vibora 0.1.6

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 (311) hide show
  1. package/bin/vibora +2 -0
  2. package/bin/vibora.js +1018 -0
  3. package/dist/assets/abap-BdImnpbu.js +1 -0
  4. package/dist/assets/actionscript-3-CfeIJUat.js +1 -0
  5. package/dist/assets/ada-bCR0ucgS.js +1 -0
  6. package/dist/assets/andromeeda-C-Jbm3Hp.js +1 -0
  7. package/dist/assets/angular-html-CU67Zn6k.js +1 -0
  8. package/dist/assets/angular-ts-BwZT4LLn.js +1 -0
  9. package/dist/assets/apache-Pmp26Uib.js +1 -0
  10. package/dist/assets/apex-DDbsPZ6N.js +1 -0
  11. package/dist/assets/apl-dKokRX4l.js +1 -0
  12. package/dist/assets/applescript-Co6uUVPk.js +1 -0
  13. package/dist/assets/ara-BRHolxvo.js +1 -0
  14. package/dist/assets/asciidoc-Dv7Oe6Be.js +1 -0
  15. package/dist/assets/asm-D_Q5rh1f.js +1 -0
  16. package/dist/assets/astro-CbQHKStN.js +1 -0
  17. package/dist/assets/aurora-x-D-2ljcwZ.js +1 -0
  18. package/dist/assets/awk-DMzUqQB5.js +1 -0
  19. package/dist/assets/ayu-dark-Cv9koXgw.js +1 -0
  20. package/dist/assets/ballerina-BFfxhgS-.js +1 -0
  21. package/dist/assets/bat-BkioyH1T.js +1 -0
  22. package/dist/assets/beancount-k_qm7-4y.js +1 -0
  23. package/dist/assets/berry-uYugtg8r.js +1 -0
  24. package/dist/assets/bibtex-CHM0blh-.js +1 -0
  25. package/dist/assets/bicep-Bmn6On1c.js +1 -0
  26. package/dist/assets/blade-DVc8C-J4.js +1 -0
  27. package/dist/assets/bsl-BO_Y6i37.js +1 -0
  28. package/dist/assets/c-BIGW1oBm.js +1 -0
  29. package/dist/assets/cadence-Bv_4Rxtq.js +1 -0
  30. package/dist/assets/cairo-KRGpt6FW.js +1 -0
  31. package/dist/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  32. package/dist/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  33. package/dist/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  34. package/dist/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  35. package/dist/assets/clarity-D53aC0YG.js +1 -0
  36. package/dist/assets/clojure-P80f7IUj.js +1 -0
  37. package/dist/assets/cmake-D1j8_8rp.js +1 -0
  38. package/dist/assets/cobol-nwyudZeR.js +1 -0
  39. package/dist/assets/codeowners-Bp6g37R7.js +1 -0
  40. package/dist/assets/codeql-DsOJ9woJ.js +1 -0
  41. package/dist/assets/coffee-Ch7k5sss.js +1 -0
  42. package/dist/assets/common-lisp-Cg-RD9OK.js +1 -0
  43. package/dist/assets/coq-DkFqJrB1.js +1 -0
  44. package/dist/assets/cpp-CofmeUqb.js +1 -0
  45. package/dist/assets/crystal-tKQVLTB8.js +1 -0
  46. package/dist/assets/csharp-K5feNrxe.js +1 -0
  47. package/dist/assets/css-DPfMkruS.js +1 -0
  48. package/dist/assets/csv-fuZLfV_i.js +1 -0
  49. package/dist/assets/cue-D82EKSYY.js +1 -0
  50. package/dist/assets/cypher-COkxafJQ.js +1 -0
  51. package/dist/assets/d-85-TOEBH.js +1 -0
  52. package/dist/assets/dark-plus-C3mMm8J8.js +1 -0
  53. package/dist/assets/dart-CF10PKvl.js +1 -0
  54. package/dist/assets/dax-CEL-wOlO.js +1 -0
  55. package/dist/assets/desktop-BmXAJ9_W.js +1 -0
  56. package/dist/assets/diff-D97Zzqfu.js +1 -0
  57. package/dist/assets/docker-BcOcwvcX.js +1 -0
  58. package/dist/assets/dotenv-Da5cRb03.js +1 -0
  59. package/dist/assets/dracula-BzJJZx-M.js +1 -0
  60. package/dist/assets/dracula-soft-BXkSAIEj.js +1 -0
  61. package/dist/assets/dream-maker-BtqSS_iP.js +1 -0
  62. package/dist/assets/edge-BkV0erSs.js +1 -0
  63. package/dist/assets/elixir-CDX3lj18.js +1 -0
  64. package/dist/assets/elm-DbKCFpqz.js +1 -0
  65. package/dist/assets/emacs-lisp-C9XAeP06.js +1 -0
  66. package/dist/assets/erb-BOJIQeun.js +1 -0
  67. package/dist/assets/erlang-DsQrWhSR.js +1 -0
  68. package/dist/assets/everforest-dark-BgDCqdQA.js +1 -0
  69. package/dist/assets/everforest-light-C8M2exoo.js +1 -0
  70. package/dist/assets/fennel-BYunw83y.js +1 -0
  71. package/dist/assets/fish-BvzEVeQv.js +1 -0
  72. package/dist/assets/fluent-C4IJs8-o.js +1 -0
  73. package/dist/assets/fortran-fixed-form-BZjJHVRy.js +1 -0
  74. package/dist/assets/fortran-free-form-D22FLkUw.js +1 -0
  75. package/dist/assets/fsharp-CXgrBDvD.js +1 -0
  76. package/dist/assets/gdresource-B7Tvp0Sc.js +1 -0
  77. package/dist/assets/gdscript-DTMYz4Jt.js +1 -0
  78. package/dist/assets/gdshader-DkwncUOv.js +1 -0
  79. package/dist/assets/genie-D0YGMca9.js +1 -0
  80. package/dist/assets/gherkin-DyxjwDmM.js +1 -0
  81. package/dist/assets/git-commit-F4YmCXRG.js +1 -0
  82. package/dist/assets/git-rebase-r7XF79zn.js +1 -0
  83. package/dist/assets/github-dark-DHJKELXO.js +1 -0
  84. package/dist/assets/github-dark-default-Cuk6v7N8.js +1 -0
  85. package/dist/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  86. package/dist/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  87. package/dist/assets/github-light-DAi9KRSo.js +1 -0
  88. package/dist/assets/github-light-default-D7oLnXFd.js +1 -0
  89. package/dist/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  90. package/dist/assets/gleam-BspZqrRM.js +1 -0
  91. package/dist/assets/glimmer-js-Rg0-pVw9.js +1 -0
  92. package/dist/assets/glimmer-ts-U6CK756n.js +1 -0
  93. package/dist/assets/glsl-DplSGwfg.js +1 -0
  94. package/dist/assets/gnuplot-DdkO51Og.js +1 -0
  95. package/dist/assets/go-Dn2_MT6a.js +1 -0
  96. package/dist/assets/graphql-ChdNCCLP.js +1 -0
  97. package/dist/assets/groovy-gcz8RCvz.js +1 -0
  98. package/dist/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  99. package/dist/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  100. package/dist/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  101. package/dist/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  102. package/dist/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  103. package/dist/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  104. package/dist/assets/hack-CaT9iCJl.js +1 -0
  105. package/dist/assets/haml-B8DHNrY2.js +1 -0
  106. package/dist/assets/handlebars-BL8al0AC.js +1 -0
  107. package/dist/assets/haskell-Df6bDoY_.js +1 -0
  108. package/dist/assets/haxe-CzTSHFRz.js +1 -0
  109. package/dist/assets/hcl-BWvSN4gD.js +1 -0
  110. package/dist/assets/hjson-D5-asLiD.js +1 -0
  111. package/dist/assets/hlsl-D3lLCCz7.js +1 -0
  112. package/dist/assets/houston-DnULxvSX.js +1 -0
  113. package/dist/assets/html-GMplVEZG.js +1 -0
  114. package/dist/assets/html-derivative-BFtXZ54Q.js +1 -0
  115. package/dist/assets/http-jrhK8wxY.js +1 -0
  116. package/dist/assets/hurl-irOxFIW8.js +1 -0
  117. package/dist/assets/hxml-Bvhsp5Yf.js +1 -0
  118. package/dist/assets/hy-DFXneXwc.js +1 -0
  119. package/dist/assets/imba-DGztddWO.js +1 -0
  120. package/dist/assets/index-BNhD6i8B.js +45 -0
  121. package/dist/assets/index-Co_u49xL.css +1 -0
  122. package/dist/assets/ini-BEwlwnbL.js +1 -0
  123. package/dist/assets/java-CylS5w8V.js +1 -0
  124. package/dist/assets/javascript-wDzz0qaB.js +1 -0
  125. package/dist/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  126. package/dist/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  127. package/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  128. package/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  129. package/dist/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  130. package/dist/assets/jinja-4LBKfQ-Z.js +1 -0
  131. package/dist/assets/jison-wvAkD_A8.js +1 -0
  132. package/dist/assets/json-Cp-IABpG.js +1 -0
  133. package/dist/assets/json5-C9tS-k6U.js +1 -0
  134. package/dist/assets/jsonc-Des-eS-w.js +1 -0
  135. package/dist/assets/jsonl-DcaNXYhu.js +1 -0
  136. package/dist/assets/jsonnet-DFQXde-d.js +1 -0
  137. package/dist/assets/jssm-C2t-YnRu.js +1 -0
  138. package/dist/assets/jsx-g9-lgVsj.js +1 -0
  139. package/dist/assets/julia-C8NyazO9.js +1 -0
  140. package/dist/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  141. package/dist/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  142. package/dist/assets/kanagawa-wave-DWedfzmr.js +1 -0
  143. package/dist/assets/kdl-DV7GczEv.js +1 -0
  144. package/dist/assets/kotlin-BdnUsdx6.js +1 -0
  145. package/dist/assets/kusto-BvAqAH-y.js +1 -0
  146. package/dist/assets/laserwave-DUszq2jm.js +1 -0
  147. package/dist/assets/latex-BdAV_C_H.js +1 -0
  148. package/dist/assets/lean-Bc6EcWN3.js +1 -0
  149. package/dist/assets/less-B1dDrJ26.js +1 -0
  150. package/dist/assets/light-plus-B7mTdjB0.js +1 -0
  151. package/dist/assets/liquid-DYVedYrR.js +1 -0
  152. package/dist/assets/llvm-BtvRca6l.js +1 -0
  153. package/dist/assets/log-2UxHyX5q.js +1 -0
  154. package/dist/assets/logo-BtOb2qkB.js +1 -0
  155. package/dist/assets/lua-BbnMAYS6.js +1 -0
  156. package/dist/assets/luau-CXu1NL6O.js +1 -0
  157. package/dist/assets/make-CHLpvVh8.js +1 -0
  158. package/dist/assets/markdown-Cvjx9yec.js +1 -0
  159. package/dist/assets/marko-CPi9NSCl.js +1 -0
  160. package/dist/assets/material-theme-D5KoaKCx.js +1 -0
  161. package/dist/assets/material-theme-darker-BfHTSMKl.js +1 -0
  162. package/dist/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  163. package/dist/assets/material-theme-ocean-CyktbL80.js +1 -0
  164. package/dist/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  165. package/dist/assets/matlab-D7o27uSR.js +1 -0
  166. package/dist/assets/mdc-DUICxH0z.js +1 -0
  167. package/dist/assets/mdx-Cmh6b_Ma.js +1 -0
  168. package/dist/assets/mermaid-DKYwYmdq.js +1 -0
  169. package/dist/assets/min-dark-CafNBF8u.js +1 -0
  170. package/dist/assets/min-light-CTRr51gU.js +1 -0
  171. package/dist/assets/mipsasm-CKIfxQSi.js +1 -0
  172. package/dist/assets/mojo-1DNp92w6.js +1 -0
  173. package/dist/assets/monokai-D4h5O-jR.js +1 -0
  174. package/dist/assets/move-Bu9oaDYs.js +1 -0
  175. package/dist/assets/narrat-DRg8JJMk.js +1 -0
  176. package/dist/assets/nextflow-BrzmwbiE.js +1 -0
  177. package/dist/assets/nginx-DknmC5AR.js +1 -0
  178. package/dist/assets/night-owl-C39BiMTA.js +1 -0
  179. package/dist/assets/nim-CVrawwO9.js +1 -0
  180. package/dist/assets/nix-c8nO5XWb.js +1 -0
  181. package/dist/assets/nord-Ddv68eIx.js +1 -0
  182. package/dist/assets/nushell-C-sUppwS.js +1 -0
  183. package/dist/assets/objective-c-DXmwc3jG.js +1 -0
  184. package/dist/assets/objective-cpp-CLxacb5B.js +1 -0
  185. package/dist/assets/ocaml-C0hk2d4L.js +1 -0
  186. package/dist/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  187. package/dist/assets/one-light-PoHY5YXO.js +1 -0
  188. package/dist/assets/openscad-C4EeE6gA.js +1 -0
  189. package/dist/assets/pascal-D93ZcfNL.js +1 -0
  190. package/dist/assets/perl-C0TMdlhV.js +1 -0
  191. package/dist/assets/php-CDn_0X-4.js +1 -0
  192. package/dist/assets/pkl-u5AG7uiY.js +1 -0
  193. package/dist/assets/plastic-3e1v2bzS.js +1 -0
  194. package/dist/assets/plsql-ChMvpjG-.js +1 -0
  195. package/dist/assets/po-BTJTHyun.js +1 -0
  196. package/dist/assets/poimandres-CS3Unz2-.js +1 -0
  197. package/dist/assets/polar-C0HS_06l.js +1 -0
  198. package/dist/assets/postcss-CXtECtnM.js +1 -0
  199. package/dist/assets/powerquery-CEu0bR-o.js +1 -0
  200. package/dist/assets/powershell-Dpen1YoG.js +1 -0
  201. package/dist/assets/prisma-Dd19v3D-.js +1 -0
  202. package/dist/assets/prolog-CbFg5uaA.js +1 -0
  203. package/dist/assets/proto-DyJlTyXw.js +1 -0
  204. package/dist/assets/pug-CGlum2m_.js +1 -0
  205. package/dist/assets/puppet-BMWR74SV.js +1 -0
  206. package/dist/assets/purescript-CklMAg4u.js +1 -0
  207. package/dist/assets/python-B6aJPvgy.js +1 -0
  208. package/dist/assets/qml-3beO22l8.js +1 -0
  209. package/dist/assets/qmldir-C8lEn-DE.js +1 -0
  210. package/dist/assets/qss-IeuSbFQv.js +1 -0
  211. package/dist/assets/r-DiinP2Uv.js +1 -0
  212. package/dist/assets/racket-BqYA7rlc.js +1 -0
  213. package/dist/assets/raku-DXvB9xmW.js +1 -0
  214. package/dist/assets/razor-CE9lU5zL.js +1 -0
  215. package/dist/assets/red-bN70gL4F.js +1 -0
  216. package/dist/assets/reg-C-SQnVFl.js +1 -0
  217. package/dist/assets/regexp-CDVJQ6XC.js +1 -0
  218. package/dist/assets/rel-C3B-1QV4.js +1 -0
  219. package/dist/assets/riscv-BM1_JUlF.js +1 -0
  220. package/dist/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  221. package/dist/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  222. package/dist/assets/rose-pine-qdsjHGoJ.js +1 -0
  223. package/dist/assets/rosmsg-BJDFO7_C.js +1 -0
  224. package/dist/assets/rst-B0xPkSld.js +1 -0
  225. package/dist/assets/ruby-BvKwtOVI.js +1 -0
  226. package/dist/assets/rust-B1yitclQ.js +1 -0
  227. package/dist/assets/sas-cz2c8ADy.js +1 -0
  228. package/dist/assets/sass-Cj5Yp3dK.js +1 -0
  229. package/dist/assets/scala-C151Ov-r.js +1 -0
  230. package/dist/assets/scheme-C98Dy4si.js +1 -0
  231. package/dist/assets/scss-OYdSNvt2.js +1 -0
  232. package/dist/assets/sdbl-DVxCFoDh.js +1 -0
  233. package/dist/assets/shaderlab-Dg9Lc6iA.js +1 -0
  234. package/dist/assets/shellscript-Yzrsuije.js +1 -0
  235. package/dist/assets/shellsession-BADoaaVG.js +1 -0
  236. package/dist/assets/slack-dark-BthQWCQV.js +1 -0
  237. package/dist/assets/slack-ochin-DqwNpetd.js +1 -0
  238. package/dist/assets/smalltalk-BERRCDM3.js +1 -0
  239. package/dist/assets/snazzy-light-Bw305WKR.js +1 -0
  240. package/dist/assets/solarized-dark-DXbdFlpD.js +1 -0
  241. package/dist/assets/solarized-light-L9t79GZl.js +1 -0
  242. package/dist/assets/solidity-rGO070M0.js +1 -0
  243. package/dist/assets/soy-Brmx7dQM.js +1 -0
  244. package/dist/assets/sparql-rVzFXLq3.js +1 -0
  245. package/dist/assets/splunk-BtCnVYZw.js +1 -0
  246. package/dist/assets/sql-BLtJtn59.js +1 -0
  247. package/dist/assets/ssh-config-_ykCGR6B.js +1 -0
  248. package/dist/assets/stata-BH5u7GGu.js +1 -0
  249. package/dist/assets/stylus-BEDo0Tqx.js +1 -0
  250. package/dist/assets/svelte-3Dk4HxPD.js +1 -0
  251. package/dist/assets/swift-Dg5xB15N.js +1 -0
  252. package/dist/assets/synthwave-84-CbfX1IO0.js +1 -0
  253. package/dist/assets/system-verilog-CnnmHF94.js +1 -0
  254. package/dist/assets/systemd-4A_iFExJ.js +1 -0
  255. package/dist/assets/talonscript-CkByrt1z.js +1 -0
  256. package/dist/assets/tasl-QIJgUcNo.js +1 -0
  257. package/dist/assets/tcl-dwOrl1Do.js +1 -0
  258. package/dist/assets/templ-W15q3VgB.js +1 -0
  259. package/dist/assets/terraform-BETggiCN.js +1 -0
  260. package/dist/assets/tex-CxkMU7Pf.js +1 -0
  261. package/dist/assets/tokyo-night-hegEt444.js +1 -0
  262. package/dist/assets/toml-vGWfd6FD.js +1 -0
  263. package/dist/assets/ts-tags-zn1MmPIZ.js +1 -0
  264. package/dist/assets/tsv-B_m7g4N7.js +1 -0
  265. package/dist/assets/tsx-COt5Ahok.js +1 -0
  266. package/dist/assets/turtle-BsS91CYL.js +1 -0
  267. package/dist/assets/twig-CO9l9SDP.js +1 -0
  268. package/dist/assets/typescript-BPQ3VLAy.js +1 -0
  269. package/dist/assets/typespec-BGHnOYBU.js +1 -0
  270. package/dist/assets/typst-DHCkPAjA.js +1 -0
  271. package/dist/assets/v-BcVCzyr7.js +1 -0
  272. package/dist/assets/vala-CsfeWuGM.js +1 -0
  273. package/dist/assets/vb-D17OF-Vu.js +1 -0
  274. package/dist/assets/verilog-BQ8w6xss.js +1 -0
  275. package/dist/assets/vesper-DU1UobuO.js +1 -0
  276. package/dist/assets/vhdl-CeAyd5Ju.js +1 -0
  277. package/dist/assets/viml-CJc9bBzg.js +1 -0
  278. package/dist/assets/vitesse-black-Bkuqu6BP.js +1 -0
  279. package/dist/assets/vitesse-dark-D0r3Knsf.js +1 -0
  280. package/dist/assets/vitesse-light-CVO1_9PV.js +1 -0
  281. package/dist/assets/vue-DnHKYNfI.js +1 -0
  282. package/dist/assets/vue-html-CChd_i61.js +1 -0
  283. package/dist/assets/vue-vine-8moa0y9V.js +1 -0
  284. package/dist/assets/vyper-CDx5xZoG.js +1 -0
  285. package/dist/assets/wasm-CG6Dc4jp.js +1 -0
  286. package/dist/assets/wasm-MzD3tlZU.js +1 -0
  287. package/dist/assets/wenyan-BV7otONQ.js +1 -0
  288. package/dist/assets/wgsl-Dx-B1_4e.js +1 -0
  289. package/dist/assets/wikitext-BhOHFoWU.js +1 -0
  290. package/dist/assets/wit-5i3qLPDT.js +1 -0
  291. package/dist/assets/wolfram-lXgVvXCa.js +1 -0
  292. package/dist/assets/xml-sdJ4AIDG.js +1 -0
  293. package/dist/assets/xsl-CtQFsRM5.js +1 -0
  294. package/dist/assets/yaml-Buea-lGh.js +1 -0
  295. package/dist/assets/zenscript-DVFEvuxE.js +1 -0
  296. package/dist/assets/zig-VOosw3JB.js +1 -0
  297. package/dist/favicon.ico +0 -0
  298. package/dist/index.html +15 -0
  299. package/dist/vibora-icon.png +0 -0
  300. package/dist/vibora-logo.jpeg +0 -0
  301. package/dist/vite.svg +1 -0
  302. package/drizzle/0000_jittery_bloodaxe.sql +46 -0
  303. package/drizzle/0001_soft_amphibian.sql +2 -0
  304. package/drizzle/0002_burly_tyrannus.sql +12 -0
  305. package/drizzle/meta/0000_snapshot.json +310 -0
  306. package/drizzle/meta/0001_snapshot.json +324 -0
  307. package/drizzle/meta/0002_snapshot.json +398 -0
  308. package/drizzle/meta/_journal.json +27 -0
  309. package/lib/librust_pty.so +0 -0
  310. package/package.json +25 -0
  311. package/server/index.js +139285 -0
@@ -0,0 +1,45 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
2
+ function jL(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(s,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const h of u.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function n(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=n(o);fetch(o.href,u)}})();function Rw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pg={exports:{}},Kc={};var DS;function BL(){if(DS)return Kc;DS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,o,u){var h=null;if(u!==void 0&&(h=""+u),o.key!==void 0&&(h=""+o.key),"key"in o){u={};for(var a in o)a!=="key"&&(u[a]=o[a])}else u=o;return o=u.ref,{$$typeof:e,type:s,key:h,ref:o!==void 0?o:null,props:u}}return Kc.Fragment=t,Kc.jsx=n,Kc.jsxs=n,Kc}var PS;function zL(){return PS||(PS=1,Pg.exports=BL()),Pg.exports}var w=zL(),Ig={exports:{}},pt={};var IS;function HL(){if(IS)return pt;IS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),h=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),g=Symbol.iterator;function b(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function _(I,G,K){this.props=I,this.context=G,this.refs=y,this.updater=K||C}_.prototype.isReactComponent={},_.prototype.setState=function(I,G){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,G,"setState")},_.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function v(){}v.prototype=_.prototype;function S(I,G,K){this.props=I,this.context=G,this.refs=y,this.updater=K||C}var E=S.prototype=new v;E.constructor=S,x(E,_.prototype),E.isPureReactComponent=!0;var T=Array.isArray;function A(){}var M={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function D(I,G,K){var J=K.ref;return{$$typeof:e,type:I,key:G,ref:J!==void 0?J:null,props:K}}function U(I,G){return D(I.type,G,I.props)}function z(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function W(I){var G={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(K){return G[K]})}var N=/\/+/g;function Y(I,G){return typeof I=="object"&&I!==null&&I.key!=null?W(""+I.key):G.toString(36)}function $(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(A,A):(I.status="pending",I.then(function(G){I.status==="pending"&&(I.status="fulfilled",I.value=G)},function(G){I.status==="pending"&&(I.status="rejected",I.reason=G)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function F(I,G,K,J,Z){var ee=typeof I;(ee==="undefined"||ee==="boolean")&&(I=null);var X=!1;if(I===null)X=!0;else switch(ee){case"bigint":case"string":case"number":X=!0;break;case"object":switch(I.$$typeof){case e:case t:X=!0;break;case p:return X=I._init,F(X(I._payload),G,K,J,Z)}}if(X)return Z=Z(I),X=J===""?"."+Y(I,0):J,T(Z)?(K="",X!=null&&(K=X.replace(N,"$&/")+"/"),F(Z,G,K,"",function(re){return re})):Z!=null&&(z(Z)&&(Z=U(Z,K+(Z.key==null||I&&I.key===Z.key?"":(""+Z.key).replace(N,"$&/")+"/")+X)),G.push(Z)),1;X=0;var V=J===""?".":J+":";if(T(I))for(var se=0;se<I.length;se++)J=I[se],ee=V+Y(J,se),X+=F(J,G,K,ee,Z);else if(se=b(I),typeof se=="function")for(I=se.call(I),se=0;!(J=I.next()).done;)J=J.value,ee=V+Y(J,se++),X+=F(J,G,K,ee,Z);else if(ee==="object"){if(typeof I.then=="function")return F($(I),G,K,J,Z);throw G=String(I),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return X}function q(I,G,K){if(I==null)return I;var J=[],Z=0;return F(I,J,"","",function(ee){return G.call(K,ee,Z++)}),J}function H(I){if(I._status===-1){var G=I._result;G=G(),G.then(function(K){(I._status===0||I._status===-1)&&(I._status=1,I._result=K)},function(K){(I._status===0||I._status===-1)&&(I._status=2,I._result=K)}),I._status===-1&&(I._status=0,I._result=G)}if(I._status===1)return I._result.default;throw I._result}var P=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},B={map:q,forEach:function(I,G,K){q(I,function(){G.apply(this,arguments)},K)},count:function(I){var G=0;return q(I,function(){G++}),G},toArray:function(I){return q(I,function(G){return G})||[]},only:function(I){if(!z(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return pt.Activity=f,pt.Children=B,pt.Component=_,pt.Fragment=n,pt.Profiler=o,pt.PureComponent=S,pt.StrictMode=s,pt.Suspense=c,pt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,pt.__COMPILER_RUNTIME={__proto__:null,c:function(I){return M.H.useMemoCache(I)}},pt.cache=function(I){return function(){return I.apply(null,arguments)}},pt.cacheSignal=function(){return null},pt.cloneElement=function(I,G,K){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var J=x({},I.props),Z=I.key;if(G!=null)for(ee in G.key!==void 0&&(Z=""+G.key),G)!L.call(G,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&G.ref===void 0||(J[ee]=G[ee]);var ee=arguments.length-2;if(ee===1)J.children=K;else if(1<ee){for(var X=Array(ee),V=0;V<ee;V++)X[V]=arguments[V+2];J.children=X}return D(I.type,Z,J)},pt.createContext=function(I){return I={$$typeof:h,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:u,_context:I},I},pt.createElement=function(I,G,K){var J,Z={},ee=null;if(G!=null)for(J in G.key!==void 0&&(ee=""+G.key),G)L.call(G,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(Z[J]=G[J]);var X=arguments.length-2;if(X===1)Z.children=K;else if(1<X){for(var V=Array(X),se=0;se<X;se++)V[se]=arguments[se+2];Z.children=V}if(I&&I.defaultProps)for(J in X=I.defaultProps,X)Z[J]===void 0&&(Z[J]=X[J]);return D(I,ee,Z)},pt.createRef=function(){return{current:null}},pt.forwardRef=function(I){return{$$typeof:a,render:I}},pt.isValidElement=z,pt.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:H}},pt.memo=function(I,G){return{$$typeof:d,type:I,compare:G===void 0?null:G}},pt.startTransition=function(I){var G=M.T,K={};M.T=K;try{var J=I(),Z=M.S;Z!==null&&Z(K,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(A,P)}catch(ee){P(ee)}finally{G!==null&&K.types!==null&&(G.types=K.types),M.T=G}},pt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},pt.use=function(I){return M.H.use(I)},pt.useActionState=function(I,G,K){return M.H.useActionState(I,G,K)},pt.useCallback=function(I,G){return M.H.useCallback(I,G)},pt.useContext=function(I){return M.H.useContext(I)},pt.useDebugValue=function(){},pt.useDeferredValue=function(I,G){return M.H.useDeferredValue(I,G)},pt.useEffect=function(I,G){return M.H.useEffect(I,G)},pt.useEffectEvent=function(I){return M.H.useEffectEvent(I)},pt.useId=function(){return M.H.useId()},pt.useImperativeHandle=function(I,G,K){return M.H.useImperativeHandle(I,G,K)},pt.useInsertionEffect=function(I,G){return M.H.useInsertionEffect(I,G)},pt.useLayoutEffect=function(I,G){return M.H.useLayoutEffect(I,G)},pt.useMemo=function(I,G){return M.H.useMemo(I,G)},pt.useOptimistic=function(I,G){return M.H.useOptimistic(I,G)},pt.useReducer=function(I,G,K){return M.H.useReducer(I,G,K)},pt.useRef=function(I){return M.H.useRef(I)},pt.useState=function(I){return M.H.useState(I)},pt.useSyncExternalStore=function(I,G,K){return M.H.useSyncExternalStore(I,G,K)},pt.useTransition=function(){return M.H.useTransition()},pt.version="19.2.3",pt}var NS;function Iu(){return NS||(NS=1,Ig.exports=HL()),Ig.exports}var k=Iu();const Ie=Rw(k),kw=jL({__proto__:null,default:Ie},[k]);var Ng={exports:{}},Yc={},jg={exports:{}},Bg={};var jS;function VL(){return jS||(jS=1,(function(e){function t(F,q){var H=F.length;F.push(q);e:for(;0<H;){var P=H-1>>>1,B=F[P];if(0<o(B,q))F[P]=q,F[H]=B,H=P;else break e}}function n(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var q=F[0],H=F.pop();if(H!==q){F[0]=H;e:for(var P=0,B=F.length,I=B>>>1;P<I;){var G=2*(P+1)-1,K=F[G],J=G+1,Z=F[J];if(0>o(K,H))J<B&&0>o(Z,K)?(F[P]=Z,F[J]=H,P=J):(F[P]=K,F[G]=H,P=G);else if(J<B&&0>o(Z,H))F[P]=Z,F[J]=H,P=J;else break e}}return q}function o(F,q){var H=F.sortIndex-q.sortIndex;return H!==0?H:F.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var h=Date,a=h.now();e.unstable_now=function(){return h.now()-a}}var c=[],d=[],p=1,f=null,g=3,b=!1,C=!1,x=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function E(F){for(var q=n(d);q!==null;){if(q.callback===null)s(d);else if(q.startTime<=F)s(d),q.sortIndex=q.expirationTime,t(c,q);else break;q=n(d)}}function T(F){if(x=!1,E(F),!C)if(n(c)!==null)C=!0,A||(A=!0,W());else{var q=n(d);q!==null&&$(T,q.startTime-F)}}var A=!1,M=-1,L=5,D=-1;function U(){return y?!0:!(e.unstable_now()-D<L)}function z(){if(y=!1,A){var F=e.unstable_now();D=F;var q=!0;try{e:{C=!1,x&&(x=!1,v(M),M=-1),b=!0;var H=g;try{t:{for(E(F),f=n(c);f!==null&&!(f.expirationTime>F&&U());){var P=f.callback;if(typeof P=="function"){f.callback=null,g=f.priorityLevel;var B=P(f.expirationTime<=F);if(F=e.unstable_now(),typeof B=="function"){f.callback=B,E(F),q=!0;break t}f===n(c)&&s(c),E(F)}else s(c);f=n(c)}if(f!==null)q=!0;else{var I=n(d);I!==null&&$(T,I.startTime-F),q=!1}}break e}finally{f=null,g=H,b=!1}q=void 0}}finally{q?W():A=!1}}}var W;if(typeof S=="function")W=function(){S(z)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,Y=N.port2;N.port1.onmessage=z,W=function(){Y.postMessage(null)}}else W=function(){_(z,0)};function $(F,q){M=_(function(){F(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(F){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var H=g;g=q;try{return F()}finally{g=H}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(F,q){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var H=g;g=F;try{return q()}finally{g=H}},e.unstable_scheduleCallback=function(F,q,H){var P=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?P+H:P):H=P,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=H+B,F={id:p++,callback:q,priorityLevel:F,startTime:H,expirationTime:B,sortIndex:-1},H>P?(F.sortIndex=H,t(d,F),n(c)===null&&F===n(d)&&(x?(v(M),M=-1):x=!0,$(T,H-P))):(F.sortIndex=B,t(c,F),C||b||(C=!0,A||(A=!0,W()))),F},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(F){var q=g;return function(){var H=g;g=q;try{return F.apply(this,arguments)}finally{g=H}}}})(Bg)),Bg}var BS;function FL(){return BS||(BS=1,jg.exports=VL()),jg.exports}var zg={exports:{}},$n={};var zS;function UL(){if(zS)return $n;zS=1;var e=Iu();function t(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(c,d,p){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:f==null?null:""+f,children:c,containerInfo:d,implementation:p}}var h=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(c,d){if(c==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return $n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,$n.createPortal=function(c,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return u(c,d,null,p)},$n.flushSync=function(c){var d=h.T,p=s.p;try{if(h.T=null,s.p=2,c)return c()}finally{h.T=d,s.p=p,s.d.f()}},$n.preconnect=function(c,d){typeof c=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(c,d))},$n.prefetchDNS=function(c){typeof c=="string"&&s.d.D(c)},$n.preinit=function(c,d){if(typeof c=="string"&&d&&typeof d.as=="string"){var p=d.as,f=a(p,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?s.d.S(c,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:f,integrity:g,fetchPriority:b}):p==="script"&&s.d.X(c,{crossOrigin:f,integrity:g,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},$n.preinitModule=function(c,d){if(typeof c=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=a(d.as,d.crossOrigin);s.d.M(c,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&s.d.M(c)},$n.preload=function(c,d){if(typeof c=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,f=a(p,d.crossOrigin);s.d.L(c,p,{crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},$n.preloadModule=function(c,d){if(typeof c=="string")if(d){var p=a(d.as,d.crossOrigin);s.d.m(c,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else s.d.m(c)},$n.requestFormReset=function(c){s.d.r(c)},$n.unstable_batchedUpdates=function(c,d){return c(d)},$n.useFormState=function(c,d,p){return h.H.useFormState(c,d,p)},$n.useFormStatus=function(){return h.H.useHostTransitionStatus()},$n.version="19.2.3",$n}var HS;function Tw(){if(HS)return zg.exports;HS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zg.exports=UL(),zg.exports}var VS;function WL(){if(VS)return Yc;VS=1;var e=FL(),t=Iu(),n=Tw();function s(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function h(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function a(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function c(r){if(u(r)!==r)throw Error(s(188))}function d(r){var i=r.alternate;if(!i){if(i=u(r),i===null)throw Error(s(188));return i!==r?null:r}for(var l=r,m=i;;){var R=l.return;if(R===null)break;var O=R.alternate;if(O===null){if(m=R.return,m!==null){l=m;continue}break}if(R.child===O.child){for(O=R.child;O;){if(O===l)return c(R),r;if(O===m)return c(R),i;O=O.sibling}throw Error(s(188))}if(l.return!==m.return)l=R,m=O;else{for(var j=!1,Q=R.child;Q;){if(Q===l){j=!0,l=R,m=O;break}if(Q===m){j=!0,m=R,l=O;break}Q=Q.sibling}if(!j){for(Q=O.child;Q;){if(Q===l){j=!0,l=O,m=R;break}if(Q===m){j=!0,m=O,l=R;break}Q=Q.sibling}if(!j)throw Error(s(189))}}if(l.alternate!==m)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?r:i}function p(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=p(r),i!==null)return i;r=r.sibling}return null}var f=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function W(r){return r===null||typeof r!="object"?null:(r=z&&r[z]||r["@@iterator"],typeof r=="function"?r:null)}var N=Symbol.for("react.client.reference");function Y(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===N?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case x:return"Fragment";case _:return"Profiler";case y:return"StrictMode";case T:return"Suspense";case A:return"SuspenseList";case D:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case C:return"Portal";case S:return r.displayName||"Context";case v:return(r._context.displayName||"Context")+".Consumer";case E:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case M:return i=r.displayName||null,i!==null?i:Y(r.type)||"Memo";case L:i=r._payload,r=r._init;try{return Y(r(i))}catch{}}return null}var $=Array.isArray,F=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},P=[],B=-1;function I(r){return{current:r}}function G(r){0>B||(r.current=P[B],P[B]=null,B--)}function K(r,i){B++,P[B]=r.current,r.current=i}var J=I(null),Z=I(null),ee=I(null),X=I(null);function V(r,i){switch(K(ee,i),K(Z,r),K(J,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?nS(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=nS(i),r=rS(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}G(J),K(J,r)}function se(){G(J),G(Z),G(ee)}function re(r){r.memoizedState!==null&&K(X,r);var i=J.current,l=rS(i,r.type);i!==l&&(K(Z,r),K(J,l))}function ne(r){Z.current===r&&(G(J),G(Z)),X.current===r&&(G(X),Wc._currentValue=H)}var oe,ce;function ve(r){if(oe===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);oe=i&&i[1]||"",ce=-1<l.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+oe+r+ce}var ge=!1;function he(r,i){if(!r||ge)return"";ge=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(i){var ke=function(){throw Error()};if(Object.defineProperty(ke.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ke,[])}catch(_e){var me=_e}Reflect.construct(r,[],ke)}else{try{ke.call()}catch(_e){me=_e}r.call(ke.prototype)}}else{try{throw Error()}catch(_e){me=_e}(ke=r())&&typeof ke.catch=="function"&&ke.catch(function(){})}}catch(_e){if(_e&&me&&typeof _e.stack=="string")return[_e.stack,me.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=m.DetermineComponentFrameRoot(),j=O[0],Q=O[1];if(j&&Q){var ie=j.split(`
5
+ `),pe=Q.split(`
6
+ `);for(R=m=0;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;for(;R<pe.length&&!pe[R].includes("DetermineComponentFrameRoot");)R++;if(m===ie.length||R===pe.length)for(m=ie.length-1,R=pe.length-1;1<=m&&0<=R&&ie[m]!==pe[R];)R--;for(;1<=m&&0<=R;m--,R--)if(ie[m]!==pe[R]){if(m!==1||R!==1)do if(m--,R--,0>R||ie[m]!==pe[R]){var Se=`
7
+ `+ie[m].replace(" at new "," at ");return r.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",r.displayName)),Se}while(1<=m&&0<=R);break}}}finally{ge=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?ve(l):""}function de(r,i){switch(r.tag){case 26:case 27:case 5:return ve(r.type);case 16:return ve("Lazy");case 13:return r.child!==i&&i!==null?ve("Suspense Fallback"):ve("Suspense");case 19:return ve("SuspenseList");case 0:case 15:return he(r.type,!1);case 11:return he(r.type.render,!1);case 1:return he(r.type,!0);case 31:return ve("Activity");default:return""}}function Le(r){try{var i="",l=null;do i+=de(r,l),l=r,r=r.return;while(r);return i}catch(m){return`
8
+ Error generating stack: `+m.message+`
9
+ `+m.stack}}var Oe=Object.prototype.hasOwnProperty,Ne=e.unstable_scheduleCallback,ye=e.unstable_cancelCallback,Ae=e.unstable_shouldYield,ae=e.unstable_requestPaint,be=e.unstable_now,Ce=e.unstable_getCurrentPriorityLevel,We=e.unstable_ImmediatePriority,rt=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,Me=e.unstable_LowPriority,He=e.unstable_IdlePriority,dt=e.log,$e=e.unstable_setDisableYieldValue,et=null,Re=null;function tt(r){if(typeof dt=="function"&&$e(r),Re&&typeof Re.setStrictMode=="function")try{Re.setStrictMode(et,r)}catch{}}var at=Math.clz32?Math.clz32:Ct,Xe=Math.log,st=Math.LN2;function Ct(r){return r>>>=0,r===0?32:31-(Xe(r)/st|0)|0}var lt=256,tn=262144,kt=4194304;function vt(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Je(r,i,l){var m=r.pendingLanes;if(m===0)return 0;var R=0,O=r.suspendedLanes,j=r.pingedLanes;r=r.warmLanes;var Q=m&134217727;return Q!==0?(m=Q&~O,m!==0?R=vt(m):(j&=Q,j!==0?R=vt(j):l||(l=Q&~r,l!==0&&(R=vt(l))))):(Q=m&~O,Q!==0?R=vt(Q):j!==0?R=vt(j):l||(l=m&~r,l!==0&&(R=vt(l)))),R===0?0:i!==0&&i!==R&&(i&O)===0&&(O=R&-R,l=i&-i,O>=l||O===32&&(l&4194048)!==0)?i:R}function Ot(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Nt(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ot(){var r=kt;return kt<<=1,(kt&62914560)===0&&(kt=4194304),r}function wt(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function bt(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function St(r,i,l,m,R,O){var j=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var Q=r.entanglements,ie=r.expirationTimes,pe=r.hiddenUpdates;for(l=j&~l;0<l;){var Se=31-at(l),ke=1<<Se;Q[Se]=0,ie[Se]=-1;var me=pe[Se];if(me!==null)for(pe[Se]=null,Se=0;Se<me.length;Se++){var _e=me[Se];_e!==null&&(_e.lane&=-536870913)}l&=~ke}m!==0&&Qe(r,m,0),O!==0&&R===0&&r.tag!==0&&(r.suspendedLanes|=O&~(j&~i))}function Qe(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var m=31-at(i);r.entangledLanes|=i,r.entanglements[m]=r.entanglements[m]|1073741824|l&261930}function Ht(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var m=31-at(l),R=1<<m;R&i|r[m]&i&&(r[m]|=i),l&=~R}}function Cn(r,i){var l=i&-i;return l=(l&42)!==0?1:Gn(l),(l&(r.suspendedLanes|i))!==0?0:l}function Gn(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Bn(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function gs(){var r=q.p;return r!==0?r:(r=window.event,r===void 0?32:RS(r.type))}function Da(r,i){var l=q.p;try{return q.p=r,i()}finally{q.p=l}}var gr=Math.random().toString(36).slice(2),fn="__reactFiber$"+gr,hn="__reactProps$"+gr,vs="__reactContainer$"+gr,vr="__reactEvents$"+gr,Us="__reactListeners$"+gr,Tp="__reactHandles$"+gr,nc="__reactResources$"+gr,bo="__reactMarker$"+gr;function So(r){delete r[fn],delete r[hn],delete r[vr],delete r[Us],delete r[Tp]}function Ws(r){var i=r[fn];if(i)return i;for(var l=r.parentNode;l;){if(i=l[vs]||l[fn]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=uS(r);r!==null;){if(l=r[fn])return l;r=uS(r)}return i}r=l,l=r.parentNode}return null}function _s(r){if(r=r[fn]||r[vs]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function xo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(s(33))}function ss(r){var i=r[nc];return i||(i=r[nc]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function pn(r){r[bo]=!0}var Zn=new Set,Jn={};function _r(r,i){is(r,i),is(r+"Capture",i)}function is(r,i){for(Jn[r]=i,r=0;r<i.length;r++)Zn.add(i[r])}var Lp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Pa={},Ia={};function Ap(r){return Oe.call(Ia,r)?!0:Oe.call(Pa,r)?!1:Lp.test(r)?Ia[r]=!0:(Pa[r]=!0,!1)}function qs(r,i,l){if(Ap(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var m=i.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function Ei(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function yr(r,i,l,m){if(m===null)r.removeAttribute(l);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+m)}}function sr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function cd(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Op(r,i,l){var m=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var R=m.get,O=m.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return R.call(this)},set:function(j){l=""+j,O.call(this,j)}}),Object.defineProperty(r,i,{enumerable:m.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function rc(r){if(!r._valueTracker){var i=cd(r)?"checked":"value";r._valueTracker=Op(r,i,""+r[i])}}function Na(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),m="";return r&&(m=cd(r)?r.checked?"true":"false":r.value),r=m,r!==l?(i.setValue(r),!0):!1}function Ri(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var sc=/[\n"\\]/g;function ir(r){return r.replace(sc,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function ic(r,i,l,m,R,O,j,Q){r.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?r.type=j:r.removeAttribute("type"),i!=null?j==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+sr(i)):r.value!==""+sr(i)&&(r.value=""+sr(i)):j!=="submit"&&j!=="reset"||r.removeAttribute("value"),i!=null?oc(r,j,sr(i)):l!=null?oc(r,j,sr(l)):m!=null&&r.removeAttribute("value"),R==null&&O!=null&&(r.defaultChecked=!!O),R!=null&&(r.checked=R&&typeof R!="function"&&typeof R!="symbol"),Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?r.name=""+sr(Q):r.removeAttribute("name")}function ud(r,i,l,m,R,O,j,Q){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(r.type=O),i!=null||l!=null){if(!(O!=="submit"&&O!=="reset"||i!=null)){rc(r);return}l=l!=null?""+sr(l):"",i=i!=null?""+sr(i):l,Q||i===r.value||(r.value=i),r.defaultValue=i}m=m??R,m=typeof m!="function"&&typeof m!="symbol"&&!!m,r.checked=Q?r.checked:!!m,r.defaultChecked=!!m,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(r.name=j),rc(r)}function oc(r,i,l){i==="number"&&Ri(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function ki(r,i,l,m){if(r=r.options,i){i={};for(var R=0;R<l.length;R++)i["$"+l[R]]=!0;for(l=0;l<r.length;l++)R=i.hasOwnProperty("$"+r[l].value),r[l].selected!==R&&(r[l].selected=R),R&&m&&(r[l].defaultSelected=!0)}else{for(l=""+sr(l),i=null,R=0;R<r.length;R++){if(r[R].value===l){r[R].selected=!0,m&&(r[R].defaultSelected=!0);return}i!==null||r[R].disabled||(i=r[R])}i!==null&&(i.selected=!0)}}function dd(r,i,l){if(i!=null&&(i=""+sr(i),i!==r.value&&(r.value=i),l==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=l!=null?""+sr(l):""}function Fe(r,i,l,m){if(i==null){if(m!=null){if(l!=null)throw Error(s(92));if($(m)){if(1<m.length)throw Error(s(93));m=m[0]}l=m}l==null&&(l=""),i=l}l=sr(i),r.defaultValue=l,m=r.textContent,m===l&&m!==""&&m!==null&&(r.value=m),rc(r)}function nt(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var mt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Gt(r,i,l){var m=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?m?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":m?r.setProperty(i,l):typeof l!="number"||l===0||mt.has(i)?i==="float"?r.cssFloat=l:r[i]=(""+l).trim():r[i]=l+"px"}function nn(r,i,l){if(i!=null&&typeof i!="object")throw Error(s(62));if(r=r.style,l!=null){for(var m in l)!l.hasOwnProperty(m)||i!=null&&i.hasOwnProperty(m)||(m.indexOf("--")===0?r.setProperty(m,""):m==="float"?r.cssFloat="":r[m]="");for(var R in i)m=i[R],i.hasOwnProperty(R)&&l[R]!==m&&Gt(r,R,m)}else for(var O in i)i.hasOwnProperty(O)&&Gt(r,O,i[O])}function mn(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Gs=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$s=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ks(r){return $s.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function os(){}var fd=null;function Mp(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ja=null,Ba=null;function ty(r){var i=_s(r);if(i&&(r=i.stateNode)){var l=r[hn]||null;e:switch(r=i.stateNode,i.type){case"input":if(ic(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+ir(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var m=l[i];if(m!==r&&m.form===r.form){var R=m[hn]||null;if(!R)throw Error(s(90));ic(m,R.value,R.defaultValue,R.defaultValue,R.checked,R.defaultChecked,R.type,R.name)}}for(i=0;i<l.length;i++)m=l[i],m.form===r.form&&Na(m)}break e;case"textarea":dd(r,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&ki(r,!!l.multiple,i,!1)}}}var Dp=!1;function ny(r,i,l){if(Dp)return r(i,l);Dp=!0;try{var m=r(i);return m}finally{if(Dp=!1,(ja!==null||Ba!==null)&&(Jd(),ja&&(i=ja,r=Ba,Ba=ja=null,ty(i),r)))for(i=0;i<r.length;i++)ty(r[i])}}function ac(r,i){var l=r.stateNode;if(l===null)return null;var m=l[hn]||null;if(m===null)return null;l=m[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(r=r.type,m=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!m;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(s(231,i,typeof l));return l}var Ys=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pp=!1;if(Ys)try{var lc={};Object.defineProperty(lc,"passive",{get:function(){Pp=!0}}),window.addEventListener("test",lc,lc),window.removeEventListener("test",lc,lc)}catch{Pp=!1}var Ti=null,Ip=null,hd=null;function ry(){if(hd)return hd;var r,i=Ip,l=i.length,m,R="value"in Ti?Ti.value:Ti.textContent,O=R.length;for(r=0;r<l&&i[r]===R[r];r++);var j=l-r;for(m=1;m<=j&&i[l-m]===R[O-m];m++);return hd=R.slice(r,1<m?1-m:void 0)}function pd(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function md(){return!0}function sy(){return!1}function or(r){function i(l,m,R,O,j){this._reactName=l,this._targetInst=R,this.type=m,this.nativeEvent=O,this.target=j,this.currentTarget=null;for(var Q in r)r.hasOwnProperty(Q)&&(l=r[Q],this[Q]=l?l(O):O[Q]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?md:sy,this.isPropagationStopped=sy,this}return f(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=md)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=md)},persist:function(){},isPersistent:md}),i}var Co={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gd=or(Co),cc=f({},Co,{view:0,detail:0}),IT=or(cc),Np,jp,uc,vd=f({},cc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zp,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==uc&&(uc&&r.type==="mousemove"?(Np=r.screenX-uc.screenX,jp=r.screenY-uc.screenY):jp=Np=0,uc=r),Np)},movementY:function(r){return"movementY"in r?r.movementY:jp}}),iy=or(vd),NT=f({},vd,{dataTransfer:0}),jT=or(NT),BT=f({},cc,{relatedTarget:0}),Bp=or(BT),zT=f({},Co,{animationName:0,elapsedTime:0,pseudoElement:0}),HT=or(zT),VT=f({},Co,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),FT=or(VT),UT=f({},Co,{data:0}),oy=or(UT),WT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},GT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $T(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=GT[r])?!!i[r]:!1}function zp(){return $T}var KT=f({},cc,{key:function(r){if(r.key){var i=WT[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=pd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?qT[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zp,charCode:function(r){return r.type==="keypress"?pd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?pd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),YT=or(KT),XT=f({},vd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ay=or(XT),QT=f({},cc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zp}),ZT=or(QT),JT=f({},Co,{propertyName:0,elapsedTime:0,pseudoElement:0}),e5=or(JT),t5=f({},vd,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),n5=or(t5),r5=f({},Co,{newState:0,oldState:0}),s5=or(r5),i5=[9,13,27,32],Hp=Ys&&"CompositionEvent"in window,dc=null;Ys&&"documentMode"in document&&(dc=document.documentMode);var o5=Ys&&"TextEvent"in window&&!dc,ly=Ys&&(!Hp||dc&&8<dc&&11>=dc),cy=" ",uy=!1;function dy(r,i){switch(r){case"keyup":return i5.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fy(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var za=!1;function a5(r,i){switch(r){case"compositionend":return fy(i);case"keypress":return i.which!==32?null:(uy=!0,cy);case"textInput":return r=i.data,r===cy&&uy?null:r;default:return null}}function l5(r,i){if(za)return r==="compositionend"||!Hp&&dy(r,i)?(r=ry(),hd=Ip=Ti=null,za=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return ly&&i.locale!=="ko"?null:i.data;default:return null}}var c5={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function hy(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!c5[r.type]:i==="textarea"}function py(r,i,l,m){ja?Ba?Ba.push(m):Ba=[m]:ja=m,i=af(i,"onChange"),0<i.length&&(l=new gd("onChange","change",null,l,m),r.push({event:l,listeners:i}))}var fc=null,hc=null;function u5(r){X1(r,0)}function _d(r){var i=xo(r);if(Na(i))return r}function my(r,i){if(r==="change")return i}var gy=!1;if(Ys){var Vp;if(Ys){var Fp="oninput"in document;if(!Fp){var vy=document.createElement("div");vy.setAttribute("oninput","return;"),Fp=typeof vy.oninput=="function"}Vp=Fp}else Vp=!1;gy=Vp&&(!document.documentMode||9<document.documentMode)}function _y(){fc&&(fc.detachEvent("onpropertychange",yy),hc=fc=null)}function yy(r){if(r.propertyName==="value"&&_d(hc)){var i=[];py(i,hc,r,Mp(r)),ny(u5,i)}}function d5(r,i,l){r==="focusin"?(_y(),fc=i,hc=l,fc.attachEvent("onpropertychange",yy)):r==="focusout"&&_y()}function f5(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return _d(hc)}function h5(r,i){if(r==="click")return _d(i)}function p5(r,i){if(r==="input"||r==="change")return _d(i)}function m5(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var br=typeof Object.is=="function"?Object.is:m5;function pc(r,i){if(br(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),m=Object.keys(i);if(l.length!==m.length)return!1;for(m=0;m<l.length;m++){var R=l[m];if(!Oe.call(i,R)||!br(r[R],i[R]))return!1}return!0}function by(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Sy(r,i){var l=by(r);r=0;for(var m;l;){if(l.nodeType===3){if(m=r+l.textContent.length,r<=i&&m>=i)return{node:l,offset:i-r};r=m}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=by(l)}}function xy(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?xy(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Cy(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ri(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=Ri(r.document)}return i}function Up(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var g5=Ys&&"documentMode"in document&&11>=document.documentMode,Ha=null,Wp=null,mc=null,qp=!1;function wy(r,i,l){var m=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;qp||Ha==null||Ha!==Ri(m)||(m=Ha,"selectionStart"in m&&Up(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),mc&&pc(mc,m)||(mc=m,m=af(Wp,"onSelect"),0<m.length&&(i=new gd("onSelect","select",null,i,l),r.push({event:i,listeners:m}),i.target=Ha)))}function wo(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var Va={animationend:wo("Animation","AnimationEnd"),animationiteration:wo("Animation","AnimationIteration"),animationstart:wo("Animation","AnimationStart"),transitionrun:wo("Transition","TransitionRun"),transitionstart:wo("Transition","TransitionStart"),transitioncancel:wo("Transition","TransitionCancel"),transitionend:wo("Transition","TransitionEnd")},Gp={},Ey={};Ys&&(Ey=document.createElement("div").style,"AnimationEvent"in window||(delete Va.animationend.animation,delete Va.animationiteration.animation,delete Va.animationstart.animation),"TransitionEvent"in window||delete Va.transitionend.transition);function Eo(r){if(Gp[r])return Gp[r];if(!Va[r])return r;var i=Va[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Ey)return Gp[r]=i[l];return r}var Ry=Eo("animationend"),ky=Eo("animationiteration"),Ty=Eo("animationstart"),v5=Eo("transitionrun"),_5=Eo("transitionstart"),y5=Eo("transitioncancel"),Ly=Eo("transitionend"),Ay=new Map,$p="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");$p.push("scrollEnd");function as(r,i){Ay.set(r,i),_r(i,[r])}var yd=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},zr=[],Fa=0,Kp=0;function bd(){for(var r=Fa,i=Kp=Fa=0;i<r;){var l=zr[i];zr[i++]=null;var m=zr[i];zr[i++]=null;var R=zr[i];zr[i++]=null;var O=zr[i];if(zr[i++]=null,m!==null&&R!==null){var j=m.pending;j===null?R.next=R:(R.next=j.next,j.next=R),m.pending=R}O!==0&&Oy(l,R,O)}}function Sd(r,i,l,m){zr[Fa++]=r,zr[Fa++]=i,zr[Fa++]=l,zr[Fa++]=m,Kp|=m,r.lanes|=m,r=r.alternate,r!==null&&(r.lanes|=m)}function Yp(r,i,l,m){return Sd(r,i,l,m),xd(r)}function Ro(r,i){return Sd(r,null,null,i),xd(r)}function Oy(r,i,l){r.lanes|=l;var m=r.alternate;m!==null&&(m.lanes|=l);for(var R=!1,O=r.return;O!==null;)O.childLanes|=l,m=O.alternate,m!==null&&(m.childLanes|=l),O.tag===22&&(r=O.stateNode,r===null||r._visibility&1||(R=!0)),r=O,O=O.return;return r.tag===3?(O=r.stateNode,R&&i!==null&&(R=31-at(l),r=O.hiddenUpdates,m=r[R],m===null?r[R]=[i]:m.push(i),i.lane=l|536870912),O):null}function xd(r){if(50<jc)throw jc=0,sg=null,Error(s(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ua={};function b5(r,i,l,m){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sr(r,i,l,m){return new b5(r,i,l,m)}function Xp(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Xs(r,i){var l=r.alternate;return l===null?(l=Sr(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function My(r,i){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,i=l.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Cd(r,i,l,m,R,O){var j=0;if(m=r,typeof r=="function")Xp(r)&&(j=1);else if(typeof r=="string")j=EL(r,l,J.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case D:return r=Sr(31,l,i,R),r.elementType=D,r.lanes=O,r;case x:return ko(l.children,R,O,i);case y:j=8,R|=24;break;case _:return r=Sr(12,l,i,R|2),r.elementType=_,r.lanes=O,r;case T:return r=Sr(13,l,i,R),r.elementType=T,r.lanes=O,r;case A:return r=Sr(19,l,i,R),r.elementType=A,r.lanes=O,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case S:j=10;break e;case v:j=9;break e;case E:j=11;break e;case M:j=14;break e;case L:j=16,m=null;break e}j=29,l=Error(s(130,r===null?"null":typeof r,"")),m=null}return i=Sr(j,l,i,R),i.elementType=r,i.type=m,i.lanes=O,i}function ko(r,i,l,m){return r=Sr(7,r,m,i),r.lanes=l,r}function Qp(r,i,l){return r=Sr(6,r,null,i),r.lanes=l,r}function Dy(r){var i=Sr(18,null,null,0);return i.stateNode=r,i}function Zp(r,i,l){return i=Sr(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Py=new WeakMap;function Hr(r,i){if(typeof r=="object"&&r!==null){var l=Py.get(r);return l!==void 0?l:(i={value:r,source:i,stack:Le(i)},Py.set(r,i),i)}return{value:r,source:i,stack:Le(i)}}var Wa=[],qa=0,wd=null,gc=0,Vr=[],Fr=0,Li=null,ys=1,bs="";function Qs(r,i){Wa[qa++]=gc,Wa[qa++]=wd,wd=r,gc=i}function Iy(r,i,l){Vr[Fr++]=ys,Vr[Fr++]=bs,Vr[Fr++]=Li,Li=r;var m=ys;r=bs;var R=32-at(m)-1;m&=~(1<<R),l+=1;var O=32-at(i)+R;if(30<O){var j=R-R%5;O=(m&(1<<j)-1).toString(32),m>>=j,R-=j,ys=1<<32-at(i)+R|l<<R|m,bs=O+r}else ys=1<<O|l<<R|m,bs=r}function Jp(r){r.return!==null&&(Qs(r,1),Iy(r,1,0))}function em(r){for(;r===wd;)wd=Wa[--qa],Wa[qa]=null,gc=Wa[--qa],Wa[qa]=null;for(;r===Li;)Li=Vr[--Fr],Vr[Fr]=null,bs=Vr[--Fr],Vr[Fr]=null,ys=Vr[--Fr],Vr[Fr]=null}function Ny(r,i){Vr[Fr++]=ys,Vr[Fr++]=bs,Vr[Fr++]=Li,ys=i.id,bs=i.overflow,Li=r}var zn=null,Yt=null,At=!1,Ai=null,Ur=!1,tm=Error(s(519));function Oi(r){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vc(Hr(i,r)),tm}function jy(r){var i=r.stateNode,l=r.type,m=r.memoizedProps;switch(i[fn]=r,i[hn]=m,l){case"dialog":Rt("cancel",i),Rt("close",i);break;case"iframe":case"object":case"embed":Rt("load",i);break;case"video":case"audio":for(l=0;l<zc.length;l++)Rt(zc[l],i);break;case"source":Rt("error",i);break;case"img":case"image":case"link":Rt("error",i),Rt("load",i);break;case"details":Rt("toggle",i);break;case"input":Rt("invalid",i),ud(i,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Rt("invalid",i);break;case"textarea":Rt("invalid",i),Fe(i,m.value,m.defaultValue,m.children)}l=m.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||m.suppressHydrationWarning===!0||eS(i.textContent,l)?(m.popover!=null&&(Rt("beforetoggle",i),Rt("toggle",i)),m.onScroll!=null&&Rt("scroll",i),m.onScrollEnd!=null&&Rt("scrollend",i),m.onClick!=null&&(i.onclick=os),i=!0):i=!1,i||Oi(r,!0)}function By(r){for(zn=r.return;zn;)switch(zn.tag){case 5:case 31:case 13:Ur=!1;return;case 27:case 3:Ur=!0;return;default:zn=zn.return}}function Ga(r){if(r!==zn)return!1;if(!At)return By(r),At=!0,!1;var i=r.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||yg(r.type,r.memoizedProps)),l=!l),l&&Yt&&Oi(r),By(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=cS(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Yt=cS(r)}else i===27?(i=Yt,qi(r.type)?(r=wg,wg=null,Yt=r):Yt=i):Yt=zn?qr(r.stateNode.nextSibling):null;return!0}function To(){Yt=zn=null,At=!1}function nm(){var r=Ai;return r!==null&&(ur===null?ur=r:ur.push.apply(ur,r),Ai=null),r}function vc(r){Ai===null?Ai=[r]:Ai.push(r)}var rm=I(null),Lo=null,Zs=null;function Mi(r,i,l){K(rm,i._currentValue),i._currentValue=l}function Js(r){r._currentValue=rm.current,G(rm)}function sm(r,i,l){for(;r!==null;){var m=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,m!==null&&(m.childLanes|=i)):m!==null&&(m.childLanes&i)!==i&&(m.childLanes|=i),r===l)break;r=r.return}}function im(r,i,l,m){var R=r.child;for(R!==null&&(R.return=r);R!==null;){var O=R.dependencies;if(O!==null){var j=R.child;O=O.firstContext;e:for(;O!==null;){var Q=O;O=R;for(var ie=0;ie<i.length;ie++)if(Q.context===i[ie]){O.lanes|=l,Q=O.alternate,Q!==null&&(Q.lanes|=l),sm(O.return,l,r),m||(j=null);break e}O=Q.next}}else if(R.tag===18){if(j=R.return,j===null)throw Error(s(341));j.lanes|=l,O=j.alternate,O!==null&&(O.lanes|=l),sm(j,l,r),j=null}else j=R.child;if(j!==null)j.return=R;else for(j=R;j!==null;){if(j===r){j=null;break}if(R=j.sibling,R!==null){R.return=j.return,j=R;break}j=j.return}R=j}}function $a(r,i,l,m){r=null;for(var R=i,O=!1;R!==null;){if(!O){if((R.flags&524288)!==0)O=!0;else if((R.flags&262144)!==0)break}if(R.tag===10){var j=R.alternate;if(j===null)throw Error(s(387));if(j=j.memoizedProps,j!==null){var Q=R.type;br(R.pendingProps.value,j.value)||(r!==null?r.push(Q):r=[Q])}}else if(R===X.current){if(j=R.alternate,j===null)throw Error(s(387));j.memoizedState.memoizedState!==R.memoizedState.memoizedState&&(r!==null?r.push(Wc):r=[Wc])}R=R.return}r!==null&&im(i,r,l,m),i.flags|=262144}function Ed(r){for(r=r.firstContext;r!==null;){if(!br(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ao(r){Lo=r,Zs=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Hn(r){return zy(Lo,r)}function Rd(r,i){return Lo===null&&Ao(r),zy(r,i)}function zy(r,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Zs===null){if(r===null)throw Error(s(308));Zs=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Zs=Zs.next=i;return l}var S5=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,m){r.push(m)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},x5=e.unstable_scheduleCallback,C5=e.unstable_NormalPriority,gn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function om(){return{controller:new S5,data:new Map,refCount:0}}function _c(r){r.refCount--,r.refCount===0&&x5(C5,function(){r.controller.abort()})}var yc=null,am=0,Ka=0,Ya=null;function w5(r,i){if(yc===null){var l=yc=[];am=0,Ka=ug(),Ya={status:"pending",value:void 0,then:function(m){l.push(m)}}}return am++,i.then(Hy,Hy),i}function Hy(){if(--am===0&&yc!==null){Ya!==null&&(Ya.status="fulfilled");var r=yc;yc=null,Ka=0,Ya=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function E5(r,i){var l=[],m={status:"pending",value:null,reason:null,then:function(R){l.push(R)}};return r.then(function(){m.status="fulfilled",m.value=i;for(var R=0;R<l.length;R++)(0,l[R])(i)},function(R){for(m.status="rejected",m.reason=R,R=0;R<l.length;R++)(0,l[R])(void 0)}),m}var Vy=F.S;F.S=function(r,i){w1=be(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&w5(r,i),Vy!==null&&Vy(r,i)};var Oo=I(null);function lm(){var r=Oo.current;return r!==null?r:Wt.pooledCache}function kd(r,i){i===null?K(Oo,Oo.current):K(Oo,i.pool)}function Fy(){var r=lm();return r===null?null:{parent:gn._currentValue,pool:r}}var Xa=Error(s(460)),cm=Error(s(474)),Td=Error(s(542)),Ld={then:function(){}};function Uy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Wy(r,i,l){switch(l=r[l],l===void 0?r.push(i):l!==i&&(i.then(os,os),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Gy(r),r;default:if(typeof i.status=="string")i.then(os,os);else{if(r=Wt,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=i,r.status="pending",r.then(function(m){if(i.status==="pending"){var R=i;R.status="fulfilled",R.value=m}},function(m){if(i.status==="pending"){var R=i;R.status="rejected",R.reason=m}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,Gy(r),r}throw Do=i,Xa}}function Mo(r){try{var i=r._init;return i(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Do=l,Xa):l}}var Do=null;function qy(){if(Do===null)throw Error(s(459));var r=Do;return Do=null,r}function Gy(r){if(r===Xa||r===Td)throw Error(s(483))}var Qa=null,bc=0;function Ad(r){var i=bc;return bc+=1,Qa===null&&(Qa=[]),Wy(Qa,r,i)}function Sc(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Od(r,i){throw i.$$typeof===g?Error(s(525)):(r=Object.prototype.toString.call(i),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function $y(r){function i(ue,le){if(r){var fe=ue.deletions;fe===null?(ue.deletions=[le],ue.flags|=16):fe.push(le)}}function l(ue,le){if(!r)return null;for(;le!==null;)i(ue,le),le=le.sibling;return null}function m(ue){for(var le=new Map;ue!==null;)ue.key!==null?le.set(ue.key,ue):le.set(ue.index,ue),ue=ue.sibling;return le}function R(ue,le){return ue=Xs(ue,le),ue.index=0,ue.sibling=null,ue}function O(ue,le,fe){return ue.index=fe,r?(fe=ue.alternate,fe!==null?(fe=fe.index,fe<le?(ue.flags|=67108866,le):fe):(ue.flags|=67108866,le)):(ue.flags|=1048576,le)}function j(ue){return r&&ue.alternate===null&&(ue.flags|=67108866),ue}function Q(ue,le,fe,we){return le===null||le.tag!==6?(le=Qp(fe,ue.mode,we),le.return=ue,le):(le=R(le,fe),le.return=ue,le)}function ie(ue,le,fe,we){var it=fe.type;return it===x?Se(ue,le,fe.props.children,we,fe.key):le!==null&&(le.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===L&&Mo(it)===le.type)?(le=R(le,fe.props),Sc(le,fe),le.return=ue,le):(le=Cd(fe.type,fe.key,fe.props,null,ue.mode,we),Sc(le,fe),le.return=ue,le)}function pe(ue,le,fe,we){return le===null||le.tag!==4||le.stateNode.containerInfo!==fe.containerInfo||le.stateNode.implementation!==fe.implementation?(le=Zp(fe,ue.mode,we),le.return=ue,le):(le=R(le,fe.children||[]),le.return=ue,le)}function Se(ue,le,fe,we,it){return le===null||le.tag!==7?(le=ko(fe,ue.mode,we,it),le.return=ue,le):(le=R(le,fe),le.return=ue,le)}function ke(ue,le,fe){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return le=Qp(""+le,ue.mode,fe),le.return=ue,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return fe=Cd(le.type,le.key,le.props,null,ue.mode,fe),Sc(fe,le),fe.return=ue,fe;case C:return le=Zp(le,ue.mode,fe),le.return=ue,le;case L:return le=Mo(le),ke(ue,le,fe)}if($(le)||W(le))return le=ko(le,ue.mode,fe,null),le.return=ue,le;if(typeof le.then=="function")return ke(ue,Ad(le),fe);if(le.$$typeof===S)return ke(ue,Rd(ue,le),fe);Od(ue,le)}return null}function me(ue,le,fe,we){var it=le!==null?le.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return it!==null?null:Q(ue,le,""+fe,we);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case b:return fe.key===it?ie(ue,le,fe,we):null;case C:return fe.key===it?pe(ue,le,fe,we):null;case L:return fe=Mo(fe),me(ue,le,fe,we)}if($(fe)||W(fe))return it!==null?null:Se(ue,le,fe,we,null);if(typeof fe.then=="function")return me(ue,le,Ad(fe),we);if(fe.$$typeof===S)return me(ue,le,Rd(ue,fe),we);Od(ue,fe)}return null}function _e(ue,le,fe,we,it){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return ue=ue.get(fe)||null,Q(le,ue,""+we,it);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case b:return ue=ue.get(we.key===null?fe:we.key)||null,ie(le,ue,we,it);case C:return ue=ue.get(we.key===null?fe:we.key)||null,pe(le,ue,we,it);case L:return we=Mo(we),_e(ue,le,fe,we,it)}if($(we)||W(we))return ue=ue.get(fe)||null,Se(le,ue,we,it,null);if(typeof we.then=="function")return _e(ue,le,fe,Ad(we),it);if(we.$$typeof===S)return _e(ue,le,fe,Rd(le,we),it);Od(le,we)}return null}function Ge(ue,le,fe,we){for(var it=null,Mt=null,Ze=le,_t=le=0,Lt=null;Ze!==null&&_t<fe.length;_t++){Ze.index>_t?(Lt=Ze,Ze=null):Lt=Ze.sibling;var Dt=me(ue,Ze,fe[_t],we);if(Dt===null){Ze===null&&(Ze=Lt);break}r&&Ze&&Dt.alternate===null&&i(ue,Ze),le=O(Dt,le,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt,Ze=Lt}if(_t===fe.length)return l(ue,Ze),At&&Qs(ue,_t),it;if(Ze===null){for(;_t<fe.length;_t++)Ze=ke(ue,fe[_t],we),Ze!==null&&(le=O(Ze,le,_t),Mt===null?it=Ze:Mt.sibling=Ze,Mt=Ze);return At&&Qs(ue,_t),it}for(Ze=m(Ze);_t<fe.length;_t++)Lt=_e(Ze,ue,_t,fe[_t],we),Lt!==null&&(r&&Lt.alternate!==null&&Ze.delete(Lt.key===null?_t:Lt.key),le=O(Lt,le,_t),Mt===null?it=Lt:Mt.sibling=Lt,Mt=Lt);return r&&Ze.forEach(function(Xi){return i(ue,Xi)}),At&&Qs(ue,_t),it}function ct(ue,le,fe,we){if(fe==null)throw Error(s(151));for(var it=null,Mt=null,Ze=le,_t=le=0,Lt=null,Dt=fe.next();Ze!==null&&!Dt.done;_t++,Dt=fe.next()){Ze.index>_t?(Lt=Ze,Ze=null):Lt=Ze.sibling;var Xi=me(ue,Ze,Dt.value,we);if(Xi===null){Ze===null&&(Ze=Lt);break}r&&Ze&&Xi.alternate===null&&i(ue,Ze),le=O(Xi,le,_t),Mt===null?it=Xi:Mt.sibling=Xi,Mt=Xi,Ze=Lt}if(Dt.done)return l(ue,Ze),At&&Qs(ue,_t),it;if(Ze===null){for(;!Dt.done;_t++,Dt=fe.next())Dt=ke(ue,Dt.value,we),Dt!==null&&(le=O(Dt,le,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt);return At&&Qs(ue,_t),it}for(Ze=m(Ze);!Dt.done;_t++,Dt=fe.next())Dt=_e(Ze,ue,_t,Dt.value,we),Dt!==null&&(r&&Dt.alternate!==null&&Ze.delete(Dt.key===null?_t:Dt.key),le=O(Dt,le,_t),Mt===null?it=Dt:Mt.sibling=Dt,Mt=Dt);return r&&Ze.forEach(function(NL){return i(ue,NL)}),At&&Qs(ue,_t),it}function Ut(ue,le,fe,we){if(typeof fe=="object"&&fe!==null&&fe.type===x&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case b:e:{for(var it=fe.key;le!==null;){if(le.key===it){if(it=fe.type,it===x){if(le.tag===7){l(ue,le.sibling),we=R(le,fe.props.children),we.return=ue,ue=we;break e}}else if(le.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===L&&Mo(it)===le.type){l(ue,le.sibling),we=R(le,fe.props),Sc(we,fe),we.return=ue,ue=we;break e}l(ue,le);break}else i(ue,le);le=le.sibling}fe.type===x?(we=ko(fe.props.children,ue.mode,we,fe.key),we.return=ue,ue=we):(we=Cd(fe.type,fe.key,fe.props,null,ue.mode,we),Sc(we,fe),we.return=ue,ue=we)}return j(ue);case C:e:{for(it=fe.key;le!==null;){if(le.key===it)if(le.tag===4&&le.stateNode.containerInfo===fe.containerInfo&&le.stateNode.implementation===fe.implementation){l(ue,le.sibling),we=R(le,fe.children||[]),we.return=ue,ue=we;break e}else{l(ue,le);break}else i(ue,le);le=le.sibling}we=Zp(fe,ue.mode,we),we.return=ue,ue=we}return j(ue);case L:return fe=Mo(fe),Ut(ue,le,fe,we)}if($(fe))return Ge(ue,le,fe,we);if(W(fe)){if(it=W(fe),typeof it!="function")throw Error(s(150));return fe=it.call(fe),ct(ue,le,fe,we)}if(typeof fe.then=="function")return Ut(ue,le,Ad(fe),we);if(fe.$$typeof===S)return Ut(ue,le,Rd(ue,fe),we);Od(ue,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,le!==null&&le.tag===6?(l(ue,le.sibling),we=R(le,fe),we.return=ue,ue=we):(l(ue,le),we=Qp(fe,ue.mode,we),we.return=ue,ue=we),j(ue)):l(ue,le)}return function(ue,le,fe,we){try{bc=0;var it=Ut(ue,le,fe,we);return Qa=null,it}catch(Ze){if(Ze===Xa||Ze===Td)throw Ze;var Mt=Sr(29,Ze,null,ue.mode);return Mt.lanes=we,Mt.return=ue,Mt}}}var Po=$y(!0),Ky=$y(!1),Di=!1;function um(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dm(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Pi(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ii(r,i,l){var m=r.updateQueue;if(m===null)return null;if(m=m.shared,(Pt&2)!==0){var R=m.pending;return R===null?i.next=i:(i.next=R.next,R.next=i),m.pending=i,i=xd(r),Oy(r,null,l),i}return Sd(r,m,i,l),xd(r)}function xc(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var m=i.lanes;m&=r.pendingLanes,l|=m,i.lanes=l,Ht(r,l)}}function fm(r,i){var l=r.updateQueue,m=r.alternate;if(m!==null&&(m=m.updateQueue,l===m)){var R=null,O=null;if(l=l.firstBaseUpdate,l!==null){do{var j={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};O===null?R=O=j:O=O.next=j,l=l.next}while(l!==null);O===null?R=O=i:O=O.next=i}else R=O=i;l={baseState:m.baseState,firstBaseUpdate:R,lastBaseUpdate:O,shared:m.shared,callbacks:m.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}var hm=!1;function Cc(){if(hm){var r=Ya;if(r!==null)throw r}}function wc(r,i,l,m){hm=!1;var R=r.updateQueue;Di=!1;var O=R.firstBaseUpdate,j=R.lastBaseUpdate,Q=R.shared.pending;if(Q!==null){R.shared.pending=null;var ie=Q,pe=ie.next;ie.next=null,j===null?O=pe:j.next=pe,j=ie;var Se=r.alternate;Se!==null&&(Se=Se.updateQueue,Q=Se.lastBaseUpdate,Q!==j&&(Q===null?Se.firstBaseUpdate=pe:Q.next=pe,Se.lastBaseUpdate=ie))}if(O!==null){var ke=R.baseState;j=0,Se=pe=ie=null,Q=O;do{var me=Q.lane&-536870913,_e=me!==Q.lane;if(_e?(Tt&me)===me:(m&me)===me){me!==0&&me===Ka&&(hm=!0),Se!==null&&(Se=Se.next={lane:0,tag:Q.tag,payload:Q.payload,callback:null,next:null});e:{var Ge=r,ct=Q;me=i;var Ut=l;switch(ct.tag){case 1:if(Ge=ct.payload,typeof Ge=="function"){ke=Ge.call(Ut,ke,me);break e}ke=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=ct.payload,me=typeof Ge=="function"?Ge.call(Ut,ke,me):Ge,me==null)break e;ke=f({},ke,me);break e;case 2:Di=!0}}me=Q.callback,me!==null&&(r.flags|=64,_e&&(r.flags|=8192),_e=R.callbacks,_e===null?R.callbacks=[me]:_e.push(me))}else _e={lane:me,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},Se===null?(pe=Se=_e,ie=ke):Se=Se.next=_e,j|=me;if(Q=Q.next,Q===null){if(Q=R.shared.pending,Q===null)break;_e=Q,Q=_e.next,_e.next=null,R.lastBaseUpdate=_e,R.shared.pending=null}}while(!0);Se===null&&(ie=ke),R.baseState=ie,R.firstBaseUpdate=pe,R.lastBaseUpdate=Se,O===null&&(R.shared.lanes=0),Hi|=j,r.lanes=j,r.memoizedState=ke}}function Yy(r,i){if(typeof r!="function")throw Error(s(191,r));r.call(i)}function Xy(r,i){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)Yy(l[r],i)}var Za=I(null),Md=I(0);function Qy(r,i){r=li,K(Md,r),K(Za,i),li=r|i.baseLanes}function pm(){K(Md,li),K(Za,Za.current)}function mm(){li=Md.current,G(Za),G(Md)}var xr=I(null),Wr=null;function Ni(r){var i=r.alternate;K(an,an.current&1),K(xr,r),Wr===null&&(i===null||Za.current!==null||i.memoizedState!==null)&&(Wr=r)}function gm(r){K(an,an.current),K(xr,r),Wr===null&&(Wr=r)}function Zy(r){r.tag===22?(K(an,an.current),K(xr,r),Wr===null&&(Wr=r)):ji()}function ji(){K(an,an.current),K(xr,xr.current)}function Cr(r){G(xr),Wr===r&&(Wr=null),G(an)}var an=I(0);function Dd(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||xg(l)||Cg(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ei=0,gt=null,Vt=null,vn=null,Pd=!1,Ja=!1,Io=!1,Id=0,Ec=0,el=null,R5=0;function sn(){throw Error(s(321))}function vm(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!br(r[l],i[l]))return!1;return!0}function _m(r,i,l,m,R,O){return ei=O,gt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,F.H=r===null||r.memoizedState===null?Ib:Dm,Io=!1,O=l(m,R),Io=!1,Ja&&(O=eb(i,l,m,R)),Jy(r),O}function Jy(r){F.H=Tc;var i=Vt!==null&&Vt.next!==null;if(ei=0,vn=Vt=gt=null,Pd=!1,Ec=0,el=null,i)throw Error(s(300));r===null||_n||(r=r.dependencies,r!==null&&Ed(r)&&(_n=!0))}function eb(r,i,l,m){gt=r;var R=0;do{if(Ja&&(el=null),Ec=0,Ja=!1,25<=R)throw Error(s(301));if(R+=1,vn=Vt=null,r.updateQueue!=null){var O=r.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}F.H=Nb,O=i(l,m)}while(Ja);return O}function k5(){var r=F.H,i=r.useState()[0];return i=typeof i.then=="function"?Rc(i):i,r=r.useState()[0],(Vt!==null?Vt.memoizedState:null)!==r&&(gt.flags|=1024),i}function ym(){var r=Id!==0;return Id=0,r}function bm(r,i,l){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~l}function Sm(r){if(Pd){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Pd=!1}ei=0,vn=Vt=gt=null,Ja=!1,Ec=Id=0,el=null}function er(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vn===null?gt.memoizedState=vn=r:vn=vn.next=r,vn}function ln(){if(Vt===null){var r=gt.alternate;r=r!==null?r.memoizedState:null}else r=Vt.next;var i=vn===null?gt.memoizedState:vn.next;if(i!==null)vn=i,Vt=r;else{if(r===null)throw gt.alternate===null?Error(s(467)):Error(s(310));Vt=r,r={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},vn===null?gt.memoizedState=vn=r:vn=vn.next=r}return vn}function Nd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rc(r){var i=Ec;return Ec+=1,el===null&&(el=[]),r=Wy(el,r,i),i=gt,(vn===null?i.memoizedState:vn.next)===null&&(i=i.alternate,F.H=i===null||i.memoizedState===null?Ib:Dm),r}function jd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Rc(r);if(r.$$typeof===S)return Hn(r)}throw Error(s(438,String(r)))}function xm(r){var i=null,l=gt.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var m=gt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(i={data:m.data.map(function(R){return R.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Nd(),gt.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(r),m=0;m<r;m++)l[m]=U;return i.index++,l}function ti(r,i){return typeof i=="function"?i(r):i}function Bd(r){var i=ln();return Cm(i,Vt,r)}function Cm(r,i,l){var m=r.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=l;var R=r.baseQueue,O=m.pending;if(O!==null){if(R!==null){var j=R.next;R.next=O.next,O.next=j}i.baseQueue=R=O,m.pending=null}if(O=r.baseState,R===null)r.memoizedState=O;else{i=R.next;var Q=j=null,ie=null,pe=i,Se=!1;do{var ke=pe.lane&-536870913;if(ke!==pe.lane?(Tt&ke)===ke:(ei&ke)===ke){var me=pe.revertLane;if(me===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null}),ke===Ka&&(Se=!0);else if((ei&me)===me){pe=pe.next,me===Ka&&(Se=!0);continue}else ke={lane:0,revertLane:pe.revertLane,gesture:null,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ie===null?(Q=ie=ke,j=O):ie=ie.next=ke,gt.lanes|=me,Hi|=me;ke=pe.action,Io&&l(O,ke),O=pe.hasEagerState?pe.eagerState:l(O,ke)}else me={lane:ke,revertLane:pe.revertLane,gesture:pe.gesture,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null},ie===null?(Q=ie=me,j=O):ie=ie.next=me,gt.lanes|=ke,Hi|=ke;pe=pe.next}while(pe!==null&&pe!==i);if(ie===null?j=O:ie.next=Q,!br(O,r.memoizedState)&&(_n=!0,Se&&(l=Ya,l!==null)))throw l;r.memoizedState=O,r.baseState=j,r.baseQueue=ie,m.lastRenderedState=O}return R===null&&(m.lanes=0),[r.memoizedState,m.dispatch]}function wm(r){var i=ln(),l=i.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=r;var m=l.dispatch,R=l.pending,O=i.memoizedState;if(R!==null){l.pending=null;var j=R=R.next;do O=r(O,j.action),j=j.next;while(j!==R);br(O,i.memoizedState)||(_n=!0),i.memoizedState=O,i.baseQueue===null&&(i.baseState=O),l.lastRenderedState=O}return[O,m]}function tb(r,i,l){var m=gt,R=ln(),O=At;if(O){if(l===void 0)throw Error(s(407));l=l()}else l=i();var j=!br((Vt||R).memoizedState,l);if(j&&(R.memoizedState=l,_n=!0),R=R.queue,km(sb.bind(null,m,R,r),[r]),R.getSnapshot!==i||j||vn!==null&&vn.memoizedState.tag&1){if(m.flags|=2048,tl(9,{destroy:void 0},rb.bind(null,m,R,l,i),null),Wt===null)throw Error(s(349));O||(ei&127)!==0||nb(m,i,l)}return l}function nb(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=gt.updateQueue,i===null?(i=Nd(),gt.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function rb(r,i,l,m){i.value=l,i.getSnapshot=m,ib(i)&&ob(r)}function sb(r,i,l){return l(function(){ib(i)&&ob(r)})}function ib(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!br(r,l)}catch{return!0}}function ob(r){var i=Ro(r,2);i!==null&&dr(i,r,2)}function Em(r){var i=er();if(typeof r=="function"){var l=r;if(r=l(),Io){tt(!0);try{l()}finally{tt(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:r},i}function ab(r,i,l,m){return r.baseState=l,Cm(r,Vt,typeof m=="function"?m:ti)}function T5(r,i,l,m,R){if(Vd(r))throw Error(s(485));if(r=i.action,r!==null){var O={payload:R,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){O.listeners.push(j)}};F.T!==null?l(!0):O.isTransition=!1,m(O),l=i.pending,l===null?(O.next=i.pending=O,lb(i,O)):(O.next=l.next,i.pending=l.next=O)}}function lb(r,i){var l=i.action,m=i.payload,R=r.state;if(i.isTransition){var O=F.T,j={};F.T=j;try{var Q=l(R,m),ie=F.S;ie!==null&&ie(j,Q),cb(r,i,Q)}catch(pe){Rm(r,i,pe)}finally{O!==null&&j.types!==null&&(O.types=j.types),F.T=O}}else try{O=l(R,m),cb(r,i,O)}catch(pe){Rm(r,i,pe)}}function cb(r,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(m){ub(r,i,m)},function(m){return Rm(r,i,m)}):ub(r,i,l)}function ub(r,i,l){i.status="fulfilled",i.value=l,db(i),r.state=l,i=r.pending,i!==null&&(l=i.next,l===i?r.pending=null:(l=l.next,i.next=l,lb(r,l)))}function Rm(r,i,l){var m=r.pending;if(r.pending=null,m!==null){m=m.next;do i.status="rejected",i.reason=l,db(i),i=i.next;while(i!==m)}r.action=null}function db(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function fb(r,i){return i}function hb(r,i){if(At){var l=Wt.formState;if(l!==null){e:{var m=gt;if(At){if(Yt){t:{for(var R=Yt,O=Ur;R.nodeType!==8;){if(!O){R=null;break t}if(R=qr(R.nextSibling),R===null){R=null;break t}}O=R.data,R=O==="F!"||O==="F"?R:null}if(R){Yt=qr(R.nextSibling),m=R.data==="F!";break e}}Oi(m)}m=!1}m&&(i=l[0])}}return l=er(),l.memoizedState=l.baseState=i,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fb,lastRenderedState:i},l.queue=m,l=Mb.bind(null,gt,m),m.dispatch=l,m=Em(!1),O=Mm.bind(null,gt,!1,m.queue),m=er(),R={state:i,dispatch:null,action:r,pending:null},m.queue=R,l=T5.bind(null,gt,R,O,l),R.dispatch=l,m.memoizedState=r,[i,l,!1]}function pb(r){var i=ln();return mb(i,Vt,r)}function mb(r,i,l){if(i=Cm(r,i,fb)[0],r=Bd(ti)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=Rc(i)}catch(j){throw j===Xa?Td:j}else m=i;i=ln();var R=i.queue,O=R.dispatch;return l!==i.memoizedState&&(gt.flags|=2048,tl(9,{destroy:void 0},L5.bind(null,R,l),null)),[m,O,r]}function L5(r,i){r.action=i}function gb(r){var i=ln(),l=Vt;if(l!==null)return mb(i,l,r);ln(),i=i.memoizedState,l=ln();var m=l.queue.dispatch;return l.memoizedState=r,[i,m,!1]}function tl(r,i,l,m){return r={tag:r,create:l,deps:m,inst:i,next:null},i=gt.updateQueue,i===null&&(i=Nd(),gt.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=r.next=r:(m=l.next,l.next=r,r.next=m,i.lastEffect=r),r}function vb(){return ln().memoizedState}function zd(r,i,l,m){var R=er();gt.flags|=r,R.memoizedState=tl(1|i,{destroy:void 0},l,m===void 0?null:m)}function Hd(r,i,l,m){var R=ln();m=m===void 0?null:m;var O=R.memoizedState.inst;Vt!==null&&m!==null&&vm(m,Vt.memoizedState.deps)?R.memoizedState=tl(i,O,l,m):(gt.flags|=r,R.memoizedState=tl(1|i,O,l,m))}function _b(r,i){zd(8390656,8,r,i)}function km(r,i){Hd(2048,8,r,i)}function A5(r){gt.flags|=4;var i=gt.updateQueue;if(i===null)i=Nd(),gt.updateQueue=i,i.events=[r];else{var l=i.events;l===null?i.events=[r]:l.push(r)}}function yb(r){var i=ln().memoizedState;return A5({ref:i,nextImpl:r}),function(){if((Pt&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function bb(r,i){return Hd(4,2,r,i)}function Sb(r,i){return Hd(4,4,r,i)}function xb(r,i){if(typeof i=="function"){r=r();var l=i(r);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Cb(r,i,l){l=l!=null?l.concat([r]):null,Hd(4,4,xb.bind(null,i,r),l)}function Tm(){}function wb(r,i){var l=ln();i=i===void 0?null:i;var m=l.memoizedState;return i!==null&&vm(i,m[1])?m[0]:(l.memoizedState=[r,i],r)}function Eb(r,i){var l=ln();i=i===void 0?null:i;var m=l.memoizedState;if(i!==null&&vm(i,m[1]))return m[0];if(m=r(),Io){tt(!0);try{r()}finally{tt(!1)}}return l.memoizedState=[m,i],m}function Lm(r,i,l){return l===void 0||(ei&1073741824)!==0&&(Tt&261930)===0?r.memoizedState=i:(r.memoizedState=l,r=R1(),gt.lanes|=r,Hi|=r,l)}function Rb(r,i,l,m){return br(l,i)?l:Za.current!==null?(r=Lm(r,l,m),br(r,i)||(_n=!0),r):(ei&42)===0||(ei&1073741824)!==0&&(Tt&261930)===0?(_n=!0,r.memoizedState=l):(r=R1(),gt.lanes|=r,Hi|=r,i)}function kb(r,i,l,m,R){var O=q.p;q.p=O!==0&&8>O?O:8;var j=F.T,Q={};F.T=Q,Mm(r,!1,i,l);try{var ie=R(),pe=F.S;if(pe!==null&&pe(Q,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Se=E5(ie,m);kc(r,i,Se,Rr(r))}else kc(r,i,m,Rr(r))}catch(ke){kc(r,i,{then:function(){},status:"rejected",reason:ke},Rr())}finally{q.p=O,j!==null&&Q.types!==null&&(j.types=Q.types),F.T=j}}function O5(){}function Am(r,i,l,m){if(r.tag!==5)throw Error(s(476));var R=Tb(r).queue;kb(r,R,i,H,l===null?O5:function(){return Lb(r),l(m)})}function Tb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:H},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Lb(r){var i=Tb(r);i.next===null&&(i=r.alternate.memoizedState),kc(r,i.next.queue,{},Rr())}function Om(){return Hn(Wc)}function Ab(){return ln().memoizedState}function Ob(){return ln().memoizedState}function M5(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Rr();r=Pi(l);var m=Ii(i,r,l);m!==null&&(dr(m,i,l),xc(m,i,l)),i={cache:om()},r.payload=i;return}i=i.return}}function D5(r,i,l){var m=Rr();l={lane:m,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Vd(r)?Db(i,l):(l=Yp(r,i,l,m),l!==null&&(dr(l,r,m),Pb(l,i,m)))}function Mb(r,i,l){var m=Rr();kc(r,i,l,m)}function kc(r,i,l,m){var R={lane:m,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Vd(r))Db(i,R);else{var O=r.alternate;if(r.lanes===0&&(O===null||O.lanes===0)&&(O=i.lastRenderedReducer,O!==null))try{var j=i.lastRenderedState,Q=O(j,l);if(R.hasEagerState=!0,R.eagerState=Q,br(Q,j))return Sd(r,i,R,0),Wt===null&&bd(),!1}catch{}if(l=Yp(r,i,R,m),l!==null)return dr(l,r,m),Pb(l,i,m),!0}return!1}function Mm(r,i,l,m){if(m={lane:2,revertLane:ug(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Vd(r)){if(i)throw Error(s(479))}else i=Yp(r,l,m,2),i!==null&&dr(i,r,2)}function Vd(r){var i=r.alternate;return r===gt||i!==null&&i===gt}function Db(r,i){Ja=Pd=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function Pb(r,i,l){if((l&4194048)!==0){var m=i.lanes;m&=r.pendingLanes,l|=m,i.lanes=l,Ht(r,l)}}var Tc={readContext:Hn,use:jd,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useLayoutEffect:sn,useInsertionEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useSyncExternalStore:sn,useId:sn,useHostTransitionStatus:sn,useFormState:sn,useActionState:sn,useOptimistic:sn,useMemoCache:sn,useCacheRefresh:sn};Tc.useEffectEvent=sn;var Ib={readContext:Hn,use:jd,useCallback:function(r,i){return er().memoizedState=[r,i===void 0?null:i],r},useContext:Hn,useEffect:_b,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,zd(4194308,4,xb.bind(null,i,r),l)},useLayoutEffect:function(r,i){return zd(4194308,4,r,i)},useInsertionEffect:function(r,i){zd(4,2,r,i)},useMemo:function(r,i){var l=er();i=i===void 0?null:i;var m=r();if(Io){tt(!0);try{r()}finally{tt(!1)}}return l.memoizedState=[m,i],m},useReducer:function(r,i,l){var m=er();if(l!==void 0){var R=l(i);if(Io){tt(!0);try{l(i)}finally{tt(!1)}}}else R=i;return m.memoizedState=m.baseState=R,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:R},m.queue=r,r=r.dispatch=D5.bind(null,gt,r),[m.memoizedState,r]},useRef:function(r){var i=er();return r={current:r},i.memoizedState=r},useState:function(r){r=Em(r);var i=r.queue,l=Mb.bind(null,gt,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:Tm,useDeferredValue:function(r,i){var l=er();return Lm(l,r,i)},useTransition:function(){var r=Em(!1);return r=kb.bind(null,gt,r.queue,!0,!1),er().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var m=gt,R=er();if(At){if(l===void 0)throw Error(s(407));l=l()}else{if(l=i(),Wt===null)throw Error(s(349));(Tt&127)!==0||nb(m,i,l)}R.memoizedState=l;var O={value:l,getSnapshot:i};return R.queue=O,_b(sb.bind(null,m,O,r),[r]),m.flags|=2048,tl(9,{destroy:void 0},rb.bind(null,m,O,l,i),null),l},useId:function(){var r=er(),i=Wt.identifierPrefix;if(At){var l=bs,m=ys;l=(m&~(1<<32-at(m)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Id++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=R5++,i="_"+i+"r_"+l.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Om,useFormState:hb,useActionState:hb,useOptimistic:function(r){var i=er();i.memoizedState=i.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Mm.bind(null,gt,!0,l),l.dispatch=i,[r,i]},useMemoCache:xm,useCacheRefresh:function(){return er().memoizedState=M5.bind(null,gt)},useEffectEvent:function(r){var i=er(),l={impl:r};return i.memoizedState=l,function(){if((Pt&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Dm={readContext:Hn,use:jd,useCallback:wb,useContext:Hn,useEffect:km,useImperativeHandle:Cb,useInsertionEffect:bb,useLayoutEffect:Sb,useMemo:Eb,useReducer:Bd,useRef:vb,useState:function(){return Bd(ti)},useDebugValue:Tm,useDeferredValue:function(r,i){var l=ln();return Rb(l,Vt.memoizedState,r,i)},useTransition:function(){var r=Bd(ti)[0],i=ln().memoizedState;return[typeof r=="boolean"?r:Rc(r),i]},useSyncExternalStore:tb,useId:Ab,useHostTransitionStatus:Om,useFormState:pb,useActionState:pb,useOptimistic:function(r,i){var l=ln();return ab(l,Vt,r,i)},useMemoCache:xm,useCacheRefresh:Ob};Dm.useEffectEvent=yb;var Nb={readContext:Hn,use:jd,useCallback:wb,useContext:Hn,useEffect:km,useImperativeHandle:Cb,useInsertionEffect:bb,useLayoutEffect:Sb,useMemo:Eb,useReducer:wm,useRef:vb,useState:function(){return wm(ti)},useDebugValue:Tm,useDeferredValue:function(r,i){var l=ln();return Vt===null?Lm(l,r,i):Rb(l,Vt.memoizedState,r,i)},useTransition:function(){var r=wm(ti)[0],i=ln().memoizedState;return[typeof r=="boolean"?r:Rc(r),i]},useSyncExternalStore:tb,useId:Ab,useHostTransitionStatus:Om,useFormState:gb,useActionState:gb,useOptimistic:function(r,i){var l=ln();return Vt!==null?ab(l,Vt,r,i):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:xm,useCacheRefresh:Ob};Nb.useEffectEvent=yb;function Pm(r,i,l,m){i=r.memoizedState,l=l(m,i),l=l==null?i:f({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var Im={enqueueSetState:function(r,i,l){r=r._reactInternals;var m=Rr(),R=Pi(m);R.payload=i,l!=null&&(R.callback=l),i=Ii(r,R,m),i!==null&&(dr(i,r,m),xc(i,r,m))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var m=Rr(),R=Pi(m);R.tag=1,R.payload=i,l!=null&&(R.callback=l),i=Ii(r,R,m),i!==null&&(dr(i,r,m),xc(i,r,m))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=Rr(),m=Pi(l);m.tag=2,i!=null&&(m.callback=i),i=Ii(r,m,l),i!==null&&(dr(i,r,l),xc(i,r,l))}};function jb(r,i,l,m,R,O,j){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,O,j):i.prototype&&i.prototype.isPureReactComponent?!pc(l,m)||!pc(R,O):!0}function Bb(r,i,l,m){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,m),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,m),i.state!==r&&Im.enqueueReplaceState(i,i.state,null)}function No(r,i){var l=i;if("ref"in i){l={};for(var m in i)m!=="ref"&&(l[m]=i[m])}if(r=r.defaultProps){l===i&&(l=f({},l));for(var R in r)l[R]===void 0&&(l[R]=r[R])}return l}function zb(r){yd(r)}function Hb(r){console.error(r)}function Vb(r){yd(r)}function Fd(r,i){try{var l=r.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(m){setTimeout(function(){throw m})}}function Fb(r,i,l){try{var m=r.onCaughtError;m(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(R){setTimeout(function(){throw R})}}function Nm(r,i,l){return l=Pi(l),l.tag=3,l.payload={element:null},l.callback=function(){Fd(r,i)},l}function Ub(r){return r=Pi(r),r.tag=3,r}function Wb(r,i,l,m){var R=l.type.getDerivedStateFromError;if(typeof R=="function"){var O=m.value;r.payload=function(){return R(O)},r.callback=function(){Fb(i,l,m)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(r.callback=function(){Fb(i,l,m),typeof R!="function"&&(Vi===null?Vi=new Set([this]):Vi.add(this));var Q=m.stack;this.componentDidCatch(m.value,{componentStack:Q!==null?Q:""})})}function P5(r,i,l,m,R){if(l.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(i=l.alternate,i!==null&&$a(i,l,R,!0),l=xr.current,l!==null){switch(l.tag){case 31:case 13:return Wr===null?ef():l.alternate===null&&on===0&&(on=3),l.flags&=-257,l.flags|=65536,l.lanes=R,m===Ld?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([m]):i.add(m),ag(r,m,R)),!1;case 22:return l.flags|=65536,m===Ld?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([m])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([m]):l.add(m)),ag(r,m,R)),!1}throw Error(s(435,l.tag))}return ag(r,m,R),ef(),!1}if(At)return i=xr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=R,m!==tm&&(r=Error(s(422),{cause:m}),vc(Hr(r,l)))):(m!==tm&&(i=Error(s(423),{cause:m}),vc(Hr(i,l))),r=r.current.alternate,r.flags|=65536,R&=-R,r.lanes|=R,m=Hr(m,l),R=Nm(r.stateNode,m,R),fm(r,R),on!==4&&(on=2)),!1;var O=Error(s(520),{cause:m});if(O=Hr(O,l),Nc===null?Nc=[O]:Nc.push(O),on!==4&&(on=2),i===null)return!0;m=Hr(m,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,r=R&-R,l.lanes|=r,r=Nm(l.stateNode,m,r),fm(l,r),!1;case 1:if(i=l.type,O=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Vi===null||!Vi.has(O))))return l.flags|=65536,R&=-R,l.lanes|=R,R=Ub(R),Wb(R,r,l,m),fm(l,R),!1}l=l.return}while(l!==null);return!1}var jm=Error(s(461)),_n=!1;function Vn(r,i,l,m){i.child=r===null?Ky(i,null,l,m):Po(i,r.child,l,m)}function qb(r,i,l,m,R){l=l.render;var O=i.ref;if("ref"in m){var j={};for(var Q in m)Q!=="ref"&&(j[Q]=m[Q])}else j=m;return Ao(i),m=_m(r,i,l,j,O,R),Q=ym(),r!==null&&!_n?(bm(r,i,R),ni(r,i,R)):(At&&Q&&Jp(i),i.flags|=1,Vn(r,i,m,R),i.child)}function Gb(r,i,l,m,R){if(r===null){var O=l.type;return typeof O=="function"&&!Xp(O)&&O.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=O,$b(r,i,O,m,R)):(r=Cd(l.type,null,m,i,i.mode,R),r.ref=i.ref,r.return=i,i.child=r)}if(O=r.child,!qm(r,R)){var j=O.memoizedProps;if(l=l.compare,l=l!==null?l:pc,l(j,m)&&r.ref===i.ref)return ni(r,i,R)}return i.flags|=1,r=Xs(O,m),r.ref=i.ref,r.return=i,i.child=r}function $b(r,i,l,m,R){if(r!==null){var O=r.memoizedProps;if(pc(O,m)&&r.ref===i.ref)if(_n=!1,i.pendingProps=m=O,qm(r,R))(r.flags&131072)!==0&&(_n=!0);else return i.lanes=r.lanes,ni(r,i,R)}return Bm(r,i,l,m,R)}function Kb(r,i,l,m){var R=m.children,O=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((i.flags&128)!==0){if(O=O!==null?O.baseLanes|l:l,r!==null){for(m=i.child=r.child,R=0;m!==null;)R=R|m.lanes|m.childLanes,m=m.sibling;m=R&~O}else m=0,i.child=null;return Yb(r,i,O,l,m)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&kd(i,O!==null?O.cachePool:null),O!==null?Qy(i,O):pm(),Zy(i);else return m=i.lanes=536870912,Yb(r,i,O!==null?O.baseLanes|l:l,l,m)}else O!==null?(kd(i,O.cachePool),Qy(i,O),ji(),i.memoizedState=null):(r!==null&&kd(i,null),pm(),ji());return Vn(r,i,R,l),i.child}function Lc(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Yb(r,i,l,m,R){var O=lm();return O=O===null?null:{parent:gn._currentValue,pool:O},i.memoizedState={baseLanes:l,cachePool:O},r!==null&&kd(i,null),pm(),Zy(i),r!==null&&$a(r,i,m,!0),i.childLanes=R,null}function Ud(r,i){return i=qd({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function Xb(r,i,l){return Po(i,r.child,null,l),r=Ud(i,i.pendingProps),r.flags|=2,Cr(i),i.memoizedState=null,r}function I5(r,i,l){var m=i.pendingProps,R=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(At){if(m.mode==="hidden")return r=Ud(i,m),i.lanes=536870912,Lc(null,r);if(gm(i),(r=Yt)?(r=lS(r,Ur),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Li!==null?{id:ys,overflow:bs}:null,retryLane:536870912,hydrationErrors:null},l=Dy(r),l.return=i,i.child=l,zn=i,Yt=null)):r=null,r===null)throw Oi(i);return i.lanes=536870912,null}return Ud(i,m)}var O=r.memoizedState;if(O!==null){var j=O.dehydrated;if(gm(i),R)if(i.flags&256)i.flags&=-257,i=Xb(r,i,l);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(s(558));else if(_n||$a(r,i,l,!1),R=(l&r.childLanes)!==0,_n||R){if(m=Wt,m!==null&&(j=Cn(m,l),j!==0&&j!==O.retryLane))throw O.retryLane=j,Ro(r,j),dr(m,r,j),jm;ef(),i=Xb(r,i,l)}else r=O.treeContext,Yt=qr(j.nextSibling),zn=i,At=!0,Ai=null,Ur=!1,r!==null&&Ny(i,r),i=Ud(i,m),i.flags|=4096;return i}return r=Xs(r.child,{mode:m.mode,children:m.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Wd(r,i){var l=i.ref;if(l===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(r===null||r.ref!==l)&&(i.flags|=4194816)}}function Bm(r,i,l,m,R){return Ao(i),l=_m(r,i,l,m,void 0,R),m=ym(),r!==null&&!_n?(bm(r,i,R),ni(r,i,R)):(At&&m&&Jp(i),i.flags|=1,Vn(r,i,l,R),i.child)}function Qb(r,i,l,m,R,O){return Ao(i),i.updateQueue=null,l=eb(i,m,l,R),Jy(r),m=ym(),r!==null&&!_n?(bm(r,i,O),ni(r,i,O)):(At&&m&&Jp(i),i.flags|=1,Vn(r,i,l,O),i.child)}function Zb(r,i,l,m,R){if(Ao(i),i.stateNode===null){var O=Ua,j=l.contextType;typeof j=="object"&&j!==null&&(O=Hn(j)),O=new l(m,O),i.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=Im,i.stateNode=O,O._reactInternals=i,O=i.stateNode,O.props=m,O.state=i.memoizedState,O.refs={},um(i),j=l.contextType,O.context=typeof j=="object"&&j!==null?Hn(j):Ua,O.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(Pm(i,l,j,m),O.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(j=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),j!==O.state&&Im.enqueueReplaceState(O,O.state,null),wc(i,m,O,R),Cc(),O.state=i.memoizedState),typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!0}else if(r===null){O=i.stateNode;var Q=i.memoizedProps,ie=No(l,Q);O.props=ie;var pe=O.context,Se=l.contextType;j=Ua,typeof Se=="object"&&Se!==null&&(j=Hn(Se));var ke=l.getDerivedStateFromProps;Se=typeof ke=="function"||typeof O.getSnapshotBeforeUpdate=="function",Q=i.pendingProps!==Q,Se||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Q||pe!==j)&&Bb(i,O,m,j),Di=!1;var me=i.memoizedState;O.state=me,wc(i,m,O,R),Cc(),pe=i.memoizedState,Q||me!==pe||Di?(typeof ke=="function"&&(Pm(i,l,ke,m),pe=i.memoizedState),(ie=Di||jb(i,l,ie,m,me,pe,j))?(Se||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(i.flags|=4194308)):(typeof O.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=m,i.memoizedState=pe),O.props=m,O.state=pe,O.context=j,m=ie):(typeof O.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{O=i.stateNode,dm(r,i),j=i.memoizedProps,Se=No(l,j),O.props=Se,ke=i.pendingProps,me=O.context,pe=l.contextType,ie=Ua,typeof pe=="object"&&pe!==null&&(ie=Hn(pe)),Q=l.getDerivedStateFromProps,(pe=typeof Q=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(j!==ke||me!==ie)&&Bb(i,O,m,ie),Di=!1,me=i.memoizedState,O.state=me,wc(i,m,O,R),Cc();var _e=i.memoizedState;j!==ke||me!==_e||Di||r!==null&&r.dependencies!==null&&Ed(r.dependencies)?(typeof Q=="function"&&(Pm(i,l,Q,m),_e=i.memoizedState),(Se=Di||jb(i,l,Se,m,me,_e,ie)||r!==null&&r.dependencies!==null&&Ed(r.dependencies))?(pe||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(m,_e,ie),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(m,_e,ie)),typeof O.componentDidUpdate=="function"&&(i.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof O.componentDidUpdate!="function"||j===r.memoizedProps&&me===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&me===r.memoizedState||(i.flags|=1024),i.memoizedProps=m,i.memoizedState=_e),O.props=m,O.state=_e,O.context=ie,m=Se):(typeof O.componentDidUpdate!="function"||j===r.memoizedProps&&me===r.memoizedState||(i.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&me===r.memoizedState||(i.flags|=1024),m=!1)}return O=m,Wd(r,i),m=(i.flags&128)!==0,O||m?(O=i.stateNode,l=m&&typeof l.getDerivedStateFromError!="function"?null:O.render(),i.flags|=1,r!==null&&m?(i.child=Po(i,r.child,null,R),i.child=Po(i,null,l,R)):Vn(r,i,l,R),i.memoizedState=O.state,r=i.child):r=ni(r,i,R),r}function Jb(r,i,l,m){return To(),i.flags|=256,Vn(r,i,l,m),i.child}var zm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hm(r){return{baseLanes:r,cachePool:Fy()}}function Vm(r,i,l){return r=r!==null?r.childLanes&~l:0,i&&(r|=Er),r}function e1(r,i,l){var m=i.pendingProps,R=!1,O=(i.flags&128)!==0,j;if((j=O)||(j=r!==null&&r.memoizedState===null?!1:(an.current&2)!==0),j&&(R=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,r===null){if(At){if(R?Ni(i):ji(),(r=Yt)?(r=lS(r,Ur),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Li!==null?{id:ys,overflow:bs}:null,retryLane:536870912,hydrationErrors:null},l=Dy(r),l.return=i,i.child=l,zn=i,Yt=null)):r=null,r===null)throw Oi(i);return Cg(r)?i.lanes=32:i.lanes=536870912,null}var Q=m.children;return m=m.fallback,R?(ji(),R=i.mode,Q=qd({mode:"hidden",children:Q},R),m=ko(m,R,l,null),Q.return=i,m.return=i,Q.sibling=m,i.child=Q,m=i.child,m.memoizedState=Hm(l),m.childLanes=Vm(r,j,l),i.memoizedState=zm,Lc(null,m)):(Ni(i),Fm(i,Q))}var ie=r.memoizedState;if(ie!==null&&(Q=ie.dehydrated,Q!==null)){if(O)i.flags&256?(Ni(i),i.flags&=-257,i=Um(r,i,l)):i.memoizedState!==null?(ji(),i.child=r.child,i.flags|=128,i=null):(ji(),Q=m.fallback,R=i.mode,m=qd({mode:"visible",children:m.children},R),Q=ko(Q,R,l,null),Q.flags|=2,m.return=i,Q.return=i,m.sibling=Q,i.child=m,Po(i,r.child,null,l),m=i.child,m.memoizedState=Hm(l),m.childLanes=Vm(r,j,l),i.memoizedState=zm,i=Lc(null,m));else if(Ni(i),Cg(Q)){if(j=Q.nextSibling&&Q.nextSibling.dataset,j)var pe=j.dgst;j=pe,m=Error(s(419)),m.stack="",m.digest=j,vc({value:m,source:null,stack:null}),i=Um(r,i,l)}else if(_n||$a(r,i,l,!1),j=(l&r.childLanes)!==0,_n||j){if(j=Wt,j!==null&&(m=Cn(j,l),m!==0&&m!==ie.retryLane))throw ie.retryLane=m,Ro(r,m),dr(j,r,m),jm;xg(Q)||ef(),i=Um(r,i,l)}else xg(Q)?(i.flags|=192,i.child=r.child,i=null):(r=ie.treeContext,Yt=qr(Q.nextSibling),zn=i,At=!0,Ai=null,Ur=!1,r!==null&&Ny(i,r),i=Fm(i,m.children),i.flags|=4096);return i}return R?(ji(),Q=m.fallback,R=i.mode,ie=r.child,pe=ie.sibling,m=Xs(ie,{mode:"hidden",children:m.children}),m.subtreeFlags=ie.subtreeFlags&65011712,pe!==null?Q=Xs(pe,Q):(Q=ko(Q,R,l,null),Q.flags|=2),Q.return=i,m.return=i,m.sibling=Q,i.child=m,Lc(null,m),m=i.child,Q=r.child.memoizedState,Q===null?Q=Hm(l):(R=Q.cachePool,R!==null?(ie=gn._currentValue,R=R.parent!==ie?{parent:ie,pool:ie}:R):R=Fy(),Q={baseLanes:Q.baseLanes|l,cachePool:R}),m.memoizedState=Q,m.childLanes=Vm(r,j,l),i.memoizedState=zm,Lc(r.child,m)):(Ni(i),l=r.child,r=l.sibling,l=Xs(l,{mode:"visible",children:m.children}),l.return=i,l.sibling=null,r!==null&&(j=i.deletions,j===null?(i.deletions=[r],i.flags|=16):j.push(r)),i.child=l,i.memoizedState=null,l)}function Fm(r,i){return i=qd({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function qd(r,i){return r=Sr(22,r,null,i),r.lanes=0,r}function Um(r,i,l){return Po(i,r.child,null,l),r=Fm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function t1(r,i,l){r.lanes|=i;var m=r.alternate;m!==null&&(m.lanes|=i),sm(r.return,i,l)}function Wm(r,i,l,m,R,O){var j=r.memoizedState;j===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:l,tailMode:R,treeForkCount:O}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=m,j.tail=l,j.tailMode=R,j.treeForkCount=O)}function n1(r,i,l){var m=i.pendingProps,R=m.revealOrder,O=m.tail;m=m.children;var j=an.current,Q=(j&2)!==0;if(Q?(j=j&1|2,i.flags|=128):j&=1,K(an,j),Vn(r,i,m,l),m=At?gc:0,!Q&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&t1(r,l,i);else if(r.tag===19)t1(r,l,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(R){case"forwards":for(l=i.child,R=null;l!==null;)r=l.alternate,r!==null&&Dd(r)===null&&(R=l),l=l.sibling;l=R,l===null?(R=i.child,i.child=null):(R=l.sibling,l.sibling=null),Wm(i,!1,R,l,O,m);break;case"backwards":case"unstable_legacy-backwards":for(l=null,R=i.child,i.child=null;R!==null;){if(r=R.alternate,r!==null&&Dd(r)===null){i.child=R;break}r=R.sibling,R.sibling=l,l=R,R=r}Wm(i,!0,l,null,O,m);break;case"together":Wm(i,!1,null,null,void 0,m);break;default:i.memoizedState=null}return i.child}function ni(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),Hi|=i.lanes,(l&i.childLanes)===0)if(r!==null){if($a(r,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(s(153));if(i.child!==null){for(r=i.child,l=Xs(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=Xs(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function qm(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Ed(r)))}function N5(r,i,l){switch(i.tag){case 3:V(i,i.stateNode.containerInfo),Mi(i,gn,r.memoizedState.cache),To();break;case 27:case 5:re(i);break;case 4:V(i,i.stateNode.containerInfo);break;case 10:Mi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,gm(i),null;break;case 13:var m=i.memoizedState;if(m!==null)return m.dehydrated!==null?(Ni(i),i.flags|=128,null):(l&i.child.childLanes)!==0?e1(r,i,l):(Ni(i),r=ni(r,i,l),r!==null?r.sibling:null);Ni(i);break;case 19:var R=(r.flags&128)!==0;if(m=(l&i.childLanes)!==0,m||($a(r,i,l,!1),m=(l&i.childLanes)!==0),R){if(m)return n1(r,i,l);i.flags|=128}if(R=i.memoizedState,R!==null&&(R.rendering=null,R.tail=null,R.lastEffect=null),K(an,an.current),m)break;return null;case 22:return i.lanes=0,Kb(r,i,l,i.pendingProps);case 24:Mi(i,gn,r.memoizedState.cache)}return ni(r,i,l)}function r1(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps)_n=!0;else{if(!qm(r,l)&&(i.flags&128)===0)return _n=!1,N5(r,i,l);_n=(r.flags&131072)!==0}else _n=!1,At&&(i.flags&1048576)!==0&&Iy(i,gc,i.index);switch(i.lanes=0,i.tag){case 16:e:{var m=i.pendingProps;if(r=Mo(i.elementType),i.type=r,typeof r=="function")Xp(r)?(m=No(r,m),i.tag=1,i=Zb(null,i,r,m,l)):(i.tag=0,i=Bm(null,i,r,m,l));else{if(r!=null){var R=r.$$typeof;if(R===E){i.tag=11,i=qb(null,i,r,m,l);break e}else if(R===M){i.tag=14,i=Gb(null,i,r,m,l);break e}}throw i=Y(r)||r,Error(s(306,i,""))}}return i;case 0:return Bm(r,i,i.type,i.pendingProps,l);case 1:return m=i.type,R=No(m,i.pendingProps),Zb(r,i,m,R,l);case 3:e:{if(V(i,i.stateNode.containerInfo),r===null)throw Error(s(387));m=i.pendingProps;var O=i.memoizedState;R=O.element,dm(r,i),wc(i,m,null,l);var j=i.memoizedState;if(m=j.cache,Mi(i,gn,m),m!==O.cache&&im(i,[gn],l,!0),Cc(),m=j.element,O.isDehydrated)if(O={element:m,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=O,i.memoizedState=O,i.flags&256){i=Jb(r,i,m,l);break e}else if(m!==R){R=Hr(Error(s(424)),i),vc(R),i=Jb(r,i,m,l);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Yt=qr(r.firstChild),zn=i,At=!0,Ai=null,Ur=!0,l=Ky(i,null,m,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(To(),m===R){i=ni(r,i,l);break e}Vn(r,i,m,l)}i=i.child}return i;case 26:return Wd(r,i),r===null?(l=pS(i.type,null,i.pendingProps,null))?i.memoizedState=l:At||(l=i.type,r=i.pendingProps,m=lf(ee.current).createElement(l),m[fn]=i,m[hn]=r,Fn(m,l,r),pn(m),i.stateNode=m):i.memoizedState=pS(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return re(i),r===null&&At&&(m=i.stateNode=dS(i.type,i.pendingProps,ee.current),zn=i,Ur=!0,R=Yt,qi(i.type)?(wg=R,Yt=qr(m.firstChild)):Yt=R),Vn(r,i,i.pendingProps.children,l),Wd(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&At&&((R=m=Yt)&&(m=fL(m,i.type,i.pendingProps,Ur),m!==null?(i.stateNode=m,zn=i,Yt=qr(m.firstChild),Ur=!1,R=!0):R=!1),R||Oi(i)),re(i),R=i.type,O=i.pendingProps,j=r!==null?r.memoizedProps:null,m=O.children,yg(R,O)?m=null:j!==null&&yg(R,j)&&(i.flags|=32),i.memoizedState!==null&&(R=_m(r,i,k5,null,null,l),Wc._currentValue=R),Wd(r,i),Vn(r,i,m,l),i.child;case 6:return r===null&&At&&((r=l=Yt)&&(l=hL(l,i.pendingProps,Ur),l!==null?(i.stateNode=l,zn=i,Yt=null,r=!0):r=!1),r||Oi(i)),null;case 13:return e1(r,i,l);case 4:return V(i,i.stateNode.containerInfo),m=i.pendingProps,r===null?i.child=Po(i,null,m,l):Vn(r,i,m,l),i.child;case 11:return qb(r,i,i.type,i.pendingProps,l);case 7:return Vn(r,i,i.pendingProps,l),i.child;case 8:return Vn(r,i,i.pendingProps.children,l),i.child;case 12:return Vn(r,i,i.pendingProps.children,l),i.child;case 10:return m=i.pendingProps,Mi(i,i.type,m.value),Vn(r,i,m.children,l),i.child;case 9:return R=i.type._context,m=i.pendingProps.children,Ao(i),R=Hn(R),m=m(R),i.flags|=1,Vn(r,i,m,l),i.child;case 14:return Gb(r,i,i.type,i.pendingProps,l);case 15:return $b(r,i,i.type,i.pendingProps,l);case 19:return n1(r,i,l);case 31:return I5(r,i,l);case 22:return Kb(r,i,l,i.pendingProps);case 24:return Ao(i),m=Hn(gn),r===null?(R=lm(),R===null&&(R=Wt,O=om(),R.pooledCache=O,O.refCount++,O!==null&&(R.pooledCacheLanes|=l),R=O),i.memoizedState={parent:m,cache:R},um(i),Mi(i,gn,R)):((r.lanes&l)!==0&&(dm(r,i),wc(i,null,null,l),Cc()),R=r.memoizedState,O=i.memoizedState,R.parent!==m?(R={parent:m,cache:m},i.memoizedState=R,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=R),Mi(i,gn,m)):(m=O.cache,Mi(i,gn,m),m!==R.cache&&im(i,[gn],l,!0))),Vn(r,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function ri(r){r.flags|=4}function Gm(r,i,l,m,R){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(R&335544128)===R)if(r.stateNode.complete)r.flags|=8192;else if(A1())r.flags|=8192;else throw Do=Ld,cm}else r.flags&=-16777217}function s1(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!yS(i))if(A1())r.flags|=8192;else throw Do=Ld,cm}function Gd(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ot():536870912,r.lanes|=i,il|=i)}function Ac(r,i){if(!At)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var m=null;l!==null;)l.alternate!==null&&(m=l),l=l.sibling;m===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:m.sibling=null}}function Xt(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,m=0;if(i)for(var R=r.child;R!==null;)l|=R.lanes|R.childLanes,m|=R.subtreeFlags&65011712,m|=R.flags&65011712,R.return=r,R=R.sibling;else for(R=r.child;R!==null;)l|=R.lanes|R.childLanes,m|=R.subtreeFlags,m|=R.flags,R.return=r,R=R.sibling;return r.subtreeFlags|=m,r.childLanes=l,i}function j5(r,i,l){var m=i.pendingProps;switch(em(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(i),null;case 1:return Xt(i),null;case 3:return l=i.stateNode,m=null,r!==null&&(m=r.memoizedState.cache),i.memoizedState.cache!==m&&(i.flags|=2048),Js(gn),se(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Ga(i)?ri(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,nm())),Xt(i),null;case 26:var R=i.type,O=i.memoizedState;return r===null?(ri(i),O!==null?(Xt(i),s1(i,O)):(Xt(i),Gm(i,R,null,m,l))):O?O!==r.memoizedState?(ri(i),Xt(i),s1(i,O)):(Xt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==m&&ri(i),Xt(i),Gm(i,R,r,m,l)),null;case 27:if(ne(i),l=ee.current,R=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&ri(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}r=J.current,Ga(i)?jy(i):(r=dS(R,m,l),i.stateNode=r,ri(i))}return Xt(i),null;case 5:if(ne(i),R=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&ri(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}if(O=J.current,Ga(i))jy(i);else{var j=lf(ee.current);switch(O){case 1:O=j.createElementNS("http://www.w3.org/2000/svg",R);break;case 2:O=j.createElementNS("http://www.w3.org/1998/Math/MathML",R);break;default:switch(R){case"svg":O=j.createElementNS("http://www.w3.org/2000/svg",R);break;case"math":O=j.createElementNS("http://www.w3.org/1998/Math/MathML",R);break;case"script":O=j.createElement("div"),O.innerHTML="<script><\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof m.is=="string"?j.createElement("select",{is:m.is}):j.createElement("select"),m.multiple?O.multiple=!0:m.size&&(O.size=m.size);break;default:O=typeof m.is=="string"?j.createElement(R,{is:m.is}):j.createElement(R)}}O[fn]=i,O[hn]=m;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)O.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=O;e:switch(Fn(O,R,m),R){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&ri(i)}}return Xt(i),Gm(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,l),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==m&&ri(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(s(166));if(r=ee.current,Ga(i)){if(r=i.stateNode,l=i.memoizedProps,m=null,R=zn,R!==null)switch(R.tag){case 27:case 5:m=R.memoizedProps}r[fn]=i,r=!!(r.nodeValue===l||m!==null&&m.suppressHydrationWarning===!0||eS(r.nodeValue,l)),r||Oi(i,!0)}else r=lf(r).createTextNode(m),r[fn]=i,i.stateNode=r}return Xt(i),null;case 31:if(l=i.memoizedState,r===null||r.memoizedState!==null){if(m=Ga(i),l!==null){if(r===null){if(!m)throw Error(s(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));r[fn]=i}else To(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),r=!1}else l=nm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return i.flags&256?(Cr(i),i):(Cr(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Xt(i),null;case 13:if(m=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(R=Ga(i),m!==null&&m.dehydrated!==null){if(r===null){if(!R)throw Error(s(318));if(R=i.memoizedState,R=R!==null?R.dehydrated:null,!R)throw Error(s(317));R[fn]=i}else To(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),R=!1}else R=nm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=R),R=!0;if(!R)return i.flags&256?(Cr(i),i):(Cr(i),null)}return Cr(i),(i.flags&128)!==0?(i.lanes=l,i):(l=m!==null,r=r!==null&&r.memoizedState!==null,l&&(m=i.child,R=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(R=m.alternate.memoizedState.cachePool.pool),O=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(O=m.memoizedState.cachePool.pool),O!==R&&(m.flags|=2048)),l!==r&&l&&(i.child.flags|=8192),Gd(i,i.updateQueue),Xt(i),null);case 4:return se(),r===null&&pg(i.stateNode.containerInfo),Xt(i),null;case 10:return Js(i.type),Xt(i),null;case 19:if(G(an),m=i.memoizedState,m===null)return Xt(i),null;if(R=(i.flags&128)!==0,O=m.rendering,O===null)if(R)Ac(m,!1);else{if(on!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(O=Dd(r),O!==null){for(i.flags|=128,Ac(m,!1),r=O.updateQueue,i.updateQueue=r,Gd(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)My(l,r),l=l.sibling;return K(an,an.current&1|2),At&&Qs(i,m.treeForkCount),i.child}r=r.sibling}m.tail!==null&&be()>Qd&&(i.flags|=128,R=!0,Ac(m,!1),i.lanes=4194304)}else{if(!R)if(r=Dd(O),r!==null){if(i.flags|=128,R=!0,r=r.updateQueue,i.updateQueue=r,Gd(i,r),Ac(m,!0),m.tail===null&&m.tailMode==="hidden"&&!O.alternate&&!At)return Xt(i),null}else 2*be()-m.renderingStartTime>Qd&&l!==536870912&&(i.flags|=128,R=!0,Ac(m,!1),i.lanes=4194304);m.isBackwards?(O.sibling=i.child,i.child=O):(r=m.last,r!==null?r.sibling=O:i.child=O,m.last=O)}return m.tail!==null?(r=m.tail,m.rendering=r,m.tail=r.sibling,m.renderingStartTime=be(),r.sibling=null,l=an.current,K(an,R?l&1|2:l&1),At&&Qs(i,m.treeForkCount),r):(Xt(i),null);case 22:case 23:return Cr(i),mm(),m=i.memoizedState!==null,r!==null?r.memoizedState!==null!==m&&(i.flags|=8192):m&&(i.flags|=8192),m?(l&536870912)!==0&&(i.flags&128)===0&&(Xt(i),i.subtreeFlags&6&&(i.flags|=8192)):Xt(i),l=i.updateQueue,l!==null&&Gd(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==l&&(i.flags|=2048),r!==null&&G(Oo),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Js(gn),Xt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function B5(r,i){switch(em(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Js(gn),se(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return ne(i),null;case 31:if(i.memoizedState!==null){if(Cr(i),i.alternate===null)throw Error(s(340));To()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Cr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(s(340));To()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return G(an),null;case 4:return se(),null;case 10:return Js(i.type),null;case 22:case 23:return Cr(i),mm(),r!==null&&G(Oo),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Js(gn),null;case 25:return null;default:return null}}function i1(r,i){switch(em(i),i.tag){case 3:Js(gn),se();break;case 26:case 27:case 5:ne(i);break;case 4:se();break;case 31:i.memoizedState!==null&&Cr(i);break;case 13:Cr(i);break;case 19:G(an);break;case 10:Js(i.type);break;case 22:case 23:Cr(i),mm(),r!==null&&G(Oo);break;case 24:Js(gn)}}function Oc(r,i){try{var l=i.updateQueue,m=l!==null?l.lastEffect:null;if(m!==null){var R=m.next;l=R;do{if((l.tag&r)===r){m=void 0;var O=l.create,j=l.inst;m=O(),j.destroy=m}l=l.next}while(l!==R)}}catch(Q){zt(i,i.return,Q)}}function Bi(r,i,l){try{var m=i.updateQueue,R=m!==null?m.lastEffect:null;if(R!==null){var O=R.next;m=O;do{if((m.tag&r)===r){var j=m.inst,Q=j.destroy;if(Q!==void 0){j.destroy=void 0,R=i;var ie=l,pe=Q;try{pe()}catch(Se){zt(R,ie,Se)}}}m=m.next}while(m!==O)}}catch(Se){zt(i,i.return,Se)}}function o1(r){var i=r.updateQueue;if(i!==null){var l=r.stateNode;try{Xy(i,l)}catch(m){zt(r,r.return,m)}}}function a1(r,i,l){l.props=No(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(m){zt(r,i,m)}}function Mc(r,i){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var m=r.stateNode;break;case 30:m=r.stateNode;break;default:m=r.stateNode}typeof l=="function"?r.refCleanup=l(m):l.current=m}}catch(R){zt(r,i,R)}}function Ss(r,i){var l=r.ref,m=r.refCleanup;if(l!==null)if(typeof m=="function")try{m()}catch(R){zt(r,i,R)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(R){zt(r,i,R)}else l.current=null}function l1(r){var i=r.type,l=r.memoizedProps,m=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&m.focus();break e;case"img":l.src?m.src=l.src:l.srcSet&&(m.srcset=l.srcSet)}}catch(R){zt(r,r.return,R)}}function $m(r,i,l){try{var m=r.stateNode;oL(m,r.type,l,i),m[hn]=i}catch(R){zt(r,r.return,R)}}function c1(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&qi(r.type)||r.tag===4}function Km(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||c1(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&qi(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Ym(r,i,l){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(r),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=os));else if(m!==4&&(m===27&&qi(r.type)&&(l=r.stateNode,i=null),r=r.child,r!==null))for(Ym(r,i,l),r=r.sibling;r!==null;)Ym(r,i,l),r=r.sibling}function $d(r,i,l){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(m!==4&&(m===27&&qi(r.type)&&(l=r.stateNode),r=r.child,r!==null))for($d(r,i,l),r=r.sibling;r!==null;)$d(r,i,l),r=r.sibling}function u1(r){var i=r.stateNode,l=r.memoizedProps;try{for(var m=r.type,R=i.attributes;R.length;)i.removeAttributeNode(R[0]);Fn(i,m,l),i[fn]=r,i[hn]=l}catch(O){zt(r,r.return,O)}}var si=!1,yn=!1,Xm=!1,d1=typeof WeakSet=="function"?WeakSet:Set,Mn=null;function z5(r,i){if(r=r.containerInfo,vg=mf,r=Cy(r),Up(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var m=l.getSelection&&l.getSelection();if(m&&m.rangeCount!==0){l=m.anchorNode;var R=m.anchorOffset,O=m.focusNode;m=m.focusOffset;try{l.nodeType,O.nodeType}catch{l=null;break e}var j=0,Q=-1,ie=-1,pe=0,Se=0,ke=r,me=null;t:for(;;){for(var _e;ke!==l||R!==0&&ke.nodeType!==3||(Q=j+R),ke!==O||m!==0&&ke.nodeType!==3||(ie=j+m),ke.nodeType===3&&(j+=ke.nodeValue.length),(_e=ke.firstChild)!==null;)me=ke,ke=_e;for(;;){if(ke===r)break t;if(me===l&&++pe===R&&(Q=j),me===O&&++Se===m&&(ie=j),(_e=ke.nextSibling)!==null)break;ke=me,me=ke.parentNode}ke=_e}l=Q===-1||ie===-1?null:{start:Q,end:ie}}else l=null}l=l||{start:0,end:0}}else l=null;for(_g={focusedElem:r,selectionRange:l},mf=!1,Mn=i;Mn!==null;)if(i=Mn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Mn=r;else for(;Mn!==null;){switch(i=Mn,O=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)R=r[l],R.ref.impl=R.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&O!==null){r=void 0,l=i,R=O.memoizedProps,O=O.memoizedState,m=l.stateNode;try{var Ge=No(l.type,R);r=m.getSnapshotBeforeUpdate(Ge,O),m.__reactInternalSnapshotBeforeUpdate=r}catch(ct){zt(l,l.return,ct)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,l=r.nodeType,l===9)Sg(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Sg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(s(163))}if(r=i.sibling,r!==null){r.return=i.return,Mn=r;break}Mn=i.return}}function f1(r,i,l){var m=l.flags;switch(l.tag){case 0:case 11:case 15:oi(r,l),m&4&&Oc(5,l);break;case 1:if(oi(r,l),m&4)if(r=l.stateNode,i===null)try{r.componentDidMount()}catch(j){zt(l,l.return,j)}else{var R=No(l.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(R,i,r.__reactInternalSnapshotBeforeUpdate)}catch(j){zt(l,l.return,j)}}m&64&&o1(l),m&512&&Mc(l,l.return);break;case 3:if(oi(r,l),m&64&&(r=l.updateQueue,r!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Xy(r,i)}catch(j){zt(l,l.return,j)}}break;case 27:i===null&&m&4&&u1(l);case 26:case 5:oi(r,l),i===null&&m&4&&l1(l),m&512&&Mc(l,l.return);break;case 12:oi(r,l);break;case 31:oi(r,l),m&4&&m1(r,l);break;case 13:oi(r,l),m&4&&g1(r,l),m&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=K5.bind(null,l),pL(r,l))));break;case 22:if(m=l.memoizedState!==null||si,!m){i=i!==null&&i.memoizedState!==null||yn,R=si;var O=yn;si=m,(yn=i)&&!O?ai(r,l,(l.subtreeFlags&8772)!==0):oi(r,l),si=R,yn=O}break;case 30:break;default:oi(r,l)}}function h1(r){var i=r.alternate;i!==null&&(r.alternate=null,h1(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&So(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Zt=null,ar=!1;function ii(r,i,l){for(l=l.child;l!==null;)p1(r,i,l),l=l.sibling}function p1(r,i,l){if(Re&&typeof Re.onCommitFiberUnmount=="function")try{Re.onCommitFiberUnmount(et,l)}catch{}switch(l.tag){case 26:yn||Ss(l,i),ii(r,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:yn||Ss(l,i);var m=Zt,R=ar;qi(l.type)&&(Zt=l.stateNode,ar=!1),ii(r,i,l),Vc(l.stateNode),Zt=m,ar=R;break;case 5:yn||Ss(l,i);case 6:if(m=Zt,R=ar,Zt=null,ii(r,i,l),Zt=m,ar=R,Zt!==null)if(ar)try{(Zt.nodeType===9?Zt.body:Zt.nodeName==="HTML"?Zt.ownerDocument.body:Zt).removeChild(l.stateNode)}catch(O){zt(l,i,O)}else try{Zt.removeChild(l.stateNode)}catch(O){zt(l,i,O)}break;case 18:Zt!==null&&(ar?(r=Zt,oS(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),hl(r)):oS(Zt,l.stateNode));break;case 4:m=Zt,R=ar,Zt=l.stateNode.containerInfo,ar=!0,ii(r,i,l),Zt=m,ar=R;break;case 0:case 11:case 14:case 15:Bi(2,l,i),yn||Bi(4,l,i),ii(r,i,l);break;case 1:yn||(Ss(l,i),m=l.stateNode,typeof m.componentWillUnmount=="function"&&a1(l,i,m)),ii(r,i,l);break;case 21:ii(r,i,l);break;case 22:yn=(m=yn)||l.memoizedState!==null,ii(r,i,l),yn=m;break;default:ii(r,i,l)}}function m1(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{hl(r)}catch(l){zt(i,i.return,l)}}}function g1(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{hl(r)}catch(l){zt(i,i.return,l)}}function H5(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new d1),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new d1),i;default:throw Error(s(435,r.tag))}}function Kd(r,i){var l=H5(r);i.forEach(function(m){if(!l.has(m)){l.add(m);var R=Y5.bind(null,r,m);m.then(R,R)}})}function lr(r,i){var l=i.deletions;if(l!==null)for(var m=0;m<l.length;m++){var R=l[m],O=r,j=i,Q=j;e:for(;Q!==null;){switch(Q.tag){case 27:if(qi(Q.type)){Zt=Q.stateNode,ar=!1;break e}break;case 5:Zt=Q.stateNode,ar=!1;break e;case 3:case 4:Zt=Q.stateNode.containerInfo,ar=!0;break e}Q=Q.return}if(Zt===null)throw Error(s(160));p1(O,j,R),Zt=null,ar=!1,O=R.alternate,O!==null&&(O.return=null),R.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)v1(i,r),i=i.sibling}var ls=null;function v1(r,i){var l=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:lr(i,r),cr(r),m&4&&(Bi(3,r,r.return),Oc(3,r),Bi(5,r,r.return));break;case 1:lr(i,r),cr(r),m&512&&(yn||l===null||Ss(l,l.return)),m&64&&si&&(r=r.updateQueue,r!==null&&(m=r.callbacks,m!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?m:l.concat(m))));break;case 26:var R=ls;if(lr(i,r),cr(r),m&512&&(yn||l===null||Ss(l,l.return)),m&4){var O=l!==null?l.memoizedState:null;if(m=r.memoizedState,l===null)if(m===null)if(r.stateNode===null){e:{m=r.type,l=r.memoizedProps,R=R.ownerDocument||R;t:switch(m){case"title":O=R.getElementsByTagName("title")[0],(!O||O[bo]||O[fn]||O.namespaceURI==="http://www.w3.org/2000/svg"||O.hasAttribute("itemprop"))&&(O=R.createElement(m),R.head.insertBefore(O,R.querySelector("head > title"))),Fn(O,m,l),O[fn]=r,pn(O),m=O;break e;case"link":var j=vS("link","href",R).get(m+(l.href||""));if(j){for(var Q=0;Q<j.length;Q++)if(O=j[Q],O.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&O.getAttribute("rel")===(l.rel==null?null:l.rel)&&O.getAttribute("title")===(l.title==null?null:l.title)&&O.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){j.splice(Q,1);break t}}O=R.createElement(m),Fn(O,m,l),R.head.appendChild(O);break;case"meta":if(j=vS("meta","content",R).get(m+(l.content||""))){for(Q=0;Q<j.length;Q++)if(O=j[Q],O.getAttribute("content")===(l.content==null?null:""+l.content)&&O.getAttribute("name")===(l.name==null?null:l.name)&&O.getAttribute("property")===(l.property==null?null:l.property)&&O.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&O.getAttribute("charset")===(l.charSet==null?null:l.charSet)){j.splice(Q,1);break t}}O=R.createElement(m),Fn(O,m,l),R.head.appendChild(O);break;default:throw Error(s(468,m))}O[fn]=r,pn(O),m=O}r.stateNode=m}else _S(R,r.type,r.stateNode);else r.stateNode=gS(R,m,r.memoizedProps);else O!==m?(O===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):O.count--,m===null?_S(R,r.type,r.stateNode):gS(R,m,r.memoizedProps)):m===null&&r.stateNode!==null&&$m(r,r.memoizedProps,l.memoizedProps)}break;case 27:lr(i,r),cr(r),m&512&&(yn||l===null||Ss(l,l.return)),l!==null&&m&4&&$m(r,r.memoizedProps,l.memoizedProps);break;case 5:if(lr(i,r),cr(r),m&512&&(yn||l===null||Ss(l,l.return)),r.flags&32){R=r.stateNode;try{nt(R,"")}catch(Ge){zt(r,r.return,Ge)}}m&4&&r.stateNode!=null&&(R=r.memoizedProps,$m(r,R,l!==null?l.memoizedProps:R)),m&1024&&(Xm=!0);break;case 6:if(lr(i,r),cr(r),m&4){if(r.stateNode===null)throw Error(s(162));m=r.memoizedProps,l=r.stateNode;try{l.nodeValue=m}catch(Ge){zt(r,r.return,Ge)}}break;case 3:if(df=null,R=ls,ls=cf(i.containerInfo),lr(i,r),ls=R,cr(r),m&4&&l!==null&&l.memoizedState.isDehydrated)try{hl(i.containerInfo)}catch(Ge){zt(r,r.return,Ge)}Xm&&(Xm=!1,_1(r));break;case 4:m=ls,ls=cf(r.stateNode.containerInfo),lr(i,r),cr(r),ls=m;break;case 12:lr(i,r),cr(r);break;case 31:lr(i,r),cr(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,Kd(r,m)));break;case 13:lr(i,r),cr(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Xd=be()),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,Kd(r,m)));break;case 22:R=r.memoizedState!==null;var ie=l!==null&&l.memoizedState!==null,pe=si,Se=yn;if(si=pe||R,yn=Se||ie,lr(i,r),yn=Se,si=pe,cr(r),m&8192)e:for(i=r.stateNode,i._visibility=R?i._visibility&-2:i._visibility|1,R&&(l===null||ie||si||yn||jo(r)),l=null,i=r;;){if(i.tag===5||i.tag===26){if(l===null){ie=l=i;try{if(O=ie.stateNode,R)j=O.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{Q=ie.stateNode;var ke=ie.memoizedProps.style,me=ke!=null&&ke.hasOwnProperty("display")?ke.display:null;Q.style.display=me==null||typeof me=="boolean"?"":(""+me).trim()}}catch(Ge){zt(ie,ie.return,Ge)}}}else if(i.tag===6){if(l===null){ie=i;try{ie.stateNode.nodeValue=R?"":ie.memoizedProps}catch(Ge){zt(ie,ie.return,Ge)}}}else if(i.tag===18){if(l===null){ie=i;try{var _e=ie.stateNode;R?aS(_e,!0):aS(ie.stateNode,!1)}catch(Ge){zt(ie,ie.return,Ge)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}m&4&&(m=r.updateQueue,m!==null&&(l=m.retryQueue,l!==null&&(m.retryQueue=null,Kd(r,l))));break;case 19:lr(i,r),cr(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,Kd(r,m)));break;case 30:break;case 21:break;default:lr(i,r),cr(r)}}function cr(r){var i=r.flags;if(i&2){try{for(var l,m=r.return;m!==null;){if(c1(m)){l=m;break}m=m.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var R=l.stateNode,O=Km(r);$d(r,O,R);break;case 5:var j=l.stateNode;l.flags&32&&(nt(j,""),l.flags&=-33);var Q=Km(r);$d(r,Q,j);break;case 3:case 4:var ie=l.stateNode.containerInfo,pe=Km(r);Ym(r,pe,ie);break;default:throw Error(s(161))}}catch(Se){zt(r,r.return,Se)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function _1(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;_1(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function oi(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)f1(r,i.alternate,i),i=i.sibling}function jo(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Bi(4,i,i.return),jo(i);break;case 1:Ss(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&a1(i,i.return,l),jo(i);break;case 27:Vc(i.stateNode);case 26:case 5:Ss(i,i.return),jo(i);break;case 22:i.memoizedState===null&&jo(i);break;case 30:jo(i);break;default:jo(i)}r=r.sibling}}function ai(r,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var m=i.alternate,R=r,O=i,j=O.flags;switch(O.tag){case 0:case 11:case 15:ai(R,O,l),Oc(4,O);break;case 1:if(ai(R,O,l),m=O,R=m.stateNode,typeof R.componentDidMount=="function")try{R.componentDidMount()}catch(pe){zt(m,m.return,pe)}if(m=O,R=m.updateQueue,R!==null){var Q=m.stateNode;try{var ie=R.shared.hiddenCallbacks;if(ie!==null)for(R.shared.hiddenCallbacks=null,R=0;R<ie.length;R++)Yy(ie[R],Q)}catch(pe){zt(m,m.return,pe)}}l&&j&64&&o1(O),Mc(O,O.return);break;case 27:u1(O);case 26:case 5:ai(R,O,l),l&&m===null&&j&4&&l1(O),Mc(O,O.return);break;case 12:ai(R,O,l);break;case 31:ai(R,O,l),l&&j&4&&m1(R,O);break;case 13:ai(R,O,l),l&&j&4&&g1(R,O);break;case 22:O.memoizedState===null&&ai(R,O,l),Mc(O,O.return);break;case 30:break;default:ai(R,O,l)}i=i.sibling}}function Qm(r,i){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&_c(l))}function Zm(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&_c(r))}function cs(r,i,l,m){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)y1(r,i,l,m),i=i.sibling}function y1(r,i,l,m){var R=i.flags;switch(i.tag){case 0:case 11:case 15:cs(r,i,l,m),R&2048&&Oc(9,i);break;case 1:cs(r,i,l,m);break;case 3:cs(r,i,l,m),R&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&_c(r)));break;case 12:if(R&2048){cs(r,i,l,m),r=i.stateNode;try{var O=i.memoizedProps,j=O.id,Q=O.onPostCommit;typeof Q=="function"&&Q(j,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ie){zt(i,i.return,ie)}}else cs(r,i,l,m);break;case 31:cs(r,i,l,m);break;case 13:cs(r,i,l,m);break;case 23:break;case 22:O=i.stateNode,j=i.alternate,i.memoizedState!==null?O._visibility&2?cs(r,i,l,m):Dc(r,i):O._visibility&2?cs(r,i,l,m):(O._visibility|=2,nl(r,i,l,m,(i.subtreeFlags&10256)!==0||!1)),R&2048&&Qm(j,i);break;case 24:cs(r,i,l,m),R&2048&&Zm(i.alternate,i);break;default:cs(r,i,l,m)}}function nl(r,i,l,m,R){for(R=R&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var O=r,j=i,Q=l,ie=m,pe=j.flags;switch(j.tag){case 0:case 11:case 15:nl(O,j,Q,ie,R),Oc(8,j);break;case 23:break;case 22:var Se=j.stateNode;j.memoizedState!==null?Se._visibility&2?nl(O,j,Q,ie,R):Dc(O,j):(Se._visibility|=2,nl(O,j,Q,ie,R)),R&&pe&2048&&Qm(j.alternate,j);break;case 24:nl(O,j,Q,ie,R),R&&pe&2048&&Zm(j.alternate,j);break;default:nl(O,j,Q,ie,R)}i=i.sibling}}function Dc(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=r,m=i,R=m.flags;switch(m.tag){case 22:Dc(l,m),R&2048&&Qm(m.alternate,m);break;case 24:Dc(l,m),R&2048&&Zm(m.alternate,m);break;default:Dc(l,m)}i=i.sibling}}var Pc=8192;function rl(r,i,l){if(r.subtreeFlags&Pc)for(r=r.child;r!==null;)b1(r,i,l),r=r.sibling}function b1(r,i,l){switch(r.tag){case 26:rl(r,i,l),r.flags&Pc&&r.memoizedState!==null&&RL(l,ls,r.memoizedState,r.memoizedProps);break;case 5:rl(r,i,l);break;case 3:case 4:var m=ls;ls=cf(r.stateNode.containerInfo),rl(r,i,l),ls=m;break;case 22:r.memoizedState===null&&(m=r.alternate,m!==null&&m.memoizedState!==null?(m=Pc,Pc=16777216,rl(r,i,l),Pc=m):rl(r,i,l));break;default:rl(r,i,l)}}function S1(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function Ic(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var m=i[l];Mn=m,C1(m,r)}S1(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)x1(r),r=r.sibling}function x1(r){switch(r.tag){case 0:case 11:case 15:Ic(r),r.flags&2048&&Bi(9,r,r.return);break;case 3:Ic(r);break;case 12:Ic(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Yd(r)):Ic(r);break;default:Ic(r)}}function Yd(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var m=i[l];Mn=m,C1(m,r)}S1(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Bi(8,i,i.return),Yd(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Yd(i));break;default:Yd(i)}r=r.sibling}}function C1(r,i){for(;Mn!==null;){var l=Mn;switch(l.tag){case 0:case 11:case 15:Bi(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var m=l.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:_c(l.memoizedState.cache)}if(m=l.child,m!==null)m.return=l,Mn=m;else e:for(l=r;Mn!==null;){m=Mn;var R=m.sibling,O=m.return;if(h1(m),m===l){Mn=null;break e}if(R!==null){R.return=O,Mn=R;break e}Mn=O}}}var V5={getCacheForType:function(r){var i=Hn(gn),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l},cacheSignal:function(){return Hn(gn).controller.signal}},F5=typeof WeakMap=="function"?WeakMap:Map,Pt=0,Wt=null,Et=null,Tt=0,Bt=0,wr=null,zi=!1,sl=!1,Jm=!1,li=0,on=0,Hi=0,Bo=0,eg=0,Er=0,il=0,Nc=null,ur=null,tg=!1,Xd=0,w1=0,Qd=1/0,Zd=null,Vi=null,wn=0,Fi=null,ol=null,ci=0,ng=0,rg=null,E1=null,jc=0,sg=null;function Rr(){return(Pt&2)!==0&&Tt!==0?Tt&-Tt:F.T!==null?ug():gs()}function R1(){if(Er===0)if((Tt&536870912)===0||At){var r=tn;tn<<=1,(tn&3932160)===0&&(tn=262144),Er=r}else Er=536870912;return r=xr.current,r!==null&&(r.flags|=32),Er}function dr(r,i,l){(r===Wt&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)&&(al(r,0),Ui(r,Tt,Er,!1)),bt(r,l),((Pt&2)===0||r!==Wt)&&(r===Wt&&((Pt&2)===0&&(Bo|=l),on===4&&Ui(r,Tt,Er,!1)),xs(r))}function k1(r,i,l){if((Pt&6)!==0)throw Error(s(327));var m=!l&&(i&127)===0&&(i&r.expiredLanes)===0||Ot(r,i),R=m?q5(r,i):og(r,i,!0),O=m;do{if(R===0){sl&&!m&&Ui(r,i,0,!1);break}else{if(l=r.current.alternate,O&&!U5(l)){R=og(r,i,!1),O=!1;continue}if(R===2){if(O=i,r.errorRecoveryDisabledLanes&O)var j=0;else j=r.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var Q=r;R=Nc;var ie=Q.current.memoizedState.isDehydrated;if(ie&&(al(Q,j).flags|=256),j=og(Q,j,!1),j!==2){if(Jm&&!ie){Q.errorRecoveryDisabledLanes|=O,Bo|=O,R=4;break e}O=ur,ur=R,O!==null&&(ur===null?ur=O:ur.push.apply(ur,O))}R=j}if(O=!1,R!==2)continue}}if(R===1){al(r,0),Ui(r,i,0,!0);break}e:{switch(m=r,O=R,O){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Ui(m,i,Er,!zi);break e;case 2:ur=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(R=Xd+300-be(),10<R)){if(Ui(m,i,Er,!zi),Je(m,0,!0)!==0)break e;ci=i,m.timeoutHandle=sS(T1.bind(null,m,l,ur,Zd,tg,i,Er,Bo,il,zi,O,"Throttled",-0,0),R);break e}T1(m,l,ur,Zd,tg,i,Er,Bo,il,zi,O,null,-0,0)}}break}while(!0);xs(r)}function T1(r,i,l,m,R,O,j,Q,ie,pe,Se,ke,me,_e){if(r.timeoutHandle=-1,ke=i.subtreeFlags,ke&8192||(ke&16785408)===16785408){ke={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:os},b1(i,O,ke);var Ge=(O&62914560)===O?Xd-be():(O&4194048)===O?w1-be():0;if(Ge=kL(ke,Ge),Ge!==null){ci=O,r.cancelPendingCommit=Ge(N1.bind(null,r,i,O,l,m,R,j,Q,ie,Se,ke,null,me,_e)),Ui(r,O,j,!pe);return}}N1(r,i,O,l,m,R,j,Q,ie)}function U5(r){for(var i=r;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var m=0;m<l.length;m++){var R=l[m],O=R.getSnapshot;R=R.value;try{if(!br(O(),R))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ui(r,i,l,m){i&=~eg,i&=~Bo,r.suspendedLanes|=i,r.pingedLanes&=~i,m&&(r.warmLanes|=i),m=r.expirationTimes;for(var R=i;0<R;){var O=31-at(R),j=1<<O;m[O]=-1,R&=~j}l!==0&&Qe(r,l,i)}function Jd(){return(Pt&6)===0?(Bc(0),!1):!0}function ig(){if(Et!==null){if(Bt===0)var r=Et.return;else r=Et,Zs=Lo=null,Sm(r),Qa=null,bc=0,r=Et;for(;r!==null;)i1(r.alternate,r),r=r.return;Et=null}}function al(r,i){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,cL(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),ci=0,ig(),Wt=r,Et=l=Xs(r.current,null),Tt=i,Bt=0,wr=null,zi=!1,sl=Ot(r,i),Jm=!1,il=Er=eg=Bo=Hi=on=0,ur=Nc=null,tg=!1,(i&8)!==0&&(i|=i&32);var m=r.entangledLanes;if(m!==0)for(r=r.entanglements,m&=i;0<m;){var R=31-at(m),O=1<<R;i|=r[R],m&=~O}return li=i,bd(),l}function L1(r,i){gt=null,F.H=Tc,i===Xa||i===Td?(i=qy(),Bt=3):i===cm?(i=qy(),Bt=4):Bt=i===jm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,wr=i,Et===null&&(on=1,Fd(r,Hr(i,r.current)))}function A1(){var r=xr.current;return r===null?!0:(Tt&4194048)===Tt?Wr===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?r===Wr:!1}function O1(){var r=F.H;return F.H=Tc,r===null?Tc:r}function M1(){var r=F.A;return F.A=V5,r}function ef(){on=4,zi||(Tt&4194048)!==Tt&&xr.current!==null||(sl=!0),(Hi&134217727)===0&&(Bo&134217727)===0||Wt===null||Ui(Wt,Tt,Er,!1)}function og(r,i,l){var m=Pt;Pt|=2;var R=O1(),O=M1();(Wt!==r||Tt!==i)&&(Zd=null,al(r,i)),i=!1;var j=on;e:do try{if(Bt!==0&&Et!==null){var Q=Et,ie=wr;switch(Bt){case 8:ig(),j=6;break e;case 3:case 2:case 9:case 6:xr.current===null&&(i=!0);var pe=Bt;if(Bt=0,wr=null,ll(r,Q,ie,pe),l&&sl){j=0;break e}break;default:pe=Bt,Bt=0,wr=null,ll(r,Q,ie,pe)}}W5(),j=on;break}catch(Se){L1(r,Se)}while(!0);return i&&r.shellSuspendCounter++,Zs=Lo=null,Pt=m,F.H=R,F.A=O,Et===null&&(Wt=null,Tt=0,bd()),j}function W5(){for(;Et!==null;)D1(Et)}function q5(r,i){var l=Pt;Pt|=2;var m=O1(),R=M1();Wt!==r||Tt!==i?(Zd=null,Qd=be()+500,al(r,i)):sl=Ot(r,i);e:do try{if(Bt!==0&&Et!==null){i=Et;var O=wr;t:switch(Bt){case 1:Bt=0,wr=null,ll(r,i,O,1);break;case 2:case 9:if(Uy(O)){Bt=0,wr=null,P1(i);break}i=function(){Bt!==2&&Bt!==9||Wt!==r||(Bt=7),xs(r)},O.then(i,i);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:Uy(O)?(Bt=0,wr=null,P1(i)):(Bt=0,wr=null,ll(r,i,O,7));break;case 5:var j=null;switch(Et.tag){case 26:j=Et.memoizedState;case 5:case 27:var Q=Et;if(j?yS(j):Q.stateNode.complete){Bt=0,wr=null;var ie=Q.sibling;if(ie!==null)Et=ie;else{var pe=Q.return;pe!==null?(Et=pe,tf(pe)):Et=null}break t}}Bt=0,wr=null,ll(r,i,O,5);break;case 6:Bt=0,wr=null,ll(r,i,O,6);break;case 8:ig(),on=6;break e;default:throw Error(s(462))}}G5();break}catch(Se){L1(r,Se)}while(!0);return Zs=Lo=null,F.H=m,F.A=R,Pt=l,Et!==null?0:(Wt=null,Tt=0,bd(),on)}function G5(){for(;Et!==null&&!Ae();)D1(Et)}function D1(r){var i=r1(r.alternate,r,li);r.memoizedProps=r.pendingProps,i===null?tf(r):Et=i}function P1(r){var i=r,l=i.alternate;switch(i.tag){case 15:case 0:i=Qb(l,i,i.pendingProps,i.type,void 0,Tt);break;case 11:i=Qb(l,i,i.pendingProps,i.type.render,i.ref,Tt);break;case 5:Sm(i);default:i1(l,i),i=Et=My(i,li),i=r1(l,i,li)}r.memoizedProps=r.pendingProps,i===null?tf(r):Et=i}function ll(r,i,l,m){Zs=Lo=null,Sm(i),Qa=null,bc=0;var R=i.return;try{if(P5(r,R,i,l,Tt)){on=1,Fd(r,Hr(l,r.current)),Et=null;return}}catch(O){if(R!==null)throw Et=R,O;on=1,Fd(r,Hr(l,r.current)),Et=null;return}i.flags&32768?(At||m===1?r=!0:sl||(Tt&536870912)!==0?r=!1:(zi=r=!0,(m===2||m===9||m===3||m===6)&&(m=xr.current,m!==null&&m.tag===13&&(m.flags|=16384))),I1(i,r)):tf(i)}function tf(r){var i=r;do{if((i.flags&32768)!==0){I1(i,zi);return}r=i.return;var l=j5(i.alternate,i,li);if(l!==null){Et=l;return}if(i=i.sibling,i!==null){Et=i;return}Et=i=r}while(i!==null);on===0&&(on=5)}function I1(r,i){do{var l=B5(r.alternate,r);if(l!==null){l.flags&=32767,Et=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(r=r.sibling,r!==null)){Et=r;return}Et=r=l}while(r!==null);on=6,Et=null}function N1(r,i,l,m,R,O,j,Q,ie){r.cancelPendingCommit=null;do nf();while(wn!==0);if((Pt&6)!==0)throw Error(s(327));if(i!==null){if(i===r.current)throw Error(s(177));if(O=i.lanes|i.childLanes,O|=Kp,St(r,l,O,j,Q,ie),r===Wt&&(Et=Wt=null,Tt=0),ol=i,Fi=r,ci=l,ng=O,rg=R,E1=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,X5(ze,function(){return V1(),null})):(r.callbackNode=null,r.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=F.T,F.T=null,R=q.p,q.p=2,j=Pt,Pt|=4;try{z5(r,i,l)}finally{Pt=j,q.p=R,F.T=m}}wn=1,j1(),B1(),z1()}}function j1(){if(wn===1){wn=0;var r=Fi,i=ol,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=F.T,F.T=null;var m=q.p;q.p=2;var R=Pt;Pt|=4;try{v1(i,r);var O=_g,j=Cy(r.containerInfo),Q=O.focusedElem,ie=O.selectionRange;if(j!==Q&&Q&&Q.ownerDocument&&xy(Q.ownerDocument.documentElement,Q)){if(ie!==null&&Up(Q)){var pe=ie.start,Se=ie.end;if(Se===void 0&&(Se=pe),"selectionStart"in Q)Q.selectionStart=pe,Q.selectionEnd=Math.min(Se,Q.value.length);else{var ke=Q.ownerDocument||document,me=ke&&ke.defaultView||window;if(me.getSelection){var _e=me.getSelection(),Ge=Q.textContent.length,ct=Math.min(ie.start,Ge),Ut=ie.end===void 0?ct:Math.min(ie.end,Ge);!_e.extend&&ct>Ut&&(j=Ut,Ut=ct,ct=j);var ue=Sy(Q,ct),le=Sy(Q,Ut);if(ue&&le&&(_e.rangeCount!==1||_e.anchorNode!==ue.node||_e.anchorOffset!==ue.offset||_e.focusNode!==le.node||_e.focusOffset!==le.offset)){var fe=ke.createRange();fe.setStart(ue.node,ue.offset),_e.removeAllRanges(),ct>Ut?(_e.addRange(fe),_e.extend(le.node,le.offset)):(fe.setEnd(le.node,le.offset),_e.addRange(fe))}}}}for(ke=[],_e=Q;_e=_e.parentNode;)_e.nodeType===1&&ke.push({element:_e,left:_e.scrollLeft,top:_e.scrollTop});for(typeof Q.focus=="function"&&Q.focus(),Q=0;Q<ke.length;Q++){var we=ke[Q];we.element.scrollLeft=we.left,we.element.scrollTop=we.top}}mf=!!vg,_g=vg=null}finally{Pt=R,q.p=m,F.T=l}}r.current=i,wn=2}}function B1(){if(wn===2){wn=0;var r=Fi,i=ol,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=F.T,F.T=null;var m=q.p;q.p=2;var R=Pt;Pt|=4;try{f1(r,i.alternate,i)}finally{Pt=R,q.p=m,F.T=l}}wn=3}}function z1(){if(wn===4||wn===3){wn=0,ae();var r=Fi,i=ol,l=ci,m=E1;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?wn=5:(wn=0,ol=Fi=null,H1(r,r.pendingLanes));var R=r.pendingLanes;if(R===0&&(Vi=null),Bn(l),i=i.stateNode,Re&&typeof Re.onCommitFiberRoot=="function")try{Re.onCommitFiberRoot(et,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=F.T,R=q.p,q.p=2,F.T=null;try{for(var O=r.onRecoverableError,j=0;j<m.length;j++){var Q=m[j];O(Q.value,{componentStack:Q.stack})}}finally{F.T=i,q.p=R}}(ci&3)!==0&&nf(),xs(r),R=r.pendingLanes,(l&261930)!==0&&(R&42)!==0?r===sg?jc++:(jc=0,sg=r):jc=0,Bc(0)}}function H1(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,_c(i)))}function nf(){return j1(),B1(),z1(),V1()}function V1(){if(wn!==5)return!1;var r=Fi,i=ng;ng=0;var l=Bn(ci),m=F.T,R=q.p;try{q.p=32>l?32:l,F.T=null,l=rg,rg=null;var O=Fi,j=ci;if(wn=0,ol=Fi=null,ci=0,(Pt&6)!==0)throw Error(s(331));var Q=Pt;if(Pt|=4,x1(O.current),y1(O,O.current,j,l),Pt=Q,Bc(0,!1),Re&&typeof Re.onPostCommitFiberRoot=="function")try{Re.onPostCommitFiberRoot(et,O)}catch{}return!0}finally{q.p=R,F.T=m,H1(r,i)}}function F1(r,i,l){i=Hr(l,i),i=Nm(r.stateNode,i,2),r=Ii(r,i,2),r!==null&&(bt(r,2),xs(r))}function zt(r,i,l){if(r.tag===3)F1(r,r,l);else for(;i!==null;){if(i.tag===3){F1(i,r,l);break}else if(i.tag===1){var m=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Vi===null||!Vi.has(m))){r=Hr(l,r),l=Ub(2),m=Ii(i,l,2),m!==null&&(Wb(l,m,i,r),bt(m,2),xs(m));break}}i=i.return}}function ag(r,i,l){var m=r.pingCache;if(m===null){m=r.pingCache=new F5;var R=new Set;m.set(i,R)}else R=m.get(i),R===void 0&&(R=new Set,m.set(i,R));R.has(l)||(Jm=!0,R.add(l),r=$5.bind(null,r,i,l),i.then(r,r))}function $5(r,i,l){var m=r.pingCache;m!==null&&m.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,Wt===r&&(Tt&l)===l&&(on===4||on===3&&(Tt&62914560)===Tt&&300>be()-Xd?(Pt&2)===0&&al(r,0):eg|=l,il===Tt&&(il=0)),xs(r)}function U1(r,i){i===0&&(i=ot()),r=Ro(r,i),r!==null&&(bt(r,i),xs(r))}function K5(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),U1(r,l)}function Y5(r,i){var l=0;switch(r.tag){case 31:case 13:var m=r.stateNode,R=r.memoizedState;R!==null&&(l=R.retryLane);break;case 19:m=r.stateNode;break;case 22:m=r.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(i),U1(r,l)}function X5(r,i){return Ne(r,i)}var rf=null,cl=null,lg=!1,sf=!1,cg=!1,Wi=0;function xs(r){r!==cl&&r.next===null&&(cl===null?rf=cl=r:cl=cl.next=r),sf=!0,lg||(lg=!0,Z5())}function Bc(r,i){if(!cg&&sf){cg=!0;do for(var l=!1,m=rf;m!==null;){if(r!==0){var R=m.pendingLanes;if(R===0)var O=0;else{var j=m.suspendedLanes,Q=m.pingedLanes;O=(1<<31-at(42|r)+1)-1,O&=R&~(j&~Q),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(l=!0,$1(m,O))}else O=Tt,O=Je(m,m===Wt?O:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(O&3)===0||Ot(m,O)||(l=!0,$1(m,O));m=m.next}while(l);cg=!1}}function Q5(){W1()}function W1(){sf=lg=!1;var r=0;Wi!==0&&lL()&&(r=Wi);for(var i=be(),l=null,m=rf;m!==null;){var R=m.next,O=q1(m,i);O===0?(m.next=null,l===null?rf=R:l.next=R,R===null&&(cl=l)):(l=m,(r!==0||(O&3)!==0)&&(sf=!0)),m=R}wn!==0&&wn!==5||Bc(r),Wi!==0&&(Wi=0)}function q1(r,i){for(var l=r.suspendedLanes,m=r.pingedLanes,R=r.expirationTimes,O=r.pendingLanes&-62914561;0<O;){var j=31-at(O),Q=1<<j,ie=R[j];ie===-1?((Q&l)===0||(Q&m)!==0)&&(R[j]=Nt(Q,i)):ie<=i&&(r.expiredLanes|=Q),O&=~Q}if(i=Wt,l=Tt,l=Je(r,r===i?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m=r.callbackNode,l===0||r===i&&(Bt===2||Bt===9)||r.cancelPendingCommit!==null)return m!==null&&m!==null&&ye(m),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||Ot(r,l)){if(i=l&-l,i===r.callbackPriority)return i;switch(m!==null&&ye(m),Bn(l)){case 2:case 8:l=rt;break;case 32:l=ze;break;case 268435456:l=He;break;default:l=ze}return m=G1.bind(null,r),l=Ne(l,m),r.callbackPriority=i,r.callbackNode=l,i}return m!==null&&m!==null&&ye(m),r.callbackPriority=2,r.callbackNode=null,2}function G1(r,i){if(wn!==0&&wn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(nf()&&r.callbackNode!==l)return null;var m=Tt;return m=Je(r,r===Wt?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m===0?null:(k1(r,m,i),q1(r,be()),r.callbackNode!=null&&r.callbackNode===l?G1.bind(null,r):null)}function $1(r,i){if(nf())return null;k1(r,i,!0)}function Z5(){uL(function(){(Pt&6)!==0?Ne(We,Q5):W1()})}function ug(){if(Wi===0){var r=Ka;r===0&&(r=lt,lt<<=1,(lt&261888)===0&&(lt=256)),Wi=r}return Wi}function K1(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Ks(""+r)}function Y1(r,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,r.id&&l.setAttribute("form",r.id),i.parentNode.insertBefore(l,i),r=new FormData(r),l.parentNode.removeChild(l),r}function J5(r,i,l,m,R){if(i==="submit"&&l&&l.stateNode===R){var O=K1((R[hn]||null).action),j=m.submitter;j&&(i=(i=j[hn]||null)?K1(i.formAction):j.getAttribute("formAction"),i!==null&&(O=i,j=null));var Q=new gd("action","action",null,m,R);r.push({event:Q,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Wi!==0){var ie=j?Y1(R,j):new FormData(R);Am(l,{pending:!0,data:ie,method:R.method,action:O},null,ie)}}else typeof O=="function"&&(Q.preventDefault(),ie=j?Y1(R,j):new FormData(R),Am(l,{pending:!0,data:ie,method:R.method,action:O},O,ie))},currentTarget:R}]})}}for(var dg=0;dg<$p.length;dg++){var fg=$p[dg],eL=fg.toLowerCase(),tL=fg[0].toUpperCase()+fg.slice(1);as(eL,"on"+tL)}as(Ry,"onAnimationEnd"),as(ky,"onAnimationIteration"),as(Ty,"onAnimationStart"),as("dblclick","onDoubleClick"),as("focusin","onFocus"),as("focusout","onBlur"),as(v5,"onTransitionRun"),as(_5,"onTransitionStart"),as(y5,"onTransitionCancel"),as(Ly,"onTransitionEnd"),is("onMouseEnter",["mouseout","mouseover"]),is("onMouseLeave",["mouseout","mouseover"]),is("onPointerEnter",["pointerout","pointerover"]),is("onPointerLeave",["pointerout","pointerover"]),_r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_r("onBeforeInput",["compositionend","keypress","textInput","paste"]),_r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),nL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zc));function X1(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var m=r[l],R=m.event;m=m.listeners;e:{var O=void 0;if(i)for(var j=m.length-1;0<=j;j--){var Q=m[j],ie=Q.instance,pe=Q.currentTarget;if(Q=Q.listener,ie!==O&&R.isPropagationStopped())break e;O=Q,R.currentTarget=pe;try{O(R)}catch(Se){yd(Se)}R.currentTarget=null,O=ie}else for(j=0;j<m.length;j++){if(Q=m[j],ie=Q.instance,pe=Q.currentTarget,Q=Q.listener,ie!==O&&R.isPropagationStopped())break e;O=Q,R.currentTarget=pe;try{O(R)}catch(Se){yd(Se)}R.currentTarget=null,O=ie}}}}function Rt(r,i){var l=i[vr];l===void 0&&(l=i[vr]=new Set);var m=r+"__bubble";l.has(m)||(Q1(i,r,2,!1),l.add(m))}function hg(r,i,l){var m=0;i&&(m|=4),Q1(l,r,m,i)}var of="_reactListening"+Math.random().toString(36).slice(2);function pg(r){if(!r[of]){r[of]=!0,Zn.forEach(function(l){l!=="selectionchange"&&(nL.has(l)||hg(l,!1,r),hg(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[of]||(i[of]=!0,hg("selectionchange",!1,i))}}function Q1(r,i,l,m){switch(RS(i)){case 2:var R=AL;break;case 8:R=OL;break;default:R=Lg}l=R.bind(null,i,l,r),R=void 0,!Pp||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(R=!0),m?R!==void 0?r.addEventListener(i,l,{capture:!0,passive:R}):r.addEventListener(i,l,!0):R!==void 0?r.addEventListener(i,l,{passive:R}):r.addEventListener(i,l,!1)}function mg(r,i,l,m,R){var O=m;if((i&1)===0&&(i&2)===0&&m!==null)e:for(;;){if(m===null)return;var j=m.tag;if(j===3||j===4){var Q=m.stateNode.containerInfo;if(Q===R)break;if(j===4)for(j=m.return;j!==null;){var ie=j.tag;if((ie===3||ie===4)&&j.stateNode.containerInfo===R)return;j=j.return}for(;Q!==null;){if(j=Ws(Q),j===null)return;if(ie=j.tag,ie===5||ie===6||ie===26||ie===27){m=O=j;continue e}Q=Q.parentNode}}m=m.return}ny(function(){var pe=O,Se=Mp(l),ke=[];e:{var me=Ay.get(r);if(me!==void 0){var _e=gd,Ge=r;switch(r){case"keypress":if(pd(l)===0)break e;case"keydown":case"keyup":_e=YT;break;case"focusin":Ge="focus",_e=Bp;break;case"focusout":Ge="blur",_e=Bp;break;case"beforeblur":case"afterblur":_e=Bp;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=iy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=jT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=ZT;break;case Ry:case ky:case Ty:_e=HT;break;case Ly:_e=e5;break;case"scroll":case"scrollend":_e=IT;break;case"wheel":_e=n5;break;case"copy":case"cut":case"paste":_e=FT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=ay;break;case"toggle":case"beforetoggle":_e=s5}var ct=(i&4)!==0,Ut=!ct&&(r==="scroll"||r==="scrollend"),ue=ct?me!==null?me+"Capture":null:me;ct=[];for(var le=pe,fe;le!==null;){var we=le;if(fe=we.stateNode,we=we.tag,we!==5&&we!==26&&we!==27||fe===null||ue===null||(we=ac(le,ue),we!=null&&ct.push(Hc(le,we,fe))),Ut)break;le=le.return}0<ct.length&&(me=new _e(me,Ge,null,l,Se),ke.push({event:me,listeners:ct}))}}if((i&7)===0){e:{if(me=r==="mouseover"||r==="pointerover",_e=r==="mouseout"||r==="pointerout",me&&l!==fd&&(Ge=l.relatedTarget||l.fromElement)&&(Ws(Ge)||Ge[vs]))break e;if((_e||me)&&(me=Se.window===Se?Se:(me=Se.ownerDocument)?me.defaultView||me.parentWindow:window,_e?(Ge=l.relatedTarget||l.toElement,_e=pe,Ge=Ge?Ws(Ge):null,Ge!==null&&(Ut=u(Ge),ct=Ge.tag,Ge!==Ut||ct!==5&&ct!==27&&ct!==6)&&(Ge=null)):(_e=null,Ge=pe),_e!==Ge)){if(ct=iy,we="onMouseLeave",ue="onMouseEnter",le="mouse",(r==="pointerout"||r==="pointerover")&&(ct=ay,we="onPointerLeave",ue="onPointerEnter",le="pointer"),Ut=_e==null?me:xo(_e),fe=Ge==null?me:xo(Ge),me=new ct(we,le+"leave",_e,l,Se),me.target=Ut,me.relatedTarget=fe,we=null,Ws(Se)===pe&&(ct=new ct(ue,le+"enter",Ge,l,Se),ct.target=fe,ct.relatedTarget=Ut,we=ct),Ut=we,_e&&Ge)t:{for(ct=rL,ue=_e,le=Ge,fe=0,we=ue;we;we=ct(we))fe++;we=0;for(var it=le;it;it=ct(it))we++;for(;0<fe-we;)ue=ct(ue),fe--;for(;0<we-fe;)le=ct(le),we--;for(;fe--;){if(ue===le||le!==null&&ue===le.alternate){ct=ue;break t}ue=ct(ue),le=ct(le)}ct=null}else ct=null;_e!==null&&Z1(ke,me,_e,ct,!1),Ge!==null&&Ut!==null&&Z1(ke,Ut,Ge,ct,!0)}}e:{if(me=pe?xo(pe):window,_e=me.nodeName&&me.nodeName.toLowerCase(),_e==="select"||_e==="input"&&me.type==="file")var Mt=my;else if(hy(me))if(gy)Mt=p5;else{Mt=f5;var Ze=d5}else _e=me.nodeName,!_e||_e.toLowerCase()!=="input"||me.type!=="checkbox"&&me.type!=="radio"?pe&&mn(pe.elementType)&&(Mt=my):Mt=h5;if(Mt&&(Mt=Mt(r,pe))){py(ke,Mt,l,Se);break e}Ze&&Ze(r,me,pe),r==="focusout"&&pe&&me.type==="number"&&pe.memoizedProps.value!=null&&oc(me,"number",me.value)}switch(Ze=pe?xo(pe):window,r){case"focusin":(hy(Ze)||Ze.contentEditable==="true")&&(Ha=Ze,Wp=pe,mc=null);break;case"focusout":mc=Wp=Ha=null;break;case"mousedown":qp=!0;break;case"contextmenu":case"mouseup":case"dragend":qp=!1,wy(ke,l,Se);break;case"selectionchange":if(g5)break;case"keydown":case"keyup":wy(ke,l,Se)}var _t;if(Hp)e:{switch(r){case"compositionstart":var Lt="onCompositionStart";break e;case"compositionend":Lt="onCompositionEnd";break e;case"compositionupdate":Lt="onCompositionUpdate";break e}Lt=void 0}else za?dy(r,l)&&(Lt="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Lt="onCompositionStart");Lt&&(ly&&l.locale!=="ko"&&(za||Lt!=="onCompositionStart"?Lt==="onCompositionEnd"&&za&&(_t=ry()):(Ti=Se,Ip="value"in Ti?Ti.value:Ti.textContent,za=!0)),Ze=af(pe,Lt),0<Ze.length&&(Lt=new oy(Lt,r,null,l,Se),ke.push({event:Lt,listeners:Ze}),_t?Lt.data=_t:(_t=fy(l),_t!==null&&(Lt.data=_t)))),(_t=o5?a5(r,l):l5(r,l))&&(Lt=af(pe,"onBeforeInput"),0<Lt.length&&(Ze=new oy("onBeforeInput","beforeinput",null,l,Se),ke.push({event:Ze,listeners:Lt}),Ze.data=_t)),J5(ke,r,pe,l,Se)}X1(ke,i)})}function Hc(r,i,l){return{instance:r,listener:i,currentTarget:l}}function af(r,i){for(var l=i+"Capture",m=[];r!==null;){var R=r,O=R.stateNode;if(R=R.tag,R!==5&&R!==26&&R!==27||O===null||(R=ac(r,l),R!=null&&m.unshift(Hc(r,R,O)),R=ac(r,i),R!=null&&m.push(Hc(r,R,O))),r.tag===3)return m;r=r.return}return[]}function rL(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Z1(r,i,l,m,R){for(var O=i._reactName,j=[];l!==null&&l!==m;){var Q=l,ie=Q.alternate,pe=Q.stateNode;if(Q=Q.tag,ie!==null&&ie===m)break;Q!==5&&Q!==26&&Q!==27||pe===null||(ie=pe,R?(pe=ac(l,O),pe!=null&&j.unshift(Hc(l,pe,ie))):R||(pe=ac(l,O),pe!=null&&j.push(Hc(l,pe,ie)))),l=l.return}j.length!==0&&r.push({event:i,listeners:j})}var sL=/\r\n?/g,iL=/\u0000|\uFFFD/g;function J1(r){return(typeof r=="string"?r:""+r).replace(sL,`
10
+ `).replace(iL,"")}function eS(r,i){return i=J1(i),J1(r)===i}function Ft(r,i,l,m,R,O){switch(l){case"children":typeof m=="string"?i==="body"||i==="textarea"&&m===""||nt(r,m):(typeof m=="number"||typeof m=="bigint")&&i!=="body"&&nt(r,""+m);break;case"className":Ei(r,"class",m);break;case"tabIndex":Ei(r,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Ei(r,l,m);break;case"style":nn(r,m,O);break;case"data":if(i!=="object"){Ei(r,"data",m);break}case"src":case"href":if(m===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(l);break}m=Ks(""+m),r.setAttribute(l,m);break;case"action":case"formAction":if(typeof m=="function"){r.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof O=="function"&&(l==="formAction"?(i!=="input"&&Ft(r,i,"name",R.name,R,null),Ft(r,i,"formEncType",R.formEncType,R,null),Ft(r,i,"formMethod",R.formMethod,R,null),Ft(r,i,"formTarget",R.formTarget,R,null)):(Ft(r,i,"encType",R.encType,R,null),Ft(r,i,"method",R.method,R,null),Ft(r,i,"target",R.target,R,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(l);break}m=Ks(""+m),r.setAttribute(l,m);break;case"onClick":m!=null&&(r.onclick=os);break;case"onScroll":m!=null&&Rt("scroll",r);break;case"onScrollEnd":m!=null&&Rt("scrollend",r);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(l=m.__html,l!=null){if(R.children!=null)throw Error(s(60));r.innerHTML=l}}break;case"multiple":r.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":r.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){r.removeAttribute("xlink:href");break}l=Ks(""+m),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(l,""+m):r.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":m===!0?r.setAttribute(l,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(l,m):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?r.setAttribute(l,m):r.removeAttribute(l);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?r.removeAttribute(l):r.setAttribute(l,m);break;case"popover":Rt("beforetoggle",r),Rt("toggle",r),qs(r,"popover",m);break;case"xlinkActuate":yr(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":yr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":yr(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":yr(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":yr(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":yr(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":yr(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":yr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":yr(r,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":qs(r,"is",m);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Gs.get(l)||l,qs(r,l,m))}}function gg(r,i,l,m,R,O){switch(l){case"style":nn(r,m,O);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(l=m.__html,l!=null){if(R.children!=null)throw Error(s(60));r.innerHTML=l}}break;case"children":typeof m=="string"?nt(r,m):(typeof m=="number"||typeof m=="bigint")&&nt(r,""+m);break;case"onScroll":m!=null&&Rt("scroll",r);break;case"onScrollEnd":m!=null&&Rt("scrollend",r);break;case"onClick":m!=null&&(r.onclick=os);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jn.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(R=l.endsWith("Capture"),i=l.slice(2,R?l.length-7:void 0),O=r[hn]||null,O=O!=null?O[l]:null,typeof O=="function"&&r.removeEventListener(i,O,R),typeof m=="function")){typeof O!="function"&&O!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(i,m,R);break e}l in r?r[l]=m:m===!0?r.setAttribute(l,""):qs(r,l,m)}}}function Fn(r,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",r),Rt("load",r);var m=!1,R=!1,O;for(O in l)if(l.hasOwnProperty(O)){var j=l[O];if(j!=null)switch(O){case"src":m=!0;break;case"srcSet":R=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ft(r,i,O,j,l,null)}}R&&Ft(r,i,"srcSet",l.srcSet,l,null),m&&Ft(r,i,"src",l.src,l,null);return;case"input":Rt("invalid",r);var Q=O=j=R=null,ie=null,pe=null;for(m in l)if(l.hasOwnProperty(m)){var Se=l[m];if(Se!=null)switch(m){case"name":R=Se;break;case"type":j=Se;break;case"checked":ie=Se;break;case"defaultChecked":pe=Se;break;case"value":O=Se;break;case"defaultValue":Q=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(s(137,i));break;default:Ft(r,i,m,Se,l,null)}}ud(r,O,Q,ie,pe,j,R,!1);return;case"select":Rt("invalid",r),m=j=O=null;for(R in l)if(l.hasOwnProperty(R)&&(Q=l[R],Q!=null))switch(R){case"value":O=Q;break;case"defaultValue":j=Q;break;case"multiple":m=Q;default:Ft(r,i,R,Q,l,null)}i=O,l=j,r.multiple=!!m,i!=null?ki(r,!!m,i,!1):l!=null&&ki(r,!!m,l,!0);return;case"textarea":Rt("invalid",r),O=R=m=null;for(j in l)if(l.hasOwnProperty(j)&&(Q=l[j],Q!=null))switch(j){case"value":m=Q;break;case"defaultValue":R=Q;break;case"children":O=Q;break;case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(91));break;default:Ft(r,i,j,Q,l,null)}Fe(r,m,R,O);return;case"option":for(ie in l)l.hasOwnProperty(ie)&&(m=l[ie],m!=null)&&(ie==="selected"?r.selected=m&&typeof m!="function"&&typeof m!="symbol":Ft(r,i,ie,m,l,null));return;case"dialog":Rt("beforetoggle",r),Rt("toggle",r),Rt("cancel",r),Rt("close",r);break;case"iframe":case"object":Rt("load",r);break;case"video":case"audio":for(m=0;m<zc.length;m++)Rt(zc[m],r);break;case"image":Rt("error",r),Rt("load",r);break;case"details":Rt("toggle",r);break;case"embed":case"source":case"link":Rt("error",r),Rt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(pe in l)if(l.hasOwnProperty(pe)&&(m=l[pe],m!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ft(r,i,pe,m,l,null)}return;default:if(mn(i)){for(Se in l)l.hasOwnProperty(Se)&&(m=l[Se],m!==void 0&&gg(r,i,Se,m,l,void 0));return}}for(Q in l)l.hasOwnProperty(Q)&&(m=l[Q],m!=null&&Ft(r,i,Q,m,l,null))}function oL(r,i,l,m){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var R=null,O=null,j=null,Q=null,ie=null,pe=null,Se=null;for(_e in l){var ke=l[_e];if(l.hasOwnProperty(_e)&&ke!=null)switch(_e){case"checked":break;case"value":break;case"defaultValue":ie=ke;default:m.hasOwnProperty(_e)||Ft(r,i,_e,null,m,ke)}}for(var me in m){var _e=m[me];if(ke=l[me],m.hasOwnProperty(me)&&(_e!=null||ke!=null))switch(me){case"type":O=_e;break;case"name":R=_e;break;case"checked":pe=_e;break;case"defaultChecked":Se=_e;break;case"value":j=_e;break;case"defaultValue":Q=_e;break;case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(s(137,i));break;default:_e!==ke&&Ft(r,i,me,_e,m,ke)}}ic(r,j,Q,ie,pe,Se,O,R);return;case"select":_e=j=Q=me=null;for(O in l)if(ie=l[O],l.hasOwnProperty(O)&&ie!=null)switch(O){case"value":break;case"multiple":_e=ie;default:m.hasOwnProperty(O)||Ft(r,i,O,null,m,ie)}for(R in m)if(O=m[R],ie=l[R],m.hasOwnProperty(R)&&(O!=null||ie!=null))switch(R){case"value":me=O;break;case"defaultValue":Q=O;break;case"multiple":j=O;default:O!==ie&&Ft(r,i,R,O,m,ie)}i=Q,l=j,m=_e,me!=null?ki(r,!!l,me,!1):!!m!=!!l&&(i!=null?ki(r,!!l,i,!0):ki(r,!!l,l?[]:"",!1));return;case"textarea":_e=me=null;for(Q in l)if(R=l[Q],l.hasOwnProperty(Q)&&R!=null&&!m.hasOwnProperty(Q))switch(Q){case"value":break;case"children":break;default:Ft(r,i,Q,null,m,R)}for(j in m)if(R=m[j],O=l[j],m.hasOwnProperty(j)&&(R!=null||O!=null))switch(j){case"value":me=R;break;case"defaultValue":_e=R;break;case"children":break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(s(91));break;default:R!==O&&Ft(r,i,j,R,m,O)}dd(r,me,_e);return;case"option":for(var Ge in l)me=l[Ge],l.hasOwnProperty(Ge)&&me!=null&&!m.hasOwnProperty(Ge)&&(Ge==="selected"?r.selected=!1:Ft(r,i,Ge,null,m,me));for(ie in m)me=m[ie],_e=l[ie],m.hasOwnProperty(ie)&&me!==_e&&(me!=null||_e!=null)&&(ie==="selected"?r.selected=me&&typeof me!="function"&&typeof me!="symbol":Ft(r,i,ie,me,m,_e));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ct in l)me=l[ct],l.hasOwnProperty(ct)&&me!=null&&!m.hasOwnProperty(ct)&&Ft(r,i,ct,null,m,me);for(pe in m)if(me=m[pe],_e=l[pe],m.hasOwnProperty(pe)&&me!==_e&&(me!=null||_e!=null))switch(pe){case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(s(137,i));break;default:Ft(r,i,pe,me,m,_e)}return;default:if(mn(i)){for(var Ut in l)me=l[Ut],l.hasOwnProperty(Ut)&&me!==void 0&&!m.hasOwnProperty(Ut)&&gg(r,i,Ut,void 0,m,me);for(Se in m)me=m[Se],_e=l[Se],!m.hasOwnProperty(Se)||me===_e||me===void 0&&_e===void 0||gg(r,i,Se,me,m,_e);return}}for(var ue in l)me=l[ue],l.hasOwnProperty(ue)&&me!=null&&!m.hasOwnProperty(ue)&&Ft(r,i,ue,null,m,me);for(ke in m)me=m[ke],_e=l[ke],!m.hasOwnProperty(ke)||me===_e||me==null&&_e==null||Ft(r,i,ke,me,m,_e)}function tS(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aL(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,l=performance.getEntriesByType("resource"),m=0;m<l.length;m++){var R=l[m],O=R.transferSize,j=R.initiatorType,Q=R.duration;if(O&&Q&&tS(j)){for(j=0,Q=R.responseEnd,m+=1;m<l.length;m++){var ie=l[m],pe=ie.startTime;if(pe>Q)break;var Se=ie.transferSize,ke=ie.initiatorType;Se&&tS(ke)&&(ie=ie.responseEnd,j+=Se*(ie<Q?1:(Q-pe)/(ie-pe)))}if(--m,i+=8*(O+j)/(R.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var vg=null,_g=null;function lf(r){return r.nodeType===9?r:r.ownerDocument}function nS(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function rS(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function yg(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var bg=null;function lL(){var r=window.event;return r&&r.type==="popstate"?r===bg?!1:(bg=r,!0):(bg=null,!1)}var sS=typeof setTimeout=="function"?setTimeout:void 0,cL=typeof clearTimeout=="function"?clearTimeout:void 0,iS=typeof Promise=="function"?Promise:void 0,uL=typeof queueMicrotask=="function"?queueMicrotask:typeof iS<"u"?function(r){return iS.resolve(null).then(r).catch(dL)}:sS;function dL(r){setTimeout(function(){throw r})}function qi(r){return r==="head"}function oS(r,i){var l=i,m=0;do{var R=l.nextSibling;if(r.removeChild(l),R&&R.nodeType===8)if(l=R.data,l==="/$"||l==="/&"){if(m===0){r.removeChild(R),hl(i);return}m--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")m++;else if(l==="html")Vc(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,Vc(l);for(var O=l.firstChild;O;){var j=O.nextSibling,Q=O.nodeName;O[bo]||Q==="SCRIPT"||Q==="STYLE"||Q==="LINK"&&O.rel.toLowerCase()==="stylesheet"||l.removeChild(O),O=j}}else l==="body"&&Vc(r.ownerDocument.body);l=R}while(l);hl(i)}function aS(r,i){var l=r;r=0;do{var m=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),m&&m.nodeType===8)if(l=m.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=m}while(l)}function Sg(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Sg(l),So(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function fL(r,i,l,m){for(;r.nodeType===1;){var R=l;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!m&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(m){if(!r[bo])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(O=r.getAttribute("rel"),O==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(O!==R.rel||r.getAttribute("href")!==(R.href==null||R.href===""?null:R.href)||r.getAttribute("crossorigin")!==(R.crossOrigin==null?null:R.crossOrigin)||r.getAttribute("title")!==(R.title==null?null:R.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(O=r.getAttribute("src"),(O!==(R.src==null?null:R.src)||r.getAttribute("type")!==(R.type==null?null:R.type)||r.getAttribute("crossorigin")!==(R.crossOrigin==null?null:R.crossOrigin))&&O&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var O=R.name==null?null:""+R.name;if(R.type==="hidden"&&r.getAttribute("name")===O)return r}else return r;if(r=qr(r.nextSibling),r===null)break}return null}function hL(r,i,l){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=qr(r.nextSibling),r===null))return null;return r}function lS(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=qr(r.nextSibling),r===null))return null;return r}function xg(r){return r.data==="$?"||r.data==="$~"}function Cg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function pL(r,i){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||l.readyState!=="loading")i();else{var m=function(){i(),l.removeEventListener("DOMContentLoaded",m)};l.addEventListener("DOMContentLoaded",m),r._reactRetry=m}}function qr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var wg=null;function cS(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(i===0)return qr(r.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}r=r.nextSibling}return null}function uS(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return r;i--}else l!=="/$"&&l!=="/&"||i++}r=r.previousSibling}return null}function dS(r,i,l){switch(i=lf(l),r){case"html":if(r=i.documentElement,!r)throw Error(s(452));return r;case"head":if(r=i.head,!r)throw Error(s(453));return r;case"body":if(r=i.body,!r)throw Error(s(454));return r;default:throw Error(s(451))}}function Vc(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);So(r)}var Gr=new Map,fS=new Set;function cf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ui=q.d;q.d={f:mL,r:gL,D:vL,C:_L,L:yL,m:bL,X:xL,S:SL,M:CL};function mL(){var r=ui.f(),i=Jd();return r||i}function gL(r){var i=_s(r);i!==null&&i.tag===5&&i.type==="form"?Lb(i):ui.r(r)}var ul=typeof document>"u"?null:document;function hS(r,i,l){var m=ul;if(m&&typeof i=="string"&&i){var R=ir(i);R='link[rel="'+r+'"][href="'+R+'"]',typeof l=="string"&&(R+='[crossorigin="'+l+'"]'),fS.has(R)||(fS.add(R),r={rel:r,crossOrigin:l,href:i},m.querySelector(R)===null&&(i=m.createElement("link"),Fn(i,"link",r),pn(i),m.head.appendChild(i)))}}function vL(r){ui.D(r),hS("dns-prefetch",r,null)}function _L(r,i){ui.C(r,i),hS("preconnect",r,i)}function yL(r,i,l){ui.L(r,i,l);var m=ul;if(m&&r&&i){var R='link[rel="preload"][as="'+ir(i)+'"]';i==="image"&&l&&l.imageSrcSet?(R+='[imagesrcset="'+ir(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(R+='[imagesizes="'+ir(l.imageSizes)+'"]')):R+='[href="'+ir(r)+'"]';var O=R;switch(i){case"style":O=dl(r);break;case"script":O=fl(r)}Gr.has(O)||(r=f({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),Gr.set(O,r),m.querySelector(R)!==null||i==="style"&&m.querySelector(Fc(O))||i==="script"&&m.querySelector(Uc(O))||(i=m.createElement("link"),Fn(i,"link",r),pn(i),m.head.appendChild(i)))}}function bL(r,i){ui.m(r,i);var l=ul;if(l&&r){var m=i&&typeof i.as=="string"?i.as:"script",R='link[rel="modulepreload"][as="'+ir(m)+'"][href="'+ir(r)+'"]',O=R;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=fl(r)}if(!Gr.has(O)&&(r=f({rel:"modulepreload",href:r},i),Gr.set(O,r),l.querySelector(R)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Uc(O)))return}m=l.createElement("link"),Fn(m,"link",r),pn(m),l.head.appendChild(m)}}}function SL(r,i,l){ui.S(r,i,l);var m=ul;if(m&&r){var R=ss(m).hoistableStyles,O=dl(r);i=i||"default";var j=R.get(O);if(!j){var Q={loading:0,preload:null};if(j=m.querySelector(Fc(O)))Q.loading=5;else{r=f({rel:"stylesheet",href:r,"data-precedence":i},l),(l=Gr.get(O))&&Eg(r,l);var ie=j=m.createElement("link");pn(ie),Fn(ie,"link",r),ie._p=new Promise(function(pe,Se){ie.onload=pe,ie.onerror=Se}),ie.addEventListener("load",function(){Q.loading|=1}),ie.addEventListener("error",function(){Q.loading|=2}),Q.loading|=4,uf(j,i,m)}j={type:"stylesheet",instance:j,count:1,state:Q},R.set(O,j)}}}function xL(r,i){ui.X(r,i);var l=ul;if(l&&r){var m=ss(l).hoistableScripts,R=fl(r),O=m.get(R);O||(O=l.querySelector(Uc(R)),O||(r=f({src:r,async:!0},i),(i=Gr.get(R))&&Rg(r,i),O=l.createElement("script"),pn(O),Fn(O,"link",r),l.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},m.set(R,O))}}function CL(r,i){ui.M(r,i);var l=ul;if(l&&r){var m=ss(l).hoistableScripts,R=fl(r),O=m.get(R);O||(O=l.querySelector(Uc(R)),O||(r=f({src:r,async:!0,type:"module"},i),(i=Gr.get(R))&&Rg(r,i),O=l.createElement("script"),pn(O),Fn(O,"link",r),l.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},m.set(R,O))}}function pS(r,i,l,m){var R=(R=ee.current)?cf(R):null;if(!R)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=dl(l.href),l=ss(R).hoistableStyles,m=l.get(i),m||(m={type:"style",instance:null,count:0,state:null},l.set(i,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=dl(l.href);var O=ss(R).hoistableStyles,j=O.get(r);if(j||(R=R.ownerDocument||R,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(r,j),(O=R.querySelector(Fc(r)))&&!O._p&&(j.instance=O,j.state.loading=5),Gr.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Gr.set(r,l),O||wL(R,r,l,j.state))),i&&m===null)throw Error(s(528,""));return j}if(i&&m!==null)throw Error(s(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fl(l),l=ss(R).hoistableScripts,m=l.get(i),m||(m={type:"script",instance:null,count:0,state:null},l.set(i,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function dl(r){return'href="'+ir(r)+'"'}function Fc(r){return'link[rel="stylesheet"]['+r+"]"}function mS(r){return f({},r,{"data-precedence":r.precedence,precedence:null})}function wL(r,i,l,m){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?m.loading=1:(i=r.createElement("link"),m.preload=i,i.addEventListener("load",function(){return m.loading|=1}),i.addEventListener("error",function(){return m.loading|=2}),Fn(i,"link",l),pn(i),r.head.appendChild(i))}function fl(r){return'[src="'+ir(r)+'"]'}function Uc(r){return"script[async]"+r}function gS(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var m=r.querySelector('style[data-href~="'+ir(l.href)+'"]');if(m)return i.instance=m,pn(m),m;var R=f({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return m=(r.ownerDocument||r).createElement("style"),pn(m),Fn(m,"style",R),uf(m,l.precedence,r),i.instance=m;case"stylesheet":R=dl(l.href);var O=r.querySelector(Fc(R));if(O)return i.state.loading|=4,i.instance=O,pn(O),O;m=mS(l),(R=Gr.get(R))&&Eg(m,R),O=(r.ownerDocument||r).createElement("link"),pn(O);var j=O;return j._p=new Promise(function(Q,ie){j.onload=Q,j.onerror=ie}),Fn(O,"link",m),i.state.loading|=4,uf(O,l.precedence,r),i.instance=O;case"script":return O=fl(l.src),(R=r.querySelector(Uc(O)))?(i.instance=R,pn(R),R):(m=l,(R=Gr.get(O))&&(m=f({},l),Rg(m,R)),r=r.ownerDocument||r,R=r.createElement("script"),pn(R),Fn(R,"link",m),r.head.appendChild(R),i.instance=R);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(m=i.instance,i.state.loading|=4,uf(m,l.precedence,r));return i.instance}function uf(r,i,l){for(var m=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),R=m.length?m[m.length-1]:null,O=R,j=0;j<m.length;j++){var Q=m[j];if(Q.dataset.precedence===i)O=Q;else if(O!==R)break}O?O.parentNode.insertBefore(r,O.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(r,i.firstChild))}function Eg(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Rg(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var df=null;function vS(r,i,l){if(df===null){var m=new Map,R=df=new Map;R.set(l,m)}else R=df,m=R.get(l),m||(m=new Map,R.set(l,m));if(m.has(r))return m;for(m.set(r,null),l=l.getElementsByTagName(r),R=0;R<l.length;R++){var O=l[R];if(!(O[bo]||O[fn]||r==="link"&&O.getAttribute("rel")==="stylesheet")&&O.namespaceURI!=="http://www.w3.org/2000/svg"){var j=O.getAttribute(i)||"";j=r+j;var Q=m.get(j);Q?Q.push(O):m.set(j,[O])}}return m}function _S(r,i,l){r=r.ownerDocument||r,r.head.insertBefore(l,i==="title"?r.querySelector("head > title"):null)}function EL(r,i,l){if(l===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function yS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function RL(r,i,l,m){if(l.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var R=dl(m.href),O=i.querySelector(Fc(R));if(O){i=O._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ff.bind(r),i.then(r,r)),l.state.loading|=4,l.instance=O,pn(O);return}O=i.ownerDocument||i,m=mS(m),(R=Gr.get(R))&&Eg(m,R),O=O.createElement("link"),pn(O);var j=O;j._p=new Promise(function(Q,ie){j.onload=Q,j.onerror=ie}),Fn(O,"link",m),l.instance=O}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=ff.bind(r),i.addEventListener("load",l),i.addEventListener("error",l))}}var kg=0;function kL(r,i){return r.stylesheets&&r.count===0&&pf(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var m=setTimeout(function(){if(r.stylesheets&&pf(r,r.stylesheets),r.unsuspend){var O=r.unsuspend;r.unsuspend=null,O()}},6e4+i);0<r.imgBytes&&kg===0&&(kg=62500*aL());var R=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&pf(r,r.stylesheets),r.unsuspend)){var O=r.unsuspend;r.unsuspend=null,O()}},(r.imgBytes>kg?50:800)+i);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(m),clearTimeout(R)}}:null}function ff(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var hf=null;function pf(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,hf=new Map,i.forEach(TL,r),hf=null,ff.call(r))}function TL(r,i){if(!(i.state.loading&4)){var l=hf.get(r);if(l)var m=l.get(null);else{l=new Map,hf.set(r,l);for(var R=r.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O<R.length;O++){var j=R[O];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(l.set(j.dataset.precedence,j),m=j)}m&&l.set(null,m)}R=i.instance,j=R.getAttribute("data-precedence"),O=l.get(j)||m,O===m&&l.set(null,R),l.set(j,R),this.count++,m=ff.bind(this),R.addEventListener("load",m),R.addEventListener("error",m),O?O.parentNode.insertBefore(R,O.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(R,r.firstChild)),i.state.loading|=4}}var Wc={$$typeof:S,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function LL(r,i,l,m,R,O,j,Q,ie){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=m,this.onUncaughtError=R,this.onCaughtError=O,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function bS(r,i,l,m,R,O,j,Q,ie,pe,Se,ke){return r=new LL(r,i,l,j,ie,pe,Se,ke,Q),i=1,O===!0&&(i|=24),O=Sr(3,null,null,i),r.current=O,O.stateNode=r,i=om(),i.refCount++,r.pooledCache=i,i.refCount++,O.memoizedState={element:m,isDehydrated:l,cache:i},um(O),r}function SS(r){return r?(r=Ua,r):Ua}function xS(r,i,l,m,R,O){R=SS(R),m.context===null?m.context=R:m.pendingContext=R,m=Pi(i),m.payload={element:l},O=O===void 0?null:O,O!==null&&(m.callback=O),l=Ii(r,m,i),l!==null&&(dr(l,r,i),xc(l,r,i))}function CS(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function Tg(r,i){CS(r,i),(r=r.alternate)&&CS(r,i)}function wS(r){if(r.tag===13||r.tag===31){var i=Ro(r,67108864);i!==null&&dr(i,r,67108864),Tg(r,67108864)}}function ES(r){if(r.tag===13||r.tag===31){var i=Rr();i=Gn(i);var l=Ro(r,i);l!==null&&dr(l,r,i),Tg(r,i)}}var mf=!0;function AL(r,i,l,m){var R=F.T;F.T=null;var O=q.p;try{q.p=2,Lg(r,i,l,m)}finally{q.p=O,F.T=R}}function OL(r,i,l,m){var R=F.T;F.T=null;var O=q.p;try{q.p=8,Lg(r,i,l,m)}finally{q.p=O,F.T=R}}function Lg(r,i,l,m){if(mf){var R=Ag(m);if(R===null)mg(r,i,m,gf,l),kS(r,m);else if(DL(R,r,i,l,m))m.stopPropagation();else if(kS(r,m),i&4&&-1<ML.indexOf(r)){for(;R!==null;){var O=_s(R);if(O!==null)switch(O.tag){case 3:if(O=O.stateNode,O.current.memoizedState.isDehydrated){var j=vt(O.pendingLanes);if(j!==0){var Q=O;for(Q.pendingLanes|=2,Q.entangledLanes|=2;j;){var ie=1<<31-at(j);Q.entanglements[1]|=ie,j&=~ie}xs(O),(Pt&6)===0&&(Qd=be()+500,Bc(0))}}break;case 31:case 13:Q=Ro(O,2),Q!==null&&dr(Q,O,2),Jd(),Tg(O,2)}if(O=Ag(m),O===null&&mg(r,i,m,gf,l),O===R)break;R=O}R!==null&&m.stopPropagation()}else mg(r,i,m,null,l)}}function Ag(r){return r=Mp(r),Og(r)}var gf=null;function Og(r){if(gf=null,r=Ws(r),r!==null){var i=u(r);if(i===null)r=null;else{var l=i.tag;if(l===13){if(r=h(i),r!==null)return r;r=null}else if(l===31){if(r=a(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return gf=r,null}function RS(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ce()){case We:return 2;case rt:return 8;case ze:case Me:return 32;case He:return 268435456;default:return 32}default:return 32}}var Mg=!1,Gi=null,$i=null,Ki=null,qc=new Map,Gc=new Map,Yi=[],ML="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function kS(r,i){switch(r){case"focusin":case"focusout":Gi=null;break;case"dragenter":case"dragleave":$i=null;break;case"mouseover":case"mouseout":Ki=null;break;case"pointerover":case"pointerout":qc.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gc.delete(i.pointerId)}}function $c(r,i,l,m,R,O){return r===null||r.nativeEvent!==O?(r={blockedOn:i,domEventName:l,eventSystemFlags:m,nativeEvent:O,targetContainers:[R]},i!==null&&(i=_s(i),i!==null&&wS(i)),r):(r.eventSystemFlags|=m,i=r.targetContainers,R!==null&&i.indexOf(R)===-1&&i.push(R),r)}function DL(r,i,l,m,R){switch(i){case"focusin":return Gi=$c(Gi,r,i,l,m,R),!0;case"dragenter":return $i=$c($i,r,i,l,m,R),!0;case"mouseover":return Ki=$c(Ki,r,i,l,m,R),!0;case"pointerover":var O=R.pointerId;return qc.set(O,$c(qc.get(O)||null,r,i,l,m,R)),!0;case"gotpointercapture":return O=R.pointerId,Gc.set(O,$c(Gc.get(O)||null,r,i,l,m,R)),!0}return!1}function TS(r){var i=Ws(r.target);if(i!==null){var l=u(i);if(l!==null){if(i=l.tag,i===13){if(i=h(l),i!==null){r.blockedOn=i,Da(r.priority,function(){ES(l)});return}}else if(i===31){if(i=a(l),i!==null){r.blockedOn=i,Da(r.priority,function(){ES(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function vf(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=Ag(r.nativeEvent);if(l===null){l=r.nativeEvent;var m=new l.constructor(l.type,l);fd=m,l.target.dispatchEvent(m),fd=null}else return i=_s(l),i!==null&&wS(i),r.blockedOn=l,!1;i.shift()}return!0}function LS(r,i,l){vf(r)&&l.delete(i)}function PL(){Mg=!1,Gi!==null&&vf(Gi)&&(Gi=null),$i!==null&&vf($i)&&($i=null),Ki!==null&&vf(Ki)&&(Ki=null),qc.forEach(LS),Gc.forEach(LS)}function _f(r,i){r.blockedOn===i&&(r.blockedOn=null,Mg||(Mg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,PL)))}var yf=null;function AS(r){yf!==r&&(yf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){yf===r&&(yf=null);for(var i=0;i<r.length;i+=3){var l=r[i],m=r[i+1],R=r[i+2];if(typeof m!="function"){if(Og(m||l)===null)continue;break}var O=_s(l);O!==null&&(r.splice(i,3),i-=3,Am(O,{pending:!0,data:R,method:l.method,action:m},m,R))}}))}function hl(r){function i(ie){return _f(ie,r)}Gi!==null&&_f(Gi,r),$i!==null&&_f($i,r),Ki!==null&&_f(Ki,r),qc.forEach(i),Gc.forEach(i);for(var l=0;l<Yi.length;l++){var m=Yi[l];m.blockedOn===r&&(m.blockedOn=null)}for(;0<Yi.length&&(l=Yi[0],l.blockedOn===null);)TS(l),l.blockedOn===null&&Yi.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(m=0;m<l.length;m+=3){var R=l[m],O=l[m+1],j=R[hn]||null;if(typeof O=="function")j||AS(l);else if(j){var Q=null;if(O&&O.hasAttribute("formAction")){if(R=O,j=O[hn]||null)Q=j.formAction;else if(Og(R)!==null)continue}else Q=j.action;typeof Q=="function"?l[m+1]=Q:(l.splice(m,3),m-=3),AS(l)}}}function OS(){function r(O){O.canIntercept&&O.info==="react-transition"&&O.intercept({handler:function(){return new Promise(function(j){return R=j})},focusReset:"manual",scroll:"manual"})}function i(){R!==null&&(R(),R=null),m||setTimeout(l,20)}function l(){if(!m&&!navigation.transition){var O=navigation.currentEntry;O&&O.url!=null&&navigation.navigate(O.url,{state:O.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,R=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){m=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),R!==null&&(R(),R=null)}}}function Dg(r){this._internalRoot=r}bf.prototype.render=Dg.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(s(409));var l=i.current,m=Rr();xS(l,m,r,i,null,null)},bf.prototype.unmount=Dg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;xS(r.current,2,null,r,null,null),Jd(),i[vs]=null}};function bf(r){this._internalRoot=r}bf.prototype.unstable_scheduleHydration=function(r){if(r){var i=gs();r={blockedOn:null,target:r,priority:i};for(var l=0;l<Yi.length&&i!==0&&i<Yi[l].priority;l++);Yi.splice(l,0,r),l===0&&TS(r)}};var MS=t.version;if(MS!=="19.2.3")throw Error(s(527,MS,"19.2.3"));q.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=d(i),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var IL={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sf.isDisabled&&Sf.supportsFiber)try{et=Sf.inject(IL),Re=Sf}catch{}}return Yc.createRoot=function(r,i){if(!o(r))throw Error(s(299));var l=!1,m="",R=zb,O=Hb,j=Vb;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(R=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=bS(r,1,!1,null,null,l,m,null,R,O,j,OS),r[vs]=i.current,pg(r),new Dg(i)},Yc.hydrateRoot=function(r,i,l){if(!o(r))throw Error(s(299));var m=!1,R="",O=zb,j=Hb,Q=Vb,ie=null;return l!=null&&(l.unstable_strictMode===!0&&(m=!0),l.identifierPrefix!==void 0&&(R=l.identifierPrefix),l.onUncaughtError!==void 0&&(O=l.onUncaughtError),l.onCaughtError!==void 0&&(j=l.onCaughtError),l.onRecoverableError!==void 0&&(Q=l.onRecoverableError),l.formState!==void 0&&(ie=l.formState)),i=bS(r,1,!0,i,l??null,m,R,ie,O,j,Q,OS),i.context=SS(null),l=i.current,m=Rr(),m=Gn(m),R=Pi(m),R.callback=null,Ii(l,R,m),l=m,i.current.lanes=l,bt(i,l),xs(i),r[vs]=i.current,pg(r),new bf(i)},Yc.version="19.2.3",Yc}var FS;function qL(){if(FS)return Ng.exports;FS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ng.exports=WL(),Ng.exports}var GL=qL();const Av=new WeakMap,$L=new WeakMap,ch={current:[]};let Hg=!1,cu=0;const iu=new Set,xf=new Map;function Lw(e){for(const t of e){if(ch.current.includes(t))continue;ch.current.push(t),t.recompute();const n=$L.get(t);if(n)for(const s of n){const o=Av.get(s);o?.length&&Lw(o)}}}function KL(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function YL(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Aw(e){if(cu>0&&!xf.has(e)&&xf.set(e,e.prevState),iu.add(e),!(cu>0)&&!Hg)try{for(Hg=!0;iu.size>0;){const t=Array.from(iu);iu.clear();for(const n of t){const s=xf.get(n)??n.prevState;n.prevState=s,KL(n)}for(const n of t){const s=Av.get(n);s&&(ch.current.push(n),Lw(s))}for(const n of t){const s=Av.get(n);if(s)for(const o of s)YL(o)}}}finally{Hg=!1,ch.current=[],xf.clear()}}function uu(e){cu++;try{e()}finally{if(cu--,cu===0){const t=iu.values().next().value;t&&Aw(t)}}}function XL(e){return typeof e=="function"}let QL=class{constructor(t,n){this.listeners=new Set,this.subscribe=s=>{var o,u;this.listeners.add(s);const h=(u=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:u.call(o,s,this);return()=>{this.listeners.delete(s),h?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,s,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):XL(t)?this.state=t(this.prevState):this.state=t,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),Aw(this)}};const so="__TSR_index",US="popstate",WS="beforeunload";function ZL(e){let t=e.getLocation();const n=new Set,s=h=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:h}))},o=h=>{e.notifyOnIndexChange??!0?s(h):t=e.getLocation()},u=async({task:h,navigateOpts:a,...c})=>{if(a?.ignoreBlocker??!1){h();return}const p=e.getBlockers?.()??[],f=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&p.length&&f)for(const g of p){const b=uh(c.path,c.state);if(await g.blockerFn({currentLocation:t,nextLocation:b,action:c.type})){e.onBlocked?.();return}}h()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:h=>(n.add(h),()=>{n.delete(h)}),push:(h,a,c)=>{const d=t.state[so];a=qS(d+1,a),u({task:()=>{e.pushState(h,a),s({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:h,state:a})},replace:(h,a,c)=>{const d=t.state[so];a=qS(d,a),u({task:()=>{e.replaceState(h,a),s({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:h,state:a})},go:(h,a)=>{u({task:()=>{e.go(h),o({type:"GO",index:h})},navigateOpts:a,type:"GO"})},back:h=>{u({task:()=>{e.back(h?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:h,type:"BACK"})},forward:h=>{u({task:()=>{e.forward(h?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:h,type:"FORWARD"})},canGoBack:()=>t.state[so]!==0,createHref:h=>e.createHref(h),block:h=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,h]),()=>{const c=e.getBlockers?.()??[];e.setBlockers?.(c.filter(d=>d!==h))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function qS(e,t){t||(t={});const n=x_();return{...t,key:n,__TSR_key:n,[so]:e}}function JL(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let o=[];const u=()=>o,h=L=>o=L,a=(L=>L),c=(()=>uh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const L=x_();t.history.replaceState({[so]:0,key:L,__TSR_key:L},"")}let d=c(),p,f=!1,g=!1,b=!1,C=!1;const x=()=>d;let y,_;const v=()=>{y&&(M._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),M._ignoreSubscribers=!1,y=void 0,_=void 0,p=void 0)},S=(L,D,U)=>{const z=a(D);_||(p=d),d=uh(D,U),y={href:z,state:U,isPush:y?.isPush||L==="push"},_||(_=Promise.resolve().then(()=>v()))},E=L=>{d=c(),M.notify({type:L})},T=async()=>{if(g){g=!1;return}const L=c(),D=L.state[so]-d.state[so],U=D===1,z=D===-1,W=!U&&!z||f;f=!1;const N=W?"GO":z?"BACK":"FORWARD",Y=W?{type:"GO",index:D}:{type:z?"BACK":"FORWARD"};if(b)b=!1;else{const $=u();if(typeof document<"u"&&$.length){for(const F of $)if(await F.blockerFn({currentLocation:d,nextLocation:L,action:N})){g=!0,t.history.go(1),M.notify(Y);return}}}d=c(),M.notify(Y)},A=L=>{if(C){C=!1;return}let D=!1;const U=u();if(typeof document<"u"&&U.length)for(const z of U){const W=z.enableBeforeUnload??!0;if(W===!0){D=!0;break}if(typeof W=="function"&&W()===!0){D=!0;break}}if(D)return L.preventDefault(),L.returnValue=""},M=ZL({getLocation:x,getLength:()=>t.history.length,pushState:(L,D)=>S("push",L,D),replaceState:(L,D)=>S("replace",L,D),back:L=>(L&&(b=!0),C=!0,t.history.back()),forward:L=>{L&&(b=!0),C=!0,t.history.forward()},go:L=>{f=!0,t.history.go(L)},createHref:L=>a(L),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(WS,A,{capture:!0}),t.removeEventListener(US,T)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:u,setBlockers:h,notifyOnIndexChange:!1});return t.addEventListener(WS,A,{capture:!0}),t.addEventListener(US,T),t.history.pushState=function(...L){const D=n.apply(t.history,L);return M._ignoreSubscribers||E("PUSH"),D},t.history.replaceState=function(...L){const D=s.apply(t.history,L);return M._ignoreSubscribers||E("REPLACE"),D},M}function uh(e,t){const n=e.indexOf("#"),s=e.indexOf("?"),o=x_();return{href:e,pathname:e.substring(0,n>0?s>0?Math.min(n,s):n:s>0?s:e.length),hash:n>-1?e.substring(n):"",search:s>-1?e.slice(s,n===-1?void 0:n):"",state:t||{[so]:0,key:o,__TSR_key:o}}}function x_(){return(Math.random()+1).toString(36).substring(7)}function dh(e){return e[e.length-1]}function eA(e){return typeof e=="function"}function eo(e,t){return eA(e)?e(t):e}const tA=Object.prototype.hasOwnProperty;function Yr(e,t){if(e===t)return e;const n=t,s=KS(e)&&KS(n);if(!s&&!(fh(e)&&fh(n)))return n;const o=s?e:GS(e);if(!o)return n;const u=s?n:GS(n);if(!u)return n;const h=o.length,a=u.length,c=s?new Array(a):{};let d=0;for(let p=0;p<a;p++){const f=s?p:u[p],g=e[f],b=n[f];if(g===b){c[f]=g,(s?p<h:tA.call(e,f))&&d++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){c[f]=b;continue}const C=Yr(g,b);c[f]=C,C===g&&d++}return h===a&&d===h?e:c}function GS(e){const t=[],n=Object.getOwnPropertyNames(e);for(const o of n){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;t.push(o)}const s=Object.getOwnPropertySymbols(e);for(const o of s){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;t.push(o)}return t}function fh(e){if(!$S(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!$S(n)||!n.hasOwnProperty("isPrototypeOf"))}function $S(e){return Object.prototype.toString.call(e)==="[object Object]"}function KS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ra(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,o=e.length;s<o;s++)if(!ra(e[s],t[s],n))return!1;return!0}if(fh(e)&&fh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const h in t)if((!s||t[h]!==void 0)&&!ra(e[h],t[h],n))return!1;return!0}let o=0;if(!s)o=Object.keys(e).length;else for(const h in e)e[h]!==void 0&&o++;let u=0;for(const h in t)if((!s||t[h]!==void 0)&&(u++,u>o||!ra(e[h],t[h],n)))return!1;return o===u}return!1}function Al(e){let t,n;const s=new Promise((o,u)=>{t=o,n=u});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,t(o),e?.(o)},s.reject=o=>{s.status="rejected",n(o)},s}function io(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function YS(e){try{return decodeURI(e)}catch{return e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}}function XS(e,t){if(!e)return e;const n=/%25|%5C/gi;let s=0,o="",u;for(;(u=n.exec(e))!==null;)o+=YS(e.slice(s,u.index))+u[0],s=n.lastIndex;return o+YS(s?e.slice(s):e)}var nA="Invariant failed";function vi(e,t){if(!e)throw new Error(nA)}function hh(e){const t=new Map;let n,s;const o=u=>{u.next&&(u.prev?(u.prev.next=u.next,u.next.prev=u.prev,u.next=void 0,s&&(s.next=u,u.prev=s)):(u.next.prev=void 0,n=u.next,u.next=void 0,s&&(u.prev=s,s.next=u)),s=u)};return{get(u){const h=t.get(u);if(h)return o(h),h.value},set(u,h){if(t.size>=e&&n){const c=n;t.delete(c.key),c.next&&(n=c.next,c.next.prev=void 0),c===s&&(s=void 0)}const a=t.get(u);if(a)a.value=h,o(a);else{const c={key:u,value:h,prev:s};s&&(s.next=c),s=c,n||(n=c),t.set(u,c)}},clear(){t.clear(),n=void 0,s=void 0}}}const Ol=0,fa=1,ha=2,vu=3,rA=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,sA=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,iA=/^([^{]*)\{\$\}([^}]*)$/;function C_(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),o=s===-1?e.length:s,u=e.substring(t,o);if(!u||!u.includes("$"))return n[0]=Ol,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(u==="$"){const d=e.length;return n[0]=ha,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(u.charCodeAt(0)===36)return n[0]=fa,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const h=u.match(iA);if(h){const p=h[1].length;return n[0]=ha,n[1]=t+p,n[2]=t+p+1,n[3]=t+p+2,n[4]=t+p+3,n[5]=e.length,n}const a=u.match(sA);if(a){const d=a[1],p=a[2],f=a[3],g=d.length;return n[0]=vu,n[1]=t+g,n[2]=t+g+3,n[3]=t+g+3+p.length,n[4]=o-f.length,n[5]=o,n}const c=u.match(rA);if(c){const d=c[1],p=c[2],f=c[3],g=d.length;return n[0]=fa,n[1]=t+g,n[2]=t+g+2,n[3]=t+g+2+p.length,n[4]=o-f.length,n[5]=o,n}return n[0]=Ol,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function $h(e,t,n,s,o,u,h){h?.(n);let a=s;{const c=n.fullPath??n.from,d=c.length,p=n.options?.caseSensitive??e;for(;a<d;){const f=C_(c,a,t);let g;const b=a,C=f[5];switch(a=C+1,u++,f[0]){case Ol:{const y=c.substring(f[2],f[3]);if(p){const _=o.static?.get(y);if(_)g=_;else{o.static??=new Map;const v=_u(n.fullPath??n.from);v.parent=o,v.depth=u,g=v,o.static.set(y,v)}}else{const _=y.toLowerCase(),v=o.staticInsensitive?.get(_);if(v)g=v;else{o.staticInsensitive??=new Map;const S=_u(n.fullPath??n.from);S.parent=o,S.depth=u,g=S,o.staticInsensitive.set(_,S)}}break}case fa:{const y=c.substring(b,f[1]),_=c.substring(f[4],C),v=p&&!!(y||_),S=y?v?y:y.toLowerCase():void 0,E=_?v?_:_.toLowerCase():void 0,T=o.dynamic?.find(A=>A.caseSensitive===v&&A.prefix===S&&A.suffix===E);if(T)g=T;else{const A=Fg(fa,n.fullPath??n.from,v,S,E);g=A,A.depth=u,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case vu:{const y=c.substring(b,f[1]),_=c.substring(f[4],C),v=p&&!!(y||_),S=y?v?y:y.toLowerCase():void 0,E=_?v?_:_.toLowerCase():void 0,T=o.optional?.find(A=>A.caseSensitive===v&&A.prefix===S&&A.suffix===E);if(T)g=T;else{const A=Fg(vu,n.fullPath??n.from,v,S,E);g=A,A.parent=o,A.depth=u,o.optional??=[],o.optional.push(A)}break}case ha:{const y=c.substring(b,f[1]),_=c.substring(f[4],C),v=p&&!!(y||_),S=y?v?y:y.toLowerCase():void 0,E=_?v?_:_.toLowerCase():void 0,T=Fg(ha,n.fullPath??n.from,v,S,E);g=T,T.parent=o,T.depth=u,o.wildcard??=[],o.wildcard.push(T)}}o=g}if((n.path||!n.children)&&!n.isRoot){const f=c.endsWith("/");f||(o.notFound=n),(!o.route||!o.isIndex&&f)&&(o.route=n,o.fullPath=n.fullPath??n.from),o.isIndex||=f}}if(n.children)for(const c of n.children)$h(e,t,c,a,o,u,h)}function Vg(e,t){if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function qo(e){if(e.static)for(const t of e.static.values())qo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())qo(t);if(e.dynamic?.length){e.dynamic.sort(Vg);for(const t of e.dynamic)qo(t)}if(e.optional?.length){e.optional.sort(Vg);for(const t of e.optional)qo(t)}if(e.wildcard?.length){e.wildcard.sort(Vg);for(const t of e.wildcard)qo(t)}}function _u(e){return{kind:Ol,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,isIndex:!1,notFound:null}}function Fg(e,t,n,s,o){return{kind:e,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,isIndex:!1,notFound:null,caseSensitive:n,prefix:s,suffix:o}}function oA(e,t){const n=_u("/"),s=new Uint16Array(6);for(const o of e)$h(!1,s,o,1,n,0);qo(n),t.masksTree=n,t.flatCache=hh(1e3)}function aA(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=w_(e,t.masksTree);return t.flatCache.set(e,s),s}function lA(e,t,n,s,o){e||="/",s||="/";const u=t?`case\0${e}`:e;let h=o.singleCache.get(u);if(!h){h=_u("/");const a=new Uint16Array(6);$h(t,a,{from:e},1,h,0),o.singleCache.set(u,h)}return w_(s,h,n)}function cA(e,t,n=!1){const s=n?e:`nofuzz\0${e}`,o=t.matchCache.get(s);if(o!==void 0)return o;e||="/";const u=w_(e,t.segmentTree,n);return u&&(u.branch=hA(u.route)),t.matchCache.set(s,u),u}function uA(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function dA(e,t=!1,n){const s=_u(e.fullPath),o=new Uint16Array(6),u={},h={};let a=0;return $h(t,o,e,1,s,0,d=>{if(n?.(d,a),vi(!(d.id in u),`Duplicate routes found with id: ${String(d.id)}`),u[d.id]=d,a!==0&&d.path){const p=uA(d.fullPath);(!h[p]||d.fullPath.endsWith("/"))&&(h[p]=d)}a++}),qo(s),{processedTree:{segmentTree:s,singleCache:hh(1e3),matchCache:hh(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:h}}function w_(e,t,n=!1){const s=e.split("/"),o=mA(e,s,t,n);if(!o)return null;const u=fA(e,s,o),h="**"in o;return h&&(u["**"]=o["**"]),{route:h?o.node.notFound??o.node.route:o.node.route,params:u}}function fA(e,t,n){const s=pA(n.node);let o=null;const u={};for(let h=0,a=0,c=0;a<s.length;h++,a++,c++){const d=s[a],p=t[h],f=c;if(p&&(c+=p.length),d.kind===fa){o??=n.node.fullPath.split("/");const g=o[a],b=d.prefix?.length??0;if(g.charCodeAt(b)===123){const x=d.suffix?.length??0,y=g.substring(b+2,g.length-x-1),_=p.substring(b,p.length-x);u[y]=decodeURIComponent(_)}else{const x=g.substring(1);u[x]=decodeURIComponent(p)}}else if(d.kind===vu){if(n.skipped&1<<a){h--;continue}o??=n.node.fullPath.split("/");const g=o[a],b=d.prefix?.length??0,C=d.suffix?.length??0,x=g.substring(b+3,g.length-C-1),y=d.suffix||d.prefix?p.substring(b,p.length-C):p;y&&(u[x]=decodeURIComponent(y))}else if(d.kind===ha){const g=d,b=e.substring(f+(g.prefix?.length??0),e.length-(g.suffix?.length??0)),C=decodeURIComponent(b);u["*"]=C,u._splat=C;break}}return u}function hA(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function pA(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function mA(e,t,n,s){const o=!dh(t),u=o&&e!=="/",h=t.length-(o?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,d=null,p=null;for(;a.length;){const f=a.pop();let{node:g,index:b,skipped:C,depth:x,statics:y,dynamics:_,optionals:v}=f;s&&g.notFound&&Cf(d,f)&&(d=f);const S=b===h;if(S){if(g.route&&(!u||g.isIndex)&&(Cf(p,f)&&(p=f),y===h&&g.isIndex))return p;if(!g.optional&&!g.wildcard)continue}const E=S?void 0:t[b];let T;if(g.wildcard&&Cf(c,f))for(const A of g.wildcard){const{prefix:M,suffix:L}=A;if(!(M&&(S||!(A.caseSensitive?E:T??=E.toLowerCase()).startsWith(M)))){if(L){if(S)continue;const D=t.slice(b).join("/").slice(-L.length);if((A.caseSensitive?D:D.toLowerCase())!==L)continue}c={node:A,index:b,skipped:C,depth:x,statics:y,dynamics:_,optionals:v};break}}if(g.optional){const A=C|1<<x,M=x+1;for(let L=g.optional.length-1;L>=0;L--){const D=g.optional[L];a.push({node:D,index:b,skipped:A,depth:M,statics:y,dynamics:_,optionals:v})}if(!S)for(let L=g.optional.length-1;L>=0;L--){const D=g.optional[L],{prefix:U,suffix:z}=D;if(U||z){const W=D.caseSensitive?E:T??=E.toLowerCase();if(U&&!W.startsWith(U)||z&&!W.endsWith(z))continue}a.push({node:D,index:b+1,skipped:C,depth:M,statics:y,dynamics:_,optionals:v+1})}}if(!S&&g.dynamic&&E)for(let A=g.dynamic.length-1;A>=0;A--){const M=g.dynamic[A],{prefix:L,suffix:D}=M;if(L||D){const U=M.caseSensitive?E:T??=E.toLowerCase();if(L&&!U.startsWith(L)||D&&!U.endsWith(D))continue}a.push({node:M,index:b+1,skipped:C,depth:x+1,statics:y,dynamics:_+1,optionals:v})}if(!S&&g.staticInsensitive){const A=g.staticInsensitive.get(T??=E.toLowerCase());A&&a.push({node:A,index:b+1,skipped:C,depth:x+1,statics:y+1,dynamics:_,optionals:v})}if(!S&&g.static){const A=g.static.get(E);A&&a.push({node:A,index:b+1,skipped:C,depth:x+1,statics:y+1,dynamics:_,optionals:v})}}if(p&&c)return Cf(c,p)?p:c;if(p)return p;if(c)return c;if(s&&d){let f=d.index;for(let b=0;b<d.index;b++)f+=t[b].length;const g=f===e.length?"/":e.slice(f);return{node:d.node,skipped:d.skipped,"**":decodeURIComponent(g)}}return null}function Cf(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&(t.node.isIndex>e.node.isIndex||t.node.isIndex===e.node.isIndex&&t.depth>e.depth))):!0}function th(e){return E_(e.filter(t=>t!==void 0).join("/"))}function E_(e){return e.replace(/\/{2,}/g,"/")}function Ow(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function sa(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Mw(e){return sa(Ow(e))}function ph(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function gA(e,t,n){return ph(e,n)===ph(t,n)}function vA({base:e,to:t,trailingSlash:n="never",cache:s}){const o=t.startsWith("/"),u=!o&&t===".";let h;if(s){h=o?t:u?e:e+"\0"+t;const f=s.get(h);if(f)return f}let a;if(u)a=e.split("/");else if(o)a=t.split("/");else{for(a=e.split("/");a.length>1&&dh(a)==="";)a.pop();const f=t.split("/");for(let g=0,b=f.length;g<b;g++){const C=f[g];C===""?g?g===b-1&&a.push(C):a=[C]:C===".."?a.pop():C==="."||a.push(C)}}a.length>1&&(dh(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let c,d="";for(let f=0;f<a.length;f++){f>0&&(d+="/");const g=a[f];if(!g)continue;c=C_(g,0,c);const b=c[0];if(b===Ol){d+=g;continue}const C=c[5],x=g.substring(0,c[1]),y=g.substring(c[4],C),_=g.substring(c[2],c[3]);b===fa?d+=x||y?`${x}{$${_}}${y}`:`$${_}`:b===ha?d+=x||y?`${x}{$}${y}`:"$":d+=`${x}{-$${_}}${y}`}d=E_(d);const p=d||"/";return h&&s&&s.set(h,p),p}function Ug(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?encodeURI(s):_A(s,n)}function Wg({path:e,params:t,decodeCharMap:n}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const u=e.length;let h=0,a,c="";for(;h<u;){const p=h;a=C_(e,p,a);const f=a[5];if(h=f+1,p===f)continue;const g=a[0];if(g===Ol){c+="/"+e.substring(p,f);continue}if(g===ha){const b=t._splat;o._splat=b,o["*"]=b;const C=e.substring(p,a[1]),x=e.substring(a[4],f);if(!b){s=!0,(C||x)&&(c+="/"+C+x);continue}const y=Ug("_splat",t,n);c+="/"+C+y+x;continue}if(g===fa){const b=e.substring(a[2],a[3]);!s&&!(b in t)&&(s=!0),o[b]=t[b];const C=e.substring(p,a[1]),x=e.substring(a[4],f),y=Ug(b,t,n)??"undefined";c+="/"+C+y+x;continue}if(g===vu){const b=e.substring(a[2],a[3]),C=t[b];if(C==null)continue;o[b]=C;const x=e.substring(p,a[1]),y=e.substring(a[4],f),_=Ug(b,t,n)??"";c+="/"+x+_+y;continue}}return e.endsWith("/")&&(c+="/"),{usedParams:o,interpolatedPath:c||"/",isMissingParams:s}}function _A(e,t){let n=encodeURIComponent(e);if(t)for(const[s,o]of t)n=n.replaceAll(s,o);return n}function es(e){return!!e?.isNotFound}function yA(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const mh="tsr-scroll-restoration-v1_3",bA=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function SA(){const e=yA();if(!e)return null;const t=e.getItem(mh);let n=t?JSON.parse(t):{};return{state:n,set:s=>(n=eo(s,n)||n,e.setItem(mh,JSON.stringify(n)))}}const wf=SA(),Ov=e=>e.state.__TSR_key||e.href;function xA(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let gh=!1;function Dw({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:o,location:u}){let h;try{h=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(d){console.error(d);return}const a=t||window.history.state?.__TSR_key,c=h[a];gh=!0;e:{if(s&&c&&Object.keys(c).length>0){for(const f in c){const g=c[f];if(f==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(f){const b=document.querySelector(f);b&&(b.scrollLeft=g.scrollX,b.scrollTop=g.scrollY)}}break e}const d=(u??window.location).hash.split("#",2)[1];if(d){const f=window.history.state?.__hashScrollIntoViewOptions??!0;if(f){const g=document.getElementById(d);g&&g.scrollIntoView(f)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),o)for(const f of o){if(f==="window")continue;const g=typeof f=="function"?f():document.querySelector(f);g&&g.scrollTo(p)}}gh=!1}function CA(e,t){if(!wf&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!wf))return;e.isScrollRestorationSetup=!0,gh=!1;const s=e.options.getScrollRestorationKey||Ov;window.history.scrollRestoration="manual";const o=u=>{if(gh||!e.isScrollRestoring)return;let h="";if(u.target===document||u.target===window)h="window";else{const c=u.target.getAttribute("data-scroll-restoration-id");c?h=`[data-scroll-restoration-id="${c}"]`:h=xA(u.target)}const a=s(e.state.location);wf.set(c=>{const d=c[a]||={},p=d[h]||={};if(h==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(h){const f=document.querySelector(h);f&&(p.scrollX=f.scrollLeft||0,p.scrollY=f.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",bA(o,100),!0),e.subscribe("onRendered",u=>{const h=s(u.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(Dw({storageKey:mh,key:h,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&wf.set(a=>(a[h]||={},a)))})}function wA(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function EA(e,t=String){const n=new URLSearchParams;for(const s in e){const o=e[s];o!==void 0&&n.set(s,t(o))}return n.toString()}function qg(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function RA(e){const t=new URLSearchParams(e),n={};for(const[s,o]of t.entries()){const u=n[s];u==null?n[s]=qg(o):Array.isArray(u)?u.push(qg(o)):n[s]=[u,qg(o)]}return n}const kA=LA(JSON.parse),TA=AA(JSON.stringify,JSON.parse);function LA(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=RA(t);for(const s in n){const o=n[s];if(typeof o=="string")try{n[s]=e(o)}catch{}}return n}}function AA(e,t){const n=typeof t=="function";function s(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const u=EA(o,s);return u?`?${u}`:""}}const Tr="__root__";function Pw(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function hs(e){return e instanceof Response&&!!e.options}const nh=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Kh=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),R_=(e,t,n=!0)=>{const s={...e.router.options.context??{}},o=n?t:t-1;for(let u=0;u<=o;u++){const h=e.matches[u];if(!h)continue;const a=e.router.getMatch(h.id);a&&Object.assign(s,a.__routeContext,a.__beforeLoadContext)}return s},Iw=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),vi(n.options.notFoundComponent);const s=e.matches.find(o=>o.routeId===n.id);vi(s,"Could not find match for route: "+n.id),e.updateMatch(s.id,o=>({...o,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,Iw(e,t))},to=(e,t,n)=>{if(!(!hs(n)&&!es(n))){if(hs(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const s=hs(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:s,isFetching:!1,error:n})),es(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw hs(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(Iw(e,n),n)}},Nw=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},Xc=(e,t,n,s)=>{const{id:o,routeId:u}=e.matches[t],h=e.router.looseRoutesById[u];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,to(e,e.router.getMatch(o),n);try{h.options.onError?.(n)}catch(a){n=a,to(e,e.router.getMatch(o),n)}e.updateMatch(o,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},OA=(e,t,n,s)=>{const o=e.router.getMatch(t),u=e.matches[n-1]?.id,h=u?e.router.getMatch(u):void 0;if(e.router.isShell()){o.ssr=s.id===Tr;return}if(h?.ssr===!1){o.ssr=!1;return}const a=b=>b===!0&&h?.ssr==="data-only"?"data-only":b,c=e.router.options.defaultSsr??!0;if(s.options.ssr===void 0){o.ssr=a(c);return}if(typeof s.options.ssr!="function"){o.ssr=a(s.options.ssr);return}const{search:d,params:p}=o,f={search:Ef(d,o.searchError),params:Ef(p,o.paramsError),location:e.location,matches:e.matches.map(b=>({index:b.index,pathname:b.pathname,fullPath:b.fullPath,staticData:b.staticData,id:b.id,routeId:b.routeId,search:Ef(b.search,b.searchError),params:Ef(b.params,b.paramsError),ssr:b.ssr}))},g=s.options.ssr(f);if(io(g))return g.then(b=>{o.ssr=a(b??c)});o.ssr=a(g??c)},jw=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!Kh(e,t)&&(n.options.loader||n.options.beforeLoad||Hw(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const h=setTimeout(()=>{nh(e)},o);s._nonReactive.pendingTimeout=h}},MA=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;jw(e,t,n,s);const o=()=>{const u=e.router.getMatch(t);u.preload&&(u.status==="redirected"||u.status==="notFound")&&to(e,u,u.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},DA=(e,t,n,s)=>{const o=e.router.getMatch(t),u=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Al(()=>{u?.resolve()});const{paramsError:h,searchError:a}=o;h&&Xc(e,n,h,"PARSE_PARAMS"),a&&Xc(e,n,a,"VALIDATE_SEARCH"),jw(e,t,s,o);const c=new AbortController,d=e.matches[n-1]?.id;(d?e.router.getMatch(d):void 0)?.context??e.router.options.context;let f=!1;const g=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:c})))},b=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!s.options.beforeLoad){uu(()=>{g(),b()});return}o._nonReactive.beforeLoadPromise=Al();const C={...R_(e,n,!1),...o.__routeContext},{search:x,params:y,cause:_}=o,v=Kh(e,t),S={search:x,abortController:c,params:y,preload:v,context:C,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":_,matches:e.matches,...e.router.options.additionalContext},E=A=>{if(A===void 0){uu(()=>{g(),b()});return}(hs(A)||es(A))&&(g(),Xc(e,n,A,"BEFORE_LOAD")),uu(()=>{g(),e.updateMatch(t,M=>({...M,__beforeLoadContext:A})),b()})};let T;try{if(T=s.options.beforeLoad(S),io(T))return g(),T.catch(A=>{Xc(e,n,A,"BEFORE_LOAD")}).then(E)}catch(A){g(),Xc(e,n,A,"BEFORE_LOAD")}E(T)},PA=(e,t)=>{const{id:n,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s],u=()=>{if(e.router.isServer){const c=OA(e,n,t,o);if(io(c))return c.then(a)}return a()},h=()=>DA(e,n,t,o),a=()=>{if(Nw(e,n))return;const c=MA(e,n,o);return io(c)?c.then(h):h()};return u()},du=(e,t,n)=>{const s=e.router.getMatch(t);if(!s||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([u,h,a])=>{const c=u?.meta,d=u?.links,p=u?.scripts,f=u?.styles;return{meta:c,links:d,headScripts:p,headers:a,scripts:h,styles:f}})},Bw=(e,t,n,s)=>{const o=e.matchPromises[n-1],{params:u,loaderDeps:h,abortController:a,cause:c}=e.router.getMatch(t),d=R_(e,n),p=Kh(e,t);return{params:u,deps:h,preload:!!p,parentMatchPromise:o,abortController:a,context:d,location:e.location,navigate:f=>e.router.navigate({...f,_fromLocation:e.location}),cause:p?"preload":c,route:s,...e.router.options.additionalContext}},QS=async(e,t,n,s)=>{try{const o=e.router.getMatch(t);try{(!e.router.isServer||o.ssr===!0)&&zw(s);const u=s.options.loader?.(Bw(e,t,n,s)),h=s.options.loader&&io(u);if((h||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(t,f=>({...f,isFetching:"loader"})),s.options.loader){const f=h?await u:u;to(e,e.router.getMatch(t),f),f!==void 0&&e.updateMatch(t,g=>({...g,loaderData:f}))}s._lazyPromise&&await s._lazyPromise;const c=du(e,t,s),d=c?await c:void 0,p=o._nonReactive.minPendingPromise;p&&await p,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,f=>({...f,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...d}))}catch(u){let h=u;const a=o._nonReactive.minPendingPromise;a&&await a,es(u)&&await s.options.notFoundComponent?.preload?.(),to(e,e.router.getMatch(t),u);try{s.options.onError?.(u)}catch(p){h=p,to(e,e.router.getMatch(t),p)}const c=du(e,t,s),d=c?await c:void 0;e.updateMatch(t,p=>({...p,error:h,status:"error",isFetching:!1,...d}))}}catch(o){const u=e.router.getMatch(t);if(u){const h=du(e,t,s);if(h){const a=await h;e.updateMatch(t,c=>({...c,...a}))}u._nonReactive.loaderPromise=void 0}to(e,u,o)}},IA=async(e,t)=>{const{id:n,routeId:s}=e.matches[t];let o=!1,u=!1;const h=e.router.looseRoutesById[s],a=()=>{e.updateMatch(n,p=>({...p,context:R_(e,t)}))};if(Nw(e,n)){if(e.router.isServer){const p=du(e,n,h);if(p){const f=await p;e.updateMatch(n,g=>({...g,...f}))}return e.router.getMatch(n)}}else{const p=e.router.getMatch(n);if(p._nonReactive.loaderPromise){if(p.status==="success"&&!e.sync&&!p.preload)return p;await p._nonReactive.loaderPromise;const f=e.router.getMatch(n),g=f._nonReactive.error||f.error;g&&to(e,f,g)}else{const f=Date.now()-p.updatedAt,g=Kh(e,n),b=g?h.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:h.options.staleTime??e.router.options.defaultStaleTime??0,C=h.options.shouldReload,x=typeof C=="function"?C(Bw(e,n,t,h)):C,y=!!g&&!e.router.state.matches.some(E=>E.id===n),_=e.router.getMatch(n);_._nonReactive.loaderPromise=Al(),y!==_.preload&&e.updateMatch(n,E=>({...E,preload:y}));const{status:v,invalid:S}=_;if(o=v==="success"&&(S||(x??f>b)),!(g&&h.options.preload===!1))if(o&&!e.sync)u=!0,(async()=>{try{await QS(e,n,t,h),a();const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0}catch(E){hs(E)&&await e.router.navigate(E.options)}})();else if(v!=="success"||o&&e.sync)await QS(e,n,t,h);else{const E=du(e,n,h);if(E){const T=await E;e.updateMatch(n,A=>({...A,...T}))}}}}const c=e.router.getMatch(n);u||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,u||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0,u||a();const d=u?c.isFetching:!1;return d!==c.isFetching||c.invalid!==!1?(e.updateMatch(n,p=>({...p,isFetching:d,invalid:!1})),e.router.getMatch(n)):c};async function ZS(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&nh(t);try{for(let o=0;o<t.matches.length;o++){const u=PA(t,o);io(u)&&await u}const n=t.firstBadMatchIndex??t.matches.length;for(let o=0;o<n;o++)t.matchPromises.push(IA(t,o));await Promise.all(t.matchPromises);const s=nh(t);io(s)&&await s}catch(n){if(es(n)&&!t.preload){const s=nh(t);throw io(s)&&await s,n}if(hs(n))throw n}return t.matches}async function zw(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const s of Vw){const o=e.options[s]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function Ef(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function Hw(e){for(const t of Vw)if(e.options[t]?.preload)return!0;return!1}const Vw=["component","errorComponent","pendingComponent","notFoundComponent"];function NA(e){return{input:({url:t})=>{for(const n of e)t=Fw(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Uw(e[n],t);return t}}}function jA(e){const t=Mw(e.basepath),n=`/${t}`,s=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),u=e.caseSensitive?s:s.toLowerCase();return{input:({url:h})=>{const a=e.caseSensitive?h.pathname:h.pathname.toLowerCase();return a===o?h.pathname="/":a.startsWith(u)&&(h.pathname=h.pathname.slice(n.length)),h},output:({url:h})=>(h.pathname=th(["/",t,h.pathname]),h)}}function Fw(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Uw(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function ia(e){const t=e.resolvedLocation,n=e.location,s=t?.pathname!==n.pathname,o=t?.href!==n.href,u=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:s,hrefChanged:o,hashChanged:u}}class BA{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,o=this.basepath??s?.basepath??"/",u=this.basepath===void 0,h=s?.rewrite;this.options={...s,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=JL())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new QL(HA(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),CA(this));let a=!1;const c=this.options.basepath??"/",d=this.options.rewrite;if(u||o!==c||h!==d){this.basepath=c;const g=[];Mw(c)!==""&&g.push(jA({basepath:c})),d&&g.push(d),this.rewrite=g.length===0?void 0:g.length===1?g[0]:NA(g),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:s,processedTree:o}=dA(this.routeTree,this.options.caseSensitive,(h,a)=>{h.init({originalIndex:a})});this.options.routeMasks&&oA(this.options.routeMasks,o),this.routesById=n,this.routesByPath=s,this.processedTree=o;const u=this.options.notFoundRoute;u&&(u.init({originalIndex:99999999999}),this.routesById[u.id]=u)},this.subscribe=(n,s)=>{const o={eventType:n,fn:s};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(s=>{s.eventType===n.type&&s.fn(n)})},this.parseLocation=(n,s)=>{const o=({href:c,state:d})=>{const p=new URL(c,this.origin),f=Fw(this.rewrite,p),g=this.options.parseSearch(f.search),b=this.options.stringifySearch(g);return f.search=b,{href:f.href.replace(f.origin,""),publicHref:c,url:f,pathname:XS(f.pathname),searchStr:b,search:Yr(s?.search,g),hash:f.hash.split("#").reverse()[0]??"",state:Yr(s?.state,d)}},u=o(n),{__tempLocation:h,__tempKey:a}=u.state;if(h&&(!a||a===this.tempLocationKey)){const c=o(h);return c.state.key=u.state.key,c.state.__TSR_key=u.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:u}}return u},this.resolvePathCache=hh(1e3),this.resolvePathWithBase=(n,s)=>vA({base:n,to:E_(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,s,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:s},o):this.matchRoutesInternal(n,s),this.getMatchedRoutes=n=>VA({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const s=this.getMatch(n);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(u=>u.status==="pending"),s=this.state.matches.filter(u=>u.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...s]).forEach(u=>{this.cancelMatch(u.id)})},this.buildLocation=n=>{const s=(u={})=>{const h=u._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutes(h,{_buildLocation:!0}),c=dh(a);u.from;const d=u.unsafeRelative==="path"?h.pathname:u.from??c.fullPath,p=this.resolvePathWithBase(d,"."),f=c.search,g={...c.params},b=u.to?this.resolvePathWithBase(p,`${u.to}`):this.resolvePathWithBase(p,"."),C=u.params===!1||u.params===null?{}:(u.params??!0)===!0?g:Object.assign(g,eo(u.params,g)),x=Wg({path:b,params:C}).interpolatedPath,y=this.matchRoutes(x,void 0,{_buildLocation:!0}).map(U=>this.looseRoutesById[U.routeId]);if(Object.keys(C).length>0)for(const U of y){const z=U.options.params?.stringify??U.options.stringifyParams;z&&Object.assign(C,z(C))}const _=n.leaveParams?b:XS(Wg({path:b,params:C,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let v=f;if(n._includeValidateSearch&&this.options.search?.strict){const U={};y.forEach(z=>{if(z.options.validateSearch)try{Object.assign(U,Mv(z.options.validateSearch,{...U,...v}))}catch{}}),v=U}v=FA({search:v,dest:u,destRoutes:y,_includeValidateSearch:n._includeValidateSearch}),v=Yr(f,v);const S=this.options.stringifySearch(v),E=u.hash===!0?h.hash:u.hash?eo(u.hash,h.hash):void 0,T=E?`#${E}`:"";let A=u.state===!0?h.state:u.state?eo(u.state,h.state):{};A=Yr(h.state,A);const M=`${_}${S}${T}`,L=new URL(M,this.origin),D=Uw(this.rewrite,L);return{publicHref:D.pathname+D.search+D.hash,href:M,url:D,pathname:_,search:v,searchStr:S,state:A,hash:E??"",unmaskOnReload:u.unmaskOnReload}},o=(u={},h)=>{const a=s(u);let c=h?s(h):void 0;if(!c){const d={};if(this.options.routeMasks){const p=aA(a.pathname,this.processedTree);if(p){Object.assign(d,p.params);const{from:f,params:g,...b}=p.route,C=g===!1||g===null?{}:(g??!0)===!0?d:Object.assign(d,eo(g,d));h={from:n.from,...b,params:C},c=s(h)}}}return c&&(a.maskedLocation=c),a};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:s,...o})=>{const u=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(p=>{o.state[p]=this.latestLocation.state[p]});const d=ra(o.state,this.latestLocation.state);return c.forEach(p=>{delete o.state[p]}),d},h=sa(this.latestLocation.href)===sa(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Al(()=>{a?.resolve()}),h&&u())this.load();else{let{maskedLocation:c,hashScrollIntoView:d,url:p,...f}=o;c&&(f={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:s})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:s,hashScrollIntoView:o,viewTransition:u,ignoreBlocker:h,href:a,...c}={})=>{if(a){const f=this.history.location.state.__TSR_index,g=uh(a,{__TSR_index:n?f:f+1});c.to=g.pathname,c.search=this.options.parseSearch(g.search),c.hash=g.hash.slice(1)}const d=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const p=this.commitLocation({...d,viewTransition:u,replace:n,resetScroll:s,hashScrollIntoView:o,ignoreBlocker:h});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:n,reloadDocument:s,href:o,...u})=>{if(!s&&o)try{new URL(`${o}`),s=!0}catch{}if(s){if(o||(o=this.buildLocation({to:n,...u}).url.href),!u.ignoreBlocker){const a=this.history.getBlockers?.()??[];for(const c of a)if(c?.blockerFn&&await c.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(o):window.location.href=o,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==s.publicHref||s.url.origin!==this.origin){const o=this.getParsedLocationHref(s);throw Pw({href:o})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:s.cachedMatches.filter(o=>!n.some(u=>u.id===o.id))}))},this.load=async n=>{let s,o,u;for(u=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ia({resolvedLocation:d,location:c})}),this.emit({type:"onBeforeLoad",...ia({resolvedLocation:d,location:c})}),await ZS({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],f=[],g=[];uu(()=>{this.__store.setState(b=>{const C=b.matches,x=b.pendingMatches||b.matches;return p=C.filter(y=>!x.some(_=>_.id===y.id)),f=x.filter(y=>!C.some(_=>_.id===y.id)),g=x.filter(y=>C.some(_=>_.id===y.id)),{...b,isLoading:!1,loadedAt:Date.now(),matches:x,pendingMatches:void 0,cachedMatches:[...b.cachedMatches,...p.filter(y=>y.status!=="error"&&y.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[f,"onEnter"],[g,"onStay"]].forEach(([b,C])=>{b.forEach(x=>{this.looseRoutesById[x.routeId].options[C]?.(x)})})})})}})}catch(c){hs(c)?(s=c,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):es(c)&&(o=c),this.__store.setState(d=>({...d,statusCode:s?s.status:o?404:d.matches.some(p=>p.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===u&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=u,await u;this.latestLoadPromise&&u!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.__store.state.matches.some(a=>a.status==="error")&&(h=500),h!==void 0&&this.__store.setState(a=>({...a,statusCode:h}))},this.startViewTransition=n=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const u=this.latestLocation,h=this.state.resolvedLocation,a=typeof s.types=="function"?s.types(ia({resolvedLocation:h,location:u})):s.types;if(a===!1){n();return}o={update:n,types:a}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,s)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(u=>u.id===n)?"pendingMatches":this.state.matches.some(u=>u.id===n)?"matches":this.state.cachedMatches.some(u=>u.id===n)?"cachedMatches":"";o&&this.__store.setState(u=>({...u,[o]:u[o]?.map(h=>h.id===n?s(h):h)}))})},this.getMatch=n=>{const s=o=>o.id===n;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=n=>{const s=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(s),cachedMatches:o.cachedMatches.map(s),pendingMatches:o.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>{let s=n.url.href;return this.origin&&n.url.origin===this.origin&&(s=s.replace(this.origin,"")||"/"),s},this.resolveRedirect=n=>{if(!n.options.href){const s=this.buildLocation(n.options),o=this.getParsedLocationHref(s);n.options.href=s.href,n.headers.set("Location",o)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const s=n?.filter;s!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(u=>!s(u))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=s=>{const o=this.looseRoutesById[s.routeId];if(!o.options.loader)return!0;const u=(s.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=u};this.clearCache({filter:n})},this.loadRouteChunk=zw,this.preloadRoute=async n=>{const s=this.buildLocation(n);let o=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:n});const u=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),h=new Set([...u,...this.state.cachedMatches.map(a=>a.id)]);uu(()=>{o.forEach(a=>{h.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return o=await ZS({router:this,matches:o,location:s,preload:!0,updateMatch:(a,c)=>{u.has(a)?o=o.map(d=>d.id===a?c(d):d):this.updateMatch(a,c)}}),o}catch(a){if(hs(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});es(a)||console.error(a);return}},this.matchRoute=(n,s)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},u=this.buildLocation(o);if(s?.pending&&this.state.status!=="pending")return!1;const a=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=lA(u.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!c||n.params&&!ra(c.params,n.params,{partial:!0})?!1:s?.includeSearch??!0?ra(a.search,u.search,{partial:!0})?c.params:!1:c.params},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??TA,parseSearch:t.parseSearch??kA}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const s=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:u}=s;let{matchedRoutes:h}=s,a=!1;(o?o.path!=="/"&&u["**"]:sa(t.pathname))&&(this.options.notFoundRoute?h=[...h,this.options.notFoundRoute]:a=!0);const c=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let f=h.length-1;f>=0;f--){const g=h[f];if(g.children)return g.id}return Tr}})(),d=[],p=f=>f?.id?f.context??this.options.context??void 0:this.options.context??void 0;return h.forEach((f,g)=>{const b=d[g-1],[C,x,y]=(()=>{const N=b?.search??t.search,Y=b?._strictSearch??void 0;try{const $=Mv(f.options.validateSearch,{...N})??void 0;return[{...N,...$},{...Y,...$},void 0]}catch($){let F=$;if($ instanceof vh||(F=new vh($.message,{cause:$})),n?.throwOnError)throw F;return[N,{},F]}})(),_=f.options.loaderDeps?.({search:C})??"",v=_?JSON.stringify(_):"",{interpolatedPath:S,usedParams:E}=Wg({path:f.fullPath,params:u,decodeCharMap:this.pathParamsDecodeCharMap}),T=f.id+S+v,A=this.getMatch(T),M=this.state.matches.find(N=>N.routeId===f.id),L=A?._strictParams??E;let D;if(!A){const N=f.options.params?.parse??f.options.parseParams;if(N)try{Object.assign(L,N(L))}catch(Y){if(es(Y)||hs(Y)?D=Y:D=new zA(Y.message,{cause:Y}),n?.throwOnError)throw D}}Object.assign(u,L);const U=M?"stay":"enter";let z;if(A)z={...A,cause:U,params:M?Yr(M.params,u):u,_strictParams:L,search:Yr(M?M.search:A.search,C),_strictSearch:x};else{const N=f.options.loader||f.options.beforeLoad||f.lazyFn||Hw(f)?"pending":"success";z={id:T,ssr:this.isServer?void 0:f.options.ssr,index:g,routeId:f.id,params:M?Yr(M.params,u):u,_strictParams:L,pathname:S,updatedAt:Date.now(),search:M?Yr(M.search,C):C,_strictSearch:x,searchError:void 0,status:N,isFetching:!1,error:void 0,paramsError:D,__routeContext:void 0,_nonReactive:{loadPromise:Al()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:U,loaderDeps:M?Yr(M.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:f.options.staticData||{},fullPath:f.fullPath}}n?.preload||(z.globalNotFound=c===f.id),z.searchError=y;const W=p(b);z.context={...W,...z.__routeContext,...z.__beforeLoadContext},d.push(z)}),d.forEach((f,g)=>{const b=this.looseRoutesById[f.routeId];if(!this.getMatch(f.id)&&n?._buildLocation!==!0){const x=d[g-1],y=p(x);if(b.options.context){const _={deps:f.loaderDeps,params:f.params,context:y??{},location:t,navigate:v=>this.navigate({...v,_fromLocation:t}),buildLocation:this.buildLocation,cause:f.cause,abortController:f.abortController,preload:!!f.preload,matches:d};f.__routeContext=b.options.context(_)??void 0}f.context={...y,...f.__routeContext,...f.__beforeLoadContext}}}),d}}class vh extends Error{}class zA extends Error{}function HA(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Mv(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new vh("Async validation not supported");if(n.issues)throw new vh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function VA({pathname:e,routesById:t,processedTree:n}){const s={},o=sa(e);let u;const h=cA(o,n,!0);return h&&(u=h.route,Object.assign(s,h.params)),{matchedRoutes:h?.branch||[t[Tr]],routeParams:s,foundRoute:u}}function FA({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){const o=n.reduce((a,c)=>{const d=[];if("search"in c.options)c.options.search?.middlewares&&d.push(...c.options.search.middlewares);else if(c.options.preSearchFilters||c.options.postSearchFilters){const p=({search:f,next:g})=>{let b=f;"preSearchFilters"in c.options&&c.options.preSearchFilters&&(b=c.options.preSearchFilters.reduce((x,y)=>y(x),f));const C=g(b);return"postSearchFilters"in c.options&&c.options.postSearchFilters?c.options.postSearchFilters.reduce((x,y)=>y(x),C):C};d.push(p)}if(s&&c.options.validateSearch){const p=({search:f,next:g})=>{const b=g(f);try{return{...b,...Mv(c.options.validateSearch,b)??void 0}}catch{return b}};d.push(p)}return a.concat(d)},[])??[],u=({search:a})=>t.search?t.search===!0?a:eo(t.search,a):{};o.push(u);const h=(a,c)=>{if(a>=o.length)return c;const d=o[a];return d({search:c,next:f=>h(a+1,f)})};return h(0,e)}const UA="Error preloading route! ☝️";class Ww{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,o=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=Tr:this.parentRoute||vi(!1);let u=o?Tr:s?.path;u&&u!=="/"&&(u=Ow(u));const h=s?.id||u;let a=o?Tr:th([this.parentRoute.id===Tr?"":this.parentRoute.id,h]);u===Tr&&(u="/"),a!==Tr&&(a=th(["/",a]));const c=a===Tr?"/":th([this.parentRoute.fullPath,u]);this._path=u,this._id=a,this._fullPath=c,this._to=c},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class WA extends Ww{constructor(t){super(t)}}function k_(e){const t=e.errorComponent??Yh;return w.jsx(qA,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?k.createElement(t,{error:n,reset:s}):e.children})}class qA extends k.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Yh({error:e}){const[t,n]=k.useState(!1);return w.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[w.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),w.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),w.jsx("div",{style:{height:".25rem"}}),t?w.jsx("div",{children:w.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?w.jsx("code",{children:e.message}):null})}):null]})}function GA({children:e,fallback:t=null}){return $A()?w.jsx(Ie.Fragment,{children:e}):w.jsx(Ie.Fragment,{children:t})}function $A(){return Ie.useSyncExternalStore(KA,()=>!0,()=>!1)}function KA(){return()=>{}}var Gg={exports:{}},$g={},Kg={exports:{}},Yg={};var JS;function YA(){if(JS)return Yg;JS=1;var e=Iu();function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,u=e.useLayoutEffect,h=e.useDebugValue;function a(f,g){var b=g(),C=s({inst:{value:b,getSnapshot:g}}),x=C[0].inst,y=C[1];return u(function(){x.value=b,x.getSnapshot=g,c(x)&&y({inst:x})},[f,b,g]),o(function(){return c(x)&&y({inst:x}),f(function(){c(x)&&y({inst:x})})},[f]),h(b),b}function c(f){var g=f.getSnapshot;f=f.value;try{var b=g();return!n(f,b)}catch{return!0}}function d(f,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return Yg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Yg}var ex;function qw(){return ex||(ex=1,Kg.exports=YA()),Kg.exports}var tx;function XA(){if(tx)return $g;tx=1;var e=Iu(),t=qw();function n(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,u=e.useRef,h=e.useEffect,a=e.useMemo,c=e.useDebugValue;return $g.useSyncExternalStoreWithSelector=function(d,p,f,g,b){var C=u(null);if(C.current===null){var x={hasValue:!1,value:null};C.current=x}else x=C.current;C=a(function(){function _(A){if(!v){if(v=!0,S=A,A=g(A),b!==void 0&&x.hasValue){var M=x.value;if(b(M,A))return E=M}return E=A}if(M=E,s(S,A))return M;var L=g(A);return b!==void 0&&b(M,L)?(S=A,M):(S=A,E=L)}var v=!1,S,E,T=f===void 0?null:f;return[function(){return _(p())},T===null?void 0:function(){return _(T())}]},[p,f,g,b]);var y=o(d,C[0],C[1]);return h(function(){x.hasValue=!0,x.value=y},[y]),c(y),y},$g}var nx;function QA(){return nx||(nx=1,Gg.exports=XA()),Gg.exports}var Gw=QA();function ZA(e,t=s=>s,n={}){const s=n.equal??JA;return Gw.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,s)}function JA(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!t.has(s)||!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=rx(e);if(n.length!==rx(t).length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Object.is(e[n[s]],t[n[s]]))return!1;return!0}function rx(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const Xg=k.createContext(null);function $w(){return typeof document>"u"?Xg:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Xg,Xg)}function Ir(e){const t=k.useContext($w());return e?.warn,t}function Xn(e){const t=Ir({warn:e?.router===void 0}),n=e?.router||t,s=k.useRef(void 0);return ZA(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const u=Yr(s.current,e.select(o));return s.current=u,u}return e.select(o)}return o})}const Xh=k.createContext(void 0),eO=k.createContext(void 0);function Is(e){const t=k.useContext(e.from?eO:Xh);return Xn({select:s=>{const o=s.matches.find(u=>e.from?e.from===u.routeId:u.id===t);if(vi(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function T_(e){return Is({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function L_(e){const{select:t,...n}=e;return Is({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function A_(e){return Is({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function O_(e){return Is({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}const Rf=typeof window<"u"?k.useLayoutEffect:k.useEffect;function Qg(e){const t=k.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function tO(e,t,n={},s={}){k.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([u])=>{t(u)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,s.disabled,e])}function nO(e){const t=k.useRef(null);return k.useImperativeHandle(e,()=>t.current,[]),t}function po(e){const t=Ir();return k.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Qn=Tw();const rO=Rw(Qn);function sO(e,t){const n=Ir(),[s,o]=k.useState(!1),u=k.useRef(!1),h=nO(t),{activeProps:a,inactiveProps:c,activeOptions:d,to:p,preload:f,preloadDelay:g,hashScrollIntoView:b,replace:C,startTransition:x,resetScroll:y,viewTransition:_,children:v,target:S,disabled:E,style:T,className:A,onClick:M,onFocus:L,onMouseEnter:D,onMouseLeave:U,onTouchStart:z,ignoreBlocker:W,params:N,search:Y,hash:$,state:F,mask:q,reloadDocument:H,unsafeRelative:P,from:B,_fromLocation:I,...G}=e,K=Xn({select:ae=>ae.location.search,structuralSharing:!0}),J=e.from,Z=k.useMemo(()=>({...e,from:J}),[n,K,J,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ee=k.useMemo(()=>n.buildLocation({...Z}),[n,Z]),X=k.useMemo(()=>{if(E)return;let ae=ee.maskedLocation?ee.maskedLocation.url.href:ee.url.href,be=!1;return n.origin&&(ae.startsWith(n.origin)?ae=n.history.createHref(ae.replace(n.origin,""))||"/":be=!0),{href:ae,external:be}},[E,ee.maskedLocation,ee.url,n.origin,n.history]),V=k.useMemo(()=>{if(X?.external)return X.href;try{return new URL(p),p}catch{}},[p,X]),se=e.reloadDocument||V?!1:f??n.options.defaultPreload,re=g??n.options.defaultPreloadDelay??0,ne=Xn({select:ae=>{if(V)return!1;if(d?.exact){if(!gA(ae.location.pathname,ee.pathname,n.basepath))return!1}else{const be=ph(ae.location.pathname,n.basepath),Ce=ph(ee.pathname,n.basepath);if(!(be.startsWith(Ce)&&(be.length===Ce.length||be[Ce.length]==="/")))return!1}return(d?.includeSearch??!0)&&!ra(ae.location.search,ee.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?ae.location.hash===ee.hash:!0}}),oe=k.useCallback(()=>{n.preloadRoute({...Z}).catch(ae=>{console.warn(ae),console.warn(UA)})},[n,Z]),ce=k.useCallback(ae=>{ae?.isIntersecting&&oe()},[oe]);tO(h,ce,cO,{disabled:!!E||se!=="viewport"}),k.useEffect(()=>{u.current||!E&&se==="render"&&(oe(),u.current=!0)},[E,oe,se]);const ve=ae=>{const be=ae.currentTarget.getAttribute("target"),Ce=S!==void 0?S:be;if(!E&&!uO(ae)&&!ae.defaultPrevented&&(!Ce||Ce==="_self")&&ae.button===0){ae.preventDefault(),Qn.flushSync(()=>{o(!0)});const We=n.subscribe("onResolved",()=>{We(),o(!1)});n.navigate({...Z,replace:C,resetScroll:y,hashScrollIntoView:b,startTransition:x,viewTransition:_,ignoreBlocker:W})}};if(V)return{...G,ref:h,href:V,...v&&{children:v},...S&&{target:S},...E&&{disabled:E},...T&&{style:T},...A&&{className:A},...M&&{onClick:M},...L&&{onFocus:L},...D&&{onMouseEnter:D},...U&&{onMouseLeave:U},...z&&{onTouchStart:z}};const ge=ae=>{E||se&&oe()},he=ge,de=ae=>{if(!(E||!se))if(!re)oe();else{const be=ae.target;if(Qc.has(be))return;const Ce=setTimeout(()=>{Qc.delete(be),oe()},re);Qc.set(be,Ce)}},Le=ae=>{if(E||!se||!re)return;const be=ae.target,Ce=Qc.get(be);Ce&&(clearTimeout(Ce),Qc.delete(be))},Oe=ne?eo(a,{})??iO:Zg,Ne=ne?Zg:eo(c,{})??Zg,ye=[A,Oe.className,Ne.className].filter(Boolean).join(" "),Ae=(T||Oe.style||Ne.style)&&{...T,...Oe.style,...Ne.style};return{...G,...Oe,...Ne,href:X?.href,ref:h,onClick:Zc([M,ve]),onFocus:Zc([L,ge]),onMouseEnter:Zc([D,de]),onMouseLeave:Zc([U,Le]),onTouchStart:Zc([z,he]),disabled:!!E,target:S,...Ae&&{style:Ae},...ye&&{className:ye},...E&&oO,...ne&&aO,...s&&lO}}const Zg={},iO={className:"active"},oO={role:"link","aria-disabled":!0},aO={"data-status":"active","aria-current":"page"},lO={"data-transitioning":"transitioning"},Qc=new WeakMap,cO={rootMargin:"100px"},Zc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},rr=k.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:o,ref:u,...h}=sO(s,t),a=typeof s.children=="function"?s.children({isActive:h["data-status"]==="active"}):s.children;return n===void 0&&delete h.disabled,k.createElement(n||"a",{...h,ref:u},a)});function uO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let dO=class extends Ww{constructor(t){super(t),this.useMatch=n=>Is({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Is({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>O_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>A_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>L_({...n,from:this.id}),this.useLoaderData=n=>T_({...n,from:this.id}),this.useNavigate=()=>po({from:this.fullPath}),this.Link=Ie.forwardRef((n,s)=>w.jsx(rr,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function fO(e){return new dO(e)}class hO extends WA{constructor(t){super(t),this.useMatch=n=>Is({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Is({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>O_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>A_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>L_({...n,from:this.id}),this.useLoaderData=n=>T_({...n,from:this.id}),this.useNavigate=()=>po({from:this.fullPath}),this.Link=Ie.forwardRef((n,s)=>w.jsx(rr,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function pO(e){return new hO(e)}function Ns(e){return typeof e=="object"?new sx(e,{silent:!0}).createRoute(e):new sx(e,{silent:!0}).createRoute}class sx{constructor(t,n){this.path=t,this.createRoute=s=>{this.silent;const o=fO(s);return o.isRoot=!1,o},this.silent=n?.silent}}class ix{constructor(t){this.useMatch=n=>Is({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Is({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>O_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>A_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>L_({...n,from:this.options.id}),this.useLoaderData=n=>T_({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ir();return po({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function ox(e){return typeof e=="object"?new ix(e):t=>new ix({id:e,...t})}function mO(){const e=Ir(),t=k.useRef({router:e,mounted:!1}),[n,s]=k.useState(!1),{hasPendingMatches:o,isLoading:u}=Xn({select:f=>({isLoading:f.isLoading,hasPendingMatches:f.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),h=Qg(u),a=u||n||o,c=Qg(a),d=u||o,p=Qg(d);return e.startTransition=f=>{s(!0),k.startTransition(()=>{f(),s(!1)})},k.useEffect(()=>{const f=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return sa(e.latestLocation.href)!==sa(g.href)&&e.commitLocation({...g,replace:!0}),()=>{f()}},[e,e.history]),Rf(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),Rf(()=>{h&&!u&&e.emit({type:"onLoad",...ia(e.state)})},[h,e,u]),Rf(()=>{p&&!d&&e.emit({type:"onBeforeRouteMount",...ia(e.state)})},[d,p,e]),Rf(()=>{if(c&&!a){const f=ia(e.state);e.emit({type:"onResolved",...f}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),f.hrefChanged&&wA(e)}},[a,c,e]),null}function gO(e){const t=Xn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return w.jsx(k_,{getResetKey:()=>t,onCatch:(n,s)=>{if(es(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(es(n))return e.fallback?.(n);throw n},children:e.children})}function vO(){return w.jsx("p",{children:"Not Found"})}function vl(e){return w.jsx(w.Fragment,{children:e.children})}function Kw(e,t,n){return t.options.notFoundComponent?w.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?w.jsx(e.options.defaultNotFoundComponent,{...n}):w.jsx(vO,{})}function _O({children:e}){const t=Ir();return t.isServer?w.jsx("script",{nonce:t.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function yO(){const e=Ir();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||Ov)(e.latestLocation),s=n!==Ov(e.latestLocation)?n:void 0,o={storageKey:mh,shouldScrollRestoration:!0};return s&&(o.key=s),w.jsx(_O,{children:`(${Dw.toString()})(${JSON.stringify(o)})`})}const Yw=k.memo(function({matchId:t}){const n=Ir(),s=Xn({select:_=>{const v=_.matches.find(S=>S.id===t);return vi(v),{routeId:v.routeId,ssr:v.ssr,_displayPending:v._displayPending}},structuralSharing:!0}),o=n.routesById[s.routeId],u=o.options.pendingComponent??n.options.defaultPendingComponent,h=u?w.jsx(u,{}):null,a=o.options.errorComponent??n.options.defaultErrorComponent,c=o.options.onCatch??n.options.defaultOnCatch,d=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,p=s.ssr===!1||s.ssr==="data-only",f=(!o.isRoot||o.options.wrapInSuspense||p)&&(o.options.wrapInSuspense??u??(o.options.errorComponent?.preload||p))?k.Suspense:vl,g=a?k_:vl,b=d?gO:vl,C=Xn({select:_=>_.loadedAt}),x=Xn({select:_=>{const v=_.matches.findIndex(S=>S.id===t);return _.matches[v-1]?.routeId}}),y=o.isRoot?o.options.shellComponent??vl:vl;return w.jsxs(y,{children:[w.jsx(Xh.Provider,{value:t,children:w.jsx(f,{fallback:h,children:w.jsx(g,{getResetKey:()=>C,errorComponent:a||Yh,onCatch:(_,v)=>{if(es(_))throw _;c?.(_,v)},children:w.jsx(b,{fallback:_=>{if(!d||_.routeId&&_.routeId!==s.routeId||!_.routeId&&!o.isRoot)throw _;return k.createElement(d,_)},children:p||s._displayPending?w.jsx(GA,{fallback:h,children:w.jsx(ax,{matchId:t})}):w.jsx(ax,{matchId:t})})})})}),x===Tr&&n.options.scrollRestoration?w.jsxs(w.Fragment,{children:[w.jsx(bO,{}),w.jsx(yO,{})]}):null]})});function bO(){const e=Ir(),t=k.useRef(void 0);return w.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ia(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ax=k.memo(function({matchId:t}){const n=Ir(),{match:s,key:o,routeId:u}=Xn({select:c=>{const d=c.matches.find(C=>C.id===t),p=d.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:d.id,status:d.status,error:d.error,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),h=n.routesById[u],a=k.useMemo(()=>{const c=h.options.component??n.options.defaultComponent;return c?w.jsx(c,{},o):w.jsx(Xw,{})},[o,h.options.component,n.options.defaultComponent]);if(s._displayPending)throw n.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw n.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const c=h.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const d=n.getMatch(s.id);if(d&&!d._nonReactive.minPendingPromise&&!n.isServer){const p=Al();d._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),d._nonReactive.minPendingPromise=void 0},c)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return vi(es(s.error)),Kw(n,h,s.error);if(s.status==="redirected")throw vi(hs(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(n.isServer){const c=(h.options.errorComponent??n.options.defaultErrorComponent)||Yh;return w.jsx(c,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return a}),Xw=k.memo(function(){const t=Ir(),n=k.useContext(Xh),s=Xn({select:d=>d.matches.find(p=>p.id===n)?.routeId}),o=t.routesById[s],u=Xn({select:d=>{const f=d.matches.find(g=>g.id===n);return vi(f),f.globalNotFound}}),h=Xn({select:d=>{const p=d.matches,f=p.findIndex(g=>g.id===n);return p[f+1]?.id}}),a=t.options.defaultPendingComponent?w.jsx(t.options.defaultPendingComponent,{}):null;if(u)return Kw(t,o,void 0);if(!h)return null;const c=w.jsx(Yw,{matchId:h});return s===Tr?w.jsx(k.Suspense,{fallback:a,children:c}):c});function SO(){const e=Ir(),n=e.routesById[Tr].options.pendingComponent??e.options.defaultPendingComponent,s=n?w.jsx(n,{}):null,o=e.isServer||typeof document<"u"&&e.ssr?vl:k.Suspense,u=w.jsxs(o,{fallback:s,children:[!e.isServer&&w.jsx(mO,{}),w.jsx(xO,{})]});return e.options.InnerWrap?w.jsx(e.options.InnerWrap,{children:u}):u}function xO(){const e=Ir(),t=Xn({select:o=>o.matches[0]?.id}),n=Xn({select:o=>o.loadedAt}),s=t?w.jsx(Yw,{matchId:t}):null;return w.jsx(Xh.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:w.jsx(k_,{getResetKey:()=>n,errorComponent:Yh,onCatch:o=>{o.message||o.toString()},children:s})})}const CO=e=>new wO(e);class wO extends BA{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=Ns,globalThis.createLazyFileRoute=ox):typeof window<"u"&&(window.createFileRoute=Ns,window.createLazyFileRoute=ox);function EO({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=$w(),o=w.jsx(s.Provider,{value:e,children:t});return e.options.Wrap?w.jsx(e.options.Wrap,{children:o}):o}function RO({router:e,...t}){return w.jsx(EO,{router:e,...t,children:w.jsx(SO,{})})}function kO(e){return Xn({select:t=>t.location})}var Vl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},TO={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},LO=class{#e=TO;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Yo=new LO;function AO(e){setTimeout(e,0)}var pa=typeof window>"u"||"Deno"in globalThis;function tr(){}function OO(e,t){return typeof e=="function"?e(t):e}function Dv(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function oo(e,t){return typeof e=="function"?e(t):e}function Qr(e,t){return typeof e=="function"?e(t):e}function lx(e,t){const{type:n="all",exact:s,fetchStatus:o,predicate:u,queryKey:h,stale:a}=e;if(h){if(s){if(t.queryHash!==M_(h,t.options))return!1}else if(!yu(t.queryKey,h))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||u&&!u(t))}function cx(e,t){const{exact:n,status:s,predicate:o,mutationKey:u}=e;if(u){if(!t.options.mutationKey)return!1;if(n){if(ma(t.options.mutationKey)!==ma(u))return!1}else if(!yu(t.options.mutationKey,u))return!1}return!(s&&t.state.status!==s||o&&!o(t))}function M_(e,t){return(t?.queryKeyHashFn||ma)(e)}function ma(e){return JSON.stringify(e,(t,n)=>Pv(n)?Object.keys(n).sort().reduce((s,o)=>(s[o]=n[o],s),{}):n)}function yu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>yu(e[n],t[n])):!1}var MO=Object.prototype.hasOwnProperty;function Zw(e,t){if(e===t)return e;const n=ux(e)&&ux(t);if(!n&&!(Pv(e)&&Pv(t)))return t;const o=(n?e:Object.keys(e)).length,u=n?t:Object.keys(t),h=u.length,a=n?new Array(h):{};let c=0;for(let d=0;d<h;d++){const p=n?d:u[d],f=e[p],g=t[p];if(f===g){a[p]=f,(n?d<o:MO.call(e,p))&&c++;continue}if(f===null||g===null||typeof f!="object"||typeof g!="object"){a[p]=g;continue}const b=Zw(f,g);a[p]=b,b===f&&c++}return o===h&&c===o?e:a}function _h(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function ux(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pv(e){if(!dx(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!dx(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function dx(e){return Object.prototype.toString.call(e)==="[object Object]"}function DO(e){return new Promise(t=>{Yo.setTimeout(t,e)})}function Iv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zw(e,t):t}function PO(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function IO(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var D_=Symbol();function Jw(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===D_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function e2(e,t){return typeof e=="function"?e(...t):!!e}var NO=class extends Vl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!pa&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},P_=new NO;function Nv(){let e,t;const n=new Promise((o,u)=>{e=o,t=u});n.status="pending",n.catch(()=>{});function s(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{s({status:"fulfilled",value:o}),e(o)},n.reject=o=>{s({status:"rejected",reason:o}),t(o)},n}var jO=AO;function BO(){let e=[],t=0,n=a=>{a()},s=a=>{a()},o=jO;const u=a=>{t?e.push(a):o(()=>{n(a)})},h=()=>{const a=e;e=[],a.length&&o(()=>{s(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||h()}return c},batchCalls:a=>(...c)=>{u(()=>{a(...c)})},schedule:u,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{o=a}}}var Ln=BO(),zO=class extends Vl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!pa&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},yh=new zO;function HO(e){return Math.min(1e3*2**e,3e4)}function t2(e){return(e??"online")==="online"?yh.isOnline():!0}var jv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function n2(e){let t=!1,n=0,s;const o=Nv(),u=()=>o.status!=="pending",h=x=>{if(!u()){const y=new jv(x);g(y),e.onCancel?.(y)}},a=()=>{t=!0},c=()=>{t=!1},d=()=>P_.isFocused()&&(e.networkMode==="always"||yh.isOnline())&&e.canRun(),p=()=>t2(e.networkMode)&&e.canRun(),f=x=>{u()||(s?.(),o.resolve(x))},g=x=>{u()||(s?.(),o.reject(x))},b=()=>new Promise(x=>{s=y=>{(u()||d())&&x(y)},e.onPause?.()}).then(()=>{s=void 0,u()||e.onContinue?.()}),C=()=>{if(u())return;let x;const y=n===0?e.initialPromise:void 0;try{x=y??e.fn()}catch(_){x=Promise.reject(_)}Promise.resolve(x).then(f).catch(_=>{if(u())return;const v=e.retry??(pa?0:3),S=e.retryDelay??HO,E=typeof S=="function"?S(n,_):S,T=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,_);if(t||!T){g(_);return}n++,e.onFail?.(n,_),DO(E).then(()=>d()?void 0:b()).then(()=>{t?g(_):C()})})};return{promise:o,status:()=>o.status,cancel:h,continue:()=>(s?.(),o),cancelRetry:a,continueRetry:c,canStart:p,start:()=>(p()?C():b().then(C),o)}}var r2=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Dv(this.gcTime)&&(this.#e=Yo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pa?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Yo.clearTimeout(this.#e),this.#e=void 0)}},VO=class extends r2{#e;#t;#n;#s;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=hx(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=hx(this.options);t.data!==void 0&&(this.setState(fx(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Iv(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(tr).catch(tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Qr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D_||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>oo(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Qw(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,s=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const a=Jw(this.options,t),d=(()=>{const p={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(p),p})();return this.#a=!1,this.options.persister?this.options.persister(a,d,this):a(d)},h=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:o};return s(a),a})();this.options.behavior?.onFetch(h,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==h.fetchOptions?.meta)&&this.#i({type:"fetch",meta:h.fetchOptions?.meta}),this.#r=n2({initialPromise:t?.initialPromise,fn:h.fetchFn,onCancel:a=>{a instanceof jv&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,c)=>{this.#i({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof jv){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#i({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...s2(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...fx(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ln.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function s2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:t2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function hx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var FO=class extends Vl{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=Nv(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#o;#a;#i;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),px(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bv(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),t._defaulted&&!_h(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&mx(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),s&&(this.#t!==n||Qr(this.options.enabled,this.#t)!==Qr(t.enabled,this.#t)||oo(this.options.staleTime,this.#t)!==oo(t.staleTime,this.#t))&&this.#g();const o=this.#v();s&&(this.#t!==n||Qr(this.options.enabled,this.#t)!==Qr(t.enabled,this.#t)||o!==this.#l)&&this.#_(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return WO(this,n)&&(this.#s=n,this.#o=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#x();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(tr)),t}#g(){this.#b();const e=oo(this.options.staleTime,this.#t);if(pa||this.#s.isStale||!Dv(e))return;const n=Qw(this.#s.dataUpdatedAt,e)+1;this.#c=Yo.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#_(e){this.#S(),this.#l=e,!(pa||Qr(this.options.enabled,this.#t)===!1||!Dv(this.#l)||this.#l===0)&&(this.#u=Yo.setInterval(()=>{(this.options.refetchIntervalInBackground||P_.isFocused())&&this.#d()},this.#l))}#y(){this.#g(),this.#_(this.#v())}#b(){this.#c&&(Yo.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(Yo.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,o=this.#s,u=this.#r,h=this.#o,c=e!==n?e.state:this.#n,{state:d}=e;let p={...d},f=!1,g;if(t._optimisticResults){const L=this.hasListeners(),D=!L&&px(e,t),U=L&&mx(e,n,t,s);(D||U)&&(p={...p,...s2(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:b,errorUpdatedAt:C,status:x}=p;g=p.data;let y=!1;if(t.placeholderData!==void 0&&g===void 0&&x==="pending"){let L;o?.isPlaceholderData&&t.placeholderData===h?.placeholderData?(L=o.data,y=!0):L=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,L!==void 0&&(x="success",g=Iv(o?.data,L,t),f=!0)}if(t.select&&g!==void 0&&!y)if(o&&g===u?.data&&t.select===this.#m)g=this.#f;else try{this.#m=t.select,g=t.select(g),g=Iv(o?.data,g,t),this.#f=g,this.#i=null}catch(L){this.#i=L}this.#i&&(b=this.#i,g=this.#f,C=Date.now(),x="error");const _=p.fetchStatus==="fetching",v=x==="pending",S=x==="error",E=v&&_,T=g!==void 0,M={status:x,fetchStatus:p.fetchStatus,isPending:v,isSuccess:x==="success",isError:S,isInitialLoading:E,isLoading:E,data:g,dataUpdatedAt:p.dataUpdatedAt,error:b,errorUpdatedAt:C,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:S&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&T,isStale:I_(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Qr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=z=>{M.status==="error"?z.reject(M.error):M.data!==void 0&&z.resolve(M.data)},D=()=>{const z=this.#a=M.promise=Nv();L(z)},U=this.#a;switch(U.status){case"pending":e.queryHash===n.queryHash&&L(U);break;case"fulfilled":(M.status==="error"||M.data!==U.value)&&D();break;case"rejected":(M.status!=="error"||M.error!==U.reason)&&D();break}}return M}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#h=this.#t),_h(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#p.size)return!0;const u=new Set(o??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#s).some(h=>{const a=h;return this.#s[a]!==e[a]&&u.has(a)})};this.#C({listeners:n()})}#x(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Ln.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function UO(e,t){return Qr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function px(e,t){return UO(e,t)||e.state.data!==void 0&&Bv(e,t,t.refetchOnMount)}function Bv(e,t,n){if(Qr(t.enabled,e)!==!1&&oo(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&I_(e,t)}return!1}function mx(e,t,n,s){return(e!==t||Qr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&I_(e,n)}function I_(e,t){return Qr(t.enabled,e)!==!1&&e.isStaleByTime(oo(t.staleTime,e))}function WO(e,t){return!_h(e.getCurrentResult(),t)}function gx(e){return{onFetch:(t,n)=>{const s=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],h=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const d=async()=>{let p=!1;const f=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},g=Jw(t.options,t.fetchOptions),b=async(C,x,y)=>{if(p)return Promise.reject();if(x==null&&C.pages.length)return Promise.resolve(C);const v=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:x,direction:y?"backward":"forward",meta:t.options.meta};return f(A),A})(),S=await g(v),{maxPages:E}=t.options,T=y?IO:PO;return{pages:T(C.pages,S,E),pageParams:T(C.pageParams,x,E)}};if(o&&u.length){const C=o==="backward",x=C?qO:vx,y={pages:u,pageParams:h},_=x(s,y);a=await b(y,_,C)}else{const C=e??u.length;do{const x=c===0?h[0]??s.initialPageParam:vx(s,a);if(c>0&&x==null)break;a=await b(a,x),c++}while(c<C)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function vx(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function qO(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var GO=class extends r2{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||i2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=n2({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(u,h)=>{this.#r({type:"failed",failureCount:u,error:h})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",o=!this.#s.canStart();try{if(s)t();else{this.#r({type:"pending",variables:e,isPaused:o}),await this.#n.config.onMutate?.(e,this,n);const h=await this.options.onMutate?.(e,n);h!==this.state.context&&this.#r({type:"pending",context:h,variables:e,isPaused:o})}const u=await this.#s.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,n),await this.options.onSuccess?.(u,e,this.state.context,n),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(u,null,e,this.state.context,n),this.#r({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,n),await this.options.onError?.(u,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,u,e,this.state.context,n),u}finally{this.#r({type:"error",error:u})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ln.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function i2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $O=class extends Vl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new GO({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=kf(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=kf(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=kf(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=kf(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ln.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>cx(t,n))}findAll(e={}){return this.getAll().filter(t=>cx(e,t))}notify(e){Ln.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ln.batch(()=>Promise.all(e.map(t=>t.continue().catch(tr))))}};function kf(e){return e.options.scope?.id}var KO=class extends Vl{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),_h(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ma(n.mutationKey)!==ma(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#o()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??i2();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Ln.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,s=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#s.onSuccess?.(t.data,n,s,o),this.#s.onSettled?.(t.data,null,n,s,o)):t?.type==="error"&&(this.#s.onError?.(t.error,n,s,o),this.#s.onSettled?.(void 0,t.error,n,s,o))}this.listeners.forEach(n=>{n(this.#t)})})}},YO=class extends Vl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,o=t.queryHash??M_(s,t);let u=this.get(o);return u||(u=new VO({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ln.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>lx(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>lx(e,n)):t}notify(e){Ln.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},XO=class{#e;#t;#n;#s;#r;#o;#a;#i;constructor(e={}){this.#e=e.queryCache||new YO,this.#t=e.mutationCache||new $O,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=P_.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=yh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(oo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),u=this.#e.get(s.queryHash)?.state.data,h=OO(t,u);if(h!==void 0)return this.#e.build(this,s).setData(h,{...n,manual:!0})}setQueriesData(e,t,n){return Ln.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ln.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ln.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=Ln.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(s).then(tr).catch(tr)}invalidateQueries(e,t={}){return Ln.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=Ln.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let u=o.fetch(void 0,n);return n.throwOnError||(u=u.catch(tr)),o.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(s).then(tr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(oo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(tr).catch(tr)}fetchInfiniteQuery(e){return e.behavior=gx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(tr).catch(tr)}ensureInfiniteQueryData(e){return e.behavior=gx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yh.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(ma(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{yu(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ma(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{yu(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=M_(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===D_&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},o2=k.createContext(void 0),qn=e=>{const t=k.useContext(o2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QO=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(o2.Provider,{value:e,children:t})),a2=k.createContext(!1),ZO=()=>k.useContext(a2);a2.Provider;function JO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var eM=k.createContext(JO()),tM=()=>k.useContext(eM),nM=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},rM=e=>{k.useEffect(()=>{e.clearReset()},[e])},sM=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||e2(n,[e.error,s])),iM=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...o)=>n(s(...o)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},oM=(e,t)=>e.isLoading&&e.isFetching&&!t,aM=(e,t)=>e?.suspense&&t.isPending,_x=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lM(e,t,n){const s=ZO(),o=tM(),u=qn(),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h),h._optimisticResults=s?"isRestoring":"optimistic",iM(h),nM(h,o),rM(o);const a=!u.getQueryCache().get(h.queryHash),[c]=k.useState(()=>new t(u,h)),d=c.getOptimisticResult(h),p=!s&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(f=>{const g=p?c.subscribe(Ln.batchCalls(f)):tr;return c.updateResult(),g},[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),k.useEffect(()=>{c.setOptions(h)},[h,c]),aM(h,d))throw _x(h,c,o);if(sM({result:d,errorResetBoundary:o,throwOnError:h.throwOnError,query:u.getQueryCache().get(h.queryHash),suspense:h.suspense}))throw d.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,d),h.experimental_prefetchInRender&&!pa&&oM(d,s)&&(a?_x(h,c,o):u.getQueryCache().get(h.queryHash)?.promise)?.catch(tr).finally(()=>{c.updateResult()}),h.notifyOnChangeProps?d:c.trackResult(d)}function Nr(e,t){return lM(e,FO)}function jn(e,t){const n=qn(),[s]=k.useState(()=>new KO(n,e));k.useEffect(()=>{s.setOptions(e)},[s,e]);const o=k.useSyncExternalStore(k.useCallback(h=>s.subscribe(Ln.batchCalls(h)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=k.useCallback((h,a)=>{s.mutate(h,a).catch(tr)},[s]);if(o.error&&e2(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}function Qh(){return typeof window<"u"}function mo(e){return N_(e)?(e.nodeName||"").toLowerCase():"#document"}function xn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zs(e){var t;return(t=(N_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function N_(e){return Qh()?e instanceof Node||e instanceof xn(e).Node:!1}function jt(e){return Qh()?e instanceof Element||e instanceof xn(e).Element:!1}function Jt(e){return Qh()?e instanceof HTMLElement||e instanceof xn(e).HTMLElement:!1}function zv(e){return!Qh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xn(e).ShadowRoot}const cM=new Set(["inline","contents"]);function ba(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=Dr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!cM.has(o)}const uM=new Set(["table","td","th"]);function dM(e){return uM.has(mo(e))}const fM=[":popover-open",":modal"];function Zh(e){return fM.some(t=>{try{return e.matches(t)}catch{return!1}})}const hM=["transform","translate","scale","rotate","perspective"],pM=["transform","translate","scale","rotate","perspective","filter"],mM=["paint","layout","strict","content"];function j_(e){const t=Jh(),n=jt(e)?Dr(e):e;return hM.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||pM.some(s=>(n.willChange||"").includes(s))||mM.some(s=>(n.contain||"").includes(s))}function gM(e){let t=js(e);for(;Jt(t)&&!Ms(t);){if(j_(t))return t;if(Zh(t))return null;t=js(t)}return null}function Jh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vM=new Set(["html","body","#document"]);function Ms(e){return vM.has(mo(e))}function Dr(e){return xn(e).getComputedStyle(e)}function ep(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function js(e){if(mo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zv(e)&&e.host||zs(e);return zv(t)?t.host:t}function l2(e){const t=js(e);return Ms(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jt(t)&&ba(t)?t:l2(t)}function ao(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=l2(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),h=xn(o);if(u){const a=Hv(h);return t.concat(h,h.visualViewport||[],ba(o)?o:[],a&&n?ao(a):[])}return t.concat(o,ao(o,[],n))}function Hv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const yx={};function Wn(e,t){const n=k.useRef(yx);return n.current===yx&&(n.current=e(t)),n}const Jg=kw[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],_M=Jg&&Jg!==k.useLayoutEffect?Jg:e=>e();function De(e){const t=Wn(yM).current;return t.next=e,_M(t.effect),t.trampoline}function yM(){const e={next:void 0,callback:bM,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function bM(){}const SM=()=>{},je=typeof document<"u"?k.useLayoutEffect:SM;function Vv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const fu={};function Bs(e,t,n,s,o){let u={...Fv(e,fu)};return t&&(u=ou(u,t)),n&&(u=ou(u,n)),s&&(u=ou(u,s)),o&&(u=ou(u,o)),u}function xM(e){if(e.length===0)return fu;if(e.length===1)return Fv(e[0],fu);let t={...Fv(e[0],fu)};for(let n=1;n<e.length;n+=1)t=ou(t,e[n]);return t}function ou(e,t){return c2(t)?t(e):CM(e,t)}function CM(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Vv(e.style,s);break}case"className":{e[n]=u2(e.className,s);break}default:wM(n,s)?e[n]=EM(e[n],s):e[n]=s}}return e}function wM(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&s===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function c2(e){return typeof e=="function"}function Fv(e,t){return c2(e)?e(t):e??fu}function EM(e,t){return t?e?n=>{if(RM(n)){const o=n;Uv(o);const u=t(o);return o.baseUIHandlerPrevented||e?.(o),u}const s=t(n);return e?.(n),s}:t:e}function Uv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function u2(e,t){return t?e?t+" "+e:t:e}function RM(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function It(e,...t){const n=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}const d2=k.createContext(void 0);function B_(e=!1){const t=k.useContext(d2);if(t===void 0&&!e)throw new Error(It(16));return t}function kM(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:o=0,isNativeButton:u}=e,h=s&&t!==!1,a=s&&t===!1;return{props:k.useMemo(()=>{const d={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return s||(d.tabIndex=o,!u&&n&&(d.tabIndex=t?o:-1)),(u&&(t||h)||!u&&n)&&(d["aria-disabled"]=n),u&&(!t||a)&&(d.disabled=n),d},[s,n,t,h,a,u,o])}}function jr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:o=!0}=e,u=k.useRef(null),h=B_(!0)!==void 0,a=De(()=>{const g=u.current;return!!(g?.tagName==="A"&&g?.href)}),{props:c}=kM({focusableWhenDisabled:n,disabled:t,composite:h,tabIndex:s,isNativeButton:o}),d=k.useCallback(()=>{const g=u.current;TM(g)&&h&&t&&c.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,c.disabled,h]);je(d,[d]);const p=k.useCallback((g={})=>{const{onClick:b,onMouseDown:C,onKeyUp:x,onKeyDown:y,onPointerDown:_,...v}=g;return Bs({type:o?"button":void 0,onClick(E){if(t){E.preventDefault();return}b?.(E)},onMouseDown(E){t||C?.(E)},onKeyDown(E){if(t||(Uv(E),y?.(E)),E.baseUIHandlerPrevented)return;const T=E.target===E.currentTarget&&!o&&!a()&&!t,A=E.key==="Enter",M=E.key===" ";T&&((M||A)&&E.preventDefault(),A&&b?.(E))},onKeyUp(E){t||(Uv(E),x?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!o&&!t&&E.key===" "&&b?.(E)},onPointerDown(E){if(t){E.preventDefault();return}_?.(E)}},o?void 0:{role:"button"},c,v)},[t,c,o,a]),f=De(g=>{u.current=g,d()});return{getButtonProps:p,buttonRef:f}}function TM(e){return Jt(e)&&e.tagName==="BUTTON"}function ns(e,t,n,s){const o=Wn(f2).current;return AM(o,e,t,n,s)&&h2(o,[e,t,n,s]),o.callback}function LM(e){const t=Wn(f2).current;return OM(t,e)&&h2(t,e),t.callback}function f2(){return{callback:null,cleanup:null,refs:[]}}function AM(e,t,n,s,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==o}function OM(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function h2(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const s=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const u=t[o];if(u!=null)switch(typeof u){case"function":{const h=u(n);typeof h=="function"&&(s[o]=h);break}case"object":{u.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const u=t[o];if(u!=null)switch(typeof u){case"function":{const h=s[o];typeof h=="function"?h():u(null);break}case"object":{u.current=null;break}}}}}}}const MM=parseInt(k.version,10);function z_(e){return MM>=e}function bx(e){if(!k.isValidElement(e))return null;const t=e,n=t.props;return(z_(19)?n?.ref:t.ref)??null}function DM(e,t){const n={};for(const s in e){const o=e[s];if(t?.hasOwnProperty(s)){const u=t[s](o);u!=null&&Object.assign(n,u);continue}o===!0?n[`data-${s.toLowerCase()}`]="":o&&(n[`data-${s.toLowerCase()}`]=o.toString())}return n}function PM(e,t){return typeof e=="function"?e(t):e}function IM(e,t){return typeof e=="function"?e(t):e}function rn(){}const hr=Object.freeze([]),en=Object.freeze({}),NM=500,jM=500,BM={style:{transition:"none"}},p2="data-base-ui-click-trigger",H_={fallbackAxisSide:"none"},zM={fallbackAxisSide:"end"},HM={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function ut(e,t,n={}){const s=t.render,o=VM(t,n);if(n.enabled===!1)return null;const u=n.state??en;return FM(e,s,o,u)}function VM(e,t={}){const{className:n,style:s,render:o}=e,{state:u=en,ref:h,props:a,stateAttributesMapping:c,enabled:d=!0}=t,p=d?PM(n,u):void 0,f=d?IM(s,u):void 0,g=d?DM(u,c):en,b=d?Vv(g,Array.isArray(a)?xM(a):a)??en:en;return typeof document<"u"&&(d?Array.isArray(h)?b.ref=LM([b.ref,bx(o),...h]):b.ref=ns(b.ref,bx(o),h):ns(null,null)),d?(p!==void 0&&(b.className=u2(b.className,p)),f!==void 0&&(b.style=Vv(b.style,f)),b):en}function FM(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const o=Bs(n,t.props);return o.ref=n.ref,k.cloneElement(t,o)}if(e&&typeof e=="string")return UM(e,n);throw new Error(It(8))}function UM(e,t){return e==="button"?k.createElement("button",{type:"button",...t,key:t.key}):e==="img"?k.createElement("img",{alt:"",...t,key:t.key}):k.createElement(e,t)}const WM=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,focusableWhenDisabled:h=!1,nativeButton:a=!0,...c}=t,d=!!u,{getButtonProps:p,buttonRef:f}=jr({disabled:d,focusableWhenDisabled:h,native:a}),g=k.useMemo(()=>({disabled:d}),[d]);return ut("button",t,{state:g,ref:[n,f],props:[c,p]})});function m2(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=m2(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function g2(){for(var e,t,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=m2(e))&&(s&&(s+=" "),s+=t);return s}const Sx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xx=g2,Fl=(e,t)=>n=>{var s;if(t?.variants==null)return xx(e,n?.class,n?.className);const{variants:o,defaultVariants:u}=t,h=Object.keys(o).map(d=>{const p=n?.[d],f=u?.[d];if(p===null)return null;const g=Sx(p)||Sx(f);return o[d][g]}),a=n&&Object.entries(n).reduce((d,p)=>{let[f,g]=p;return g===void 0||(d[f]=g),d},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,p)=>{let{class:f,className:g,...b}=p;return Object.entries(b).every(C=>{let[x,y]=C;return Array.isArray(y)?y.includes({...u,...a}[x]):{...u,...a}[x]===y})?[...d,f,g]:d},[]);return xx(e,h,c,n?.class,n?.className)},qM=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},GM=(e,t)=>({classGroupId:e,validator:t}),v2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),bh="-",Cx=[],$M="arbitrary..",KM=e=>{const t=XM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return YM(h);const a=h.split(bh),c=a[0]===""&&a.length>1?1:0;return _2(a,c,t)},getConflictingClassGroupIds:(h,a)=>{if(a){const c=s[h],d=n[h];return c?d?qM(d,c):c:d||Cx}return n[h]||Cx}}},_2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],u=n.nextPart.get(o);if(u){const d=_2(e,t+1,u);if(d)return d}const h=n.validators;if(h===null)return;const a=t===0?e.join(bh):e.slice(t).join(bh),c=h.length;for(let d=0;d<c;d++){const p=h[d];if(p.validator(a))return p.classGroupId}},YM=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?$M+s:void 0})(),XM=e=>{const{theme:t,classGroups:n}=e;return QM(n,t)},QM=(e,t)=>{const n=v2();for(const s in e){const o=e[s];V_(o,n,s,t)}return n},V_=(e,t,n,s)=>{const o=e.length;for(let u=0;u<o;u++){const h=e[u];ZM(h,t,n,s)}},ZM=(e,t,n,s)=>{if(typeof e=="string"){JM(e,t,n);return}if(typeof e=="function"){e3(e,t,n,s);return}t3(e,t,n,s)},JM=(e,t,n)=>{const s=e===""?t:y2(t,e);s.classGroupId=n},e3=(e,t,n,s)=>{if(n3(e)){V_(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(GM(n,e))},t3=(e,t,n,s)=>{const o=Object.entries(e),u=o.length;for(let h=0;h<u;h++){const[a,c]=o[h];V_(c,y2(t,a),n,s)}},y2=(e,t)=>{let n=e;const s=t.split(bh),o=s.length;for(let u=0;u<o;u++){const h=s[u];let a=n.nextPart.get(h);a||(a=v2(),n.nextPart.set(h,a)),n=a}return n},n3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,r3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const o=(u,h)=>{n[u]=h,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(u){let h=n[u];if(h!==void 0)return h;if((h=s[u])!==void 0)return o(u,h),h},set(u,h){u in n?n[u]=h:o(u,h)}}},Wv="!",wx=":",s3=[],Ex=(e,t,n,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:o}),i3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=o=>{const u=[];let h=0,a=0,c=0,d;const p=o.length;for(let x=0;x<p;x++){const y=o[x];if(h===0&&a===0){if(y===wx){u.push(o.slice(c,x)),c=x+1;continue}if(y==="/"){d=x;continue}}y==="["?h++:y==="]"?h--:y==="("?a++:y===")"&&a--}const f=u.length===0?o:o.slice(c);let g=f,b=!1;f.endsWith(Wv)?(g=f.slice(0,-1),b=!0):f.startsWith(Wv)&&(g=f.slice(1),b=!0);const C=d&&d>c?d-c:void 0;return Ex(u,b,g,C)};if(t){const o=t+wx,u=s;s=h=>h.startsWith(o)?u(h.slice(o.length)):Ex(s3,!1,h,void 0,!0)}if(n){const o=s;s=u=>n({className:u,parseClassName:o})}return s},o3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let o=[];for(let u=0;u<n.length;u++){const h=n[u],a=h[0]==="[",c=t.has(h);a||c?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(h)):o.push(h)}return o.length>0&&(o.sort(),s.push(...o)),s}},a3=e=>({cache:r3(e.cacheSize),parseClassName:i3(e),sortModifiers:o3(e),...KM(e)}),l3=/\s+/,c3=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:u}=t,h=[],a=e.trim().split(l3);let c="";for(let d=a.length-1;d>=0;d-=1){const p=a[d],{isExternal:f,modifiers:g,hasImportantModifier:b,baseClassName:C,maybePostfixModifierPosition:x}=n(p);if(f){c=p+(c.length>0?" "+c:c);continue}let y=!!x,_=s(y?C.substring(0,x):C);if(!_){if(!y){c=p+(c.length>0?" "+c:c);continue}if(_=s(C),!_){c=p+(c.length>0?" "+c:c);continue}y=!1}const v=g.length===0?"":g.length===1?g[0]:u(g).join(":"),S=b?v+Wv:v,E=S+_;if(h.indexOf(E)>-1)continue;h.push(E);const T=o(_,y);for(let A=0;A<T.length;++A){const M=T[A];h.push(S+M)}c=p+(c.length>0?" "+c:c)}return c},u3=(...e)=>{let t=0,n,s,o="";for(;t<e.length;)(n=e[t++])&&(s=b2(n))&&(o&&(o+=" "),o+=s);return o},b2=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=b2(e[s]))&&(n&&(n+=" "),n+=t);return n},d3=(e,...t)=>{let n,s,o,u;const h=c=>{const d=t.reduce((p,f)=>f(p),e());return n=a3(d),s=n.cache.get,o=n.cache.set,u=a,a(c)},a=c=>{const d=s(c);if(d)return d;const p=c3(c,n);return o(c,p),p};return u=h,(...c)=>u(u3(...c))},f3=[],En=e=>{const t=n=>n[e]||f3;return t.isThemeGetter=!0,t},S2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,x2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h3=/^\d+\/\d+$/,p3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,m3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,g3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,v3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pl=e=>h3.test(e),xt=e=>!!e&&!Number.isNaN(Number(e)),Qi=e=>!!e&&Number.isInteger(Number(e)),ev=e=>e.endsWith("%")&&xt(e.slice(0,-1)),di=e=>p3.test(e),y3=()=>!0,b3=e=>m3.test(e)&&!g3.test(e),C2=()=>!1,S3=e=>v3.test(e),x3=e=>_3.test(e),C3=e=>!Ke(e)&&!Ye(e),w3=e=>Ul(e,R2,C2),Ke=e=>S2.test(e),zo=e=>Ul(e,k2,b3),tv=e=>Ul(e,L3,xt),Rx=e=>Ul(e,w2,C2),E3=e=>Ul(e,E2,x3),Tf=e=>Ul(e,T2,S3),Ye=e=>x2.test(e),Jc=e=>Wl(e,k2),R3=e=>Wl(e,A3),kx=e=>Wl(e,w2),k3=e=>Wl(e,R2),T3=e=>Wl(e,E2),Lf=e=>Wl(e,T2,!0),Ul=(e,t,n)=>{const s=S2.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},Wl=(e,t,n=!1)=>{const s=x2.exec(e);return s?s[1]?t(s[1]):n:!1},w2=e=>e==="position"||e==="percentage",E2=e=>e==="image"||e==="url",R2=e=>e==="length"||e==="size"||e==="bg-size",k2=e=>e==="length",L3=e=>e==="number",A3=e=>e==="family-name",T2=e=>e==="shadow",O3=()=>{const e=En("color"),t=En("font"),n=En("text"),s=En("font-weight"),o=En("tracking"),u=En("leading"),h=En("breakpoint"),a=En("container"),c=En("spacing"),d=En("radius"),p=En("shadow"),f=En("inset-shadow"),g=En("text-shadow"),b=En("drop-shadow"),C=En("blur"),x=En("perspective"),y=En("aspect"),_=En("ease"),v=En("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...E(),Ye,Ke],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],L=()=>[Ye,Ke,c],D=()=>[pl,"full","auto",...L()],U=()=>[Qi,"none","subgrid",Ye,Ke],z=()=>["auto",{span:["full",Qi,Ye,Ke]},Qi,Ye,Ke],W=()=>[Qi,"auto",Ye,Ke],N=()=>["auto","min","max","fr",Ye,Ke],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...L()],q=()=>[pl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],H=()=>[e,Ye,Ke],P=()=>[...E(),kx,Rx,{position:[Ye,Ke]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",k3,w3,{size:[Ye,Ke]}],G=()=>[ev,Jc,zo],K=()=>["","none","full",d,Ye,Ke],J=()=>["",xt,Jc,zo],Z=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[xt,ev,kx,Rx],V=()=>["","none",C,Ye,Ke],se=()=>["none",xt,Ye,Ke],re=()=>["none",xt,Ye,Ke],ne=()=>[xt,Ye,Ke],oe=()=>[pl,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[di],breakpoint:[di],color:[y3],container:[di],"drop-shadow":[di],ease:["in","out","in-out"],font:[C3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[di],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[di],shadow:[di],spacing:["px",xt],text:[di],"text-shadow":[di],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pl,Ke,Ye,y]}],container:["container"],columns:[{columns:[xt,Ke,Ye,a]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Qi,"auto",Ye,Ke]}],basis:[{basis:[pl,"full","auto",a,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xt,pl,"auto","initial","none",Ke]}],grow:[{grow:["",xt,Ye,Ke]}],shrink:[{shrink:["",xt,Ye,Ke]}],order:[{order:[Qi,"first","last","none",Ye,Ke]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[a,"screen",...q()]}],"min-w":[{"min-w":[a,"screen","none",...q()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[h]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Jc,zo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ye,tv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ev,Ke]}],"font-family":[{font:[R3,Ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ye,Ke]}],"line-clamp":[{"line-clamp":[xt,"none",Ye,tv]}],leading:[{leading:[u,...L()]}],"list-image":[{"list-image":["none",Ye,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[xt,"from-font","auto",Ye,zo]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[xt,"auto",Ye,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qi,Ye,Ke],radial:["",Ye,Ke],conic:[Qi,Ye,Ke]},T3,E3]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xt,Ye,Ke]}],"outline-w":[{outline:["",xt,Jc,zo]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",p,Lf,Tf]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",f,Lf,Tf]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[xt,zo]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,Lf,Tf]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[xt,Ye,Ke]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[xt]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Ye,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[xt]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ke]}],filter:[{filter:["","none",Ye,Ke]}],blur:[{blur:V()}],brightness:[{brightness:[xt,Ye,Ke]}],contrast:[{contrast:[xt,Ye,Ke]}],"drop-shadow":[{"drop-shadow":["","none",b,Lf,Tf]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",xt,Ye,Ke]}],"hue-rotate":[{"hue-rotate":[xt,Ye,Ke]}],invert:[{invert:["",xt,Ye,Ke]}],saturate:[{saturate:[xt,Ye,Ke]}],sepia:[{sepia:["",xt,Ye,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ke]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[xt,Ye,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[xt,Ye,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xt,Ye,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xt,Ye,Ke]}],"backdrop-invert":[{"backdrop-invert":["",xt,Ye,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[xt,Ye,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[xt,Ye,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",xt,Ye,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xt,"initial",Ye,Ke]}],ease:[{ease:["linear","initial",_,Ye,Ke]}],delay:[{delay:[xt,Ye,Ke]}],animate:[{animate:["none",v,Ye,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ye,Ke]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[Ye,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,Ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[xt,Jc,zo,tv]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},M3=d3(O3);function Be(...e){return M3(g2(e))}const D3=Fl("cursor-pointer focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border dark:bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function Ve({className:e,variant:t="default",size:n="default",...s}){return w.jsx(WM,{"data-slot":"button",className:Be(D3({variant:t,size:n,className:e})),...s})}const P3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},Ee=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n,absoluteStrokeWidth:s=!1,className:o="",altIcon:u,showAlt:h=!1,icon:a,primaryColor:c,secondaryColor:d,disableSecondaryOpacity:p=!1,...f},g)=>{const b=n!==void 0?s?Number(n)*24/Number(t):n:void 0,C=b!==void 0?{strokeWidth:b,stroke:"currentColor"}:{},x={ref:g,...P3,width:t,height:t,color:c||e,className:o,...C,...f},_=[...h&&u?u:a].sort(([,v],[,S])=>{const E=v.opacity!==void 0;return S.opacity!==void 0?1:E?-1:0}).map(([v,S])=>{const E=S.opacity!==void 0,T=E&&!p?S.opacity:void 0,A=d?{...S.stroke!==void 0?{stroke:E?d:c||e}:{fill:E?d:c||e}}:{};return k.createElement(v,{...S,...C,...A,opacity:T,key:S.key})});return k.createElement("svg",x,_)});Ee.displayName="HugeiconsIcon";const tp=[["path",{d:"M13.9248 21H10.0752C5.44476 21 3.12955 21 2.27636 19.4939C1.42317 17.9879 2.60736 15.9914 4.97574 11.9985L6.90057 8.75333C9.17559 4.91778 10.3131 3 12 3C13.6869 3 14.8244 4.91777 17.0994 8.75332L19.0243 11.9985C21.3926 15.9914 22.5768 17.9879 21.7236 19.4939C20.8704 21 18.5552 21 13.9248 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 9V13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 16.9922V17.0022",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",key:"2"}]],L2=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],A2=[["path",{d:"M6 20L18 20",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M16 12C16 12 13.054 16 12 16C10.9459 16 8 12 8 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],O2=[["path",{d:"M17.9997 12.5C17.9997 12.5 13.5807 18.5 11.9996 18.5C10.4185 18.5 5.99966 12.5 5.99966 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.9997 5.50005C17.9997 5.50005 13.5807 11.5 11.9996 11.5C10.4185 11.5 5.99966 5.5 5.99966 5.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],I3=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Tx=[["path",{d:"M5.5 12.002H19",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],M2=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],D2=[["path",{d:"M17.9998 15C17.9998 15 13.5809 9.00001 11.9998 9C10.4187 8.99999 5.99985 15 5.99985 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],P2=[["path",{d:"M18 4L5.99997 4",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.9999 12C15.9999 12 13.054 8.00001 11.9999 8C10.9458 7.99999 7.99994 12 7.99994 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],N3=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 9H21.5",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6.99981 6H7.00879",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}],["path",{d:"M10.9998 6H11.0088",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"3"}]],j3=[["path",{d:"M16 2V6M8 2V6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 4H11C7.22876 4 5.34315 4 4.17157 5.17157C3 6.34315 3 8.22876 3 12V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V12C21 8.22876 21 6.34315 19.8284 5.17157C18.6569 4 16.7712 4 13 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 10H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M11.9955 14H12.0045M11.9955 18H12.0045M15.991 14H16M8 14H8.00897M8 18H8.00897",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"3"}]],ho=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],B3=[["path",{d:"M11 6L21 6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11 12L21 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 18L21 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M3 7.39286C3 7.39286 4 8.04466 4.5 9C4.5 9 6 5.25 8 4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M3 18.3929C3 18.3929 4 19.0447 4.5 20C4.5 20 6 16.25 8 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]],z3=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12.5L10.5 15L16 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],H3=[["path",{d:"M7.99994 12H8.00891M11.9955 12H12.0044M15.991 12H15.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"0"}],["path",{d:"M18 21C19.2322 21 20.231 19.8487 20.231 18.4286C20.231 16.1808 20.1312 14.6864 21.6733 12.9091C22.1089 12.407 22.1089 11.5929 21.6733 11.0908C20.1312 9.31353 20.231 7.81914 20.231 5.57141C20.231 4.15125 19.2322 2.99998 18 2.99998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6 21C4.76784 21 3.76897 19.8487 3.76897 18.4286C3.76897 16.1808 3.86877 14.6864 2.32673 12.9091C1.89109 12.407 1.89109 11.5929 2.32673 11.0908C3.83496 9.35249 3.76897 7.8399 3.76897 5.57141C3.76897 4.15125 4.76784 2.99998 6 2.99998",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],F_=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 9H21.5",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6.99981 6H7.00879",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}],["path",{d:"M10.9998 6H11.0088",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"3"}],["path",{d:"M16 13L17.2265 14.0572C17.7422 14.5016 18 14.7239 18 15C18 15.2761 17.7422 15.4984 17.2265 15.9428L16 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M8 13L6.77346 14.0572C6.25782 14.5016 6 14.7239 6 15C6 15.2761 6.25782 15.4984 6.77346 15.9428L8 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M13 12L11 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]],V3=[["path",{d:"M9 15C9 12.1716 9 10.7574 9.87868 9.87868C10.7574 9 12.1716 9 15 9L16 9C18.8284 9 20.2426 9 21.1213 9.87868C22 10.7574 22 12.1716 22 15V16C22 18.8284 22 20.2426 21.1213 21.1213C20.2426 22 18.8284 22 16 22H15C12.1716 22 10.7574 22 9.87868 21.1213C9 20.2426 9 18.8284 9 16L9 15Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.9999 9C16.9975 6.04291 16.9528 4.51121 16.092 3.46243C15.9258 3.25989 15.7401 3.07418 15.5376 2.90796C14.4312 2 12.7875 2 9.5 2C6.21252 2 4.56878 2 3.46243 2.90796C3.25989 3.07417 3.07418 3.25989 2.90796 3.46243C2 4.56878 2 6.21252 2 9.5C2 12.7875 2 14.4312 2.90796 15.5376C3.07417 15.7401 3.25989 15.9258 3.46243 16.092C4.51121 16.9528 6.04291 16.9975 9 16.9999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],I2=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12H21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 7L17 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["circle",{cx:"8.25",cy:"7",r:"1.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["circle",{cx:"8.25",cy:"17",r:"1.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M13 17L17 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],Nu=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],F3=[["path",{d:"M18 16L19.8398 17.5858C20.6133 18.2525 21 18.5858 21 19C21 19.4142 20.6133 19.7475 19.8398 20.4142L18 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 16L12.1602 17.5858C11.3867 18.2525 11 18.5858 11 19C11 19.4142 11.3867 19.7475 12.1602 20.4142L14 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20 13.0032L20 7.8199C20 6.12616 20 5.27929 19.732 4.60291C19.3013 3.51555 18.3902 2.65784 17.2352 2.25228C16.5168 2 15.6173 2 13.8182 2C10.6698 2 9.09563 2 7.83836 2.44148C5.81714 3.15122 4.22281 4.6522 3.46894 6.55509C3 7.73875 3 9.22077 3 12.1848L3 14.731C3 17.8013 3 19.3364 3.8477 20.4025C4.09058 20.708 4.37862 20.9792 4.70307 21.2078C5.61506 21.8506 6.85019 21.9757 9 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M3 12C3 10.159 4.49238 8.66667 6.33333 8.66667C6.99912 8.66667 7.78404 8.78333 8.43137 8.60988C9.00652 8.45576 9.45576 8.00652 9.60988 7.43136C9.78333 6.78404 9.66667 5.99912 9.66667 5.33333C9.66667 3.49238 11.1591 2 13 2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],U3=[["path",{d:"M8 7L16 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 11L12 11",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],N2=[["path",{d:"M8.85746 12.5061C6.36901 10.6456 4.59564 8.59915 3.62734 7.44867C3.3276 7.09253 3.22938 6.8319 3.17033 6.3728C2.96811 4.8008 2.86701 4.0148 3.32795 3.5074C3.7889 3 4.60404 3 6.23433 3H17.7657C19.396 3 20.2111 3 20.672 3.5074C21.133 4.0148 21.0319 4.8008 20.8297 6.37281C20.7706 6.83191 20.6724 7.09254 20.3726 7.44867C19.403 8.60062 17.6261 10.6507 15.1326 12.5135C14.907 12.6821 14.7583 12.9567 14.7307 13.2614C14.4837 15.992 14.2559 17.4876 14.1141 18.2442C13.8853 19.4657 12.1532 20.2006 11.226 20.8563C10.6741 21.2466 10.0043 20.782 9.93278 20.1778C9.79643 19.0261 9.53961 16.6864 9.25927 13.2614C9.23409 12.9539 9.08486 12.6761 8.85746 12.5061Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],ms=[["path",{d:"M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}]],j2=[["path",{d:"M2.5 20V8.87695C2.5 7.58945 2.5 6.9457 2.78533 6.47048C2.9541 6.18939 3.18939 5.9541 3.47048 5.78533C3.9457 5.5 4.59449 5.5 5.89206 5.5C6.52339 5.5 6.83906 5.5 7.12612 5.58819C7.31759 5.64702 7.49914 5.73428 7.66469 5.84705C7.91289 6.01611 8.10859 6.26074 8.5 6.75C8.89141 7.23926 9.08711 7.48389 9.33531 7.65295C9.50086 7.76572 9.68241 7.85298 9.87388 7.91181C10.1609 8 10.4742 8 11.1008 8H15C16.4045 8 17.1067 8 17.6111 8.33706C17.8295 8.48298 18.017 8.67048 18.1629 8.88886C18.5 9.39331 18.5 10.0955 18.5 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4.42028 14.0144L3.63368 16.0144C2.65618 18.4998 2.16743 19.7425 2.7524 20.6213C3.33737 21.5 4.65337 21.5 7.28537 21.5H15.1903C16.4249 21.5 17.0422 21.5 17.5295 21.1795C18.0169 20.859 18.2702 20.2865 18.7769 19.1415L19.6618 17.1415C20.7866 14.5992 21.349 13.3281 20.7679 12.4141C20.1868 11.5 18.8163 11.5 16.0752 11.5H8.07196C6.78232 11.5 6.1375 11.5 5.63811 11.8439C5.13872 12.1877 4.89924 12.7966 4.42028 14.0144Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M11.5 4.51456C12.4151 3.28409 13.6662 2.55594 15.5125 2.50161C16.1155 2.48386 16.7152 2.61395 17.2682 2.85544C18.5748 3.42601 19.4185 4.15644 20 5.5L21.5 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],B2=[["path",{d:"M12 21C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 15L14 17C14.2426 15.3039 15.7368 14 17.5 14C18.6894 14 19.7402 14.5933 20.3726 15.5M22 20L21 18C20.7574 19.6961 19.2632 21 17.5 21C16.3106 21 15.2598 20.4067 14.6273 19.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],qv=[["path",{d:"M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M5 7L5 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"5",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"19",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"5",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],z2=[["path",{d:"M6 8L6 16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 16V12C18 9.17156 18 7.75735 17.1213 6.87867C16.2426 5.99999 14.8284 5.99999 12 5.99999L11 5.99999M11 5.99999C11 5.29976 12.9943 3.99152 13.5 3.49999M11 5.99999C11 6.70022 12.9943 8.00846 13.5 8.49999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"6",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"18",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],Sh=[["path",{d:"M3.88884 9.66294C4.39329 10 5.09552 10 6.49998 10C7.90445 10 8.60668 10 9.11113 9.66294C9.32951 9.51702 9.51701 9.32952 9.66292 9.11114C9.99998 8.60669 9.99998 7.90446 9.99998 6.5C9.99998 5.09554 9.99998 4.39331 9.66292 3.88886C9.51701 3.67048 9.32951 3.48298 9.11113 3.33706C8.60668 3 7.90445 3 6.49998 3C5.09552 3 4.39329 3 3.88884 3.33706C3.67046 3.48298 3.48296 3.67048 3.33705 3.88886C2.99998 4.39331 2.99998 5.09554 2.99998 6.5C2.99998 7.90446 2.99998 8.60669 3.33705 9.11114C3.48296 9.32952 3.67046 9.51702 3.88884 9.66294Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.8888 9.66294C15.3933 10 16.0955 10 17.5 10C18.9044 10 19.6067 10 20.1111 9.66294C20.3295 9.51702 20.517 9.32952 20.6629 9.11114C21 8.60669 21 7.90446 21 6.5C21 5.09554 21 4.39331 20.6629 3.88886C20.517 3.67048 20.3295 3.48298 20.1111 3.33706C19.6067 3 18.9044 3 17.5 3C16.0955 3 15.3933 3 14.8888 3.33706C14.6705 3.48298 14.483 3.67048 14.337 3.88886C14 4.39331 14 5.09554 14 6.5C14 7.90446 14 8.60669 14.337 9.11114C14.483 9.32952 14.6705 9.51702 14.8888 9.66294Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3.88884 20.6629C4.39329 21 5.09552 21 6.49998 21C7.90445 21 8.60668 21 9.11113 20.6629C9.32951 20.517 9.51701 20.3295 9.66292 20.1111C9.99998 19.6067 9.99998 18.9045 9.99998 17.5C9.99998 16.0955 9.99998 15.3933 9.66292 14.8889C9.51701 14.6705 9.32951 14.483 9.11113 14.3371C8.60668 14 7.90445 14 6.49998 14C5.09552 14 4.39329 14 3.88884 14.3371C3.67046 14.483 3.48296 14.6705 3.33705 14.8889C2.99998 15.3933 2.99998 16.0955 2.99998 17.5C2.99998 18.9045 2.99998 19.6067 3.33705 20.1111C3.48296 20.3295 3.67046 20.517 3.88884 20.6629Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.8888 20.6629C15.3933 21 16.0955 21 17.5 21C18.9044 21 19.6067 21 20.1111 20.6629C20.3295 20.517 20.517 20.3295 20.6629 20.1111C21 19.6067 21 18.9045 21 17.5C21 16.0955 21 15.3933 20.6629 14.8889C20.517 14.6705 20.3295 14.483 20.1111 14.3371C19.6067 14 18.9044 14 17.5 14C16.0955 14 15.3933 14 14.8888 14.3371C14.6705 14.483 14.483 14.6705 14.337 14.8889C14 15.3933 14 16.0955 14 17.5C14 18.9045 14 19.6067 14.337 20.1111C14.483 20.3295 14.6705 20.517 14.8888 20.6629Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],W3=[["path",{d:"M20.7104 8.70122L21.9186 12.7288C21.9578 12.8592 21.9773 12.9244 21.9879 12.9914L21.9908 13.0118C22 13.079 22 13.147 22 13.2831C22 16.7797 22 18.528 20.9812 19.6669C20.8824 19.7774 20.7774 19.8824 20.6669 19.9812C19.528 21 17.7797 21 14.2831 21H9.71685C6.22026 21 4.47197 21 3.33311 19.9812C3.22259 19.8824 3.11765 19.7774 3.01877 19.6669C2 18.528 2 16.7797 2 13.2831C2 13.147 2 13.079 2.00915 13.0118L2.01215 12.9914C2.02269 12.9244 2.04225 12.8592 2.08136 12.7288L3.28963 8.70122C4.11355 5.95484 4.5255 4.58166 5.5884 3.79083C6.6513 3 8.08495 3 10.9522 3H13.0478C15.9151 3 17.3487 3 18.4116 3.79083C19.4745 4.58166 19.8865 5.95484 20.7104 8.70122Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2 13H22",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M17.9888 17H18M13 17H13.0112",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}]],q3=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 9.5C9.5 8.11929 10.6193 7 12 7C13.3807 7 14.5 8.11929 14.5 9.5C14.5 10.3569 14.0689 11.1131 13.4117 11.5636C12.7283 12.0319 12 12.6716 12 13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.0001 17H12.009",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",key:"2"}]],G3=[["path",{d:"M3 11.9896V14.5C3 17.7998 3 19.4497 4.02513 20.4749C5.05025 21.5 6.70017 21.5 10 21.5H14C17.2998 21.5 18.9497 21.5 19.9749 20.4749C21 19.4497 21 17.7998 21 14.5V11.9896C21 10.3083 21 9.46773 20.6441 8.74005C20.2882 8.01237 19.6247 7.49628 18.2976 6.46411L16.2976 4.90855C14.2331 3.30285 13.2009 2.5 12 2.5C10.7991 2.5 9.76689 3.30285 7.70242 4.90855L5.70241 6.46411C4.37533 7.49628 3.71179 8.01237 3.3559 8.74005C3 9.46773 3 10.3083 3 11.9896Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.0002 17C14.2007 17.6224 13.1504 18 12.0002 18C10.8499 18 9.79971 17.6224 9.00018 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],$3=[["circle",{cx:"7.5",cy:"7.5",r:"1.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 21C9.37246 15.775 14.2741 8.88406 21.4975 13.5424",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],K3=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 8.01172V8.00172",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",key:"2"}]],Ls=[["path",{d:"M12 3V6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 18V21",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 12L18 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6 12L3 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M18.3635 5.63672L16.2422 7.75804",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.75804 16.2422L5.63672 18.3635",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M18.3635 18.3635L16.2422 16.2422",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M7.75804 7.75804L5.63672 5.63672",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]],Y3=[["path",{d:"M3 6H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 12H13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 18H17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M21 8L19.8462 8.87652C17.9487 10.318 17 11.0388 17 12C17 12.9612 17.9487 13.682 19.8462 15.1235L21 16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],X3=[["path",{d:"M15.5 8.5L12 12M12 12L8.5 15.5M12 12L15.5 15.5M12 12L8.5 8.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],H2=[["path",{d:"M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18.6461 4.52795C18.2489 4.89346 18 5.41766 18 6C18 7.10457 18.8954 8 20 8C20.3793 8 20.7339 7.89441 21.0361 7.71103C21.6139 7.36038 22 6.72527 22 6C22 4.89543 21.1046 4 20 4C19.4778 4 19.0023 4.20016 18.6461 4.52795ZM18.6461 4.52795C16.8794 2.95541 14.5513 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 11.6625 21.9833 11.3289 21.9506 11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],ql=[["path",{d:"M12 4V20M20 12H4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Q3=[["path",{d:"M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],ml=[["path",{d:"M20.0071 14.5662L19.3587 14.1731C18.7986 13.8508 18.3579 13.3564 18.102 12.7634L15.68 7.15102C15.5927 6.94865 15.4729 6.77988 15.328 6.64097C14.6876 6.02689 13.5808 6.28697 13.0432 6.99226C12.0506 8.29448 13.3839 9.52751 13.1022 10.6133L5.35908 6.26089C3.55799 5.28913 2.0024 7.87074 3.79277 9.06333L8.37607 11.6124C7.4934 12.765 5.25512 18.3551 8.12341 20.0599C8.28646 20.1568 8.4672 20.2213 8.64852 20.2773C8.76516 20.3134 8.88186 20.3496 8.99761 20.3857C9.8979 20.6667 11.6003 21.02 12.7668 20.9182C13.9811 20.8123 14.7421 21.4597 15.68 21.9995",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.36184 4.96447C9.75873 5.36011 11.4854 5.24597 12.1223 5.16653M9.36184 4.96447C8.96494 4.56883 8.95358 2.63679 9.03328 2.0019M9.36184 4.96447C10.3829 3.19624 14.4425 0.375691 18.4708 3.19624C20.4175 4.55924 20.6922 5.4182 21 5.99362",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Z3=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],V2=[["path",{d:"M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],F2=[["path",{d:"M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.5 10C7.67157 10 7 9.32843 7 8.5C7 7.67157 7.67157 7 8.5 7C9.32843 7 10 7.67157 10 8.5C10 9.32843 9.32843 10 8.5 10Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.5 17C16.3284 17 17 16.3284 17 15.5C17 14.6716 16.3284 14 15.5 14C14.6716 14 14 14.6716 14 15.5C14 16.3284 14.6716 17 15.5 17Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M10 8.5L17 8.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14 15.5L7 15.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}]],U_=[["path",{d:"M14.4961 2.00027H9.49609C8.66767 2.00027 7.99609 2.67185 7.99609 3.50027C7.99609 4.3287 8.66767 5.00027 9.49609 5.00027H14.4961C15.3245 5.00027 15.9961 4.3287 15.9961 3.50027C15.9961 2.67185 15.3245 2.00027 14.4961 2.00027Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.99609 15.0003H11.4247M7.99609 11.0003H15.9961",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.9961 3.50027C17.5496 3.54709 18.4761 3.72035 19.1174 4.36164C19.9961 5.24032 19.9961 6.65451 19.9961 9.4829L19.9961 15.9997C19.9961 18.8282 19.9961 20.2424 19.1174 21.1211C18.2387 21.9997 16.8245 21.9997 13.9961 21.9997L9.99609 21.9997C7.16767 21.9997 5.75346 21.9997 4.87478 21.1211C3.9961 20.2424 3.9961 18.8282 3.99609 15.9998L3.99611 9.48296C3.9961 6.65453 3.9961 5.24031 4.87478 4.36163C5.51606 3.72034 6.44261 3.54708 7.99599 3.50027",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Af=[["path",{d:"M14.5405 2V4.48622C14.5405 6.23417 14.5405 7.10814 14.7545 7.94715C14.9685 8.78616 15.3879 9.55654 16.2267 11.0973L17.3633 13.1852C19.5008 17.1115 20.5696 19.0747 19.6928 20.53L19.6792 20.5522C18.7896 22 16.5264 22 12 22C7.47357 22 5.21036 22 4.3208 20.5522L4.30725 20.53C3.43045 19.0747 4.49918 17.1115 6.63666 13.1852L7.7733 11.0973C8.61209 9.55654 9.03149 8.78616 9.24548 7.94715C9.45947 7.10814 9.45947 6.23417 9.45947 4.48622V2",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M9 16.002L9.00868 15.9996",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"1"}],["path",{d:"M15 18.002L15.0087 17.9996",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",key:"2"}],["path",{d:"M8 2L16 2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M7.5 11.5563C8.5 10.4029 10.0994 11.2343 12 12.3182C14.5 13.7439 16 12.65 16.5 11.6152",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}]],J3=[["path",{d:"M5 14.5C5 14.5 6.5 14.5 8.5 18C8.5 18 14.0588 8.83333 19 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],ju=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],e4=[["path",{d:"M18 14C18 14 13.5811 19 12 19C10.4188 19 6 14 6 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 9.99996C18 9.99996 13.5811 5.00001 12 5C10.4188 4.99999 6 10 6 10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],t4=[["path",{d:"M17.0158 16.5V21.282C17.0158 21.6025 16.8064 21.874 16.5174 21.9663M17.0158 16.5L10.8772 12M17.0158 16.5V7.5M7.74691 9.7053L4.25118 7.03035C3.85429 6.72665 3.29466 6.76425 2.94169 7.11833L2.2921 7.76997C1.89399 8.16933 1.90433 8.81995 2.31494 9.20638L5.28343 12M7.74691 9.7053L10.8772 12M7.74691 9.7053L15.8129 2.19186C15.9453 2.06854 16.1193 2 16.3 2C16.3758 2 16.4488 2.01181 16.5174 2.0337M10.8772 12L17.0158 7.5M17.0158 7.5V2.71803C17.0158 2.39749 16.8064 2.126 16.5174 2.0337M7.74691 14.2947L4.25118 16.9696C3.85429 17.2733 3.29466 17.2357 2.94169 16.8817L2.2921 16.23C1.89399 15.8307 1.90433 15.18 2.31494 14.7936L5.28343 12M7.74691 14.2947L15.8129 21.8081C15.9453 21.9315 16.1193 22 16.3 22C16.3758 22 16.4488 21.9882 16.5174 21.9663M7.74691 14.2947L5.28343 12M16.5174 2.0337L21.4111 4.23506C21.7695 4.39626 22.0001 4.75353 22.0001 5.14752V18.8525C22.0001 19.2465 21.7695 19.6037 21.4111 19.7649L16.5174 21.9663",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],W_=k.createContext(void 0);function bi(e){const t=k.useContext(W_);if(e===!1&&t===void 0)throw new Error(It(27));return t}let xh=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const n4={[xh.startingStyle]:""},r4={[xh.endingStyle]:""},Hs={transitionStatus(e){return e==="starting"?n4:e==="ending"?r4:null}};let Xo=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=xh.startingStyle]="startingStyle",e[e.endingStyle=xh.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),Gv=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const s4={[Gv.popupOpen]:""},i4={[Gv.popupOpen]:"",[Gv.pressed]:""},o4={[Xo.open]:""},a4={[Xo.closed]:""},l4={[Xo.anchorHidden]:""},q_={open(e){return e?s4:null}},bu={open(e){return e?i4:null}},go={open(e){return e?o4:a4},anchorHidden(e){return e?l4:null}},c4={...go,...Hs},U2=k.forwardRef(function(t,n){const{render:s,className:o,forceRender:u=!1,...h}=t,{store:a}=bi(),c=a.useState("open"),d=a.useState("nested"),p=a.useState("mounted"),f=a.useState("transitionStatus"),g=k.useMemo(()=>({open:c,transitionStatus:f}),[c,f]);return ut("div",t,{state:g,ref:[a.context.backdropRef,n],stateAttributesMapping:c4,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},h],enabled:u||!d})}),Pn="none",oa="trigger-press",Or="trigger-hover",Ch="trigger-focus",G_="outside-press",aa="item-press",u4="close-press",Lx="clear-press",Qo="input-change",Ji="input-clear",ga="focus-out",np="escape-key",hu="list-navigation",W2="cancel-open",au="sibling-open",q2="imperative-action",d4="window-resize";function Ue(e,t,n,s){let o=!1,u=!1;const h=s??en;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){u=!0},get isCanceled(){return o},get isPropagationAllowed(){return u},trigger:n,...h}}function eu(e,t,n){const s=n??en;return{reason:e,event:t??new Event("base-ui"),...s}}const rp=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,...a}=t,{store:c}=bi(),d=c.useState("open");function p(C){d&&c.setOpen(!1,Ue(u4,C.nativeEvent))}const{getButtonProps:f,buttonRef:g}=jr({disabled:u,native:h}),b=k.useMemo(()=>({disabled:u}),[u]);return ut("button",t,{state:b,ref:[n,g],props:[{onClick:p},a,f]})}),f4={...kw};let Ax=0;function h4(e,t="mui"){const[n,s]=k.useState(e),o=e||n;return k.useEffect(()=>{n==null&&(Ax+=1,s(`${t}-${Ax}`))},[n,t]),o}const Ox=f4.useId;function Sa(e,t){if(Ox!==void 0){const n=Ox();return e??(t?`${t}-${n}`:n)}return h4(e,t)}function Pr(e){return Sa(e,"base-ui")}const G2=k.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=bi(),c=Pr(u);return a.useSyncedValueWithCleanup("descriptionElementId",c),ut("p",t,{ref:n,props:[{id:c},h]})}),p4=[];function $2(e){k.useEffect(e,p4)}const tu=0;class va{static create(){return new va}currentId=tu;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=tu,n()},t)}isStarted(){return this.currentId!==tu}clear=()=>{this.currentId!==tu&&(clearTimeout(this.currentId),this.currentId=tu)};disposeEffect=()=>this.clear}function Qt(){const e=Wn(va.create).current;return $2(e.disposeEffect),e}function dn(e){const t=Wn(m4,e).current;return t.next=e,je(t.effect),t}function m4(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const xa=typeof navigator<"u",nv=_4(),K2=b4(),$_=y4(),K_=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),g4=nv.platform==="MacIntel"&&nv.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(nv.platform),Mx=xa&&/firefox/i.test($_),Y2=xa&&/apple/i.test(navigator.vendor),wh=xa&&/android/i.test(K2)||/android/i.test($_),v4=xa&&K2.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,X2=$_.includes("jsdom/");function _4(){if(!xa)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function y4(){if(!xa)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function b4(){if(!xa)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const $v="data-base-ui-focusable",Q2="active",Z2="selected",J2="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",lo="ArrowLeft",co="ArrowRight",Y_="ArrowUp",Bu="ArrowDown";function ds(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ft(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&zv(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function An(e){return"composedPath"in e?e.composedPath()[0]:e.target}function us(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function S4(e){return e.matches("html,body")}function cn(e){return e?.ownerDocument||document}function X_(e){return Jt(e)&&e.matches(J2)}function Kv(e){return e?e.getAttribute("role")==="combobox"&&X_(e):!1}function x4(e){if(!e||X2)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Su(e){return e?e.hasAttribute($v)?e:e.querySelector(`[${$v}]`)||e:null}function la(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...la(e,o.id,n)])}function Dx(e,t){let n=[],s=e.find(o=>o.id===t)?.parentId;for(;s;){const o=e.find(u=>u.id===s);s=o?.parentId,o&&(n=n.concat(o))}return n}function un(e){e.preventDefault(),e.stopPropagation()}function C4(e){return"nativeEvent"in e}function eE(e){return e.mozInputSource===0&&e.isTrusted?!0:wh&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function tE(e){return X2?!1:!wh&&e.width===0&&e.height===0||wh&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Ml(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function nE(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const w4=["top","right","bottom","left"],Dl=Math.min,Lr=Math.max,Eh=Math.round,_l=Math.floor,Ds=e=>({x:e,y:e}),E4={left:"right",right:"left",bottom:"top",top:"bottom"},R4={start:"end",end:"start"};function Yv(e,t,n){return Lr(e,Dl(t,n))}function _i(e,t){return typeof e=="function"?e(t):e}function Mr(e){return e.split("-")[0]}function vo(e){return e.split("-")[1]}function Q_(e){return e==="x"?"y":"x"}function Z_(e){return e==="y"?"height":"width"}const k4=new Set(["top","bottom"]);function Zr(e){return k4.has(Mr(e))?"y":"x"}function J_(e){return Q_(Zr(e))}function T4(e,t,n){n===void 0&&(n=!1);const s=vo(e),o=J_(e),u=Z_(o);let h=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(h=Rh(h)),[h,Rh(h)]}function L4(e){const t=Rh(e);return[Xv(e),t,Xv(t)]}function Xv(e){return e.replace(/start|end/g,t=>R4[t])}const Px=["left","right"],Ix=["right","left"],A4=["top","bottom"],O4=["bottom","top"];function M4(e,t,n){switch(e){case"top":case"bottom":return n?t?Ix:Px:t?Px:Ix;case"left":case"right":return t?A4:O4;default:return[]}}function D4(e,t,n,s){const o=vo(e);let u=M4(Mr(e),n==="start",s);return o&&(u=u.map(h=>h+"-"+o),t&&(u=u.concat(u.map(Xv)))),u}function Rh(e){return e.replace(/left|right|bottom|top/g,t=>E4[t])}function P4(e){return{top:0,right:0,bottom:0,left:0,...e}}function rE(e){return typeof e!="number"?P4(e):{top:e,right:e,bottom:e,left:e}}function kh(e){const{x:t,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:t,right:t+s,bottom:n+o,x:t,y:n}}function Of(e,t,n){return Math.floor(e/t)!==n}function Sl(e,t){return t<0||t>=e.current.length}function rh(e,t){return Un(e,{disabledIndices:t})}function Qv(e,t){return Un(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Un(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:s,amount:o=1}={}){let u=t;do u+=n?-o:o;while(u>=0&&u<=e.current.length-1&&uo(e,u,s));return u}function sE(e,{event:t,orientation:n,loopFocus:s,rtl:o,cols:u,disabledIndices:h,minIndex:a,maxIndex:c,prevIndex:d,stopEvent:p=!1}){let f=d;const g=[],b={};let C=!1;{let _=null,v=-1;e.current.forEach((S,E)=>{if(S==null)return;const T=S.closest('[role="row"]');T&&(C=!0),(T!==_||v===-1)&&(_=T,v+=1,g[v]=[]),g[v].push(E),b[E]=v})}const x=C&&g.length>0&&g.some(_=>_.length!==u);function y(_){if(!x||d===-1)return;const v=b[d];if(v==null)return;const S=g[v].indexOf(d);let E=_==="up"?v-1:v+1;s&&(E<0?E=g.length-1:E>=g.length&&(E=0));const T=new Set;for(;E>=0&&E<g.length&&!T.has(E);){T.add(E);const A=g[E];if(A.length===0){E=_==="up"?E-1:E+1;continue}const M=Math.min(S,A.length-1);for(let L=M;L>=0;L-=1){const D=A[L];if(!uo(e,D,h))return D}E=_==="up"?E-1:E+1,s&&(E<0?E=g.length-1:E>=g.length&&(E=0))}}if(t.key===Y_){const _=y("up");if(_!==void 0)p&&un(t),f=_;else{if(p&&un(t),d===-1)f=c;else if(f=Un(e,{startingIndex:f,amount:u,decrement:!0,disabledIndices:h}),s&&(d-u<a||f<0)){const v=d%u,S=c%u,E=c-(S-v);S===v?f=c:f=S>v?E:E-u}Sl(e,f)&&(f=d)}}if(t.key===Bu){const _=y("down");_!==void 0?(p&&un(t),f=_):(p&&un(t),d===-1?f=a:(f=Un(e,{startingIndex:d,amount:u,disabledIndices:h}),s&&d+u>c&&(f=Un(e,{startingIndex:d%u-u,amount:u,disabledIndices:h}))),Sl(e,f)&&(f=d))}if(n==="both"){const _=_l(d/u);t.key===(o?lo:co)&&(p&&un(t),d%u!==u-1?(f=Un(e,{startingIndex:d,disabledIndices:h}),s&&Of(f,u,_)&&(f=Un(e,{startingIndex:d-d%u-1,disabledIndices:h}))):s&&(f=Un(e,{startingIndex:d-d%u-1,disabledIndices:h})),Of(f,u,_)&&(f=d)),t.key===(o?co:lo)&&(p&&un(t),d%u!==0?(f=Un(e,{startingIndex:d,decrement:!0,disabledIndices:h}),s&&Of(f,u,_)&&(f=Un(e,{startingIndex:d+(u-d%u),decrement:!0,disabledIndices:h}))):s&&(f=Un(e,{startingIndex:d+(u-d%u),decrement:!0,disabledIndices:h})),Of(f,u,_)&&(f=d));const v=_l(c/u)===_;Sl(e,f)&&(s&&v?f=t.key===(o?co:lo)?c:Un(e,{startingIndex:d-d%u-1,disabledIndices:h}):f=d)}return f}function iE(e,t,n){const s=[];let o=0;return e.forEach(({width:u,height:h},a)=>{let c=!1;for(n&&(o=0);!c;){const d=[];for(let p=0;p<u;p+=1)for(let f=0;f<h;f+=1)d.push(o+p+f*t);o%t+u<=t&&d.every(p=>s[p]==null)?(d.forEach(p=>{s[p]=a}),c=!0):o+=1}}),[...s]}function oE(e,t,n,s,o){if(e===-1)return-1;const u=n.indexOf(e),h=t[e];switch(o){case"tl":return u;case"tr":return h?u+h.width-1:u;case"bl":return h?u+(h.height-1)*s:u;case"br":return n.lastIndexOf(e);default:return-1}}function aE(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function uo(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}var I4=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Th=I4.join(","),lE=typeof Element>"u",Pl=lE?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Lh=!lE&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},xu=function(t,n){var s;n===void 0&&(n=!0);var o=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),u=o===""||o==="true",h=u||n&&t&&xu(t.parentNode);return h},N4=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},cE=function(t,n,s){if(xu(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Th));return n&&Pl.call(t,Th)&&o.unshift(t),o=o.filter(s),o},Ah=function(t,n,s){for(var o=[],u=Array.from(t);u.length;){var h=u.shift();if(!xu(h,!1))if(h.tagName==="SLOT"){var a=h.assignedElements(),c=a.length?a:h.children,d=Ah(c,!0,s);s.flatten?o.push.apply(o,d):o.push({scopeParent:h,candidates:d})}else{var p=Pl.call(h,Th);p&&s.filter(h)&&(n||!t.includes(h))&&o.push(h);var f=h.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(h),g=!xu(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(h));if(f&&g){var b=Ah(f===!0?h.children:f.children,!0,s);s.flatten?o.push.apply(o,b):o.push({scopeParent:h,candidates:b})}else u.unshift.apply(u,h.children)}}return o},uE=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},dE=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||N4(t))&&!uE(t)?0:t.tabIndex},j4=function(t,n){var s=dE(t);return s<0&&n&&!uE(t)?0:s},B4=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},fE=function(t){return t.tagName==="INPUT"},z4=function(t){return fE(t)&&t.type==="hidden"},H4=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},V4=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},F4=function(t){if(!t.name)return!0;var n=t.form||Lh(t),s=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=s(window.CSS.escape(t.name));else try{o=s(t.name)}catch(h){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",h.message),!1}var u=V4(o,t.form);return!u||u===t},U4=function(t){return fE(t)&&t.type==="radio"},W4=function(t){return U4(t)&&!F4(t)},q4=function(t){var n,s=t&&Lh(t),o=(n=s)===null||n===void 0?void 0:n.host,u=!1;if(s&&s!==t){var h,a,c;for(u=!!((h=o)!==null&&h!==void 0&&(a=h.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!u&&o;){var d,p,f;s=Lh(o),o=(d=s)===null||d===void 0?void 0:d.host,u=!!((p=o)!==null&&p!==void 0&&(f=p.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return u},Nx=function(t){var n=t.getBoundingClientRect(),s=n.width,o=n.height;return s===0&&o===0},G4=function(t,n){var s=n.displayCheck,o=n.getShadowRoot;if(s==="full-native"&&"checkVisibility"in t){var u=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!u}if(getComputedStyle(t).visibility==="hidden")return!0;var h=Pl.call(t,"details>summary:first-of-type"),a=h?t.parentElement:t;if(Pl.call(a,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof o=="function"){for(var c=t;t;){var d=t.parentElement,p=Lh(t);if(d&&!d.shadowRoot&&o(d)===!0)return Nx(t);t.assignedSlot?t=t.assignedSlot:!d&&p!==t.ownerDocument?t=p.host:t=d}t=c}if(q4(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return Nx(t);return!1},$4=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var o=n.children.item(s);if(o.tagName==="LEGEND")return Pl.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Zv=function(t,n){return!(n.disabled||xu(n)||z4(n)||G4(n,t)||H4(n)||$4(n))},Jv=function(t,n){return!(W4(n)||dE(n)<0||!Zv(t,n))},K4=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},hE=function(t){var n=[],s=[];return t.forEach(function(o,u){var h=!!o.scopeParent,a=h?o.scopeParent:o,c=j4(a,h),d=h?hE(o.candidates):a;c===0?h?n.push.apply(n,d):n.push(a):s.push({documentOrder:u,tabIndex:c,item:o,isScope:h,content:d})}),s.sort(B4).reduce(function(o,u){return u.isScope?o.push.apply(o,u.content):o.push(u.content),o},[]).concat(n)},zu=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Ah([t],n.includeContainer,{filter:Jv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:K4}):s=cE(t,n.includeContainer,Jv.bind(null,n)),hE(s)},Y4=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Ah([t],n.includeContainer,{filter:Zv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=cE(t,n.includeContainer,Zv.bind(null,n)),s},pE=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Pl.call(t,Th)===!1?!1:Jv(n,t)};const Gl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function mE(e,t){const n=zu(e,Gl()),s=n.length;if(s===0)return;const o=ds(cn(e)),u=n.indexOf(o),h=u===-1?t===1?0:s-1:u+t;return n[h]}function e0(e){return mE(cn(e).body,1)||e}function gE(e){return mE(cn(e).body,-1)||e}function vE(e,t){if(!e)return null;const n=zu(cn(e).body,Gl()),s=n.length;if(s===0)return null;const o=n.indexOf(e);if(o===-1)return null;const u=(o+t+s)%s;return n[u]}function X4(e){return vE(e,1)}function Q4(e){return vE(e,-1)}function xl(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!ft(n,s)}function Z4(e){zu(e,Gl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function jx(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function _E(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class t0{nodesRef={current:[]};events=_E();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(s=>s===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const yE=k.createContext(null),bE=k.createContext(null),Si=()=>k.useContext(yE)?.id||null,_o=e=>{const t=k.useContext(bE);return e??t};function SE(e){const t=Sa(),n=_o(e),s=Si();return je(()=>{if(!t)return;const o={id:t,parentId:s};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,s]),t}function J4(e){const{children:t,id:n}=e,s=Si();return w.jsx(yE.Provider,{value:k.useMemo(()=>({id:n,parentId:s}),[n,s]),children:t})}function eD(e){const{children:t,externalTree:n}=e,s=Wn(()=>n??new t0).current;return w.jsx(bE.Provider,{value:s,children:t})}function Il(e){return`data-base-ui-${e}`}function rv(e,t,n){if(n&&!Ml(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const s=e();return typeof s=="number"?s:s?.[t]}return e?.[t]}const $l={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Mf=null;class tD{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Df=new tD;class Ts{static create(){return new Ts}static request(t){return Df.request(t)}static cancel(t){return Df.cancel(t)}currentId=Mf;request(t){this.cancel(),this.currentId=Df.request(()=>{this.currentId=Mf,t()})}cancel=()=>{this.currentId!==Mf&&(Df.cancel(this.currentId),this.currentId=Mf)};disposeEffect=()=>this.cancel}function Hu(){const e=Wn(Ts.create).current;return $2(e.disposeEffect),e}function pr(e){return e?.ownerDocument||document}const Nl=k.forwardRef(function(t,n){const[s,o]=k.useState();je(()=>{Y2&&o("button")},[]);const u={tabIndex:0,role:s};return w.jsx("span",{...t,ref:n,style:$l,"aria-hidden":s?void 0:!0,...u,"data-base-ui-focus-guard":""})});let Bx=0;function sh(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:o=!1}=t;s&&cancelAnimationFrame(Bx);const u=()=>e?.focus({preventScroll:n});o?u():Bx=requestAnimationFrame(u)}const Cl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function zx(e){return e==="inert"?Cl.inert:e==="aria-hidden"?Cl["aria-hidden"]:Cl.none}let Pf=new WeakSet,If={},sv=0;const xE=e=>e&&(e.host||xE(e.parentNode)),nD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=xE(n);return e.contains(s)?s:null}).filter(n=>n!=null);function rD(e,t,n,s){const o="data-base-ui-inert",u=s?"inert":n?"aria-hidden":null,h=nD(t,e),a=new Set,c=new Set(h),d=[];If[o]||(If[o]=new WeakMap);const p=If[o];h.forEach(f),g(t),a.clear();function f(b){!b||a.has(b)||(a.add(b),b.parentNode&&f(b.parentNode))}function g(b){!b||c.has(b)||[].forEach.call(b.children,C=>{if(mo(C)!=="script")if(a.has(C))g(C);else{const x=u?C.getAttribute(u):null,y=x!==null&&x!=="false",_=zx(u),v=(_.get(C)||0)+1,S=(p.get(C)||0)+1;_.set(C,v),p.set(C,S),d.push(C),v===1&&y&&Pf.add(C),S===1&&C.setAttribute(o,""),!y&&u&&C.setAttribute(u,u==="inert"?"":"true")}})}return sv+=1,()=>{d.forEach(b=>{const C=zx(u),y=(C.get(b)||0)-1,_=(p.get(b)||0)-1;C.set(b,y),p.set(b,_),y||(!Pf.has(b)&&u&&b.removeAttribute(u),Pf.delete(b)),_||b.removeAttribute(o)}),sv-=1,sv||(Cl.inert=new WeakMap,Cl["aria-hidden"]=new WeakMap,Cl.none=new WeakMap,Pf=new WeakSet,If={})}}function sD(e,t=!1,n=!1){const s=cn(e[0]).body;return rD(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const CE=k.createContext(null),wE=()=>k.useContext(CE),iD=Il("portal");function oD(e={}){const{ref:t,container:n,componentProps:s=en,elementProps:o,elementState:u}=e,h=Sa(),c=wE()?.portalNode,[d,p]=k.useState(null),[f,g]=k.useState(null),b=k.useRef(null);je(()=>{if(n===null){b.current&&(b.current=null,g(null),p(null));return}if(h==null)return;const y=(n&&(N_(n)?n:n.current))??c??document.body;if(y==null){b.current&&(b.current=null,g(null),p(null));return}b.current!==y&&(b.current=y,g(null),p(y))},[n,c,h]);const C=ut("div",s,{ref:[t,g],state:u,props:[{id:h,[iD]:""},o]});return{portalNode:f,portalSubtree:d&&C?Qn.createPortal(C,d):null}}const sp=k.forwardRef(function(t,n){const{children:s,container:o,className:u,render:h,renderGuards:a,...c}=t,{portalNode:d,portalSubtree:p}=oD({container:o,ref:n,componentProps:t,elementProps:c}),f=k.useRef(null),g=k.useRef(null),b=k.useRef(null),C=k.useRef(null),[x,y]=k.useState(null),_=x?.modal,v=x?.open,S=typeof a=="boolean"?a:!!x&&!x.modal&&x.open&&!!d;k.useEffect(()=>{if(!d||_)return;function T(A){d&&xl(A)&&(A.type==="focusin"?jx:Z4)(d)}return d.addEventListener("focusin",T,!0),d.addEventListener("focusout",T,!0),()=>{d.removeEventListener("focusin",T,!0),d.removeEventListener("focusout",T,!0)}},[d,_]),k.useEffect(()=>{!d||v||jx(d)},[v,d]);const E=k.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:b,afterInsideRef:C,portalNode:d,setFocusManagerState:y}),[d]);return w.jsxs(k.Fragment,{children:[p,w.jsxs(CE.Provider,{value:E,children:[S&&d&&w.jsx(Nl,{"data-type":"outside",ref:f,onFocus:T=>{if(xl(T,d))b.current?.focus();else{const A=x?x.domReference:null;gE(A)?.focus()}}}),S&&d&&w.jsx("span",{"aria-owns":d.id,style:HM}),d&&Qn.createPortal(s,d),S&&d&&w.jsx(Nl,{"data-type":"outside",ref:g,onFocus:T=>{if(xl(T,d))C.current?.focus();else{const A=x?x.domReference:null;e0(A)?.focus(),x?.closeOnFocusOut&&x?.onOpenChange(!1,Ue(ga,T.nativeEvent))}}})]})]})});function Uo(e){return e==null?e:"current"in e?e.current:e}function aD(e,t){const n=xn(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Hx=20;let no=[];function n0(){no=no.filter(e=>e.isConnected)}function lD(e){n0(),e&&mo(e)!=="body"&&(no.push(e),no.length>Hx&&(no=no.slice(-Hx)))}function iv(){return n0(),no[no.length-1]}function cD(e){if(!e)return null;const t=Gl();return pE(e,t)?e:zu(e,t)[0]||e}function uD(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Dr(e).display!=="none"}function Vx(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Gl(),o=Y4(e,n).filter(h=>{const a=h.getAttribute("data-tabindex")||"";return pE(h,n)||h.hasAttribute("data-tabindex")&&!a.startsWith("-")}),u=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?u!=="0"&&e.setAttribute("tabindex","0"):(u!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ip(e){const{context:t,children:n,disabled:s=!1,order:o=["content"],initialFocus:u=!0,returnFocus:h=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:d=!0,openInteractionType:p="",getInsideElements:f=()=>[],nextFocusableElement:g,previousFocusableElement:b,beforeContentFocusGuardRef:C,externalTree:x}=e,y="rootStore"in t?t.rootStore:t,_=y.useState("open"),v=y.useState("domReferenceElement"),S=y.useState("floatingElement"),{events:E,dataRef:T}=y.context,A=De(()=>T.current.floatingContext?.nodeId),M=De(f),L=u===!1,D=Kv(v)&&L,U=dn(o),z=dn(u),W=dn(h),N=dn(p),Y=_o(x),$=wE(),F=k.useRef(null),q=k.useRef(null),H=k.useRef(!1),P=k.useRef(!1),B=k.useRef(!1),I=k.useRef(-1),G=k.useRef(""),K=k.useRef(""),J=Qt(),Z=Qt(),ee=Hu(),X=$!=null,V=Su(S),se=De((he=V)=>he?zu(he,Gl()):[]),re=De(he=>{const de=se(he);return U.current.map(()=>de).filter(Boolean).flat()});k.useEffect(()=>{if(s||!c)return;function he(Le){Le.key==="Tab"&&ft(V,ds(cn(V)))&&se().length===0&&!D&&un(Le)}const de=cn(V);return de.addEventListener("keydown",he),()=>{de.removeEventListener("keydown",he)}},[s,v,V,c,U,D,se,re]),k.useEffect(()=>{if(s||!S)return;function he(de){const Le=An(de),Ne=se().indexOf(Le);Ne!==-1&&(I.current=Ne)}return S.addEventListener("focusin",he),()=>{S.removeEventListener("focusin",he)}},[s,S,se]),k.useEffect(()=>{if(s||!_)return;const he=cn(V);function de(){B.current=!1}function Le(Ne){const ye=An(Ne),Ae=ft(S,ye)||ft(v,ye)||ft($?.portalNode,ye);B.current=!Ae,K.current=Ne.pointerType||"keyboard"}function Oe(){K.current="keyboard"}return he.addEventListener("pointerdown",Le,!0),he.addEventListener("pointerup",de,!0),he.addEventListener("pointercancel",de,!0),he.addEventListener("keydown",Oe,!0),()=>{he.removeEventListener("pointerdown",Le,!0),he.removeEventListener("pointerup",de,!0),he.removeEventListener("pointercancel",de,!0),he.removeEventListener("keydown",Oe,!0)}},[s,S,v,V,_,$]),k.useEffect(()=>{if(s||!d)return;function he(){P.current=!0,Z.start(0,()=>{P.current=!1})}function de(ye){const Ae=ye.relatedTarget,ae=ye.currentTarget,be=An(ye);queueMicrotask(()=>{const Ce=A(),We=y.context.triggerElements,rt=!(ft(v,Ae)||ft(S,Ae)||ft(Ae,S)||ft($?.portalNode,Ae)||Ae!=null&&We.hasElement(Ae)||We.hasMatchingElement(ze=>ft(ze,Ae))||Ae?.hasAttribute(Il("focus-guard"))||Y&&(la(Y.nodesRef.current,Ce).find(ze=>ft(ze.context?.elements.floating,Ae)||ft(ze.context?.elements.domReference,Ae))||Dx(Y.nodesRef.current,Ce).find(ze=>[ze.context?.elements.floating,Su(ze.context?.elements.floating)].includes(Ae)||ze.context?.elements.domReference===Ae)));if(ae===v&&V&&Vx(V,U),a&&ae!==v&&!uD(be)&&ds(cn(V))===cn(V).body){if(Jt(V)&&(V.focus(),a==="popup")){ee.request(()=>{V.focus()});return}const ze=I.current,Me=se(),He=Me[ze]||Me[Me.length-1]||V;Jt(He)&&He.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(D||!c)&&Ae&&rt&&!P.current&&(D||Ae!==iv())&&(H.current=!0,y.setOpen(!1,Ue(ga,ye)))})}function Le(){B.current||(T.current.insideReactTree=!0,J.start(0,()=>{T.current.insideReactTree=!1}))}const Oe=Jt(v)?v:null,Ne=[];if(!(!S&&!Oe))return Oe&&(Oe.addEventListener("focusout",de),Oe.addEventListener("pointerdown",he),Ne.push(()=>{Oe.removeEventListener("focusout",de),Oe.removeEventListener("pointerdown",he)})),S&&(S.addEventListener("focusout",de),$&&(S.addEventListener("focusout",Le,!0),Ne.push(()=>{S.removeEventListener("focusout",Le,!0)})),Ne.push(()=>{S.removeEventListener("focusout",de)})),()=>{Ne.forEach(ye=>{ye()})}},[s,v,S,V,c,Y,$,y,d,a,se,D,A,U,T,J,Z,ee]);const ne=k.useRef(null),oe=k.useRef(null),ce=ns(ne,C,$?.beforeInsideRef),ve=ns(oe,$?.afterInsideRef);k.useEffect(()=>{if(s||!S||!_)return;const he=Array.from($?.portalNode?.querySelectorAll(`[${Il("portal")}]`)||[]),Le=(Y?Dx(Y.nodesRef.current,A()):[]).find(ye=>Kv(ye.context?.elements.domReference||null))?.context?.elements.domReference,Oe=[S,Le,...he,...M(),F.current,q.current,ne.current,oe.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,Uo(b),Uo(g),D?v:null].filter(ye=>ye!=null),Ne=sD(Oe,c||D);return()=>{Ne()}},[_,s,v,S,c,U,$,D,Y,A,M,g,b]),je(()=>{if(!_||s||!Jt(V))return;const he=cn(V),de=ds(he);queueMicrotask(()=>{const Le=re(V),Oe=z.current,Ne=typeof Oe=="function"?Oe(N.current||""):Oe;if(Ne===void 0||Ne===!1)return;let ye;Ne===!0||Ne===null?ye=Le[0]||V:ye=Uo(Ne),ye=ye||Le[0]||V,!ft(V,de)&&sh(ye,{preventScroll:ye===V})})},[s,_,V,L,re,z,N]),je(()=>{if(s||!V)return;const he=cn(V),de=ds(he);lD(de);function Le(ye){if(ye.open||(G.current=aD(ye.nativeEvent,K.current)),ye.reason===Or&&ye.nativeEvent.type==="mouseleave"&&(H.current=!0),ye.reason===G_)if(ye.nested)H.current=!1;else if(eE(ye.nativeEvent)||tE(ye.nativeEvent))H.current=!1;else{let Ae=!1;document.createElement("div").focus({get preventScroll(){return Ae=!0,!1}}),Ae?H.current=!1:H.current=!0}}E.on("openchange",Le);const Oe=he.createElement("span");Oe.setAttribute("tabindex","-1"),Oe.setAttribute("aria-hidden","true"),Object.assign(Oe.style,$l),X&&v&&v.insertAdjacentElement("afterend",Oe);function Ne(){const ye=W.current;let Ae=typeof ye=="function"?ye(G.current):ye;if(Ae===void 0||Ae===!1)return null;if(Ae===null&&(Ae=!0),typeof Ae=="boolean"){const be=v||iv();return be&&be.isConnected?be:Oe}const ae=v||iv()||Oe;return Uo(Ae)||ae}return()=>{E.off("openchange",Le);const ye=ds(he),Ae=ft(S,ye)||Y&&la(Y.nodesRef.current,A(),!1).some(be=>ft(be.context?.elements.floating,ye)),ae=Ne();queueMicrotask(()=>{const be=cD(ae),Ce=typeof W.current!="boolean";W.current&&!H.current&&Jt(be)&&(!(!Ce&&be!==ye&&ye!==he.body)||Ae)&&be.focus({preventScroll:!0}),Oe.remove()})}},[s,S,V,W,T,E,Y,X,v,A]),k.useEffect(()=>{queueMicrotask(()=>{H.current=!1})},[s]),k.useEffect(()=>{if(s||!_)return;function he(Le){An(Le)?.closest(`[${p2}]`)&&(P.current=!0)}const de=cn(V);return de.addEventListener("pointerdown",he,!0),()=>{de.removeEventListener("pointerdown",he,!0)}},[s,_,V]),je(()=>{if(!s&&$)return $.setFocusManagerState({modal:c,closeOnFocusOut:d,open:_,onOpenChange:y.setOpen,domReference:v}),()=>{$.setFocusManagerState(null)}},[s,$,c,_,y,d,v]),je(()=>{if(!(s||!V))return Vx(V,U),()=>{queueMicrotask(n0)}},[s,V,U]);const ge=!s&&(c?!D:!0)&&(X||c);return w.jsxs(k.Fragment,{children:[ge&&w.jsx(Nl,{"data-type":"inside",ref:ce,onFocus:he=>{if(c){const de=re();sh(de[de.length-1])}else $?.portalNode&&(H.current=!1,xl(he,$.portalNode)?e0(v)?.focus():Uo(b??$.beforeOutsideRef)?.focus())}}),n,ge&&w.jsx(Nl,{"data-type":"inside",ref:ve,onFocus:he=>{c?sh(re()[0]):$?.portalNode&&(d&&(H.current=!0),xl(he,$.portalNode)?gE(v)?.focus():Uo(g??$.afterOutsideRef)?.focus())}})]})}function Vu(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.context.dataRef,{enabled:o=!0,event:u="click",toggle:h=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:d=0}=t,p=k.useRef(void 0),f=Hu(),g=Qt(),b=k.useMemo(()=>({onPointerDown(C){p.current=C.pointerType},onMouseDown(C){const x=p.current,y=C.nativeEvent,_=n.select("open");if(C.button!==0||u==="click"||Ml(x,!0)&&a)return;const v=s.current.openEvent,S=v?.type,E=n.select("domReferenceElement")!==C.currentTarget,T=_&&E||!(_&&h&&(!(v&&c)||S==="click"||S==="mousedown"));if(X_(y.target)){const M=Ue(oa,y,y.target);T&&x==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,M)}):n.setOpen(T,M);return}const A=C.currentTarget;f.request(()=>{const M=Ue(oa,y,A);T&&x==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,M)}):n.setOpen(T,M)})},onClick(C){if(u==="mousedown-only")return;const x=p.current;if(u==="mousedown"&&x){p.current=void 0;return}if(Ml(x,!0)&&a)return;const y=n.select("open"),_=s.current.openEvent,v=n.select("domReferenceElement")!==C.currentTarget,S=y&&v||!(y&&h&&(!(_&&c)||nE(_))),E=Ue(oa,C.nativeEvent,C.currentTarget);S&&x==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,E)}):n.setOpen(S,E)},onKeyDown(){p.current=void 0}}),[s,u,a,n,c,h,f,g,d]);return k.useMemo(()=>o?{reference:b}:en,[o,b])}function Fx(e,t,n){let{reference:s,floating:o}=e;const u=Zr(t),h=J_(t),a=Z_(h),c=Mr(t),d=u==="y",p=s.x+s.width/2-o.width/2,f=s.y+s.height/2-o.height/2,g=s[a]/2-o[a]/2;let b;switch(c){case"top":b={x:p,y:s.y-o.height};break;case"bottom":b={x:p,y:s.y+s.height};break;case"right":b={x:s.x+s.width,y:f};break;case"left":b={x:s.x-o.width,y:f};break;default:b={x:s.x,y:s.y}}switch(vo(t)){case"start":b[h]-=g*(n&&d?-1:1);break;case"end":b[h]+=g*(n&&d?-1:1);break}return b}const dD=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:h}=n,a=u.filter(Boolean),c=await(h.isRTL==null?void 0:h.isRTL(t));let d=await h.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=Fx(d,s,c),g=s,b={},C=0;for(let x=0;x<a.length;x++){const{name:y,fn:_}=a[x],{x:v,y:S,data:E,reset:T}=await _({x:p,y:f,initialPlacement:s,placement:g,strategy:o,middlewareData:b,rects:d,platform:h,elements:{reference:e,floating:t}});p=v??p,f=S??f,b={...b,[y]:{...b[y],...E}},T&&C<=50&&(C++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(d=T.rects===!0?await h.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:p,y:f}=Fx(d,g,c)),x=-1)}return{x:p,y:f,placement:g,strategy:o,middlewareData:b}};async function Cu(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:u,rects:h,elements:a,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:g=!1,padding:b=0}=_i(t,e),C=rE(b),y=a[g?f==="floating"?"reference":"floating":f],_=kh(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(y)))==null||n?y:y.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(a.floating)),boundary:d,rootBoundary:p,strategy:c})),v=f==="floating"?{x:s,y:o,width:h.floating.width,height:h.floating.height}:h.reference,S=await(u.getOffsetParent==null?void 0:u.getOffsetParent(a.floating)),E=await(u.isElement==null?void 0:u.isElement(S))?await(u.getScale==null?void 0:u.getScale(S))||{x:1,y:1}:{x:1,y:1},T=kh(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:S,strategy:c}):v);return{top:(_.top-T.top+C.top)/E.y,bottom:(T.bottom-_.bottom+C.bottom)/E.y,left:(_.left-T.left+C.left)/E.x,right:(T.right-_.right+C.right)/E.x}}const fD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:o,middlewareData:u,rects:h,initialPlacement:a,platform:c,elements:d}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:x=!0,...y}=_i(e,t);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const _=Mr(o),v=Zr(a),S=Mr(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),T=g||(S||!x?[Rh(a)]:L4(a)),A=C!=="none";!g&&A&&T.push(...D4(a,x,C,E));const M=[a,...T],L=await Cu(t,y),D=[];let U=((s=u.flip)==null?void 0:s.overflows)||[];if(p&&D.push(L[_]),f){const Y=T4(o,h,E);D.push(L[Y[0]],L[Y[1]])}if(U=[...U,{placement:o,overflows:D}],!D.every(Y=>Y<=0)){var z,W;const Y=(((z=u.flip)==null?void 0:z.index)||0)+1,$=M[Y];if($&&(!(f==="alignment"?v!==Zr($):!1)||U.every(H=>Zr(H.placement)===v?H.overflows[0]>0:!0)))return{data:{index:Y,overflows:U},reset:{placement:$}};let F=(W=U.filter(q=>q.overflows[0]<=0).sort((q,H)=>q.overflows[1]-H.overflows[1])[0])==null?void 0:W.placement;if(!F)switch(b){case"bestFit":{var N;const q=(N=U.filter(H=>{if(A){const P=Zr(H.placement);return P===v||P==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(P=>P>0).reduce((P,B)=>P+B,0)]).sort((H,P)=>H[1]-P[1])[0])==null?void 0:N[0];q&&(F=q);break}case"initialPlacement":F=a;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function Ux(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Wx(e){return w4.some(t=>e[t]>=0)}const hD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...o}=_i(e,t);switch(s){case"referenceHidden":{const u=await Cu(t,{...o,elementContext:"reference"}),h=Ux(u,n.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:Wx(h)}}}case"escaped":{const u=await Cu(t,{...o,altBoundary:!0}),h=Ux(u,n.floating);return{data:{escapedOffsets:h,escaped:Wx(h)}}}default:return{}}}}},EE=new Set(["left","top"]);async function pD(e,t){const{placement:n,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),h=Mr(n),a=vo(n),c=Zr(n)==="y",d=EE.has(h)?-1:1,p=u&&c?-1:1,f=_i(t,e);let{mainAxis:g,crossAxis:b,alignmentAxis:C}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof C=="number"&&(b=a==="end"?C*-1:C),c?{x:b*p,y:g*d}:{x:g*d,y:b*p}}const mD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:o,y:u,placement:h,middlewareData:a}=t,c=await pD(t,e);return h===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:u+c.y,data:{...c,placement:h}}}}},gD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:o}=t,{mainAxis:u=!0,crossAxis:h=!1,limiter:a={fn:y=>{let{x:_,y:v}=y;return{x:_,y:v}}},...c}=_i(e,t),d={x:n,y:s},p=await Cu(t,c),f=Zr(Mr(o)),g=Q_(f);let b=d[g],C=d[f];if(u){const y=g==="y"?"top":"left",_=g==="y"?"bottom":"right",v=b+p[y],S=b-p[_];b=Yv(v,b,S)}if(h){const y=f==="y"?"top":"left",_=f==="y"?"bottom":"right",v=C+p[y],S=C-p[_];C=Yv(v,C,S)}const x=a.fn({...t,[g]:b,[f]:C});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[g]:u,[f]:h}}}}}},vD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:o,rects:u,middlewareData:h}=t,{offset:a=0,mainAxis:c=!0,crossAxis:d=!0}=_i(e,t),p={x:n,y:s},f=Zr(o),g=Q_(f);let b=p[g],C=p[f];const x=_i(a,t),y=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const S=g==="y"?"height":"width",E=u.reference[g]-u.floating[S]+y.mainAxis,T=u.reference[g]+u.reference[S]-y.mainAxis;b<E?b=E:b>T&&(b=T)}if(d){var _,v;const S=g==="y"?"width":"height",E=EE.has(Mr(o)),T=u.reference[f]-u.floating[S]+(E&&((_=h.offset)==null?void 0:_[f])||0)+(E?0:y.crossAxis),A=u.reference[f]+u.reference[S]+(E?0:((v=h.offset)==null?void 0:v[f])||0)-(E?y.crossAxis:0);C<T?C=T:C>A&&(C=A)}return{[g]:b,[f]:C}}}},_D=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:o,rects:u,platform:h,elements:a}=t,{apply:c=()=>{},...d}=_i(e,t),p=await Cu(t,d),f=Mr(o),g=vo(o),b=Zr(o)==="y",{width:C,height:x}=u.floating;let y,_;f==="top"||f==="bottom"?(y=f,_=g===(await(h.isRTL==null?void 0:h.isRTL(a.floating))?"start":"end")?"left":"right"):(_=f,y=g==="end"?"top":"bottom");const v=x-p.top-p.bottom,S=C-p.left-p.right,E=Dl(x-p[y],v),T=Dl(C-p[_],S),A=!t.middlewareData.shift;let M=E,L=T;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=S),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(M=v),A&&!g){const U=Lr(p.left,0),z=Lr(p.right,0),W=Lr(p.top,0),N=Lr(p.bottom,0);b?L=C-2*(U!==0||z!==0?U+z:Lr(p.left,p.right)):M=x-2*(W!==0||N!==0?W+N:Lr(p.top,p.bottom))}await c({...t,availableWidth:L,availableHeight:M});const D=await h.getDimensions(a.floating);return C!==D.width||x!==D.height?{reset:{rects:!0}}:{}}}};function RE(e){const t=Dr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=Jt(e),u=o?e.offsetWidth:n,h=o?e.offsetHeight:s,a=Eh(n)!==u||Eh(s)!==h;return a&&(n=u,s=h),{width:n,height:s,$:a}}function r0(e){return jt(e)?e:e.contextElement}function wl(e){const t=r0(e);if(!Jt(t))return Ds(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:u}=RE(t);let h=(u?Eh(n.width):n.width)/s,a=(u?Eh(n.height):n.height)/o;return(!h||!Number.isFinite(h))&&(h=1),(!a||!Number.isFinite(a))&&(a=1),{x:h,y:a}}const yD=Ds(0);function kE(e){const t=xn(e);return!Jh()||!t.visualViewport?yD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xn(e)?!1:t}function _a(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),u=r0(e);let h=Ds(1);t&&(s?jt(s)&&(h=wl(s)):h=wl(e));const a=bD(u,n,s)?kE(u):Ds(0);let c=(o.left+a.x)/h.x,d=(o.top+a.y)/h.y,p=o.width/h.x,f=o.height/h.y;if(u){const g=xn(u),b=s&&jt(s)?xn(s):s;let C=g,x=Hv(C);for(;x&&s&&b!==C;){const y=wl(x),_=x.getBoundingClientRect(),v=Dr(x),S=_.left+(x.clientLeft+parseFloat(v.paddingLeft))*y.x,E=_.top+(x.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,d*=y.y,p*=y.x,f*=y.y,c+=S,d+=E,C=xn(x),x=Hv(C)}}return kh({width:p,height:f,x:c,y:d})}function op(e,t){const n=ep(e).scrollLeft;return t?t.left+n:_a(zs(e)).left+n}function TE(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-op(e,n),o=n.top+t.scrollTop;return{x:s,y:o}}function SD(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const u=o==="fixed",h=zs(s),a=t?Zh(t.floating):!1;if(s===h||a&&u)return n;let c={scrollLeft:0,scrollTop:0},d=Ds(1);const p=Ds(0),f=Jt(s);if((f||!f&&!u)&&((mo(s)!=="body"||ba(h))&&(c=ep(s)),Jt(s))){const b=_a(s);d=wl(s),p.x=b.x+s.clientLeft,p.y=b.y+s.clientTop}const g=h&&!f&&!u?TE(h,c):Ds(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+p.x+g.x,y:n.y*d.y-c.scrollTop*d.y+p.y+g.y}}function xD(e){return Array.from(e.getClientRects())}function CD(e){const t=zs(e),n=ep(e),s=e.ownerDocument.body,o=Lr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=Lr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let h=-n.scrollLeft+op(e);const a=-n.scrollTop;return Dr(s).direction==="rtl"&&(h+=Lr(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:h,y:a}}const qx=25;function wD(e,t){const n=xn(e),s=zs(e),o=n.visualViewport;let u=s.clientWidth,h=s.clientHeight,a=0,c=0;if(o){u=o.width,h=o.height;const p=Jh();(!p||p&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const d=op(s);if(d<=0){const p=s.ownerDocument,f=p.body,g=getComputedStyle(f),b=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,C=Math.abs(s.clientWidth-f.clientWidth-b);C<=qx&&(u-=C)}else d<=qx&&(u+=d);return{width:u,height:h,x:a,y:c}}const ED=new Set(["absolute","fixed"]);function RD(e,t){const n=_a(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,u=Jt(e)?wl(e):Ds(1),h=e.clientWidth*u.x,a=e.clientHeight*u.y,c=o*u.x,d=s*u.y;return{width:h,height:a,x:c,y:d}}function Gx(e,t,n){let s;if(t==="viewport")s=wD(e,n);else if(t==="document")s=CD(zs(e));else if(jt(t))s=RD(t,n);else{const o=kE(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return kh(s)}function LE(e,t){const n=js(e);return n===t||!jt(n)||Ms(n)?!1:Dr(n).position==="fixed"||LE(n,t)}function kD(e,t){const n=t.get(e);if(n)return n;let s=ao(e,[],!1).filter(a=>jt(a)&&mo(a)!=="body"),o=null;const u=Dr(e).position==="fixed";let h=u?js(e):e;for(;jt(h)&&!Ms(h);){const a=Dr(h),c=j_(h);!c&&a.position==="fixed"&&(o=null),(u?!c&&!o:!c&&a.position==="static"&&!!o&&ED.has(o.position)||ba(h)&&!c&&LE(e,h))?s=s.filter(p=>p!==h):o=a,h=js(h)}return t.set(e,s),s}function TD(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const h=[...n==="clippingAncestors"?Zh(t)?[]:kD(t,this._c):[].concat(n),s],a=h[0],c=h.reduce((d,p)=>{const f=Gx(t,p,o);return d.top=Lr(f.top,d.top),d.right=Dl(f.right,d.right),d.bottom=Dl(f.bottom,d.bottom),d.left=Lr(f.left,d.left),d},Gx(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function LD(e){const{width:t,height:n}=RE(e);return{width:t,height:n}}function AD(e,t,n){const s=Jt(t),o=zs(t),u=n==="fixed",h=_a(e,!0,u,t);let a={scrollLeft:0,scrollTop:0};const c=Ds(0);function d(){c.x=op(o)}if(s||!s&&!u)if((mo(t)!=="body"||ba(o))&&(a=ep(t)),s){const b=_a(t,!0,u,t);c.x=b.x+t.clientLeft,c.y=b.y+t.clientTop}else o&&d();u&&!s&&o&&d();const p=o&&!s&&!u?TE(o,a):Ds(0),f=h.left+a.scrollLeft-c.x-p.x,g=h.top+a.scrollTop-c.y-p.y;return{x:f,y:g,width:h.width,height:h.height}}function ov(e){return Dr(e).position==="static"}function $x(e,t){if(!Jt(e)||Dr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return zs(e)===n&&(n=n.ownerDocument.body),n}function AE(e,t){const n=xn(e);if(Zh(e))return n;if(!Jt(e)){let o=js(e);for(;o&&!Ms(o);){if(jt(o)&&!ov(o))return o;o=js(o)}return n}let s=$x(e,t);for(;s&&dM(s)&&ov(s);)s=$x(s,t);return s&&Ms(s)&&ov(s)&&!j_(s)?n:s||gM(e)||n}const OD=async function(e){const t=this.getOffsetParent||AE,n=this.getDimensions,s=await n(e.floating);return{reference:AD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function MD(e){return Dr(e).direction==="rtl"}const DD={convertOffsetParentRelativeRectToViewportRelativeRect:SD,getDocumentElement:zs,getClippingRect:TD,getOffsetParent:AE,getElementRects:OD,getClientRects:xD,getDimensions:LD,getScale:wl,isElement:jt,isRTL:MD};function OE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function PD(e,t){let n=null,s;const o=zs(e);function u(){var a;clearTimeout(s),(a=n)==null||a.disconnect(),n=null}function h(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),u();const d=e.getBoundingClientRect(),{left:p,top:f,width:g,height:b}=d;if(a||t(),!g||!b)return;const C=_l(f),x=_l(o.clientWidth-(p+g)),y=_l(o.clientHeight-(f+b)),_=_l(p),S={rootMargin:-C+"px "+-x+"px "+-y+"px "+-_+"px",threshold:Lr(0,Dl(1,c))||1};let E=!0;function T(A){const M=A[0].intersectionRatio;if(M!==c){if(!E)return h();M?h(!1,M):s=setTimeout(()=>{h(!1,1e-7)},1e3)}M===1&&!OE(d,e.getBoundingClientRect())&&h(),E=!1}try{n=new IntersectionObserver(T,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,S)}n.observe(e)}return h(!0),u}function Kx(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=r0(e),p=o||u?[...d?ao(d):[],...ao(t)]:[];p.forEach(_=>{o&&_.addEventListener("scroll",n,{passive:!0}),u&&_.addEventListener("resize",n)});const f=d&&a?PD(d,n):null;let g=-1,b=null;h&&(b=new ResizeObserver(_=>{let[v]=_;v&&v.target===d&&b&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var S;(S=b)==null||S.observe(t)})),n()}),d&&!c&&b.observe(d),b.observe(t));let C,x=c?_a(e):null;c&&y();function y(){const _=_a(e);x&&!OE(x,_)&&n(),x=_,C=requestAnimationFrame(y)}return n(),()=>{var _;p.forEach(v=>{o&&v.removeEventListener("scroll",n),u&&v.removeEventListener("resize",n)}),f?.(),(_=b)==null||_.disconnect(),b=null,c&&cancelAnimationFrame(C)}}const ID=mD,ND=gD,jD=fD,BD=_D,zD=hD,HD=vD,VD=(e,t,n)=>{const s=new Map,o={platform:DD,...n},u={...o.platform,_c:s};return dD(e,t,{...o,platform:u})};var FD=typeof document<"u",UD=function(){},ih=FD?k.useLayoutEffect:UD;function Oh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Oh(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!Oh(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function ME(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yx(e,t){const n=ME(e);return Math.round(t*n)/n}function av(e){const t=k.useRef(e);return ih(()=>{t.current=e}),t}function WD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:h}={},transform:a=!0,whileElementsMounted:c,open:d}=e,[p,f]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,b]=k.useState(s);Oh(g,s)||b(s);const[C,x]=k.useState(null),[y,_]=k.useState(null),v=k.useCallback(H=>{H!==A.current&&(A.current=H,x(H))},[]),S=k.useCallback(H=>{H!==M.current&&(M.current=H,_(H))},[]),E=u||C,T=h||y,A=k.useRef(null),M=k.useRef(null),L=k.useRef(p),D=c!=null,U=av(c),z=av(o),W=av(d),N=k.useCallback(()=>{if(!A.current||!M.current)return;const H={placement:t,strategy:n,middleware:g};z.current&&(H.platform=z.current),VD(A.current,M.current,H).then(P=>{const B={...P,isPositioned:W.current!==!1};Y.current&&!Oh(L.current,B)&&(L.current=B,Qn.flushSync(()=>{f(B)}))})},[g,t,n,z,W]);ih(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(H=>({...H,isPositioned:!1})))},[d]);const Y=k.useRef(!1);ih(()=>(Y.current=!0,()=>{Y.current=!1}),[]),ih(()=>{if(E&&(A.current=E),T&&(M.current=T),E&&T){if(U.current)return U.current(E,T,N);N()}},[E,T,N,U,D]);const $=k.useMemo(()=>({reference:A,floating:M,setReference:v,setFloating:S}),[v,S]),F=k.useMemo(()=>({reference:E,floating:T}),[E,T]),q=k.useMemo(()=>{const H={position:n,left:0,top:0};if(!F.floating)return H;const P=Yx(F.floating,p.x),B=Yx(F.floating,p.y);return a?{...H,transform:"translate("+P+"px, "+B+"px)",...ME(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:B}},[n,a,F.floating,p.x,p.y]);return k.useMemo(()=>({...p,update:N,refs:$,elements:F,floatingStyles:q}),[p,N,$,F,q])}const qD=(e,t)=>({...ID(e),options:[e,t]}),GD=(e,t)=>({...ND(e),options:[e,t]}),$D=(e,t)=>({...HD(e),options:[e,t]}),KD=(e,t)=>({...jD(e),options:[e,t]}),YD=(e,t)=>({...BD(e),options:[e,t]}),XD=(e,t)=>({...zD(e),options:[e,t]}),QD={intentional:"onClick",sloppy:"onPointerDown"};function ZD(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function ap(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingElement"),u=n.useState("referenceElement"),h=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:d=!0,escapeKey:p=!0,outsidePress:f=!0,outsidePressEvent:g="sloppy",referencePress:b=!1,referencePressEvent:C="sloppy",ancestorScroll:x=!1,bubbles:y,externalTree:_}=t,v=_o(_),S=De(typeof f=="function"?f:()=>!1),E=typeof f=="function"?S:f,T=k.useRef(!1),{escapeKey:A,outsidePress:M}=ZD(y),L=k.useRef(null),D=Qt(),U=Qt(),z=De(()=>{U.clear(),c.current.insideReactTree=!1}),W=k.useRef(!1),N=k.useRef(""),Y=De(ne=>{N.current=ne.pointerType}),$=De(()=>{const ne=N.current,oe=ne==="pen"||!ne?"mouse":ne,ce=typeof g=="function"?g():g;return typeof ce=="string"?ce:ce[oe]}),F=De(ne=>{if(!s||!d||!p||ne.key!=="Escape"||W.current)return;const oe=c.current.floatingContext?.nodeId,ce=v?la(v.nodesRef.current,oe):[];if(!A&&ce.length>0){let he=!0;if(ce.forEach(de=>{de.context?.open&&!de.context.dataRef.current.__escapeKeyBubbles&&(he=!1)}),!he)return}const ve=C4(ne)?ne.nativeEvent:ne,ge=Ue(np,ve);n.setOpen(!1,ge),!A&&!ge.isPropagationAllowed&&ne.stopPropagation()}),q=De(ne=>{const oe=$();return oe==="intentional"&&ne.type!=="click"||oe==="sloppy"&&ne.type==="click"}),H=De(()=>{c.current.insideReactTree=!0,U.start(0,z)}),P=De((ne,oe=!1)=>{if(q(ne)){z();return}if(c.current.insideReactTree){z();return}if($()==="intentional"&&oe||typeof E=="function"&&!E(ne))return;const ce=An(ne),ve=`[${Il("inert")}]`,ge=cn(n.select("floatingElement")).querySelectorAll(ve),he=n.context.triggerElements;if(ce&&(he.hasElement(ce)||he.hasMatchingElement(ye=>ft(ye,ce))))return;let de=jt(ce)?ce:null;for(;de&&!Ms(de);){const ye=js(de);if(Ms(ye)||!jt(ye))break;de=ye}if(ge.length&&jt(ce)&&!S4(ce)&&!ft(ce,n.select("floatingElement"))&&Array.from(ge).every(ye=>!ft(de,ye)))return;if(Jt(ce)&&!("touches"in ne)){const ye=Ms(ce),Ae=Dr(ce),ae=/auto|scroll/,be=ye||ae.test(Ae.overflowX),Ce=ye||ae.test(Ae.overflowY),We=be&&ce.clientWidth>0&&ce.scrollWidth>ce.clientWidth,rt=Ce&&ce.clientHeight>0&&ce.scrollHeight>ce.clientHeight,ze=Ae.direction==="rtl",Me=rt&&(ze?ne.offsetX<=ce.offsetWidth-ce.clientWidth:ne.offsetX>ce.clientWidth),He=We&&ne.offsetY>ce.clientHeight;if(Me||He)return}const Le=c.current.floatingContext?.nodeId,Oe=v&&la(v.nodesRef.current,Le).some(ye=>us(ne,ye.context?.elements.floating));if(us(ne,n.select("floatingElement"))||us(ne,n.select("domReferenceElement"))||Oe)return;const Ne=v?la(v.nodesRef.current,Le):[];if(Ne.length>0){let ye=!0;if(Ne.forEach(Ae=>{Ae.context?.open&&!Ae.context.dataRef.current.__outsidePressBubbles&&(ye=!1)}),!ye)return}n.setOpen(!1,Ue(G_,ne)),z()}),B=De(ne=>{$()!=="sloppy"||ne.pointerType==="touch"||!n.select("open")||!d||us(ne,n.select("floatingElement"))||us(ne,n.select("domReferenceElement"))||P(ne)}),I=De(ne=>{if($()!=="sloppy"||!n.select("open")||!d||us(ne,n.select("floatingElement"))||us(ne,n.select("domReferenceElement")))return;const oe=ne.touches[0];oe&&(L.current={startTime:Date.now(),startX:oe.clientX,startY:oe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),G=De(ne=>{const oe=An(ne);function ce(){I(ne),oe?.removeEventListener(ne.type,ce)}oe?.addEventListener(ne.type,ce)}),K=De(ne=>{const oe=T.current;if(T.current=!1,D.clear(),ne.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const ce=An(ne);function ve(){ne.type==="pointerdown"?B(ne):P(ne,oe),ce?.removeEventListener(ne.type,ve)}ce?.addEventListener(ne.type,ve)}),J=De(ne=>{if($()!=="sloppy"||!L.current||us(ne,n.select("floatingElement"))||us(ne,n.select("domReferenceElement")))return;const oe=ne.touches[0];if(!oe)return;const ce=Math.abs(oe.clientX-L.current.startX),ve=Math.abs(oe.clientY-L.current.startY),ge=Math.sqrt(ce*ce+ve*ve);ge>5&&(L.current.dismissOnTouchEnd=!0),ge>10&&(P(ne),D.clear(),L.current=null)}),Z=De(ne=>{const oe=An(ne);function ce(){J(ne),oe?.removeEventListener(ne.type,ce)}oe?.addEventListener(ne.type,ce)}),ee=De(ne=>{$()!=="sloppy"||!L.current||us(ne,n.select("floatingElement"))||us(ne,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&P(ne),D.clear(),L.current=null)}),X=De(ne=>{const oe=An(ne);function ce(){ee(ne),oe?.removeEventListener(ne.type,ce)}oe?.addEventListener(ne.type,ce)});k.useEffect(()=>{if(!s||!d)return;c.current.__escapeKeyBubbles=A,c.current.__outsidePressBubbles=M;const ne=new va;function oe(de){n.setOpen(!1,Ue(Pn,de))}function ce(){ne.clear(),W.current=!0}function ve(){ne.start(Jh()?5:0,()=>{W.current=!1})}const ge=cn(o);ge.addEventListener("pointerdown",Y,!0),p&&(ge.addEventListener("keydown",F),ge.addEventListener("compositionstart",ce),ge.addEventListener("compositionend",ve)),E&&(ge.addEventListener("click",K,!0),ge.addEventListener("pointerdown",K,!0),ge.addEventListener("touchstart",G,!0),ge.addEventListener("touchmove",Z,!0),ge.addEventListener("touchend",X,!0),ge.addEventListener("mousedown",K,!0));let he=[];return x&&(jt(h)&&(he=ao(h)),jt(o)&&(he=he.concat(ao(o))),!jt(u)&&u&&u.contextElement&&(he=he.concat(ao(u.contextElement)))),he=he.filter(de=>de!==ge.defaultView?.visualViewport),he.forEach(de=>{de.addEventListener("scroll",oe,{passive:!0})}),()=>{ge.removeEventListener("pointerdown",Y,!0),p&&(ge.removeEventListener("keydown",F),ge.removeEventListener("compositionstart",ce),ge.removeEventListener("compositionend",ve)),E&&(ge.removeEventListener("click",K,!0),ge.removeEventListener("pointerdown",K,!0),ge.removeEventListener("touchstart",G,!0),ge.removeEventListener("touchmove",Z,!0),ge.removeEventListener("touchend",X,!0),ge.removeEventListener("mousedown",K,!0)),he.forEach(de=>{de.removeEventListener("scroll",oe)}),ne.clear()}},[c,o,u,h,p,E,s,a,x,d,A,M,F,P,K,B,G,Z,X,Y,n]),k.useEffect(z,[E,z]);const V=k.useMemo(()=>({onKeyDown:F,...b&&{[QD[C]]:ne=>{n.setOpen(!1,Ue(oa,ne.nativeEvent))},...C!=="intentional"&&{onClick(ne){n.setOpen(!1,Ue(oa,ne.nativeEvent))}}}}),[F,n,b,C]),se=De(ne=>{const oe=An(ne.nativeEvent);!ft(n.select("floatingElement"),oe)||ne.button!==0||(T.current=!0)}),re=k.useMemo(()=>({onKeyDown:F,onPointerDown:se,onMouseDown:se,onMouseUp:se,onClickCapture:H,onMouseDownCapture:H,onPointerDownCapture:H,onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[F,se,H]);return k.useMemo(()=>d?{reference:V,floating:re,trigger:V}:{},[d,V,re])}var Mh=Symbol("NOT_FOUND");function JD(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function e6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function t6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${t}[${n}]`)}}var Xx=e=>Array.isArray(e)?e:[e];function n6(e){const t=Array.isArray(e[0])?e[0]:e;return t6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function r6(e,t){const n=[],{length:s}=e;for(let o=0;o<s;o++)n.push(e[o].apply(null,t));return n}function s6(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Mh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function i6(e,t){let n=[];function s(a){const c=n.findIndex(d=>t(a,d.key));if(c>-1){const d=n[c];return c>0&&(n.splice(c,1),n.unshift(d)),d.value}return Mh}function o(a,c){s(a)===Mh&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function u(){return n}function h(){n=[]}return{get:s,put:o,getEntries:u,clear:h}}var o6=(e,t)=>e===t;function a6(e){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:o}=n;for(let u=0;u<o;u++)if(!e(n[u],s[u]))return!1;return!0}}function l6(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=o6,maxSize:o=1,resultEqualityCheck:u}=n,h=a6(s);let a=0;const c=o<=1?s6(h):i6(o,h);function d(){let p=c.get(arguments);if(p===Mh){if(p=e.apply(null,arguments),a++,u){const g=c.getEntries().find(b=>u(b.value,p));g&&(p=g.value,a!==0&&a--)}c.put(arguments,p)}return p}return d.clearCache=()=>{c.clear(),d.resetResultsCount()},d.resultsCount=()=>a,d.resetResultsCount=()=>{a=0},d}var c6=class{constructor(e){this.value=e}deref(){return this.value}},u6=typeof WeakRef<"u"?WeakRef:c6,d6=0,Qx=1;function Nf(){return{s:d6,v:void 0,o:null,p:null}}function DE(e,t={}){let n=Nf();const{resultEqualityCheck:s}=t;let o,u=0;function h(){let a=n;const{length:c}=arguments;for(let f=0,g=c;f<g;f++){const b=arguments[f];if(typeof b=="function"||typeof b=="object"&&b!==null){let C=a.o;C===null&&(a.o=C=new WeakMap);const x=C.get(b);x===void 0?(a=Nf(),C.set(b,a)):a=x}else{let C=a.p;C===null&&(a.p=C=new Map);const x=C.get(b);x===void 0?(a=Nf(),C.set(b,a)):a=x}}const d=a;let p;if(a.s===Qx)p=a.v;else if(p=e.apply(null,arguments),u++,s){const f=o?.deref?.()??o;f!=null&&s(f,p)&&(p=f,u!==0&&u--),o=typeof p=="object"&&p!==null||typeof p=="function"?new u6(p):p}return d.s=Qx,d.v=p,p}return h.clearCache=()=>{n=Nf(),h.resetResultsCount()},h.resultsCount=()=>u,h.resetResultsCount=()=>{u=0},h}function PE(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...o)=>{let u=0,h=0,a,c={},d=o.pop();typeof d=="object"&&(c=d,d=o.pop()),JD(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const p={...n,...c},{memoize:f,memoizeOptions:g=[],argsMemoize:b=DE,argsMemoizeOptions:C=[]}=p,x=Xx(g),y=Xx(C),_=n6(o),v=f(function(){return u++,d.apply(null,arguments)},...x),S=b(function(){h++;const T=r6(_,arguments);return a=v.apply(null,T),a},...y);return Object.assign(S,{resultFunc:d,memoizedResultFunc:v,dependencies:_,dependencyRecomputations:()=>h,resetDependencyRecomputations:()=>{h=0},lastResult:()=>a,recomputations:()=>u,resetRecomputations:()=>{u=0},memoize:f,argsMemoize:b})};return Object.assign(s,{withTypes:()=>s}),s}var f6=PE(DE),h6=Object.assign((e,t=f6)=>{e6(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(u=>e[u]);return t(s,(...u)=>u.reduce((h,a,c)=>(h[n[c]]=a,h),{}))},{withTypes:()=>h6});PE({memoize:l6,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const xe=(e,t,n,s,o,u,...h)=>{if(h.length>0)throw new Error(It(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var p6=qw();const m6=z_(19),g6=m6?v6:_6;function Te(e,t,n,s,o){return g6(e,t,n,s,o)}function v6(e,t,n,s,o){const u=k.useCallback(()=>t(e.getSnapshot(),n,s,o),[e,t,n,s,o]);return p6.useSyncExternalStore(e.subscribe,u,u)}function _6(e,t,n,s,o){return Gw.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,u=>t(u,n,s,o))}class ca{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const s of this.listeners){if(n!==this.updateTick)return;s(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){ca.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||ca.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};ca.prototype.setState.call(this,t)}}class s0 extends ca{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}controlledValues=new Map;useSyncedValue(t,n){k.useDebugValue(t),je(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){je(()=>(this.state[t]!==n&&this.set(t,n),()=>{this.set(t,void 0)}),[t,n])}useSyncedValues(t){const n=Object.values(t);je(()=>{this.update(t)},n)}useControlledProp(t,n,s){k.useDebugValue(t);const o=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,o),!o&&!Object.is(this.state[t],s)&&super.setState({...this.state,[t]:s})),je(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,s,o])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.update(n)}setState(t){const n={...t};for(const s in n)if(Object.hasOwn(n,s)&&this.controlledValues.get(s)===!0){delete n[s];continue}super.setState({...this.state,...n})}select=(t,n,s,o)=>{const u=this.selectors[t];return u(this.state,n,s,o)};useState=(t,n,s,o)=>{k.useDebugValue(t);const u=this.selectors[t];return Te(this,u,n,s,o)};useContextCallback(t,n){k.useDebugValue(t);const s=De(n??rn);this.context[t]=s}useStateSetter(t){const n=k.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(t,s)}),n.current}observe(t,n){let s;typeof t=="function"?s=t:s=this.selectors[t];let o=s(this.state);return n(o,o,this),this.subscribe(u=>{const h=s(u);if(!Object.is(o,h)){const a=o;o=h,n(h,a,this)}})}}const y6={open:xe(e=>e.open),domReferenceElement:xe(e=>e.domReferenceElement),referenceElement:xe(e=>e.positionReference??e.referenceElement),floatingElement:xe(e=>e.floatingElement),floatingId:xe(e=>e.floatingId)};class i0 extends s0{constructor(t){const{nested:n,noEmit:s,onOpenChange:o,triggerElements:u,...h}=t;super({...h,positionReference:h.referenceElement,domReferenceElement:h.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:_E(),nested:n,noEmit:s,triggerElements:u},y6)}setOpen=(t,n)=>{if((!t||!this.state.open||nE(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const s={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",s)}this.context.onOpenChange?.(t,n)}}function xi(e,t=!1,n=!1){const[s,o]=k.useState(e&&t?"idle":void 0),[u,h]=k.useState(e);return e&&!u&&(h(!0),o("starting")),!e&&u&&s!=="ending"&&!n&&o("ending"),!e&&!u&&s==="ending"&&o(void 0),je(()=>{if(!e&&u&&s!=="ending"&&n){const a=Ts.request(()=>{o("ending")});return()=>{Ts.cancel(a)}}},[e,u,s,n]),je(()=>{if(!e||t)return;const a=Ts.request(()=>{o(void 0)});return()=>{Ts.cancel(a)}},[t,e]),je(()=>{if(!e||!t)return;e&&u&&s!=="idle"&&o("starting");const a=Ts.request(()=>{o("idle")});return()=>{Ts.cancel(a)}},[t,e,u,o,s]),k.useMemo(()=>({mounted:u,setMounted:h,transitionStatus:s}),[u,s])}function b6(e,t=!1,n=!0){const s=Hu();return De((o,u=null)=>{s.cancel();const h=Uo(e);h!=null&&(typeof h.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?o():s.request(()=>{function a(){h&&Promise.all(h.getAnimations().map(c=>c.finished)).then(()=>{u!=null&&u.aborted||Qn.flushSync(o)}).catch(()=>{if(n){if(u!=null&&u.aborted)return;Qn.flushSync(o)}else h.getAnimations().length>0&&h.getAnimations().some(c=>c.pending||c.playState!=="finished")&&a()})}t?s.request(a):a()}))})}function Br(e){const{enabled:t=!0,open:n,ref:s,onComplete:o}=e,u=dn(n),h=De(o),a=b6(s,n);k.useEffect(()=>{t&&a(()=>{n===u.current&&h()})},[t,n,h,a,u])}function S6(e,t){const n=k.useRef(null);return k.useCallback(s=>{e!==void 0&&(n.current!==null&&(t.context.triggerElements.delete(n.current),n.current=null),s!==null&&(n.current=e,t.context.triggerElements.add(e,s)))},[t,e])}function IE(e,t,n,s){const o=n.useState("isMountedByTrigger",e),u=S6(e,n),h=De(a=>{u(a),a!==null&&n.select("open")&&n.select("activeTriggerId")==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...s})});return je(()=>{o&&n.update({activeTriggerElement:t.current,...s})},[o,n,t,...Object.values(s)]),{registerTrigger:h,isMountedByThisTrigger:o}}function NE(e){const t=e.useState("open");je(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[s,o]=n.value;e.update({activeTriggerId:s,activeTriggerElement:o})}}},[t,e])}function jE(e,t,n){const{mounted:s,setMounted:o,transitionStatus:u}=xi(e);t.useSyncedValues({mounted:s,transitionStatus:u});const h=De(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Br({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||h()}}),{forceUnmount:h,transitionStatus:u}}class lp{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const s=this.idMap.get(t);s!==n&&(s!==void 0&&this.elements.delete(s),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function x6(){return new i0({open:!1,floatingElement:null,referenceElement:null,triggerElements:new lp,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function BE(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:x6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:en,inactiveTriggerProps:en,popupProps:en}}const zE={open:xe(e=>e.open),mounted:xe(e=>e.mounted),transitionStatus:xe(e=>e.transitionStatus),floatingRootContext:xe(e=>e.floatingRootContext),preventUnmountingOnClose:xe(e=>e.preventUnmountingOnClose),payload:xe(e=>e.payload),activeTriggerId:xe(e=>e.activeTriggerId),activeTriggerElement:xe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:xe((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:xe((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:xe((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:xe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:xe(e=>e.popupProps),popupElement:xe(e=>e.popupElement),positionerElement:xe(e=>e.positionerElement)};function o0(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,o=Sa(),u=Si()!=null,h=Wn(()=>new i0({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:s.triggers??new lp,floatingId:o,nested:u,noEmit:e.noEmit||!1})).current;return je(()=>{const a={open:t,floatingId:o};s.reference!==void 0&&(a.referenceElement=s.reference,a.domReferenceElement=jt(s.reference)?s.reference:null),s.floating!==void 0&&(a.floatingElement=s.floating),h.update(a)},[t,o,s.reference,s.floating,h]),h.context.onOpenChange=n,h.context.nested=u,h.context.noEmit=e.noEmit||!1,h}function C6(e={}){const{nodeId:t,externalTree:n}=e,s=o0(e),o=e.rootContext||s,u={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[h,a]=k.useState(null),c=k.useRef(null),d=_o(n);je(()=>{u.domReference&&(c.current=u.domReference)},[u.domReference]);const p=WD({...e,elements:{...u,...h&&{reference:h}}}),f=k.useCallback(M=>{const L=jt(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;a(L),p.refs.setReference(L)},[p.refs]),[g,b]=k.useState(null),[C,x]=k.useState(null);o.useSyncedValue("referenceElement",g),o.useSyncedValue("domReferenceElement",jt(g)?g:null),o.useSyncedValue("floatingElement",C);const y=k.useCallback(M=>{(jt(M)||M===null)&&(c.current=M,b(M)),(jt(p.refs.reference.current)||p.refs.reference.current===null||M!==null&&!jt(M))&&p.refs.setReference(M)},[p.refs,b]),_=k.useCallback(M=>{x(M),p.refs.setFloating(M)},[p.refs]),v=k.useMemo(()=>({...p.refs,setReference:y,setFloating:_,setPositionReference:f,domReference:c}),[p.refs,y,_,f]),S=k.useMemo(()=>({...p.elements,domReference:u.domReference}),[p.elements,u.domReference]),E=o.useState("open"),T=o.useState("floatingId"),A=k.useMemo(()=>({...p,dataRef:o.context.dataRef,open:E,onOpenChange:o.setOpen,events:o.context.events,floatingId:T,refs:v,elements:S,nodeId:t,rootStore:o}),[p,v,S,t,o,E,T]);return je(()=>{o.context.dataRef.current.floatingContext=A;const M=d?.nodesRef.current.find(L=>L.id===t);M&&(M.context=A)}),k.useMemo(()=>({...p,context:A,refs:v,elements:S,rootStore:o}),[p,v,S,A,o])}function HE(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:o}=e,u=Sa(),h=Si()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),d=t.useState(s?"popupElement":"positionerElement"),p=t.context.triggerElements,f=Wn(()=>new i0({open:a,referenceElement:c,floatingElement:d,triggerElements:p,onOpenChange:o,floatingId:u,nested:h,noEmit:n})).current;return je(()=>{const g={open:a,floatingId:u,referenceElement:c,floatingElement:d};jt(c)&&(g.domReferenceElement=c),f.update(g)},[a,u,c,d,f]),f.context.onOpenChange=o,f.context.nested=h,f.context.noEmit=n,f}const lv=v4&&Y2;function w6(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:s,dataRef:o}=n.context,{enabled:u=!0,visibleOnly:h=!0}=t,a=k.useRef(!1),c=Qt(),d=k.useRef(!0);k.useEffect(()=>{const f=n.select("domReferenceElement");if(!u)return;const g=xn(f);function b(){!n.select("open")&&Jt(f)&&f===ds(cn(f))&&(a.current=!0)}function C(){d.current=!0}function x(){d.current=!1}return g.addEventListener("blur",b),lv&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",x,!0)),()=>{g.removeEventListener("blur",b),lv&&(g.removeEventListener("keydown",C,!0),g.removeEventListener("pointerdown",x,!0))}},[n,u]),k.useEffect(()=>{if(!u)return;function f(g){(g.reason===oa||g.reason===np)&&(a.current=!0)}return s.on("openchange",f),()=>{s.off("openchange",f)}},[s,u]);const p=k.useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(f){if(a.current)return;const g=An(f.nativeEvent);if(h&&jt(g)){if(lv&&!f.relatedTarget){if(!d.current&&!X_(g))return}else if(!x4(g))return}n.setOpen(!0,Ue(Ch,f.nativeEvent,f.currentTarget))},onBlur(f){a.current=!1;const g=f.relatedTarget,b=f.nativeEvent,C=jt(g)&&g.hasAttribute(Il("focus-guard"))&&g.getAttribute("data-type")==="outside";c.start(0,()=>{const x=n.select("domReferenceElement"),y=ds(x?x.ownerDocument:document);!g&&y===x||ft(o.current.floatingContext?.refs.floating.current,y)||ft(x,y)||C||n.context.triggerElements.hasElement(f.relatedTarget)||n.setOpen(!1,Ue(Ch,b))})}}),[o,n,h,c]);return k.useMemo(()=>u?{reference:p,trigger:p}:{},[u,p])}const e_=Il("safe-polygon"),E6=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${J2}`;function R6(e){return e?!!e.closest(E6):!1}function VE(e){const t=k.useRef(void 0),n=k.useRef(!1),s=k.useRef(void 0),o=k.useRef(!0),u=k.useRef(!1),h=k.useRef(()=>{}),a=k.useRef(!1),c=Qt(),d=Qt(),p=k.useRef(void 0);return k.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:s,blockMouseMoveRef:o,performedPointerEventsMutationRef:u,unbindMouseMoveRef:h,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:d,handleCloseOptionsRef:p}),f.hoverInteractionState},[e,t,n,s,o,u,h,a,c,d,p])}const k6=new Set(["click","mousedown"]);function T6(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingElement"),u=n.useState("domReferenceElement"),{dataRef:h}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:d}=t,{pointerTypeRef:p,interactedInsideRef:f,handlerRef:g,performedPointerEventsMutationRef:b,unbindMouseMoveRef:C,restTimeoutPendingRef:x,openChangeTimeout:y,handleCloseOptionsRef:_}=VE(n),v=_o(d),S=Si(),E=De(()=>f.current?!0:h.current.openEvent?k6.has(h.current.openEvent.type):!1),T=De(()=>{const U=h.current.openEvent?.type;return U?.includes("mouse")&&U!=="mousedown"}),A=k.useCallback((U,z=!0)=>{const W=L6(c,p.current);W&&!g.current?y.start(W,()=>n.setOpen(!1,Ue(Or,U))):z&&(y.clear(),n.setOpen(!1,Ue(Or,U)))},[c,g,n,p,y]),M=De(()=>{C.current(),g.current=void 0}),L=De(()=>{if(b.current){const U=cn(o).body;U.style.pointerEvents="",U.removeAttribute(e_),b.current=!1}}),D=De(U=>{const z=An(U);if(!R6(z)){f.current=!1;return}f.current=!0});je(()=>{s||(p.current=void 0,x.current=!1,f.current=!1,M(),L())},[s,p,x,f,M,L]),k.useEffect(()=>()=>{M()},[M]),k.useEffect(()=>L,[L]),je(()=>{if(a&&s&&_.current?.blockPointerEvents&&T()&&jt(u)&&o){b.current=!0;const U=cn(o).body;U.setAttribute(e_,"");const z=u,W=o,N=v?.nodesRef.current.find(Y=>Y.id===S)?.context?.elements.floating;return N&&(N.style.pointerEvents=""),U.style.pointerEvents="none",z.style.pointerEvents="auto",W.style.pointerEvents="auto",()=>{U.style.pointerEvents="",z.style.pointerEvents="",W.style.pointerEvents=""}}},[a,s,u,o,_,T,v,S,b]),k.useEffect(()=>{if(!a)return;function U(Y){if(E()||!h.current.floatingContext||!n.select("open"))return;const $=n.context.triggerElements;Y.relatedTarget&&$.hasElement(Y.relatedTarget)||(L(),M(),E()||A(Y))}function z(Y){y.clear(),L(),g.current?.(Y),M()}function W(Y){E()||A(Y,!1)}const N=o;return N&&(N.addEventListener("mouseleave",U),N.addEventListener("mouseenter",z),N.addEventListener("mouseleave",W),N.addEventListener("pointerdown",D,!0)),()=>{N&&(N.removeEventListener("mouseleave",U),N.removeEventListener("mouseenter",z),N.removeEventListener("mouseleave",W),N.removeEventListener("pointerdown",D,!0))}})}function L6(e,t){return t&&!Ml(t)?0:typeof e=="function"?e():e}function cv(e){return typeof e=="function"?e():e}const A6={current:null};function O6(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:s,events:o}=n.context,{enabled:u=!0,delay:h=0,handleClose:a=null,mouseOnly:c=!1,restMs:d=0,move:p=!0,triggerElementRef:f=A6,externalTree:g,isActiveTrigger:b=!0}=t,C=_o(g),{pointerTypeRef:x,interactedInsideRef:y,handlerRef:_,blockMouseMoveRef:v,performedPointerEventsMutationRef:S,unbindMouseMoveRef:E,restTimeoutPendingRef:T,openChangeTimeout:A,restTimeout:M,handleCloseOptionsRef:L}=VE(n),D=dn(a),U=dn(h),z=dn(d);b&&(L.current=D.current?.__options);const W=De(()=>y.current?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),N=k.useCallback((q,H=!0)=>{const P=rv(U.current,"close",x.current);P&&!_.current?A.start(P,()=>n.setOpen(!1,Ue(Or,q))):H&&(A.clear(),n.setOpen(!1,Ue(Or,q)))},[U,_,n,x,A]),Y=De(()=>{E.current(),_.current=void 0}),$=De(()=>{if(S.current){const q=cn(n.select("domReferenceElement")).body;q.style.pointerEvents="",q.removeAttribute(e_),S.current=!1}});k.useEffect(()=>{if(!u)return;function q(H){H.open||(A.clear(),M.clear(),v.current=!0,T.current=!1)}return o.on("openchange",q),()=>{o.off("openchange",q)}},[u,o,A,M,v,T]);const F=De(q=>{if(W()||!s.current.floatingContext)return;const H=n.context.triggerElements;if(q.relatedTarget&&H.hasElement(q.relatedTarget))return;const P=f.current;D.current?.({...s.current.floatingContext,tree:C,x:q.clientX,y:q.clientY,onClose(){$(),Y(),!W()&&P===n.select("domReferenceElement")&&N(q)}})(q)});return k.useEffect(()=>{if(!u)return;const q=f.current??(b?n.select("domReferenceElement"):null);if(!jt(q))return;function H(I){if(A.clear(),v.current=!1,c&&!Ml(x.current)||cv(z.current)>0&&!rv(U.current,"open"))return;const G=rv(U.current,"open",x.current),K=n.select("domReferenceElement"),J=n.context.triggerElements,Z=(J.hasElement(I.target)||J.hasMatchingElement(V=>ft(V,I.target)))&&(!K||!ft(K,I.target)),ee=I.currentTarget??null,X=!n.select("open")||Z;G?A.start(G,()=>{X&&n.setOpen(!0,Ue(Or,I,ee))}):X&&n.setOpen(!0,Ue(Or,I,ee))}function P(I){if(W()){$();return}E.current();const G=n.select("domReferenceElement"),K=cn(G);M.clear(),T.current=!1;const J=n.context.triggerElements;if(I.relatedTarget&&J.hasElement(I.relatedTarget))return;if(D.current&&s.current.floatingContext){n.select("open")||A.clear();const ee=f.current;_.current=D.current({...s.current.floatingContext,tree:C,x:I.clientX,y:I.clientY,onClose(){$(),Y(),!W()&&ee===n.select("domReferenceElement")&&N(I,!0)}});const X=_.current;X(I),K.addEventListener("mousemove",X),E.current=()=>{K.removeEventListener("mousemove",X)};return}(x.current!=="touch"||!ft(n.select("floatingElement"),I.relatedTarget))&&N(I)}function B(I){F(I)}return n.select("open")&&q.addEventListener("mouseleave",B),p&&q.addEventListener("mousemove",H,{once:!0}),q.addEventListener("mouseenter",H),q.addEventListener("mouseleave",P),()=>{q.removeEventListener("mouseleave",B),p&&q.removeEventListener("mousemove",H),q.removeEventListener("mouseenter",H),q.removeEventListener("mouseleave",P)}},[Y,$,v,s,U,N,n,u,D,F,b,W,c,p,x,z,M,T,A,f,C,E,_]),k.useMemo(()=>{function q(H){x.current=H.pointerType}return{onPointerDown:q,onPointerEnter:q,onMouseMove(H){const{nativeEvent:P}=H,B=H.currentTarget,I=n.select("domReferenceElement"),G=n.context.triggerElements,K=n.select("open"),J=(G.hasElement(H.target)||G.hasMatchingElement(ee=>ft(ee,H.target)))&&(!I||!ft(I,H.target));if(c&&!Ml(x.current)||K&&!J||cv(z.current)===0||!J&&T.current&&H.movementX**2+H.movementY**2<2)return;M.clear();function Z(){!v.current&&(!K||J)&&n.setOpen(!0,Ue(Or,P,B))}x.current==="touch"?Qn.flushSync(()=>{Z()}):J&&K?Z():(T.current=!0,M.start(cv(z.current),Z))}}},[v,c,n,x,z,M,T])}function Kl(e=[]){const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),s=e.map(d=>d?.item),o=e.map(d=>d?.trigger),u=k.useCallback(d=>jf(d,e,"reference"),t),h=k.useCallback(d=>jf(d,e,"floating"),n),a=k.useCallback(d=>jf(d,e,"item"),s),c=k.useCallback(d=>jf(d,e,"trigger"),o);return k.useMemo(()=>({getReferenceProps:u,getFloatingProps:h,getItemProps:a,getTriggerProps:c}),[u,h,a,c])}function jf(e,t,n){const s=new Map,o=n==="item",u={};n==="floating"&&(u.tabIndex=-1,u[$v]="");for(const h in e)o&&e&&(h===Q2||h===Z2)||(u[h]=e[h]);for(let h=0;h<t.length;h+=1){let a;const c=t[h]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&Zx(u,a,o,s)}return Zx(u,e,o,s),u}function Zx(e,t,n,s){for(const o in t){const u=t[o];n&&(o===Q2||o===Z2)||(o.startsWith("on")?(s.has(o)||s.set(o,[]),typeof u=="function"&&(s.get(o)?.push(u),e[o]=(...h)=>s.get(o)?.map(a=>a(...h)).find(a=>a!==void 0))):e[o]=u)}}const M6="Escape";function cp(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Bf(e,t){return cp(t,e===Y_||e===Bu,e===lo||e===co)}function uv(e,t,n){return cp(t,e===Bu,n?e===lo:e===co)||e==="Enter"||e===" "||e===""}function D6(e,t,n){return cp(t,n?e===lo:e===co,e===Bu)}function P6(e,t,n,s){const o=n?e===co:e===lo,u=e===Y_;return t==="both"||t==="horizontal"&&s&&s>1?e===M6:cp(t,o,u)}function a0(e,t){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingElement"),u=n.useState("domReferenceElement"),h=n.context.dataRef,{listRef:a,activeIndex:c,onNavigate:d=()=>{},enabled:p=!0,selectedIndex:f=null,allowEscape:g=!1,loopFocus:b=!1,nested:C=!1,rtl:x=!1,virtual:y=!1,focusItemOnOpen:_="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:S=!0,disabledIndices:E=void 0,orientation:T="vertical",parentOrientation:A,cols:M=1,scrollItemIntoView:L=!0,itemSizes:D,dense:U=!1,id:z,resetOnPointerLeave:W=!0,externalTree:N}=t,Y=Su(o),$=dn(Y),F=Si(),q=_o(N);je(()=>{h.current.orientation=T},[h,T]);const H=Kv(u),P=k.useRef(_),B=k.useRef(f??-1),I=k.useRef(null),G=k.useRef(!0),K=De(ae=>{d(B.current===-1?null:B.current,ae)}),J=k.useRef(K),Z=k.useRef(!!o),ee=k.useRef(s),X=k.useRef(!1),V=k.useRef(!1),se=dn(E),re=dn(s),ne=dn(L),oe=dn(f),ce=dn(W),ve=De(()=>{function ae(rt){y?q?.events.emit("virtualfocus",rt):sh(rt,{sync:X.current,preventScroll:!0})}const be=a.current[B.current],Ce=V.current;be&&ae(be),(X.current?rt=>rt():requestAnimationFrame)(()=>{const rt=a.current[B.current]||be;if(!rt)return;be||ae(rt);const ze=ne.current;ze&&he&&(Ce||!G.current)&&rt.scrollIntoView?.(typeof ze=="boolean"?{block:"nearest",inline:"nearest"}:ze)})});je(()=>{p&&(s&&o?(B.current=f??-1,P.current&&f!=null&&(V.current=!0,K())):Z.current&&(B.current=-1,J.current()))},[p,s,o,f,K]),je(()=>{if(p){if(!s){X.current=!1;return}if(o)if(c==null){if(X.current=!1,oe.current!=null)return;if(Z.current&&(B.current=-1,ve()),(!ee.current||!Z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let ae=0;const be=()=>{a.current[0]==null?(ae<2&&(ae?requestAnimationFrame:queueMicrotask)(be),ae+=1):(B.current=I.current==null||uv(I.current,T,x)||C?rh(a):Qv(a),I.current=null,K())};be()}}else Sl(a,c)||(B.current=c,ve(),V.current=!1)}},[p,s,o,c,oe,C,a,T,x,K,ve,se]),je(()=>{if(!p||o||!q||y||!Z.current)return;const ae=q.nodesRef.current,be=ae.find(rt=>rt.id===F)?.context?.elements.floating,Ce=ds(cn(o)),We=ae.some(rt=>rt.context&&ft(rt.context.elements.floating,Ce));be&&!We&&G.current&&be.focus({preventScroll:!0})},[p,o,q,F,y]),je(()=>{J.current=K,ee.current=s,Z.current=!!o}),je(()=>{s||(I.current=null,P.current=_)},[s,_]);const ge=c!=null,he=k.useMemo(()=>{function ae(Ce){if(!re.current)return;const We=a.current.indexOf(Ce.currentTarget);We!==-1&&B.current!==We&&(B.current=We,K(Ce))}return{onFocus(Ce){X.current=!0,ae(Ce)},onClick:({currentTarget:Ce})=>Ce.focus({preventScroll:!0}),onMouseMove(Ce){X.current=!0,V.current=!1,v&&ae(Ce)},onPointerLeave(Ce){if(!re.current||!G.current||Ce.pointerType==="touch")return;X.current=!0;const We=Ce.relatedTarget;!v||a.current.includes(We)||ce.current&&(B.current=-1,K(Ce),y||$.current?.focus({preventScroll:!0}))}}},[re,$,v,a,K,ce,y]),de=k.useCallback(()=>A??q?.nodesRef.current.find(ae=>ae.id===F)?.context?.dataRef?.current.orientation,[F,q,A]),Le=De(ae=>{if(G.current=!1,X.current=!0,ae.which===229||!re.current&&ae.currentTarget===$.current)return;if(C&&P6(ae.key,T,x,M)){Bf(ae.key,de())||un(ae),n.setOpen(!1,Ue(hu,ae.nativeEvent)),Jt(u)&&(y?q?.events.emit("virtualfocus",u):u.focus());return}const be=B.current,Ce=rh(a,E),We=Qv(a,E);if(H||(ae.key==="Home"&&(un(ae),B.current=Ce,K(ae)),ae.key==="End"&&(un(ae),B.current=We,K(ae))),M>1){const rt=D||Array.from({length:a.current.length},()=>({width:1,height:1})),ze=iE(rt,M,U),Me=ze.findIndex($e=>$e!=null&&!uo(a,$e,E)),He=ze.reduce(($e,et,Re)=>et!=null&&!uo(a,et,E)?Re:$e,-1),dt=ze[sE({current:ze.map($e=>$e!=null?a.current[$e]:null)},{event:ae,orientation:T,loopFocus:b,rtl:x,cols:M,disabledIndices:aE([...(typeof E!="function"?E:null)||a.current.map(($e,et)=>uo(a,et,E)?et:void 0),void 0],ze),minIndex:Me,maxIndex:He,prevIndex:oE(B.current>We?Ce:B.current,rt,ze,M,ae.key===Bu?"bl":ae.key===(x?lo:co)?"tr":"tl"),stopEvent:!0})];if(dt!=null&&(B.current=dt,K(ae)),T==="both")return}if(Bf(ae.key,T)){if(un(ae),s&&!y&&ds(ae.currentTarget.ownerDocument)===ae.currentTarget){B.current=uv(ae.key,T,x)?Ce:We,K(ae);return}uv(ae.key,T,x)?b?be>=We?g&&be!==a.current.length?B.current=-1:(X.current=!1,B.current=Ce):B.current=Un(a,{startingIndex:be,disabledIndices:E}):B.current=Math.min(We,Un(a,{startingIndex:be,disabledIndices:E})):b?be<=Ce?g&&be!==-1?B.current=a.current.length:(X.current=!1,B.current=We):B.current=Un(a,{startingIndex:be,decrement:!0,disabledIndices:E}):B.current=Math.max(Ce,Un(a,{startingIndex:be,decrement:!0,disabledIndices:E})),Sl(a,B.current)&&(B.current=-1),K(ae)}}),Oe=k.useMemo(()=>y&&s&&ge&&{"aria-activedescendant":`${z}-${c}`},[y,s,ge,z,c]),Ne=k.useMemo(()=>({"aria-orientation":T==="both"?void 0:T,...H?{}:Oe,onKeyDown(ae){if(ae.key==="Tab"&&ae.shiftKey&&s&&!y){const be=An(ae.nativeEvent);if(be&&!ft($.current,be))return;un(ae),n.setOpen(!1,Ue(ga,ae.nativeEvent)),Jt(u)&&u.focus();return}Le(ae)},onPointerMove(){G.current=!0}}),[Oe,Le,$,T,H,n,s,y,u]),ye=k.useMemo(()=>{function ae(Ce){_==="auto"&&eE(Ce.nativeEvent)&&(P.current=!y)}function be(Ce){P.current=_,_==="auto"&&tE(Ce.nativeEvent)&&(P.current=!0)}return{onKeyDown(Ce){const We=n.select("open");G.current=!1;const rt=Ce.key.startsWith("Arrow"),ze=D6(Ce.key,de(),x),Me=Bf(Ce.key,T),He=(C?ze:Me)||Ce.key==="Enter"||Ce.key.trim()==="";if(y&&We)return Le(Ce);if(!(!We&&!S&&rt)){if(He){const dt=Bf(Ce.key,de());I.current=C&&dt?null:Ce.key}if(C){ze&&(un(Ce),We?(B.current=rh(a,se.current),K(Ce)):n.setOpen(!0,Ue(hu,Ce.nativeEvent,Ce.currentTarget)));return}Me&&(oe.current!=null&&(B.current=oe.current),un(Ce),!We&&S?n.setOpen(!0,Ue(hu,Ce.nativeEvent,Ce.currentTarget)):Le(Ce),We&&K(Ce))}},onFocus(Ce){n.select("open")&&!y&&(B.current=-1,K(Ce))},onPointerDown:be,onPointerEnter:be,onMouseDown:ae,onClick:ae}},[Le,se,_,a,C,K,n,S,T,de,x,oe,y]),Ae=k.useMemo(()=>({...Oe,...ye}),[Oe,ye]);return k.useMemo(()=>p?{reference:Ae,floating:Ne,item:he,trigger:ye}:{},[p,Ae,Ne,ye,he])}const I6=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function FE(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.useState("floatingId"),u=n.useState("domReferenceElement"),h=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,d=Sa(),p=u?.id||d,f=k.useMemo(()=>Su(h)?.id||o,[h,o]),g=I6.get(c)??c,C=Si()!=null,x=k.useMemo(()=>g==="tooltip"||c==="label"?en:{"aria-haspopup":g==="alertdialog"?"dialog":g,"aria-expanded":"false",...g==="listbox"&&{role:"combobox"},...g==="menu"&&C&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[g,C,c]),y=k.useMemo(()=>g==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:s?f:void 0}:{...x,"aria-expanded":s?"true":"false","aria-controls":s?f:void 0,...g==="menu"&&{id:p}},[g,f,s,p,c,x]),_=k.useMemo(()=>{const S={id:f,...g&&{role:g}};return g==="tooltip"||c==="label"?S:{...S,...g==="menu"&&{"aria-labelledby":p}}},[g,f,p,c]),v=k.useCallback(({active:S,selected:E})=>{const T={role:"option",...S&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...T,"aria-selected":E}}return{}},[f,c]);return k.useMemo(()=>a?{reference:y,floating:_,item:v,trigger:x}:{},[a,y,_,x,v])}function l0(e,t){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),o=n.context.dataRef,{listRef:u,activeIndex:h,onMatch:a,onTypingChange:c,enabled:d=!0,findMatch:p=null,resetMs:f=750,ignoreKeys:g=hr,selectedIndex:b=null}=t,C=Qt(),x=k.useRef(""),y=k.useRef(b??h??-1),_=k.useRef(null);je(()=>{s&&(C.clear(),_.current=null,x.current="")},[s,C]),je(()=>{s&&x.current===""&&(y.current=b??h??-1)},[s,b,h]);const v=De(A=>{A?o.current.typing||(o.current.typing=A,c?.(A)):o.current.typing&&(o.current.typing=A,c?.(A))}),S=De(A=>{function M(W,N,Y){const $=p?p(N,Y):N.find(F=>F?.toLocaleLowerCase().indexOf(Y.toLocaleLowerCase())===0);return $?W.indexOf($):-1}const L=u.current;if(x.current.length>0&&x.current[0]!==" "&&(M(L,L,x.current)===-1?v(!1):A.key===" "&&un(A)),L==null||g.includes(A.key)||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;s&&A.key!==" "&&(un(A),v(!0)),L.every(W=>W?W[0]?.toLocaleLowerCase()!==W[1]?.toLocaleLowerCase():!0)&&x.current===A.key&&(x.current="",y.current=_.current),x.current+=A.key,C.start(f,()=>{x.current="",y.current=_.current,v(!1)});const U=y.current,z=M(L,[...L.slice((U||0)+1),...L.slice(0,(U||0)+1)],x.current);z!==-1?(a?.(z),_.current=z):A.key!==" "&&(x.current="",v(!1))}),E=k.useMemo(()=>({onKeyDown:S}),[S]),T=k.useMemo(()=>({onKeyDown:S,onKeyUp(A){A.key===" "&&v(!1)}}),[S,v]);return k.useMemo(()=>d?{reference:E,floating:T}:{},[d,E,T])}function Jx(e,t){const[n,s]=e;let o=!1;const u=t.length;for(let h=0,a=u-1;h<u;a=h++){const[c,d]=t[h]||[0,0],[p,f]=t[a]||[0,0];d>=s!=f>=s&&n<=(p-c)*(s-d)/(f-d)+c&&(o=!o)}return o}function N6(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function j6(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:s=!0}=e,o=new va;let u=!1,h=null,a=null,c=typeof performance<"u"?performance.now():0;function d(f,g){const b=performance.now(),C=b-c;if(h===null||a===null||C===0)return h=f,a=g,c=b,null;const x=f-h,y=g-a,v=Math.sqrt(x*x+y*y)/C;return h=f,a=g,c=b,v}const p=({x:f,y:g,placement:b,elements:C,onClose:x,nodeId:y,tree:_})=>function(S){function E(){o.clear(),x()}if(o.clear(),!C.domReference||!C.floating||b==null||f==null||g==null)return;const{clientX:T,clientY:A}=S,M=[T,A],L=An(S),D=S.type==="mouseleave",U=ft(C.floating,L),z=ft(C.domReference,L),W=C.domReference.getBoundingClientRect(),N=C.floating.getBoundingClientRect(),Y=b.split("-")[0],$=f>N.right-N.width/2,F=g>N.bottom-N.height/2,q=N6(M,W),H=N.width>W.width,P=N.height>W.height,B=(H?W:N).left,I=(H?W:N).right,G=(P?W:N).top,K=(P?W:N).bottom;if(U&&(u=!0,!D))return;if(z&&(u=!1),z&&!D){u=!0;return}if(D&&jt(S.relatedTarget)&&ft(C.floating,S.relatedTarget)||_&&la(_.nodesRef.current,y).some(({context:ee})=>ee?.open))return;if(Y==="top"&&g>=W.bottom-1||Y==="bottom"&&g<=W.top+1||Y==="left"&&f>=W.right-1||Y==="right"&&f<=W.left+1)return E();let J=[];switch(Y){case"top":J=[[B,W.top+1],[B,N.bottom-1],[I,N.bottom-1],[I,W.top+1]];break;case"bottom":J=[[B,N.top+1],[B,W.bottom-1],[I,W.bottom-1],[I,N.top+1]];break;case"left":J=[[N.right-1,K],[N.right-1,G],[W.left+1,G],[W.left+1,K]];break;case"right":J=[[W.right-1,K],[W.right-1,G],[N.left+1,G],[N.left+1,K]];break}function Z([ee,X]){switch(Y){case"top":{const V=[H?ee+t/2:$?ee+t*4:ee-t*4,X+t+1],se=[H?ee-t/2:$?ee+t*4:ee-t*4,X+t+1],re=[[N.left,$||H?N.bottom-t:N.top],[N.right,$?H?N.bottom-t:N.top:N.bottom-t]];return[V,se,...re]}case"bottom":{const V=[H?ee+t/2:$?ee+t*4:ee-t*4,X-t],se=[H?ee-t/2:$?ee+t*4:ee-t*4,X-t],re=[[N.left,$||H?N.top+t:N.bottom],[N.right,$?H?N.top+t:N.bottom:N.top+t]];return[V,se,...re]}case"left":{const V=[ee+t+1,P?X+t/2:F?X+t*4:X-t*4],se=[ee+t+1,P?X-t/2:F?X+t*4:X-t*4];return[...[[F||P?N.right-t:N.left,N.top],[F?P?N.right-t:N.left:N.right-t,N.bottom]],V,se]}case"right":{const V=[ee-t,P?X+t/2:F?X+t*4:X-t*4],se=[ee-t,P?X-t/2:F?X+t*4:X-t*4],re=[[F||P?N.left+t:N.right,N.top],[F?P?N.left+t:N.right:N.left+t,N.bottom]];return[V,se,...re]}default:return[]}}if(!Jx([T,A],J)){if(u&&!q)return E();if(!D&&s){const ee=d(S.clientX,S.clientY);if(ee!==null&&ee<.1)return E()}Jx([T,A],Z([f,g]))?!u&&s&&o.start(40,E):E()}};return p.__options={blockPointerEvents:n},p}let B6=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),z6=(function(e){return e[e.open=Xo.open]="open",e[e.closed=Xo.closed]="closed",e[e.startingStyle=Xo.startingStyle]="startingStyle",e[e.endingStyle=Xo.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const UE=k.createContext(void 0);function H6(){const e=k.useContext(UE);if(e===void 0)throw new Error(It(26));return e}const El="ArrowUp",Zo="ArrowDown",wu="ArrowLeft",Rl="ArrowRight",Fu="Home",Uu="End",WE=new Set([wu,Rl]),V6=new Set([wu,Rl,Fu,Uu]),qE=new Set([El,Zo]),F6=new Set([El,Zo,Fu,Uu]),GE=new Set([...WE,...qE]),U6=new Set([...GE,Fu,Uu]),c0=new Set([El,Zo,wu,Rl,Fu,Uu]),W6="Shift",q6="Control",G6="Alt",$6="Meta",K6=new Set([W6,q6,G6,$6]);function Y6(e){return Jt(e)&&e.tagName==="INPUT"}function eC(e){return!!(Y6(e)&&e.selectionStart!=null||Jt(e)&&e.tagName==="TEXTAREA")}function tC(e,t,n,s){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,u=e.scrollTop;const h=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(h&&s!=="vertical"){const c=nC(e,t,"left"),d=zf(e),p=zf(t);n==="ltr"&&(c+t.offsetWidth+p.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?o=c+t.offsetWidth+p.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:c-p.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(o=c-p.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(c-p.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?o=c-p.scrollMarginLeft-d.scrollPaddingLeft:c+t.offsetWidth+p.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(o=c+t.offsetWidth+p.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(a&&s!=="horizontal"){const c=nC(e,t,"top"),d=zf(e),p=zf(t);c-p.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?u=c-p.scrollMarginTop-d.scrollPaddingTop:c+t.offsetHeight+p.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(u=c+t.offsetHeight+p.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:o,top:u,behavior:"auto"})}function nC(e,t,n){const s=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[s],t.offsetParent!==e);)t=t.offsetParent;return o}function zf(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const X6={...go,...Hs,nestedDialogOpen(e){return e?{[z6.nestedDialogOpen]:""}:null}},$E=k.forwardRef(function(t,n){const{className:s,finalFocus:o,initialFocus:u,render:h,...a}=t,{store:c}=bi(),d=c.useState("descriptionElementId"),p=c.useState("disablePointerDismissal"),f=c.useState("floatingRootContext"),g=c.useState("popupProps"),b=c.useState("modal"),C=c.useState("mounted"),x=c.useState("nested"),y=c.useState("nestedOpenDialogCount"),_=c.useState("open"),v=c.useState("openMethod"),S=c.useState("titleElementId"),E=c.useState("transitionStatus"),T=c.useState("role");H6(),Br({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function A(z){return z==="touch"?c.context.popupRef.current:!0}const M=u===void 0?A:u,L=y>0,D=k.useMemo(()=>({open:_,nested:x,transitionStatus:E,nestedDialogOpen:L}),[_,x,E,L]),U=ut("div",t,{state:D,props:[g,{"aria-labelledby":S??void 0,"aria-describedby":d??void 0,role:T,tabIndex:-1,hidden:!C,onKeyDown(z){c0.has(z.key)&&z.stopPropagation()},style:{[B6.nestedDialogs]:y}},a],ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],stateAttributesMapping:X6});return w.jsx(ip,{context:f,openInteractionType:v,disabled:!C,closeOnFocusOut:!p,initialFocus:M,returnFocus:o,modal:b!==!1,restoreFocus:"popup",children:U})});function up(e){return z_(19)?e:e?"true":void 0}const dp=k.forwardRef(function(t,n){const{cutout:s,...o}=t;let u;if(s){const h=s?.getBoundingClientRect();u=`polygon(
11
+ 0% 0%,
12
+ 100% 0%,
13
+ 100% 100%,
14
+ 0% 100%,
15
+ 0% 0%,
16
+ ${h.left}px ${h.top}px,
17
+ ${h.left}px ${h.bottom}px,
18
+ ${h.right}px ${h.bottom}px,
19
+ ${h.right}px ${h.top}px,
20
+ ${h.left}px ${h.top}px
21
+ )`}return w.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:u}})}),KE=k.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=bi(),h=u.useState("mounted"),a=u.useState("modal");return h||s?w.jsx(UE.Provider,{value:s,children:w.jsxs(sp,{ref:n,...o,children:[h&&a===!0&&w.jsx(dp,{ref:u.context.internalBackdropRef,inert:up(!open)}),t.children]})}):null});let rC={},sC={},iC="";function Q6(e){if(typeof document>"u")return!1;const t=pr(e);return xn(t).innerWidth-t.documentElement.clientWidth>0}function Z6(e){const t=pr(e),n=t.documentElement,s=t.body,o=ba(n)?n:s,u=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=u}}function J6(e){const t=pr(e),n=t.documentElement,s=t.body,o=xn(n);let u=0,h=0;const a=Ts.create(),c=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(K_&&(o.visualViewport?.scale??1)!==1)return()=>{};function d(){const g=o.getComputedStyle(n),b=o.getComputedStyle(s),y=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";u=n.scrollTop,h=n.scrollLeft,rC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},iC=n.style.scrollBehavior,sC={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const _=n.scrollHeight>n.clientHeight,v=n.scrollWidth>n.clientWidth,S=g.overflowY==="scroll"||b.overflowY==="scroll",E=g.overflowX==="scroll"||b.overflowX==="scroll",T=Math.max(0,o.innerWidth-n.clientWidth),A=Math.max(0,o.innerHeight-n.clientHeight),M=parseFloat(b.marginTop)+parseFloat(b.marginBottom),L=parseFloat(b.marginLeft)+parseFloat(b.marginRight),D=ba(n)?n:s;if(c){n.style.scrollbarGutter=y,D.style.overflowY="hidden",D.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(_||S)&&(n.style.overflowY="scroll"),(v||E)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:M||A?`calc(100dvh - ${M+A}px)`:"100dvh",width:L||T?`calc(100vw - ${L+T}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=u,s.scrollLeft=h,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function p(){Object.assign(n.style,rC),Object.assign(s.style,sC),c||(n.scrollTop=u,n.scrollLeft=h,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=iC)}function f(){p(),a.request(d)}return d(),o.addEventListener("resize",f),()=>{a.cancel(),p(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",f)}}class e8{lockCount=0;restore=null;timeoutLock=va.create();timeoutUnlock=va.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const s=pr(t).documentElement,o=xn(s).getComputedStyle(s).overflowY;if(o==="hidden"||o==="clip"){this.restore=rn;return}const u=g4||!Q6(t);this.restore=u?Z6(t):J6(t)}}const t8=new e8;function fp(e=!0,t=null){je(()=>{if(e)return t8.acquire(t)},[e,t])}function n8(e){const t=k.useRef(""),n=k.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:k.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function hp(e){const[t,n]=k.useState(null),s=De((a,c)=>{e||n(c)}),o=k.useCallback(()=>{n(null)},[]),{onClick:u,onPointerDown:h}=n8(s);return k.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:u,onPointerDown:h}}),[t,o,u,h])}function YE(e){const{store:t,parentContext:n,actionsRef:s}=e,o=t.useState("open"),u=t.useState("disablePointerDismissal"),h=t.useState("modal"),a=t.useState("popupElement"),{openMethod:c,triggerProps:d,reset:p}=hp(o);NE(t);const{forceUnmount:f}=jE(o,t,()=>{p()}),g=De(U=>{const z=Ue(U);return z.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},z}),b=k.useCallback(()=>{t.setOpen(!1,g(q2))},[t,g]);k.useImperativeHandle(s,()=>({unmount:f,close:b}),[f,b]);const C=HE({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[x,y]=k.useState(0),_=x===0,v=FE(C),S=ap(C,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:h==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(U){if("button"in U&&U.button!==0||"touches"in U&&U.touches.length!==1)return!1;const z=An(U);if(_&&!u){const W=z;return h&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===W||t.context.backdropRef.current===W||ft(W,a)&&!W?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:_});fp(o&&h===!0,a);const{getReferenceProps:E,getFloatingProps:T,getTriggerProps:A}=Kl([v,S]);t.useContextCallback("onNestedDialogOpen",U=>{y(U+1)}),t.useContextCallback("onNestedDialogClose",()=>{y(0)}),k.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(x),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,x]);const M=k.useMemo(()=>E(d),[E,d]),L=k.useMemo(()=>A(d),[A,d]),D=k.useMemo(()=>T(),[T]);t.useSyncedValues({openMethod:c,activeTriggerProps:M,inactiveTriggerProps:L,popupProps:D,floatingRootContext:C,nestedOpenDialogCount:x})}const r8={...zE,modal:xe(e=>e.modal),nested:xe(e=>e.nested),nestedOpenDialogCount:xe(e=>e.nestedOpenDialogCount),disablePointerDismissal:xe(e=>e.disablePointerDismissal),openMethod:xe(e=>e.openMethod),descriptionElementId:xe(e=>e.descriptionElementId),titleElementId:xe(e=>e.titleElementId),viewportElement:xe(e=>e.viewportElement),role:xe(e=>e.role)};class XE extends s0{constructor(t){super(s8(t),{popupRef:k.createRef(),backdropRef:k.createRef(),internalBackdropRef:k.createRef(),triggerElements:new lp,onOpenChange:void 0,onOpenChangeComplete:void 0},r8)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const s={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",s);const o={open:t},u=n.trigger?.id??null;(u||t)&&(o.activeTriggerId=u,o.activeTriggerElement=n.trigger??null),this.update(o)}}function s8(e={}){return{...BE(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function i8(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:u,disablePointerDismissal:h=!1,modal:a=!0,actionsRef:c,handle:d,triggerId:p,defaultTriggerId:f=null}=e,g=bi(!0),b=!!g,C=Wn(()=>d?.store??new XE({open:n??s,activeTriggerId:p!==void 0?p:f,modal:a,disablePointerDismissal:h,nested:b})).current;C.useControlledProp("open",n,s),C.useControlledProp("activeTriggerId",p,f),C.useSyncedValues({disablePointerDismissal:h,nested:b,modal:a}),C.useContextCallback("onOpenChange",o),C.useContextCallback("onOpenChangeComplete",u);const x=C.useState("payload");YE({store:C,actionsRef:c,parentContext:g?.store.context});const y=k.useMemo(()=>({store:C}),[C]);return w.jsx(W_.Provider,{value:y,children:typeof t=="function"?t({payload:x}):t})}const QE=k.forwardRef(function(t,n){const{render:s,className:o,id:u,...h}=t,{store:a}=bi(),c=Pr(u);return a.useSyncedValueWithCleanup("titleElementId",c),ut("h2",t,{ref:n,props:[{id:c},h]})}),ZE=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,id:a,payload:c,handle:d,...p}=t,f=bi(!0),g=d?.store??f?.store;if(!g)throw new Error(It(79));const b=Pr(a),C=g.useState("floatingRootContext"),x=g.useState("isOpenedByTrigger",b),y=k.useRef(null),{registerTrigger:_,isMountedByThisTrigger:v}=IE(b,y,g,{payload:c}),{getButtonProps:S,buttonRef:E}=jr({disabled:u,native:h}),T=Vu(C,{enabled:C!=null}),A=Kl([T]),M=k.useMemo(()=>({disabled:u,open:x}),[u,x]),L=g.useState("triggerProps",v);return ut("button",t,{state:M,ref:[E,n,_,y],props:[A.getReferenceProps(),L,{[p2]:"",id:b},p,S],stateAttributesMapping:q_})});function As({...e}){return w.jsx(i8,{"data-slot":"dialog",...e})}function JE({...e}){return w.jsx(ZE,{"data-slot":"dialog-trigger",...e})}function o8({...e}){return w.jsx(KE,{"data-slot":"dialog-portal",...e})}function u0({...e}){return w.jsx(rp,{"data-slot":"dialog-close",...e})}function a8({className:e,...t}){return w.jsx(U2,{"data-slot":"dialog-overlay",className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function Os({className:e,children:t,showCloseButton:n=!0,...s}){return w.jsxs(o8,{children:[w.jsx(a8,{}),w.jsxs($E,{"data-slot":"dialog-content",className:Be("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...s,children:[t,n&&w.jsxs(rp,{"data-slot":"dialog-close",render:w.jsx(Ve,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[w.jsx(Ee,{icon:ho,strokeWidth:2}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function mi({className:e,...t}){return w.jsx("div",{"data-slot":"dialog-header",className:Be("gap-1 flex flex-col",e),...t})}function ua({className:e,showCloseButton:t=!1,children:n,...s}){return w.jsxs("div",{"data-slot":"dialog-footer",className:Be("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...s,children:[n,t&&w.jsx(rp,{render:w.jsx(Ve,{variant:"outline"}),children:"Close"})]})}function gi({className:e,...t}){return w.jsx(QE,{"data-slot":"dialog-title",className:Be("text-sm font-medium",e),...t})}function Jo({className:e,...t}){return w.jsx(G2,{"data-slot":"dialog-description",className:Be("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3",e),...t})}let oC=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const l8={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Ca={valid(e){return e===null?null:e?{[oC.valid]:""}:{[oC.invalid]:""}}},c8=k.createContext({invalid:void 0,name:void 0,validityData:{state:l8,errors:[],error:"",value:"",initialValue:null},setValidityData:rn,disabled:void 0,touched:!1,setTouched:rn,dirty:!1,setDirty:rn,filled:!1,setFilled:rn,focused:!1,setFocused:rn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=en)=>e,getInputValidationProps:(e=en)=>e,inputRef:{current:null},commit:async()=>{}}});function rs(e=!0){const t=k.useContext(c8);if(t.setValidityData===rn&&!e)throw new Error(It(28));return t}const u8=k.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:rn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Wu(){return k.useContext(u8)}const d8=k.createContext({controlId:void 0,setControlId:rn,labelId:void 0,setLabelId:rn,messageIds:[],setMessageIds:rn,getDescriptionProps:e=>e});function yo(){return k.useContext(d8)}function f8(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Ps({controlled:e,default:t,name:n,state:s="value"}){const{current:o}=k.useRef(e!==void 0),[u,h]=k.useState(t),a=o?e:u,c=k.useCallback(d=>{o||h(d)},[]);return[a,c]}function pp(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:o,setControlId:u}=yo(),h=Pr(t);return je(()=>{if(!(!n&&!t||u===rn)){if(n){const a=s?.current;jt(a)&&a.closest("label")!=null?u(t??null):u(o??h)}else t&&u(t);return()=>{t&&u(void 0)}}},[t,s,o,u,n,h]),o??h}function qu(e){const{enabled:t=!0,value:n,id:s,name:o,controlRef:u,commit:h}=e,{formRef:a}=Wu(),{invalid:c,markedDirtyRef:d,validityData:p,setValidityData:f}=rs(),g=De(e.getValue);je(()=>{if(!t)return;let b=n;b===void 0&&(b=g()),p.initialValue===null&&b!==null&&f(C=>({...C,initialValue:b}))},[t,f,n,p.initialValue,g]),je(()=>{!t||!s||a.current.fields.set(s,{getValue:g,name:o,controlRef:u,validityData:f8(p,c),validate(){let b=n;b===void 0&&(b=g()),d.current=!0,Qn.flushSync(()=>h(b))}})},[h,u,t,a,g,s,c,d,o,p,n]),je(()=>{const b=a.current.fields;return()=>{s&&b.delete(s)}},[a,s])}const h8=k.forwardRef(function(t,n){const{render:s,className:o,id:u,name:h,value:a,disabled:c=!1,onValueChange:d,defaultValue:p,...f}=t,{state:g,name:b,disabled:C}=rs(),x=C||c,y=b??h,_=k.useMemo(()=>({...g,disabled:x}),[g,x]),{setTouched:v,setDirty:S,validityData:E,setFocused:T,setFilled:A,validationMode:M,validation:L}=rs(),{labelId:D}=yo(),U=pp({id:u});je(()=>{const F=a!=null;L.inputRef.current?.value||F&&a!==""?A(!0):F&&a===""&&A(!1)},[L.inputRef,A,a]);const[z,W]=Ps({controlled:a,default:p,name:"FieldControl",state:"value"}),N=a!==void 0,Y=De((F,q)=>{d?.(F,q),!q.isCanceled&&W(F)});return qu({id:U,name:y,commit:L.commit,value:z,getValue:()=>L.inputRef.current?.value,controlRef:L.inputRef}),ut("input",t,{ref:n,state:_,props:[{id:U,disabled:x,name:y,ref:L.inputRef,"aria-labelledby":D,...N?{value:z}:{defaultValue:p},onChange(F){const q=F.currentTarget.value;Y(q,Ue(Pn,F.nativeEvent)),S(q!==E.initialValue),A(q!=="")},onFocus(){T(!0)},onBlur(F){v(!0),T(!1),M==="onBlur"&&L.commit(F.currentTarget.value)},onKeyDown(F){F.currentTarget.tagName==="INPUT"&&F.key==="Enter"&&(v(!0),L.commit(F.currentTarget.value))}},L.getInputValidationProps(),f],stateAttributesMapping:Ca})}),p8=k.createContext({disabled:!1});function m8(){return k.useContext(p8)}const g8=k.createContext(void 0);function v8(e=!0){const t=k.useContext(g8);if(t===void 0&&!e)throw new Error(It(3));return t}const _8=k.forwardRef(function(t,n){return w.jsx(h8,{ref:n,...t})});function Kt({className:e,type:t,...n}){return w.jsx(_8,{type:t,"data-slot":"input",className:Be("bg-input/20 dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-7 rounded-md border px-2 py-0.5 text-sm transition-colors file:h-6 file:text-xs/relaxed file:font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})}function mp({className:e,...t}){return w.jsx("textarea",{"data-slot":"textarea",className:Be("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-md border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function y8({className:e,...t}){return w.jsx("label",{"data-slot":"label",className:Be("gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",e),...t})}const b8=k.forwardRef(function(t,n){const{className:s,render:o,orientation:u="horizontal",...h}=t,a=k.useMemo(()=>({orientation:u}),[u]);return ut("div",t,{state:a,ref:n,props:[{role:"separator","aria-orientation":u},h]})});function S8({className:e,orientation:t="horizontal",...n}){return w.jsx(b8,{"data-slot":"separator",orientation:t,className:Be("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",e),...n})}function gp({className:e,...t}){return w.jsx("div",{"data-slot":"field-group",className:Be("gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",e),...t})}const x8=Fl("data-[invalid=true]:text-destructive gap-2 group/field flex w-full",{variants:{orientation:{vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function In({className:e,orientation:t="vertical",...n}){return w.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:Be(x8({orientation:t}),e),...n})}function Nn({className:e,...t}){return w.jsx(y8,{"data-slot":"field-label",className:Be("has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function pi({className:e,...t}){return w.jsx("p",{"data-slot":"field-description",className:Be("text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function eR(e){const t=k.useRef(!0);t.current&&(t.current=!1,e())}const tR=k.createContext(null),nR=k.createContext(null);function Vs(){const e=k.useContext(tR);if(e===null)throw new Error(It(60));return e}function rR(){const e=k.useContext(nR);if(e===null)throw new Error(It(61));return e}const sR=(e,t)=>Object.is(e,t);function yi(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function ea(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:yi(s,t,n))}function jl(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:yi(s,t,n))}function iR(e,t,n){return e.filter(s=>!yi(s,t,n))}function t_(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function oR(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function kn(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return t_(e)}function fs(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?t_(e.value):t_(e)}function C8(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??kn(e,n);if(Array.isArray(t)){const s=oR(t)?t.flatMap(o=>o.items):t;if(e==null){const o=s.find(u=>u.value==null);return o&&o.label!=null?o.label:kn(e,n)}if(typeof e!="object"){const o=s.find(u=>u&&u.value===e);return o&&o.label!=null?o.label:kn(e,n)}if("value"in e){const o=s.find(u=>u&&u.value===e.value);if(o&&o.label!=null)return o.label}}return kn(e,n)}function w8(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>kn(n,t)).join(", ")}const ht={id:xe(e=>e.id),modal:xe(e=>e.modal),multiple:xe(e=>e.multiple),items:xe(e=>e.items),itemToStringLabel:xe(e=>e.itemToStringLabel),itemToStringValue:xe(e=>e.itemToStringValue),isItemEqualToValue:xe(e=>e.isItemEqualToValue),value:xe(e=>e.value),open:xe(e=>e.open),mounted:xe(e=>e.mounted),forceMount:xe(e=>e.forceMount),transitionStatus:xe(e=>e.transitionStatus),openMethod:xe(e=>e.openMethod),activeIndex:xe(e=>e.activeIndex),selectedIndex:xe(e=>e.selectedIndex),isActive:xe((e,t)=>e.activeIndex===t),isSelected:xe((e,t,n)=>{const s=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(u=>yi(u,n,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:yi(o,n,s)}),isSelectedByFocus:xe((e,t)=>e.selectedIndex===t),popupProps:xe(e=>e.popupProps),triggerProps:xe(e=>e.triggerProps),triggerElement:xe(e=>e.triggerElement),positionerElement:xe(e=>e.positionerElement),listElement:xe(e=>e.listElement),scrollUpArrowVisible:xe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:xe(e=>e.scrollDownArrowVisible),hasScrollArrows:xe(e=>e.hasScrollArrows),serializedValue:xe(e=>{const{multiple:t,value:n,itemToStringValue:s}=e;return t&&Array.isArray(n)&&n.length===0?"":fs(n,s)})};function ta(e,t){const n=k.useRef(e),s=De(t);je(()=>{n.current!==e&&s(n.current)},[e,s]),je(()=>{n.current=e},[e])}function E8(e){const{id:t,value:n,defaultValue:s=null,onValueChange:o,open:u,defaultOpen:h=!1,onOpenChange:a,name:c,disabled:d=!1,readOnly:p=!1,required:f=!1,modal:g=!0,actionsRef:b,inputRef:C,onOpenChangeComplete:x,items:y,multiple:_=!1,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:E=sR,highlightItemOnHover:T=!0,children:A}=e,{clearErrors:M}=Wu(),{setDirty:L,shouldValidateOnChange:D,validityData:U,setFilled:z,name:W,disabled:N,validation:Y}=rs(),{controlId:$}=yo(),F=pp({id:t}),q=N||d,H=W??c,[P,B]=Ps({controlled:n,default:_?s??hr:s,name:"Select",state:"value"}),[I,G]=Ps({controlled:u,default:h,name:"Select",state:"open"}),K=k.useRef([]),J=k.useRef([]),Z=k.useRef(null),ee=k.useRef(null),X=k.useRef(0),V=k.useRef(null),se=k.useRef([]),re=k.useRef(!1),ne=k.useRef(!1),oe=k.useRef(null),ce=k.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ve=k.useRef(!1),{mounted:ge,setMounted:he,transitionStatus:de}=xi(I),{openMethod:Le,triggerProps:Oe,reset:Ne}=hp(I),ye=Wn(()=>new ca({id:F,modal:g,multiple:_,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:E,value:P,open:I,mounted:ge,transitionStatus:de,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ae=Te(ye,ht.activeIndex),ae=Te(ye,ht.selectedIndex),be=Te(ye,ht.triggerElement),Ce=Te(ye,ht.positionerElement),We=k.useMemo(()=>_&&Array.isArray(P)&&P.length===0?"":fs(P,S),[_,P,S]),rt=k.useMemo(()=>_&&Array.isArray(P)?P.map(ot=>fs(ot,S)):fs(P,S),[_,P,S]),ze=dn(ye.state.triggerElement);qu({id:F,commit:Y.commit,value:P,controlRef:ze,name:H,getValue:()=>rt});const Me=k.useRef(P);je(()=>{P!==Me.current&&ye.set("forceMount",!0)},[ye,P]),je(()=>{z(P!==null)},[P,z]),je(function(){if(I)return;const wt=se.current;if(_){const St=Array.isArray(P)?P:[];if(St.length===0){ye.set("selectedIndex",null);return}const Qe=St[St.length-1],Ht=jl(wt,Qe,E);ye.set("selectedIndex",Ht===-1?null:Ht);return}const bt=jl(wt,P,E);ye.set("selectedIndex",bt===-1?null:bt)},[_,I,P,se,E,ye]),ta(P,()=>{M(H),L(P!==U.initialValue),D()?Y.commit(P):Y.commit(P,!0)});const He=De((ot,wt)=>{if(a?.(ot,wt),!wt.isCanceled&&(G(ot),!ot&&ye.state.activeIndex!==null)){const bt=K.current[ye.state.activeIndex];queueMicrotask(()=>{bt?.setAttribute("tabindex","-1")})}}),dt=De(()=>{he(!1),ye.set("activeIndex",null),Ne(),x?.(!1)});Br({enabled:!b,open:I,ref:Z,onComplete(){I||dt()}}),k.useImperativeHandle(b,()=>({unmount:dt}),[dt]);const $e=De((ot,wt)=>{o?.(ot,wt),!wt.isCanceled&&B(ot)}),et=De(()=>{const ot=ye.state.listElement||Z.current;if(!ot)return;const wt=ot.scrollTop,bt=ot.scrollTop+ot.clientHeight,St=wt>1,Qe=bt<ot.scrollHeight-1;ye.state.scrollUpArrowVisible!==St&&ye.set("scrollUpArrowVisible",St),ye.state.scrollDownArrowVisible!==Qe&&ye.set("scrollDownArrowVisible",Qe)}),Re=o0({open:I,onOpenChange:He,elements:{reference:be,floating:Ce}}),tt=Vu(Re,{enabled:!p&&!q,event:"mousedown"}),at=ap(Re,{bubbles:!1}),Xe=a0(Re,{enabled:!p&&!q,listRef:K,activeIndex:Ae,selectedIndex:ae,disabledIndices:hr,onNavigate(ot){ot===null&&!I||ye.set("activeIndex",ot)},focusItemOnHover:!1}),st=l0(Re,{enabled:!p&&!q&&(I||!_),listRef:J,activeIndex:Ae,selectedIndex:ae,onMatch(ot){I?ye.set("activeIndex",ot):$e(se.current[ot],Ue("none"))},onTypingChange(ot){re.current=ot}}),{getReferenceProps:Ct,getFloatingProps:lt,getItemProps:tn}=Kl([tt,at,Xe,st]),kt=k.useMemo(()=>Bs(Ct(),Oe),[Ct,Oe]);eR(()=>{ye.update({popupProps:lt(),triggerProps:kt})}),je(()=>{ye.update({id:F,modal:g,multiple:_,value:P,open:I,mounted:ge,transitionStatus:de,popupProps:lt(),triggerProps:kt,items:y,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:E,openMethod:Le})},[ye,F,g,_,P,I,ge,de,lt,kt,y,v,S,E,Le]);const vt=k.useMemo(()=>({store:ye,name:H,required:f,disabled:q,readOnly:p,multiple:_,itemToStringLabel:v,itemToStringValue:S,highlightItemOnHover:T,setValue:$e,setOpen:He,listRef:K,popupRef:Z,scrollHandlerRef:ee,handleScrollArrowVisibility:et,scrollArrowsMountedCountRef:X,getItemProps:tn,events:Re.context.events,valueRef:V,valuesRef:se,labelsRef:J,typingRef:re,selectionRef:ce,selectedItemTextRef:oe,validation:Y,onOpenChangeComplete:x,keyboardActiveRef:ne,alignItemWithTriggerActiveRef:ve,initialValueRef:Me}),[ye,H,f,q,p,_,v,S,T,$e,He,tn,Re.context.events,Y,x,et]),Je=ns(C,Y.inputRef),Ot=_&&Array.isArray(P)&&P.length>0,Nt=k.useMemo(()=>!_||!Array.isArray(P)||!H?null:P.map(ot=>{const wt=fs(ot,S);return w.jsx("input",{type:"hidden",name:H,value:wt},wt)}),[_,P,H,S]);return w.jsx(tR.Provider,{value:vt,children:w.jsxs(nR.Provider,{value:Re,children:[A,w.jsx("input",{...Y.getInputValidationProps({onFocus(){ye.state.triggerElement?.focus()},onChange(ot){if(ot.nativeEvent.defaultPrevented)return;const wt=ot.target.value,bt=Ue(Pn,ot.nativeEvent);function St(){if(_)return;const Qe=se.current.find(Ht=>fs(Ht,S).toLowerCase()===wt.toLowerCase());Qe!=null&&(L(Qe!==U.initialValue),$e(Qe,bt),D()&&Y.commit(Qe))}ye.set("forceMount",!0),queueMicrotask(St)}}),id:t||$||void 0,name:_?void 0:H,value:We,disabled:q,required:f&&!Ot,readOnly:p,ref:Je,style:$l,tabIndex:-1,"aria-hidden":!0}),Nt]})})}function d0(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),s=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||s.content!=="none"))return t;const u=parseFloat(n.width)||0,h=parseFloat(n.height)||0,a=parseFloat(s.width)||0,c=parseFloat(s.height)||0,d=Math.max(t.width,u,a),p=Math.max(t.height,h,c),f=d-t.width,g=p-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-g/2,bottom:t.bottom+g/2}}const Hf=2,R8={...bu,...Ca,value:()=>null},k8=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,...a}=t,{setTouched:c,setFocused:d,validationMode:p,state:f,disabled:g}=rs(),{labelId:b}=yo(),{store:C,setOpen:x,selectionRef:y,validation:_,readOnly:v,alignItemWithTriggerActiveRef:S,disabled:E,keyboardActiveRef:T}=Vs(),A=g||E||u,M=Te(C,ht.open),L=Te(C,ht.value),D=Te(C,ht.triggerProps),U=Te(C,ht.positionerElement),z=Te(C,ht.listElement),W=Te(C,ht.serializedValue),N=dn(U),Y=k.useRef(null),$=Qt(),F=Qt(),{getButtonProps:q,buttonRef:H}=jr({disabled:A,native:h}),P=De(ee=>{C.set("triggerElement",ee)}),B=ns(n,Y,H,P),I=Qt(),G=Qt();k.useEffect(()=>{if(M)return G.start(200,()=>{y.current.allowUnselectedMouseUp=!0,I.start(200,()=>{y.current.allowSelectedMouseUp=!0})}),()=>{I.clear(),G.clear()};y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},F.clear()},[M,y,F,I,G]);const K=k.useMemo(()=>z?.id??Su(U)?.id,[z,U]),J=Bs(D,{role:"combobox","aria-expanded":M?"true":"false","aria-haspopup":"listbox","aria-controls":M?K:void 0,"aria-labelledby":b,"aria-readonly":v||void 0,tabIndex:A?-1:0,ref:B,onFocus(ee){d(!0),M&&S.current&&x(!1,Ue(ga,ee.nativeEvent)),$.start(0,()=>{C.set("forceMount",!0)})},onBlur(){c(!0),d(!1),p==="onBlur"&&_.commit(L)},onPointerMove(){T.current=!1},onKeyDown(){T.current=!0},onMouseDown(ee){if(M)return;const X=pr(ee.currentTarget);function V(se){if(!Y.current)return;const re=se.target;if(ft(Y.current,re)||ft(N.current,re)||re===Y.current)return;const ne=d0(Y.current);se.clientX>=ne.left-Hf&&se.clientX<=ne.right+Hf&&se.clientY>=ne.top-Hf&&se.clientY<=ne.bottom+Hf||x(!1,Ue(W2,se))}F.start(0,()=>{X.addEventListener("mouseup",V,{once:!0})})}},_.getValidationProps,a,q);J.role="combobox";const Z=k.useMemo(()=>({...f,open:M,disabled:A,value:L,readOnly:v,placeholder:!W}),[f,M,A,L,v,W]);return ut("button",t,{ref:[n,Y],state:Z,stateAttributesMapping:R8,props:J})}),T8={value:()=>null},L8=k.forwardRef(function(t,n){const{className:s,render:o,children:u,...h}=t,{store:a,valueRef:c}=Vs(),d=Te(a,ht.value),p=Te(a,ht.items),f=Te(a,ht.itemToStringLabel),g=Te(a,ht.serializedValue),b=k.useMemo(()=>({value:d,placeholder:!g}),[d,g]),C=typeof u=="function"?u(d):u??(Array.isArray(d)?w8(d,f):C8(d,p,f));return ut("span",t,{state:b,ref:[n,c],props:[{children:C},h],stateAttributesMapping:T8})}),A8=k.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h}=Vs(),a=Te(h,ht.open),c=k.useMemo(()=>({open:a}),[a]);return ut("span",t,{state:c,ref:n,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:q_})}),O8=k.createContext(void 0),M8=k.forwardRef(function(t,n){const{store:s}=Vs(),o=Te(s,ht.mounted),u=Te(s,ht.forceMount);return o||u?w.jsx(O8.Provider,{value:!0,children:w.jsx(sp,{ref:n,...t})}):null}),aR=k.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function D8(){return k.useContext(aR)}function Gu(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:o}=e,u=De(o),h=k.useRef(0),a=Wn(I8).current,c=Wn(P8).current,[d,p]=k.useState(0),f=k.useRef(d),g=De((_,v)=>{c.set(_,v??null),f.current+=1,p(f.current)}),b=De(_=>{c.delete(_),f.current+=1,p(f.current)}),C=k.useMemo(()=>{const _=new Map;return Array.from(c.keys()).filter(S=>S.isConnected).sort(N8).forEach((S,E)=>{const T=c.get(S)??{};_.set(S,{...T,index:E})}),_},[c,d]);je(()=>{if(typeof MutationObserver!="function"||C.size===0)return;const _=new MutationObserver(v=>{const S=new Set,E=T=>S.has(T)?S.delete(T):S.add(T);v.forEach(T=>{T.removedNodes.forEach(E),T.addedNodes.forEach(E)}),S.size===0&&(f.current+=1,p(f.current))});return C.forEach((v,S)=>{S.parentElement&&_.observe(S.parentElement,{childList:!0})}),()=>{_.disconnect()}},[C]),je(()=>{f.current===d&&(n.current.length!==C.size&&(n.current.length=C.size),s&&s.current.length!==C.size&&(s.current.length=C.size),h.current=C.size),u(C)},[u,C,n,s,d]),je(()=>()=>{n.current=[]},[n]),je(()=>()=>{s&&(s.current=[])},[s]);const x=De(_=>(a.add(_),()=>{a.delete(_)}));je(()=>{a.forEach(_=>_(C))},[a,C]);const y=k.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,elementsRef:n,labelsRef:s,nextIndexRef:h}),[g,b,x,n,s,h]);return w.jsx(aR.Provider,{value:y,children:t})}function P8(){return new Map}function I8(){return new Set}function N8(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const j8=k.createContext(void 0);function wa(){return k.useContext(j8)?.direction??"ltr"}const B8=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:u,platform:h,elements:a,middlewareData:c}=t,{element:d,padding:p=0,offsetParent:f="real"}=_i(e,t)||{};if(d==null)return{};const g=rE(p),b={x:n,y:s},C=J_(o),x=Z_(C),y=await h.getDimensions(d),_=C==="y",v=_?"top":"left",S=_?"bottom":"right",E=_?"clientHeight":"clientWidth",T=u.reference[x]+u.reference[C]-b[C]-u.floating[x],A=b[C]-u.reference[C],M=f==="real"?await h.getOffsetParent?.(d):a.floating;let L=a.floating[E]||u.floating[x];(!L||!await h.isElement?.(M))&&(L=a.floating[E]||u.floating[x]);const D=T/2-A/2,U=L/2-y[x]/2-1,z=Math.min(g[v],U),W=Math.min(g[S],U),N=z,Y=L-y[x]-W,$=L/2-y[x]/2+D,F=Yv(N,$,Y),q=!c.arrow&&vo(o)!=null&&$!==F&&u.reference[x]/2-($<N?z:W)-y[x]/2<0,H=q?$<N?$-N:$-Y:0;return{[C]:b[C]+H,data:{[C]:F,centerOffset:$-F-H,...q&&{alignmentOffset:H}},reset:q}}}),z8=(e,t)=>({...B8(e),options:[e,t]}),H8={name:"hide",async fn(e){const{width:t,height:n,x:s,y:o}=e.rects.reference,u=t===0&&n===0&&s===0&&o===0;return{data:{referenceHidden:(await XD().fn(e)).data?.referenceHidden||u}}}},V8={sideX:"left",sideY:"top"};function lR(e,t,n){const s=e==="inline-start"||e==="inline-end";return{top:"top",right:s?n?"inline-start":"inline-end":"right",bottom:"bottom",left:s?n?"inline-end":"inline-start":"left"}[t]}function aC(e,t,n){const{rects:s,placement:o}=e;return{side:lR(t,Mr(o),n),align:vo(o)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function f0(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:h=0,collisionBoundary:a,collisionPadding:c=5,sticky:d=!1,arrowPadding:p=5,disableAnchorTracking:f=!1,keepMounted:g=!1,floatingRootContext:b,mounted:C,collisionAvoidance:x,shiftCrossAxis:y=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:S=!1,externalTree:E}=e,[T,A]=k.useState(null);!C&&T!==null&&A(null);const M=x.side||"flip",L=x.align||"flip",D=x.fallbackAxisSide||"end",U=typeof t=="function"?t:void 0,z=De(U),W=U?z:t,N=dn(t),$=wa()==="rtl",F=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":$?"left":"right","inline-start":$?"right":"left"}[s],q=u==="center"?F:`${F}-${u}`;let H=c;const P=1,B=s==="bottom"?P:0,I=s==="top"?P:0,G=s==="right"?P:0,K=s==="left"?P:0;typeof H=="number"?H={top:H+B,right:H+K,bottom:H+I,left:H+G}:H&&(H={top:(H.top||0)+B,right:(H.right||0)+K,bottom:(H.bottom||0)+I,left:(H.left||0)+G});const J={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:H},Z=k.useRef(null),ee=dn(o),X=dn(h),re=[qD(Xe=>{const st=aC(Xe,s,$),Ct=typeof ee.current=="function"?ee.current(st):ee.current,lt=typeof X.current=="function"?X.current(st):X.current;return{mainAxis:Ct,crossAxis:lt,alignmentAxis:lt}},[typeof o!="function"?o:0,typeof h!="function"?h:0,$,s])],ne=L==="none"&&M!=="shift",oe=!ne&&(d||y||M==="shift"),ce=M==="none"?null:KD({...J,padding:{top:H.top+P,right:H.right+P,bottom:H.bottom+P,left:H.left+P},mainAxis:!y&&M==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),ve=ne?null:GD(Xe=>{const st=pr(Xe.elements.floating).documentElement;return{...J,rootBoundary:y?{x:0,y:0,width:st.clientWidth,height:st.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:oe,limiter:d||y?void 0:$D(Ct=>{if(!Z.current)return{};const{width:lt,height:tn}=Z.current.getBoundingClientRect(),kt=Zr(Mr(Ct.placement)),vt=kt==="y"?lt:tn,Je=kt==="y"?H.left+H.right:H.top+H.bottom;return{offset:vt/2+Je/2}})}},[J,d,y,H,L]);M==="shift"||L==="shift"||u==="center"?re.push(ve,ce):re.push(ce,ve),re.push(YD({...J,apply({elements:{floating:Xe},rects:{reference:st},availableWidth:Ct,availableHeight:lt}){Object.entries({"--available-width":`${Ct}px`,"--available-height":`${lt}px`,"--anchor-width":`${st.width}px`,"--anchor-height":`${st.height}px`}).forEach(([tn,kt])=>{Xe.style.setProperty(tn,kt)})}}),z8(()=>({element:Z.current||document.createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(Xe){const{elements:st,middlewareData:Ct,placement:lt,rects:tn,y:kt}=Xe,vt=Mr(lt),Je=Zr(vt),Ot=Z.current,Nt=Ct.arrow?.x||0,ot=Ct.arrow?.y||0,wt=Ot?.clientWidth||0,bt=Ot?.clientHeight||0,St=Nt+wt/2,Qe=ot+bt/2,Ht=Math.abs(Ct.shift?.y||0),Cn=tn.reference.height/2,Gn=typeof o=="function"?o(aC(Xe,s,$)):o,Bn=Ht>Gn,gs={top:`${St}px calc(100% + ${Gn}px)`,bottom:`${St}px ${-Gn}px`,left:`calc(100% + ${Gn}px) ${Qe}px`,right:`${-Gn}px ${Qe}px`}[vt],Da=`${St}px ${tn.reference.y+Cn-kt}px`;return st.floating.style.setProperty("--transform-origin",oe&&Je==="y"&&Bn?Da:gs),{}}},H8,v),je(()=>{!C&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[C,b]);const ge=k.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:he,elements:de,x:Le,y:Oe,middlewareData:Ne,update:ye,placement:Ae,context:ae,isPositioned:be,floatingStyles:Ce}=C6({rootContext:b,placement:q,middleware:re,strategy:n,whileElementsMounted:g?void 0:(...Xe)=>Kx(...Xe,ge),nodeId:_,externalTree:E}),{sideX:We,sideY:rt}=Ne.adaptiveOrigin||V8,ze=be?n:"fixed",Me=k.useMemo(()=>v?{position:ze,[We]:Le,[rt]:Oe}:{position:ze,...Ce},[v,ze,We,Le,rt,Oe,Ce]),He=k.useRef(null);je(()=>{if(!C)return;const Xe=N.current,st=typeof Xe=="function"?Xe():Xe,lt=(lC(st)?st.current:st)||null||null;lt!==He.current&&(he.setPositionReference(lt),He.current=lt)},[C,he,W,N]),k.useEffect(()=>{if(!C)return;const Xe=N.current;typeof Xe!="function"&&lC(Xe)&&Xe.current!==He.current&&(he.setPositionReference(Xe.current),He.current=Xe.current)},[C,he,W,N]),k.useEffect(()=>{if(g&&C&&de.domReference&&de.floating)return Kx(de.domReference,de.floating,ye,ge)},[g,C,de,ye,ge]);const dt=Mr(Ae),$e=lR(s,dt,$),et=vo(Ae)||"center",Re=!!Ne.hide?.referenceHidden;je(()=>{S&&C&&be&&A(dt)},[S,C,be,dt]);const tt=k.useMemo(()=>({position:"absolute",top:Ne.arrow?.y,left:Ne.arrow?.x}),[Ne.arrow]),at=Ne.arrow?.centerOffset!==0;return k.useMemo(()=>({positionerStyles:Me,arrowStyles:tt,arrowRef:Z,arrowUncentered:at,side:$e,align:et,physicalSide:dt,anchorHidden:Re,refs:he,context:ae,isPositioned:be,update:ye}),[Me,tt,Z,at,$e,et,dt,Re,he,ae,be,ye])}function lC(e){return e!=null&&"current"in e}const cR=k.createContext(void 0);function h0(){const e=k.useContext(cR);if(!e)throw new Error(It(59));return e}function Dh(e,t){e&&Object.assign(e.style,t)}const uR={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},F8={position:"fixed"},U8=k.forwardRef(function(t,n){const{anchor:s,positionMethod:o="absolute",className:u,render:h,side:a="bottom",align:c="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g,arrowPadding:b=5,sticky:C=!1,disableAnchorTracking:x,alignItemWithTrigger:y=!0,collisionAvoidance:_=H_,...v}=t,{store:S,listRef:E,labelsRef:T,alignItemWithTriggerActiveRef:A,selectedItemTextRef:M,valuesRef:L,initialValueRef:D,popupRef:U,setValue:z}=Vs(),W=rR(),N=Te(S,ht.open),Y=Te(S,ht.mounted),$=Te(S,ht.modal),F=Te(S,ht.value),q=Te(S,ht.openMethod),H=Te(S,ht.positionerElement),P=Te(S,ht.triggerElement),B=Te(S,ht.isItemEqualToValue),I=k.useRef(null),G=k.useRef(null),[K,J]=k.useState(y),Z=Y&&K&&q!=="touch";!Y&&K!==y&&J(y),je(()=>{Y||(ht.scrollUpArrowVisible(S.state)&&S.set("scrollUpArrowVisible",!1),ht.scrollDownArrowVisible(S.state)&&S.set("scrollDownArrowVisible",!1))},[S,Y]),k.useImperativeHandle(A,()=>Z),fp((Z||$)&&N&&q!=="touch",P);const ee=f0({anchor:s,floatingRootContext:W,positionMethod:o,mounted:Y,side:a,sideOffset:d,align:c,alignOffset:p,arrowPadding:b,collisionBoundary:f,collisionPadding:g,sticky:C,disableAnchorTracking:x??Z,collisionAvoidance:_,keepMounted:!0}),X=Z?"none":ee.side,V=Z?F8:ee.positionerStyles,se=k.useMemo(()=>{const he={};return N||(he.pointerEvents="none"),{role:"presentation",hidden:!Y,style:{...V,...he}}},[N,Y,V]),re=k.useMemo(()=>({open:N,side:X,align:ee.align,anchorHidden:ee.anchorHidden}),[N,X,ee.align,ee.anchorHidden]),ne=De(he=>{S.set("positionerElement",he)}),oe=ut("div",t,{ref:[n,ne],state:re,stateAttributesMapping:go,props:[se,v]}),ce=k.useRef(0),ve=De(he=>{if(he.size===0&&ce.current===0||L.current.length===0)return;const de=ce.current;if(ce.current=he.size,he.size===de)return;const Le=Ue(Pn);if(de!==0&&!S.state.multiple&&F!==null&&jl(L.current,F,B)===-1){const Ne=D.current,Ae=Ne!=null&&ea(L.current,Ne,B)?Ne:null;z(Ae,Le),Ae===null&&(S.set("selectedIndex",null),M.current=null)}if(de!==0&&S.state.multiple&&Array.isArray(F)){const Oe=F.filter(Ne=>ea(L.current,Ne,B));(Oe.length!==F.length||Oe.some(Ne=>!ea(F,Ne,B)))&&(z(Oe,Le),Oe.length===0&&(S.set("selectedIndex",null),M.current=null))}if(N&&Z){S.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Oe={height:""};Dh(H,Oe),Dh(U.current,Oe)}}),ge=k.useMemo(()=>({...ee,side:X,alignItemWithTriggerActive:Z,setControlledAlignItemWithTrigger:J,scrollUpArrowRef:I,scrollDownArrowRef:G}),[ee,X,Z,J]);return w.jsx(Gu,{elementsRef:E,labelsRef:T,onMapChange:ve,children:w.jsxs(cR.Provider,{value:ge,children:[Y&&$&&w.jsx(dp,{inert:up(!N),cutout:P}),oe]})})});function dR(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Vf="base-ui-disable-scrollbar",Eu={className:Vf,element:w.jsx("style",{href:Vf,precedence:"base-ui:low",children:`.${Vf}{scrollbar-width:none}.${Vf}::-webkit-scrollbar{display:none}`})},W8=k.createContext(void 0);function fR(e){return k.useContext(W8)}function p0(e){return e==="starting"?BM:en}const q8={...go,...Hs},G8=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{store:h,popupRef:a,onOpenChangeComplete:c,setOpen:d,valueRef:p,selectedItemTextRef:f,keyboardActiveRef:g,multiple:b,handleScrollArrowVisibility:C,scrollHandlerRef:x}=Vs(),{side:y,align:_,alignItemWithTriggerActive:v,setControlledAlignItemWithTrigger:S,scrollDownArrowRef:E,scrollUpArrowRef:T}=h0(),A=fR()!=null,M=rR(),L=Qt(),D=Te(h,ht.id),U=Te(h,ht.open),z=Te(h,ht.mounted),W=Te(h,ht.popupProps),N=Te(h,ht.transitionStatus),Y=Te(h,ht.triggerElement),$=Te(h,ht.positionerElement),F=Te(h,ht.listElement),q=k.useRef(0),H=k.useRef(!1),P=k.useRef(0),B=k.useRef(!1),I=k.useRef({}),G=Hu(),K=De(X=>{if(!$||!a.current||!B.current)return;if(H.current||!v){C();return}const V=$.style.top==="0px",se=$.style.bottom==="0px",re=$.getBoundingClientRect().height,ne=pr($),oe=getComputedStyle($),ce=parseFloat(oe.marginTop),ve=parseFloat(oe.marginBottom),ge=ne.documentElement.clientHeight-ce-ve,he=X.scrollTop,de=X.scrollHeight,Le=X.clientHeight,Oe=de-Le;let Ne=null,ye=null,Ae=!1;if(V){const ae=Oe-he,be=re+ae,Ce=Math.min(be,ge);Ne=Ce,Ce!==ge?ye=Oe:Ae=!0}else if(se){const ae=he-0,be=re+ae,Ce=Math.min(be,ge),We=be-ge;Ne=Ce,Ce!==ge?ye=0:(Ae=!0,he<Oe&&(ye=he-(ae-We)))}Ne!=null&&($.style.height=`${Ne}px`),ye!=null&&(X.scrollTop=ye),Ae&&(H.current=!0),C()});k.useImperativeHandle(x,()=>K,[K]),Br({open:U,ref:a,onComplete(){U&&c?.(!0)}});const J=k.useMemo(()=>({open:U,transitionStatus:N,side:y,align:_}),[U,N,y,_]);je(()=>{!$||!a.current||Object.keys(I.current).length||(I.current={top:$.style.top||"0",left:$.style.left||"0",right:$.style.right,height:$.style.height,bottom:$.style.bottom,minHeight:$.style.minHeight,maxHeight:$.style.maxHeight,marginTop:$.style.marginTop,marginBottom:$.style.marginBottom})},[a,$]),je(()=>{z||v||(B.current=!1,H.current=!1,q.current=0,P.current=0,Dh($,I.current))},[z,v,$,a]),je(()=>{const X=a.current;if(!(!z||!Y||!$||!X)){if(!v){B.current=!0,G.request(C);return}queueMicrotask(()=>{const V=getComputedStyle($),se=getComputedStyle(X),re=pr(Y),ne=xn($),oe=Y.getBoundingClientRect(),ce=$.getBoundingClientRect(),ve=oe.left,ge=oe.height,he=F||X,de=he.scrollHeight,Le=parseFloat(se.borderBottomWidth),Oe=parseFloat(V.marginTop)||10,Ne=parseFloat(V.marginBottom)||10,ye=parseFloat(V.minHeight)||100,Ae=5,ae=5,be=20,Ce=re.documentElement.clientHeight-Oe-Ne,We=re.documentElement.clientWidth,rt=Ce-oe.bottom+ge,ze=f.current,Me=p.current;let He=0,dt=0;if(ze&&Me){const vt=Me.getBoundingClientRect(),Je=ze.getBoundingClientRect(),Ot=vt.left-ve,Nt=Je.left-ce.left,ot=vt.top-oe.top+vt.height/2,wt=Je.top-ce.top+Je.height/2;He=Ot-Nt,dt=wt-ot}const $e=rt+dt+Ne+Le;let et=Math.min(Ce,$e);const Re=Ce-Oe-Ne,tt=$e-et,at=Math.max(Ae,ve+He),Xe=We-ae,st=Math.max(0,at+ce.width-Xe);$.style.left=`${at-st}px`,$.style.height=`${et}px`,$.style.maxHeight="auto",$.style.marginTop=`${Oe}px`,$.style.marginBottom=`${Ne}px`,X.style.height="100%";const Ct=he.scrollHeight-he.clientHeight,lt=tt>=Ct;lt&&(et=Math.min(Ce,ce.height)-(tt-Ct));const tn=oe.top<be||oe.bottom>Ce-be||et<Math.min(de,ye),kt=(ne.visualViewport?.scale??1)!==1&&K_;if(tn||kt){B.current=!0,Dh($,I.current),Qn.flushSync(()=>S(!1));return}if(lt){const vt=Math.max(0,Ce-$e);$.style.top=ce.height>=Re?"0":`${vt}px`,$.style.height=`${et}px`,he.scrollTop=he.scrollHeight-he.clientHeight,q.current=Math.max(ye,et)}else $.style.bottom="0",q.current=Math.max(ye,et),he.scrollTop=tt;q.current===Ce&&(H.current=!0),C(),setTimeout(()=>{B.current=!0})})}},[h,z,$,Y,p,f,a,C,v,S,G,E,T,F]),k.useEffect(()=>{if(!v||!$||!z)return;const X=xn($);function V(se){d(!1,Ue(d4,se))}return X.addEventListener("resize",V),()=>{X.removeEventListener("resize",V)}},[d,v,$,z]);const Z={...F?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":b||void 0,id:`${D}-list`},onKeyDown(X){g.current=!0,A&&c0.has(X.key)&&X.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(X){if(dR(X)||X.pointerType==="touch")return;const V=X.currentTarget;L.start(0,()=>{h.set("activeIndex",null),V.focus({preventScroll:!0})})},onScroll(X){F||x.current?.(X.currentTarget)},...v&&{style:F?{height:"100%"}:uR}},ee=ut("div",t,{ref:[n,a],state:J,stateAttributesMapping:q8,props:[W,Z,p0(N),{className:!F&&v?Eu.className:void 0},u]});return w.jsxs(k.Fragment,{children:[Eu.element,w.jsx(ip,{context:M,modal:!1,disabled:!z,restoreFocus:!0,children:ee})]})}),$8=k.forwardRef(function(t,n){const{className:s,render:o,...u}=t,{store:h,scrollHandlerRef:a}=Vs(),{alignItemWithTriggerActive:c}=h0(),d=Te(h,ht.hasScrollArrows),p=Te(h,ht.openMethod),f=Te(h,ht.multiple),b={id:`${Te(h,ht.id)}-list`,role:"listbox","aria-multiselectable":f||void 0,onScroll(x){a.current?.(x.currentTarget)},...c&&{style:uR},className:d&&p!=="touch"?Eu.className:void 0},C=De(x=>{h.set("listElement",x)});return ut("div",t,{ref:[n,C],props:[b,u]})});let m0=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function $u(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:o,index:u}=e,{register:h,unregister:a,subscribeMapChange:c,elementsRef:d,labelsRef:p,nextIndexRef:f}=D8(),g=k.useRef(-1),[b,C]=k.useState(u??(o===m0.GuessFromOrder?()=>{if(g.current===-1){const _=f.current;f.current+=1,g.current=_}return g.current}:-1)),x=k.useRef(null),y=k.useCallback(_=>{if(x.current=_,b!==-1&&_!==null&&(d.current[b]=_,p)){const v=t!==void 0;p.current[b]=v?t:s?.current?.textContent??_.textContent}},[b,d,p,t,s]);return je(()=>{if(u!=null)return;const _=x.current;if(_)return h(_,n),()=>{a(_)}},[u,h,a,n]),je(()=>{if(u==null)return c(_=>{const v=x.current?_.get(x.current)?.index:null;v!=null&&C(v)})},[u,c,C]),k.useMemo(()=>({ref:y,index:b}),[b,y])}const hR=k.createContext(void 0);function g0(){const e=k.useContext(hR);if(!e)throw new Error(It(57));return e}const K8=k.memo(k.forwardRef(function(t,n){const{render:s,className:o,value:u=null,label:h,disabled:a=!1,nativeButton:c=!1,...d}=t,p=k.useRef(null),f=$u({label:h,textRef:p,indexGuessBehavior:m0.GuessFromOrder}),{store:g,getItemProps:b,setOpen:C,setValue:x,selectionRef:y,typingRef:_,valuesRef:v,keyboardActiveRef:S,multiple:E,highlightItemOnHover:T}=Vs(),A=Qt(),M=Te(g,ht.isActive,f.index),L=Te(g,ht.isSelected,f.index,u),D=Te(g,ht.isSelectedByFocus,f.index),U=Te(g,ht.isItemEqualToValue),z=f.index,W=z!==-1,N=k.useRef(null),Y=dn(z);je(()=>{if(!W)return;const ee=v.current;return ee[z]=u,()=>{delete ee[z]}},[W,z,u,v]),je(()=>{if(!W)return;const ee=g.state.value;let X=ee;E&&Array.isArray(ee)&&ee.length>0&&(X=ee[ee.length-1]),X!==void 0&&yi(X,u,U)&&g.set("selectedIndex",z)},[W,z,E,U,g,u]);const $=k.useMemo(()=>({disabled:a,selected:L,highlighted:M}),[a,L,M]),F=b({active:M,selected:L});F.onFocus=void 0,F.id=void 0;const q=k.useRef(null),H=k.useRef("mouse"),P=k.useRef(!1),{getButtonProps:B,buttonRef:I}=jr({disabled:a,focusableWhenDisabled:!0,native:c});function G(ee){const X=g.state.value;if(E){const V=Array.isArray(X)?X:[],se=L?iR(V,u,U):[...V,u];x(se,Ue(aa,ee))}else x(u,Ue(aa,ee)),C(!1,Ue(aa,ee))}const K={role:"option","aria-selected":L,"aria-disabled":a||void 0,tabIndex:M?0:-1,onFocus(){g.set("activeIndex",z)},onMouseEnter(){!S.current&&g.state.selectedIndex===null&&g.set("activeIndex",z)},onMouseMove(){T&&g.set("activeIndex",z)},onMouseLeave(ee){!T||S.current||dR(ee)||A.start(0,()=>{g.state.activeIndex===z&&g.set("activeIndex",null)})},onTouchStart(){y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ee){q.current=ee.key,g.set("activeIndex",z)},onClick(ee){P.current=!1,!(ee.type==="keydown"&&q.current===null)&&(a||q.current===" "&&_.current||H.current!=="touch"&&!M||(q.current=null,G(ee.nativeEvent)))},onPointerEnter(ee){H.current=ee.pointerType},onPointerDown(ee){H.current=ee.pointerType,P.current=!0},onMouseUp(ee){if(a)return;if(P.current){P.current=!1;return}const X=!y.current.allowSelectedMouseUp&&L,V=!y.current.allowUnselectedMouseUp&&!L;X||V||H.current!=="touch"&&!M||G(ee.nativeEvent)}},J=ut("div",t,{ref:[I,n,f.ref,N],state:$,props:[F,K,d,B]}),Z=k.useMemo(()=>({selected:L,indexRef:Y,textRef:p,selectedByFocus:D,hasRegistered:W}),[L,Y,p,D,W]);return w.jsx(hR.Provider,{value:Z,children:J})})),Y8=k.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=g0();return s||o?w.jsx(X8,{...t,ref:n}):null}),X8=k.memo(k.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=g0(),a=k.useRef(null),{transitionStatus:c,setMounted:d}=xi(h),p=k.useMemo(()=>({selected:h,transitionStatus:c}),[h,c]),f=ut("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Hs});return Br({open:h,ref:a,onComplete(){h||d(!1)}}),f})),Q8=k.memo(k.forwardRef(function(t,n){const{indexRef:s,textRef:o,selectedByFocus:u,hasRegistered:h}=g0(),{selectedItemTextRef:a}=Vs(),{className:c,render:d,...p}=t,f=k.useCallback(b=>{if(!b||!h)return;const C=a.current===null||!a.current.isConnected;(u||C&&s.current===0)&&(a.current=b)},[a,s,u,h]);return ut("div",t,{ref:[f,n,o],props:p})})),pR=k.forwardRef(function(t,n){const{render:s,className:o,direction:u,keepMounted:h=!1,...a}=t,{store:c,popupRef:d,listRef:p,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:g}=Vs(),{side:b,scrollDownArrowRef:C,scrollUpArrowRef:x}=h0(),y=u==="up"?ht.scrollUpArrowVisible:ht.scrollDownArrowVisible,_=Te(c,y),v=Te(c,ht.openMethod),S=_&&v!=="touch",E=Qt(),T=u==="up"?x:C,{transitionStatus:A,setMounted:M}=xi(S);je(()=>(g.current+=1,c.state.hasScrollArrows||c.set("hasScrollArrows",!0),()=>{g.current=Math.max(0,g.current-1),g.current===0&&c.state.hasScrollArrows&&c.set("hasScrollArrows",!1)}),[c,g]),Br({open:S,ref:T,onComplete(){S||M(!1)}});const L=k.useMemo(()=>({direction:u,visible:S,side:b,transitionStatus:A}),[u,S,b,A]),U=ut("div",t,{ref:[n,T],state:L,props:[{"aria-hidden":!0,children:u==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(W){if(W.movementX===0&&W.movementY===0||E.isStarted())return;c.set("activeIndex",null);function N(){const Y=c.state.listElement??d.current;if(!Y)return;c.set("activeIndex",null),f();const $=Y.scrollTop===0,F=Math.round(Y.scrollTop+Y.clientHeight)>=Y.scrollHeight;if(p.current.length===0&&(u==="up"?c.set("scrollUpArrowVisible",!$):c.set("scrollDownArrowVisible",!F)),u==="up"&&$||u==="down"&&F){E.clear();return}if((c.state.listElement||d.current)&&p.current&&p.current.length>0){const H=p.current,P=T.current?.offsetHeight||0;if(u==="up"){let B=0;const I=Y.scrollTop+P;for(let K=0;K<H.length;K+=1){const J=H[K];if(J&&J.offsetTop>=I){B=K;break}}const G=Math.max(0,B-1);if(G<B){const K=H[G];K&&(Y.scrollTop=Math.max(0,K.offsetTop-P))}else Y.scrollTop=0}else{let B=H.length-1;const I=Y.scrollTop+Y.clientHeight-P;for(let K=0;K<H.length;K+=1){const J=H[K];if(J&&J.offsetTop+J.offsetHeight>I){B=Math.max(0,K-1);break}}const G=Math.min(H.length-1,B+1);if(G>B){const K=H[G];K&&(Y.scrollTop=K.offsetTop+K.offsetHeight-Y.clientHeight+P)}else Y.scrollTop=Y.scrollHeight-Y.clientHeight}}E.start(40,N)}E.start(40,N)},onMouseLeave(){E.clear()}},a]});return S||h?U:null}),Z8=k.forwardRef(function(t,n){return w.jsx(pR,{...t,ref:n,direction:"down"})}),J8=k.forwardRef(function(t,n){return w.jsx(pR,{...t,ref:n,direction:"up"})}),v0=E8;function _0({className:e,...t}){return w.jsx(L8,{"data-slot":"select-value",className:Be("flex flex-1 text-left",e),...t})}function y0({className:e,size:t="default",children:n,...s}){return w.jsxs(k8,{"data-slot":"select-trigger","data-size":t,className:Be("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...s,children:[n,w.jsx(A8,{render:w.jsx(Ee,{icon:e4,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function b0({className:e,children:t,side:n="bottom",sideOffset:s=4,align:o="center",alignOffset:u=0,alignItemWithTrigger:h=!0,...a}){return w.jsx(M8,{children:w.jsx(U8,{side:n,sideOffset:s,align:o,alignOffset:u,alignItemWithTrigger:h,className:"isolate z-50",children:w.jsxs(G8,{"data-slot":"select-content",className:Be("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto",e),...a,children:[w.jsx(eP,{}),w.jsx($8,{children:t}),w.jsx(tP,{})]})})})}function Ru({className:e,children:t,...n}){return w.jsxs(K8,{"data-slot":"select-item",className:Be("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[w.jsx(Q8,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),w.jsx(Y8,{render:w.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:w.jsx(Ee,{icon:ju,strokeWidth:2,className:"pointer-events-none"})})]})}function eP({className:e,...t}){return w.jsx(J8,{"data-slot":"select-scroll-up-button",className:Be("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 top-0 w-full",e),...t,children:w.jsx(Ee,{icon:D2,strokeWidth:2})})}function tP({className:e,...t}){return w.jsx(Z8,{"data-slot":"select-scroll-down-button",className:Be("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 bottom-0 w-full",e),...t,children:w.jsx(Ee,{icon:L2,strokeWidth:2})})}const mR=k.createContext(void 0);function S0(){const e=k.useContext(mR);if(e===void 0)throw new Error(It(64));return e}let nP=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const x0={tabActivationDirection:e=>({[nP.activationDirection]:e})},rP=k.forwardRef(function(t,n){const{className:s,defaultValue:o=0,onValueChange:u,orientation:h="horizontal",render:a,value:c,...d}=t,p=wa(),f=Object.hasOwn(t,"defaultValue"),g=k.useRef([]),[b,C]=k.useState(()=>new Map),[x,y]=Ps({controlled:c,default:o,name:"Tabs",state:"value"}),_=c!==void 0,[v,S]=k.useState(()=>new Map),[E,T]=k.useState("none"),A=De((q,H)=>{u?.(q,H),!H.isCanceled&&(y(q),T(H.activationDirection))}),M=De((q,H)=>{C(P=>{if(P.get(q)===H)return P;const B=new Map(P);return B.set(q,H),B})}),L=De((q,H)=>{C(P=>{if(!P.has(q)||P.get(q)!==H)return P;const B=new Map(P);return B.delete(q),B})}),D=k.useCallback(q=>b.get(q),[b]),U=k.useCallback(q=>{for(const H of v.values())if(q===H?.value)return H?.id},[v]),z=k.useCallback(q=>{if(q===void 0)return null;for(const[H,P]of v.entries())if(P!=null&&q===(P.value??P.index))return H;return null},[v]),W=k.useMemo(()=>({direction:p,getTabElementBySelectedValue:z,getTabIdByPanelValue:U,getTabPanelIdByValue:D,onValueChange:A,orientation:h,registerMountedTabPanel:M,setTabMap:S,unregisterMountedTabPanel:L,tabActivationDirection:E,value:x}),[p,z,U,D,A,h,M,S,L,E,x]),N=k.useMemo(()=>{for(const q of v.values())if(q!=null&&q.value===x)return q},[v,x]),Y=k.useMemo(()=>{for(const q of v.values())if(q!=null&&!q.disabled)return q.value},[v]);je(()=>{if(_||v.size===0)return;const q=N?.disabled,H=N==null&&x!==null;if(f&&q&&x===o||!q&&!H)return;const B=Y??null;x!==B&&(y(B),T("none"))},[o,Y,f,_,N,T,y,v,x]);const F=ut("div",t,{state:{orientation:h,tabActivationDirection:E},ref:n,props:d,stateAttributesMapping:x0});return w.jsx(mR.Provider,{value:W,children:w.jsx(Gu,{elementsRef:g,children:F})})}),gR="data-composite-item-active";function vR(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=B_(),{ref:o,index:u}=$u(e),h=n===u,a=k.useRef(null),c=ns(o,a);return{compositeProps:k.useMemo(()=>({tabIndex:h?0:-1,onFocus(){s(u)},onMouseMove(){const p=a.current;if(!t||!p)return;const f=p.hasAttribute("disabled")||p.ariaDisabled==="true";!h&&!f&&p.focus()}}),[h,s,u,t]),compositeRef:c,index:u}}const _R=k.createContext(void 0);function sP(){const e=k.useContext(_R);if(e===void 0)throw new Error(It(65));return e}const iP=k.forwardRef(function(t,n){const{className:s,disabled:o=!1,render:u,value:h,id:a,nativeButton:c=!0,...d}=t,{value:p,getTabPanelIdByValue:f,orientation:g}=S0(),{activateOnFocus:b,highlightedTabIndex:C,onTabActivation:x,setHighlightedTabIndex:y,tabsListElement:_}=sP(),v=Pr(a),S=k.useMemo(()=>({disabled:o,id:v,value:h}),[o,v,h]),{compositeProps:E,compositeRef:T,index:A}=vR({metadata:S}),M=h===p,L=k.useRef(!1);je(()=>{if(L.current){L.current=!1;return}if(!(M&&A>-1&&C!==A))return;const P=_;if(P!=null){const B=ds(pr(P));if(B&&ft(P,B))return}o||y(A)},[M,A,C,y,o,_]);const{getButtonProps:D,buttonRef:U}=jr({disabled:o,native:c,focusableWhenDisabled:!0}),z=f(h),W=k.useRef(!1),N=k.useRef(!1);function Y(P){M||o||x(h,Ue(Pn,P.nativeEvent,void 0,{activationDirection:"none"}))}function $(P){M||(A>-1&&!o&&y(A),!o&&b&&(!W.current||W.current&&N.current)&&x(h,Ue(Pn,P.nativeEvent,void 0,{activationDirection:"none"})))}function F(P){if(M||o)return;W.current=!0;function B(){W.current=!1,N.current=!1}(!P.button||P.button===0)&&(N.current=!0,pr(P.currentTarget).addEventListener("pointerup",B,{once:!0}))}const q=k.useMemo(()=>({disabled:o,active:M,orientation:g}),[o,M,g]);return ut("button",t,{state:q,ref:[n,U,T],props:[E,{role:"tab","aria-controls":z,"aria-selected":M,id:v,onClick:Y,onFocus:$,onPointerDown:F,[gR]:M?"":void 0,onKeyDownCapture(){L.current=!0}},d,D]})});let oP=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const aP=k.forwardRef(function(t,n){const{className:s,value:o,render:u,keepMounted:h=!1,...a}=t,{value:c,getTabIdByPanelValue:d,orientation:p,tabActivationDirection:f,registerMountedTabPanel:g,unregisterMountedTabPanel:b}=S0(),C=Pr(),x=k.useMemo(()=>({id:C,value:o}),[C,o]),{ref:y,index:_}=$u({metadata:x}),v=o!==c,S=d(o),E=k.useMemo(()=>({hidden:v,orientation:p,tabActivationDirection:f}),[v,p,f]),T=ut("div",t,{state:E,ref:[n,y],props:[{"aria-labelledby":S,hidden:v,id:C??void 0,role:"tabpanel",tabIndex:v?-1:0,[oP.index]:_},a],stateAttributesMapping:x0});return je(()=>{if(!(v&&!h)&&C!=null)return g(o,C),()=>{b(o,C)}},[v,h,o,C,g,b]),!v||h?T:null});function lP(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const cP=[];function uP(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:o=!1,orientation:u="both",direction:h,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:d,enableHomeAndEndKeys:p=!1,stopEventPropagation:f=!1,disabledIndices:g,modifierKeys:b=cP}=e,[C,x]=k.useState(0),y=n>1,_=k.useRef(null),v=ns(_,d),S=k.useRef([]),E=k.useRef(!1),T=a??C,A=De((D,U=!1)=>{if((c??x)(D),U){const z=S.current[D];tC(_.current,z,h,u)}}),M=De(D=>{if(D.size===0||E.current)return;E.current=!0;const U=Array.from(D.keys()),z=U.find(N=>N?.hasAttribute(gR))??null,W=z?U.indexOf(z):-1;W!==-1&&A(W),tC(_.current,z,h,u)}),L=k.useMemo(()=>({"aria-orientation":u==="both"?void 0:u,ref:v,onFocus(D){!_.current||!eC(D.target)||D.target.setSelectionRange(0,D.target.value.length??0)},onKeyDown(D){const U=p?U6:GE;if(!U.has(D.key)||dP(D,b)||!_.current)return;const W=h==="rtl",N=W?wu:Rl,Y={horizontal:N,vertical:Zo,both:N}[u],$=W?Rl:wu,F={horizontal:$,vertical:El,both:$}[u];if(eC(D.target)&&!lP(D.target)){const K=D.target.selectionStart,J=D.target.selectionEnd,Z=D.target.value??"";if(K==null||D.shiftKey||K!==J||D.key!==F&&K<Z.length||D.key!==Y&&K>0)return}let q=T;const H=rh(S,g),P=Qv(S,g);if(y){const K=t||Array.from({length:S.current.length},()=>({width:1,height:1})),J=iE(K,n,o),Z=J.findIndex(X=>X!=null&&!uo(S,X,g)),ee=J.reduce((X,V,se)=>V!=null&&!uo(S,V,g)?se:X,-1);q=J[sE({current:J.map(X=>X?S.current[X]:null)},{event:D,orientation:u,loopFocus:s,cols:n,disabledIndices:aE([...g||S.current.map((X,V)=>uo(S,V)?V:void 0),void 0],J),minIndex:Z,maxIndex:ee,prevIndex:oE(T>P?H:T,K,J,n,D.key===Zo?"bl":D.key===Rl?"tr":"tl"),rtl:W})]}const B={horizontal:[N],vertical:[Zo],both:[N,Zo]}[u],I={horizontal:[$],vertical:[El],both:[$,El]}[u],G=y?U:{horizontal:p?V6:WE,vertical:p?F6:qE,both:U}[u];p&&(D.key===Fu?q=H:D.key===Uu&&(q=P)),q===T&&(B.includes(D.key)||I.includes(D.key))&&(s&&q===P&&B.includes(D.key)?q=H:s&&q===H&&I.includes(D.key)?q=P:q=Un(S,{startingIndex:q,decrement:I.includes(D.key),disabledIndices:g})),q!==T&&!Sl(S,q)&&(f&&D.stopPropagation(),G.has(D.key)&&D.preventDefault(),A(q,!0),queueMicrotask(()=>{S.current[q]?.focus()}))}}),[n,o,h,g,S,p,T,y,t,s,v,b,A,u,f]);return k.useMemo(()=>({props:L,highlightedIndex:T,onHighlightedIndexChange:A,elementsRef:S,disabledIndices:g,onMapChange:M,relayKeyboardEvent:L.onKeyDown}),[L,T,A,S,g,M])}function dP(e,t){for(const n of K6.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function fP(e){const{render:t,className:n,refs:s=hr,props:o=hr,state:u=en,stateAttributesMapping:h,highlightedIndex:a,onHighlightedIndexChange:c,orientation:d,dense:p,itemSizes:f,loopFocus:g,cols:b,enableHomeAndEndKeys:C,onMapChange:x,stopEventPropagation:y=!0,rootRef:_,disabledIndices:v,modifierKeys:S,highlightItemOnHover:E=!1,tag:T="div",...A}=e,M=wa(),{props:L,highlightedIndex:D,onHighlightedIndexChange:U,elementsRef:z,onMapChange:W,relayKeyboardEvent:N}=uP({itemSizes:f,cols:b,loopFocus:g,dense:p,orientation:d,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:_,stopEventPropagation:y,enableHomeAndEndKeys:C,direction:M,disabledIndices:v,modifierKeys:S}),Y=ut(T,e,{state:u,ref:s,props:[L,...o,A],stateAttributesMapping:h}),$=k.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:U,highlightItemOnHover:E,relayKeyboardEvent:N}),[D,U,E,N]);return w.jsx(d2.Provider,{value:$,children:w.jsx(Gu,{elementsRef:z,onMapChange:F=>{x?.(F),W(F)},children:Y})})}const hP=k.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:o,loopFocus:u=!0,render:h,...a}=t,{getTabElementBySelectedValue:c,onValueChange:d,orientation:p,value:f,setTabMap:g,tabActivationDirection:b}=S0(),[C,x]=k.useState(0),[y,_]=k.useState(null),v=pP(f,p,y,c),S=De((M,L)=>{if(M!==f){const D=v(M);L.activationDirection=D,d(M,L)}}),E=k.useMemo(()=>({orientation:p,tabActivationDirection:b}),[p,b]),T={"aria-orientation":p==="vertical"?"vertical":void 0,role:"tablist"},A=k.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:C,onTabActivation:S,setHighlightedTabIndex:x,tabsListElement:y,value:f}),[s,C,S,x,y,f]);return w.jsx(_R.Provider,{value:A,children:w.jsx(fP,{render:h,className:o,state:E,refs:[n,_],props:[T,a],stateAttributesMapping:x0,highlightedIndex:C,enableHomeAndEndKeys:!0,loopFocus:u,orientation:p,onHighlightedIndexChange:x,onMapChange:g,disabledIndices:hr})})});function cC(e,t){const{left:n,top:s}=e.getBoundingClientRect(),{left:o,top:u}=t.getBoundingClientRect(),h=n-o,a=s-u;return{left:h,top:a}}function pP(e,t,n,s){const[o,u]=k.useState(null);return je(()=>{if(e==null||n==null){u(null);return}const h=s(e);if(h==null){u(null);return}const{left:a,top:c}=cC(h,n);u(t==="horizontal"?a:c)},[t,s,n,e]),k.useCallback(h=>{if(h===e)return"none";if(h==null)return u(null),"none";if(h!=null&&n!=null){const a=s(h);if(a!=null){const{left:c,top:d}=cC(a,n);if(o==null)return u(t==="horizontal"?c:d),"none";if(t==="horizontal"){if(c<o)return u(c),"left";if(c>o)return u(c),"right"}else{if(d<o)return u(d),"up";if(d>o)return u(d),"down"}}}return"none"},[s,t,o,n,e])}function C0({className:e,orientation:t="horizontal",...n}){return w.jsx(rP,{"data-slot":"tabs","data-orientation":t,className:Be("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const mP=Fl("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function w0({className:e,variant:t="default",...n}){return w.jsx(hP,{"data-slot":"tabs-list","data-variant":t,className:Be(mP({variant:t}),e),...n})}function kl({className:e,...t}){return w.jsx(iP,{"data-slot":"tabs-trigger",className:Be("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function pu({className:e,...t}){return w.jsx(aP,{"data-slot":"tabs-content",className:Be("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function gP(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:u,actionsRef:h,handle:a,triggerId:c,defaultTriggerId:d=null}=e,p=bi(),f=!!p,g=Wn(()=>a?.store??new XE({open:n??s,activeTriggerId:c!==void 0?c:d,modal:!0,disablePointerDismissal:!0,nested:f,role:"alertdialog"})).current;g.useControlledProp("open",n,s),g.useControlledProp("activeTriggerId",c,d),g.useSyncedValue("nested",f),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",u);const b=g.useState("payload");YE({store:g,actionsRef:h,parentContext:p?.store.context});const C=k.useMemo(()=>({store:g}),[g]);return w.jsx(W_.Provider,{value:C,children:typeof t=="function"?t({payload:b}):t})}const yR=k.createContext(void 0),bR=k.createContext(void 0),SR=k.createContext(void 0),xR=k.createContext("");function Ci(){const e=k.useContext(yR);if(!e)throw new Error(It(22));return e}function vp(){const e=k.useContext(bR);if(!e)throw new Error(It(23));return e}function Ea(){const e=k.useContext(SR);if(!e)throw new Error(It(24));return e}function E0(){return k.useContext(xR)}const qe={id:xe(e=>e.id),query:xe(e=>e.query),items:xe(e=>e.items),selectedValue:xe(e=>e.selectedValue),open:xe(e=>e.open),mounted:xe(e=>e.mounted),forceMounted:xe(e=>e.forceMounted),inline:xe(e=>e.inline),activeIndex:xe(e=>e.activeIndex),selectedIndex:xe(e=>e.selectedIndex),isActive:xe((e,t)=>e.activeIndex===t),isSelected:xe((e,t)=>{const n=e.isItemEqualToValue,s=e.selectedValue;return Array.isArray(s)?s.some(o=>yi(o,t,n)):yi(s,t,n)}),transitionStatus:xe(e=>e.transitionStatus),popupProps:xe(e=>e.popupProps),inputProps:xe(e=>e.inputProps),triggerProps:xe(e=>e.triggerProps),getItemProps:xe(e=>e.getItemProps),positionerElement:xe(e=>e.positionerElement),listElement:xe(e=>e.listElement),triggerElement:xe(e=>e.triggerElement),inputElement:xe(e=>e.inputElement),popupSide:xe(e=>e.popupSide),openMethod:xe(e=>e.openMethod),inputInsidePopup:xe(e=>e.inputInsidePopup),selectionMode:xe(e=>e.selectionMode),listRef:xe(e=>e.listRef),labelsRef:xe(e=>e.labelsRef),popupRef:xe(e=>e.popupRef),emptyRef:xe(e=>e.emptyRef),inputRef:xe(e=>e.inputRef),keyboardActiveRef:xe(e=>e.keyboardActiveRef),chipsContainerRef:xe(e=>e.chipsContainerRef),clearRef:xe(e=>e.clearRef),valuesRef:xe(e=>e.valuesRef),allValuesRef:xe(e=>e.allValuesRef),name:xe(e=>e.name),disabled:xe(e=>e.disabled),readOnly:xe(e=>e.readOnly),required:xe(e=>e.required),grid:xe(e=>e.grid),isGrouped:xe(e=>e.isGrouped),virtualized:xe(e=>e.virtualized),onOpenChangeComplete:xe(e=>e.onOpenChangeComplete),openOnInputClick:xe(e=>e.openOnInputClick),itemToStringLabel:xe(e=>e.itemToStringLabel),isItemEqualToValue:xe(e=>e.isItemEqualToValue),modal:xe(e=>e.modal),autoHighlight:xe(e=>e.autoHighlight),submitOnItemClick:xe(e=>e.submitOnItemClick)};function vP(e,t){return(n,s)=>{if(n==null)return!1;const o=kn(n,t);return e.contains(o,s)}}function _P(e,t,n){return(s,o)=>{if(s==null)return!1;if(!o)return!0;const u=kn(s,t),h=n!=null?kn(n,t):"";return h&&e.contains(h,o)&&h.length===o.length?!0:e.contains(u,o)}}const uC=new Map;function CR(e){return Array.isArray(e)?e.map(t=>CR(t)).join(","):e==null?"":String(e)}function yP(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${CR(e.locale)}|${JSON.stringify(t)}`,s=uC.get(n);if(s)return s;const o=new Intl.Collator(e.locale,t),u={contains(h,a,c){if(!a)return!0;const d=kn(h,c);for(let p=0;p<=d.length-a.length;p+=1)if(o.compare(d.slice(p,p+a.length),a)===0)return!0;return!1},startsWith(h,a,c){if(!a)return!0;const d=kn(h,c);return o.compare(d.slice(0,a.length),a)===0},endsWith(h,a,c){if(!a)return!0;const d=kn(h,c),p=a.length;return d.length>=p&&o.compare(d.slice(d.length-p),a)===0}};return uC.set(n,u),u}const bP=yP,wR=Symbol("none"),Ho={value:wR,index:-1};function SP(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:s=null,selectedValue:o,onSelectedValueChange:u,defaultInputValue:h,inputValue:a,selectionMode:c="none",onItemHighlighted:d,name:p,disabled:f=!1,readOnly:g=!1,required:b=!1,inputRef:C,grid:x=!1,items:y,filteredItems:_,filter:v,openOnInputClick:S=!0,autoHighlight:E=!1,keepHighlight:T=!1,highlightItemOnHover:A=!0,itemToStringLabel:M,itemToStringValue:L,isItemEqualToValue:D=sR,virtualized:U=!1,inline:z=!1,fillInputOnItemPress:W=!0,modal:N=!1,limit:Y=-1,autoComplete:$="list",locale:F,submitOnItemClick:q=!1}=e,{clearErrors:H}=Wu(),{setDirty:P,validityData:B,shouldValidateOnChange:I,setFilled:G,name:K,disabled:J,validation:Z}=rs(),ee=pp({id:t}),X=bP({locale:F}),[V,se]=k.useState(!1),[re,ne]=k.useState(null),oe=k.useRef([]),ce=k.useRef([]),ve=k.useRef(null),ge=k.useRef(null),he=k.useRef(null),de=k.useRef(!0),Le=k.useRef(!1),Oe=k.useRef(null),Ne=k.useRef(null),ye=k.useRef(null),Ae=k.useRef(Ho),ae=k.useRef(null),be=k.useRef([]),Ce=k.useRef([]),We=J||f,rt=K??p,ze=c==="multiple",Me=c==="single",He=a!==void 0||h!==void 0,dt=y!==void 0,$e=_!==void 0;let et;E==="always"?et="always":et=E?"input-change":!1;const[Re,tt]=Ps({controlled:o,default:ze?s??hr:s,name:"Combobox",state:"selectedValue"}),at=k.useMemo(()=>v===null?()=>!0:v!==void 0?v:Me&&!V?_P(X,M,Re):vP(X,M),[v,Me,Re,V,X,M]),Xe=Wn(()=>He?h??"":Me?kn(Re,M):"").current,[st,Ct]=Ps({controlled:a,default:Xe,name:"Combobox",state:"inputValue"}),[lt,tn]=Ps({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),kt=oR(y),vt=re??(st===""?"":String(st).trim()),Je=Me?kn(Re,M):"",Ot=Me&&!V&&vt!==""&&Je!==""&&Je.length===vt.length&&X.contains(Je,vt),Nt=Ot?"":vt,ot=dt&&$e&&Ot,wt=k.useMemo(()=>y?kt?y.flatMap(Fe=>Fe.items):y:hr,[y,kt]),bt=k.useMemo(()=>{if(_&&!ot)return _;if(!y)return hr;if(kt){const nt=y,mt=[];let Gt=0;for(const nn of nt){if(Y>-1&&Gt>=Y)break;const mn=Nt===""?nn.items:nn.items.filter(Ks=>at(Ks,Nt,M));if(mn.length===0)continue;const Gs=Y>-1?Y-Gt:1/0,$s=mn.slice(0,Gs);if($s.length>0){const Ks={...nn,items:$s};mt.push(Ks),Gt+=$s.length}}return mt}if(Nt==="")return Y>-1?wt.slice(0,Y):wt;const Fe=[];for(const nt of wt){if(Y>-1&&Fe.length>=Y)break;at(nt,Nt,M)&&Fe.push(nt)}return Fe},[_,ot,y,kt,Nt,Y,at,M,wt]),St=k.useMemo(()=>kt?bt.flatMap(nt=>nt.items):bt,[bt,kt]),Qe=Wn(()=>new ca({id:ee,selectedValue:Re,open:lt,filter:at,query:vt,items:y,selectionMode:c,listRef:oe,labelsRef:ce,popupRef:ve,emptyRef:he,inputRef:ge,keyboardActiveRef:de,chipsContainerRef:Oe,clearRef:Ne,valuesRef:be,allValuesRef:Ce,selectionEventRef:ye,name:rt,disabled:We,readOnly:g,required:b,grid:x,isGrouped:kt,virtualized:U,openOnInputClick:S,itemToStringLabel:M,isItemEqualToValue:D,modal:N,autoHighlight:et,submitOnItemClick:q,hasInputValue:He,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:z,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||rn,setOpen:rn,setInputValue:rn,setSelectedValue:rn,setIndices:rn,onItemHighlighted:rn,handleSelection:rn,getItemProps:()=>en,forceMount:rn,requestSubmit:rn})).current,Ht=c==="none"?st:Re,Cn=k.useMemo(()=>c==="none"?Ht:Array.isArray(Re)?Re.map(Fe=>fs(Fe,L)):fs(Re,L),[Ht,L,c,Re]),Gn=De(d),Bn=De(n),gs=Te(Qe,qe.activeIndex),Da=Te(Qe,qe.selectedIndex),gr=Te(Qe,qe.positionerElement),fn=Te(Qe,qe.listElement),hn=Te(Qe,qe.triggerElement),vs=Te(Qe,qe.inputElement),vr=Te(Qe,qe.inline),Us=Te(Qe,qe.inputInsidePopup),Tp=dn(hn),{mounted:nc,setMounted:bo,transitionStatus:So}=xi(lt),{openMethod:Ws,triggerProps:_s,reset:xo}=hp(lt);qu({id:ee,name:rt,commit:Z.commit,value:Ht,controlRef:Us?Tp:ge,getValue:()=>Cn});const ss=De(()=>{y?ce.current=St.map(Fe=>kn(Fe,M)):Qe.set("forceMounted",!0)}),pn=k.useRef(Re);je(()=>{Re!==pn.current&&ss()},[ss,Re]);const Zn=De(Fe=>{Qe.update(Fe);const nt=Fe.type||"none";if(Fe.activeIndex!==void 0)if(Fe.activeIndex===null)Ae.current!==Ho&&(Ae.current=Ho,Gn(void 0,eu(nt,void 0,{index:-1})));else{const mt=be.current[Fe.activeIndex];Ae.current={value:mt,index:Fe.activeIndex},Gn(mt,eu(nt,void 0,{index:Fe.activeIndex}))}}),Jn=De((Fe,nt)=>{if(Le.current=nt.reason===Ji,e.onInputValueChange?.(Fe,nt),!nt.isCanceled){if(nt.reason===Qo){const mt=Fe.trim()!=="";mt&&se(!0),ae.current={hasQuery:mt},mt&&et&&Qe.state.activeIndex==null&&Qe.set("activeIndex",0)}Ct(Fe)}}),_r=De((Fe,nt)=>{lt!==Fe&&(nt.reason==="escape-key"&&dt&&St.length===0&&!Qe.state.emptyRef.current&&nt.allowPropagation(),e.onOpenChange?.(Fe,nt),!nt.isCanceled&&(!Fe&&V&&(Me?(ne(vt),vt===""&&se(!1)):ze&&(vr||Us?Zn({activeIndex:null}):ne(vt),Jn("",Ue(Ji,nt.event)))),tn(Fe)))}),is=De((Fe,nt)=>{if(u?.(Fe,nt),nt.isCanceled)return;tt(Fe),(c==="none"&&ve.current&&W||Me&&!Qe.state.inputInsidePopup)&&Jn(kn(Fe,M),Ue(nt.reason,nt.event)),Me&&Fe!=null&&nt.reason!==Qo&&V&&ne(vt)}),Lp=De((Fe,nt)=>{let mt=nt;if(mt===void 0){if(gs===null)return;mt=be.current[gs]}const Gt=An(Fe),nn=ye.current??Fe;ye.current=null;const mn=Ue(aa,nn),Gs=Gt?.closest("a")?.getAttribute("href");if(Gs){Gs.startsWith("#")&&_r(!1,mn);return}if(ze){const $s=Array.isArray(Re)?Re:[],os=ea($s,mt,Qe.state.isItemEqualToValue)?iR($s,mt,Qe.state.isItemEqualToValue):[...$s,mt];if(is(os,mn),!(ge.current?ge.current.value.trim()!=="":!1))return;Qe.state.inputInsidePopup?Jn("",Ue(Ji,mn.event)):_r(!1,mn)}else is(mt,mn),_r(!1,mn)}),Pa=De(()=>{if(!Qe.state.submitOnItemClick)return;const Fe=Qe.state.inputElement?.form;Fe&&typeof Fe.requestSubmit=="function"&&Fe.requestSubmit()}),Ia=De(()=>{if(bo(!1),Bn?.(!1),se(!1),xo(),ne(null),Zn(c==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ze&&ge.current&&ge.current.value!==""&&!Le.current&&Jn("",Ue(Ji)),Me)if(Qe.state.inputInsidePopup)ge.current&&ge.current.value!==""&&Jn("",Ue(Ji));else{const Fe=kn(Re,M);ge.current&&ge.current.value!==Fe&&Jn(Fe,Ue(Fe===""?Ji:Pn))}}),Ap=k.useMemo(()=>vr&&gr?{current:gr.closest('[role="dialog"]')}:ve,[vr,gr]);Br({enabled:!e.actionsRef,open:lt,ref:Ap,onComplete(){lt||Ia()}}),k.useImperativeHandle(e.actionsRef,()=>({unmount:Ia}),[Ia]),je(function(){if(lt||c==="none")return;const nt=y?wt:Ce.current;if(ze){const mt=Array.isArray(Re)?Re:[],Gt=mt[mt.length-1],nn=jl(nt,Gt,D);Zn({selectedIndex:nn===-1?null:nn})}else{const mt=jl(nt,Re,D);Zn({selectedIndex:mt===-1?null:mt})}},[lt,Re,y,c,wt,ze,D,Zn]),je(()=>{y&&(be.current=St,oe.current.length=St.length)},[y,St]),je(()=>{const Fe=ae.current;if(Fe&&(Fe.hasQuery?et&&Qe.set("activeIndex",0):et==="always"&&Qe.set("activeIndex",0),ae.current=null),!lt&&!vr)return;const mt=dt||$e?St:be.current,Gt=Qe.state.activeIndex;if(Gt==null){if(et==="always"&&mt.length>0){Qe.set("activeIndex",0);return}Ae.current!==Ho&&(Ae.current=Ho,Qe.state.onItemHighlighted(void 0,eu(Pn,void 0,{index:-1})));return}if(Gt>=mt.length){Ae.current!==Ho&&(Ae.current=Ho,Qe.state.onItemHighlighted(void 0,eu(Pn,void 0,{index:-1}))),Qe.set("activeIndex",null);return}const nn=mt[Gt],mn=Ae.current.value,Gs=mn!==wR&&Qe.state.isItemEqualToValue(nn,mn);(Ae.current.index!==Gt||!Gs)&&(Ae.current={value:nn,index:Gt},Qe.state.onItemHighlighted(nn,eu(Pn,void 0,{index:Gt})))},[gs,et,$e,dt,St,vr,lt,Qe]),je(()=>{if(!y||c==="none")return;const Fe=wt;if(ze){const Gt=Array.isArray(Re)?Re:hr,nn=Gt.filter(mn=>ea(Fe,mn,Qe.state.isItemEqualToValue));nn.length!==Gt.length&&tt(nn);return}if(Re==null?!0:ea(Fe,Re,Qe.state.isItemEqualToValue))return;let mt=null;if(s!=null&&ea(Fe,s,Qe.state.isItemEqualToValue)&&(mt=s),tt(mt),!Qe.state.inputInsidePopup){const Gt=kn(mt,M);ge.current&&ge.current.value!==Gt&&Jn(Gt,Ue(Pn))}},[y,wt,ze,c,Re,s,tt,M,Qe,Jn]),je(()=>{if(c==="none"){G(String(st)!=="");return}G(ze?Array.isArray(Re)&&Re.length>0:Re!=null)},[G,c,st,Re,ze]),k.useEffect(()=>{dt&&et&&St.length===0&&Zn({activeIndex:null})},[dt,et,St.length,Zn]),ta(vt,()=>{!lt||vt===""||vt===String(Xe)||se(!0)}),ta(Re,()=>{if(c!=="none"&&(H(rt),P(Re!==B.initialValue),I()?Z.commit(Re):Z.commit(Re,!0),ze&&Qe.state.selectedIndex!==null&&(!Array.isArray(Re)||Re.length===0)&&Zn({activeIndex:null,selectedIndex:null}),Me&&!He&&!Us)){const Fe=kn(Re,M);st!==Fe&&Jn(Fe,Ue(Pn))}}),ta(st,()=>{c==="none"&&(H(rt),P(st!==B.initialValue),I()?Z.commit(st):Z.commit(st,!0))}),ta(y,()=>{if(!Me||He||Us||V)return;const Fe=kn(Re,M);st!==Fe&&Jn(Fe,Ue(Pn))});const qs=o0({open:vr?!0:lt,onOpenChange:_r,elements:{reference:Us?hn:vs,floating:gr}});let Ei,yr;vr||(Ei=x?"grid":"listbox",yr=lt?"true":"false");const sr=k.useMemo(()=>{const Fe=vs?.tagName==="INPUT",nt=Fe||lt,mt=Fe?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return nt&&(mt.role="combobox",mt["aria-expanded"]=yr,mt["aria-haspopup"]=Ei,mt["aria-controls"]=lt?fn?.id:void 0,mt["aria-autocomplete"]=$),{reference:mt,floating:{role:"presentation"}}},[vs,lt,yr,Ei,fn?.id,$]),cd=Vu(qs,{enabled:!g&&!We&&S,event:"mousedown-only",toggle:!1,touchOpenDelay:Us?0:50}),Op=ap(qs,{enabled:!g&&!We&&!vr,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:vr?!0:void 0,outsidePress(Fe){const nt=An(Fe);return!ft(hn,nt)&&!ft(Ne.current,nt)&&!ft(Oe.current,nt)}}),rc=a0(qs,{enabled:!g&&!We,id:ee,listRef:oe,activeIndex:gs,selectedIndex:Da,virtual:!0,loopFocus:!0,allowEscape:!et,focusItemOnOpen:V||c==="none"&&!et?!1:"auto",focusItemOnHover:A,resetOnPointerLeave:!T,cols:x?2:1,orientation:x?"horizontal":void 0,disabledIndices:hr,onNavigate(Fe,nt){!nt&&!lt||So==="ending"||Zn(nt?{activeIndex:Fe,type:de.current?"keyboard":"pointer"}:{activeIndex:Fe})}}),{getReferenceProps:Na,getFloatingProps:Ri,getItemProps:sc}=Kl([sr,cd,Op,rc]);eR(()=>{Qe.update({inline:z,popupProps:Ri(),inputProps:Na(),triggerProps:_s,getItemProps:sc,setOpen:_r,setInputValue:Jn,setSelectedValue:is,setIndices:Zn,onItemHighlighted:Gn,handleSelection:Lp,forceMount:ss,requestSubmit:Pa})}),je(()=>{Qe.update({id:ee,selectedValue:Re,open:lt,mounted:nc,transitionStatus:So,items:y,inline:z,popupProps:Ri(),inputProps:Na(),triggerProps:_s,openMethod:Ws,getItemProps:sc,selectionMode:c,name:rt,disabled:We,readOnly:g,required:b,grid:x,isGrouped:kt,virtualized:U,onOpenChangeComplete:Bn,openOnInputClick:S,itemToStringLabel:M,modal:N,autoHighlight:et,isItemEqualToValue:D,submitOnItemClick:q,hasInputValue:He,requestSubmit:Pa})},[Qe,ee,Re,lt,nc,So,y,Ri,Na,sc,Ws,_s,c,rt,We,g,b,Z,x,kt,U,Bn,S,M,N,D,q,He,z,Pa,et]);const ir=ns(C,Z.inputRef),ic=k.useMemo(()=>({query:vt,filteredItems:bt,flatFilteredItems:St}),[vt,bt,St]),ud=k.useMemo(()=>Array.isArray(Ht)?"":fs(Ht,L),[Ht,L]),oc=ze&&Array.isArray(Re)&&Re.length>0,ki=k.useMemo(()=>!ze||!Array.isArray(Re)||!rt?null:Re.map(Fe=>{const nt=fs(Fe,L);return w.jsx("input",{type:"hidden",name:rt,value:nt},nt)}),[ze,Re,rt,L]),dd=w.jsxs(k.Fragment,{children:[e.children,w.jsx("input",{...Z.getInputValidationProps({onFocus(){if(Us){hn?.focus();return}(ge.current||hn)?.focus()},onChange(Fe){if(Fe.nativeEvent.defaultPrevented)return;const nt=Fe.target.value,mt=Ue(Qo,Fe.nativeEvent);function Gt(){if(ze)return;if(c==="none"){P(nt!==B.initialValue),Jn(nt,mt),I()&&Z.commit(nt);return}const nn=be.current.find(mn=>fs(mn,L).toLowerCase()===nt.toLowerCase());nn!=null&&(P(nn!==B.initialValue),is?.(nn,mt),I()&&Z.commit(nn))}y?Gt():(ss(),queueMicrotask(Gt))}}),id:ee,name:ze||c==="none"?void 0:rt,disabled:We,required:b&&!oc,readOnly:g,value:ud,ref:ir,style:$l,tabIndex:-1,"aria-hidden":!0}),ki]});return w.jsx(yR.Provider,{value:Qe,children:w.jsx(bR.Provider,{value:qs,children:w.jsx(SR.Provider,{value:ic,children:w.jsx(xR.Provider,{value:st,children:dd})})})})}const Ff=2,xP={...bu,...Ca},CP=k.forwardRef(function(t,n){const{render:s,className:o,nativeButton:u=!0,disabled:h=!1,...a}=t,{state:c,disabled:d,setTouched:p,setFocused:f,validationMode:g,validation:b}=rs(),{labelId:C}=yo(),x=Ci(),y=Te(x,qe.selectionMode),_=Te(x,qe.disabled),v=Te(x,qe.readOnly),S=Te(x,qe.listElement),E=Te(x,qe.triggerProps),T=Te(x,qe.triggerElement),A=Te(x,qe.inputInsidePopup),M=Te(x,qe.open),L=Te(x,qe.selectedValue),D=Te(x,qe.activeIndex),U=Te(x,qe.selectedIndex),z=vp(),W=E0(),N=Qt(),Y=d||_||h,$=k.useRef("");function F(Z){$.current=Z.pointerType}const q=z.select("domReferenceElement");k.useEffect(()=>{A&&T&&T!==q&&z.set("domReferenceElement",T)},[T,q,z,A]);const{reference:H}=l0(z,{enabled:!M&&!v&&!_&&y==="single",listRef:x.state.labelsRef,activeIndex:D,selectedIndex:U,onMatch(Z){const ee=x.state.valuesRef.current[Z];ee!==void 0&&x.state.setSelectedValue(ee,Ue("none"))}}),{reference:P}=Vu(z,{enabled:!v&&!_,event:"mousedown"}),{buttonRef:B,getButtonProps:I}=jr({native:u,disabled:Y}),G=k.useMemo(()=>({...c,open:M,disabled:Y}),[c,M,Y]),K=De(Z=>{x.set("triggerElement",Z)});return ut("button",t,{ref:[n,B,K],state:G,props:[E,P,H,{tabIndex:A?0:-1,disabled:Y,role:A?"combobox":void 0,"aria-expanded":M?"true":"false","aria-haspopup":A?"dialog":"listbox","aria-controls":M?S?.id:void 0,"aria-readonly":v||void 0,"aria-labelledby":C,onPointerDown:F,onPointerEnter:F,onFocus(){f(!0),!(Y||v)&&N.start(0,x.state.forceMount)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const Z=y==="none"?W:L;b.commit(Z)}},onMouseDown(Z){if(Y||v||(A||z.set("domReferenceElement",Z.currentTarget),x.state.forceMount(),$.current!=="touch"&&(x.state.inputRef.current?.focus(),A||Z.preventDefault()),M))return;const ee=pr(Z.currentTarget);function X(V){if(!T)return;const se=An(V),re=x.state.positionerElement,ne=x.state.listElement;if(ft(T,se)||ft(re,se)||ft(ne,se)||se===T)return;const oe=d0(T),ce=V.clientX>=oe.left-Ff&&V.clientX<=oe.right+Ff,ve=V.clientY>=oe.top-Ff&&V.clientY<=oe.bottom+Ff;ce&&ve||x.state.setOpen(!1,Ue("cancel-open",V))}A&&ee.addEventListener("mouseup",X,{once:!0})},onKeyDown(Z){Y||v||(Z.key==="ArrowDown"||Z.key==="ArrowUp")&&(un(Z),x.state.setOpen(!0,Ue(hu,Z.nativeEvent)),x.state.inputRef.current?.focus())}},b?b.getValidationProps(a):a,I],stateAttributesMapping:xP})}),wP=k.createContext(void 0);function EP(){return k.useContext(wP)}const ER=k.createContext(void 0);function R0(e){const t=k.useContext(ER);if(t===void 0&&!e)throw new Error(It(21));return t}const RP={...bu,...Ca,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},kP=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,id:h,...a}=t,{state:c,disabled:d,setTouched:p,setFocused:f,validationMode:g,validation:b}=rs(),{labelId:C}=yo(),x=EP(),_=!!R0(!0),v=Ci(),{filteredItems:S}=Ea(),E=E0(),T=Pr(h),A=wa(),M=Te(v,qe.disabled),L=Te(v,qe.readOnly),D=Te(v,qe.name),U=Te(v,qe.selectionMode),z=Te(v,qe.autoHighlight),W=Te(v,qe.inputProps),N=Te(v,qe.triggerProps),Y=Te(v,qe.open),$=Te(v,qe.mounted),F=Te(v,qe.selectedValue),q=Te(v,qe.popupSide),H=Te(v,qe.positionerElement),P=!!z,B=$&&H?q:null,I=d||M||u,G=S.length===0,[K,J]=k.useState(null),Z=k.useRef(!1),ee=De(re=>{const ne=_||v.state.inline;ne&&!v.state.hasInputValue&&v.state.setInputValue("",Ue(Pn)),v.update({inputElement:re,inputInsidePopup:ne})}),X=k.useMemo(()=>({...c,open:Y,disabled:I,readOnly:L,popupSide:B,listEmpty:G}),[c,Y,I,L,B,G]);function V(re){if(!x)return;let ne;const{highlightedChipIndex:oe}=x;if(oe!==void 0){if(re.key==="ArrowLeft")re.preventDefault(),oe>0?ne=oe-1:ne=void 0;else if(re.key==="ArrowRight")re.preventDefault(),oe<F.length-1?ne=oe+1:ne=void 0;else if(re.key==="Backspace"||re.key==="Delete"){re.preventDefault();const ce=oe>=F.length-1?F.length-2:oe;ne=ce>=0?ce:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return ne}return re.key==="ArrowLeft"&&(re.currentTarget.selectionStart??0)===0&&F.length>0?(re.preventDefault(),ne=Math.max(F.length-1,0)):re.key==="Backspace"&&re.currentTarget.value===""&&F.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),re.preventDefault()),ne}return ut("input",t,{state:X,ref:[n,v.state.inputRef,ee],props:[W,N,{type:"text",value:t.value??K??E,"aria-readonly":L||void 0,"aria-labelledby":C,disabled:I,readOnly:L,...U==="none"&&D&&{name:D},id:T,onFocus(){f(!0)},onBlur(){if(p(!0),f(!1),g==="onBlur"){const re=U==="none"?E:F;b.commit(re)}},onCompositionStart(re){wh||(Z.current=!0,J(re.currentTarget.value))},onCompositionEnd(re){Z.current=!1;const ne=re.currentTarget.value;J(null),v.state.setInputValue(ne,Ue(Qo,re.nativeEvent))},onChange(re){if(Z.current){const ve=re.currentTarget.value;J(ve),ve===""&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,Ue(Ji,re.nativeEvent));const ge=ve.trim(),he=P&&ge!=="";!L&&!I&&ge!==""&&(v.state.setOpen(!0,Ue(Qo,re.nativeEvent)),P||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),Y&&v.state.activeIndex!==null&&!he&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"});return}v.state.setInputValue(re.currentTarget.value,Ue(Qo,re.nativeEvent));const ne=re.currentTarget.value==="",oe=Ue(Ji,re.nativeEvent);ne&&!v.state.inputInsidePopup&&(U==="single"&&v.state.setSelectedValue(null,oe),v.state.openOnInputClick||v.state.setOpen(!1,oe));const ce=re.currentTarget.value.trim();!L&&!I&&ce!==""&&(v.state.setOpen(!0,Ue(Qo,re.nativeEvent)),P||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),Y&&v.state.activeIndex!==null&&!P&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(re){if(I||L||re.ctrlKey||re.shiftKey||re.altKey||re.metaKey)return;v.state.keyboardActiveRef.current=!0;const ne=re.currentTarget,oe=ne.scrollWidth-ne.clientWidth,ce=A==="rtl";if(re.key==="Home"){un(re);const ge=Mx&&ce?ne.value.length:0;ne.setSelectionRange(ge,ge),ne.scrollLeft=0;return}if(re.key==="End"){un(re);const ge=Mx&&ce?0:ne.value.length;ne.setSelectionRange(ge,ge),ne.scrollLeft=ce?-oe:oe;return}if(!$&&re.key==="Escape"){const ge=U==="multiple"&&Array.isArray(F)?F.length===0:F===null,he=Ue(np,re.nativeEvent),de=U==="multiple"?[]:null;v.state.setInputValue("",he),v.state.setSelectedValue(de,he),!ge&&!v.state.inline&&!he.isPropagationAllowed&&re.stopPropagation();return}if(x&&re.key==="Backspace"&&ne.value===""&&x.highlightedChipIndex===void 0&&Array.isArray(F)&&F.length>0){const ge=F.slice(0,-1);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"}),v.state.setSelectedValue(ge,Ue(Pn,re.nativeEvent));return}const ve=V(re);if(x?.setHighlightedChipIndex(ve),ve!==void 0?x?.chipsRef.current[ve]?.focus():v.state.inputRef.current?.focus(),re.which!==229&&re.key==="Enter"&&Y){const ge=v.state.activeIndex,he=re.nativeEvent;if(ge===null){v.state.setOpen(!1,Ue(Pn,he));return}un(re);const de=v.state.listRef.current[ge];de&&(v.state.selectionEventRef.current=he,de.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},b?b.getValidationProps(a):a],stateAttributesMapping:RP})}),TP={...Hs,...q_},LP=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,keepMounted:a=!1,...c}=t,{disabled:d}=rs(),p=Ci(),f=Te(p,qe.selectionMode),g=Te(p,qe.disabled),b=Te(p,qe.readOnly),C=Te(p,qe.open),x=Te(p,qe.selectedValue),y=E0();let _=!1;f==="none"?_=y!=="":f==="single"?_=x!=null:_=Array.isArray(x)&&x.length>0;const v=d||g||u,{buttonRef:S,getButtonProps:E}=jr({native:h,disabled:v}),{mounted:T,transitionStatus:A,setMounted:M}=xi(_),L=k.useMemo(()=>({disabled:v,open:C,transitionStatus:A}),[v,C,A]);Br({open:_,ref:p.state.clearRef,onComplete(){_||M(!1)}});const D=ut("button",t,{state:L,ref:[n,S,p.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:v,"aria-readonly":b||void 0,onMouseDown(z){z.preventDefault()},onClick(z){if(v||b)return;const W=p.state.keyboardActiveRef;p.state.setInputValue("",Ue(Lx,z.nativeEvent)),f!=="none"?(p.state.setSelectedValue(Array.isArray(x)?[]:null,Ue(Lx,z.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:W.current?"keyboard":"pointer"})):p.state.setIndices({activeIndex:null,type:W.current?"keyboard":"pointer"}),p.state.inputRef.current?.focus()}},c,E],stateAttributesMapping:TP});return a||T?D:null}),AP=k.createContext(null);function OP(){return k.useContext(AP)}function MP(e){const{children:t}=e,{filteredItems:n}=Ea(),s=OP(),o=s?s.items:n;return o?w.jsx(k.Fragment,{children:o.map(t)}):null}const DP=k.forwardRef(function(t,n){var s;const{render:o,className:u,children:h,...a}=t,c=Ci(),d=vp(),p=!!R0(!0),{filteredItems:f}=Ea(),g=Te(c,qe.items),b=Te(c,qe.labelsRef),C=Te(c,qe.listRef),x=Te(c,qe.selectionMode),y=Te(c,qe.grid),_=Te(c,qe.popupProps),v=Te(c,qe.disabled),S=Te(c,qe.readOnly),E=Te(c,qe.virtualized),T=x==="multiple",A=f.length===0,M=De(N=>{c.set("positionerElement",N)}),L=De(N=>{c.set("listElement",N)}),D=k.useMemo(()=>typeof h=="function"?s||(s=w.jsx(MP,{children:h})):h,[h]),U=k.useMemo(()=>({empty:A}),[A]),z=d.useState("floatingId"),W=ut("div",t,{state:U,ref:[n,L,p?null:M],props:[_,{children:D,tabIndex:-1,id:z,role:y?"grid":"listbox","aria-multiselectable":T?"true":void 0,onKeyDown(N){if(!(v||S)&&N.key==="Enter"){const Y=c.state.activeIndex;if(Y==null)return;un(N);const $=N.nativeEvent,F=c.state.listRef.current[Y];F&&(c.state.selectionEventRef.current=$,F.click(),c.state.selectionEventRef.current=null)}},onKeyDownCapture(){c.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.state.keyboardActiveRef.current=!1}},a]});return E?W:w.jsx(Gu,{elementsRef:C,labelsRef:g?void 0:b,children:W})}),RR=k.createContext(void 0);function PP(){const e=k.useContext(RR);if(e===void 0)throw new Error(It(20));return e}const IP=k.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,u=Ci(),h=Te(u,qe.mounted),a=Te(u,qe.forceMounted);return h||s||a?w.jsx(RR.Provider,{value:s,children:w.jsx(sp,{ref:n,...o})}):null}),NP=k.forwardRef(function(t,n){const{render:s,className:o,anchor:u,positionMethod:h="absolute",side:a="bottom",align:c="center",sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:C=!1,disableAnchorTracking:x=!1,collisionAvoidance:y=H_,..._}=t,v=Ci(),{filteredItems:S}=Ea(),E=vp(),T=PP(),A=Te(v,qe.modal),M=Te(v,qe.open),L=Te(v,qe.mounted),D=Te(v,qe.openMethod),U=Te(v,qe.triggerElement),z=Te(v,qe.inputElement),W=Te(v,qe.inputInsidePopup),N=S.length===0,$=f0({anchor:u??(W?U:z),floatingRootContext:E,positionMethod:h,mounted:L,side:a,sideOffset:d,align:c,alignOffset:p,arrowPadding:b,collisionBoundary:f,collisionPadding:g,sticky:C,disableAnchorTracking:x,keepMounted:T,collisionAvoidance:y,lazyFlip:!0});fp(M&&A&&D!=="touch",U);const F=k.useMemo(()=>{const I={...$.positionerStyles};return M||(I.pointerEvents="none"),{role:"presentation",hidden:!L,style:I}},[M,L,$.positionerStyles]),q=k.useMemo(()=>({open:M,side:$.side,align:$.align,anchorHidden:$.anchorHidden,empty:N}),[M,$.side,$.align,$.anchorHidden,N]);je(()=>{v.set("popupSide",$.side)},[v,$.side]);const H=k.useMemo(()=>({side:$.side,align:$.align,arrowRef:$.arrowRef,arrowUncentered:$.arrowUncentered,arrowStyles:$.arrowStyles,anchorHidden:$.anchorHidden,isPositioned:$.isPositioned}),[$.side,$.align,$.arrowRef,$.arrowUncentered,$.arrowStyles,$.anchorHidden,$.isPositioned]),P=De(I=>{v.set("positionerElement",I)}),B=ut("div",t,{state:q,ref:[n,P],props:[F,_],stateAttributesMapping:go});return w.jsxs(ER.Provider,{value:H,children:[L&&A&&w.jsx(dp,{inert:up(!M),cutout:z??U}),B]})}),jP={...go,...Hs},BP=k.forwardRef(function(t,n){const{render:s,className:o,initialFocus:u,finalFocus:h,...a}=t,c=Ci(),d=R0(),p=vp(),{filteredItems:f}=Ea(),g=Te(c,qe.mounted),b=Te(c,qe.open),C=Te(c,qe.openMethod),x=Te(c,qe.transitionStatus),y=Te(c,qe.inputInsidePopup),_=Te(c,qe.inputElement),v=f.length===0;Br({open:b,ref:c.state.popupRef,onComplete(){b&&c.state.onOpenChangeComplete(!0)}});const S=k.useMemo(()=>({open:b,side:d.side,align:d.align,anchorHidden:d.anchorHidden,transitionStatus:x,empty:v}),[b,d.side,d.align,d.anchorHidden,x,v]),E=ut("div",t,{state:S,ref:[n,c.state.popupRef],props:[{role:y?"dialog":"presentation",tabIndex:-1,onFocus(L){const D=An(L.nativeEvent);C!=="touch"&&(ft(c.state.listElement,D)||D===L.currentTarget)&&c.state.inputRef.current?.focus()}},p0(x),a],stateAttributesMapping:jP}),A=u===void 0?y?L=>L==="touch"?c.state.popupRef.current:_:!1:u;let M;return h!=null?M=h:M=y?void 0:!1,w.jsx(ip,{context:p,disabled:!g,modal:!y,openInteractionType:C,initialFocus:A,returnFocus:M,children:E})}),kR=k.createContext(void 0);function TR(){const e=k.useContext(kR);if(!e)throw new Error(It(19));return e}const zP=k.createContext(!1);function HP(){return k.useContext(zP)}const VP=k.memo(k.forwardRef(function(t,n){const{render:s,className:o,value:u=null,index:h,disabled:a=!1,nativeButton:c=!1,...d}=t,p=k.useRef(!1),f=k.useRef(null),g=$u({index:h,textRef:f,indexGuessBehavior:m0.GuessFromOrder}),b=Ci(),C=HP(),{flatFilteredItems:x}=Ea(),y=Te(b,qe.open),_=Te(b,qe.selectionMode),v=Te(b,qe.readOnly),S=Te(b,qe.virtualized),E=Te(b,qe.isItemEqualToValue),T=_!=="none",A=h??(S?jl(x,u,E):g.index),M=g.index!==-1,L=Te(b,qe.id),D=Te(b,qe.isActive,A),U=Te(b,qe.isSelected,u),z=Te(b,qe.items),W=Te(b,qe.getItemProps),N=k.useRef(null),Y=L!=null&&M?`${L}-${A}`:void 0,$=U&&T;je(()=>{if(!(M&&(S||h!=null)))return;const Z=b.state.listRef.current;return Z[A]=N.current,()=>{delete Z[A]}},[M,S,A,h,b]),je(()=>{if(!M||z)return;const J=b.state.valuesRef.current;return J[A]=u,_!=="none"&&b.state.allValuesRef.current.push(u),()=>{delete J[A]}},[M,z,A,u,b,_]),je(()=>{if(!y){p.current=!1;return}if(!M||z)return;const J=b.state.selectedValue,Z=Array.isArray(J)?J[J.length-1]:J;yi(Z,u,E)&&b.set("selectedIndex",A)},[M,z,y,b,A,u,E]);const F=k.useMemo(()=>({disabled:a,selected:$,highlighted:D}),[a,$,D]),q=W({active:D,selected:$});q.id=void 0,q.onFocus=void 0;const{getButtonProps:H,buttonRef:P}=jr({disabled:a,focusableWhenDisabled:!0,native:c});function B(J){function Z(){b.state.handleSelection(J,u)}b.state.submitOnItemClick?(Qn.flushSync(Z),b.state.requestSubmit()):Z()}const I={id:Y,role:C?"gridcell":"option","aria-disabled":a||void 0,"aria-selected":T?$:void 0,tabIndex:void 0,onPointerDownCapture(J){p.current=!0,J.preventDefault()},onClick(J){a||v||B(J.nativeEvent)},onMouseUp(J){const Z=p.current;p.current=!1,!(a||v||J.button!==0||Z||!D)&&B(J.nativeEvent)}},G=ut("div",t,{ref:[P,n,g.ref,N],state:F,props:[q,I,d,H]}),K=k.useMemo(()=>({selected:$,textRef:f}),[$,f]);return w.jsx(kR.Provider,{value:K,children:G})})),FP=k.forwardRef(function(t,n){const{render:s,className:o,children:u,...h}=t,{filteredItems:a}=Ea(),c=Ci(),d=a.length===0?u:null;return ut("div",t,{ref:[n,c.state.emptyRef],props:[{children:d,role:"status","aria-live":"polite","aria-atomic":!0},h]})});let dC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function LR(e){return k.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[dC.checked]:""}:{[dC.unchecked]:""}},...Ca}),[e.indeterminate])}const AR=k.createContext(void 0);function UP(){const e=k.useContext(AR);if(e===void 0)throw new Error(It(14));return e}const WP="data-parent",qP=k.forwardRef(function(t,n){const{checked:s,className:o,defaultChecked:u=!1,disabled:h=!1,id:a,indeterminate:c=!1,inputRef:d,name:p,onCheckedChange:f,parent:g=!1,readOnly:b=!1,render:C,required:x=!1,uncheckedValue:y,value:_,nativeButton:v=!1,...S}=t,{clearErrors:E}=Wu(),{disabled:T,name:A,setDirty:M,setFilled:L,setFocused:D,setTouched:U,state:z,validationMode:W,validityData:N,shouldValidateOnChange:Y,validation:$}=rs(),F=m8(),{labelId:q,controlId:H,setControlId:P,getDescriptionProps:B}=yo(),I=v8(),G=I?.parent,K=G&&I.allValues,J=T||F.disabled||I?.disabled||h,Z=A??p,ee=_??Z,X=Pr(),V=Pr();let se=H;K?se=g?V:`${G.id}-${ee}`:a&&(se=a);let re={};K&&(g?re=I.parent.getParentProps():ee&&(re=I.parent.getChildProps(ee)));const ne=De(f),{checked:oe=s,indeterminate:ce=c,onCheckedChange:ve,...ge}=re,he=I?.value,de=I?.setValue,Le=I?.defaultValue,Oe=k.useRef(null),{getButtonProps:Ne,buttonRef:ye}=jr({disabled:J,native:v}),Ae=I?.validation??$,[ae,be]=Ps({controlled:ee&&he&&!g?he.includes(ee):oe,default:ee&&Le&&!g?Le.includes(ee):u,name:"Checkbox",state:"checked"});je(()=>{if(P!==rn)return P(se),()=>{P(void 0)}},[se,I,P,g]),qu({enabled:!I,id:X,commit:Ae.commit,value:ae,controlRef:Oe,name:Z,getValue:()=>ae});const Ce=k.useRef(null),We=ns(d,Ce,Ae.inputRef);je(()=>{Ce.current&&(Ce.current.indeterminate=ce,ae&&L(!0))},[ae,ce,L]),ta(ae,()=>{I&&!g||(E(Z),L(ae),M(ae!==N.initialValue),Y()?Ae.commit(ae):Ae.commit(ae,!0))});const rt=Bs({checked:ae,disabled:J,name:g?void 0:Z,id:se??void 0,required:x,ref:We,style:$l,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(et){if(et.nativeEvent.defaultPrevented)return;const Re=et.target.checked,tt=Ue(Pn,et.nativeEvent);if(ve?.(Re,tt),ne(Re,tt),!tt.isCanceled&&(be(Re),ee&&he&&de&&!g)){const at=Re?[...he,ee]:he.filter(Xe=>Xe!==ee);de(at,tt)}},onFocus(){Oe.current?.focus()}},_!==void 0?{value:(I?ae&&_:_)||""}:en,B,I?Ae.getValidationProps:Ae.getInputValidationProps),ze=K?!!oe:ae,Me=K&&ce||c;k.useEffect(()=>{G&&ee&&G.disabledStatesRef.current.set(ee,J)},[G,J,ee]);const He=k.useMemo(()=>({...z,checked:ze,disabled:J,readOnly:b,required:x,indeterminate:Me}),[z,ze,J,b,x,Me]),dt=LR(He),$e=ut("span",t,{state:He,ref:[ye,Oe,n,I?.registerControlRef],props:[{id:X,role:"checkbox","aria-checked":ce?"mixed":ae,"aria-readonly":b||void 0,"aria-required":x||void 0,"aria-labelledby":q,[WP]:g?"":void 0,onFocus(){D(!0)},onBlur(){const et=Ce.current;et&&(U(!0),D(!1),W==="onBlur"&&Ae.commit(I?he:et.checked))},onClick(et){b||J||(et.preventDefault(),Ce.current?.click())}},B,Ae.getValidationProps,S,ge,Ne],stateAttributesMapping:dt});return w.jsxs(AR.Provider,{value:He,children:[$e,!ae&&!I&&Z&&!g&&y!==void 0&&w.jsx("input",{type:"hidden",name:Z,value:y}),w.jsx("input",{...rt})]})}),GP=k.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=UP(),c=a.checked||a.indeterminate,{transitionStatus:d,setMounted:p}=xi(c),f=k.useRef(null),g=k.useMemo(()=>({...a,transitionStatus:d}),[a,d]);Br({open:c,ref:f,onComplete(){c||p(!1)}});const b=LR(a),C=k.useMemo(()=>({...b,...Hs,...Ca}),[b]),x=u||c,y=ut("span",t,{enabled:x,ref:[n,f],state:g,stateAttributesMapping:C,props:h});return x?y:null});function $P(e){const{multiple:t=!1,defaultValue:n,value:s,onValueChange:o,...u}=e;return w.jsx(SP,{...u,selectionMode:t?"multiple":"single",selectedValue:s,defaultSelectedValue:n,onSelectedValueChange:o})}const KP=k.forwardRef(function(t,n){const s=t.keepMounted??!1,{selected:o}=TR();return s||o?w.jsx(YP,{...t,ref:n}):null}),YP=k.memo(k.forwardRef((e,t)=>{const{render:n,className:s,keepMounted:o,...u}=e,{selected:h}=TR(),a=k.useRef(null),{transitionStatus:c,setMounted:d}=xi(h),p=k.useMemo(()=>({selected:h,transitionStatus:c}),[h,c]),f=ut("span",e,{ref:[t,a],state:p,props:[{"aria-hidden":!0,children:"✔️"},u],stateAttributesMapping:Hs});return Br({open:h,ref:a,onComplete(){h||d(!1)}}),f})),XP=k.createContext(void 0);function _p(e=!0){const t=k.useContext(XP);if(t===void 0&&!e)throw new Error(It(25));return t}const OR=k.createContext(void 0);function MR(e){const t=k.useContext(OR);if(t===void 0&&!e)throw new Error(It(33));return t}const DR=k.createContext(void 0);function Ra(e){const t=k.useContext(DR);if(t===void 0&&!e)throw new Error(It(36));return t}const QP={type:"regular-item"};function ZP(e){const{closeOnClick:t,disabled:n=!1,highlighted:s,id:o,store:u,nativeButton:h,itemMetadata:a,nodeId:c}=e,d=k.useRef(null),p=_p(!0),f=p!==void 0,{events:g}=u.useState("floatingTreeRoot"),{getButtonProps:b,buttonRef:C}=jr({disabled:n,focusableWhenDisabled:!0,native:h}),x=k.useCallback(_=>Bs({id:o,role:"menuitem",tabIndex:s?0:-1,onMouseMove(v){c&&g.emit("itemhover",{nodeId:c,target:v.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(v){v.key===" "&&u.context.typingRef.current&&v.preventBaseUIHandler()},onClick(v){t&&g.emit("close",{domEvent:v,reason:aa})},onMouseUp(v){if(p){const S=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,f&&S&&Math.abs(v.clientX-S.x)<=1&&Math.abs(v.clientY-S.y)<=1)return}d.current&&u.context.allowMouseUpTriggerRef.current&&(!f||v.button===2)&&a.type==="regular-item"&&d.current.click()}},_,b),[o,s,b,t,g,u,f,p,a,c]),y=ns(d,C);return k.useMemo(()=>({getItemProps:x,itemRef:y}),[x,y])}let fC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const PR={checked(e){return e?{[fC.checked]:""}:{[fC.unchecked]:""}},...Hs},JP={...go,...Hs},eI=k.forwardRef(function(t,n){const{render:s,className:o,finalFocus:u,...h}=t,{store:a}=Ra(),{side:c,align:d}=MR(),p=fR()!=null,f=a.useState("open"),g=a.useState("transitionStatus"),b=a.useState("popupProps"),C=a.useState("mounted"),x=a.useState("instantType"),y=a.useState("activeTriggerElement"),_=a.useState("parent"),v=a.useState("lastOpenChangeReason"),S=a.useState("rootId"),E=a.useState("floatingRootContext"),T=a.useState("floatingTreeRoot"),A=a.useState("closeDelay"),M=a.useState("activeTriggerElement");Br({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),k.useEffect(()=>{function N(Y){a.setOpen(!1,Ue(Y.reason,Y.domEvent))}return T.events.on("close",N),()=>{T.events.off("close",N)}},[T.events,a]);const L=a.useState("hoverEnabled"),D=a.useState("disabled");T6(E,{enabled:L&&!D&&_.type!=="context-menu"&&_.type!=="menubar",closeDelay:A});const U=k.useMemo(()=>({transitionStatus:g,side:c,align:d,open:f,nested:_.type==="menu",instant:x}),[g,c,d,f,_.type,x]),z=ut("div",t,{state:U,ref:[n,a.context.popupRef],stateAttributesMapping:JP,props:[b,{onKeyDown(N){p&&c0.has(N.key)&&N.stopPropagation()}},p0(g),h,{"data-rootownerid":S}]});let W=_.type===void 0||_.type==="context-menu";return(y||_.type==="menubar"&&v!==G_)&&(W=!0),w.jsx(ip,{context:E,modal:!1,disabled:!C,returnFocus:u===void 0?W:u,initialFocus:_.type!=="menu",restoreFocus:!0,externalTree:_.type!=="menubar"?T:void 0,previousFocusableElement:M,nextFocusableElement:_.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:z})}),IR=k.createContext(void 0);function tI(){const e=k.useContext(IR);if(e===void 0)throw new Error(It(32));return e}const nI=k.forwardRef(function(t,n){const{keepMounted:s=!1,...o}=t,{store:u}=Ra();return u.useState("mounted")||s?w.jsx(IR.Provider,{value:s,children:w.jsx(sp,{ref:n,...o})}):null}),rI=k.forwardRef(function(t,n){const{anchor:s,positionMethod:o="absolute",className:u,render:h,side:a,align:c,sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:C=!1,disableAnchorTracking:x=!1,collisionAvoidance:y=H_,..._}=t,{store:v}=Ra(),S=tI(),E=_p(!0),T=v.useState("parent"),A=v.useState("floatingRootContext"),M=v.useState("floatingTreeRoot"),L=v.useState("mounted"),D=v.useState("open"),U=v.useState("modal"),z=v.useState("activeTriggerElement"),W=v.useState("lastOpenChangeReason"),N=v.useState("floatingNodeId"),Y=v.useState("floatingParentNodeId");let $=s,F=d,q=p,H=c,P=y;T.type==="context-menu"&&($=s??T.context?.anchor,H=H??"start",!a&&H!=="center"&&(q=t.alignOffset??2,F=t.sideOffset??-5));let B=a,I=H;T.type==="menu"?(B=B??"inline-end",I=I??"start",P=t.collisionAvoidance??zM):T.type==="menubar"&&(B=B??"bottom",I=I??"start");const G=T.type==="context-menu",K=f0({anchor:$,floatingRootContext:A,positionMethod:E?"fixed":o,mounted:L,side:B,sideOffset:F,align:I,alignOffset:q,arrowPadding:G?0:b,collisionBoundary:f,collisionPadding:g,sticky:C,nodeId:N,keepMounted:S,disableAnchorTracking:x,collisionAvoidance:P,shiftCrossAxis:G,externalTree:M}),J=k.useMemo(()=>{const re={};return D||(re.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...K.positionerStyles,...re}}},[D,L,K.positionerStyles]);k.useEffect(()=>{function re(ne){ne.open?(ne.parentNodeId===N&&v.set("hoverEnabled",!1),ne.nodeId!==N&&ne.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,Ue(au))):ne.parentNodeId===N&&ne.reason!==au&&v.set("hoverEnabled",!0)}return M.events.on("menuopenchange",re),()=>{M.events.off("menuopenchange",re)}},[v,M.events,N]),k.useEffect(()=>{if(v.select("floatingParentNodeId")==null)return;function re(ne){if(ne.open||ne.nodeId!==v.select("floatingParentNodeId"))return;const oe=ne.reason??au;v.setOpen(!1,Ue(oe))}return M.events.on("menuopenchange",re),()=>{M.events.off("menuopenchange",re)}},[M.events,v]),k.useEffect(()=>{function re(ne){!D||ne.nodeId!==v.select("floatingParentNodeId")||ne.target&&z&&z!==ne.target&&v.setOpen(!1,Ue(au))}return M.events.on("itemhover",re),()=>{M.events.off("itemhover",re)}},[M.events,D,z,v]),k.useEffect(()=>{const re={open:D,nodeId:N,parentNodeId:Y,reason:v.select("lastOpenChangeReason")};M.events.emit("menuopenchange",re)},[M.events,D,v,N,Y]);const Z=k.useMemo(()=>({open:D,side:K.side,align:K.align,anchorHidden:K.anchorHidden,nested:T.type==="menu"}),[D,K.side,K.align,K.anchorHidden,T.type]),ee=k.useMemo(()=>({side:K.side,align:K.align,arrowRef:K.arrowRef,arrowUncentered:K.arrowUncentered,arrowStyles:K.arrowStyles,nodeId:K.context.nodeId}),[K.side,K.align,K.arrowRef,K.arrowUncentered,K.arrowStyles,K.context.nodeId]),X=ut("div",t,{state:Z,stateAttributesMapping:go,ref:[n,v.useStateSetter("positionerElement")],props:[J,_]}),V=L&&T.type!=="menu"&&(T.type!=="menubar"&&U&&W!==Or||T.type==="menubar"&&T.context.modal);let se=null;return T.type==="menubar"?se=T.context.contentElement:T.type===void 0&&(se=z),w.jsxs(OR.Provider,{value:ee,children:[V&&w.jsx(dp,{ref:T.type==="context-menu"||T.type==="nested-context-menu"?T.context.internalBackdropRef:null,inert:up(!D),cutout:se}),w.jsx(J4,{id:N,children:w.jsx(Gu,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:X})})]})}),NR=k.createContext(void 0);function sI(){const e=k.useContext(NR);if(e===void 0)throw new Error(It(34));return e}const iI=k.memo(k.forwardRef(function(t,n){const{render:s,className:o,value:u,defaultValue:h,onValueChange:a,disabled:c=!1,...d}=t,[p,f]=Ps({controlled:u,default:h,name:"MenuRadioGroup"}),g=De(a),b=De((_,v)=>{g?.(_,v),!v.isCanceled&&f(_)}),C=k.useMemo(()=>({disabled:c}),[c]),x=ut("div",t,{state:C,ref:n,props:{role:"group","aria-disabled":c||void 0,...d}}),y=k.useMemo(()=>({value:p,setValue:b,disabled:c}),[p,b,c]);return w.jsx(NR.Provider,{value:y,children:x})})),jR=k.createContext(void 0);function oI(){const e=k.useContext(jR);if(e===void 0)throw new Error(It(35));return e}const aI=k.forwardRef(function(t,n){const{render:s,className:o,id:u,label:h,nativeButton:a=!1,disabled:c=!1,closeOnClick:d=!1,value:p,...f}=t,g=$u({label:h}),b=MR(!0),C=Pr(u),{store:x}=Ra(),y=x.useState("isActive",g.index),_=x.useState("itemProps"),{value:v,setValue:S,disabled:E}=sI(),T=E||c,A=v===p,{getItemProps:M,itemRef:L}=ZP({closeOnClick:d,disabled:T,highlighted:y,id:C,store:x,nativeButton:a,nodeId:b?.nodeId,itemMetadata:QP}),D=k.useMemo(()=>({disabled:T,highlighted:y,checked:A}),[T,y,A]),U=De(W=>{const N={...Ue(aa,W.nativeEvent),preventUnmountOnClose:()=>{}};S(p,N)}),z=ut("div",t,{state:D,stateAttributesMapping:PR,props:[_,{role:"menuitemradio","aria-checked":A,onClick:U},f,M],ref:[L,n,g.ref]});return w.jsx(jR.Provider,{value:D,children:z})}),lI=k.forwardRef(function(t,n){const{render:s,className:o,keepMounted:u=!1,...h}=t,a=oI(),c=k.useRef(null),{transitionStatus:d,setMounted:p}=xi(a.checked);Br({open:a.checked,ref:c,onComplete(){a.checked||p(!1)}});const f=k.useMemo(()=>({checked:a.checked,disabled:a.disabled,highlighted:a.highlighted,transitionStatus:d}),[a.checked,a.disabled,a.highlighted,d]);return ut("span",t,{state:f,stateAttributesMapping:PR,ref:[n,c],props:{"aria-hidden":!0,...h},enabled:u||a.checked})}),cI=k.createContext(null);function BR(e){return k.useContext(cI)}const uI={...zE,disabled:xe(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:xe(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:xe(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:xe(e=>e.stickIfOpen),parent:xe(e=>e.parent),rootId:xe(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:xe(e=>e.activeIndex),isActive:xe((e,t)=>e.activeIndex===t),hoverEnabled:xe(e=>e.hoverEnabled),instantType:xe(e=>e.instantType),lastOpenChangeReason:xe(e=>e.openChangeReason),floatingTreeRoot:xe(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:xe(e=>e.floatingNodeId),floatingParentNodeId:xe(e=>e.floatingParentNodeId),itemProps:xe(e=>e.itemProps),closeDelay:xe(e=>e.closeDelay),keyboardEventRelay:xe(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class k0 extends s0{constructor(t){super({...dI(),...t},{positionerRef:k.createRef(),popupRef:k.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:k.createRef(),beforeContentFocusGuardRef:k.createRef(),onOpenChangeComplete:void 0,triggerElements:new lp},uI),this.observe(xe(n=>n.allowMouseEnter),(n,s)=>{this.state.parent.type==="menu"&&n!==s&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){return Wn(()=>t??new k0(n)).current}unsubscribeParentListener=null}function dI(){return{...BE(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new t0,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:en,keyboardEventRelay:void 0,closeDelay:0}}const fI=k.createContext(void 0);function hI(){return k.useContext(fI)}function pI(e){const{children:t,open:n,onOpenChange:s,onOpenChangeComplete:o,defaultOpen:u=!1,disabled:h=!1,modal:a,loopFocus:c=!0,orientation:d="vertical",actionsRef:p,closeParentOnEsc:f=!1,handle:g,triggerId:b,defaultTriggerId:C=null,highlightItemOnHover:x=!0}=e,y=_p(!0),_=Ra(!0),v=BR(),S=hI(),E=k.useMemo(()=>S&&_?{type:"menu",store:_.store}:v?{type:"menubar",context:v}:y&&!_?{type:"context-menu",context:y}:{type:void 0},[y,_,v,S]),T=k0.useStore(g?.store,{parent:E}),A=T.useState("floatingTreeRoot"),M=SE(A),L=Si();je(()=>{y&&!_?T.update({parent:{type:"context-menu",context:y},floatingNodeId:M,floatingParentNodeId:L}):_&&T.update({floatingNodeId:M,floatingParentNodeId:L})},[y,_,M,L,T]),T.useControlledProp("open",n,u),T.useControlledProp("activeTriggerId",b,C),T.useContextCallback("onOpenChangeComplete",o);const D=T.useState("open"),U=T.useState("activeTriggerElement"),z=T.useState("positionerElement"),W=T.useState("hoverEnabled"),N=T.useState("modal"),Y=T.useState("disabled"),$=T.useState("lastOpenChangeReason"),F=T.useState("parent"),q=T.useState("activeIndex"),H=T.useState("payload"),P=T.useState("floatingParentNodeId"),B=k.useRef(null),I=P!=null;let G;T.useSyncedValues({disabled:h,modal:F.type===void 0?a:void 0,rootId:Sa()});const{openMethod:K,triggerProps:J,reset:Z}=hp(D);NE(T);const{forceUnmount:ee}=jE(D,T,()=>{T.update({allowMouseEnter:!1,stickIfOpen:!0}),Z()}),X=k.useRef(F.type!=="context-menu"),V=Qt();k.useEffect(()=>{if(D||(B.current=null),F.type==="context-menu"){if(!D){V.clear(),X.current=!1;return}V.start(500,()=>{X.current=!0})}},[V,D,F.type]),fp(D&&N&&$!==Or&&K!=="touch",z),je(()=>{!D&&!W&&T.set("hoverEnabled",!0)},[D,W,T]);const se=k.useRef(!0),re=Qt(),ne=De((Re,tt)=>{const at=tt.reason;if(D===Re&&tt.trigger===U||(tt.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},!Re&&tt.trigger==null&&(tt.trigger=U??void 0),s?.(Re,tt),tt.isCanceled))return;const Xe={open:Re,nativeEvent:tt.event,reason:tt.reason,nested:I};G?.emit("openchange",Xe);const st=tt.event;if(Re===!1&&st?.type==="click"&&st.pointerType==="touch"&&!se.current)return;if(!Re&&q!==null){const kt=T.context.itemDomElements.current[q];queueMicrotask(()=>{kt?.setAttribute("tabindex","-1")})}Re&&at===Ch?(se.current=!1,re.start(300,()=>{se.current=!0})):(se.current=!0,re.clear());const Ct=(at===oa||at===aa)&&st.detail===0&&st?.isTrusted,lt=!Re&&(at===np||at==null);function tn(){const kt={open:Re,openChangeReason:at};B.current=tt.event??null;const vt=tt.trigger?.id??null;(vt||Re)&&(kt.activeTriggerId=vt,kt.activeTriggerElement=tt.trigger??null),T.update(kt)}at===Or?Qn.flushSync(tn):tn(),F.type==="menubar"&&(at===Ch||at===ga||at===Or||at===hu||at===au)?T.set("instantType","group"):Ct||lt?T.set("instantType",Ct?"click":"dismiss"):T.set("instantType",void 0)}),oe=k.useCallback(Re=>{const tt=Ue(Re);return tt.preventUnmountOnClose=()=>{T.set("preventUnmountingOnClose",!0)},tt},[T]),ce=k.useCallback(()=>{T.setOpen(!1,oe(q2))},[T,oe]);k.useImperativeHandle(p,()=>({unmount:ee,close:ce}),[ee,ce]);let ve;F.type==="context-menu"&&(ve=F.context),k.useImperativeHandle(ve?.positionerRef,()=>z,[z]),k.useImperativeHandle(ve?.actionsRef,()=>({setOpen:ne}),[ne]);const ge=HE({popupStore:T,onOpenChange:ne});G=ge.context.events,k.useEffect(()=>{const Re=({open:tt,eventDetails:at})=>ne(tt,at);return G.on("setOpen",Re),()=>{G?.off("setOpen",Re)}},[G,ne]);const he=ap(ge,{enabled:!Y,bubbles:f&&F.type==="menu",outsidePress(){return F.type!=="context-menu"||B.current?.type==="contextmenu"?!0:X.current},externalTree:I?A:void 0}),de=FE(ge,{role:"menu"}),Le=wa(),Oe=k.useCallback(Re=>{T.select("activeIndex")!==Re&&T.set("activeIndex",Re)},[T]),Ne=a0(ge,{enabled:!Y,listRef:T.context.itemDomElements,activeIndex:q,nested:F.type!==void 0,loopFocus:c,orientation:d,parentOrientation:F.type==="menubar"?F.context.orientation:void 0,rtl:Le==="rtl",disabledIndices:hr,onNavigate:Oe,openOnArrowKeyDown:F.type!=="context-menu",externalTree:I?A:void 0,focusItemOnHover:x}),ye=k.useCallback(Re=>{T.context.typingRef.current=Re},[T]),Ae=l0(ge,{listRef:T.context.itemLabels,activeIndex:q,resetMs:NM,onMatch:Re=>{D&&Re!==q&&T.set("activeIndex",Re)},onTypingChange:ye}),{getReferenceProps:ae,getFloatingProps:be,getItemProps:Ce,getTriggerProps:We}=Kl([he,de,Ne,Ae]),rt=k.useMemo(()=>{const Re=Bs(ae(),{onMouseEnter(){T.set("hoverEnabled",!0)},onMouseMove(){T.set("allowMouseEnter",!0)}},J);return delete Re.role,Re},[ae,T,J]),ze=k.useMemo(()=>{const Re=We();if(!Re)return Re;const tt=Bs(Re,J);return delete tt.role,delete tt["aria-controls"],tt},[We,J]),Me=Hu(),He=k.useMemo(()=>be({onMouseEnter(){F.type==="menu"&&Me.request(()=>T.set("hoverEnabled",!1))},onMouseMove(){T.set("allowMouseEnter",!0)},onClick(){T.select("hoverEnabled")&&T.set("hoverEnabled",!1)},onKeyDown(Re){const tt=T.select("keyboardEventRelay");tt&&!Re.isPropagationStopped()&&tt(Re)}}),[be,F.type,Me,T]),dt=k.useMemo(()=>Ce(),[Ce]);T.useSyncedValues({floatingRootContext:ge,activeTriggerProps:rt,inactiveTriggerProps:ze,popupProps:He,itemProps:dt});const $e=k.useMemo(()=>({store:T,parent:E}),[T,E]),et=w.jsx(DR.Provider,{value:$e,children:typeof t=="function"?t({payload:H}):t});return F.type===void 0||F.type==="context-menu"?w.jsx(eD,{externalTree:A,children:et}):et}function mI(e){const{render:t,className:n,state:s=en,props:o=hr,refs:u=hr,metadata:h,stateAttributesMapping:a,tag:c="div",...d}=e,{compositeProps:p,compositeRef:f}=vR({metadata:h});return ut(c,e,{state:s,ref:[...u,f],props:[p,...o,d],stateAttributesMapping:a})}function zR(e){if(Jt(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Ms(e))return zR(js(e))}function gI(e){const{enabled:t=!0,mouseDownAction:n,open:s}=e,o=k.useRef(!1);return k.useMemo(()=>t?{onMouseDown:u=>{(n==="open"&&!s||n==="close"&&s)&&(o.current=!0,pr(u.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:u=>{o.current&&(o.current=!1,u.preventBaseUIHandler())}}:en,[t,n,s])}const Uf=2,vI=k.forwardRef(function(t,n){const{render:s,className:o,disabled:u=!1,nativeButton:h=!0,id:a,openOnHover:c,delay:d=100,closeDelay:p=0,handle:f,payload:g,...b}=t,C=Ra(!0),x=f?.store??C?.store;if(!x)throw new Error(It(85));const y=Pr(a),_=x.useState("isTriggerActive",y),v=x.useState("floatingRootContext"),S=x.useState("isOpenedByTrigger",y),E=k.useRef(null),T=yI(),A=B_(!0),M=_o(),L=k.useMemo(()=>M??new t0,[M]),D=SE(L),U=Si(),{registerTrigger:z,isMountedByThisTrigger:W}=IE(y,E,x,{payload:g,closeDelay:p,parent:T,floatingTreeRoot:L,floatingNodeId:D,floatingParentNodeId:U,keyboardEventRelay:A?.relayKeyboardEvent}),N=x.useState("disabled"),Y=u||N||T.type==="menubar"&&T.context.disabled,{getButtonProps:$,buttonRef:F}=jr({disabled:Y,native:h});k.useEffect(()=>{!S&&T.type===void 0&&(x.context.allowMouseUpTriggerRef.current=!1)},[x,S,T.type]);const q=k.useRef(null),H=Qt(),P=De(de=>{if(!q.current)return;H.clear(),x.context.allowMouseUpTriggerRef.current=!1;const Le=de.target;if(ft(q.current,Le)||ft(x.select("positionerElement"),Le)||Le===q.current||Le!=null&&zR(Le)===x.select("rootId"))return;const Oe=d0(q.current);de.clientX>=Oe.left-Uf&&de.clientX<=Oe.right+Uf&&de.clientY>=Oe.top-Uf&&de.clientY<=Oe.bottom+Uf||L.events.emit("close",{domEvent:de,reason:W2})});k.useEffect(()=>{S&&x.select("lastOpenChangeReason")===Or&&pr(q.current).addEventListener("mouseup",P,{once:!0})},[S,P,x]);const B=T.type==="menubar"&&T.context.hasSubmenuOpen,G=O6(v,{enabled:(c??B??!1)&&!Y&&T.type!=="context-menu"&&(T.type!=="menubar"||B&&!W),handleClose:j6({blockPointerEvents:T.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:T.type===void 0?d:void 0,delay:{close:p},triggerElementRef:E,externalTree:L,isActiveTrigger:_}),K=_I(S,x.select("lastOpenChangeReason")),J=Vu(v,{enabled:!Y&&T.type!=="context-menu",event:S&&T.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0?K:!1}),Z=w6(v,{enabled:!Y&&(T.type!=="menubar"&&S||B)}),ee=gI({open:S,enabled:T.type==="menubar",mouseDownAction:"open"}),X=Kl([J,Z]),V=T.type==="menubar",se=k.useMemo(()=>({disabled:Y,open:S}),[Y,S]),re=x.useState("triggerProps",W),ne=[q,n,F,z,E],oe=[X.getReferenceProps(),G??en,re,{"aria-haspopup":"menu",id:y,onMouseDown:de=>{if(x.select("open"))return;H.start(200,()=>{x.context.allowMouseUpTriggerRef.current=!0}),pr(de.currentTarget).addEventListener("mouseup",P,{once:!0})}},V?{role:"menuitem"}:{},ee,b,$],ce=k.useRef(null),ve=De(de=>{Qn.flushSync(()=>{x.setOpen(!1,Ue(ga,de.nativeEvent,de.currentTarget))}),Q4(ce.current)?.focus()}),ge=De(de=>{const Le=x.select("positionerElement");if(Le&&xl(de,Le))x.context.beforeContentFocusGuardRef.current?.focus();else{Qn.flushSync(()=>{x.setOpen(!1,Ue(ga,de.nativeEvent,de.currentTarget))});let Oe=X4(E.current);for(;Oe!==null&&ft(Le,Oe)||Oe?.hasAttribute("aria-hidden");){const Ne=Oe;if(Oe=e0(Oe),Oe===Ne)break}Oe?.focus()}}),he=ut("button",t,{enabled:!V,stateAttributesMapping:bu,state:se,ref:ne,props:oe});return V?w.jsx(mI,{tag:"button",render:s,className:o,state:se,refs:ne,props:oe,stateAttributesMapping:bu}):S?w.jsxs(k.Fragment,{children:[w.jsx(Nl,{ref:ce,onFocus:ve},`${y}-pre-focus-guard`),w.jsx(k.Fragment,{children:he},y),w.jsx(Nl,{ref:x.context.triggerFocusTargetRef,onFocus:ge},`${y}-post-focus-guard`)]}):w.jsx(k.Fragment,{children:he},y)});function _I(e,t){const n=Qt(),[s,o]=k.useState(!1);return je(()=>{e&&t==="trigger-hover"?(o(!0),n.start(jM,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),s}function yI(){const e=_p(!0),t=Ra(!0),n=BR();return k.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function fi(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const HR=k.createContext(void 0);function yp(){const e=k.useContext(HR);if(e===void 0)throw new Error(It(53));return e}let Ph=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Wf=500,hC=16;function Jr(e,t,n){if(!e)return 0;const s=getComputedStyle(e),o=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(s[`${t}InlineStart`])*2:parseFloat(s[`${t}${o}Start`])+parseFloat(s[`${t}${o}End`])}let bI=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),gl=(function(e){return e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const T0={hasOverflowX:e=>e?{[gl.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[gl.hasOverflowY]:""}:null,overflowXStart:e=>e?{[gl.overflowXStart]:""}:null,overflowXEnd:e=>e?{[gl.overflowXEnd]:""}:null,overflowYStart:e=>e?{[gl.overflowYStart]:""}:null,overflowYEnd:e=>e?{[gl.overflowYEnd]:""}:null,cornerHidden:()=>null},pC={width:0,height:0},SI={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},xI=k.forwardRef(function(t,n){const{render:s,className:o,overflowEdgeThreshold:u,...h}=t,[a,c]=k.useState(!1),[d,p]=k.useState(!1),[f,g]=k.useState(!1),[b,C]=k.useState(pC),[x,y]=k.useState(pC),[_,v]=k.useState(!1),[S,E]=k.useState(SI),T=Pr(),A=k.useRef(null),M=k.useRef(null),L=k.useRef(null),D=k.useRef(null),U=k.useRef(null),z=k.useRef(null),W=k.useRef(null),N=k.useRef(!1),Y=k.useRef(0),$=k.useRef(0),F=k.useRef(0),q=k.useRef(0),H=k.useRef("vertical"),P=Qt(),B=Qt(),I=k.useRef({x:0,y:0}),[G,K]=k.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),J=CI(u),Z=De(ve=>{const ge=ve.x-I.current.x,he=ve.y-I.current.y;I.current=ve,he!==0&&(g(!0),P.start(Wf,()=>{g(!1)})),ge!==0&&(p(!0),B.start(Wf,()=>{p(!1)}))}),ee=De(ve=>{ve.button===0&&(N.current=!0,Y.current=ve.clientY,$.current=ve.clientX,H.current=ve.currentTarget.getAttribute(bI.orientation),M.current&&(F.current=M.current.scrollTop,q.current=M.current.scrollLeft),U.current&&H.current==="vertical"&&U.current.setPointerCapture(ve.pointerId),z.current&&H.current==="horizontal"&&z.current.setPointerCapture(ve.pointerId))}),X=De(ve=>{if(!N.current)return;const ge=ve.clientY-Y.current,he=ve.clientX-$.current;if(M.current){const de=M.current.scrollHeight,Le=M.current.clientHeight,Oe=M.current.scrollWidth,Ne=M.current.clientWidth;if(U.current&&L.current&&H.current==="vertical"){const ye=Jr(L.current,"padding","y"),Ae=Jr(U.current,"margin","y"),ae=U.current.offsetHeight,be=L.current.offsetHeight-ae-ye-Ae,Ce=ge/be;M.current.scrollTop=F.current+Ce*(de-Le),ve.preventDefault(),g(!0),P.start(Wf,()=>{g(!1)})}if(z.current&&D.current&&H.current==="horizontal"){const ye=Jr(D.current,"padding","x"),Ae=Jr(z.current,"margin","x"),ae=z.current.offsetWidth,be=D.current.offsetWidth-ae-ye-Ae,Ce=he/be;M.current.scrollLeft=q.current+Ce*(Oe-Ne),ve.preventDefault(),p(!0),B.start(Wf,()=>{p(!1)})}}}),V=De(ve=>{N.current=!1,U.current&&H.current==="vertical"&&U.current.releasePointerCapture(ve.pointerId),z.current&&H.current==="horizontal"&&z.current.releasePointerCapture(ve.pointerId)});function se(ve){const ge=ve.pointerType==="touch";if(v(ge),!ge){const he=ft(A.current,ve.target);c(he)}}const re=k.useMemo(()=>({hasOverflowX:!G.scrollbarXHidden,hasOverflowY:!G.scrollbarYHidden,overflowXStart:S.xStart,overflowXEnd:S.xEnd,overflowYStart:S.yStart,overflowYEnd:S.yEnd,cornerHidden:G.cornerHidden}),[G.scrollbarXHidden,G.scrollbarYHidden,G.cornerHidden,S]),ne={role:"presentation",onPointerEnter:se,onPointerMove:se,onPointerDown({pointerType:ve}){v(ve==="touch")},onPointerLeave(){c(!1)},style:{position:"relative",[Ph.scrollAreaCornerHeight]:`${b.height}px`,[Ph.scrollAreaCornerWidth]:`${b.width}px`}},oe=ut("div",t,{state:re,ref:[n,A],props:[ne,h],stateAttributesMapping:T0}),ce=k.useMemo(()=>({handlePointerDown:ee,handlePointerMove:X,handlePointerUp:V,handleScroll:Z,cornerSize:b,setCornerSize:C,thumbSize:x,setThumbSize:y,touchModality:_,cornerRef:W,scrollingX:d,setScrollingX:p,scrollingY:f,setScrollingY:g,hovering:a,setHovering:c,viewportRef:M,rootRef:A,scrollbarYRef:L,scrollbarXRef:D,thumbYRef:U,thumbXRef:z,rootId:T,hiddenState:G,setHiddenState:K,overflowEdges:S,setOverflowEdges:E,viewportState:re,overflowEdgeThreshold:J}),[ee,X,V,Z,b,x,_,W,d,p,f,g,a,c,M,A,L,D,U,z,T,G,S,re,J]);return w.jsxs(HR.Provider,{value:ce,children:[Eu.element,oe]})});function CI(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}const wI=k.createContext(void 0);function EI(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(s=>{s.forEach(o=>{o.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let ro=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({}),mC=!1;function RI(){mC||K_||(typeof CSS<"u"&&"registerProperty"in CSS&&[ro.scrollAreaOverflowXStart,ro.scrollAreaOverflowXEnd,ro.scrollAreaOverflowYStart,ro.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),mC=!0)}const kI=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{viewportRef:h,scrollbarYRef:a,scrollbarXRef:c,thumbYRef:d,thumbXRef:p,cornerRef:f,setCornerSize:g,setThumbSize:b,rootId:C,setHiddenState:x,hiddenState:y,handleScroll:_,setHovering:v,setOverflowEdges:S,overflowEdges:E,overflowEdgeThreshold:T}=yp(),A=wa(),M=k.useRef(!0),L=Qt(),D=Qt();function U(){const q=h.current,H=a.current,P=c.current,B=d.current,I=p.current,G=f.current;if(!q)return;const K=q.scrollHeight,J=q.scrollWidth,Z=q.clientHeight,ee=q.clientWidth,X=q.scrollTop,V=q.scrollLeft;if(K===0||J===0)return;const se=Z>=K,re=ee>=J,ne=ee/J,oe=Z/K,ce=Math.max(0,J-ee),ve=Math.max(0,K-Z);let ge=0,he=0;re||(A==="rtl"?ge=fi(-V,0,ce):ge=fi(V,0,ce),he=ce-ge);const de=se?0:fi(X,0,ve),Le=se?0:ve-de,Oe=re?0:ee,Ne=se?0:Z,ye=Jr(P,"padding","x"),Ae=Jr(H,"padding","y"),ae=Jr(I,"margin","x"),be=Jr(B,"margin","y"),Ce=Oe-ye-ae,We=Ne-Ae-be,rt=P?Math.min(P.offsetWidth,Ce):Ce,ze=H?Math.min(H.offsetHeight,We):We,Me=Math.max(hC,rt*ne),He=Math.max(hC,ze*oe);if(b(Xe=>Xe.height===He&&Xe.width===Me?Xe:{width:Me,height:He}),H&&B){const Xe=H.offsetHeight-He-Ae-be,st=K-Z,Ct=st===0?0:X/st,lt=Math.min(Xe,Math.max(0,Ct*Xe));B.style.transform=`translate3d(0,${lt}px,0)`}if(P&&I){const Xe=P.offsetWidth-Me-ye-ae,st=J-ee,Ct=st===0?0:V/st,lt=A==="rtl"?fi(Ct*Xe,-Xe,0):fi(Ct*Xe,0,Xe);I.style.transform=`translate3d(${lt}px,0,0)`}const dt=fi(ge,0,ce),$e=fi(he,0,ce),et=fi(de,0,ve),Re=fi(Le,0,ve),tt=[[ro.scrollAreaOverflowXStart,dt],[ro.scrollAreaOverflowXEnd,$e],[ro.scrollAreaOverflowYStart,et],[ro.scrollAreaOverflowYEnd,Re]];for(const[Xe,st]of tt)q.style.setProperty(Xe,`${st}px`);if(G){if(re||se)g({width:0,height:0});else if(!re&&!se){const Xe=H?.offsetWidth||0,st=P?.offsetHeight||0;g({width:Xe,height:st})}}x(Xe=>{const st=se||re;return Xe.scrollbarYHidden===se&&Xe.scrollbarXHidden===re&&Xe.cornerHidden===st?Xe:{scrollbarYHidden:se,scrollbarXHidden:re,cornerHidden:st}});const at={xStart:!re&&dt>T.xStart,xEnd:!re&&$e>T.xEnd,yStart:!se&&et>T.yStart,yEnd:!se&&Re>T.yEnd};S(Xe=>Xe.xStart===at.xStart&&Xe.xEnd===at.xEnd&&Xe.yStart===at.yStart&&Xe.yEnd===at.yEnd?Xe:at)}const z=De(()=>{Qn.flushSync(U)});je(()=>h.current?(RI(),EI(h.current,z)):void 0,[z,h]),je(()=>{queueMicrotask(z)},[z,y,A]),je(()=>{h.current?.matches(":hover")&&v(!0)},[h,v]),k.useEffect(()=>{const q=h.current;if(typeof ResizeObserver>"u"||!q)return;const H=new ResizeObserver(z);return H.observe(q),D.start(0,()=>{Promise.all(q.getAnimations({subtree:!0}).map(P=>P.finished)).then(z).catch(()=>{})}),()=>{H.disconnect(),D.clear()}},[z,h,D]);function W(){M.current=!1}const N={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!y.scrollbarXHidden||!y.scrollbarYHidden)&&{tabIndex:0},className:Eu.className,style:{overflow:"scroll"},onScroll(){h.current&&(z(),M.current||_({x:h.current.scrollLeft,y:h.current.scrollTop}),L.start(100,()=>{M.current=!0}))},onWheel:W,onTouchMove:W,onPointerMove:W,onPointerEnter:W,onKeyDown:W},Y=k.useMemo(()=>({hasOverflowX:!y.scrollbarXHidden,hasOverflowY:!y.scrollbarYHidden,overflowXStart:E.xStart,overflowXEnd:E.xEnd,overflowYStart:E.yStart,overflowYEnd:E.yEnd,cornerHidden:y.cornerHidden}),[y.scrollbarXHidden,y.scrollbarYHidden,y.cornerHidden,E]),$=ut("div",t,{ref:[n,h],state:Y,props:[N,u],stateAttributesMapping:T0}),F=k.useMemo(()=>({computeThumbPosition:z}),[z]);return w.jsx(wI.Provider,{value:F,children:$})}),VR=k.createContext(void 0);function TI(){const e=k.useContext(VR);if(e===void 0)throw new Error(It(54));return e}let Ih=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const LI=k.forwardRef(function(t,n){const{render:s,className:o,orientation:u="vertical",keepMounted:h=!1,...a}=t,{hovering:c,scrollingX:d,scrollingY:p,hiddenState:f,overflowEdges:g,scrollbarYRef:b,scrollbarXRef:C,viewportRef:x,thumbYRef:y,thumbXRef:_,handlePointerDown:v,handlePointerUp:S,rootId:E,thumbSize:T}=yp(),A=k.useMemo(()=>({hovering:c,scrolling:{horizontal:d,vertical:p}[u],orientation:u,hasOverflowX:!f.scrollbarXHidden,hasOverflowY:!f.scrollbarYHidden,overflowXStart:g.xStart,overflowXEnd:g.xEnd,overflowYStart:g.yStart,overflowYEnd:g.yEnd,cornerHidden:f.cornerHidden}),[c,d,p,u,f,g]),M=wa();k.useEffect(()=>{const N=x.current,Y=u==="vertical"?b.current:C.current;if(!Y)return;function $(F){if(!(!N||!Y||F.ctrlKey)){if(F.preventDefault(),u==="vertical"){if(N.scrollTop===0&&F.deltaY<0)return}else if(N.scrollLeft===0&&F.deltaX<0)return;if(u==="vertical"){if(N.scrollTop===N.scrollHeight-N.clientHeight&&F.deltaY>0)return}else if(N.scrollLeft===N.scrollWidth-N.clientWidth&&F.deltaX>0)return;u==="vertical"?N.scrollTop+=F.deltaY:N.scrollLeft+=F.deltaX}}return Y.addEventListener("wheel",$,{passive:!1}),()=>{Y.removeEventListener("wheel",$)}},[u,C,b,x]);const L={...E&&{"data-id":`${E}-scrollbar`},onPointerDown(N){if(N.button===0&&N.currentTarget===N.target&&x.current){if(y.current&&b.current&&u==="vertical"){const Y=Jr(y.current,"margin","y"),$=Jr(b.current,"padding","y"),F=y.current.offsetHeight,q=b.current.getBoundingClientRect(),H=N.clientY-q.top-F/2-$+Y/2,P=x.current.scrollHeight,B=x.current.clientHeight,I=b.current.offsetHeight-F-$-Y,K=H/I*(P-B);x.current.scrollTop=K}if(_.current&&C.current&&u==="horizontal"){const Y=Jr(_.current,"margin","x"),$=Jr(C.current,"padding","x"),F=_.current.offsetWidth,q=C.current.getBoundingClientRect(),H=N.clientX-q.left-F/2-$+Y/2,P=x.current.scrollWidth,B=x.current.clientWidth,I=C.current.offsetWidth-F-$-Y,G=H/I;let K;M==="rtl"?(K=(1-G)*(P-B),x.current.scrollLeft<=0&&(K=-K)):K=G*(P-B),x.current.scrollLeft=K}v(N)}},onPointerUp:S,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...u==="vertical"&&{top:0,bottom:`var(${Ph.scrollAreaCornerHeight})`,insetInlineEnd:0,[Ih.scrollAreaThumbHeight]:`${T.height}px`},...u==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Ph.scrollAreaCornerWidth})`,bottom:0,[Ih.scrollAreaThumbWidth]:`${T.width}px`}}},D=ut("div",t,{ref:[n,u==="vertical"?b:C],state:A,props:[L,a],stateAttributesMapping:T0}),U=k.useMemo(()=>({orientation:u}),[u]),z=u==="vertical"?f.scrollbarYHidden:f.scrollbarXHidden;return h||!z?w.jsx(VR.Provider,{value:U,children:D}):null}),AI=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{thumbYRef:h,thumbXRef:a,handlePointerDown:c,handlePointerMove:d,handlePointerUp:p,setScrollingX:f,setScrollingY:g}=yp(),{orientation:b}=TI(),C=k.useMemo(()=>({orientation:b}),[b]);return ut("div",t,{ref:[n,b==="vertical"?h:a],state:C,props:[{onPointerDown:c,onPointerMove:d,onPointerUp(y){b==="vertical"&&g(!1),b==="horizontal"&&f(!1),p(y)},style:{...b==="vertical"&&{height:`var(${Ih.scrollAreaThumbHeight})`},...b==="horizontal"&&{width:`var(${Ih.scrollAreaThumbWidth})`}}},u]})}),OI=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{cornerRef:h,cornerSize:a,hiddenState:c}=yp(),d=ut("div",t,{ref:[n,h],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:a.width,height:a.height}},u]});return c.cornerHidden?null:d}),FR=k.createContext(void 0);function MI(){const e=k.useContext(FR);if(e===void 0)throw new Error(It(63));return e}let gC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const UR={...Ca,checked(e){return e?{[gC.checked]:""}:{[gC.unchecked]:""}}},DI=k.forwardRef(function(t,n){const{checked:s,className:o,defaultChecked:u,id:h,inputRef:a,name:c,nativeButton:d=!1,onCheckedChange:p,readOnly:f=!1,required:g=!1,disabled:b=!1,render:C,uncheckedValue:x,...y}=t,{clearErrors:_}=Wu(),{state:v,setTouched:S,setDirty:E,validityData:T,setFilled:A,setFocused:M,shouldValidateOnChange:L,validationMode:D,disabled:U,name:z,validation:W}=rs(),{labelId:N}=yo(),Y=U||b,$=z??c,F=De(p),q=k.useRef(null),H=ns(q,a,W.inputRef),P=k.useRef(null),B=Pr(),I=pp({id:h,implicit:!1,controlRef:P}),[G,K]=Ps({controlled:s,default:!!u,name:"Switch",state:"checked"});qu({id:B,commit:W.commit,value:G,controlRef:P,name:$,getValue:()=>G}),je(()=>{q.current&&A(q.current.checked)},[q,A]),ta(G,()=>{_($),E(G!==T.initialValue),A(G),L()?W.commit(G):W.commit(G,!0)});const{getButtonProps:J,buttonRef:Z}=jr({disabled:Y,native:d}),ee={id:B,role:"switch","aria-checked":G,"aria-readonly":f||void 0,"aria-labelledby":N,onFocus(){Y||M(!0)},onBlur(){const re=q.current;!re||Y||(S(!0),M(!1),D==="onBlur"&&W.commit(re.checked))},onClick(re){f||Y||(re.preventDefault(),q?.current?.click())}},X=k.useMemo(()=>Bs({checked:G,disabled:Y,id:I,name:$,required:g,style:$l,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:H,onChange(re){if(re.nativeEvent.defaultPrevented)return;const ne=re.target.checked,oe=Ue(Pn,re.nativeEvent);F?.(ne,oe),!oe.isCanceled&&K(ne)},onFocus(){P.current?.focus()}},W.getInputValidationProps),[G,Y,H,I,$,F,g,K,W]),V=k.useMemo(()=>({...v,checked:G,disabled:Y,readOnly:f,required:g}),[v,G,Y,f,g]),se=ut("span",t,{state:V,ref:[n,P,Z],props:[ee,W.getValidationProps,y,J],stateAttributesMapping:UR});return w.jsxs(FR.Provider,{value:V,children:[se,!G&&$&&x!==void 0&&w.jsx("input",{type:"hidden",name:$,value:x}),w.jsx("input",{...X})]})}),PI=k.forwardRef(function(t,n){const{render:s,className:o,...u}=t,{state:h}=rs(),a=MI(),c={...h,...a};return ut("span",t,{state:c,ref:n,stateAttributesMapping:UR,props:u})});function II(e){return ut(e.defaultTagName??"div",e,e)}function NI({className:e,...t}){return w.jsx("div",{"data-slot":"input-group",role:"group",className:Be("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",e),...t})}const jI=Fl("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function BI({className:e,align:t="inline-start",...n}){return w.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Be(jI({align:t}),e),onClick:s=>{s.target.closest("button")||s.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const zI=Fl("gap-2 rounded-md text-xs/relaxed shadow-none flex items-center",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function WR({className:e,type:t="button",variant:n="ghost",size:s="xs",...o}){return w.jsx(Ve,{type:t,"data-size":s,variant:n,className:Be(zI({size:s}),e),...o})}function HI({className:e,...t}){return w.jsx(Kt,{"data-slot":"input-group-control",className:Be("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1",e),...t})}const VI=$P;function FI({className:e,children:t,...n}){return w.jsxs(CP,{"data-slot":"combobox-trigger",className:Be("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,w.jsx(Ee,{icon:L2,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function UI({className:e,...t}){return w.jsx(LP,{"data-slot":"combobox-clear",render:w.jsx(WR,{variant:"ghost",size:"icon-xs"}),className:Be(e),...t,children:w.jsx(Ee,{icon:ho,strokeWidth:2,className:"pointer-events-none"})})}function WI({className:e,children:t,disabled:n=!1,showTrigger:s=!0,showClear:o=!1,...u}){return w.jsxs(NI,{className:Be("w-auto",e),children:[w.jsx(kP,{render:w.jsx(HI,{disabled:n}),...u}),w.jsxs(BI,{align:"inline-end",children:[s&&w.jsx(WR,{size:"icon-xs",variant:"ghost",render:w.jsx(FI,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),o&&w.jsx(UI,{disabled:n})]}),t]})}function qI({className:e,side:t="bottom",sideOffset:n=6,align:s="start",alignOffset:o=0,anchor:u,...h}){return w.jsx(IP,{children:w.jsx(NP,{side:t,sideOffset:n,align:s,alignOffset:o,anchor:u,className:"isolate z-50",children:w.jsx(BP,{"data-slot":"combobox-content","data-chips":!!u,className:Be("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",e),...h})})})}function GI({className:e,...t}){return w.jsx(DP,{"data-slot":"combobox-list",className:Be("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",e),...t})}function $I({className:e,children:t,...n}){return w.jsxs(VP,{"data-slot":"combobox-item",className:Be("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,w.jsx(KP,{render:w.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:w.jsx(Ee,{icon:ju,strokeWidth:2,className:"pointer-events-none"})})]})}function KI({className:e,...t}){return w.jsx(FP,{"data-slot":"combobox-empty",className:Be("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}function Go({className:e,size:t="default",...n}){return w.jsx(DI,{"data-slot":"switch","data-size":t,className:Be("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:w.jsx(PI,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}const ka="";async function Ta(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}function L0(){return Nr({queryKey:["tasks"],queryFn:()=>Ta(`${ka}/api/tasks`)})}function qR(e){return Nr({queryKey:["tasks",e],queryFn:()=>Ta(`${ka}/api/tasks/${e}`),enabled:!!e})}function YI(){const e=qn();return jn({mutationFn:t=>Ta(`${ka}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function XI(){const e=qn();return jn({mutationFn:({taskId:t,status:n,position:s})=>Ta(`${ka}/api/tasks/${t}/status`,{method:"PATCH",body:JSON.stringify({status:n,position:s})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function A0(){const e=qn();return jn({mutationFn:({taskId:t,updates:n})=>Ta(`${ka}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]})}})}function QI(){const e=qn();return jn({mutationFn:t=>Ta(`${ka}/api/tasks/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function ZI(){const e=qn();return jn({mutationFn:t=>Ta(`${ka}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}const Yl="";async function Xl(e){const t=await fetch(e);if(!t.ok){const n=await t.json().catch(()=>({error:"Request failed"}));throw new Error(n.error||"Request failed")}return t.json()}function JI(e){return Nr({queryKey:["fs","list",e],queryFn:()=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return Xl(`${Yl}/api/fs/list${t}`)},enabled:e!==null})}function e9(e){return Nr({queryKey:["git","branches",e],queryFn:()=>Xl(`${Yl}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function t9(e,t={}){const{staged:n=!1,ignoreWhitespace:s=!1,includeUntracked:o=!1}=t;return Nr({queryKey:["git","diff",e,n,s,o],queryFn:()=>{const u=new URLSearchParams({path:e,...n&&{staged:"true"},...s&&{ignoreWhitespace:"true"},...o&&{includeUntracked:"true"}});return Xl(`${Yl}/api/git/diff?${u}`)},enabled:!!e,refetchInterval:5e3})}function n9(e){return Nr({queryKey:["fs","tree",e],queryFn:()=>Xl(`${Yl}/api/fs/tree?root=${encodeURIComponent(e)}`),enabled:!!e,staleTime:1e4})}function r9(e,t,n){return Nr({queryKey:["fs","read",e,t,n?.maxLines],queryFn:()=>{const s=new URLSearchParams({path:t,root:e,...n?.maxLines});return Xl(`${Yl}/api/fs/read?${s}`)},enabled:!!e&&!!t})}async function s9(e){return Xl(`${Yl}/api/fs/is-git-repo?path=${encodeURIComponent(e)}`)}const Ql="";async function Zl(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}const Rn={PORT:"port",WORKTREE_BASE_PATH:"worktree_base_path",DEFAULT_GIT_REPOS_DIR:"default_git_repos_dir",TASK_CREATION_COMMAND:"task_creation_command",HOSTNAME:"hostname",SSH_PORT:"ssh_port",LINEAR_API_KEY:"linear_api_key"},i9=3333,o9="claude --dangerously-skip-permissions";function La(e){return Nr({queryKey:["config",e],queryFn:()=>Zl(`${Ql}/api/config/${e}`)})}function a9(){const e=La(Rn.PORT);return{...e,data:e.data?.value??i9,isDefault:e.data?.isDefault??!0}}function O0(){const e=La(Rn.WORKTREE_BASE_PATH);return{...e,data:e.data?.value??"",isDefault:!0}}function M0(){const e=La(Rn.DEFAULT_GIT_REPOS_DIR);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function GR(){const e=La(Rn.TASK_CREATION_COMMAND);return{...e,data:e.data?.value??o9,isDefault:e.data?.isDefault??!0}}function $R(){const e=La(Rn.HOSTNAME);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function KR(){const e=La(Rn.SSH_PORT);return{...e,data:e.data?.value??22,isDefault:e.data?.isDefault??!0}}function l9(){const e=La(Rn.LINEAR_API_KEY);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function c9(){const e=qn();return jn({mutationFn:({key:t,value:n})=>Zl(`${Ql}/api/config/${t}`,{method:"PUT",body:JSON.stringify({value:n})}),onSuccess:(t,{key:n})=>{e.invalidateQueries({queryKey:["config",n]})}})}function u9(){const e=qn();return jn({mutationFn:t=>Zl(`${Ql}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function d9(){return Nr({queryKey:["config","notifications"],queryFn:()=>Zl(`${Ql}/api/config/notifications`)})}function f9(){const e=qn();return jn({mutationFn:t=>Zl(`${Ql}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function h9(){return jn({mutationFn:e=>Zl(`${Ql}/api/config/notifications/test/${e}`,{method:"POST"})})}const Ku="";async function Yu(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}function D0(){return Nr({queryKey:["repositories"],queryFn:()=>Yu(`${Ku}/api/repositories`)})}function p9(e){return Nr({queryKey:["repositories",e],queryFn:()=>Yu(`${Ku}/api/repositories/${e}`),enabled:!!e})}function YR(){const e=qn();return jn({mutationFn:t=>Yu(`${Ku}/api/repositories`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function m9(){const e=qn();return jn({mutationFn:({id:t,updates:n})=>Yu(`${Ku}/api/repositories/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["repositories",n]})}})}function XR(){const e=qn();return jn({mutationFn:t=>Yu(`${Ku}/api/repositories/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function Xu({className:e,children:t,...n}){return w.jsxs(xI,{"data-slot":"scroll-area",className:Be("relative",e),...n,children:[w.jsx(kI,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),w.jsx(g9,{}),w.jsx(OI,{})]})}function g9({className:e,orientation:t="vertical",...n}){return w.jsx(LI,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Be("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",e),...n,children:w.jsx(AI,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function P0({open:e,onOpenChange:t,onSelect:n,initialPath:s}){const[o,u]=k.useState(s||null),[h,a]=k.useState(""),[c,d]=k.useState("");k.useEffect(()=>{e&&(u(s||null),a(""),d(""))},[e,s]);const{data:p,isLoading:f,error:g}=JI(e?o??"":null),b=S=>{p&&(u(p.path+"/"+S),d(""))},C=()=>{p?.parent&&p.parent!==p.path&&(u(p.parent),d(""))},x=()=>{u(null),d("")},y=()=>{h.trim()&&(u(h.trim()),d(""))},_=S=>{n(S),t(!1)},v=p?.entries.filter(S=>S.name.toLowerCase().includes(c.toLowerCase()));return w.jsx(As,{open:e,onOpenChange:t,children:w.jsxs(Os,{className:"sm:max-w-lg",children:[w.jsxs(mi,{children:[w.jsx(gi,{children:"Select Git Repository"}),w.jsx(Jo,{children:"Choose an existing git repository"})]}),w.jsx("p",{className:"text-xs text-muted-foreground",children:"Click folder names to navigate • Use action buttons to select"}),w.jsx(S8,{}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("label",{className:"text-xs font-medium",children:"Enter path manually:"}),w.jsxs("div",{className:"flex gap-2",children:[w.jsx(Kt,{value:h,onChange:S=>a(S.target.value),placeholder:"/path/to/your/project",onKeyDown:S=>S.key==="Enter"&&y(),className:"flex-1"}),w.jsx(Ve,{variant:"outline",size:"sm",onClick:y,children:"Go"})]})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsx("label",{className:"text-xs font-medium",children:"Search current directory:"}),w.jsxs("div",{className:"relative",children:[w.jsx(Ee,{icon:Z3,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),w.jsx(Kt,{value:c,onChange:S=>d(S.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(Ve,{variant:"outline",size:"icon-sm",onClick:x,title:"Home",children:w.jsx(Ee,{icon:G3,size:14,strokeWidth:2})}),w.jsx(Ve,{variant:"outline",size:"icon-sm",onClick:C,disabled:!p||p.parent===p.path,title:"Parent directory",children:w.jsx(Ee,{icon:D2,size:14,strokeWidth:2})}),w.jsx("code",{className:"flex-1 text-xs bg-muted/50 px-2 py-1 rounded truncate",children:p?.path||"~"}),w.jsx(Ve,{variant:"outline",size:"sm",onClick:()=>p&&_(p.path),disabled:!p,children:"Select Current"})]}),w.jsx(Xu,{className:"h-64 border rounded-md",children:w.jsxs("div",{className:"p-1",children:[f&&w.jsx("div",{className:"text-muted-foreground text-xs p-3",children:"Loading..."}),g&&w.jsx("div",{className:"text-destructive text-xs p-3",children:g.message}),p&&v&&w.jsxs(w.Fragment,{children:[v.length===0&&w.jsx("div",{className:"text-muted-foreground text-xs p-3",children:c?"No matches found":"Empty directory"}),v.map(S=>w.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group",children:S.type==="directory"?w.jsxs(w.Fragment,{children:[w.jsx(Ee,{icon:S.isGitRepo?j2:ms,size:16,strokeWidth:2,className:S.isGitRepo?"text-emerald-500":"text-blue-500"}),w.jsx("button",{onClick:()=>b(S.name),className:"flex-1 text-left text-xs truncate hover:underline",children:S.name}),S.isGitRepo&&w.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded border border-emerald-500/50 text-emerald-500 font-medium",children:"git repo"})]}):w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"w-4"}),w.jsx("span",{className:"flex-1 text-xs text-muted-foreground truncate",children:S.name})]})},S.name))]})]})}),w.jsxs(ua,{children:[w.jsx(u0,{render:w.jsx(Ve,{variant:"outline"}),children:"Cancel"}),w.jsx(Ve,{onClick:()=>p&&_(p.path),disabled:!p,children:"Select Path"})]})]})})}function v9(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function _9(e){const t=v9(e);if(!t)return"";const n=Math.random().toString(36).substring(2,6);return`${t}-${n}`}function y9({open:e,onOpenChange:t}={}){const[n,s]=k.useState(!1),o=e??n,u=t??s,[h,a]=k.useState(!1),[c,d]=k.useState(""),[p,f]=k.useState(""),[g,b]=k.useState(""),[C,x]=k.useState(""),[y,_]=k.useState(""),[v,S]=k.useState(""),[E,T]=k.useState(!0),[A,M]=k.useState(!0),[L,D]=k.useState(null),[U,z]=k.useState("browse"),[W,N]=k.useState(""),[Y,$]=k.useState(null),[F,q]=k.useState(!1),H=po(),P=YI(),B=YR(),{data:I}=O0(),{data:G}=M0(),{data:K}=D0(),{data:J,isLoading:Z}=e9(g||null),ee=L?K?.find(ce=>ce.id===L):null,X=k.useMemo(()=>{if(!K)return[];if(!W.trim())return K;const ce=W.toLowerCase();return K.filter(ve=>ve.displayName.toLowerCase().includes(ce)||ve.path.toLowerCase().includes(ce))},[K,W]);k.useEffect(()=>{K&&K.length>0?z("saved"):z("browse")},[K]),k.useEffect(()=>{x(J?J.current||J.branches[0]||"main":"")},[J,g]);const V=ce=>{d(ce),S(_9(ce))},se=async ce=>{$(null),q(!0);try{if(!(await s9(ce)).isGitRepo){$("Selected folder is not a git repository"),q(!1);return}if(b(ce),D(null),!K?.find(he=>he.path===ce)){const he=ce.split("/").pop()||"Unknown";B.mutate({path:ce,displayName:he})}}catch(ve){$(ve instanceof Error?ve.message:"Failed to validate repository")}finally{q(!1)}},re=ce=>{if(ce.preventDefault(),!c.trim()||!g)return;const ve=g.split("/").pop()||"repo",ge=y.trim()||v,he=`${I}/${ge}`;P.mutate({title:c.trim(),description:p.trim(),repoPath:g,repoName:ve,baseBranch:C||"main",branch:ge,worktreePath:he,initializeVibora:E,copyFiles:ee?.copyFiles||void 0,startupScript:ee?.startupScript||void 0},{onSuccess:de=>{const Le=A&&p.trim()?{planMode:!0,description:p.trim()}:void 0;u(!1),d(""),f(""),b(""),x(""),_(""),S(""),T(!0),M(!0),D(null),N(""),$(null),z(K&&K.length>0?"saved":"browse"),H({to:"/tasks/$taskId",params:{taskId:de.id},state:Le})}})},ne=y.trim()||v,oe=ne?`${I}/${ne}`:"";return w.jsxs(w.Fragment,{children:[w.jsxs(As,{open:o,onOpenChange:u,children:[w.jsxs(JE,{render:w.jsx(Ve,{size:"sm"}),children:[w.jsx(Ee,{icon:ql,size:16,strokeWidth:2,"data-slot":"icon"}),"New Task"]}),w.jsx(Os,{className:"sm:max-w-md",children:w.jsxs("form",{onSubmit:re,children:[w.jsxs(mi,{children:[w.jsx(gi,{children:"Create New Task"}),w.jsx(Jo,{children:"Create a new task with a git worktree for isolated development."})]}),w.jsxs(gp,{className:"mt-4",children:[w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"title",children:"Title"}),w.jsx(Kt,{id:"title",value:c,onChange:ce=>V(ce.target.value),placeholder:"Add user authentication",required:!0})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"description",children:"Description"}),w.jsx(mp,{id:"description",value:p,onChange:ce=>f(ce.target.value),placeholder:"Implement OAuth2 login flow...",rows:2})]}),w.jsxs(In,{className:"flex flex-row items-center justify-between",children:[w.jsxs("div",{children:[w.jsx(Nn,{htmlFor:"planMode",className:"mb-0 cursor-pointer",children:"Start in Plan Mode"}),w.jsx(pi,{children:"Launch Claude with the task title and description"})]}),w.jsx(Go,{id:"planMode",checked:A,onCheckedChange:ce=>M(ce)})]}),w.jsxs(In,{children:[w.jsx(Nn,{children:"Repository"}),w.jsxs(C0,{value:U,onValueChange:ce=>{z(ce),$(null)},children:[w.jsxs(w0,{children:[w.jsx(kl,{value:"saved",disabled:!K?.length,children:"Saved"}),w.jsx(kl,{value:"browse",children:"Browse"})]}),w.jsx(pu,{value:"saved",className:"mt-2",children:w.jsxs(VI,{value:L||"",onValueChange:ce=>{const ve=K?.find(ge=>ge.id===ce);ve&&(D(ce),b(ve.path),N(ve.displayName),$(null))},inputValue:W,onInputValueChange:ce=>{N(ce),ee&&ce!==ee.displayName&&D(null)},itemToStringLabel:ce=>K?.find(ve=>ve.id===ce)?.displayName||"",children:[w.jsx(WI,{placeholder:"Search repositories...",className:"w-full"}),w.jsx(qI,{children:w.jsxs(GI,{children:[w.jsx(KI,{children:"No repositories found"}),X.map(ce=>w.jsx($I,{value:ce.id,children:ce.displayName},ce.id))]})})]})}),w.jsx(pu,{value:"browse",className:"mt-2",children:w.jsxs(Ve,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>a(!0),disabled:F,children:[w.jsx(Ee,{icon:ms,size:14,strokeWidth:2,className:"mr-2"}),F?w.jsx("span",{className:"text-muted-foreground",children:"Validating..."}):g&&!L?w.jsx("span",{className:"truncate",children:g}):w.jsx("span",{className:"text-muted-foreground",children:"Select folder..."})]})})]}),Y&&w.jsx("p",{className:"text-sm text-destructive",children:Y}),g&&!Y&&w.jsx(pi,{className:"font-mono text-xs truncate",children:g})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"baseBranch",children:"Base Branch"}),w.jsxs(v0,{value:C,onValueChange:ce=>x(ce??""),disabled:!g||Z,children:[w.jsx(y0,{className:"w-full",children:w.jsx(_0,{children:C||w.jsx("span",{className:"text-muted-foreground",children:g?Z?"Loading branches...":"Select branch":"Select repository first"})})}),w.jsx(b0,{children:J?.branches.map(ce=>w.jsxs(Ru,{value:ce,children:[ce,ce===J.current&&w.jsx("span",{className:"text-muted-foreground ml-2",children:"(current)"})]},ce))})]})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"branch",children:"Branch Name"}),w.jsx(Kt,{id:"branch",value:y,onChange:ce=>_(ce.target.value),placeholder:v||"auto-generated-from-title"}),oe&&w.jsxs(pi,{children:["Worktree: ",oe]}),!y.trim()&&v&&w.jsxs(pi,{children:['Will use "',v,'" if left empty.']})]}),w.jsxs(In,{className:"flex flex-row items-center justify-between",children:[w.jsxs("div",{children:[w.jsx(Nn,{htmlFor:"initializeVibora",className:"mb-0 cursor-pointer",children:"Initialize Vibora"}),w.jsx(pi,{children:"Create or update CLAUDE.local.md with CLI instructions"})]}),w.jsx(Go,{id:"initializeVibora",checked:E,onCheckedChange:ce=>T(ce)})]})]}),w.jsxs(ua,{className:"mt-4",children:[w.jsx(u0,{render:w.jsx(Ve,{variant:"outline",type:"button"}),children:"Cancel"}),w.jsx(Ve,{type:"submit",disabled:P.isPending||!c.trim()||!g,children:P.isPending?"Creating...":"Create Task"})]})]})})]}),w.jsx(P0,{open:h,onOpenChange:a,onSelect:se,initialPath:G||void 0})]})}function b9({onNewTaskRef:e}){const{location:t}=Xn(),n=t.pathname,[s,o]=k.useState(!1);return k.useEffect(()=>{e?.(()=>o(!0))},[e]),w.jsxs("header",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between border-b border-border bg-black px-4",children:[w.jsxs("div",{className:"flex items-center gap-4",children:[w.jsx(rr,{to:"/tasks",className:"flex items-center",children:w.jsx("img",{src:"/vibora-logo.jpeg",alt:"Vibora",className:"h-7"})}),w.jsxs("nav",{className:"flex items-center gap-1",children:[w.jsx(rr,{to:"/tasks",children:w.jsxs(Ve,{variant:n.startsWith("/tasks")?"secondary":"ghost",size:"sm",children:[w.jsx(Ee,{icon:Sh,size:16,strokeWidth:2,"data-slot":"icon"}),"Tasks"]})}),w.jsx(rr,{to:"/terminals",children:w.jsxs(Ve,{variant:n==="/terminals"?"secondary":"ghost",size:"sm",children:[w.jsx(Ee,{icon:F_,size:16,strokeWidth:2,"data-slot":"icon"}),"Terminals"]})}),w.jsx(rr,{to:"/worktrees",children:w.jsxs(Ve,{variant:n.startsWith("/worktrees")?"secondary":"ghost",size:"sm",children:[w.jsx(Ee,{icon:B2,size:16,strokeWidth:2,"data-slot":"icon"}),"Worktrees"]})}),w.jsx(rr,{to:"/repositories",children:w.jsxs(Ve,{variant:n.startsWith("/repositories")?"secondary":"ghost",size:"sm",children:[w.jsx(Ee,{icon:I2,size:16,strokeWidth:2,"data-slot":"icon"}),"Repositories"]})})]})]}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(y9,{open:s,onOpenChange:o}),w.jsx(rr,{to:"/settings",children:w.jsx(Ve,{variant:n==="/settings"?"secondary":"ghost",size:"icon-sm",children:w.jsx(Ee,{icon:V2,size:16,strokeWidth:2})})})]})]})}function S9(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const x9=e=>{switch(e){case"success":return E9;case"info":return k9;case"warning":return R9;case"error":return T9;default:return null}},C9=Array(12).fill(0),w9=({visible:e,className:t})=>Ie.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ie.createElement("div",{className:"sonner-spinner"},C9.map((n,s)=>Ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),E9=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ie.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),R9=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ie.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),k9=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),T9=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),L9=Ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),A9=()=>{const[e,t]=Ie.useState(document.hidden);return Ie.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let n_=1;class O9{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:s,...o}=t,u=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:n_++,h=this.toasts.find(c=>c.id===u),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),h?this.toasts=this.toasts.map(c=>c.id===u?(this.publish({...c,...t,id:u,title:s}),{...c,...t,id:u,dismissible:a,title:s}):c):this.addToast({title:s,...o,dismissible:a,id:u}),u},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let u=s!==void 0,h;const a=o.then(async d=>{if(h=["resolve",d],Ie.isValidElement(d))u=!1,this.create({id:s,type:"default",message:d});else if(D9(d)&&!d.ok){u=!1;const f=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,C=typeof f=="object"&&!Ie.isValidElement(f)?f:{message:f};this.create({id:s,type:"error",description:g,...C})}else if(d instanceof Error){u=!1;const f=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,C=typeof f=="object"&&!Ie.isValidElement(f)?f:{message:f};this.create({id:s,type:"error",description:g,...C})}else if(n.success!==void 0){u=!1;const f=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,C=typeof f=="object"&&!Ie.isValidElement(f)?f:{message:f};this.create({id:s,type:"success",description:g,...C})}}).catch(async d=>{if(h=["reject",d],n.error!==void 0){u=!1;const p=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,b=typeof p=="object"&&!Ie.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:f,...b})}}).finally(()=>{u&&(this.dismiss(s),s=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,p)=>a.then(()=>h[0]==="reject"?p(h[1]):d(h[1])).catch(p));return typeof s!="string"&&typeof s!="number"?{unwrap:c}:Object.assign(s,{unwrap:c})},this.custom=(t,n)=>{const s=n?.id||n_++;return this.create({jsx:t(s),id:s,...n}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const fr=new O9,M9=(e,t)=>{const n=t?.id||n_++;return fr.addToast({title:e,...t,id:n}),n},D9=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",P9=M9,I9=()=>fr.toasts,N9=()=>fr.getActiveToasts(),Ar=Object.assign(P9,{success:fr.success,info:fr.info,warning:fr.warning,error:fr.error,custom:fr.custom,message:fr.message,promise:fr.promise,dismiss:fr.dismiss,loading:fr.loading},{getHistory:I9,getToasts:N9});S9("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function qf(e){return e.label!==void 0}const j9=3,B9="24px",z9="16px",vC=4e3,H9=356,V9=14,F9=45,U9=200;function Cs(...e){return e.filter(Boolean).join(" ")}function W9(e){const[t,n]=e.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}const q9=e=>{var t,n,s,o,u,h,a,c,d;const{invert:p,toast:f,unstyled:g,interacting:b,setHeights:C,visibleToasts:x,heights:y,index:_,toasts:v,expanded:S,removeToast:E,defaultRichColors:T,closeButton:A,style:M,cancelButtonStyle:L,actionButtonStyle:D,className:U="",descriptionClassName:z="",duration:W,position:N,gap:Y,expandByDefault:$,classNames:F,icons:q,closeButtonAriaLabel:H="Close toast"}=e,[P,B]=Ie.useState(null),[I,G]=Ie.useState(null),[K,J]=Ie.useState(!1),[Z,ee]=Ie.useState(!1),[X,V]=Ie.useState(!1),[se,re]=Ie.useState(!1),[ne,oe]=Ie.useState(!1),[ce,ve]=Ie.useState(0),[ge,he]=Ie.useState(0),de=Ie.useRef(f.duration||W||vC),Le=Ie.useRef(null),Oe=Ie.useRef(null),Ne=_===0,ye=_+1<=x,Ae=f.type,ae=f.dismissible!==!1,be=f.className||"",Ce=f.descriptionClassName||"",We=Ie.useMemo(()=>y.findIndex(Je=>Je.toastId===f.id)||0,[y,f.id]),rt=Ie.useMemo(()=>{var Je;return(Je=f.closeButton)!=null?Je:A},[f.closeButton,A]),ze=Ie.useMemo(()=>f.duration||W||vC,[f.duration,W]),Me=Ie.useRef(0),He=Ie.useRef(0),dt=Ie.useRef(0),$e=Ie.useRef(null),[et,Re]=N.split("-"),tt=Ie.useMemo(()=>y.reduce((Je,Ot,Nt)=>Nt>=We?Je:Je+Ot.height,0),[y,We]),at=A9(),Xe=f.invert||p,st=Ae==="loading";He.current=Ie.useMemo(()=>We*Y+tt,[We,tt]),Ie.useEffect(()=>{de.current=ze},[ze]),Ie.useEffect(()=>{J(!0)},[]),Ie.useEffect(()=>{const Je=Oe.current;if(Je){const Ot=Je.getBoundingClientRect().height;return he(Ot),C(Nt=>[{toastId:f.id,height:Ot,position:f.position},...Nt]),()=>C(Nt=>Nt.filter(ot=>ot.toastId!==f.id))}},[C,f.id]),Ie.useLayoutEffect(()=>{if(!K)return;const Je=Oe.current,Ot=Je.style.height;Je.style.height="auto";const Nt=Je.getBoundingClientRect().height;Je.style.height=Ot,he(Nt),C(ot=>ot.find(bt=>bt.toastId===f.id)?ot.map(bt=>bt.toastId===f.id?{...bt,height:Nt}:bt):[{toastId:f.id,height:Nt,position:f.position},...ot])},[K,f.title,f.description,C,f.id,f.jsx,f.action,f.cancel]);const Ct=Ie.useCallback(()=>{ee(!0),ve(He.current),C(Je=>Je.filter(Ot=>Ot.toastId!==f.id)),setTimeout(()=>{E(f)},U9)},[f,E,C,He]);Ie.useEffect(()=>{if(f.promise&&Ae==="loading"||f.duration===1/0||f.type==="loading")return;let Je;return S||b||at?(()=>{if(dt.current<Me.current){const ot=new Date().getTime()-Me.current;de.current=de.current-ot}dt.current=new Date().getTime()})():de.current!==1/0&&(Me.current=new Date().getTime(),Je=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Ct()},de.current)),()=>clearTimeout(Je)},[S,b,f,Ae,at,Ct]),Ie.useEffect(()=>{f.delete&&(Ct(),f.onDismiss==null||f.onDismiss.call(f,f))},[Ct,f.delete]);function lt(){var Je;if(q?.loading){var Ot;return Ie.createElement("div",{className:Cs(F?.loader,f==null||(Ot=f.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":Ae==="loading"},q.loading)}return Ie.createElement(w9,{className:Cs(F?.loader,f==null||(Je=f.classNames)==null?void 0:Je.loader),visible:Ae==="loading"})}const tn=f.icon||q?.[Ae]||x9(Ae);var kt,vt;return Ie.createElement("li",{tabIndex:0,ref:Oe,className:Cs(U,be,F?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,F?.default,F?.[Ae],f==null||(n=f.classNames)==null?void 0:n[Ae]),"data-sonner-toast":"","data-rich-colors":(kt=f.richColors)!=null?kt:T,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":K,"data-promise":!!f.promise,"data-swiped":ne,"data-removed":Z,"data-visible":ye,"data-y-position":et,"data-x-position":Re,"data-index":_,"data-front":Ne,"data-swiping":X,"data-dismissible":ae,"data-type":Ae,"data-invert":Xe,"data-swipe-out":se,"data-swipe-direction":I,"data-expanded":!!(S||$&&K),"data-testid":f.testId,style:{"--index":_,"--toasts-before":_,"--z-index":v.length-_,"--offset":`${Z?ce:He.current}px`,"--initial-height":$?"auto":`${ge}px`,...M,...f.style},onDragEnd:()=>{V(!1),B(null),$e.current=null},onPointerDown:Je=>{Je.button!==2&&(st||!ae||(Le.current=new Date,ve(He.current),Je.target.setPointerCapture(Je.pointerId),Je.target.tagName!=="BUTTON"&&(V(!0),$e.current={x:Je.clientX,y:Je.clientY})))},onPointerUp:()=>{var Je,Ot,Nt;if(se||!ae)return;$e.current=null;const ot=Number(((Je=Oe.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wt=Number(((Ot=Oe.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((Nt=Le.current)==null?void 0:Nt.getTime()),St=P==="x"?ot:wt,Qe=Math.abs(St)/bt;if(Math.abs(St)>=F9||Qe>.11){ve(He.current),f.onDismiss==null||f.onDismiss.call(f,f),G(P==="x"?ot>0?"right":"left":wt>0?"down":"up"),Ct(),re(!0);return}else{var Ht,Cn;(Ht=Oe.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(Cn=Oe.current)==null||Cn.style.setProperty("--swipe-amount-y","0px")}oe(!1),V(!1),B(null)},onPointerMove:Je=>{var Ot,Nt,ot;if(!$e.current||!ae||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const bt=Je.clientY-$e.current.y,St=Je.clientX-$e.current.x;var Qe;const Ht=(Qe=e.swipeDirections)!=null?Qe:W9(N);!P&&(Math.abs(St)>1||Math.abs(bt)>1)&&B(Math.abs(St)>Math.abs(bt)?"x":"y");let Cn={x:0,y:0};const Gn=Bn=>1/(1.5+Math.abs(Bn)/20);if(P==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&bt<0||Ht.includes("bottom")&&bt>0)Cn.y=bt;else{const Bn=bt*Gn(bt);Cn.y=Math.abs(Bn)<Math.abs(bt)?Bn:bt}}else if(P==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&St<0||Ht.includes("right")&&St>0)Cn.x=St;else{const Bn=St*Gn(St);Cn.x=Math.abs(Bn)<Math.abs(St)?Bn:St}(Math.abs(Cn.x)>0||Math.abs(Cn.y)>0)&&oe(!0),(Nt=Oe.current)==null||Nt.style.setProperty("--swipe-amount-x",`${Cn.x}px`),(ot=Oe.current)==null||ot.style.setProperty("--swipe-amount-y",`${Cn.y}px`)}},rt&&!f.jsx&&Ae!=="loading"?Ie.createElement("button",{"aria-label":H,"data-disabled":st,"data-close-button":!0,onClick:st||!ae?()=>{}:()=>{Ct(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Cs(F?.closeButton,f==null||(s=f.classNames)==null?void 0:s.closeButton)},(vt=q?.close)!=null?vt:L9):null,(Ae||f.icon||f.promise)&&f.icon!==null&&(q?.[Ae]!==null||f.icon)?Ie.createElement("div",{"data-icon":"",className:Cs(F?.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||lt():null,f.type!=="loading"?tn:null):null,Ie.createElement("div",{"data-content":"",className:Cs(F?.content,f==null||(u=f.classNames)==null?void 0:u.content)},Ie.createElement("div",{"data-title":"",className:Cs(F?.title,f==null||(h=f.classNames)==null?void 0:h.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?Ie.createElement("div",{"data-description":"",className:Cs(z,Ce,F?.description,f==null||(a=f.classNames)==null?void 0:a.description)},typeof f.description=="function"?f.description():f.description):null),Ie.isValidElement(f.cancel)?f.cancel:f.cancel&&qf(f.cancel)?Ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Je=>{qf(f.cancel)&&ae&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Je),Ct())},className:Cs(F?.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Ie.isValidElement(f.action)?f.action:f.action&&qf(f.action)?Ie.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||D,onClick:Je=>{qf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Je),!Je.defaultPrevented&&Ct())},className:Cs(F?.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function _C(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function G9(e,t){const n={};return[e,t].forEach((s,o)=>{const u=o===1,h=u?"--mobile-offset":"--offset",a=u?z9:B9;function c(d){["top","right","bottom","left"].forEach(p=>{n[`${h}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof s=="number"||typeof s=="string"?c(s):typeof s=="object"?["top","right","bottom","left"].forEach(d=>{s[d]===void 0?n[`${h}-${d}`]=a:n[`${h}-${d}`]=typeof s[d]=="number"?`${s[d]}px`:s[d]}):c(a)}),n}const $9=Ie.forwardRef(function(t,n){const{id:s,invert:o,position:u="bottom-right",hotkey:h=["altKey","KeyT"],expand:a,closeButton:c,className:d,offset:p,mobileOffset:f,theme:g="light",richColors:b,duration:C,style:x,visibleToasts:y=j9,toastOptions:_,dir:v=_C(),gap:S=V9,icons:E,containerAriaLabel:T="Notifications"}=t,[A,M]=Ie.useState([]),L=Ie.useMemo(()=>s?A.filter(K=>K.toasterId===s):A.filter(K=>!K.toasterId),[A,s]),D=Ie.useMemo(()=>Array.from(new Set([u].concat(L.filter(K=>K.position).map(K=>K.position)))),[L,u]),[U,z]=Ie.useState([]),[W,N]=Ie.useState(!1),[Y,$]=Ie.useState(!1),[F,q]=Ie.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=Ie.useRef(null),P=h.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=Ie.useRef(null),I=Ie.useRef(!1),G=Ie.useCallback(K=>{M(J=>{var Z;return(Z=J.find(ee=>ee.id===K.id))!=null&&Z.delete||fr.dismiss(K.id),J.filter(({id:ee})=>ee!==K.id)})},[]);return Ie.useEffect(()=>fr.subscribe(K=>{if(K.dismiss){requestAnimationFrame(()=>{M(J=>J.map(Z=>Z.id===K.id?{...Z,delete:!0}:Z))});return}setTimeout(()=>{rO.flushSync(()=>{M(J=>{const Z=J.findIndex(ee=>ee.id===K.id);return Z!==-1?[...J.slice(0,Z),{...J[Z],...K},...J.slice(Z+1)]:[K,...J]})})})}),[A]),Ie.useEffect(()=>{if(g!=="system"){q(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:J})=>{q(J?"dark":"light")})}catch{K.addListener(({matches:Z})=>{try{q(Z?"dark":"light")}catch(ee){console.error(ee)}})}},[g]),Ie.useEffect(()=>{A.length<=1&&N(!1)},[A]),Ie.useEffect(()=>{const K=J=>{var Z;if(h.every(V=>J[V]||J.code===V)){var X;N(!0),(X=H.current)==null||X.focus()}J.code==="Escape"&&(document.activeElement===H.current||(Z=H.current)!=null&&Z.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[h]),Ie.useEffect(()=>{if(H.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,I.current=!1)}},[H.current]),Ie.createElement("section",{ref:n,"aria-label":`${T} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((K,J)=>{var Z;const[ee,X]=K.split("-");return L.length?Ie.createElement("ol",{key:K,dir:v==="auto"?_C():v,tabIndex:-1,ref:H,className:d,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":ee,"data-x-position":X,style:{"--front-toast-height":`${((Z=U[0])==null?void 0:Z.height)||0}px`,"--width":`${H9}px`,"--gap":`${S}px`,...x,...G9(p,f)},onBlur:V=>{I.current&&!V.currentTarget.contains(V.relatedTarget)&&(I.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||I.current||(I.current=!0,B.current=V.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{Y||N(!1)},onDragEnd:()=>N(!1),onPointerDown:V=>{V.target instanceof HTMLElement&&V.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},L.filter(V=>!V.position&&J===0||V.position===K).map((V,se)=>{var re,ne;return Ie.createElement(q9,{key:V.id,icons:E,index:se,toast:V,defaultRichColors:b,duration:(re=_?.duration)!=null?re:C,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:o,visibleToasts:y,closeButton:(ne=_?.closeButton)!=null?ne:c,interacting:Y,position:K,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,closeButtonAriaLabel:_?.closeButtonAriaLabel,removeToast:G,toasts:L.filter(oe=>oe.position==V.position),heights:U.filter(oe=>oe.position==V.position),setHeights:z,expandByDefault:a,gap:S,expanded:W,swipeDirections:t.swipeDirections})})):null}))});function K9(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const Y9=10,X9=2e3;function Q9(){const e=qn(),t=k.useRef(null),n=k.useRef(void 0),s=k.useRef(0),o=k.useRef(void 0),u=k.useCallback(a=>{try{const c=JSON.parse(a.data);if(c.type==="task:updated")e.invalidateQueries({queryKey:["tasks"]});else if(c.type==="notification"&&"payload"in c){const{title:d,message:p,notificationType:f}=c.payload;switch(f){case"success":Ar.success(d,{description:p});break;case"error":Ar.error(d,{description:p});break;case"warning":Ar.warning(d,{description:p});break;default:Ar.info(d,{description:p});break}}}catch{}},[e]),h=k.useCallback(()=>{const a=t.current;if(a&&(a.readyState===WebSocket.CONNECTING||a.readyState===WebSocket.OPEN))return;const c=K9(),d=new WebSocket(c);t.current=d,d.onopen=()=>{s.current=0},d.onmessage=u,d.onclose=()=>{t.current===d&&(t.current=null),s.current<Y9&&(s.current++,n.current=setTimeout(()=>{o.current?.()},X9))},d.onerror=()=>{}},[u]);o.current=h,k.useEffect(()=>(h(),()=>{n.current&&clearTimeout(n.current),t.current&&(t.current.close(),t.current=null)}),[h])}const QR=k.createContext(null);function Z9({children:e}){const[t,n]=k.useState(!1),[s,o]=k.useState(!1),u=k.useCallback(d=>{n(d)},[]),h=k.useCallback(d=>{o(d)},[]),a=k.useMemo(()=>!t,[t]),c=k.useMemo(()=>({terminalFocused:t,setTerminalFocused:u,modalOpen:s,setModalOpen:h,shortcutsEnabled:a}),[t,u,s,h,a]);return w.jsx(QR.Provider,{value:c,children:e})}function I0(){const e=k.useContext(QR);if(!e)throw new Error("useKeyboardContext must be used within a KeyboardProvider");return e}function J9(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function ZR(e){const t=e.toLowerCase().split("+"),n=t.pop()||"";return{meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl"),alt:t.includes("alt")||t.includes("option"),shift:t.includes("shift"),key:n}}function eN(e,t){const n=ZR(t);if(n.meta!==e.metaKey||n.ctrl!==e.ctrlKey||n.alt!==e.altKey||n.shift!==e.shiftKey)return!1;const s=e.key.toLowerCase(),o=n.key.toLowerCase();return o==="escape"?s==="escape":o==="enter"?s==="enter":o==="space"?s===" ":o==="backspace"?s==="backspace":o==="delete"?s==="delete":o==="tab"?s==="tab":o==="arrowup"?s==="arrowup":o==="arrowdown"?s==="arrowdown":o==="arrowleft"?s==="arrowleft":o==="arrowright"?s==="arrowright":/^[0-9]$/.test(o)?s===o:o==="/"&&!n.shift?s==="/":o==="/"&&n.shift||o==="?"?s==="?":o===","?s===",":o==="\\"?s==="\\":s===o}function JR(e){const t=ZR(e),n=[],s=J9();t.ctrl&&n.push("Ctrl"),t.alt&&n.push(s?"Option":"Alt"),t.shift&&n.push("Shift"),t.meta&&n.push(s?"Cmd":"Ctrl");let o=t.key.toUpperCase();return o==="ESCAPE"&&(o="Esc"),o==="ENTER"&&(o="Enter"),o==="SPACE"&&(o="Space"),o==="BACKSPACE"&&(o="Backspace"),o==="DELETE"&&(o="Delete"),o==="ARROWUP"&&(o="↑"),o==="ARROWDOWN"&&(o="↓"),o==="ARROWLEFT"&&(o="←"),o==="ARROWRIGHT"&&(o="→"),o===","&&(o=","),o==="/"&&(o="/"),o==="?"&&(o="?"),o==="\\"&&(o="\\"),n.push(o),n.join("+")}function tN(e){if(!e||!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return!!(t==="input"||t==="textarea"||e.isContentEditable)}function hi(e,t,n={}){const{shortcutsEnabled:s}=I0(),{ignoreContext:o=!1,allowInInput:u=!1,deps:h=[],enabled:a=!0}=n,c=k.useRef(t);c.current=t;const d=Array.isArray(e)?e:[e],p=k.useCallback(f=>{!o&&!s||!a||!u&&tN(f.target)&&!d.some(C=>C.toLowerCase()==="escape")||!d.some(b=>eN(f,b))||(f.preventDefault(),f.stopPropagation(),c.current(f))},[s,o,u,a,...d,...h]);k.useEffect(()=>(document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}),[p])}function yC(e,t){const n=e.toLowerCase(),s=t.toLowerCase();if(n===s)return 100;if(n.startsWith(s))return 80;if(n.includes(s))return 60;let o=0,u=0,h=0;for(;o<n.length&&u<s.length;)n[o]===s[u]&&(h+=1,u++),o++;return u===s.length?h:0}function nN(e,t){return t.trim()?e.map(s=>{let o=yC(s.label,t);if(s.keywords)for(const u of s.keywords){const h=yC(u,t);h>o&&(o=h)}return{command:s,score:o}}).filter(({score:s})=>s>0).sort((s,o)=>o.score-s.score).map(({command:s})=>s):e}function rN(e){const t=new Map;for(const n of e){const s=t.get(n.category)||[];s.push(n),t.set(n.category,s)}return t}const sN={navigation:"Navigation",actions:"Actions"},iN={activeTabId:null,focusedTerminals:{}};function ek(){const e=qn(),t=k.useRef(void 0),n=k.useRef({}),{data:s=iN,isLoading:o}=Nr({queryKey:["terminal-view-state"],queryFn:async()=>{const p=await fetch("/api/terminal-view-state");if(!p.ok)throw new Error("Failed to fetch terminal view state");return p.json()}}),u=jn({mutationFn:async p=>{const f=await fetch("/api/terminal-view-state",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)});if(!f.ok)throw new Error("Failed to update terminal view state");return f.json()},onSuccess:p=>{e.setQueryData(["terminal-view-state"],p)}}),h=k.useCallback(p=>{const f=n.current;n.current={...f,...p,focusedTerminals:p.focusedTerminals||f.focusedTerminals?{...f.focusedTerminals,...p.focusedTerminals}:void 0};const g=n.current,b={activeTabId:g.activeTabId!==void 0?g.activeTabId:s.activeTabId,focusedTerminals:{...s.focusedTerminals,...g.focusedTerminals}};e.setQueryData(["terminal-view-state"],b),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{u.mutate(n.current),n.current={}},500)},[e,s,u]),a=k.useCallback(p=>{h({activeTabId:p})},[h]),c=k.useCallback((p,f)=>{if(f===null){const{[p]:g,...b}=s.focusedTerminals;h({focusedTerminals:b})}else h({focusedTerminals:{[p]:f}})},[h,s.focusedTerminals]),d=k.useCallback(p=>s.focusedTerminals[p]??null,[s.focusedTerminals]);return{viewState:s,isLoading:o,activeTabId:s.activeTabId,setActiveTab:a,getFocusedTerminal:d,setFocusedTerminal:c}}function oN({onNewTask:e,onShowShortcuts:t}){const[n,s]=k.useState(!1),[o,u]=k.useState(""),[h,a]=k.useState(0),c=k.useRef(null),d=k.useRef(null),p=po(),{setActiveTab:f}=ek(),g=k.useMemo(()=>[{id:"goto-tasks",label:"Go to Tasks",shortcut:"meta+1",keywords:["kanban","board","home"],category:"navigation",icon:w.jsx(Ee,{icon:Sh,size:16,strokeWidth:2}),action:()=>{p({to:"/tasks"}),s(!1)}},{id:"goto-terminals",label:"Go to Terminals",shortcut:"meta+2",keywords:["shell","console","cli"],category:"navigation",icon:w.jsx(Ee,{icon:F_,size:16,strokeWidth:2}),action:()=>{p({to:"/terminals"}),s(!1)}},{id:"goto-task-terminals",label:"Go to Task Terminals",shortcut:"shift+meta+t",keywords:["tasks","shell","console","cli"],category:"navigation",icon:w.jsx(Ee,{icon:Sh,size:16,strokeWidth:2}),action:()=>{f("all-tasks"),p({to:"/terminals"}),s(!1)}},{id:"goto-worktrees",label:"Go to Worktrees",shortcut:"meta+3",keywords:["git","branches"],category:"navigation",icon:w.jsx(Ee,{icon:B2,size:16,strokeWidth:2}),action:()=>{p({to:"/worktrees"}),s(!1)}},{id:"goto-repositories",label:"Go to Repositories",shortcut:"meta+4",keywords:["repos","git","projects"],category:"navigation",icon:w.jsx(Ee,{icon:I2,size:16,strokeWidth:2}),action:()=>{p({to:"/repositories"}),s(!1)}},{id:"goto-settings",label:"Go to Settings",shortcut:"meta+,",keywords:["preferences","config","configuration"],category:"navigation",icon:w.jsx(Ee,{icon:V2,size:16,strokeWidth:2}),action:()=>{p({to:"/settings"}),s(!1)}},{id:"new-task",label:"New Task",shortcut:"meta+n",keywords:["create","add"],category:"actions",icon:w.jsx(Ee,{icon:ql,size:16,strokeWidth:2}),action:()=>{s(!1),e?.()}},{id:"show-shortcuts",label:"Keyboard Shortcuts",shortcut:"meta+/",keywords:["help","hotkeys","keys"],category:"actions",icon:w.jsx(Ee,{icon:q3,size:16,strokeWidth:2}),action:()=>{s(!1),t?.()}}],[p,e,t,f]),b=k.useMemo(()=>nN(g,o),[g,o]),C=k.useMemo(()=>rN(b),[b]),x=k.useMemo(()=>{const v=[],S=["navigation","actions"];for(const E of S){const T=C.get(E);T&&v.push(...T)}return v},[C]);k.useEffect(()=>{a(0)},[o]),k.useEffect(()=>{if(!d.current)return;const v=d.current.querySelector('[data-selected="true"]');v&&v.scrollIntoView({block:"nearest"})},[h]),hi("meta+k",()=>s(!0),{allowInInput:!0}),hi("meta+1",()=>p({to:"/tasks"}),{allowInInput:!0}),hi("meta+2",()=>p({to:"/terminals"}),{allowInInput:!0}),hi("shift+meta+t",()=>{f("all-tasks"),p({to:"/terminals"})},{allowInInput:!0}),hi("meta+3",()=>p({to:"/worktrees"}),{allowInInput:!0}),hi("meta+4",()=>p({to:"/repositories"}),{allowInInput:!0}),hi("meta+,",()=>p({to:"/settings"}),{allowInInput:!0}),hi("meta+n",()=>{e?.()},{allowInInput:!1,deps:[e]}),hi("meta+/",()=>{t?.()},{allowInInput:!0,deps:[t]});const y=k.useCallback(v=>{switch(v.key){case"ArrowDown":v.preventDefault(),a(S=>Math.min(S+1,x.length-1));break;case"ArrowUp":v.preventDefault(),a(S=>Math.max(S-1,0));break;case"Enter":v.preventDefault(),x[h]&&x[h].action();break;case"Escape":v.preventDefault(),s(!1);break}},[x,h]);k.useEffect(()=>{n&&(u(""),a(0),setTimeout(()=>c.current?.focus(),50))},[n]);let _=0;return w.jsx(As,{open:n,onOpenChange:s,children:w.jsxs(Os,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden",showCloseButton:!1,onKeyDown:y,children:[w.jsxs("div",{className:"flex items-center border-b border-border px-3",children:[w.jsx("span",{className:"text-muted-foreground mr-2",children:">"}),w.jsx(Kt,{ref:c,value:o,onChange:v=>u(v.target.value),placeholder:"Type a command or search...",className:"border-0 ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 px-0 h-12"}),w.jsx("kbd",{className:"pointer-events-none ml-2 inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"Esc"})]}),w.jsx("div",{ref:d,className:"max-h-80 overflow-y-auto p-2",children:b.length===0?w.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No commands found."}):w.jsx(w.Fragment,{children:["navigation","actions"].map(v=>{const S=C.get(v);return!S||S.length===0?null:w.jsxs("div",{className:"mb-2 last:mb-0",children:[w.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:sN[v]}),S.map(E=>{const T=_++,A=T===h;return w.jsxs("button",{"data-selected":A,onClick:()=>E.action(),onMouseEnter:()=>a(T),className:Be("flex w-full items-center gap-3 rounded-md px-2 py-2 text-sm",A?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[E.icon&&w.jsx("span",{className:"text-muted-foreground",children:E.icon}),w.jsx("span",{className:"flex-1 text-left",children:E.label}),E.shortcut&&w.jsx("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:JR(E.shortcut)})]},E.id)})]},v)})})})]})})}const aN=[{title:"Navigation",items:[{label:"Go to Tasks",shortcut:"meta+1"},{label:"Go to Terminals",shortcut:"meta+2"},{label:"Go to Task Terminals",shortcut:"shift+meta+t"},{label:"Go to Worktrees",shortcut:"meta+3"},{label:"Go to Repositories",shortcut:"meta+4"},{label:"Go to Settings",shortcut:"meta+,"}]},{title:"Actions",items:[{label:"Command Palette",shortcut:"meta+k"},{label:"New Task",shortcut:"meta+n"},{label:"Keyboard Shortcuts",shortcut:"meta+/"}]},{title:"General",items:[{label:"Close Modal",shortcut:"escape"}]}];function lN({open:e,onOpenChange:t}){return w.jsx(As,{open:e,onOpenChange:t,children:w.jsxs(Os,{className:"sm:max-w-md",children:[w.jsx(mi,{children:w.jsx(gi,{children:"Keyboard Shortcuts"})}),w.jsx("div",{className:"space-y-4 mt-2",children:aN.map(n=>w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:n.title}),w.jsx("div",{className:"space-y-1",children:n.items.map(s=>w.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[w.jsx("span",{className:"text-sm",children:s.label}),w.jsx("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:JR(s.shortcut)})]},s.shortcut))})]},n.title))})]})})}const cN=({...e})=>w.jsx($9,{theme:"dark",className:"toaster group",icons:{success:w.jsx(Ee,{icon:z3,strokeWidth:2,className:"size-4"}),info:w.jsx(Ee,{icon:K3,strokeWidth:2,className:"size-4"}),warning:w.jsx(Ee,{icon:tp,strokeWidth:2,className:"size-4"}),error:w.jsx(Ee,{icon:X3,strokeWidth:2,className:"size-4"}),loading:w.jsx(Ee,{icon:Ls,strokeWidth:2,className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e}),wi=pO({component:dN});function uN(){return Q9(),null}function dN(){const[e,t]=k.useState(null),[n,s]=k.useState(!1),o=k.useCallback(a=>{t(()=>a)},[]),u=k.useCallback(()=>{e?.()},[e]),h=k.useCallback(()=>{s(!0)},[]);return w.jsx(Z9,{children:w.jsxs("div",{className:"flex h-screen flex-col bg-background text-foreground",children:[w.jsx(uN,{}),w.jsx(b9,{onNewTaskRef:o}),w.jsx("main",{className:"isolate flex-1 overflow-hidden",children:w.jsx(Xw,{})}),w.jsx(oN,{onNewTask:u,onShowShortcuts:h}),w.jsx(lN,{open:n,onOpenChange:s}),w.jsx(cN,{position:"bottom-right"})]})})}const fN=Ns("/")({beforeLoad:()=>{throw Pw({to:"/tasks"})}}),tk="";async function hN(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const s=await n.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||"Request failed")}return n.json()}function pN(){const[e,t]=k.useState(new Map),[n,s]=k.useState(null),[o,u]=k.useState(!0),[h,a]=k.useState(!1),[c,d]=k.useState(null),p=k.useRef(null),f=k.useRef(0),g=k.useCallback(()=>{p.current?.close(),u(!0),a(!1),d(null),t(new Map),s(null);const C=new EventSource(`${tk}/api/worktrees`);p.current=C,C.addEventListener("worktree:basic",x=>{const y=JSON.parse(x.data);f.current=y.length,t(new Map(y.map(_=>[_.path,{..._,size:0,sizeFormatted:"...",branch:"..."}]))),u(!1),a(y.length>0)}),C.addEventListener("worktree:details",x=>{const y=JSON.parse(x.data);t(_=>{const v=new Map(_),S=v.get(y.path);return S&&v.set(y.path,{...S,size:y.size,sizeFormatted:y.sizeFormatted,branch:y.branch}),v}),f.current--,f.current<=0&&a(!1)}),C.addEventListener("worktree:complete",x=>{const y=JSON.parse(x.data);s(y),a(!1),C.close()}),C.addEventListener("worktree:error",x=>{const{path:y}=JSON.parse(x.data);console.error(`Error loading worktree details for ${y}`),f.current--,f.current<=0&&a(!1)}),C.onerror=()=>{d(new Error("Connection lost")),u(!1),a(!1),C.close()}},[]);return k.useEffect(()=>(g(),()=>{p.current?.close()}),[g]),{worktrees:k.useMemo(()=>Array.from(e.values()).sort((x,y)=>x.isOrphaned!==y.isOrphaned?x.isOrphaned?-1:1:new Date(y.lastModified).getTime()-new Date(x.lastModified).getTime()),[e]),summary:n,isLoading:o,isLoadingDetails:h,error:c,refetch:g}}function mN(){const e=qn();return jn({mutationFn:({worktreePath:t,repoPath:n})=>hN(`${tk}/api/worktrees`,{method:"DELETE",body:JSON.stringify({worktreePath:t,repoPath:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["worktrees"]}),e.invalidateQueries({queryKey:["tasks"]})}})}const gN=Fl("h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function bC({className:e,variant:t="default",render:n,...s}){return II({defaultTagName:"span",props:Bs({className:Be(gN({className:e,variant:t}))},s),render:n,state:{slot:"badge",variant:t}})}function bp({className:e,size:t="default",...n}){return w.jsx("div",{"data-slot":"card","data-size":t,className:Be("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-xs/relaxed ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col",e),...n})}function vN({className:e,...t}){return w.jsx("div",{"data-slot":"card-header",className:Be("gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...t})}function _N({className:e,...t}){return w.jsx("div",{"data-slot":"card-title",className:Be("text-sm font-medium",e),...t})}function Sp({className:e,...t}){return w.jsx("div",{"data-slot":"card-content",className:Be("px-4 group-data-[size=sm]/card:px-3",e),...t})}function yN({className:e,...t}){return w.jsx("div",{"data-slot":"card-footer",className:Be("rounded-b-lg px-4 group-data-[size=sm]/card:px-3 [.border-t]:pt-4 group-data-[size=sm]/card:[.border-t]:pt-3 flex items-center",e),...t})}function Qu({...e}){return w.jsx(gP,{"data-slot":"alert-dialog",...e})}function Zu({...e}){return w.jsx(ZE,{"data-slot":"alert-dialog-trigger",...e})}function bN({...e}){return w.jsx(KE,{"data-slot":"alert-dialog-portal",...e})}function SN({className:e,...t}){return w.jsx(U2,{"data-slot":"alert-dialog-overlay",className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function Ju({className:e,size:t="default",...n}){return w.jsxs(bN,{children:[w.jsx(SN,{}),w.jsx($E,{"data-slot":"alert-dialog-content","data-size":t,className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-3 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...n})]})}function ed({className:e,...t}){return w.jsx("div",{"data-slot":"alert-dialog-header",className:Be("grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function td({className:e,...t}){return w.jsx("div",{"data-slot":"alert-dialog-footer",className:Be("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function nd({className:e,...t}){return w.jsx(QE,{"data-slot":"alert-dialog-title",className:Be("text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function rd({className:e,...t}){return w.jsx(G2,{"data-slot":"alert-dialog-description",className:Be("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function nk({className:e,...t}){return w.jsx(Ve,{"data-slot":"alert-dialog-action",className:Be(e),...t})}function sd({className:e,variant:t="outline",size:n="default",...s}){return w.jsx(rp,{"data-slot":"alert-dialog-cancel",className:Be(e),render:w.jsx(Ve,{variant:t,size:n}),...s})}const rk={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},r_={IN_PROGRESS:"bg-slate-400/20 text-slate-600 dark:text-slate-400",IN_REVIEW:"bg-violet-400/20 text-violet-600 dark:text-violet-400",DONE:"bg-emerald-400/20 text-emerald-600 dark:text-emerald-400",CANCELED:"bg-rose-400/20 text-rose-600 dark:text-rose-400",ORPHANED:"bg-destructive/20 text-destructive"},xN=Ns("/worktrees/")({component:RN});function CN(e){const t=new Date(e),s=new Date().getTime()-t.getTime(),o=Math.floor(s/1e3),u=Math.floor(o/60),h=Math.floor(u/60),a=Math.floor(h/24);return a>0?a===1?"1 day ago":`${a} days ago`:h>0?h===1?"1 hour ago":`${h} hours ago`:u>0?u===1?"1 minute ago":`${u} minutes ago`:"just now"}function SC({className:e}){return w.jsx("span",{className:`inline-block animate-pulse rounded bg-muted ${e}`})}function wN({worktree:e,onDelete:t}){const[n,s]=k.useState(!1),[o,u]=k.useState(!1),h=e.sizeFormatted==="..."||e.branch==="...",a=async()=>{u(!0);try{await t(e),s(!1)}catch{}finally{u(!1)}};return w.jsx(bp,{className:"transition-colors hover:border-border/80",children:w.jsxs(Sp,{className:"flex items-start justify-between gap-4 py-4",children:[w.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"truncate font-medium",children:e.name}),e.isOrphaned?w.jsx(bC,{className:Be("shrink-0",r_.ORPHANED),children:"Orphaned"}):e.taskStatus?w.jsx(bC,{className:Be("shrink-0",r_[e.taskStatus]),children:rk[e.taskStatus]}):null]}),w.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx(Ee,{icon:ms,size:12,strokeWidth:2,className:"shrink-0"}),w.jsx("span",{className:"truncate font-mono",children:e.path})]}),w.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx(Ee,{icon:qv,size:12,strokeWidth:2,className:"shrink-0"}),e.branch==="..."?w.jsx(SC,{className:"h-3 w-16"}):w.jsx("span",{className:"font-mono",children:e.branch})]}),w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx(Ee,{icon:W3,size:12,strokeWidth:2,className:"shrink-0"}),e.sizeFormatted==="..."?w.jsx(SC,{className:"h-3 w-12"}):w.jsx("span",{children:e.sizeFormatted})]}),w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx(Ee,{icon:j3,size:12,strokeWidth:2,className:"shrink-0"}),w.jsx("span",{children:CN(e.lastModified)})]})]}),e.taskId&&e.taskTitle&&w.jsx("div",{className:"flex items-center gap-1.5 pt-1",children:w.jsxs(rr,{to:"/tasks/$taskId",params:{taskId:e.taskId},className:"inline-flex items-center gap-1 text-foreground hover:underline",children:[w.jsx("span",{className:"truncate",children:e.taskTitle}),w.jsx(Ee,{icon:M2,size:12,strokeWidth:2,className:"shrink-0"})]})})]})]}),w.jsxs(Qu,{open:n,onOpenChange:s,children:[w.jsx(Zu,{render:w.jsx(Ve,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:h}),children:w.jsx(Ee,{icon:Nu,size:14,strokeWidth:2})}),w.jsxs(Ju,{children:[w.jsxs(ed,{children:[w.jsx(nd,{children:"Delete Worktree"}),w.jsxs(rd,{children:["This will permanently delete the worktree directory at"," ",w.jsx("span",{className:"font-mono",children:e.name}),".",!e.isOrphaned&&w.jsxs(w.Fragment,{children:[" ","The linked task ",w.jsxs("span",{className:"font-medium",children:['"',e.taskTitle,'"']})," will also be deleted."]})," ","This action cannot be undone."]})]}),w.jsxs(td,{children:[w.jsx(sd,{disabled:o,children:"Cancel"}),w.jsxs(Ve,{variant:"destructive",onClick:a,disabled:o,className:"gap-2",children:[o&&w.jsx(Ee,{icon:Ls,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})]})})}const EN=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED","ORPHANED"];function RN(){const{worktrees:e,summary:t,isLoading:n,isLoadingDetails:s,error:o,refetch:u}=pN(),h=mN(),[a,c]=k.useState(new Set),d=b=>{c(C=>{const x=new Set(C);return x.has(b)?x.delete(b):x.add(b),x})},p=()=>{c(new Set)},f=k.useMemo(()=>a.size===0?e:e.filter(b=>!!(b.isOrphaned&&a.has("ORPHANED")||b.taskStatus&&a.has(b.taskStatus))),[e,a]),g=async b=>{await h.mutateAsync({worktreePath:b.path,repoPath:b.repoPath}),u()};return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex shrink-0 flex-col gap-2 border-b border-border px-4 py-2",children:[w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsxs("div",{className:"flex items-center gap-4",children:[w.jsx("h1",{className:"text-sm font-medium",children:"Worktrees"}),(t||e.length>0)&&w.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[w.jsxs("span",{children:[t?.total??e.length," total"]}),(t?.orphaned??e.filter(b=>b.isOrphaned).length)>0&&w.jsxs("span",{className:"text-destructive",children:[t?.orphaned??e.filter(b=>b.isOrphaned).length," orphaned"]}),s?w.jsx("span",{className:"animate-pulse",children:"calculating..."}):t?w.jsx("span",{children:t.totalSizeFormatted}):null]})]}),a.size>0&&w.jsxs(Ve,{variant:"ghost",size:"sm",onClick:p,className:"gap-1.5 text-xs",children:[w.jsx(Ee,{icon:ho,size:12,strokeWidth:2}),"Clear filters"]})]}),w.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:EN.map(b=>{const C=a.has(b);return w.jsx("button",{onClick:()=>d(b),className:Be("rounded-full px-2.5 py-1 text-xs font-medium transition-colors",C?r_[b]:"bg-muted text-muted-foreground hover:bg-muted/80"),children:rk[b]},b)})})]}),w.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[n&&w.jsx("div",{className:"flex items-center justify-center py-12",children:w.jsx(Ee,{icon:Ls,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),o&&w.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[w.jsx(Ee,{icon:tp,size:20,strokeWidth:2}),w.jsxs("span",{className:"text-sm",children:["Failed to load worktrees: ",o.message]})]}),!n&&!o&&f.length===0&&w.jsx("div",{className:"py-12 text-muted-foreground",children:w.jsx("p",{className:"text-sm",children:a.size>0?"No worktrees match the selected filters.":"No worktrees found. Worktrees are created when you create tasks with branches."})}),!n&&w.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:f.map(b=>w.jsx(wN,{worktree:b,onDelete:g},b.path))})]})]})}function qt(e,t="Assertion error"){if(!e)throw Error(t)}function Bl({group:e}){const{orientation:t,panels:n}=e;return n.reduce((s,o)=>(s+=t==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,s),0)}function s_(e,t){return t.sort(e==="horizontal"?kN:TN)}function kN(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function TN(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function sk(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function LN({orientation:e,rects:t,targetRect:n}){const s={x:n.x+n.width/2,y:n.y+n.height/2};let o,u=Number.MAX_VALUE;for(const h of t){const{x:a,y:c}=sk(s,h),d=e==="horizontal"?a:c;d<u&&(u=d,o=h)}return qt(o,"No rect found"),o}function ik(e){const{element:t,orientation:n,panels:s,separators:o}=e,u=s_(n,Array.from(t.children).filter(p=>p instanceof HTMLElement).map(p=>({element:p}))).map(({element:p})=>p),h=[];let a=!1,c,d=[];for(const p of u)if(p.hasAttribute("data-panel")){const f=s.find(g=>g.element===p);if(f){if(c){const g=c.element.getBoundingClientRect(),b=p.getBoundingClientRect();let C;if(a){const x=n==="horizontal"?new DOMRect(g.right,g.top,0,g.height):new DOMRect(g.left,g.bottom,g.width,0),y=n==="horizontal"?new DOMRect(b.left,b.top,0,b.height):new DOMRect(b.left,b.top,b.width,0);switch(d.length){case 0:{C=[x,y];break}case 1:{const _=d[0],v=LN({orientation:n,rects:[g,b],targetRect:_.element.getBoundingClientRect()});C=[_,v===g?y:x];break}default:{C=d;break}}}else d.length?C=d:C=[n==="horizontal"?new DOMRect(g.right,b.top,b.left-g.right,b.height):new DOMRect(b.left,g.bottom,b.width,b.top-g.bottom)];for(const x of C)h.push({group:e,groupSize:Bl({group:e}),panels:[c,f],separator:"width"in x?void 0:x,rect:"width"in x?x:x.element.getBoundingClientRect()})}a=!1,c=f,d=[]}}else if(p.hasAttribute("data-separator")){const f=o.find(g=>g.element===p);f?d.push(f):(c=void 0,d=[])}else a=!0;return h}function AN(e,t){const n=getComputedStyle(e),s=parseFloat(n.fontSize);return t*s}function ON(e,t){const n=getComputedStyle(e.ownerDocument.body),s=parseFloat(n.fontSize);return t*s}function MN(e){return e/100*window.innerHeight}function DN(e){return e/100*window.innerWidth}function PN(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function Gf({groupSize:e,panelElement:t,styleProp:n}){let s;const[o,u]=PN(n);switch(u){case"%":{s=o/100*e;break}case"px":{s=o;break}case"rem":{s=ON(t,o);break}case"em":{s=AN(t,o);break}case"vh":{s=MN(o);break}case"vw":{s=DN(o);break}}return s}function ps(e){return parseFloat(e.toFixed(3))}function xC(e){const{panels:t}=e,n=Bl({group:e});return n===0?t.map(s=>({collapsedSize:0,collapsible:s.panelConstraints.collapsible===!0,defaultSize:void 0,minSize:0,maxSize:100,panelId:s.id})):t.map(s=>{const{element:o,panelConstraints:u}=s;let h=0;if(u.collapsedSize){const p=Gf({groupSize:n,panelElement:o,styleProp:u.collapsedSize});h=ps(p/n*100)}let a;if(u.defaultSize){const p=Gf({groupSize:n,panelElement:o,styleProp:u.defaultSize});a=ps(p/n*100)}let c=0;if(u.minSize){const p=Gf({groupSize:n,panelElement:o,styleProp:u.minSize});c=ps(p/n*100)}let d=100;if(u.maxSize){const p=Gf({groupSize:n,panelElement:o,styleProp:u.maxSize});d=ps(p/n*100)}return{collapsedSize:h,collapsible:u.collapsible===!0,defaultSize:a,minSize:c,maxSize:d,panelId:s.id}})}class IN{#e={};addListener(t,n){const s=this.#e[t];return s===void 0?this.#e[t]=[n]:s.includes(n)||s.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const s=this.#e[t];if(s!==void 0)if(s.length===1)s[0].call(null,n);else{let o=!1,u=null;const h=Array.from(s);for(let a=0;a<h.length;a++){const c=h[a];try{c.call(null,n)}catch(d){u===null&&(o=!0,u=d)}}if(o)throw u}}removeAllListeners(){this.#e={}}removeListener(t,n){const s=this.#e[t];if(s!==void 0){const o=s.indexOf(n);o>=0&&s.splice(o,1)}}}function nr(e,t,n=0){return Math.abs(ps(e)-ps(t))<=n}let $r={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const da=new IN;function Fs(){return $r}function ts(e){const t=typeof e=="function"?e($r):e;if($r===t)return $r;const n=$r;return $r={...$r,...t},t.cursorFlags!==void 0&&da.emit("cursorFlagsChange",$r.cursorFlags),t.interactionState!==void 0&&da.emit("interactionStateChange",$r.interactionState),t.mountedGroups!==void 0&&($r.mountedGroups.forEach((s,o)=>{s.derivedPanelConstraints.forEach(u=>{if(u.collapsible){const{layout:h}=n.mountedGroups.get(o)??{};if(h){const a=nr(u.collapsedSize,s.layout[u.panelId]),c=nr(u.collapsedSize,h[u.panelId]);a&&!c&&(o.inMemoryLastExpandedPanelSizes[u.panelId]=h[u.panelId])}}})}),da.emit("mountedGroupsChange",$r.mountedGroups)),$r}const NN=e=>e,dv=()=>{},ok=1,ak=2,lk=4,ck=8,CC={coarse:10,precise:5};function jN({cursorFlags:e,groups:t,state:n}){let s=0,o=0;switch(n){case"active":case"hover":t.forEach(u=>{if(!u.disableCursor)switch(u.orientation){case"horizontal":{s++;break}case"vertical":{o++;break}}})}if(s===0&&o===0)return null;switch(n){case"active":{const u=(e&ok)!==0,h=(e&ak)!==0,a=(e&lk)!==0,c=(e&ck)!==0;if(e){if(u)return a?"se-resize":c?"ne-resize":"e-resize";if(h)return a?"sw-resize":c?"nw-resize":"w-resize";if(a)return"s-resize";if(c)return"n-resize"}break}}return s>0&&o>0?"move":s>0?"ew-resize":"ns-resize"}let fv,ws;function N0(){ws===void 0&&(ws=new CSSStyleSheet,document.adoptedStyleSheets=[ws]);const{cursorFlags:e,interactionState:t}=Fs();switch(t.state){case"active":case"hover":{const n=jN({cursorFlags:e,groups:t.hitRegions.map(o=>o.group),state:t.state}),s=`*{cursor: ${n} !important; ${t.state==="active"?"touch-action: none;":""} }`;if(fv===s)return;fv=s,n?ws.cssRules.length===0?ws.insertRule(s):ws.replaceSync(s):ws.cssRules.length===1&&ws.deleteRule(0);break}case"inactive":{fv=void 0,ws.cssRules.length===1&&ws.deleteRule(0);break}}}function BN(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function ku(e,t){return nr(e,t)?0:e>t?1:-1}function yl({panelConstraints:e,size:t}){const{collapsedSize:n=0,collapsible:s,maxSize:o=100,minSize:u=0}=e;if(ku(t,u)<0)if(s){const h=(n+u)/2;ku(t,h)<0?t=n:t=u}else t=u;return t=Math.min(o,t),t=ps(t),t}function Tu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:s,prevLayout:o,trigger:u}){if(nr(e,0))return t;const h=Object.values(t),a=Object.values(o),c=[...h],[d,p]=s;qt(d!=null,"Invalid first pivot index"),qt(p!=null,"Invalid second pivot index");let f=0;if(u==="keyboard"){{const C=e<0?p:d,x=n[C];qt(x,`Panel constraints not found for index ${C}`);const{collapsedSize:y=0,collapsible:_,minSize:v=0}=x;if(_){const S=h[C];if(qt(S!=null,`Previous layout not found for panel index ${C}`),nr(S,y)){const E=v-S;ku(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}{const C=e<0?d:p,x=n[C];qt(x,`No panel constraints found for index ${C}`);const{collapsedSize:y=0,collapsible:_,minSize:v=0}=x;if(_){const S=h[C];if(qt(S!=null,`Previous layout not found for panel index ${C}`),nr(S,v)){const E=S-y;ku(E,Math.abs(e))>0&&(e=e<0?0-E:E)}}}}{const C=e<0?1:-1;let x=e<0?p:d,y=0;for(;;){const v=h[x];qt(v!=null,`Previous layout not found for panel index ${x}`);const S=yl({panelConstraints:n[x],size:100})-v;if(y+=S,x+=C,x<0||x>=n.length)break}const _=Math.min(Math.abs(e),Math.abs(y));e=e<0?0-_:_}{let C=e<0?d:p;for(;C>=0&&C<n.length;){const x=Math.abs(e)-Math.abs(f),y=h[C];qt(y!=null,`Previous layout not found for panel index ${C}`);const _=y-x,v=yl({panelConstraints:n[C],size:_});if(!nr(y,v)&&(f+=y-v,c[C]=v,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?C--:C++}}if(BN(a,c))return o;{const C=e<0?p:d,x=h[C];qt(x!=null,`Previous layout not found for panel index ${C}`);const y=x+f,_=yl({panelConstraints:n[C],size:y});if(c[C]=_,!nr(_,y)){let v=y-_,S=e<0?p:d;for(;S>=0&&S<n.length;){const E=c[S];qt(E!=null,`Previous layout not found for panel index ${S}`);const T=E+v,A=yl({panelConstraints:n[S],size:T});if(nr(E,A)||(v-=A-E,c[S]=A),nr(v,0))break;e>0?S--:S++}}}const g=Object.values(c).reduce((C,x)=>x+C,0);if(!nr(g,100,.1))return o;const b=Object.keys(o);return c.reduce((C,x,y)=>(C[b[y]]=x,C),{})}function Jl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||ku(e[n],t[n])!==0)return!1;return!0}function uk({event:e,hitRegions:t,initialLayoutMap:n,mountedGroups:s,pointerDownAtPoint:o}){let u=0;const h=new Map(s);t.forEach(a=>{const{group:c,groupSize:d}=a,{disableCursor:p,orientation:f,panels:g}=c;let b=0;o?f==="horizontal"?b=(e.clientX-o.x)/d*100:b=(e.clientY-o.y)/d*100:f==="horizontal"?b=e.clientX<0?-100:100:b=e.clientY<0?-100:100;const C=n.get(c),{defaultLayoutDeferred:x,derivedPanelConstraints:y,layout:_,separatorToPanels:v}=s.get(c)??{defaultLayoutDeferred:!1};if(y&&C&&_&&v){const S=Tu({delta:b,initialLayout:C,panelConstraints:y,pivotIndices:a.panels.map(E=>g.indexOf(E)),prevLayout:_,trigger:"mouse-or-touch"});if(Jl(S,_)){if(b!==0&&!p)switch(f){case"horizontal":{u|=b<0?ok:ak;break}case"vertical":{u|=b<0?lk:ck;break}}}else{h.set(a.group,{defaultLayoutDeferred:x,derivedPanelConstraints:y,layout:S,separatorToPanels:v});const E=a.group.panels.map(({id:T})=>T).join(",");a.group.inMemoryLayouts[E]=S}}}),ts({cursorFlags:u,mountedGroups:h}),N0()}function wC(e){if(e.defaultPrevented||e.relatedTarget!==null||e.clientX===0&&e.clientY===0)return;const{interactionState:t,mountedGroups:n}=Fs();t.state==="active"&&t.hitRegions.forEach(s=>{e.currentTarget===s.group.element&&uk({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n})})}function oh(e){const t=e.parentElement;qt(t,"Parent group element not found");const{mountedGroups:n}=Fs();for(const[s]of n)if(s.element===t)return s;throw Error("Could not find parent Group for separator element")}function ya({layout:e,panelConstraints:t}){const n=[...Object.values(e)],s=n.reduce((h,a)=>h+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(h=>`${h}%`).join(", ")}`);if(!nr(s,100)&&n.length>0)for(let h=0;h<t.length;h++){const a=n[h];qt(a!=null,`No layout data found for index ${h}`);const c=100/s*a;n[h]=c}let o=0;for(let h=0;h<t.length;h++){const a=n[h];qt(a!=null,`No layout data found for index ${h}`);const c=yl({panelConstraints:t[h],size:a});a!=c&&(o+=a-c,n[h]=c)}if(!nr(o,0))for(let h=0;h<t.length;h++){const a=n[h];qt(a!=null,`No layout data found for index ${h}`);const c=a+o,d=yl({panelConstraints:t[h],size:c});if(a!==d&&(o-=d-a,n[h]=d,nr(o,0)))break}const u=Object.keys(e);return n.reduce((h,a,c)=>(h[u[c]]=a,h),{})}function dk({groupId:e}){const t=()=>{const{mountedGroups:n}=Fs();for(const[s,o]of n)if(s.id===e)return{group:s,...o};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:s}=t();return n?{}:s},setLayout(n){const{defaultLayoutDeferred:s,derivedPanelConstraints:o,group:u,layout:h,separatorToPanels:a}=t(),c=ya({layout:n,panelConstraints:o});return s?h:(Jl(h,c)||ts(d=>({mountedGroups:new Map(d.mountedGroups).set(u,{defaultLayoutDeferred:s,derivedPanelConstraints:o,layout:c,separatorToPanels:a})})),c)}}}function fk(e){const{mountedGroups:t}=Fs(),n=t.get(e);return qt(n,`Mounted Group ${e.id} not found`),n}function Vo(e,t){const n=oh(e),s=fk(n),o=n.separators.find(p=>p.element===e);qt(o,"Matching separator not found");const u=s.separatorToPanels.get(o);qt(u,"Matching panels not found");const h=u.map(p=>n.panels.indexOf(p)),a=dk({groupId:n.id}).getLayout(),c=Tu({delta:t,initialLayout:a,panelConstraints:s.derivedPanelConstraints,pivotIndices:h,prevLayout:a,trigger:"keyboard"}),d=ya({layout:c,panelConstraints:s.derivedPanelConstraints});Jl(a,d)||ts(p=>({mountedGroups:new Map(p.mountedGroups).set(n,{defaultLayoutDeferred:s.defaultLayoutDeferred,derivedPanelConstraints:s.derivedPanelConstraints,layout:d,separatorToPanels:s.separatorToPanels})}))}function EC(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=oh(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Vo(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Vo(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Vo(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Vo(t,-5);break}case"End":{e.preventDefault(),Vo(t,100);break}case"Enter":{e.preventDefault();const s=oh(t),{derivedPanelConstraints:o,layout:u,separatorToPanels:h}=fk(s),a=s.separators.find(f=>f.element===t);qt(a,"Matching separator not found");const c=h.get(a);qt(c,"Matching panels not found");const d=c[0],p=o.find(f=>f.panelId===d.id);if(qt(p,"Panel metadata not found"),p.collapsible){const f=u[d.id],g=p.collapsedSize===f?s.inMemoryLastExpandedPanelSizes[d.id]??p.minSize:p.collapsedSize;Vo(t,g-f)}break}case"F6":{e.preventDefault();const s=oh(t).separators.map(h=>h.element),o=Array.from(s).findIndex(h=>h===e.currentTarget);qt(o!==null,"Index not found");const u=e.shiftKey?o>0?o-1:s.length-1:o+1<s.length?o+1:0;s[u].focus();break}case"Home":{e.preventDefault(),Vo(t,-100);break}}}function zN(e,t,n){let s,o={x:1/0,y:1/0};for(const u of t){const h=sk(n,u.rect);switch(e){case"horizontal":{h.x<=o.x&&(s=u,o=h);break}case"vertical":{h.y<=o.y&&(s=u,o=h);break}}}return s?{distance:o,hitRegion:s}:void 0}let $f;function HN(){return $f===void 0&&(typeof matchMedia=="function"?$f=!!matchMedia("(pointer:coarse)").matches:$f=!1),$f}function VN(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:TC(e),b:TC(t)};let s;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),s=e;qt(s,"Stacking order can only be calculated for elements with a common ancestor");const o={a:kC(RC(n.a)),b:kC(RC(n.b))};if(o.a===o.b){const u=s.childNodes,h={a:n.a.at(-1),b:n.b.at(-1)};let a=u.length;for(;a--;){const c=u[a];if(c===h.a)return 1;if(c===h.b)return-1}}return Math.sign(o.a-o.b)}const FN=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function UN(e){const t=getComputedStyle(hk(e)??e).display;return t==="flex"||t==="inline-flex"}function WN(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||UN(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||FN.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function RC(e){let t=e.length;for(;t--;){const n=e[t];if(qt(n,"Missing node"),WN(n))return n}return null}function kC(e){return e&&Number(getComputedStyle(e).zIndex)||0}function TC(e){const t=[];for(;e;)t.push(e),e=hk(e);return t}function hk(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}function qN(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function GN({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!(n instanceof HTMLElement)||n.contains(e)||e.contains(n))return!0;if(VN(n,e)>0){let s=n;for(;s;){if(s.contains(e))return!0;if(qN(s.getBoundingClientRect(),t))return!1;s=s.parentElement}}return!0}function pk(e,t){const n=[];return t.forEach((s,o)=>{if(o.disabled)return;const u=HN()?CC.coarse:CC.precise,h=ik(o),a=zN(o.orientation,h,{x:e.clientX,y:e.clientY});a&&a.distance.x<=u&&a.distance.y<=u&&GN({groupElement:o.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function LC(e){if(e.defaultPrevented)return;const{mountedGroups:t}=Fs(),n=pk(e,t),s=new Set,o=new Set,u=new Set,h=new Map;let a=!1;n.forEach(c=>{s.add(c.group),c.panels.forEach(p=>{o.add(p)}),c.separator&&(u.add(c.separator),a||(a=!0,c.separator.element.focus()));const d=t.get(c.group);d&&h.set(c.group,d.layout)}),ts({interactionState:{hitRegions:n,initialLayoutMap:h,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),n.length&&e.preventDefault()}function AC(e){if(e.defaultPrevented)return;const{interactionState:t,mountedGroups:n}=Fs();switch(t.state){case"active":{if(e.type!=="pointerleave"&&e.buttons===0){ts(s=>s.interactionState.state==="inactive"?s:{cursorFlags:0,interactionState:{state:"inactive"}});return}uk({event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint});break}default:{const s=pk(e,n);s.length===0?t.state!=="inactive"&&ts({interactionState:{state:"inactive"}}):ts({interactionState:{hitRegions:s,state:"hover"}}),N0();break}}}function OC(e){if(e.defaultPrevented)return;e.preventDefault();const{interactionState:t}=Fs();t.state==="active"&&(ts({cursorFlags:0,interactionState:{state:"inactive"}}),N0())}function MC(e){let t=0,n=0;const s={};for(const u of e)if(u.defaultSize!==void 0){t++;const h=ps(u.defaultSize);n+=h,s[u.panelId]=h}else s[u.panelId]=void 0;const o=e.length-t;if(o!==0){const u=ps((100-n)/o);for(const h of e)h.defaultSize===void 0&&(s[h.panelId]=u)}return s}function $N(e,t,n){const s=n[0];if(!s)return;const o=e.panels.find(h=>h.element===t);if(!o||!o.onResize)return;const u=Bl({group:e});o.onResize({asPercentage:ps(s.inlineSize/u*100),inPixels:s.inlineSize},o.id)}function KN(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function YN(e){let t=!0;const n=new Set,s=new Set,o=new ResizeObserver(b=>{for(const C of b){const{borderBoxSize:x,target:y}=C;if(y===e.element){if(t){if(Bl({group:e})===0)return;ts(_=>{const v=_.mountedGroups.get(e);if(v){const S=xC(e),E=v.defaultLayoutDeferred?MC(S):v.layout,T=ya({layout:E,panelConstraints:S});return!v.defaultLayoutDeferred&&Jl(E,T)&&KN(v.derivedPanelConstraints,S)?_:{mountedGroups:new Map(_.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:S,layout:T,separatorToPanels:v.separatorToPanels})}}return _})}}else $N(e,y,x)}});o.observe(e.element),e.panels.forEach(b=>{qt(!n.has(b.id),`Panel ids must be unique; id "${b.id}" was used more than once`),n.add(b.id),b.onResize&&o.observe(b.element)});const u=Bl({group:e}),h=xC(e),a=e.panels.map(({id:b})=>b).join(",");let c=e.defaultLayout;c&&e.panels.length!==Object.keys(c).length&&(c=void 0);const d=e.inMemoryLayouts[a]??c??MC(h),p=ya({layout:d,panelConstraints:h}),f=ik(e),g=ts(b=>{const C=new Map;return f.forEach(x=>{x.separator&&C.set(x.separator,x.panels)}),{mountedGroups:new Map(b.mountedGroups).set(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:h,layout:p,separatorToPanels:C})}});return e.element.addEventListener("pointerleave",wC),e.separators.forEach(b=>{qt(!s.has(b.id),`Separator ids must be unique; id "${b.id}" was used more than once`),s.add(b.id),b.element.addEventListener("keydown",EC)}),g.mountedGroups.size===1&&(window.addEventListener("pointerdown",LC),window.addEventListener("pointermove",AC),window.addEventListener("pointerup",OC)),function(){t=!1;const b=ts(C=>{const x=new Map(C.mountedGroups);return x.delete(e),{mountedGroups:x}});e.element.removeEventListener("pointerleave",wC),e.separators.forEach(C=>{C.element.removeEventListener("keydown",EC)}),b.mountedGroups.size===0&&(window.removeEventListener("pointerdown",LC),window.removeEventListener("pointermove",AC),window.removeEventListener("pointerup",OC)),o.disconnect()}}function j0(e){const t=k.useId();return`${e??t}`}const Aa=typeof window<"u"?k.useLayoutEffect:k.useEffect;function B0(e){const t=k.useRef(e);return Aa(()=>{t.current=e},[e]),k.useCallback(n=>t.current?.(n),[t])}function z0(...e){return B0(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function XN(e){const t=k.useRef({...e});return Aa(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const mk="--react-resizable-panels--panel--pointer-events";function gk(e,t){const n=e.replace(/[^a-zA-Z0-9\-_]/g,""),s=t.replace(/[^a-zA-Z0-9\-_]/g,"");return`--react-resizable-panels--${n}--${s}`}const vk=k.createContext(null);function QN(e,t){const n=k.useRef({getLayout:()=>({}),setLayout:NN});k.useImperativeHandle(t,()=>n.current,[]),Aa(()=>{Object.assign(n.current,dk({groupId:e}))})}function ZN({children:e,className:t,defaultLayout:n,disableCursor:s,disabled:o,elementRef:u,groupRef:h,id:a,onLayoutChange:c,orientation:d="horizontal",style:p,...f}){const g=k.useRef({}),b=B0($=>{Jl(g.current,$)||(g.current=$,c?.($))}),C=j0(a),[x,y]=k.useState(!1),[_,v]=k.useState(null),[S,E]=k.useState(n??{}),[T,A]=k.useState([]),[M,L]=k.useState([]),D=k.useRef({lastExpandedPanelSizes:{},layouts:{}}),U=z0(v,u);QN(C,h);const z=k.useMemo(()=>({id:C,orientation:d,registerPanel:$=>(A(F=>s_(d,[...F,$])),()=>{A(F=>F.filter(q=>q!==$))}),registerSeparator:$=>(L(F=>s_(d,[...F,$])),()=>{L(F=>F.filter(q=>q!==$))})}),[C,d]),W=XN({defaultLayout:n,disableCursor:s}),N=k.useRef(null);Aa(()=>{if(_===null)return;const $={defaultLayout:W.defaultLayout,disableCursor:!!W.disableCursor,disabled:!!o,element:_,id:C,inMemoryLastExpandedPanelSizes:D.current.lastExpandedPanelSizes,inMemoryLayouts:D.current.layouts,orientation:d,panels:T,separators:M};N.current=$;const F=YN($),q=Fs().mountedGroups.get($);if(q){const{defaultLayoutDeferred:B,derivedPanelConstraints:I,layout:G}=q;!B&&I.length>0&&(E(G),b?.(G))}const H=da.addListener("interactionStateChange",B=>{B.state==="active"?y(B.hitRegions.some(I=>I.group===$)):y(!1)}),P=da.addListener("mountedGroupsChange",B=>{const I=B.get($);if(I){const{defaultLayoutDeferred:G,derivedPanelConstraints:K,layout:J}=I;if(G||K.length===0)return;E(J),b?.(J)}});return()=>{N.current=null,F(),H(),P()}},[o,_,C,b,d,T,M,W]),k.useEffect(()=>{const $=N.current;$&&($.defaultLayout=n,$.disableCursor=!!s)});const Y={[mk]:x?"none":void 0};for(const $ in S){const F=gk(C,$),q=S[$];Y[F]=q}return w.jsx(vk.Provider,{value:z,children:w.jsx("div",{...f,"aria-orientation":d,className:t,"data-group":!0,"data-testid":C,id:C,ref:U,style:{...p,...Y,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}function H0(){const e=k.useContext(vk);return qt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function JN({groupId:e,panelId:t}){const n=()=>{const{mountedGroups:a}=Fs();for(const[c,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:f,separatorToPanels:g}]of a)if(c.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:c,layout:f,separatorToPanels:g};throw Error(`Group ${e} not found`)},s=()=>{const a=n().derivedPanelConstraints.find(c=>c.panelId===t);if(a!==void 0)return a;throw Error(`Panel constraints not found for Panel ${t}`)},o=()=>{const a=n().group.panels.find(c=>c.id===t);if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},u=()=>{const a=n().layout[t];if(a!==void 0)return a;throw Error(`Layout not found for Panel ${t}`)},h=a=>{const c=u();if(a===c)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:f,layout:g,separatorToPanels:b}=n(),C=f.panels.findIndex(v=>v.id===t),x=C===f.panels.length-1,y=Tu({delta:x?c-a:a-c,initialLayout:g,panelConstraints:p,pivotIndices:x?[C-1,C]:[C,C+1],prevLayout:g,trigger:"imperative-api"}),_=ya({layout:y,panelConstraints:p});Jl(g,_)||ts(v=>({mountedGroups:new Map(v.mountedGroups).set(f,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:_,separatorToPanels:b})}))};return{collapse:()=>{const{collapsible:a,collapsedSize:c}=s(),d=u();a&&d!==c&&h(c)},expand:()=>{const{collapsible:a,collapsedSize:c,minSize:d}=s(),p=u();a&&p===c&&h(d)},getSize:()=>{const{group:a}=n(),c=u(),{element:d}=o(),p=a.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:c,inPixels:p}},isCollapsed:()=>{const{collapsible:a,collapsedSize:c}=s(),d=u();return a&&nr(c,d)},resize:a=>{if(u()!==a){let c;switch(typeof a){case"number":{const{group:d}=n(),p=Bl({group:d});c=ps(a/p*100);break}case"string":{c=parseFloat(a);break}}h(c)}}}}function e7(e,t){const{id:n}=H0(),s=k.useRef({collapse:dv,expand:dv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:dv});k.useImperativeHandle(t,()=>s.current,[]),Aa(()=>{Object.assign(s.current,JN({groupId:n,panelId:e}))})}function t7({children:e,className:t,collapsedSize:n="0%",collapsible:s=!1,defaultSize:o,elementRef:u,id:h,maxSize:a="100%",minSize:c="0%",onResize:d,panelRef:p,style:f,...g}){const b=!!h,C=j0(h),[x,y]=k.useState(null),_=z0(y,u),{id:v,registerPanel:S}=H0(),E=d!==null,T=B0(M=>{d?.(M,h)});Aa(()=>{if(x!==null)return S({element:x,id:C,idIsStable:b,onResize:E?T:void 0,panelConstraints:{collapsedSize:n,collapsible:s,defaultSize:o,maxSize:a,minSize:c}})},[n,s,o,x,E,C,b,a,c,T,S]),e7(C,p);const A=gk(v,C);return w.jsx("div",{...g,"data-panel":!0,"data-testid":C,id:C,ref:_,style:{...n7,flexBasis:0,flexGrow:`var(${A}, 1)`,flexShrink:1,overflow:"hidden",pointerEvents:`var(${mk})`},children:w.jsx("div",{className:t,style:{width:"100%",height:"100%",...f},children:e})})}const n7={minHeight:"unset",maxHeight:"unset",height:"unset",minWidth:"unset",maxWidth:"unset",width:"unset",flex:"unset",flexBasis:"unset",flexShrink:"unset",flexGrow:"unset",border:"unset",borderWidth:"unset",padding:"unset",margin:"unset"};function r7({layout:e,panelConstraints:t,panelId:n,panelIndex:s}){let o,u;const h=e[n],a=t.find(c=>c.panelId===n);if(a){const c=a.maxSize,d=u=a.collapsible?a.collapsedSize:a.minSize,p=[s,s+1];u=ya({layout:Tu({delta:d-h,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n],o=ya({layout:Tu({delta:c-h,initialLayout:e,panelConstraints:t,pivotIndices:p,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[n]}return{valueControls:n,valueMax:o,valueMin:u,valueNow:h}}function s7({children:e,className:t,elementRef:n,id:s,style:o,...u}){const h=j0(s),[a,c]=k.useState({}),[d,p]=k.useState("inactive"),[f,g]=k.useState(null),b=z0(g,n),{id:C,orientation:x,registerSeparator:y}=H0(),_=x==="horizontal"?"vertical":"horizontal";return Aa(()=>{if(f!==null){const v={element:f,id:h},S=y(v),E=da.addListener("interactionStateChange",A=>{p(A.state!=="inactive"&&A.hitRegions.some(M=>M.separator===v)?A.state:"inactive")}),T=da.addListener("mountedGroupsChange",A=>{A.forEach(({derivedPanelConstraints:M,layout:L,separatorToPanels:D},U)=>{if(U.id===C){const z=D.get(v);if(z){const W=z[0],N=U.panels.indexOf(W);c(r7({layout:L,panelConstraints:M,panelId:W.id,panelIndex:N}))}}})});return()=>{E(),T(),S()}}},[f,C,h,y]),w.jsx("div",{...u,"aria-controls":a.valueControls,"aria-orientation":_,"aria-valuemax":a.valueMax,"aria-valuemin":a.valueMin,"aria-valuenow":a.valueNow,children:e,className:t,"data-separator":d,"data-testid":h,id:h,ref:b,role:"separator",style:{flexBasis:"auto",...o,flexGrow:0,flexShrink:0},tabIndex:0})}function $o({className:e,direction:t,...n}){return w.jsx(ZN,{"data-slot":"resizable-panel-group",orientation:t,className:Be("flex h-full w-full data-[orientation=vertical]:flex-col",e),...n})}function Xr({...e}){return w.jsx(t7,{"data-slot":"resizable-panel",...e})}function Ko({withHandle:e,className:t,...n}){return w.jsx(s7,{"data-slot":"resizable-handle",className:Be("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:translate-x-0 data-[orientation=vertical]:after:-translate-y-1/2 [&[data-orientation=vertical]>div]:rotate-90",t),...n,children:e&&w.jsx("div",{className:"bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"})})}var hv={exports:{}},DC;function i7(){return DC||(DC=1,(function(e,t){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(h,a,c){var d=this&&this.__decorate||function(v,S,E,T){var A,M=arguments.length,L=M<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,S,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(S,E,L):A(S,E))||L);return M>3&&L&&Object.defineProperty(S,E,L),L},p=this&&this.__param||function(v,S){return function(E,T){S(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const f=c(9042),g=c(9924),b=c(844),C=c(4725),x=c(2585),y=c(3656);let _=a.AccessibilityManager=class extends b.Disposable{constructor(v,S,E,T){super(),this._terminal=v,this._coreBrowserService=E,this._renderService=T,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let A=0;A<this._terminal.rows;A++)this._rowElements[A]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[A]);if(this._topBoundaryFocusListener=A=>this._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new g.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
22
+ `)))),this.register(this._terminal.onA11yTab((A=>this._handleTab(A)))),this.register(this._terminal.onKey((A=>this._handleKey(A.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(v){for(let S=0;S<v;S++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
23
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(v){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(v)||this._charsToConsume.push(v)}_refreshRows(v,S){this._liveRegionDebouncer.refresh(v,S,this._terminal.rows)}_renderRows(v,S){const E=this._terminal.buffer,T=E.lines.length.toString();for(let A=v;A<=S;A++){const M=E.lines.get(E.ydisp+A),L=[],D=M?.translateToString(!0,void 0,void 0,L)||"",U=(E.ydisp+A+1).toString(),z=this._rowElements[A];z&&(D.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=D,this._rowColumns.set(z,L)),z.setAttribute("aria-posinset",U),z.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,S){const E=v.target,T=this._rowElements[S===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==T)return;let A,M;if(S===0?(A=E,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(A=this._rowElements.shift(),M=E,this._rowContainer.removeChild(A)),A.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const L=this._createAccessibilityTreeNode();this._rowElements.unshift(L),this._rowContainer.insertAdjacentElement("afterbegin",L)}else{const L=this._createAccessibilityTreeNode();this._rowElements.push(L),this._rowContainer.appendChild(L)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const v=document.getSelection();if(!v)return;if(v.isCollapsed)return void(this._rowContainer.contains(v.anchorNode)&&this._terminal.clearSelection());if(!v.anchorNode||!v.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:v.anchorNode,offset:v.anchorOffset},E={node:v.focusNode,offset:v.focusOffset};if((S.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===E.node&&S.offset>E.offset)&&([S,E]=[E,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const T=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(T)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:T,offset:T.textContent?.length??0}),!this._rowContainer.contains(E.node))return;const A=({node:D,offset:U})=>{const z=D instanceof Text?D.parentNode:D;let W=parseInt(z?.getAttribute("aria-posinset"),10)-1;if(isNaN(W))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(z);if(!N)return console.warn("columns is null. Race condition?"),null;let Y=U<N.length?N[U]:N.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++W,Y=0),{row:W,column:Y}},M=A(S),L=A(E);if(M&&L){if(M.row>L.row||M.row===L.row&&M.column>=L.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(L.row-M.row)*this._terminal.cols-M.column+L.column)}}_handleResize(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const v=this._coreBrowserService.mainDocument.createElement("div");return v.setAttribute("role","listitem"),v.tabIndex=-1,this._refreshRowDimensions(v),v}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let v=0;v<this._terminal.rows;v++)this._refreshRowDimensions(this._rowElements[v])}}_refreshRowDimensions(v){v.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=_=d([p(1,x.IInstantiationService),p(2,C.ICoreBrowserService),p(3,C.IRenderService)],_)},3614:(h,a)=>{function c(g){return g.replace(/\r?\n/g,"\r")}function d(g,b){return b?"\x1B[200~"+g+"\x1B[201~":g}function p(g,b,C,x){g=d(g=c(g),C.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(g,!0),b.value=""}function f(g,b,C){const x=C.getBoundingClientRect(),y=g.clientX-x.left-10,_=g.clientY-x.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${y}px`,b.style.top=`${_}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=d,a.copyHandler=function(g,b){g.clipboardData&&g.clipboardData.setData("text/plain",b.selectionText),g.preventDefault()},a.handlePasteEvent=function(g,b,C,x){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),b,C,x)},a.paste=p,a.moveTextAreaUnderMouseCursor=f,a.rightClickHandler=function(g,b,C,x,y){f(g,b,C),y&&x.rightClickSelect(g),b.value=x.selectionText,b.select()}},7239:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const d=c(1505);a.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(p,f,g){this._css.set(p,f,g)}getCss(p,f){return this._css.get(p,f)}setColor(p,f,g){this._color.set(p,f,g)}getColor(p,f){return this._color.get(p,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,d,p,f){c.addEventListener(d,p,f);let g=!1;return{dispose:()=>{g||(g=!0,c.removeEventListener(d,p,f))}}}},3551:function(h,a,c){var d=this&&this.__decorate||function(_,v,S,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,v,S,E);else for(var L=_.length-1;L>=0;L--)(T=_[L])&&(M=(A<3?T(M):A>3?T(v,S,M):T(v,S))||M);return A>3&&M&&Object.defineProperty(v,S,M),M},p=this&&this.__param||function(_,v){return function(S,E){v(S,E,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const f=c(3656),g=c(8460),b=c(844),C=c(2585),x=c(4725);let y=a.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(_,v,S,E,T){super(),this._element=_,this._mouseService=v,this._renderService=S,this._bufferService=E,this._linkProviderService=T,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const v=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const S=_.composedPath();for(let E=0;E<S.length;E++){const T=S[E];if(T.classList.contains("xterm"))break;if(T.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_handleHover(_){if(this._activeLine!==_.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(_,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,_)||(this._clearCurrentLink(),this._askForLink(_,!0))}_askForLink(_,v){this._activeProviderReplies&&v||(this._activeProviderReplies?.forEach((E=>{E?.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let S=!1;for(const[E,T]of this._linkProviderService.linkProviders.entries())v?this._activeProviderReplies?.get(E)&&(S=this._checkLinkProviderResult(E,_,S)):T.provideLinks(_.y,(A=>{if(this._isMouseOut)return;const M=A?.map((L=>({link:L})));this._activeProviderReplies?.set(E,M),S=this._checkLinkProviderResult(E,_,S),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,v){const S=new Set;for(let E=0;E<v.size;E++){const T=v.get(E);if(T)for(let A=0;A<T.length;A++){const M=T[A],L=M.link.range.start.y<_?0:M.link.range.start.x,D=M.link.range.end.y>_?this._bufferService.cols:M.link.range.end.x;for(let U=L;U<=D;U++){if(S.has(U)){T.splice(A--,1);break}S.add(U)}}}}_checkLinkProviderResult(_,v,S){if(!this._activeProviderReplies)return S;const E=this._activeProviderReplies.get(_);let T=!1;for(let A=0;A<_;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(T=!0);if(!T&&E){const A=E.find((M=>this._linkAtPosition(M.link,v)));A&&(S=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let A=0;A<this._activeProviderReplies.size;A++){const M=this._activeProviderReplies.get(A)?.find((L=>this._linkAtPosition(L.link,v)));if(M){S=!0,this._handleNewLink(M);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const v=this._positionFromMouseEvent(_,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,v){this._currentLink&&this._lastMouseEvent&&(!_||!v||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=v)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(_.link,v)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:S=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:S=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const E=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(E,T),this._lastMouseEvent)){const A=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);A&&this._askForLink(A,!1)}}))))}_linkHover(_,v,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(S,v.text)}_fireUnderlineEvent(_,v){const S=_.range,E=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-E-1,S.end.x,S.end.y-E-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(_,v,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(S,v.text)}_linkAtPosition(_,v){const S=_.range.start.y*this._bufferService.cols+_.range.start.x,E=_.range.end.y*this._bufferService.cols+_.range.end.x,T=v.y*this._bufferService.cols+v.x;return S<=T&&T<=E}_positionFromMouseEvent(_,v,S){const E=S.getCoords(_,v,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,v,S,E,T){return{x1:_,y1:v,x2:S,y2:E,cols:this._bufferService.cols,fg:T}}};a.Linkifier=y=d([p(1,x.IMouseService),p(2,x.IRenderService),p(3,C.IBufferService),p(4,x.ILinkProviderService)],y)},9042:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(h,a,c){var d=this&&this.__decorate||function(x,y,_,v){var S,E=arguments.length,T=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,_,v);else for(var A=x.length-1;A>=0;A--)(S=x[A])&&(T=(E<3?S(T):E>3?S(y,_,T):S(y,_))||T);return E>3&&T&&Object.defineProperty(y,_,T),T},p=this&&this.__param||function(x,y){return function(_,v){y(_,v,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const f=c(511),g=c(2585);let b=a.OscLinkProvider=class{constructor(x,y,_){this._bufferService=x,this._optionsService=y,this._oscLinkService=_}provideLinks(x,y){const _=this._bufferService.buffer.lines.get(x-1);if(!_)return void y(void 0);const v=[],S=this._optionsService.rawOptions.linkHandler,E=new f.CellData,T=_.getTrimmedLength();let A=-1,M=-1,L=!1;for(let D=0;D<T;D++)if(M!==-1||_.hasContent(D)){if(_.loadCell(D,E),E.hasExtendedAttrs()&&E.extended.urlId){if(M===-1){M=D,A=E.extended.urlId;continue}L=E.extended.urlId!==A}else M!==-1&&(L=!0);if(L||M!==-1&&D===T-1){const U=this._oscLinkService.getLinkData(A)?.uri;if(U){const z={start:{x:M+1,y:x},end:{x:D+(L||D!==T-1?0:1),y:x}};let W=!1;if(!S?.allowNonHttpProtocols)try{const N=new URL(U);["http:","https:"].includes(N.protocol)||(W=!0)}catch{W=!0}W||v.push({text:U,range:z,activate:(N,Y)=>S?S.activate(N,Y,z):C(0,Y),hover:(N,Y)=>S?.hover?.(N,Y,z),leave:(N,Y)=>S?.leave?.(N,Y,z)})}L=!1,E.hasExtendedAttrs()&&E.extended.urlId?(M=D,A=E.extended.urlId):(M=-1,A=-1)}}y(v)}};function C(x,y){if(confirm(`Do you want to navigate to ${y}?
24
+
25
+ WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=b=d([p(0,g.IBufferService),p(1,g.IOptionsService),p(2,g.IOscLinkService)],b)},6193:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,d,p){this._rowCount=p,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const d=c(3614),p=c(3656),f=c(3551),g=c(9042),b=c(3730),C=c(1680),x=c(3107),y=c(5744),_=c(2950),v=c(1296),S=c(428),E=c(4269),T=c(5114),A=c(8934),M=c(3230),L=c(9312),D=c(4725),U=c(6731),z=c(8055),W=c(8969),N=c(8460),Y=c(844),$=c(6114),F=c(8437),q=c(2584),H=c(7399),P=c(5941),B=c(9074),I=c(2585),G=c(5435),K=c(4567),J=c(779);class Z extends W.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(X={}){super(X),this.browser=$,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.MutableDisposable),this._onCursorMove=this.register(new N.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new N.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new N.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new N.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new N.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new N.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new N.EventEmitter),this._onBlur=this.register(new N.EventEmitter),this._onA11yCharEmitter=this.register(new N.EventEmitter),this._onA11yTabEmitter=this.register(new N.EventEmitter),this._onWillOpen=this.register(new N.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(J.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((V,se)=>this.refresh(V,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((V=>this._reportWindowsOptions(V)))),this.register(this._inputHandler.onColor((V=>this._handleColorEvent(V)))),this.register((0,N.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,N.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((V=>this._afterResize(V.cols,V.rows)))),this.register((0,Y.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const V of X){let se,re="";switch(V.index){case 256:se="foreground",re="10";break;case 257:se="background",re="11";break;case 258:se="cursor",re="12";break;default:se="ansi",re="4;"+V.index}switch(V.type){case 0:const ne=z.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[V.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${re};${(0,P.toRgbString)(ne)}${q.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((oe=>oe.ansi[V.index]=z.channels.toColor(...V.color)));else{const oe=se;this._themeService.modifyColors((ce=>ce[oe]=z.channels.toColor(...V.color)))}break;case 2:this._themeService.restoreColor(V.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const X=this.buffer.ybase+this.buffer.y,V=this.buffer.lines.get(X);if(!V)return;const se=Math.min(this.buffer.x,this.cols-1),re=this._renderService.dimensions.css.cell.height,ne=V.getWidth(se),oe=this._renderService.dimensions.css.cell.width*ne,ce=this.buffer.y*this._renderService.dimensions.css.cell.height,ve=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ve+"px",this.textarea.style.top=ce+"px",this.textarea.style.width=oe+"px",this.textarea.style.height=re+"px",this.textarea.style.lineHeight=re+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(V=>{this.hasSelection()&&(0,d.copyHandler)(V,this._selectionService)})));const X=V=>(0,d.handlePasteEvent)(V,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,p.addDisposableDomListener)(this.element,"paste",X)),$.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(V=>{V.button===2&&(0,d.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(V=>{(0,d.rightClickHandler)(V,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),$.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(V=>{V.button===1&&(0,d.moveTextAreaUnderMouseCursor)(V,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),X.appendChild(this.element);const V=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),V.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),V.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),$.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(T.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(U.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(_.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(V);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(L.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(v.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,V=this.element;function se(oe){const ce=X._mouseService.getMouseReportCoords(oe,X.screenElement);if(!ce)return!1;let ve,ge;switch(oe.overrideType||oe.type){case"mousemove":ge=32,oe.buttons===void 0?(ve=3,oe.button!==void 0&&(ve=oe.button<3?oe.button:3)):ve=1&oe.buttons?0:4&oe.buttons?1:2&oe.buttons?2:3;break;case"mouseup":ge=0,ve=oe.button<3?oe.button:3;break;case"mousedown":ge=1,ve=oe.button<3?oe.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(oe)===!1||X.viewport.getLinesScrolled(oe)===0)return!1;ge=oe.deltaY<0?0:1,ve=4;break;default:return!1}return!(ge===void 0||ve===void 0||ve>4)&&X.coreMouseService.triggerMouseEvent({col:ce.col,row:ce.row,x:ce.x,y:ce.y,button:ve,action:ge,ctrl:oe.ctrlKey,alt:oe.altKey,shift:oe.shiftKey})}const re={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ne={mouseup:oe=>(se(oe),oe.buttons||(this._document.removeEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.removeEventListener("mousemove",re.mousedrag)),this.cancel(oe)),wheel:oe=>(se(oe),this.cancel(oe,!0)),mousedrag:oe=>{oe.buttons&&se(oe)},mousemove:oe=>{oe.buttons||se(oe)}};this.register(this.coreMouseService.onProtocolChange((oe=>{oe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(oe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&oe?re.mousemove||(V.addEventListener("mousemove",ne.mousemove),re.mousemove=ne.mousemove):(V.removeEventListener("mousemove",re.mousemove),re.mousemove=null),16&oe?re.wheel||(V.addEventListener("wheel",ne.wheel,{passive:!1}),re.wheel=ne.wheel):(V.removeEventListener("wheel",re.wheel),re.wheel=null),2&oe?re.mouseup||(re.mouseup=ne.mouseup):(this._document.removeEventListener("mouseup",re.mouseup),re.mouseup=null),4&oe?re.mousedrag||(re.mousedrag=ne.mousedrag):(this._document.removeEventListener("mousemove",re.mousedrag),re.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(V,"mousedown",(oe=>{if(oe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(oe))return se(oe),re.mouseup&&this._document.addEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.addEventListener("mousemove",re.mousedrag),this.cancel(oe)}))),this.register((0,p.addDisposableDomListener)(V,"wheel",(oe=>{if(!re.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(oe)===!1)return!1;if(!this.buffer.hasScrollback){const ce=this.viewport.getLinesScrolled(oe);if(ce===0)return;const ve=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(oe.deltaY<0?"A":"B");let ge="";for(let he=0;he<Math.abs(ce);he++)ge+=ve;return this.coreService.triggerDataEvent(ge,!0),this.cancel(oe,!0)}return this.viewport.handleWheel(oe)?this.cancel(oe):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(V,"touchstart",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(oe),this.cancel(oe)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(V,"touchmove",(oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(oe)?void 0:this.cancel(oe)}),{passive:!1}))}refresh(X,V){this._renderService?.refreshRows(X,V)}updateCursorStyle(X){this._selectionService?.shouldColumnSelect(X)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(X,V,se=0){se===1?(super.scrollLines(X,V,se),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(X)}paste(X){(0,d.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const V=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),V}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,V,se){this._selectionService.setSelection(X,V,se)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(X,V){this._selectionService?.selectLines(X,V)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const V=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!V&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;V||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,H.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),se.type===3||se.type===2){const re=this.rows-1;return this.scrollLines(se.type===2?-re:re),this.cancel(X,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(se.cancel&&this.cancel(X,!0),!se.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==q.C0.ETX&&se.key!==q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,V){const se=X.isMac&&!this.options.macOptionIsMeta&&V.altKey&&!V.ctrlKey&&!V.metaKey||X.isWindows&&V.altKey&&V.ctrlKey&&!V.metaKey||X.isWindows&&V.getModifierState("AltGraph");return V.type==="keypress"?se:se&&(!V.keyCode||V.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(V){return V.keyCode===16||V.keyCode===17||V.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let V;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)V=X.charCode;else if(X.which===null||X.which===void 0)V=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;V=X.which}return!(!V||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(V=String.fromCharCode(V),this._onKey.fire({key:V,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(V,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const V=X.data;return this.coreService.triggerDataEvent(V,!0),this.cancel(X),!0}return!1}resize(X,V){X!==this.cols||V!==this.rows?super.resize(X,V):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,V){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let X=1;X<this.rows;X++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case G.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const V=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[4;${se};${V}t`);break;case G.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const re=this._renderService.dimensions.css.cell.width.toFixed(0),ne=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${ne};${re}t`)}}cancel(X,V){if(this.options.cancelEvents||V)return X.preventDefault(),X.stopPropagation(),!1}}a.Terminal=Z},9924:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,p){this._rowCount=p,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=f-this._lastRefreshMs,b=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(h,a,c){var d=this&&this.__decorate||function(_,v,S,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,v,S,E);else for(var L=_.length-1;L>=0;L--)(T=_[L])&&(M=(A<3?T(M):A>3?T(v,S,M):T(v,S))||M);return A>3&&M&&Object.defineProperty(v,S,M),M},p=this&&this.__param||function(_,v){return function(S,E){v(S,E,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const f=c(3656),g=c(4725),b=c(8460),C=c(844),x=c(2585);let y=a.Viewport=class extends C.Disposable{constructor(_,v,S,E,T,A,M,L){super(),this._viewportElement=_,this._scrollArea=v,this._bufferService=S,this._optionsService=E,this._charSizeService=T,this._renderService=A,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(L.colors),this.register(L.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(_){this._viewportElement.style.backgroundColor=_.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(_){if(_)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const v=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==v&&(this._lastRecordedBufferHeight=v,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const _=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==_&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=_),this._refreshAnimationFrame=null}syncScrollArea(_=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(_);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(_)}_handleScroll(_){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const v=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const _=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(_*(this._smoothScrollState.target-this._smoothScrollState.origin)),_<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(_,v){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(v<0&&this._viewportElement.scrollTop!==0||v>0&&S<this._lastRecordedBufferHeight)||(_.cancelable&&_.preventDefault(),!1)}handleWheel(_){const v=this._getPixelsScrolled(_);return v!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+v:this._smoothScrollState.target+=v,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=v,this._bubbleScroll(_,v))}scrollLines(_){if(_!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const v=_*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+v,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!1})}_getPixelsScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let v=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_LINE?v*=this._currentRowHeight:_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._currentRowHeight*this._bufferService.rows),v}getBufferElements(_,v){let S,E="";const T=[],A=v??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let L=_;L<A;L++){const D=M.get(L);if(!D)continue;const U=M.get(L+1)?.isWrapped;if(E+=D.translateToString(!U),!U||L===M.length-1){const z=document.createElement("div");z.textContent=E,T.push(z),E.length>0&&(S=z),E=""}}return{bufferElements:T,cursorElement:S}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let v=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(v/=this._currentRowHeight+0,this._wheelPartialScroll+=v,v=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._bufferService.rows),v}_applyScrollModifier(_,v){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&v.altKey||S==="ctrl"&&v.ctrlKey||S==="shift"&&v.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const v=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,v!==0&&(this._viewportElement.scrollTop+=v,this._bubbleScroll(_,v))}};a.Viewport=y=d([p(2,x.IBufferService),p(3,x.IOptionsService),p(4,g.ICharSizeService),p(5,g.IRenderService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],y)},3107:function(h,a,c){var d=this&&this.__decorate||function(x,y,_,v){var S,E=arguments.length,T=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,_,v);else for(var A=x.length-1;A>=0;A--)(S=x[A])&&(T=(E<3?S(T):E>3?S(y,_,T):S(y,_))||T);return E>3&&T&&Object.defineProperty(y,_,T),T},p=this&&this.__param||function(x,y){return function(_,v){y(_,v,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const f=c(4725),g=c(844),b=c(2585);let C=a.BufferDecorationRenderer=class extends g.Disposable{constructor(x,y,_,v,S){super(),this._screenElement=x,this._bufferService=y,this._coreBrowserService=_,this._decorationService=v,this._renderService=S,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,g.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",x?.options?.layer==="top"),y.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const _=x.options.x??0;return _&&_>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(x,y),y}_refreshStyle(x){const y=x.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let _=this._decorationElements.get(x);_||(_=this._createElement(x),x.element=_,this._decorationElements.set(x,_),this._container.appendChild(_),x.onDispose((()=>{this._decorationElements.delete(x),_.remove()}))),_.style.top=y*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(_)}}_refreshXPosition(x,y=x.element){if(!y)return;const _=x.options.x??0;(x.options.anchor||"left")==="right"?y.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){this._decorationElements.get(x)?.remove(),this._decorationElements.delete(x),x.dispose()}};a.BufferDecorationRenderer=C=d([p(1,b.IBufferService),p(2,f.ICoreBrowserService),p(3,b.IDecorationService),p(4,f.IRenderService)],C)},5871:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,d){return d>=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,p){return d>=c.startBufferLine-this._linePadding[p||"full"]&&d<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(h,a,c){var d=this&&this.__decorate||function(S,E,T,A){var M,L=arguments.length,D=L<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,E,T,A);else for(var U=S.length-1;U>=0;U--)(M=S[U])&&(D=(L<3?M(D):L>3?M(E,T,D):M(E,T))||D);return L>3&&D&&Object.defineProperty(E,T,D),D},p=this&&this.__param||function(S,E){return function(T,A){E(T,A,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const f=c(5871),g=c(4725),b=c(844),C=c(2585),x={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let v=a.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,E,T,A,M,L,D){super(),this._viewportElement=S,this._screenElement=E,this._bufferService=T,this._decorationService=A,this._renderService=M,this._optionsService=L,this._coreBrowserService=D,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const U=this._canvas.getContext("2d");if(!U)throw new Error("Ctx cannot be null");this._ctx=U,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const S=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=S,y.center=E,y.right=S,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=y.left,_.right=y.left+y.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);x.left=E,x.center=E,x.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const E of S)E.position!=="full"&&this._renderColorZone(E);for(const E of S)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(_[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-x[S.position||"full"]/2),y[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[S.position||"full"]))}_queueRefresh(S,E){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=v=d([p(2,C.IBufferService),p(3,C.IDecorationService),p(4,g.IRenderService),p(5,C.IOptionsService),p(6,g.ICoreBrowserService)],v)},2950:function(h,a,c){var d=this&&this.__decorate||function(x,y,_,v){var S,E=arguments.length,T=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,y,_,v);else for(var A=x.length-1;A>=0;A--)(S=x[A])&&(T=(E<3?S(T):E>3?S(y,_,T):S(y,_))||T);return E>3&&T&&Object.defineProperty(y,_,T),T},p=this&&this.__param||function(x,y){return function(_,v){y(_,v,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const f=c(4725),g=c(2585),b=c(2584);let C=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,y,_,v,S,E){this._textarea=x,this._compositionView=y,this._bufferService=_,this._optionsService=v,this._coreService=S,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),_.length>0&&this._coreService.triggerDataEvent(_,!0)}}),0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,_=y.replace(x,"");this._dataAlreadySent=_,y.length>x.length?this._coreService.triggerDataEvent(_,!0):y.length<x.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):y.length===x.length&&y!==x&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),_=this._renderService.dimensions.css.cell.height,v=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=v+"px",this._compositionView.style.height=_+"px",this._compositionView.style.lineHeight=_+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=v+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=C=d([p(2,g.IBufferService),p(3,g.IOptionsService),p(4,g.ICoreService),p(5,f.IRenderService)],C)},9806:(h,a)=>{function c(d,p,f){const g=f.getBoundingClientRect(),b=d.getComputedStyle(f),C=parseInt(b.getPropertyValue("padding-left")),x=parseInt(b.getPropertyValue("padding-top"));return[p.clientX-g.left-C,p.clientY-g.top-x]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(d,p,f,g,b,C,x,y,_){if(!C)return;const v=c(d,p,f);return v?(v[0]=Math.ceil((v[0]+(_?x/2:0))/x),v[1]=Math.ceil(v[1]/y),v[0]=Math.min(Math.max(v[0],1),g+(_?1:0)),v[1]=Math.min(Math.max(v[1],1),b),v):void 0}},9504:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const d=c(2584);function p(y,_,v,S){const E=y-f(y,v),T=_-f(_,v),A=Math.abs(E-T)-(function(M,L,D){let U=0;const z=M-f(M,D),W=L-f(L,D);for(let N=0;N<Math.abs(z-W);N++){const Y=g(M,L)==="A"?-1:1;D.buffer.lines.get(z+Y*N)?.isWrapped&&U++}return U})(y,_,v);return x(A,C(g(y,_),S))}function f(y,_){let v=0,S=_.buffer.lines.get(y),E=S?.isWrapped;for(;E&&y>=0&&y<_.rows;)v++,S=_.buffer.lines.get(--y),E=S?.isWrapped;return v}function g(y,_){return y>_?"A":"B"}function b(y,_,v,S,E,T){let A=y,M=_,L="";for(;A!==v||M!==S;)A+=E?1:-1,E&&A>T.cols-1?(L+=T.buffer.translateBufferLineToString(M,!1,y,A),A=0,y=0,M++):!E&&A<0&&(L+=T.buffer.translateBufferLineToString(M,!1,0,y+1),A=T.cols-1,y=A,M--);return L+T.buffer.translateBufferLineToString(M,!1,y,A)}function C(y,_){const v=_?"O":"[";return d.C0.ESC+v+y}function x(y,_){y=Math.floor(y);let v="";for(let S=0;S<y;S++)v+=_;return v}a.moveToCellSequence=function(y,_,v,S){const E=v.buffer.x,T=v.buffer.y;if(!v.buffer.hasScrollback)return(function(L,D,U,z,W,N){return p(D,z,W,N).length===0?"":x(b(L,D,L,D-f(D,W),!1,W).length,C("D",N))})(E,T,0,_,v,S)+p(T,_,v,S)+(function(L,D,U,z,W,N){let Y;Y=p(D,z,W,N).length>0?z-f(z,W):D;const $=z,F=(function(q,H,P,B,I,G){let K;return K=p(P,B,I,G).length>0?B-f(B,I):H,q<P&&K<=B||q>=P&&K<B?"C":"D"})(L,D,U,z,W,N);return x(b(L,Y,U,$,F==="C",W).length,C(F,N))})(E,T,y,_,v,S);let A;if(T===_)return A=E>y?"D":"C",x(Math.abs(E-y),C(A,S));A=T>_?"D":"C";const M=Math.abs(T-_);return x((function(L,D){return D.cols-L})(T>_?y:E,v)+(M-1)*v.cols+1+((T>_?E:y)-1),C(A,S))}},1296:function(h,a,c){var d=this&&this.__decorate||function(N,Y,$,F){var q,H=arguments.length,P=H<3?Y:F===null?F=Object.getOwnPropertyDescriptor(Y,$):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(N,Y,$,F);else for(var B=N.length-1;B>=0;B--)(q=N[B])&&(P=(H<3?q(P):H>3?q(Y,$,P):q(Y,$))||P);return H>3&&P&&Object.defineProperty(Y,$,P),P},p=this&&this.__param||function(N,Y){return function($,F){Y($,F,N)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const f=c(3787),g=c(2550),b=c(2223),C=c(6171),x=c(6052),y=c(4725),_=c(8055),v=c(8460),S=c(844),E=c(2585),T="xterm-dom-renderer-owner-",A="xterm-rows",M="xterm-fg-",L="xterm-bg-",D="xterm-focus",U="xterm-selection";let z=1,W=a.DomRenderer=class extends S.Disposable{constructor(N,Y,$,F,q,H,P,B,I,G,K,J,Z){super(),this._terminal=N,this._document=Y,this._element=$,this._screenElement=F,this._viewportElement=q,this._helperContainer=H,this._linkifier2=P,this._charSizeService=I,this._optionsService=G,this._bufferService=K,this._coreBrowserService=J,this._themeService=Z,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new v.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(A),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(U),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ee=>this._injectCss(ee)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(T+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ee=>this._handleLinkHover(ee)))),this.register(this._linkifier2.onHideLinkUnderline((ee=>this._handleLinkLeave(ee)))),this.register((0,S.toDisposable)((()=>{this._element.classList.remove(T+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const N=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*N,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*N),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/N),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/N),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Y=`${this._terminalSelector} .${A} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(N){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Y=`${this._terminalSelector} .${A} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Y+=`${this._terminalSelector} .${A} .xterm-dim { color: ${_.color.multiplyOpacity(N.foreground,.5).css};}`,Y+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const $=`blink_underline_${this._terminalClass}`,F=`blink_bar_${this._terminalClass}`,q=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${$} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${F} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${q} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,Y+=`${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${A}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Y+=`${this._terminalSelector} .${U} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${U} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${U} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[H,P]of N.ansi.entries())Y+=`${this._terminalSelector} .${M}${H} { color: ${P.css}; }${this._terminalSelector} .${M}${H}.xterm-dim { color: ${_.color.multiplyOpacity(P,.5).css}; }${this._terminalSelector} .${L}${H} { background-color: ${P.css}; }`;Y+=`${this._terminalSelector} .${M}${b.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(N.background).css}; }${this._terminalSelector} .${M}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${L}${b.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=Y}_setDefaultSpacing(){const N=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${N}px`,this._rowFactory.defaultSpacing=N}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(N,Y){for(let $=this._rowElements.length;$<=Y;$++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,Y){this._refreshRowElements(N,Y),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(N,Y,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,Y,$),this.renderRows(0,this._bufferService.rows-1),!N||!Y)return;this._selectionRenderModel.update(this._terminal,N,Y,$);const F=this._selectionRenderModel.viewportStartRow,q=this._selectionRenderModel.viewportEndRow,H=this._selectionRenderModel.viewportCappedStartRow,P=this._selectionRenderModel.viewportCappedEndRow;if(H>=this._bufferService.rows||P<0)return;const B=this._document.createDocumentFragment();if($){const I=N[0]>Y[0];B.appendChild(this._createSelectionElement(H,I?Y[0]:N[0],I?N[0]:Y[0],P-H+1))}else{const I=F===H?N[0]:0,G=H===q?Y[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(H,I,G));const K=P-H-1;if(B.appendChild(this._createSelectionElement(H+1,0,this._bufferService.cols,K)),H!==P){const J=q===P?Y[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(P,0,J))}}this._selectionContainer.appendChild(B)}_createSelectionElement(N,Y,$,F=1){const q=this._document.createElement("div"),H=Y*this.dimensions.css.cell.width;let P=this.dimensions.css.cell.width*($-Y);return H+P>this.dimensions.css.canvas.width&&(P=this.dimensions.css.canvas.width-H),q.style.height=F*this.dimensions.css.cell.height+"px",q.style.top=N*this.dimensions.css.cell.height+"px",q.style.left=`${H}px`,q.style.width=`${P}px`,q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const N of this._rowElements)N.replaceChildren()}renderRows(N,Y){const $=this._bufferService.buffer,F=$.ybase+$.y,q=Math.min($.x,this._bufferService.cols-1),H=this._optionsService.rawOptions.cursorBlink,P=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=N;I<=Y;I++){const G=I+$.ydisp,K=this._rowElements[I],J=$.lines.get(G);if(!K||!J)break;K.replaceChildren(...this._rowFactory.createRow(J,G,G===F,P,B,q,H,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${this._terminalClass}`}_handleLinkHover(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!0)}_handleLinkLeave(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!1)}_setCellUnderline(N,Y,$,F,q,H){$<0&&(N=0),F<0&&(Y=0);const P=this._bufferService.rows-1;$=Math.max(Math.min($,P),0),F=Math.max(Math.min(F,P),0),q=Math.min(q,this._bufferService.cols);const B=this._bufferService.buffer,I=B.ybase+B.y,G=Math.min(B.x,q-1),K=this._optionsService.rawOptions.cursorBlink,J=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=$;ee<=F;++ee){const X=ee+B.ydisp,V=this._rowElements[ee],se=B.lines.get(X);if(!V||!se)break;V.replaceChildren(...this._rowFactory.createRow(se,X,X===I,J,Z,G,K,this.dimensions.css.cell.width,this._widthCache,H?ee===$?N:0:-1,H?(ee===F?Y:q)-1:-1))}}};a.DomRenderer=W=d([p(7,E.IInstantiationService),p(8,y.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,y.ICoreBrowserService),p(12,y.IThemeService)],W)},3787:function(h,a,c){var d=this&&this.__decorate||function(A,M,L,D){var U,z=arguments.length,W=z<3?M:D===null?D=Object.getOwnPropertyDescriptor(M,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(A,M,L,D);else for(var N=A.length-1;N>=0;N--)(U=A[N])&&(W=(z<3?U(W):z>3?U(M,L,W):U(M,L))||W);return z>3&&W&&Object.defineProperty(M,L,W),W},p=this&&this.__param||function(A,M){return function(L,D){M(L,D,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const f=c(2223),g=c(643),b=c(511),C=c(2585),x=c(8055),y=c(4725),_=c(4269),v=c(6171),S=c(3734);let E=a.DomRendererRowFactory=class{constructor(A,M,L,D,U,z,W){this._document=A,this._characterJoinerService=M,this._optionsService=L,this._coreBrowserService=D,this._coreService=U,this._decorationService=z,this._themeService=W,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(A,M,L){this._selectionStart=A,this._selectionEnd=M,this._columnSelectMode=L}createRow(A,M,L,D,U,z,W,N,Y,$,F){const q=[],H=this._characterJoinerService.getJoinedCharacters(M),P=this._themeService.colors;let B,I=A.getNoBgTrimmedLength();L&&I<z+1&&(I=z+1);let G=0,K="",J=0,Z=0,ee=0,X=!1,V=0,se=!1,re=0;const ne=[],oe=$!==-1&&F!==-1;for(let ce=0;ce<I;ce++){A.loadCell(ce,this._workCell);let ve=this._workCell.getWidth();if(ve===0)continue;let ge=!1,he=ce,de=this._workCell;if(H.length>0&&ce===H[0][0]){ge=!0;const $e=H.shift();de=new _.JoinedCellData(this._workCell,A.translateToString(!0,$e[0],$e[1]),$e[1]-$e[0]),he=$e[1]-1,ve=de.getWidth()}const Le=this._isCellInSelection(ce,M),Oe=L&&ce===z,Ne=oe&&ce>=$&&ce<=F;let ye=!1;this._decorationService.forEachDecorationAtCell(ce,M,void 0,($e=>{ye=!0}));let Ae=de.getChars()||g.WHITESPACE_CELL_CHAR;if(Ae===" "&&(de.isUnderline()||de.isOverline())&&(Ae=" "),re=ve*N-Y.get(Ae,de.isBold(),de.isItalic()),B){if(G&&(Le&&se||!Le&&!se&&de.bg===J)&&(Le&&se&&P.selectionForeground||de.fg===Z)&&de.extended.ext===ee&&Ne===X&&re===V&&!Oe&&!ge&&!ye){de.isInvisible()?K+=g.WHITESPACE_CELL_CHAR:K+=Ae,G++;continue}G&&(B.textContent=K),B=this._document.createElement("span"),G=0,K=""}else B=this._document.createElement("span");if(J=de.bg,Z=de.fg,ee=de.extended.ext,X=Ne,V=re,se=Le,ge&&z>=ce&&z<=he&&(z=ce),!this._coreService.isCursorHidden&&Oe&&this._coreService.isCursorInitialized){if(ne.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&ne.push("xterm-cursor-blink"),ne.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(U)switch(U){case"outline":ne.push("xterm-cursor-outline");break;case"block":ne.push("xterm-cursor-block");break;case"bar":ne.push("xterm-cursor-bar");break;case"underline":ne.push("xterm-cursor-underline")}}if(de.isBold()&&ne.push("xterm-bold"),de.isItalic()&&ne.push("xterm-italic"),de.isDim()&&ne.push("xterm-dim"),K=de.isInvisible()?g.WHITESPACE_CELL_CHAR:de.getChars()||g.WHITESPACE_CELL_CHAR,de.isUnderline()&&(ne.push(`xterm-underline-${de.extended.underlineStyle}`),K===" "&&(K=" "),!de.isUnderlineColorDefault()))if(de.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(de.getUnderlineColor()).join(",")})`;else{let $e=de.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&de.isBold()&&$e<8&&($e+=8),B.style.textDecorationColor=P.ansi[$e].css}de.isOverline()&&(ne.push("xterm-overline"),K===" "&&(K=" ")),de.isStrikethrough()&&ne.push("xterm-strikethrough"),Ne&&(B.style.textDecoration="underline");let ae=de.getFgColor(),be=de.getFgColorMode(),Ce=de.getBgColor(),We=de.getBgColorMode();const rt=!!de.isInverse();if(rt){const $e=ae;ae=Ce,Ce=$e;const et=be;be=We,We=et}let ze,Me,He,dt=!1;switch(this._decorationService.forEachDecorationAtCell(ce,M,void 0,($e=>{$e.options.layer!=="top"&&dt||($e.backgroundColorRGB&&(We=50331648,Ce=$e.backgroundColorRGB.rgba>>8&16777215,ze=$e.backgroundColorRGB),$e.foregroundColorRGB&&(be=50331648,ae=$e.foregroundColorRGB.rgba>>8&16777215,Me=$e.foregroundColorRGB),dt=$e.options.layer==="top")})),!dt&&Le&&(ze=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,Ce=ze.rgba>>8&16777215,We=50331648,dt=!0,P.selectionForeground&&(be=50331648,ae=P.selectionForeground.rgba>>8&16777215,Me=P.selectionForeground)),dt&&ne.push("xterm-decoration-top"),We){case 16777216:case 33554432:He=P.ansi[Ce],ne.push(`xterm-bg-${Ce}`);break;case 50331648:He=x.channels.toColor(Ce>>16,Ce>>8&255,255&Ce),this._addStyle(B,`background-color:#${T((Ce>>>0).toString(16),"0",6)}`);break;default:rt?(He=P.foreground,ne.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):He=P.background}switch(ze||de.isDim()&&(ze=x.color.multiplyOpacity(He,.5)),be){case 16777216:case 33554432:de.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(B,He,P.ansi[ae],de,ze,void 0)||ne.push(`xterm-fg-${ae}`);break;case 50331648:const $e=x.channels.toColor(ae>>16&255,ae>>8&255,255&ae);this._applyMinimumContrast(B,He,$e,de,ze,Me)||this._addStyle(B,`color:#${T(ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,He,P.foreground,de,ze,Me)||rt&&ne.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}ne.length&&(B.className=ne.join(" "),ne.length=0),Oe||ge||ye?B.textContent=K:G++,re!==this.defaultSpacing&&(B.style.letterSpacing=`${re}px`),q.push(B),ce=he}return B&&G&&(B.textContent=K),q}_applyMinimumContrast(A,M,L,D,U,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,v.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const W=this._getContrastCache(D);let N;if(U||z||(N=W.getColor(M.rgba,L.rgba)),N===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);N=x.color.ensureContrastRatio(U||M,z||L,Y),W.setColor((U||M).rgba,(z||L).rgba,N??null)}return!!N&&(this._addStyle(A,`color:${N.css}`),!0)}_getContrastCache(A){return A.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(A,M){A.setAttribute("style",`${A.getAttribute("style")||""}${M};`)}_isCellInSelection(A,M){const L=this._selectionStart,D=this._selectionEnd;return!(!L||!D)&&(this._columnSelectMode?L[0]<=D[0]?A>=L[0]&&M>=L[1]&&A<D[0]&&M<=D[1]:A<L[0]&&M>=L[1]&&A>=D[0]&&M<=D[1]:M>L[1]&&M<D[1]||L[1]===D[1]&&M===L[1]&&A>=L[0]&&A<D[0]||L[1]<D[1]&&M===D[1]&&A<D[0]||L[1]<D[1]&&M===L[1]&&A>=L[0])}};function T(A,M,L){for(;A.length<L;)A=M+A;return A}a.DomRendererRowFactory=E=d([p(1,y.ICharacterJoinerService),p(2,C.IOptionsService),p(3,y.ICoreBrowserService),p(4,C.ICoreService),p(5,C.IDecorationService),p(6,y.IThemeService)],E)},2550:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const f=c.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const g=c.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[p,f,g,b],this._container.appendChild(p),this._container.appendChild(f),this._container.appendChild(g),this._container.appendChild(b),d.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,d,p,f){c===this._font&&d===this._fontSize&&p===this._weight&&f===this._weightBold||(this._font=c,this._fontSize=d,this._weight=p,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(c,d,p){let f=0;if(!d&&!p&&c.length===1&&(f=c.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const C=this._measure(c,0);return C>0&&(this._flat[f]=C),C}let g=c;d&&(g+="B"),p&&(g+="I");let b=this._holey.get(g);if(b===void 0){let C=0;d&&(C|=1),p&&(C|=2),b=this._measure(c,C),b>0&&this._holey.set(g,b)}return b}_measure(c,d){const p=this._measureElements[d];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(h,a)=>{function c(p){return 57508<=p&&p<=57558}function d(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},a.isEmoji=d,a.allowRescaling=function(p,f,g,b){return f===1&&g>Math.ceil(1.5*b)&&p!==void 0&&p>255&&!d(p)&&!c(p)&&!(function(C){return 57344<=C&&C<=63743})(p)},a.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(f){return 9472<=f&&f<=9631})(p)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(p,f,g=0){return(p-(2*Math.round(f)-g))%(2*Math.round(f))}},6052:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,f,g,b=!1){if(this.selectionStart=f,this.selectionEnd=g,!f||!g||f[0]===g[0]&&f[1]===g[1])return void this.clear();const C=p.buffers.active.ydisp,x=f[1]-C,y=g[1]-C,_=Math.max(x,0),v=Math.min(y,p.rows-1);_>=p.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=x,this.viewportEndRow=y,this.viewportCappedStartRow=_,this.viewportCappedEndRow=v,this.startCol=f[0],this.endCol=g[0])}isCellSelected(p,f,g){return!!this.hasSelection&&(g-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&g>=this.viewportCappedStartRow&&f<this.endCol&&g<=this.viewportCappedEndRow:f<this.startCol&&g>=this.viewportCappedStartRow&&f>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&f>=this.startCol)}}a.createSelectionRenderModel=function(){return new c}},456:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(h,a,c){var d=this&&this.__decorate||function(v,S,E,T){var A,M=arguments.length,L=M<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,S,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(S,E,L):A(S,E))||L);return M>3&&L&&Object.defineProperty(S,E,L),L},p=this&&this.__param||function(v,S){return function(E,T){S(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const f=c(2585),g=c(8460),b=c(844);let C=a.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(v,S,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(this._optionsService))}catch{this._measureStrategy=this.register(new y(v,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const v=this._measureStrategy.measure();v.width===this.width&&v.height===this.height||(this.width=v.width,this.height=v.height,this._onCharSizeChange.fire())}};a.CharSizeService=C=d([p(2,f.IOptionsService)],C);class x extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,E){S!==void 0&&S>0&&E!==void 0&&E>0&&(this._result.width=S,this._result.height=E)}}class y extends x{constructor(S,E,T){super(),this._document=S,this._parentElement=E,this._optionsService=T,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class _ extends x{constructor(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(h,a,c){var d=this&&this.__decorate||function(_,v,S,E){var T,A=arguments.length,M=A<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,v,S,E);else for(var L=_.length-1;L>=0;L--)(T=_[L])&&(M=(A<3?T(M):A>3?T(v,S,M):T(v,S))||M);return A>3&&M&&Object.defineProperty(v,S,M),M},p=this&&this.__param||function(_,v){return function(S,E){v(S,E,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const f=c(3734),g=c(643),b=c(511),C=c(2585);class x extends f.AttributeData{constructor(v,S,E){super(),this.content=0,this.combinedData="",this.fg=v.fg,this.bg=v.bg,this.combinedData=S,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(v){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=x;let y=a.CharacterJoinerService=class _k{constructor(v){this._bufferService=v,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(v){const S={id:this._nextCharacterJoinerId++,handler:v};return this._characterJoiners.push(S),S.id}deregister(v){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===v)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(v){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(v);if(!S||S.length===0)return[];const E=[],T=S.translateToString(!0);let A=0,M=0,L=0,D=S.getFg(0),U=S.getBg(0);for(let z=0;z<S.getTrimmedLength();z++)if(S.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==D||this._workCell.bg!==U){if(z-A>1){const W=this._getJoinedRanges(T,L,M,S,A);for(let N=0;N<W.length;N++)E.push(W[N])}A=z,L=M,D=this._workCell.fg,U=this._workCell.bg}M+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-A>1){const z=this._getJoinedRanges(T,L,M,S,A);for(let W=0;W<z.length;W++)E.push(z[W])}return E}_getJoinedRanges(v,S,E,T,A){const M=v.substring(S,E);let L=[];try{L=this._characterJoiners[0].handler(M)}catch(D){console.error(D)}for(let D=1;D<this._characterJoiners.length;D++)try{const U=this._characterJoiners[D].handler(M);for(let z=0;z<U.length;z++)_k._mergeRanges(L,U[z])}catch(U){console.error(U)}return this._stringRangesToCellRanges(L,T,A),L}_stringRangesToCellRanges(v,S,E){let T=0,A=!1,M=0,L=v[T];if(L){for(let D=E;D<this._bufferService.cols;D++){const U=S.getWidth(D),z=S.getString(D).length||g.WHITESPACE_CELL_CHAR.length;if(U!==0){if(!A&&L[0]<=M&&(L[0]=D,A=!0),L[1]<=M){if(L[1]=D,L=v[++T],!L)break;L[0]<=M?(L[0]=D,A=!0):A=!1}M+=z}}L&&(L[1]=this._bufferService.cols)}}static _mergeRanges(v,S){let E=!1;for(let T=0;T<v.length;T++){const A=v[T];if(E){if(S[1]<=A[0])return v[T-1][1]=S[1],v;if(S[1]<=A[1])return v[T-1][1]=Math.max(S[1],A[1]),v.splice(T,1),v;v.splice(T,1),T--}else{if(S[1]<=A[0])return v.splice(T,0,S),v;if(S[1]<=A[1])return A[0]=Math.min(S[0],A[0]),v;S[0]<A[1]&&(A[0]=Math.min(S[0],A[0]),E=!0)}}return E?v[v.length-1][1]=S[1]:v.push(S),v}};a.CharacterJoinerService=y=d([p(0,C.IBufferService)],y)},5114:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const d=c(844),p=c(8460),f=c(3656);class g extends d.Disposable{constructor(x,y,_){super(),this._textarea=x,this._window=y,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((v=>this._screenDprMonitor.setWindow(v)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}a.CoreBrowserService=g;class b extends d.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const d=c(844);class p extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const b=this.linkProviders.indexOf(g);b!==-1&&this.linkProviders.splice(b,1)}}}}a.LinkProviderService=p},8934:function(h,a,c){var d=this&&this.__decorate||function(C,x,y,_){var v,S=arguments.length,E=S<3?x:_===null?_=Object.getOwnPropertyDescriptor(x,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,x,y,_);else for(var T=C.length-1;T>=0;T--)(v=C[T])&&(E=(S<3?v(E):S>3?v(x,y,E):v(x,y))||E);return S>3&&E&&Object.defineProperty(x,y,E),E},p=this&&this.__param||function(C,x){return function(y,_){x(y,_,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const f=c(4725),g=c(9806);let b=a.MouseService=class{constructor(C,x){this._renderService=C,this._charSizeService=x}getCoords(C,x,y,_,v){return(0,g.getCoords)(window,C,x,y,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,v)}getMouseReportCoords(C,x){const y=(0,g.getCoordsRelativeToElement)(window,C,x);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};a.MouseService=b=d([p(0,f.IRenderService),p(1,f.ICharSizeService)],b)},3230:function(h,a,c){var d=this&&this.__decorate||function(v,S,E,T){var A,M=arguments.length,L=M<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,S,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(S,E,L):A(S,E))||L);return M>3&&L&&Object.defineProperty(S,E,L),L},p=this&&this.__param||function(v,S){return function(E,T){S(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const f=c(6193),g=c(4725),b=c(8460),C=c(844),x=c(7226),y=c(2585);let _=a.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,S,E,T,A,M,L,D){super(),this._rowCount=v,this._charSizeService=T,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((U,z)=>this._renderRows(U,z)),L),this.register(this._renderDebouncer),this.register(L.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(A.onDecorationRegistered((()=>this._fullRefresh()))),this.register(A.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(L.window,S),this.register(L.onWindowChange((U=>this._registerIntersectionObserver(U,S))))}_registerIntersectionObserver(v,S){if("IntersectionObserver"in v){const E=new v.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});E.observe(S),this._observerDisposable.value=(0,C.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(v){this._isPaused=v.isIntersecting===void 0?v.intersectionRatio===0:!v.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(v,S,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,S,this._rowCount))}_renderRows(v,S){this._renderer.value&&(v=Math.min(v,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(v,S),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:v,end:S}),this._onRender.fire({start:v,end:S}),this._isNextRenderRedrawOnly=!0)}resize(v,S){this._rowCount=S,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(v){this._renderer.value=v,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(v){return this._renderDebouncer.addRefreshCallback(v)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(v,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(v,S))):this._renderer.value.handleResize(v,S),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(v,S,E){this._selectionState.start=v,this._selectionState.end=S,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(v,S,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};a.RenderService=_=d([p(2,y.IOptionsService),p(3,g.ICharSizeService),p(4,y.IDecorationService),p(5,y.IBufferService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],_)},9312:function(h,a,c){var d=this&&this.__decorate||function(L,D,U,z){var W,N=arguments.length,Y=N<3?D:z===null?z=Object.getOwnPropertyDescriptor(D,U):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(L,D,U,z);else for(var $=L.length-1;$>=0;$--)(W=L[$])&&(Y=(N<3?W(Y):N>3?W(D,U,Y):W(D,U))||Y);return N>3&&Y&&Object.defineProperty(D,U,Y),Y},p=this&&this.__param||function(L,D){return function(U,z){D(U,z,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const f=c(9806),g=c(9504),b=c(456),C=c(4725),x=c(8460),y=c(844),_=c(6114),v=c(4841),S=c(511),E=c(2585),T=" ",A=new RegExp(T,"g");let M=a.SelectionService=class extends y.Disposable{constructor(L,D,U,z,W,N,Y,$,F){super(),this._element=L,this._screenElement=D,this._linkifier=U,this._bufferService=z,this._coreService=W,this._mouseService=N,this._optionsService=Y,this._renderService=$,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((q=>this._handleTrim(q))),this.register(this._bufferService.buffers.onBufferActivate((q=>this._handleBufferActivate(q)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,y.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!L||!D||L[0]===D[0]&&L[1]===D[1])}get selectionText(){const L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!L||!D)return"";const U=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(L[0]===D[0])return"";const W=L[0]<D[0]?L[0]:D[0],N=L[0]<D[0]?D[0]:L[0];for(let Y=L[1];Y<=D[1];Y++){const $=U.translateBufferLineToString(Y,!0,W,N);z.push($)}}else{const W=L[1]===D[1]?D[0]:void 0;z.push(U.translateBufferLineToString(L[1],!0,L[0],W));for(let N=L[1]+1;N<=D[1]-1;N++){const Y=U.lines.get(N),$=U.translateBufferLineToString(N,!0);Y?.isWrapped?z[z.length-1]+=$:z.push($)}if(L[1]!==D[1]){const N=U.lines.get(D[1]),Y=U.translateBufferLineToString(D[1],!0,0,D[0]);N&&N.isWrapped?z[z.length-1]+=Y:z.push(Y)}}return z.map((W=>W.replace(A," "))).join(_.isWindows?`\r
26
+ `:`
27
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(L){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&L&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(L){const D=this._getMouseBufferCoords(L),U=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(U&&z&&D)&&this._areCoordsInSelection(D,U,z)}isCellInSelection(L,D){const U=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!U||!z)&&this._areCoordsInSelection([L,D],U,z)}_areCoordsInSelection(L,D,U){return L[1]>D[1]&&L[1]<U[1]||D[1]===U[1]&&L[1]===D[1]&&L[0]>=D[0]&&L[0]<U[0]||D[1]<U[1]&&L[1]===U[1]&&L[0]<U[0]||D[1]<U[1]&&L[1]===D[1]&&L[0]>=D[0]}_selectWordAtCursor(L,D){const U=this._linkifier.currentLink?.link?.range;if(U)return this._model.selectionStart=[U.start.x-1,U.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(U,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(L);return!!z&&(this._selectWordAt(z,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(L,D){this._model.clearSelection(),L=Math.max(L,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,L],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(L){this._model.handleTrim(L)&&this.refresh()}_getMouseBufferCoords(L){const D=this._mouseService.getCoords(L,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(L){let D=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,L,this._screenElement)[1];const U=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=U?0:(D>U&&(D-=U),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(L){return _.isMac?L.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:L.shiftKey}handleMouseDown(L){if(this._mouseDownTimeStamp=L.timeStamp,(L.button!==2||!this.hasSelection)&&L.button===0){if(!this._enabled){if(!this.shouldForceSelection(L))return;L.stopPropagation()}L.preventDefault(),this._dragScrollAmount=0,this._enabled&&L.shiftKey?this._handleIncrementalClick(L):L.detail===1?this._handleSingleClick(L):L.detail===2?this._handleDoubleClick(L):L.detail===3&&this._handleTripleClick(L),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(L){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(L))}_handleSingleClick(L){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(L)?3:0,this._model.selectionStart=this._getMouseBufferCoords(L),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(L){this._selectWordAtCursor(L,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(L){const D=this._getMouseBufferCoords(L);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(L){return L.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(L){if(L.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(L),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(L),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const U=this._bufferService.buffer;if(this._model.selectionEnd[1]<U.lines.length){const z=U.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}D&&D[0]===this._model.selectionEnd[0]&&D[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const L=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(L.ydisp+this._bufferService.rows,L.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=L.ydisp),this.refresh()}}_handleMouseUp(L){const D=L.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&L.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const U=this._mouseService.getCoords(L,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(U&&U[0]!==void 0&&U[1]!==void 0){const z=(0,g.moveToCellSequence)(U[0]-1,U[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const L=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,U=!(!L||!D||L[0]===D[0]&&L[1]===D[1]);U?L&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&L[0]===this._oldSelectionStart[0]&&L[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(L,D,U)):this._oldHasSelection&&this._fireOnSelectionChange(L,D,U)}_fireOnSelectionChange(L,D,U){this._oldSelectionStart=L,this._oldSelectionEnd=D,this._oldHasSelection=U,this._onSelectionChange.fire()}_handleBufferActivate(L){this.clearSelection(),this._trimListener.dispose(),this._trimListener=L.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(L,D){let U=D;for(let z=0;D>=z;z++){const W=L.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?U--:W>1&&D!==z&&(U+=W-1)}return U}setSelection(L,D,U){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[L,D],this._model.selectionStartLength=U,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(L){this._isClickInSelection(L)||(this._selectWordAtCursor(L,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(L,D,U=!0,z=!0){if(L[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,N=W.lines.get(L[1]);if(!N)return;const Y=W.translateBufferLineToString(L[1],!1);let $=this._convertViewportColToCharacterIndex(N,L[0]),F=$;const q=L[0]-$;let H=0,P=0,B=0,I=0;if(Y.charAt($)===" "){for(;$>0&&Y.charAt($-1)===" ";)$--;for(;F<Y.length&&Y.charAt(F+1)===" ";)F++}else{let J=L[0],Z=L[0];N.getWidth(J)===0&&(H++,J--),N.getWidth(Z)===2&&(P++,Z++);const ee=N.getString(Z).length;for(ee>1&&(I+=ee-1,F+=ee-1);J>0&&$>0&&!this._isCharWordSeparator(N.loadCell(J-1,this._workCell));){N.loadCell(J-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(H++,J--):X>1&&(B+=X-1,$-=X-1),$--,J--}for(;Z<N.length&&F+1<Y.length&&!this._isCharWordSeparator(N.loadCell(Z+1,this._workCell));){N.loadCell(Z+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(P++,Z++):X>1&&(I+=X-1,F+=X-1),F++,Z++}}F++;let G=$+q-H+B,K=Math.min(this._bufferService.cols,F-$+H+P-B-I);if(D||Y.slice($,F).trim()!==""){if(U&&G===0&&N.getCodePoint(0)!==32){const J=W.lines.get(L[1]-1);if(J&&N.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,L[1]-1],!1,!0,!1);if(Z){const ee=this._bufferService.cols-Z.start;G-=ee,K+=ee}}}if(z&&G+K===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const J=W.lines.get(L[1]+1);if(J?.isWrapped&&J.getCodePoint(0)!==32){const Z=this._getWordAt([0,L[1]+1],!1,!1,!0);Z&&(K+=Z.length)}}return{start:G,length:K}}}_selectWordAt(L,D){const U=this._getWordAt(L,D);if(U){for(;U.start<0;)U.start+=this._bufferService.cols,L[1]--;this._model.selectionStart=[U.start,L[1]],this._model.selectionStartLength=U.length}}_selectToWordAt(L){const D=this._getWordAt(L,!0);if(D){let U=L[1];for(;D.start<0;)D.start+=this._bufferService.cols,U--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,U++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,U]}}_isCharWordSeparator(L){return L.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(L.getChars())>=0}_selectLineAt(L){const D=this._bufferService.buffer.getWrappedRangeForLine(L),U={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,v.getRangeLength)(U,this._bufferService.cols)}};a.SelectionService=M=d([p(3,E.IBufferService),p(4,E.ICoreService),p(5,C.IMouseService),p(6,E.IOptionsService),p(7,C.IRenderService),p(8,C.ICoreBrowserService)],M)},4725:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const d=c(8343);a.ICharSizeService=(0,d.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),a.IMouseService=(0,d.createDecorator)("MouseService"),a.IRenderService=(0,d.createDecorator)("RenderService"),a.ISelectionService=(0,d.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,d.createDecorator)("ThemeService"),a.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(h,a,c){var d=this&&this.__decorate||function(M,L,D,U){var z,W=arguments.length,N=W<3?L:U===null?U=Object.getOwnPropertyDescriptor(L,D):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(M,L,D,U);else for(var Y=M.length-1;Y>=0;Y--)(z=M[Y])&&(N=(W<3?z(N):W>3?z(L,D,N):z(L,D))||N);return W>3&&N&&Object.defineProperty(L,D,N),N},p=this&&this.__param||function(M,L){return function(D,U){L(D,U,M)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const f=c(7239),g=c(8055),b=c(8460),C=c(844),x=c(2585),y=g.css.toColor("#ffffff"),_=g.css.toColor("#000000"),v=g.css.toColor("#ffffff"),S=g.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],L=[0,95,135,175,215,255];for(let D=0;D<216;D++){const U=L[D/36%6|0],z=L[D/6%6|0],W=L[D%6];M.push({css:g.channels.toCss(U,z,W),rgba:g.channels.toRgba(U,z,W)})}for(let D=0;D<24;D++){const U=8+10*D;M.push({css:g.channels.toCss(U,U,U),rgba:g.channels.toRgba(U,U,U)})}return M})());let T=a.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:_,cursor:v,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:g.color.blend(_,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:g.color.blend(_,E),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(M={}){const L=this._colors;if(L.foreground=A(M.foreground,y),L.background=A(M.background,_),L.cursor=A(M.cursor,v),L.cursorAccent=A(M.cursorAccent,S),L.selectionBackgroundTransparent=A(M.selectionBackground,E),L.selectionBackgroundOpaque=g.color.blend(L.background,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundTransparent=A(M.selectionInactiveBackground,L.selectionBackgroundTransparent),L.selectionInactiveBackgroundOpaque=g.color.blend(L.background,L.selectionInactiveBackgroundTransparent),L.selectionForeground=M.selectionForeground?A(M.selectionForeground,g.NULL_COLOR):void 0,L.selectionForeground===g.NULL_COLOR&&(L.selectionForeground=void 0),g.color.isOpaque(L.selectionBackgroundTransparent)&&(L.selectionBackgroundTransparent=g.color.opacity(L.selectionBackgroundTransparent,.3)),g.color.isOpaque(L.selectionInactiveBackgroundTransparent)&&(L.selectionInactiveBackgroundTransparent=g.color.opacity(L.selectionInactiveBackgroundTransparent,.3)),L.ansi=a.DEFAULT_ANSI_COLORS.slice(),L.ansi[0]=A(M.black,a.DEFAULT_ANSI_COLORS[0]),L.ansi[1]=A(M.red,a.DEFAULT_ANSI_COLORS[1]),L.ansi[2]=A(M.green,a.DEFAULT_ANSI_COLORS[2]),L.ansi[3]=A(M.yellow,a.DEFAULT_ANSI_COLORS[3]),L.ansi[4]=A(M.blue,a.DEFAULT_ANSI_COLORS[4]),L.ansi[5]=A(M.magenta,a.DEFAULT_ANSI_COLORS[5]),L.ansi[6]=A(M.cyan,a.DEFAULT_ANSI_COLORS[6]),L.ansi[7]=A(M.white,a.DEFAULT_ANSI_COLORS[7]),L.ansi[8]=A(M.brightBlack,a.DEFAULT_ANSI_COLORS[8]),L.ansi[9]=A(M.brightRed,a.DEFAULT_ANSI_COLORS[9]),L.ansi[10]=A(M.brightGreen,a.DEFAULT_ANSI_COLORS[10]),L.ansi[11]=A(M.brightYellow,a.DEFAULT_ANSI_COLORS[11]),L.ansi[12]=A(M.brightBlue,a.DEFAULT_ANSI_COLORS[12]),L.ansi[13]=A(M.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),L.ansi[14]=A(M.brightCyan,a.DEFAULT_ANSI_COLORS[14]),L.ansi[15]=A(M.brightWhite,a.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const D=Math.min(L.ansi.length-16,M.extendedAnsi.length);for(let U=0;U<D;U++)L.ansi[U+16]=A(M.extendedAnsi[U],a.DEFAULT_ANSI_COLORS[U+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[M]=this._restoreColors.ansi[M]}else for(let L=0;L<this._restoreColors.ansi.length;++L)this._colors.ansi[L]=this._restoreColors.ansi[L]}modifyColors(M){M(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function A(M,L){if(M!==void 0)try{return g.css.toColor(M)}catch{}return L}a.ThemeService=T=d([p(0,x.IOptionsService)],T)},6349:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const d=c(8460),p=c(844);class f extends p.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(b){if(this._maxLength===b)return;const C=new Array(b);for(let x=0;x<Math.min(b,this.length);x++)C[x]=this._array[this._getCyclicIndex(x)];this._array=C,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let C=this._length;C<b;C++)this._array[C]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,C){this._array[this._getCyclicIndex(b)]=C}push(b){this._array[this._getCyclicIndex(this._length)]=b,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(b,C,...x){if(C){for(let y=b;y<this._length-C;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+C)];this._length-=C,this.onDeleteEmitter.fire({index:b,amount:C})}for(let y=this._length-1;y>=b;y--)this._array[this._getCyclicIndex(y+x.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<x.length;y++)this._array[this._getCyclicIndex(b+y)]=x[y];if(x.length&&this.onInsertEmitter.fire({index:b,amount:x.length}),this._length+x.length>this._maxLength){const y=this._length+x.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=x.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,C,x){if(!(C<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let _=C-1;_>=0;_--)this.set(b+_+x,this.get(b+_));const y=b+C+x-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<C;y++)this.set(b+y+x,this.get(b+y))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}a.CircularList=f},1439:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(d,p=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const g in d)f[g]=p<=1?d[g]:d[g]&&c(d[g],p-1);return f}},8055:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,d=0,p=0,f=0;var g,b,C,x,y;function _(S){const E=S.toString(16);return E.length<2?"0"+E:E}function v(S,E){return S<E?(E+.05)/(S+.05):(S+.05)/(E+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(E,T,A,M){return M!==void 0?`#${_(E)}${_(T)}${_(A)}${_(M)}`:`#${_(E)}${_(T)}${_(A)}`},S.toRgba=function(E,T,A,M=255){return(E<<24|T<<16|A<<8|M)>>>0},S.toColor=function(E,T,A,M){return{css:S.toCss(E,T,A,M),rgba:S.toRgba(E,T,A,M)}}})(g||(a.channels=g={})),(function(S){function E(T,A){return f=Math.round(255*A),[c,d,p]=y.toChannels(T.rgba),{css:g.toCss(c,d,p,f),rgba:g.toRgba(c,d,p,f)}}S.blend=function(T,A){if(f=(255&A.rgba)/255,f===1)return{css:A.css,rgba:A.rgba};const M=A.rgba>>24&255,L=A.rgba>>16&255,D=A.rgba>>8&255,U=T.rgba>>24&255,z=T.rgba>>16&255,W=T.rgba>>8&255;return c=U+Math.round((M-U)*f),d=z+Math.round((L-z)*f),p=W+Math.round((D-W)*f),{css:g.toCss(c,d,p),rgba:g.toRgba(c,d,p)}},S.isOpaque=function(T){return(255&T.rgba)==255},S.ensureContrastRatio=function(T,A,M){const L=y.ensureContrastRatio(T.rgba,A.rgba,M);if(L)return g.toColor(L>>24&255,L>>16&255,L>>8&255)},S.opaque=function(T){const A=(255|T.rgba)>>>0;return[c,d,p]=y.toChannels(A),{css:g.toCss(c,d,p),rgba:A}},S.opacity=E,S.multiplyOpacity=function(T,A){return f=255&T.rgba,E(T,f*A/255)},S.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(b||(a.color=b={})),(function(S){let E,T;try{const A=document.createElement("canvas");A.width=1,A.height=1;const M=A.getContext("2d",{willReadFrequently:!0});M&&(E=M,E.globalCompositeOperation="copy",T=E.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return c=parseInt(A.slice(1,2).repeat(2),16),d=parseInt(A.slice(2,3).repeat(2),16),p=parseInt(A.slice(3,4).repeat(2),16),g.toColor(c,d,p);case 5:return c=parseInt(A.slice(1,2).repeat(2),16),d=parseInt(A.slice(2,3).repeat(2),16),p=parseInt(A.slice(3,4).repeat(2),16),f=parseInt(A.slice(4,5).repeat(2),16),g.toColor(c,d,p,f);case 7:return{css:A,rgba:(parseInt(A.slice(1),16)<<8|255)>>>0};case 9:return{css:A,rgba:parseInt(A.slice(1),16)>>>0}}const M=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return c=parseInt(M[1]),d=parseInt(M[2]),p=parseInt(M[3]),f=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),g.toColor(c,d,p,f);if(!E||!T)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=T,E.fillStyle=A,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,d,p,f]=E.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(c,d,p,f),css:A}}})(C||(a.css=C={})),(function(S){function E(T,A,M){const L=T/255,D=A/255,U=M/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(U<=.03928?U/12.92:Math.pow((U+.055)/1.055,2.4))}S.relativeLuminance=function(T){return E(T>>16&255,T>>8&255,255&T)},S.relativeLuminance2=E})(x||(a.rgb=x={})),(function(S){function E(A,M,L){const D=A>>24&255,U=A>>16&255,z=A>>8&255;let W=M>>24&255,N=M>>16&255,Y=M>>8&255,$=v(x.relativeLuminance2(W,N,Y),x.relativeLuminance2(D,U,z));for(;$<L&&(W>0||N>0||Y>0);)W-=Math.max(0,Math.ceil(.1*W)),N-=Math.max(0,Math.ceil(.1*N)),Y-=Math.max(0,Math.ceil(.1*Y)),$=v(x.relativeLuminance2(W,N,Y),x.relativeLuminance2(D,U,z));return(W<<24|N<<16|Y<<8|255)>>>0}function T(A,M,L){const D=A>>24&255,U=A>>16&255,z=A>>8&255;let W=M>>24&255,N=M>>16&255,Y=M>>8&255,$=v(x.relativeLuminance2(W,N,Y),x.relativeLuminance2(D,U,z));for(;$<L&&(W<255||N<255||Y<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),N=Math.min(255,N+Math.ceil(.1*(255-N))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),$=v(x.relativeLuminance2(W,N,Y),x.relativeLuminance2(D,U,z));return(W<<24|N<<16|Y<<8|255)>>>0}S.blend=function(A,M){if(f=(255&M)/255,f===1)return M;const L=M>>24&255,D=M>>16&255,U=M>>8&255,z=A>>24&255,W=A>>16&255,N=A>>8&255;return c=z+Math.round((L-z)*f),d=W+Math.round((D-W)*f),p=N+Math.round((U-N)*f),g.toRgba(c,d,p)},S.ensureContrastRatio=function(A,M,L){const D=x.relativeLuminance(A>>8),U=x.relativeLuminance(M>>8);if(v(D,U)<L){if(U<D){const N=E(A,M,L),Y=v(D,x.relativeLuminance(N>>8));if(Y<L){const $=T(A,M,L);return Y>v(D,x.relativeLuminance($>>8))?N:$}return N}const z=T(A,M,L),W=v(D,x.relativeLuminance(z>>8));if(W<L){const N=E(A,M,L);return W>v(D,x.relativeLuminance(N>>8))?z:N}return z}},S.reduceLuminance=E,S.increaseLuminance=T,S.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]}})(y||(a.rgba=y={})),a.toPaddedHex=_,a.contrastRatio=v},8969:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const d=c(844),p=c(2585),f=c(4348),g=c(7866),b=c(744),C=c(7302),x=c(6975),y=c(8460),_=c(1753),v=c(1480),S=c(7994),E=c(9282),T=c(5435),A=c(5981),M=c(2660);let L=!1;class D extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((z=>{this._onScrollApi?.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const W in z)this.optionsService.options[W]=z[W]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new C.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(v.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((W=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((W=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new A.WriteBuffer(((W,N)=>this._inputHandler.parse(W,N)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,W){this._writeBuffer.write(z,W)}writeSync(z,W){this._logService.logLevel<=p.LogLevelEnum.WARN&&!L&&(this._logService.warn("writeSync is unreliable and will be removed soon."),L=!0),this._writeBuffer.writeSync(z,W)}input(z,W=!0){this.coreService.triggerDataEvent(z,W)}resize(z,W){isNaN(z)||isNaN(W)||(z=Math.max(z,b.MINIMUM_COLS),W=Math.max(W,b.MINIMUM_ROWS),this._bufferService.resize(z,W))}scroll(z,W=!1){this._bufferService.scroll(z,W)}scrollLines(z,W,N){this._bufferService.scrollLines(z,W,N)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const W=z-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(z,W){return this._inputHandler.registerEscHandler(z,W)}registerDcsHandler(z,W){return this._inputHandler.registerDcsHandler(z,W)}registerCsiHandler(z,W){return this._inputHandler.registerCsiHandler(z,W)}registerOscHandler(z,W){return this._inputHandler.registerOscHandler(z,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?z=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const W of z)W.dispose()}))}}}a.CoreTerminal=D},8460:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===c)return void this._listeners.splice(d,1)}}})),this._event}fire(c,d){const p=[];for(let f=0;f<this._listeners.length;f++)p.push(this._listeners[f]);for(let f=0;f<p.length;f++)p[f].call(void 0,c,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,d){return c((p=>d.fire(p)))},a.runAndSubscribe=function(c,d){return d(void 0),c((p=>d(p)))}},5435:function(h,a,c){var d=this&&this.__decorate||function(H,P,B,I){var G,K=arguments.length,J=K<3?P:I===null?I=Object.getOwnPropertyDescriptor(P,B):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(H,P,B,I);else for(var Z=H.length-1;Z>=0;Z--)(G=H[Z])&&(J=(K<3?G(J):K>3?G(P,B,J):G(P,B))||J);return K>3&&J&&Object.defineProperty(P,B,J),J},p=this&&this.__param||function(H,P){return function(B,I){P(B,I,H)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const f=c(2584),g=c(7116),b=c(2015),C=c(844),x=c(482),y=c(8437),_=c(8460),v=c(643),S=c(511),E=c(3734),T=c(2585),A=c(1480),M=c(6242),L=c(6351),D=c(5941),U={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function W(H,P){if(H>24)return P.setWinLines||!1;switch(H){case 1:return!!P.restoreWin;case 2:return!!P.minimizeWin;case 3:return!!P.setWinPosition;case 4:return!!P.setWinSizePixels;case 5:return!!P.raiseWin;case 6:return!!P.lowerWin;case 7:return!!P.refreshWin;case 8:return!!P.setWinSizeChars;case 9:return!!P.maximizeWin;case 10:return!!P.fullscreenWin;case 11:return!!P.getWinState;case 13:return!!P.getWinPosition;case 14:return!!P.getWinSizePixels;case 15:return!!P.getScreenSizePixels;case 16:return!!P.getCellSizePixels;case 18:return!!P.getWinSizeChars;case 19:return!!P.getScreenSizeChars;case 20:return!!P.getIconTitle;case 21:return!!P.getWinTitle;case 22:return!!P.pushTitle;case 23:return!!P.popTitle;case 24:return!!P.setWinLines}return!1}var N;(function(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(a.WindowsOptionsReportType=N={}));let Y=0;class $ extends C.Disposable{getAttrData(){return this._curAttrData}constructor(P,B,I,G,K,J,Z,ee,X=new b.EscapeSequenceParser){super(),this._bufferService=P,this._charsetService=B,this._coreService=I,this._logService=G,this._optionsService=K,this._oscLinkService=J,this._coreMouseService=Z,this._unicodeService=ee,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new S.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((V=>this._activeBuffer=V.activeBuffer))),this._parser.setCsiHandlerFallback(((V,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(V),params:se.toArray()})})),this._parser.setEscHandlerFallback((V=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(V)})})),this._parser.setExecuteHandlerFallback((V=>{this._logService.debug("Unknown EXECUTE code: ",{code:V})})),this._parser.setOscHandlerFallback(((V,se,re)=>{this._logService.debug("Unknown OSC code: ",{identifier:V,action:se,data:re})})),this._parser.setDcsHandlerFallback(((V,se,re)=>{se==="HOOK"&&(re=re.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(V),action:se,payload:re})})),this._parser.setPrintHandler(((V,se,re)=>this.print(V,se,re))),this._parser.registerCsiHandler({final:"@"},(V=>this.insertChars(V))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(V=>this.scrollLeft(V))),this._parser.registerCsiHandler({final:"A"},(V=>this.cursorUp(V))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(V=>this.scrollRight(V))),this._parser.registerCsiHandler({final:"B"},(V=>this.cursorDown(V))),this._parser.registerCsiHandler({final:"C"},(V=>this.cursorForward(V))),this._parser.registerCsiHandler({final:"D"},(V=>this.cursorBackward(V))),this._parser.registerCsiHandler({final:"E"},(V=>this.cursorNextLine(V))),this._parser.registerCsiHandler({final:"F"},(V=>this.cursorPrecedingLine(V))),this._parser.registerCsiHandler({final:"G"},(V=>this.cursorCharAbsolute(V))),this._parser.registerCsiHandler({final:"H"},(V=>this.cursorPosition(V))),this._parser.registerCsiHandler({final:"I"},(V=>this.cursorForwardTab(V))),this._parser.registerCsiHandler({final:"J"},(V=>this.eraseInDisplay(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(V=>this.eraseInDisplay(V,!0))),this._parser.registerCsiHandler({final:"K"},(V=>this.eraseInLine(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(V=>this.eraseInLine(V,!0))),this._parser.registerCsiHandler({final:"L"},(V=>this.insertLines(V))),this._parser.registerCsiHandler({final:"M"},(V=>this.deleteLines(V))),this._parser.registerCsiHandler({final:"P"},(V=>this.deleteChars(V))),this._parser.registerCsiHandler({final:"S"},(V=>this.scrollUp(V))),this._parser.registerCsiHandler({final:"T"},(V=>this.scrollDown(V))),this._parser.registerCsiHandler({final:"X"},(V=>this.eraseChars(V))),this._parser.registerCsiHandler({final:"Z"},(V=>this.cursorBackwardTab(V))),this._parser.registerCsiHandler({final:"`"},(V=>this.charPosAbsolute(V))),this._parser.registerCsiHandler({final:"a"},(V=>this.hPositionRelative(V))),this._parser.registerCsiHandler({final:"b"},(V=>this.repeatPrecedingCharacter(V))),this._parser.registerCsiHandler({final:"c"},(V=>this.sendDeviceAttributesPrimary(V))),this._parser.registerCsiHandler({prefix:">",final:"c"},(V=>this.sendDeviceAttributesSecondary(V))),this._parser.registerCsiHandler({final:"d"},(V=>this.linePosAbsolute(V))),this._parser.registerCsiHandler({final:"e"},(V=>this.vPositionRelative(V))),this._parser.registerCsiHandler({final:"f"},(V=>this.hVPosition(V))),this._parser.registerCsiHandler({final:"g"},(V=>this.tabClear(V))),this._parser.registerCsiHandler({final:"h"},(V=>this.setMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(V=>this.setModePrivate(V))),this._parser.registerCsiHandler({final:"l"},(V=>this.resetMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(V=>this.resetModePrivate(V))),this._parser.registerCsiHandler({final:"m"},(V=>this.charAttributes(V))),this._parser.registerCsiHandler({final:"n"},(V=>this.deviceStatus(V))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(V=>this.deviceStatusPrivate(V))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(V=>this.softReset(V))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(V=>this.setCursorStyle(V))),this._parser.registerCsiHandler({final:"r"},(V=>this.setScrollRegion(V))),this._parser.registerCsiHandler({final:"s"},(V=>this.saveCursor(V))),this._parser.registerCsiHandler({final:"t"},(V=>this.windowOptions(V))),this._parser.registerCsiHandler({final:"u"},(V=>this.restoreCursor(V))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(V=>this.insertColumns(V))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(V=>this.deleteColumns(V))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(V=>this.selectProtected(V))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(V=>this.requestMode(V,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(V=>this.requestMode(V,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((V=>(this.setTitle(V),this.setIconName(V),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((V=>this.setIconName(V)))),this._parser.registerOscHandler(2,new M.OscHandler((V=>this.setTitle(V)))),this._parser.registerOscHandler(4,new M.OscHandler((V=>this.setOrReportIndexedColor(V)))),this._parser.registerOscHandler(8,new M.OscHandler((V=>this.setHyperlink(V)))),this._parser.registerOscHandler(10,new M.OscHandler((V=>this.setOrReportFgColor(V)))),this._parser.registerOscHandler(11,new M.OscHandler((V=>this.setOrReportBgColor(V)))),this._parser.registerOscHandler(12,new M.OscHandler((V=>this.setOrReportCursorColor(V)))),this._parser.registerOscHandler(104,new M.OscHandler((V=>this.restoreIndexedColor(V)))),this._parser.registerOscHandler(110,new M.OscHandler((V=>this.restoreFgColor(V)))),this._parser.registerOscHandler(111,new M.OscHandler((V=>this.restoreBgColor(V)))),this._parser.registerOscHandler(112,new M.OscHandler((V=>this.restoreCursorColor(V)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const V in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:V},(()=>this.selectCharset("("+V))),this._parser.registerEscHandler({intermediates:")",final:V},(()=>this.selectCharset(")"+V))),this._parser.registerEscHandler({intermediates:"*",final:V},(()=>this.selectCharset("*"+V))),this._parser.registerEscHandler({intermediates:"+",final:V},(()=>this.selectCharset("+"+V))),this._parser.registerEscHandler({intermediates:"-",final:V},(()=>this.selectCharset("-"+V))),this._parser.registerEscHandler({intermediates:".",final:V},(()=>this.selectCharset("."+V))),this._parser.registerEscHandler({intermediates:"/",final:V},(()=>this.selectCharset("/"+V)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((V=>(this._logService.error("Parsing error: ",V),V))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new L.DcsHandler(((V,se)=>this.requestStatusString(V,se))))}_preserveStack(P,B,I,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=P,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=I,this._parseStack.position=G}_logSlowResolvingAsync(P){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([P,new Promise(((B,I)=>setTimeout((()=>I("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(P,B){let I,G=this._activeBuffer.x,K=this._activeBuffer.y,J=0;const Z=this._parseStack.paused;if(Z){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(I),I;G=this._parseStack.cursorStartX,K=this._parseStack.cursorStartY,this._parseStack.paused=!1,P.length>z&&(J=this._parseStack.position+z)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof P=="string"?` "${P}"`:` "${Array.prototype.map.call(P,(V=>String.fromCharCode(V))).join("")}"`),typeof P=="string"?P.split("").map((V=>V.charCodeAt(0))):P),this._parseBuffer.length<P.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(P.length,z))),Z||this._dirtyRowTracker.clearRange(),P.length>z)for(let V=J;V<P.length;V+=z){const se=V+z<P.length?V+z:P.length,re=typeof P=="string"?this._stringDecoder.decode(P.substring(V,se),this._parseBuffer):this._utf8Decoder.decode(P.subarray(V,se),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,re))return this._preserveStack(G,K,re,V),this._logSlowResolvingAsync(I),I}else if(!Z){const V=typeof P=="string"?this._stringDecoder.decode(P,this._parseBuffer):this._utf8Decoder.decode(P,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,V))return this._preserveStack(G,K,V,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===G&&this._activeBuffer.y===K||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(P,B,I){let G,K;const J=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,V=this._coreService.modes.insertMode,se=this._curAttrData;let re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-B>0&&re.getWidth(this._activeBuffer.x-1)===2&&re.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let ne=this._parser.precedingJoinState;for(let oe=B;oe<I;++oe){if(G=P[oe],G<127&&J){const he=J[String.fromCharCode(G)];he&&(G=he.charCodeAt(0))}const ce=this._unicodeService.charProperties(G,ne);K=A.UnicodeService.extractWidth(ce);const ve=A.UnicodeService.extractShouldJoin(ce),ge=ve?A.UnicodeService.extractWidth(ne):0;if(ne=ce,Z&&this._onA11yChar.fire((0,x.stringFromCodePoint)(G)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+K-ge>ee){if(X){const he=re;let de=this._activeBuffer.x-ge;for(this._activeBuffer.x=ge,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ge>0&&re instanceof y.BufferLine&&re.copyCellsFrom(he,de,0,ge,!1);de<ee;)he.setCellFromCodepoint(de++,0,1,se)}else if(this._activeBuffer.x=ee-1,K===2)continue}if(ve&&this._activeBuffer.x){const he=re.getWidth(this._activeBuffer.x-1)?1:2;re.addCodepointToCell(this._activeBuffer.x-he,G,K);for(let de=K-ge;--de>=0;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(V&&(re.insertCells(this._activeBuffer.x,K-ge,this._activeBuffer.getNullCell(se)),re.getWidth(ee-1)===2&&re.setCellFromCodepoint(ee-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,se)),re.setCellFromCodepoint(this._activeBuffer.x++,G,K,se),K>0)for(;--K;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=ne,this._activeBuffer.x<ee&&I-B>0&&re.getWidth(this._activeBuffer.x)===0&&!re.hasContent(this._activeBuffer.x)&&re.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(P,B){return P.final!=="t"||P.prefix||P.intermediates?this._parser.registerCsiHandler(P,B):this._parser.registerCsiHandler(P,(I=>!W(I.params[0],this._optionsService.rawOptions.windowOptions)||B(I)))}registerDcsHandler(P,B){return this._parser.registerDcsHandler(P,new L.DcsHandler(B))}registerEscHandler(P,B){return this._parser.registerEscHandler(P,B)}registerOscHandler(P,B){return this._parser.registerOscHandler(P,new M.OscHandler(B))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const P=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-P),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(P=this._bufferService.cols-1){this._activeBuffer.x=Math.min(P,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(P,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=P,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=P,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(P,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+P,this._activeBuffer.y+B)}cursorUp(P){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,P.params[0]||1)):this._moveCursor(0,-(P.params[0]||1)),!0}cursorDown(P){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,P.params[0]||1)):this._moveCursor(0,P.params[0]||1),!0}cursorForward(P){return this._moveCursor(P.params[0]||1,0),!0}cursorBackward(P){return this._moveCursor(-(P.params[0]||1),0),!0}cursorNextLine(P){return this.cursorDown(P),this._activeBuffer.x=0,!0}cursorPrecedingLine(P){return this.cursorUp(P),this._activeBuffer.x=0,!0}cursorCharAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(P){return this._setCursor(P.length>=2?(P.params[1]||1)-1:0,(P.params[0]||1)-1),!0}charPosAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(P){return this._moveCursor(P.params[0]||1,0),!0}linePosAbsolute(P){return this._setCursor(this._activeBuffer.x,(P.params[0]||1)-1),!0}vPositionRelative(P){return this._moveCursor(0,P.params[0]||1),!0}hVPosition(P){return this.cursorPosition(P),!0}tabClear(P){const B=P.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=P.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=P.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(P){const B=P.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(P,B,I,G=!1,K=!1){const J=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);J.replaceCells(B,I,this._activeBuffer.getNullCell(this._eraseAttrData()),K),G&&(J.isWrapped=!1)}_resetBufferLine(P,B=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+P),I.isWrapped=!1)}eraseInDisplay(P,B=!1){let I;switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);I<this._bufferService.rows;I++)this._resetBufferLine(I,B);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,B);this._dirtyRowTracker.markDirty(0);break;case 3:const G=this._activeBuffer.lines.length-this._bufferService.rows;G>0&&(this._activeBuffer.lines.trimStart(G),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-G,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-G,0),this._onScroll.fire(0))}return!0}eraseInLine(P,B=!1){switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(P){this._restrictCursor();let B=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-G+1;for(;B--;)this._activeBuffer.lines.splice(K-1,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(P){this._restrictCursor();let B=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let G;for(G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-G;B--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(G,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(P){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(P){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(P){let B=P.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(P){let B=P.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(y.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=P.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(P){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(P.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(P){const B=this._parser.precedingJoinState;if(!B)return!0;const I=P.params[0]||1,G=A.UnicodeService.extractWidth(B),K=this._activeBuffer.x-G,J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(K),Z=new Uint32Array(J.length*I);let ee=0;for(let V=0;V<J.length;){const se=J.codePointAt(V)||0;Z[ee++]=se,V+=se>65535?2:1}let X=ee;for(let V=1;V<I;++V)Z.copyWithin(X,0,ee),X+=ee;return this.print(Z,0,X),!0}sendDeviceAttributesPrimary(P){return P.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(P){return P.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(P.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(P){return(this._optionsService.rawOptions.termName+"").indexOf(P)===0}setMode(P){for(let B=0;B<P.length;B++)switch(P.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(P){for(let B=0;B<P.length;B++)switch(P.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(P){for(let B=0;B<P.length;B++)switch(P.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(P){for(let B=0;B<P.length;B++)switch(P.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),P.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(P,B){const I=this._coreService.decPrivateModes,{activeProtocol:G,activeEncoding:K}=this._coreMouseService,J=this._coreService,{buffers:Z,cols:ee}=this._bufferService,{active:X,alt:V}=Z,se=this._optionsService.rawOptions,re=ve=>ve?1:2,ne=P.params[0];return oe=ne,ce=B?ne===2?4:ne===4?re(J.modes.insertMode):ne===12?3:ne===20?re(se.convertEol):0:ne===1?re(I.applicationCursorKeys):ne===3?se.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:ne===6?re(I.origin):ne===7?re(I.wraparound):ne===8?3:ne===9?re(G==="X10"):ne===12?re(se.cursorBlink):ne===25?re(!J.isCursorHidden):ne===45?re(I.reverseWraparound):ne===66?re(I.applicationKeypad):ne===67?4:ne===1e3?re(G==="VT200"):ne===1002?re(G==="DRAG"):ne===1003?re(G==="ANY"):ne===1004?re(I.sendFocus):ne===1005?4:ne===1006?re(K==="SGR"):ne===1015?4:ne===1016?re(K==="SGR_PIXELS"):ne===1048?1:ne===47||ne===1047||ne===1049?re(X===V):ne===2004?re(I.bracketedPasteMode):0,J.triggerDataEvent(`${f.C0.ESC}[${B?"":"?"}${oe};${ce}$y`),!0;var oe,ce}_updateAttrColor(P,B,I,G,K){return B===2?(P|=50331648,P&=-16777216,P|=E.AttributeData.fromColorRGB([I,G,K])):B===5&&(P&=-50331904,P|=33554432|255&I),P}_extractColor(P,B,I){const G=[0,0,-1,0,0,0];let K=0,J=0;do{if(G[J+K]=P.params[B+J],P.hasSubParams(B+J)){const Z=P.getSubParams(B+J);let ee=0;do G[1]===5&&(K=1),G[J+ee+1+K]=Z[ee];while(++ee<Z.length&&ee+J+1+K<G.length);break}if(G[1]===5&&J+K>=2||G[1]===2&&J+K>=5)break;G[1]&&(K=1)}while(++J+B<P.length&&J+K<G.length);for(let Z=2;Z<G.length;++Z)G[Z]===-1&&(G[Z]=0);switch(G[0]){case 38:I.fg=this._updateAttrColor(I.fg,G[1],G[3],G[4],G[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,G[1],G[3],G[4],G[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,G[1],G[3],G[4],G[5])}return J}_processUnderline(P,B){B.extended=B.extended.clone(),(!~P||P>5)&&(P=1),B.extended.underlineStyle=P,B.fg|=268435456,P===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(P){P.fg=y.DEFAULT_ATTR_DATA.fg,P.bg=y.DEFAULT_ATTR_DATA.bg,P.extended=P.extended.clone(),P.extended.underlineStyle=0,P.extended.underlineColor&=-67108864,P.updateExtended()}charAttributes(P){if(P.length===1&&P.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=P.length;let I;const G=this._curAttrData;for(let K=0;K<B;K++)I=P.params[K],I>=30&&I<=37?(G.fg&=-50331904,G.fg|=16777216|I-30):I>=40&&I<=47?(G.bg&=-50331904,G.bg|=16777216|I-40):I>=90&&I<=97?(G.fg&=-50331904,G.fg|=16777224|I-90):I>=100&&I<=107?(G.bg&=-50331904,G.bg|=16777224|I-100):I===0?this._processSGR0(G):I===1?G.fg|=134217728:I===3?G.bg|=67108864:I===4?(G.fg|=268435456,this._processUnderline(P.hasSubParams(K)?P.getSubParams(K)[0]:1,G)):I===5?G.fg|=536870912:I===7?G.fg|=67108864:I===8?G.fg|=1073741824:I===9?G.fg|=2147483648:I===2?G.bg|=134217728:I===21?this._processUnderline(2,G):I===22?(G.fg&=-134217729,G.bg&=-134217729):I===23?G.bg&=-67108865:I===24?(G.fg&=-268435457,this._processUnderline(0,G)):I===25?G.fg&=-536870913:I===27?G.fg&=-67108865:I===28?G.fg&=-1073741825:I===29?G.fg&=2147483647:I===39?(G.fg&=-67108864,G.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):I===49?(G.bg&=-67108864,G.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?K+=this._extractColor(P,K,G):I===53?G.bg|=1073741824:I===55?G.bg&=-1073741825:I===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):I===100?(G.fg&=-67108864,G.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(P){switch(P.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${B};${I}R`)}return!0}deviceStatusPrivate(P){if(P.params[0]===6){const B=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${B};${I}R`)}return!0}softReset(P){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(P){const B=P.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const I=B%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(P){const B=P.params[0]||1;let I;return(P.length<2||(I=P.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(P){if(!W(P.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=P.length>1?P.params[1]:0;switch(P.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(N.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(N.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(P){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(P){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(P){return this._windowTitle=P,this._onTitleChange.fire(P),!0}setIconName(P){return this._iconName=P,!0}setOrReportIndexedColor(P){const B=[],I=P.split(";");for(;I.length>1;){const G=I.shift(),K=I.shift();if(/^\d+$/.exec(G)){const J=parseInt(G);if(q(J))if(K==="?")B.push({type:0,index:J});else{const Z=(0,D.parseColor)(K);Z&&B.push({type:1,index:J,color:Z})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(P){const B=P.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(P,B){this._getCurrentLinkId()&&this._finishHyperlink();const I=P.split(":");let G;const K=I.findIndex((J=>J.startsWith("id=")));return K!==-1&&(G=I[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(P,B){const I=P.split(";");for(let G=0;G<I.length&&!(B>=this._specialColors.length);++G,++B)if(I[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const K=(0,D.parseColor)(I[G]);K&&this._onColor.fire([{type:1,index:this._specialColors[B],color:K}])}return!0}setOrReportFgColor(P){return this._setOrReportSpecialColor(P,0)}setOrReportBgColor(P){return this._setOrReportSpecialColor(P,1)}setOrReportCursorColor(P){return this._setOrReportSpecialColor(P,2)}restoreIndexedColor(P){if(!P)return this._onColor.fire([{type:2}]),!0;const B=[],I=P.split(";");for(let G=0;G<I.length;++G)if(/^\d+$/.exec(I[G])){const K=parseInt(I[G]);q(K)&&B.push({type:2,index:K})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(P){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(P){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(P){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),!0}selectCharset(P){return P.length!==2?(this.selectDefaultCharset(),!0):(P[0]==="/"||this._charsetService.setgCharset(U[P[0]],g.CHARSETS[P[1]]||g.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const P=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,P,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(P){return this._charsetService.setgLevel(P),!0}screenAlignmentPattern(){const P=new S.CellData;P.content=4194373,P.fg=this._curAttrData.fg,P.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const I=this._activeBuffer.ybase+this._activeBuffer.y+B,G=this._activeBuffer.lines.get(I);G&&(G.fill(P),G.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(P,B){const I=this._bufferService.buffer,G=this._optionsService.rawOptions;return(K=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${K}${f.C0.ESC}\\`),!0))(P==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:P==='"p'?'P1$r61;1"p':P==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:P==="m"?"P1$r0m":P===" q"?`P1$r${{block:2,underline:4,bar:6}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(P,B){this._dirtyRowTracker.markRangeDirty(P,B)}}a.InputHandler=$;let F=class{constructor(H){this._bufferService=H,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(H){H<this.start?this.start=H:H>this.end&&(this.end=H)}markRangeDirty(H,P){H>P&&(Y=H,H=P,P=Y),H<this.start&&(this.start=H),P>this.end&&(this.end=P)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(H){return 0<=H&&H<256}F=d([p(0,T.IBufferService)],F)},844:(h,a)=>{function c(d){for(const p of d)p.dispose();d.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const p=this._disposables.indexOf(d);p!==-1&&this._disposables.splice(p,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){this._isDisposed||d===this._value||(this._value?.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},a.toDisposable=function(d){return{dispose:d}},a.disposeArray=c,a.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,f,g){this._data[p]||(this._data[p]={}),this._data[p][f]=g}get(p,f){return this._data[p]?this._data[p][f]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(d,p,f,g,b){this._data.get(d,p)||this._data.set(d,p,new c),this._data.get(d,p).set(f,g,b)}get(d,p,f,g){return this._data.get(d,p)?.get(f,g)}clear(){this._data.clear()}}},6114:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,d=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const p=this._getKey(d);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(d){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===d)}forEachByKey(d,p){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===d)}values(){return[...this._array].values()}_search(d){let p=0,f=this._array.length-1;for(;f>=p;){let g=p+f>>1;const b=this._getKey(this._array[g]);if(b>d)f=g-1;else{if(!(b<d)){for(;g>0&&this._getKey(this._array[g-1])===d;)g--;return g}p=g+1}}return p}}},7226:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const d=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(b){this._idleCallback=void 0;let C=0,x=0,y=b.timeRemaining(),_=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),x=Math.max(C,x),_=b.timeRemaining(),1.5*x>_)return y-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-C))}ms`),void this._start();y=_}this.clear()}}class f extends p{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const C=Date.now()+b;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}a.PriorityTaskQueue=f,a.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:f,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const d=c(643);a.updateWindowsModeWrappedState=function(p){const f=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),g=f?.get(p.cols-1),b=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);b&&g&&(b.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new c;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=c;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,g=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=d},9092:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const d=c(6349),p=c(7226),f=c(3734),g=c(8437),b=c(4634),C=c(511),x=c(643),y=c(4863),_=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(v,S,E){this._hasScrollback=v,this._optionsService=S,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(v){return v?(this._nullCell.fg=v.fg,this._nullCell.bg=v.bg,this._nullCell.extended=v.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(v){return v?(this._whitespaceCell.fg=v.fg,this._whitespaceCell.bg=v.bg,this._whitespaceCell.extended=v.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(v,S){return new g.BufferLine(this._bufferService.cols,this.getNullCell(v),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const v=this.ybase+this.y-this.ydisp;return v>=0&&v<this._rows}_getCorrectBufferLength(v){if(!this._hasScrollback)return v;const S=v+this._optionsService.rawOptions.scrollback;return S>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:S}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=g.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(v))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(v,S){const E=this.getNullCell(g.DEFAULT_ATTR_DATA);let T=0;const A=this._getCorrectBufferLength(S);if(A>this.lines.maxLength&&(this.lines.maxLength=A),this.lines.length>0){if(this._cols<v)for(let L=0;L<this.lines.length;L++)T+=+this.lines.get(L).resize(v,E);let M=0;if(this._rows<S)for(let L=this._rows;L<S;L++)this.lines.length<S+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(v,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(v,E)));else for(let L=this._rows;L>S;L--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(A<this.lines.maxLength){const L=this.lines.length-A;L>0&&(this.lines.trimStart(L),this.ybase=Math.max(this.ybase-L,0),this.ydisp=Math.max(this.ydisp-L,0),this.savedY=Math.max(this.savedY-L,0)),this.lines.maxLength=A}this.x=Math.min(this.x,v-1),this.y=Math.min(this.y,S-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(v,S),this._cols>v))for(let M=0;M<this.lines.length;M++)T+=+this.lines.get(M).resize(v,E);this._cols=v,this._rows=S,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let v=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,v=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return v}get _isReflowEnabled(){const v=this._optionsService.rawOptions.windowsPty;return v&&v.buildNumber?this._hasScrollback&&v.backend==="conpty"&&v.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(v,S){this._cols!==v&&(v>this._cols?this._reflowLarger(v,S):this._reflowSmaller(v,S))}_reflowLarger(v,S){const E=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,v,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(E.length>0){const T=(0,b.reflowLargerCreateNewLayout)(this.lines,E);(0,b.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(v,S,T.countRemoved)}}_reflowLargerAdjustViewport(v,S,E){const T=this.getNullCell(g.DEFAULT_ATTR_DATA);let A=E;for(;A-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new g.BufferLine(v,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(v,S){const E=this.getNullCell(g.DEFAULT_ATTR_DATA),T=[];let A=0;for(let M=this.lines.length-1;M>=0;M--){let L=this.lines.get(M);if(!L||!L.isWrapped&&L.getTrimmedLength()<=v)continue;const D=[L];for(;L.isWrapped&&M>0;)L=this.lines.get(--M),D.unshift(L);const U=this.ybase+this.y;if(U>=M&&U<M+D.length)continue;const z=D[D.length-1].getTrimmedLength(),W=(0,b.reflowSmallerGetNewLineLengths)(D,this._cols,v),N=W.length-D.length;let Y;Y=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+N):Math.max(0,this.lines.length-this.lines.maxLength+N);const $=[];for(let I=0;I<N;I++){const G=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);$.push(G)}$.length>0&&(T.push({start:M+D.length+A,newLines:$}),A+=$.length),D.push(...$);let F=W.length-1,q=W[F];q===0&&(F--,q=W[F]);let H=D.length-N-1,P=z;for(;H>=0;){const I=Math.min(P,q);if(D[F]===void 0)break;if(D[F].copyCellsFrom(D[H],P-I,q-I,I,!0),q-=I,q===0&&(F--,q=W[F]),P-=I,P===0){H--;const G=Math.max(H,0);P=(0,b.getWrappedLineTrimmedLength)(D,G,this._cols)}}for(let I=0;I<D.length;I++)W[I]<v&&D[I].setCell(W[I],E);let B=N-Y;for(;B-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+A)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+N,this.ybase+S-1)}if(T.length>0){const M=[],L=[];for(let F=0;F<this.lines.length;F++)L.push(this.lines.get(F));const D=this.lines.length;let U=D-1,z=0,W=T[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let N=0;for(let F=Math.min(this.lines.maxLength-1,D+A-1);F>=0;F--)if(W&&W.start>U+N){for(let q=W.newLines.length-1;q>=0;q--)this.lines.set(F--,W.newLines[q]);F++,M.push({index:U+1,amount:W.newLines.length}),N+=W.newLines.length,W=T[++z]}else this.lines.set(F,L[U--]);let Y=0;for(let F=M.length-1;F>=0;F--)M[F].index+=Y,this.lines.onInsertEmitter.fire(M[F]),Y+=M[F].amount;const $=Math.max(0,D+A-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(v,S,E=0,T){const A=this.lines.get(v);return A?A.translateToString(S,E,T):""}getWrappedRangeForLine(v){let S=v,E=v;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:S,last:E}}setupTabStops(v){for(v!=null?this.tabs[v]||(v=this.prevStop(v)):(this.tabs={},v=0);v<this._cols;v+=this._optionsService.rawOptions.tabStopWidth)this.tabs[v]=!0}prevStop(v){for(v==null&&(v=this.x);!this.tabs[--v]&&v>0;);return v>=this._cols?this._cols-1:v<0?0:v}nextStop(v){for(v==null&&(v=this.x);!this.tabs[++v]&&v<this._cols;);return v>=this._cols?this._cols-1:v<0?0:v}clearMarkers(v){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===v&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].dispose(),this.markers.splice(v--,1);this._isClearing=!1}addMarker(v){const S=new y.Marker(v);return this.markers.push(S),S.register(this.lines.onTrim((E=>{S.line-=E,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((E=>{S.line>=E.index&&(S.line+=E.amount)}))),S.register(this.lines.onDelete((E=>{S.line>=E.index&&S.line<E.index+E.amount&&S.dispose(),S.line>E.index&&(S.line-=E.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(v){this._isClearing||this.markers.splice(this.markers.indexOf(v),1)}}},8437:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const d=c(3734),p=c(511),f=c(643),g=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class C{constructor(y,_,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const S=_||p.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let E=0;E<y;++E)this.setCell(E,S);this.length=y}get(y){const _=this._data[3*y+0],v=2097151&_;return[this._data[3*y+1],2097152&_?this._combined[y]:v?(0,g.stringFromCodePoint)(v):"",_>>22,2097152&_?this._combined[y].charCodeAt(this._combined[y].length-1):v]}set(y,_){this._data[3*y+1]=_[f.CHAR_DATA_ATTR_INDEX],_[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=_[1],this._data[3*y+0]=2097152|y|_[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=_[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const _=this._data[3*y+0];return 2097152&_?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&_}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const _=this._data[3*y+0];return 2097152&_?this._combined[y]:2097151&_?(0,g.stringFromCodePoint)(2097151&_):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,_){return b=3*y,_.content=this._data[b+0],_.fg=this._data[b+1],_.bg=this._data[b+2],2097152&_.content&&(_.combinedData=this._combined[y]),268435456&_.bg&&(_.extended=this._extendedAttrs[y]),_}setCell(y,_){2097152&_.content&&(this._combined[y]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[y]=_.extended),this._data[3*y+0]=_.content,this._data[3*y+1]=_.fg,this._data[3*y+2]=_.bg}setCellFromCodepoint(y,_,v,S){268435456&S.bg&&(this._extendedAttrs[y]=S.extended),this._data[3*y+0]=_|v<<22,this._data[3*y+1]=S.fg,this._data[3*y+2]=S.bg}addCodepointToCell(y,_,v){let S=this._data[3*y+0];2097152&S?this._combined[y]+=(0,g.stringFromCodePoint)(_):2097151&S?(this._combined[y]=(0,g.stringFromCodePoint)(2097151&S)+(0,g.stringFromCodePoint)(_),S&=-2097152,S|=2097152):S=_|4194304,v&&(S&=-12582913,S|=v<<22),this._data[3*y+0]=S}insertCells(y,_,v){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),_<this.length-y){const S=new p.CellData;for(let E=this.length-y-_-1;E>=0;--E)this.setCell(y+_+E,this.loadCell(y+E,S));for(let E=0;E<_;++E)this.setCell(y+E,v)}else for(let S=y;S<this.length;++S)this.setCell(S,v);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,v)}deleteCells(y,_,v){if(y%=this.length,_<this.length-y){const S=new p.CellData;for(let E=0;E<this.length-y-_;++E)this.setCell(y+E,this.loadCell(y+_+E,S));for(let E=this.length-_;E<this.length;++E)this.setCell(E,v)}else for(let S=y;S<this.length;++S)this.setCell(S,v);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,v)}replaceCells(y,_,v,S=!1){if(S)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,v),_<this.length&&this.getWidth(_-1)===2&&!this.isProtected(_)&&this.setCellFromCodepoint(_,0,1,v);y<_&&y<this.length;)this.isProtected(y)||this.setCell(y,v),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),_<this.length&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_,0,1,v);y<_&&y<this.length;)this.setCell(y++,v)}resize(y,_){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const v=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*v)this._data=new Uint32Array(this._data.buffer,0,v);else{const S=new Uint32Array(v);S.set(this._data),this._data=S}for(let S=this.length;S<y;++S)this.setCell(S,_)}else{this._data=this._data.subarray(0,v);const S=Object.keys(this._combined);for(let T=0;T<S.length;T++){const A=parseInt(S[T],10);A>=y&&delete this._combined[A]}const E=Object.keys(this._extendedAttrs);for(let T=0;T<E.length;T++){const A=parseInt(E[T],10);A>=y&&delete this._extendedAttrs[A]}}return this.length=y,4*v*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const y=new Uint32Array(this._data.length);return y.set(this._data),this._data=y,1}return 0}fill(y,_=!1){if(_)for(let v=0;v<this.length;++v)this.isProtected(v)||this.setCell(v,y);else{this._combined={},this._extendedAttrs={};for(let v=0;v<this.length;++v)this.setCell(v,y)}}copyFrom(y){this.length!==y.length?this._data=new Uint32Array(y._data):this._data.set(y._data),this.length=y.length,this._combined={};for(const _ in y._combined)this._combined[_]=y._combined[_];this._extendedAttrs={};for(const _ in y._extendedAttrs)this._extendedAttrs[_]=y._extendedAttrs[_];this.isWrapped=y.isWrapped}clone(){const y=new C(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const _ in this._combined)y._combined[_]=this._combined[_];for(const _ in this._extendedAttrs)y._extendedAttrs[_]=this._extendedAttrs[_];return y.isWrapped=this.isWrapped,y}getTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,_,v,S,E){const T=y._data;if(E)for(let M=S-1;M>=0;M--){for(let L=0;L<3;L++)this._data[3*(v+M)+L]=T[3*(_+M)+L];268435456&T[3*(_+M)+2]&&(this._extendedAttrs[v+M]=y._extendedAttrs[_+M])}else for(let M=0;M<S;M++){for(let L=0;L<3;L++)this._data[3*(v+M)+L]=T[3*(_+M)+L];268435456&T[3*(_+M)+2]&&(this._extendedAttrs[v+M]=y._extendedAttrs[_+M])}const A=Object.keys(y._combined);for(let M=0;M<A.length;M++){const L=parseInt(A[M],10);L>=_&&(this._combined[L-_+v]=y._combined[L])}}translateToString(y,_,v,S){_=_??0,v=v??this.length,y&&(v=Math.min(v,this.getTrimmedLength())),S&&(S.length=0);let E="";for(;_<v;){const T=this._data[3*_+0],A=2097151&T,M=2097152&T?this._combined[_]:A?(0,g.stringFromCodePoint)(A):f.WHITESPACE_CELL_CHAR;if(E+=M,S)for(let L=0;L<M.length;++L)S.push(_);_+=T>>22||1}return S&&S.push(_),E}}a.BufferLine=C},4841:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,d){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(h,a)=>{function c(d,p,f){if(p===d.length-1)return d[p].getTrimmedLength();const g=!d[p].hasContent(f-1)&&d[p].getWidth(f-1)===1,b=d[p+1].getWidth(0)===2;return g&&b?f-1:f}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(d,p,f,g,b){const C=[];for(let x=0;x<d.length-1;x++){let y=x,_=d.get(++y);if(!_.isWrapped)continue;const v=[d.get(x)];for(;y<d.length&&_.isWrapped;)v.push(_),_=d.get(++y);if(g>=x&&g<y){x+=v.length-1;continue}let S=0,E=c(v,S,p),T=1,A=0;for(;T<v.length;){const L=c(v,T,p),D=L-A,U=f-E,z=Math.min(D,U);v[S].copyCellsFrom(v[T],A,E,z,!1),E+=z,E===f&&(S++,E=0),A+=z,A===L&&(T++,A=0),E===0&&S!==0&&v[S-1].getWidth(f-1)===2&&(v[S].copyCellsFrom(v[S-1],f-1,E++,1,!1),v[S-1].setCell(f-1,b))}v[S].replaceCells(E,f,b);let M=0;for(let L=v.length-1;L>0&&(L>S||v[L].getTrimmedLength()===0);L--)M++;M>0&&(C.push(x+v.length-M),C.push(M)),x+=v.length-1}return C},a.reflowLargerCreateNewLayout=function(d,p){const f=[];let g=0,b=p[g],C=0;for(let x=0;x<d.length;x++)if(b===x){const y=p[++g];d.onDeleteEmitter.fire({index:x-C,amount:y}),x+=y-1,C+=y,b=p[++g]}else f.push(x);return{layout:f,countRemoved:C}},a.reflowLargerApplyNewLayout=function(d,p){const f=[];for(let g=0;g<p.length;g++)f.push(d.get(p[g]));for(let g=0;g<f.length;g++)d.set(g,f[g]);d.length=p.length},a.reflowSmallerGetNewLineLengths=function(d,p,f){const g=[],b=d.map(((_,v)=>c(d,v,p))).reduce(((_,v)=>_+v));let C=0,x=0,y=0;for(;y<b;){if(b-y<f){g.push(b-y);break}C+=f;const _=c(d,x,p);C>_&&(C-=_,x++);const v=d[x].getWidth(C-1)===2;v&&C--;const S=v?f-1:f;g.push(S),y+=S}return g},a.getWrappedLineTrimmedLength=c},5295:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const d=c(8460),p=c(844),f=c(9092);class g extends p.Disposable{constructor(C,x){super(),this._optionsService=C,this._bufferService=x,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,x){this._normal.resize(C,x),this._alt.resize(C,x),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}a.BufferSet=g},511:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const d=c(482),p=c(643),f=c(3734);class g extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const x=new g;return x.setFromCharData(C),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(C[p.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(C[p.CHAR_DATA_CHAR_INDEX].length===2){const y=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const _=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(y-55296)+_-56320+65536|C[p.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[p.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=C[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=g},643:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const d=c(8460),p=c(844);class f{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}a.Marker=f,f._nextId=1},7116:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(h,a)=>{var c,d,p;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
28
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(c||(a.C0=c={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(d||(a.C1=d={})),(function(f){f.ST=`${c.ESC}\\`})(p||(a.C1_ESCAPED=p={}))},7399:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const d=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(f,g,b,C){const x={type:0,cancel:!1,key:void 0},y=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?x.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?x.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?x.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(x.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:x.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(x.key=d.C0.ESC+x.key);break;case 9:if(f.shiftKey){x.key=d.C0.ESC+"[Z";break}x.key=d.C0.HT,x.cancel=!0;break;case 13:x.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,x.cancel=!0;break;case 27:x.key=d.C0.ESC,f.altKey&&(x.key=d.C0.ESC+d.C0.ESC),x.cancel=!0;break;case 37:if(f.metaKey)break;y?(x.key=d.C0.ESC+"[1;"+(y+1)+"D",x.key===d.C0.ESC+"[1;3D"&&(x.key=d.C0.ESC+(b?"b":"[1;5D"))):x.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;y?(x.key=d.C0.ESC+"[1;"+(y+1)+"C",x.key===d.C0.ESC+"[1;3C"&&(x.key=d.C0.ESC+(b?"f":"[1;5C"))):x.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;y?(x.key=d.C0.ESC+"[1;"+(y+1)+"A",b||x.key!==d.C0.ESC+"[1;3A"||(x.key=d.C0.ESC+"[1;5A")):x.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;y?(x.key=d.C0.ESC+"[1;"+(y+1)+"B",b||x.key!==d.C0.ESC+"[1;3B"||(x.key=d.C0.ESC+"[1;5B")):x.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(x.key=d.C0.ESC+"[2~");break;case 46:x.key=y?d.C0.ESC+"[3;"+(y+1)+"~":d.C0.ESC+"[3~";break;case 36:x.key=y?d.C0.ESC+"[1;"+(y+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:x.key=y?d.C0.ESC+"[1;"+(y+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?x.type=2:f.ctrlKey?x.key=d.C0.ESC+"[5;"+(y+1)+"~":x.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?x.type=3:f.ctrlKey?x.key=d.C0.ESC+"[6;"+(y+1)+"~":x.key=d.C0.ESC+"[6~";break;case 112:x.key=y?d.C0.ESC+"[1;"+(y+1)+"P":d.C0.ESC+"OP";break;case 113:x.key=y?d.C0.ESC+"[1;"+(y+1)+"Q":d.C0.ESC+"OQ";break;case 114:x.key=y?d.C0.ESC+"[1;"+(y+1)+"R":d.C0.ESC+"OR";break;case 115:x.key=y?d.C0.ESC+"[1;"+(y+1)+"S":d.C0.ESC+"OS";break;case 116:x.key=y?d.C0.ESC+"[15;"+(y+1)+"~":d.C0.ESC+"[15~";break;case 117:x.key=y?d.C0.ESC+"[17;"+(y+1)+"~":d.C0.ESC+"[17~";break;case 118:x.key=y?d.C0.ESC+"[18;"+(y+1)+"~":d.C0.ESC+"[18~";break;case 119:x.key=y?d.C0.ESC+"[19;"+(y+1)+"~":d.C0.ESC+"[19~";break;case 120:x.key=y?d.C0.ESC+"[20;"+(y+1)+"~":d.C0.ESC+"[20~";break;case 121:x.key=y?d.C0.ESC+"[21;"+(y+1)+"~":d.C0.ESC+"[21~";break;case 122:x.key=y?d.C0.ESC+"[23;"+(y+1)+"~":d.C0.ESC+"[23~";break;case 123:x.key=y?d.C0.ESC+"[24;"+(y+1)+"~":d.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(b&&!C||!f.altKey||f.metaKey)!b||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?x.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(x.key=d.C0.US),f.key==="@"&&(x.key=d.C0.NUL)):f.keyCode===65&&(x.type=1);else{const _=p[f.keyCode],v=_?.[f.shiftKey?1:0];if(v)x.key=d.C0.ESC+v;else if(f.keyCode>=65&&f.keyCode<=90){const S=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(S);f.shiftKey&&(E=E.toUpperCase()),x.key=d.C0.ESC+E}else if(f.keyCode===32)x.key=d.C0.ESC+(f.ctrlKey?d.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let S=f.code.slice(3,4);f.shiftKey||(S=S.toLowerCase()),x.key=d.C0.ESC+S,x.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?x.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?x.key=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?x.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?x.key=d.C0.DEL:f.keyCode===219?x.key=d.C0.ESC:f.keyCode===220?x.key=d.C0.FS:f.keyCode===221&&(x.key=d.C0.GS)}return x}},482:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,d=0,p=c.length){let f="";for(let g=d;g<p;++g){let b=c[g];b>65535?(b-=65536,f+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):f+=String.fromCharCode(b)}return f},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,d){const p=c.length;if(!p)return 0;let f=0,g=0;if(this._interim){const b=c.charCodeAt(g++);56320<=b&&b<=57343?d[f++]=1024*(this._interim-55296)+b-56320+65536:(d[f++]=this._interim,d[f++]=b),this._interim=0}for(let b=g;b<p;++b){const C=c.charCodeAt(b);if(55296<=C&&C<=56319){if(++b>=p)return this._interim=C,f;const x=c.charCodeAt(b);56320<=x&&x<=57343?d[f++]=1024*(C-55296)+x-56320+65536:(d[f++]=C,d[f++]=x)}else C!==65279&&(d[f++]=C)}return f}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const p=c.length;if(!p)return 0;let f,g,b,C,x=0,y=0,_=0;if(this.interim[0]){let E=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let A,M=0;for(;(A=63&this.interim[++M])&&M<4;)T<<=6,T|=A;const L=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=L-M;for(;_<D;){if(_>=p)return 0;if(A=c[_++],(192&A)!=128){_--,E=!0;break}this.interim[M++]=A,T<<=6,T|=63&A}E||(L===2?T<128?_--:d[x++]=T:L===3?T<2048||T>=55296&&T<=57343||T===65279||(d[x++]=T):T<65536||T>1114111||(d[x++]=T)),this.interim.fill(0)}const v=p-4;let S=_;for(;S<p;){for(;!(!(S<v)||128&(f=c[S])||128&(g=c[S+1])||128&(b=c[S+2])||128&(C=c[S+3]));)d[x++]=f,d[x++]=g,d[x++]=b,d[x++]=C,S+=4;if(f=c[S++],f<128)d[x++]=f;else if((224&f)==192){if(S>=p)return this.interim[0]=f,x;if(g=c[S++],(192&g)!=128){S--;continue}if(y=(31&f)<<6|63&g,y<128){S--;continue}d[x++]=y}else if((240&f)==224){if(S>=p)return this.interim[0]=f,x;if(g=c[S++],(192&g)!=128){S--;continue}if(S>=p)return this.interim[0]=f,this.interim[1]=g,x;if(b=c[S++],(192&b)!=128){S--;continue}if(y=(15&f)<<12|(63&g)<<6|63&b,y<2048||y>=55296&&y<=57343||y===65279)continue;d[x++]=y}else if((248&f)==240){if(S>=p)return this.interim[0]=f,x;if(g=c[S++],(192&g)!=128){S--;continue}if(S>=p)return this.interim[0]=f,this.interim[1]=g,x;if(b=c[S++],(192&b)!=128){S--;continue}if(S>=p)return this.interim[0]=f,this.interim[1]=g,this.interim[2]=b,x;if(C=c[S++],(192&C)!=128){S--;continue}if(y=(7&f)<<18|(63&g)<<12|(63&b)<<6|63&C,y<65536||y>1114111)continue;d[x++]=y}}return x}}},225:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const d=c(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;a.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let b=0;b<p.length;++b)g.fill(0,p[b][0],p[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?g[b]:(function(C,x){let y,_=0,v=x.length-1;if(C<x[0][0]||C>x[v][1])return!1;for(;v>=_;)if(y=_+v>>1,C>x[y][1])_=y+1;else{if(!(C<x[y][0]))return!0;v=y-1}return!1})(b,f)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,C){let x=this.wcwidth(b),y=x===0&&C!==0;if(y){const _=d.UnicodeService.extractWidth(C);_===0?y=!1:_>x&&(x=_)}return d.UnicodeService.createPropertyValue(0,x,y)}}},5981:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const d=c(8460),p=c(844);class f extends p.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(C)}_innerWrite(b=0,C=!0){const x=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],_=this._action(y,C);if(_){const S=E=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(x,E);return void _.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(S)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=y.length,Date.now()-x>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=f},5941:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function p(f,g){const b=f.toString(16),C=b.length<2?"0"+b:b;switch(g){case 4:return b[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}a.parseColor=function(f){if(!f)return;let g=f.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const b=c.exec(g);if(b){const C=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/C*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/C*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/C*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const b=g.length/3,C=[0,0,0];for(let x=0;x<3;++x){const y=parseInt(g.slice(b*x,b*x+b),16);C[x]=b===1?y<<4:b===2?y:b===3?y>>4:y>>8}return C}},a.toRgbString=function(f,g=16){const[b,C,x]=f;return`rgb:${p(b,g)}/${p(C,g)}/${p(x,g)}`}},5770:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const d=c(482),p=c(8742),f=c(5770),g=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(C,x){this._handlers[C]===void 0&&(this._handlers[C]=[]);const y=this._handlers[C];return y.push(x),{dispose:()=>{const _=y.indexOf(x);_!==-1&&y.splice(_,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(C,x){if(this.reset(),this._ident=C,this._active=this._handlers[C]||g,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(C,x,y){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(C,x,y);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,x,y))}unhook(C,x=!0){if(this._active.length){let y=!1,_=this._active.length-1,v=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,y=x,v=this._stack.fallThrough,this._stack.paused=!1),!v&&y===!1){for(;_>=0&&(y=this._active[_].unhook(C),y!==!0);_--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,y;_--}for(;_>=0;_--)if(y=this._active[_].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",C);this._active=g,this._ident=0}};const b=new p.Params;b.addParam(0),a.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=b,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():b,this._data="",this._hitLimit=!1}put(C,x,y){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,x,y),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let x=!1;if(this._hitLimit)x=!1;else if(C&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((y=>(this._params=b,this._data="",this._hitLimit=!1,y)));return this._params=b,this._data="",this._hitLimit=!1,x}}},2015:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const d=c(844),p=c(8742),f=c(6242),g=c(6351);class b{constructor(_){this.table=new Uint8Array(_)}setDefault(_,v){this.table.fill(_<<4|v)}add(_,v,S,E){this.table[v<<8|_]=S<<4|E}addMany(_,v,S,E){for(let T=0;T<_.length;T++)this.table[v<<8|_[T]]=S<<4|E}}a.TransitionTable=b;const C=160;a.VT500_TRANSITION_TABLE=(function(){const y=new b(4095),_=Array.apply(null,Array(256)).map(((M,L)=>L)),v=(M,L)=>_.slice(M,L),S=v(32,127),E=v(0,24);E.push(25),E.push.apply(E,v(28,32));const T=v(0,14);let A;for(A in y.setDefault(1,0),y.addMany(S,0,2,0),T)y.addMany([24,26,153,154],A,3,0),y.addMany(v(128,144),A,3,0),y.addMany(v(144,152),A,3,0),y.add(156,A,0,0),y.add(27,A,11,1),y.add(157,A,4,8),y.addMany([152,158,159],A,0,7),y.add(155,A,11,3),y.add(144,A,11,9);return y.addMany(E,0,3,0),y.addMany(E,1,3,1),y.add(127,1,0,1),y.addMany(E,8,0,8),y.addMany(E,3,3,3),y.add(127,3,0,3),y.addMany(E,4,3,4),y.add(127,4,0,4),y.addMany(E,6,3,6),y.addMany(E,5,3,5),y.add(127,5,0,5),y.addMany(E,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(S,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(v(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(S,7,0,7),y.addMany(E,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(v(64,127),3,7,0),y.addMany(v(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(v(48,60),4,8,4),y.addMany(v(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(v(32,64),6,0,6),y.add(127,6,0,6),y.addMany(v(64,127),6,0,0),y.addMany(v(32,48),3,9,5),y.addMany(v(32,48),5,9,5),y.addMany(v(48,64),5,0,6),y.addMany(v(64,127),5,7,0),y.addMany(v(32,48),4,9,5),y.addMany(v(32,48),1,9,2),y.addMany(v(32,48),2,9,2),y.addMany(v(48,127),2,10,0),y.addMany(v(48,80),1,10,0),y.addMany(v(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(v(96,127),1,10,0),y.add(80,1,11,9),y.addMany(E,9,0,9),y.add(127,9,0,9),y.addMany(v(28,32),9,0,9),y.addMany(v(32,48),9,9,12),y.addMany(v(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(E,11,0,11),y.addMany(v(32,128),11,0,11),y.addMany(v(28,32),11,0,11),y.addMany(E,10,0,10),y.add(127,10,0,10),y.addMany(v(28,32),10,0,10),y.addMany(v(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(v(32,48),10,9,12),y.addMany(E,12,0,12),y.add(127,12,0,12),y.addMany(v(28,32),12,0,12),y.addMany(v(32,48),12,9,12),y.addMany(v(48,64),12,0,11),y.addMany(v(64,127),12,12,13),y.addMany(v(64,127),10,12,13),y.addMany(v(64,127),9,12,13),y.addMany(E,13,13,13),y.addMany(S,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(C,0,2,0),y.add(C,8,5,8),y.add(C,6,0,6),y.add(C,11,0,11),y.add(C,13,13,13),y})();class x extends d.Disposable{constructor(_=a.VT500_TRANSITION_TABLE){super(),this._transitions=_,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(v,S,E)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,S)=>{},this._escHandlerFb=v=>{},this._errorHandlerFb=v=>v,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,v=[64,126]){let S=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=_.prefix.charCodeAt(0),S&&60>S||S>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<_.intermediates.length;++T){const A=_.intermediates.charCodeAt(T);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=A}}if(_.final.length!==1)throw new Error("final must be a single byte");const E=_.final.charCodeAt(0);if(v[0]>E||E>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return S<<=8,S|=E,S}identToString(_){const v=[];for(;_;)v.push(String.fromCharCode(255&_)),_>>=8;return v.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,v){const S=this._identifier(_,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const E=this._escHandlers[S];return E.push(v),{dispose:()=>{const T=E.indexOf(v);T!==-1&&E.splice(T,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,v){this._executeHandlers[_.charCodeAt(0)]=v}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,v){const S=this._identifier(_);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const E=this._csiHandlers[S];return E.push(v),{dispose:()=>{const T=E.indexOf(v);T!==-1&&E.splice(T,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,v){return this._dcsParser.registerHandler(this._identifier(_),v)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,v){return this._oscParser.registerHandler(_,v)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(_,v,S,E,T){this._parseStack.state=_,this._parseStack.handlers=v,this._parseStack.handlerPos=S,this._parseStack.transition=E,this._parseStack.chunkPos=T}parse(_,v,S){let E,T=0,A=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(S===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const L=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&D>-1){for(;D>=0&&(E=L[D](this._params),E!==!0);D--)if(E instanceof Promise)return this._parseStack.handlerPos=D,E}this._parseStack.handlers=[];break;case 4:if(S===!1&&D>-1){for(;D>=0&&(E=L[D](),E!==!0);D--)if(E instanceof Promise)return this._parseStack.handlerPos=D,E}this._parseStack.handlers=[];break;case 6:if(T=_[this._parseStack.chunkPos],E=this._dcsParser.unhook(T!==24&&T!==26,S),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=_[this._parseStack.chunkPos],E=this._oscParser.end(T!==24&&T!==26,S),E)return E;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let L=M;L<v;++L){switch(T=_[L],A=this._transitions.table[this.currentState<<8|(T<160?T:C)],A>>4){case 2:for(let N=L+1;;++N){if(N>=v||(T=_[N])<32||T>126&&T<C){this._printHandler(_,L,N),L=N-1;break}if(++N>=v||(T=_[N])<32||T>126&&T<C){this._printHandler(_,L,N),L=N-1;break}if(++N>=v||(T=_[N])<32||T>126&&T<C){this._printHandler(_,L,N),L=N-1;break}if(++N>=v||(T=_[N])<32||T>126&&T<C){this._printHandler(_,L,N),L=N-1;break}}break;case 3:this._executeHandlers[T]?this._executeHandlers[T]():this._executeHandlerFb(T),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:L,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const D=this._csiHandlers[this._collect<<8|T];let U=D?D.length-1:-1;for(;U>=0&&(E=D[U](this._params),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(3,D,U,A,L),E;U<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++L<v&&(T=_[L])>47&&T<60);L--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const z=this._escHandlers[this._collect<<8|T];let W=z?z.length-1:-1;for(;W>=0&&(E=z[W](),E!==!0);W--)if(E instanceof Promise)return this._preserveStack(4,z,W,A,L),E;W<0&&this._escHandlerFb(this._collect<<8|T),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|T,this._params);break;case 13:for(let N=L+1;;++N)if(N>=v||(T=_[N])===24||T===26||T===27||T>127&&T<C){this._dcsParser.put(_,L,N),L=N-1;break}break;case 14:if(E=this._dcsParser.unhook(T!==24&&T!==26),E)return this._preserveStack(6,[],0,A,L),E;T===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let N=L+1;;N++)if(N>=v||(T=_[N])<32||T>127&&T<C){this._oscParser.put(_,L,N),L=N-1;break}break;case 6:if(E=this._oscParser.end(T!==24&&T!==26),E)return this._preserveStack(5,[],0,A,L),E;T===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&A}}}a.EscapeSequenceParser=x},6242:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const d=c(5770),p=c(482),f=[];a.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,b){this._handlers[g]===void 0&&(this._handlers[g]=[]);const C=this._handlers[g];return C.push(b),{dispose:()=>{const x=C.indexOf(b);x!==-1&&C.splice(x,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,b,C){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(g,b,C);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,b,C))}start(){this.reset(),this._state=1}put(g,b,C){if(this._state!==3){if(this._state===1)for(;b<C;){const x=g[b++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&C-b>0&&this._put(g,b,C)}}end(g,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,x=this._active.length-1,y=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,C=b,y=this._stack.fallThrough,this._stack.paused=!1),!y&&C===!1){for(;x>=0&&(C=this._active[x].end(g),C!==!0);x--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,C;x--}for(;x>=0;x--)if(C=this._active[x].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",g);this._active=f,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,b,C){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,b,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let b=!1;if(this._hitLimit)b=!1;else if(g&&(b=this._handler(this._data),b instanceof Promise))return b.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,b}}},8742:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class d{static fromArray(f){const g=new d;if(!f.length)return g;for(let b=Array.isArray(f[0])?1:0;b<f.length;++b){const C=f[b];if(Array.isArray(C))for(let x=0;x<C.length;++x)g.addSubParam(C[x]);else g.addParam(C)}return g}constructor(f=32,g=32){if(this.maxLength=f,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let g=0;g<this.length;++g){f.push(this.params[g]);const b=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-b>0&&f.push(Array.prototype.slice.call(this._subParams,b,C))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>c?c:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>c?c:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const g=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const f={};for(let g=0;g<this.length;++g){const b=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-b>0&&(f[g]=this._subParams.slice(b,C))}return f}addDigit(f){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,C=b[g-1];b[g-1]=~C?Math.min(10*C+f,c):f}}a.Params=d},5741:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,d){const p={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(p),d.dispose=()=>this._wrappedAddonDispose(p),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){d=p;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(d,1)}}},8771:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const d=c(3785),p=c(511);a.BufferApiView=class{constructor(f,g){this._buffer=f,this.type=g}init(f){return this._buffer=f,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(f){const g=this._buffer.lines.get(f);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new p.CellData}}},3785:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const d=c(511);a.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,f){if(!(p<0||p>=this._line.length))return f?(this._line.loadCell(p,f),f):this._line.loadCell(p,new d.CellData)}translateToString(p,f,g){return this._line.translateToString(p,f,g)}}},8285:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const d=c(8771),p=c(8460),f=c(844);class g extends f.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=g},7975:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,(p=>d(p.toArray())))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,((p,f)=>d(p,f.toArray())))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(h,a,c){var d=this&&this.__decorate||function(y,_,v,S){var E,T=arguments.length,A=T<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,_,v,S);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(A=(T<3?E(A):T>3?E(_,v,A):E(_,v))||A);return T>3&&A&&Object.defineProperty(_,v,A),A},p=this&&this.__param||function(y,_){return function(v,S){_(v,S,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const f=c(8460),g=c(844),b=c(5295),C=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let x=a.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(y,this))}resize(y,_){this.cols=y,this.rows=_,this.buffers.resize(y,_),this._onResize.fire({cols:y,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,_=!1){const v=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===y.fg&&S.getBg(0)===y.bg||(S=v.getBlankLine(y,_),this._cachedBlankLine=S),S.isWrapped=_;const E=v.ybase+v.scrollTop,T=v.ybase+v.scrollBottom;if(v.scrollTop===0){const A=v.lines.isFull;T===v.lines.length-1?A?v.lines.recycle().copyFrom(S):v.lines.push(S.clone()):v.lines.splice(T+1,0,S.clone()),A?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const A=T-E+1;v.lines.shiftElements(E+1,A-1,-1),v.lines.set(T,S.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(y,_,v){const S=this.buffer;if(y<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else y+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const E=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+y,S.ybase),0),E!==S.ydisp&&(_||this._onScroll.fire(S.ydisp))}};a.BufferService=x=d([p(0,C.IOptionsService)],x)},7994:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(h,a,c){var d=this&&this.__decorate||function(S,E,T,A){var M,L=arguments.length,D=L<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,E,T,A);else for(var U=S.length-1;U>=0;U--)(M=S[U])&&(D=(L<3?M(D):L>3?M(E,T,D):M(E,T))||D);return L>3&&D&&Object.defineProperty(E,T,D),D},p=this&&this.__param||function(S,E){return function(T,A){E(T,A,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const f=c(2585),g=c(8460),b=c(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function x(S,E){let T=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(T|=64,T|=S.action):(T|=3&S.button,4&S.button&&(T|=64),8&S.button&&(T|=128),S.action===32?T|=32:S.action!==0||E||(T|=3)),T}const y=String.fromCharCode,_={DEFAULT:S=>{const E=[x(S,!1)+32,S.col+32,S.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${y(E[0])}${y(E[1])}${y(E[2])}`},SGR:S=>{const E=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${x(S,!0)};${S.col};${S.row}${E}`},SGR_PIXELS:S=>{const E=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${x(S,!0)};${S.x};${S.y}${E}`}};let v=a.CoreMouseService=class extends b.Disposable{constructor(S,E){super(),this._bufferService=S,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(C))this.addProtocol(T,C[T]);for(const T of Object.keys(_))this.addEncoding(T,_[T]);this.reset()}addProtocol(S,E){this._protocols[S]=E}addEncoding(S,E){this._encodings[S]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const E=this._encodings[this._activeEncoding](S);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,E,T){if(T){if(S.x!==E.x||S.y!==E.y)return!1}else if(S.col!==E.col||S.row!==E.row)return!1;return S.button===E.button&&S.action===E.action&&S.ctrl===E.ctrl&&S.alt===E.alt&&S.shift===E.shift}};a.CoreMouseService=v=d([p(0,f.IBufferService),p(1,f.ICoreService)],v)},6975:function(h,a,c){var d=this&&this.__decorate||function(v,S,E,T){var A,M=arguments.length,L=M<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,E):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,S,E,T);else for(var D=v.length-1;D>=0;D--)(A=v[D])&&(L=(M<3?A(L):M>3?A(S,E,L):A(S,E))||L);return M>3&&L&&Object.defineProperty(S,E,L),L},p=this&&this.__param||function(v,S){return function(E,T){S(E,T,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const f=c(1439),g=c(8460),b=c(844),C=c(2585),x=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=a.CoreService=class extends b.Disposable{constructor(v,S,E){super(),this._bufferService=v,this._logService=S,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(x),this.decPrivateModes=(0,f.clone)(y)}reset(){this.modes=(0,f.clone)(x),this.decPrivateModes=(0,f.clone)(y)}triggerDataEvent(v,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${v}"`,(()=>v.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(v)}triggerBinaryEvent(v){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${v}"`,(()=>v.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(v))}};a.CoreService=_=d([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],_)},9074:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const d=c(8055),p=c(8460),f=c(844),g=c(6106);let b=0,C=0;class x extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((v=>v?.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(v){if(v.marker.isDisposed)return;const S=new y(v);if(S){const E=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),E.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,S,E){let T=0,A=0;for(const M of this._decorations.getKeyIterator(S))T=M.options.x??0,A=T+(M.options.width??1),v>=T&&v<A&&(!E||(M.options.layer??"bottom")===E)&&(yield M)}forEachDecorationAtCell(v,S,E,T){this._decorations.forEachByKey(S,(A=>{b=A.options.x??0,C=b+(A.options.width??1),v>=b&&v<C&&(!E||(A.options.layer??"bottom")===E)&&T(A)}))}}a.DecorationService=x;class y extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(v){super(),this.options=v,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=v.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const d=c(2585),p=c(8343);class f{constructor(...b){this._entries=new Map;for(const[C,x]of b)this.set(C,x)}set(b,C){const x=this._entries.get(b);return this._entries.set(b,C),x}forEach(b){for(const[C,x]of this._entries.entries())b(C,x)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}a.ServiceCollection=f,a.InstantiationService=class{constructor(){this._services=new f,this._services.set(d.IInstantiationService,this)}setService(g,b){this._services.set(g,b)}getService(g){return this._services.get(g)}createInstance(g,...b){const C=(0,p.getServiceDependencies)(g).sort(((_,v)=>_.index-v.index)),x=[];for(const _ of C){const v=this._services.get(_.id);if(!v)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${_.id}.`);x.push(v)}const y=C.length>0?C[0].index:b.length;if(b.length!==y)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${y+1} conflicts with ${b.length} static arguments`);return new g(...b,...x)}}},7866:function(h,a,c){var d=this&&this.__decorate||function(y,_,v,S){var E,T=arguments.length,A=T<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,_,v,S);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(A=(T<3?E(A):T>3?E(_,v,A):E(_,v))||A);return T>3&&A&&Object.defineProperty(_,v,A),A},p=this&&this.__param||function(y,_){return function(v,S){_(v,S,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const f=c(844),g=c(2585),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let C,x=a.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let _=0;_<y.length;_++)typeof y[_]=="function"&&(y[_]=y[_]())}_log(y,_,v){this._evalLazyOptionalParams(v),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+_,...v)}trace(y,..._){this._logLevel<=g.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,y,_)}debug(y,..._){this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,y,_)}info(y,..._){this._logLevel<=g.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,y,_)}warn(y,..._){this._logLevel<=g.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,y,_)}error(y,..._){this._logLevel<=g.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,y,_)}};a.LogService=x=d([p(0,g.IOptionsService)],x),a.setTraceLogger=function(y){C=y},a.traceCall=function(y,_,v){if(typeof v.value!="function")throw new Error("not supported");const S=v.value;v.value=function(...E){if(C.logLevel!==g.LogLevelEnum.TRACE)return S.apply(this,E);C.trace(`GlyphRenderer#${S.name}(${E.map((A=>JSON.stringify(A))).join(", ")})`);const T=S.apply(this,E);return C.trace(`GlyphRenderer#${S.name} return`,T),T}}},7302:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const d=c(8460),p=c(844),f=c(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends p.Disposable{constructor(x){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...a.DEFAULT_OPTIONS};for(const _ in x)if(_ in y)try{const v=x[_];y[_]=this._sanitizeAndValidateOption(_,v)}catch(v){console.error(v)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,y){return this.onOptionChange((_=>{_===x&&y(this.rawOptions[x])}))}onMultipleOptionChange(x,y){return this.onOptionChange((_=>{x.indexOf(_)!==-1&&y()}))}_setupOptions(){const x=_=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},y=(_,v)=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);v=this._sanitizeAndValidateOption(_,v),this.rawOptions[_]!==v&&(this.rawOptions[_]=v,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const v={get:x.bind(this,_),set:y.bind(this,_)};Object.defineProperty(this.options,_,v)}}_sanitizeAndValidateOption(x,y){switch(x){case"cursorStyle":if(y||(y=a.DEFAULT_OPTIONS[x]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${x}`);break;case"wordSeparator":y||(y=a.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=g.includes(y)?y:a.DEFAULT_OPTIONS[x];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${x} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${x} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}a.OptionsService=b},2660:function(h,a,c){var d=this&&this.__decorate||function(b,C,x,y){var _,v=arguments.length,S=v<3?C:y===null?y=Object.getOwnPropertyDescriptor(C,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(b,C,x,y);else for(var E=b.length-1;E>=0;E--)(_=b[E])&&(S=(v<3?_(S):v>3?_(C,x,S):_(C,x))||S);return v>3&&S&&Object.defineProperty(C,x,S),S},p=this&&this.__param||function(b,C){return function(x,y){C(x,y,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const f=c(2585);let g=a.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const C=this._bufferService.buffer;if(b.id===void 0){const E=C.addMarker(C.ybase+C.y),T={data:b,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(T,E))),this._dataByLinkId.set(T.id,T),T.id}const x=b,y=this._getEntryIdKey(x),_=this._entriesWithId.get(y);if(_)return this.addLineToLink(_.id,C.ybase+C.y),_.id;const v=C.addMarker(C.ybase+C.y),S={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(S,v))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(b,C){const x=this._dataByLinkId.get(b);if(x&&x.lines.every((y=>y.line!==C))){const y=this._bufferService.buffer.addMarker(C);x.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(x,y)))}}getLinkData(b){return this._dataByLinkId.get(b)?.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,C){const x=b.lines.indexOf(C);x!==-1&&(b.lines.splice(x,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};a.OscLinkService=g=d([p(0,f.IBufferService)],g)},8343:(h,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",d="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(p){return p[d]||[]},a.createDecorator=function(p){if(a.serviceRegistry.has(p))return a.serviceRegistry.get(p);const f=function(g,b,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,y,_){y[c]===y?y[d].push({id:x,index:_}):(y[d]=[{id:x,index:_}],y[c]=y)})(f,g,C)};return f.toString=()=>p,a.serviceRegistry.set(p,f),f}},2585:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const d=c(8343);var p;a.IBufferService=(0,d.createDecorator)("BufferService"),a.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),a.ICoreService=(0,d.createDecorator)("CoreService"),a.ICharsetService=(0,d.createDecorator)("CharsetService"),a.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(p||(a.LogLevelEnum=p={})),a.ILogService=(0,d.createDecorator)("LogService"),a.IOptionsService=(0,d.createDecorator)("OptionsService"),a.IOscLinkService=(0,d.createDecorator)("OscLinkService"),a.IUnicodeService=(0,d.createDecorator)("UnicodeService"),a.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(h,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const d=c(8460),p=c(225);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,C,x=!1){return(16777215&b)<<3|(3&C)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new p.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let C=0,x=0;const y=b.length;for(let _=0;_<y;++_){let v=b.charCodeAt(_);if(55296<=v&&v<=56319){if(++_>=y)return C+this.wcwidth(v);const T=b.charCodeAt(_);56320<=T&&T<=57343?v=1024*(v-55296)+T-56320+65536:C+=this.wcwidth(T)}const S=this.charProperties(v,x);let E=f.extractWidth(S);f.extractShouldJoin(S)&&(E-=f.extractWidth(x)),C+=E,x=S}return C}charProperties(b,C){return this._activeProvider.charProperties(b,C)}}a.UnicodeService=f}},s={};function o(h){var a=s[h];if(a!==void 0)return a.exports;var c=s[h]={exports:{}};return n[h].call(c.exports,c,c.exports,o),c.exports}var u={};return(()=>{var h=u;Object.defineProperty(h,"__esModule",{value:!0}),h.Terminal=void 0;const a=o(9042),c=o(3236),d=o(844),p=o(5741),f=o(8285),g=o(7975),b=o(7090),C=["cols","rows"];class x extends d.Disposable{constructor(_){super(),this._core=this.register(new c.Terminal(_)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const v=E=>this._core.options[E],S=(E,T)=>{this._checkReadonlyOptions(E),this._core.options[E]=T};for(const E in this._core.options){const T={get:v.bind(this,E),set:S.bind(this,E)};Object.defineProperty(this._publicOptions,E,T)}}_checkReadonlyOptions(_){if(C.includes(_))throw new Error(`Option "${_}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=this._core.coreService.decPrivateModes;let v="none";switch(this._core.coreMouseService.activeProtocol){case"X10":v="x10";break;case"VT200":v="vt200";break;case"DRAG":v="drag";break;case"ANY":v="any"}return{applicationCursorKeysMode:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const v in _)this._publicOptions[v]=_[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,v=!0){this._core.input(_,v)}resize(_,v){this._verifyIntegers(_,v),this._core.resize(_,v)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,v,S){this._verifyIntegers(_,v,S),this._core.select(_,v,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,v){this._verifyIntegers(_,v),this._core.selectLines(_,v)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,v){this._core.write(_,v)}writeln(_,v){this._core.write(_),this._core.write(`\r
29
+ `,v)}paste(_){this._core.paste(_)}refresh(_,v){this._verifyIntegers(_,v),this._core.refresh(_,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return a}_verifyIntegers(..._){for(const v of _)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const v of _)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}h.Terminal=x})(),u})()))})(hv)),hv.exports}var yk=i7(),pv={exports:{}},PC;function o7(){return PC||(PC=1,(function(e,t){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={};return(()=>{var s=n;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const u=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(u._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,u=o._renderService.dimensions;if(u.css.cell.width===0||u.css.cell.height===0)return;const h=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),d=Math.max(0,parseInt(a.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),f=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),g=d-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-h;return{cols:Math.max(2,Math.floor(g/u.css.cell.width)),rows:Math.max(1,Math.floor(f/u.css.cell.height))}}}})(),n})()))})(pv)),pv.exports}var bk=o7(),mv={exports:{}},IC;function a7(){return IC||(IC=1,(function(e,t){(function(n,s){e.exports=s()})(self,(()=>(()=>{var n={6:(h,a)=>{function c(p){try{const f=new URL(p),g=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return p.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(p,f,g,b={}){this._terminal=p,this._regex=f,this._handler=g,this._options=b}provideLinks(p,f){const g=d.computeLink(p,this._regex,this._terminal,this._handler);f(this._addCallbacks(g))}_addCallbacks(p){return p.map((f=>(f.leave=this._options.leave,f.hover=(g,b)=>{if(this._options.hover){const{range:C}=f;this._options.hover(g,b,C)}},f)))}};class d{static computeLink(f,g,b,C){const x=new RegExp(g.source,(g.flags||"")+"g"),[y,_]=d._getWindowedLineStrings(f-1,b),v=y.join("");let S;const E=[];for(;S=x.exec(v);){const T=S[0];if(!c(T))continue;const[A,M]=d._mapStrIdx(b,_,0,S.index),[L,D]=d._mapStrIdx(b,A,M,T.length);if(A===-1||M===-1||L===-1||D===-1)continue;const U={start:{x:M+1,y:A+1},end:{x:D,y:L+1}};E.push({range:U,text:T,activate:C})}return E}static _getWindowedLineStrings(f,g){let b,C=f,x=f,y=0,_="";const v=[];if(b=g.buffer.active.getLine(f)){const S=b.translateToString(!0);if(b.isWrapped&&S[0]!==" "){for(y=0;(b=g.buffer.active.getLine(--C))&&y<2048&&(_=b.translateToString(!0),y+=_.length,v.push(_),b.isWrapped&&_.indexOf(" ")===-1););v.reverse()}for(v.push(S),y=0;(b=g.buffer.active.getLine(++x))&&b.isWrapped&&y<2048&&(_=b.translateToString(!0),y+=_.length,v.push(_),_.indexOf(" ")===-1););}return[v,C]}static _mapStrIdx(f,g,b,C){const x=f.buffer.active,y=x.getNullCell();let _=b;for(;C;){const v=x.getLine(g);if(!v)return[-1,-1];for(let S=_;S<v.length;++S){v.getCell(S,y);const E=y.getChars();if(y.getWidth()&&(C-=E.length||1,S===v.length-1&&E==="")){const T=x.getLine(g+1);T&&T.isWrapped&&(T.getCell(0,y),y.getWidth()===2&&(C+=1))}if(C<0)return[g,S]}g++,_=0}return[g,_]}}a.LinkComputer=d}},s={};function o(h){var a=s[h];if(a!==void 0)return a.exports;var c=s[h]={exports:{}};return n[h](c,c.exports,o),c.exports}var u={};return(()=>{var h=u;Object.defineProperty(h,"__esModule",{value:!0}),h.WebLinksAddon=void 0;const a=o(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(p,f){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}h.WebLinksAddon=class{constructor(p=d,f={}){this._handler=p,this._options=f}activate(p){this._terminal=p;const f=this._options,g=f.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,g,this._handler,f))}dispose(){this._linkProvider?.dispose()}}})(),u})()))})(mv)),mv.exports}var Sk=a7();function l7({className:e,onReady:t,onResize:n,onContainerReady:s}){const o=k.useRef(null),u=k.useRef(null),h=k.useRef(null),a=k.useRef(n),{setTerminalFocused:c}=I0();k.useEffect(()=>{a.current=n},[n]);const d=k.useCallback(()=>{if(!h.current||!u.current)return;h.current.fit();const{cols:f,rows:g}=u.current;a.current?.(f,g)},[]);k.useEffect(()=>{if(!o.current||u.current)return;const f=new yk.Terminal({cursorBlink:!0,fontSize:13,fontFamily:"JetBrains Mono Variable, Menlo, Monaco, monospace",lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}}),g=new bk.FitAddon,b=new Sk.WebLinksAddon;f.loadAddon(g),f.loadAddon(b),f.open(o.current),u.current=f,h.current=g,requestAnimationFrame(()=>{d(),t?.(f),o.current&&s?.(o.current)});const C=()=>c(!0),x=()=>c(!1);f.textarea&&(f.textarea.addEventListener("focus",C),f.textarea.addEventListener("blur",x));const y=setTimeout(()=>{d(),f.refresh(0,f.rows-1)},100),_=()=>{requestAnimationFrame(d)};window.addEventListener("resize",_);const v=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{d(),f.refresh(0,f.rows-1)})};document.addEventListener("visibilitychange",v);const S=new ResizeObserver(_);S.observe(o.current);const E=new IntersectionObserver(T=>{T[0]?.isIntersecting&&requestAnimationFrame(()=>{d(),f.refresh(0,f.rows-1)})},{threshold:.1});return E.observe(o.current),()=>{clearTimeout(y),window.removeEventListener("resize",_),document.removeEventListener("visibilitychange",v),S.disconnect(),E.disconnect(),f.textarea&&(f.textarea.removeEventListener("focus",C),f.textarea.removeEventListener("blur",x)),c(!1),f.dispose(),u.current=null,h.current=null}},[d,t,s,c]);const p=k.useCallback(()=>{u.current?.scrollToBottom()},[]);return w.jsxs("div",{className:"relative h-full w-full",children:[w.jsx("div",{ref:o,className:Be("h-full w-full overflow-hidden bg-[#0a0a0a] p-2",e)}),w.jsx("button",{onClick:p,className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:w.jsx(Ee,{icon:O2,size:20,strokeWidth:2})})]})}function c7({name:e,status:t,exitCode:n,className:s,onRename:o}){const[u,h]=k.useState(!1),[a,c]=k.useState(e),d=k.useRef(null);k.useEffect(()=>{u&&d.current&&(d.current.focus(),d.current.select())},[u]);const p=()=>{o&&(c(e),h(!0))},f=()=>{const b=a.trim();b&&b!==e&&o&&o(b),h(!1)},g=b=>{b.key==="Enter"?f():b.key==="Escape"&&h(!1)};return w.jsxs("div",{className:Be("flex h-6 items-center gap-2 border-b border-border bg-card px-2 text-xs",s),children:[w.jsx("span",{className:Be("h-2 w-2 shrink-0 rounded-full",{"bg-green-500":t==="running","bg-zinc-500":t==="exited"&&n===0,"bg-red-500":t==="exited"&&n!==0,"bg-yellow-500":t==="error"})}),u?w.jsx("input",{ref:d,type:"text",value:a,onChange:b=>c(b.target.value),onBlur:f,onKeyDown:g,className:"h-4 w-24 rounded border border-border bg-background px-1 text-xs font-medium text-foreground outline-none focus:border-primary"}):w.jsx("span",{className:Be("font-medium text-foreground",o&&"cursor-pointer hover:text-primary"),onDoubleClick:p,title:o?"Double-click to rename":void 0,children:e}),t==="exited"&&n!==void 0&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"ml-auto text-muted-foreground",children:"·"}),w.jsxs("span",{className:Be({"text-muted-foreground":n===0,"text-red-400":n!==0}),children:["exit ",n]})]})]})}const u7="";function xk(){return jn({mutationFn:async e=>{const t=await fetch(`${u7}/api/git/sync`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Sync failed")}return t.json()}})}const d7="";function Ck(){return jn({mutationFn:async e=>{const t=await fetch(`${d7}/api/git/merge-to-main`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Merge failed")}return t.json()}})}const f7="";function wk(){return jn({mutationFn:async e=>{const t=await fetch(`${f7}/api/git/sync-parent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Sync parent failed")}return t.json()}})}function h7({repoPath:e,worktreePath:t,baseBranch:n,taskId:s}){const o=xk(),u=Ck(),h=wk(),a=A0(),c=async()=>{try{await o.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),Ar.success("Synced from main")}catch(f){const g=f instanceof Error?f.message:"Sync failed";Ar.error(g)}},d=async()=>{try{await u.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),Ar.success("Merged to main"),a.mutate({taskId:s,updates:{status:"DONE"}})}catch(f){const g=f instanceof Error?f.message:"Merge failed";Ar.error(g)}},p=async()=>{try{await h.mutateAsync({repoPath:e,baseBranch:n}),Ar.success("Parent synced with origin")}catch(f){const g=f instanceof Error?f.message:"Sync parent failed";Ar.error(g)}};return w.jsxs(w.Fragment,{children:[w.jsx(Ve,{variant:"ghost",size:"icon-xs",onClick:c,disabled:o.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Pull from main",children:w.jsx(Ee,{icon:A2,size:12,strokeWidth:2,className:o.isPending?"animate-spin":""})}),w.jsx(Ve,{variant:"ghost",size:"icon-xs",onClick:d,disabled:u.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Merge to main",children:w.jsx(Ee,{icon:P2,size:12,strokeWidth:2,className:u.isPending?"animate-pulse":""})}),w.jsx(Ve,{variant:"ghost",size:"icon-xs",onClick:p,disabled:h.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:w.jsx(Ee,{icon:H2,size:12,strokeWidth:2,className:h.isPending?"animate-spin":""})})]})}function p7({terminal:e,taskInfo:t,onClose:n,onReady:s,onResize:o,onRename:u,onContainerReady:h}){return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:[t?w.jsxs("div",{className:"flex flex-1 items-center gap-2 px-2 py-1",children:[w.jsxs(rr,{to:"/tasks/$taskId",params:{taskId:t.taskId},className:"flex items-center gap-1.5 rounded px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 truncate",children:[w.jsx(Ee,{icon:U_,size:14,strokeWidth:2,className:"shrink-0"}),w.jsx("span",{className:"truncate",children:t.title})]}),w.jsx(rr,{to:t.repoId?"/repositories/$repoId":"/repositories",params:t.repoId?{repoId:t.repoId}:void 0,className:"text-xs font-medium text-foreground shrink-0 cursor-pointer hover:underline",children:t.repoName}),e.cwd&&w.jsx("span",{className:"text-xs text-muted-foreground truncate",children:e.cwd.split("/").pop()}),w.jsx("div",{className:"ml-auto flex items-center gap-0.5",children:w.jsx(h7,{repoPath:t.repoPath,worktreePath:t.worktreePath,baseBranch:t.baseBranch,taskId:t.taskId})})]}):w.jsx(c7,{name:e.name,status:e.status,exitCode:e.exitCode,className:"flex-1 border-b-0",onRename:u}),n&&w.jsx(Ve,{variant:"ghost",size:"icon-xs",onClick:n,className:"mr-1 h-5 w-5 text-muted-foreground hover:text-foreground",children:w.jsx(Ee,{icon:ho,size:12,strokeWidth:2})})]}),w.jsx("div",{className:"flex-1",children:w.jsx(l7,{onReady:s,onResize:o,onContainerReady:h})})]})}function m7({onAdd:e}){return w.jsx("div",{className:"flex h-full items-center justify-center bg-[#0a0a0a]",children:e?w.jsxs(Ve,{variant:"outline",size:"sm",onClick:e,className:"gap-2",children:[w.jsx(Ee,{icon:ql,size:14,strokeWidth:2}),"New Terminal"]}):w.jsx("p",{className:"text-xs text-muted-foreground",children:"No terminals"})})}function g7(e){return e<=1?{rows:1,cols:1}:e<=2?{rows:1,cols:2}:e<=4?{rows:2,cols:2}:e<=6?{rows:2,cols:3}:e<=9?{rows:3,cols:3}:{rows:3,cols:4}}function v7({terminals:e,onTerminalClose:t,onTerminalAdd:n,onTerminalReady:s,onTerminalResize:o,onTerminalRename:u,onTerminalContainerReady:h,taskInfoByCwd:a}){if(e.length===0)return w.jsx(m7,{onAdd:n});const{rows:c,cols:d}=g7(e.length),p=[];for(let g=0;g<c;g++){const b=g*d,C=Math.min(b+d,e.length);b<e.length&&p.push(e.slice(b,C))}const f=g=>w.jsx(p7,{terminal:g,taskInfo:g.cwd?a?.get(g.cwd):void 0,onClose:t?()=>t(g.id):void 0,onReady:s?b=>s(g.id,b):void 0,onResize:o?(b,C)=>o(g.id,b,C):void 0,onRename:u?b=>u(g.id,b):void 0,onContainerReady:h?b=>h(g.id,b):void 0});return e.length===1?w.jsx("div",{className:"h-full",children:f(e[0])}):e.length===2?w.jsxs($o,{direction:"horizontal",className:"h-full",children:[w.jsx(Xr,{defaultSize:50,minSize:15,children:f(e[0])},e[0].id),w.jsx(Ko,{}),w.jsx(Xr,{defaultSize:50,minSize:15,children:f(e[1])},e[1].id)]}):e.length===3?w.jsxs($o,{direction:"horizontal",className:"h-full",children:[w.jsx(Xr,{defaultSize:50,minSize:15,children:f(e[0])},e[0].id),w.jsx(Ko,{}),w.jsx(Xr,{defaultSize:50,minSize:15,children:w.jsxs($o,{direction:"vertical",className:"h-full",children:[w.jsx(Xr,{defaultSize:50,minSize:15,children:f(e[1])},e[1].id),w.jsx(Ko,{}),w.jsx(Xr,{defaultSize:50,minSize:15,children:f(e[2])},e[2].id)]})})]}):w.jsx($o,{direction:"vertical",className:"h-full",children:p.map((g,b)=>w.jsxs(k.Fragment,{children:[b>0&&w.jsx(Ko,{}),w.jsx(Xr,{defaultSize:100/p.length,minSize:15,children:g.length===1?f(g[0]):w.jsx($o,{direction:"horizontal",className:"h-full",children:g.map((C,x)=>w.jsxs(k.Fragment,{children:[x>0&&w.jsx(Ko,{}),w.jsx(Xr,{defaultSize:100/d,minSize:15,children:f(C)})]},C.id))})})]},`row-${b}`))})}function _7({tabs:e,activeTabId:t,onTabSelect:n,onTabClose:s,onTabCreate:o,onTabRename:u}){const[h,a]=k.useState(null),[c,d]=k.useState(""),p=k.useRef(null);k.useEffect(()=>{h&&p.current&&(p.current.focus(),p.current.select())},[h]);const f=C=>{a(C.id),d(C.name)},g=()=>{h&&c.trim()&&u(h,c.trim()),a(null)},b=C=>{C.key==="Enter"?g():C.key==="Escape"&&a(null)};return w.jsxs("div",{className:"flex items-center gap-1",children:[e.map(C=>w.jsx("button",{onClick:()=>n(C.id),onDoubleClick:()=>f(C),className:Be("group relative flex items-center gap-1.5 rounded-t-md border-x border-t px-3 py-1.5 text-xs transition-colors",C.id===t?"border-border bg-background text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:h===C.id?w.jsxs("div",{className:"flex items-center gap-1",children:[w.jsx(Kt,{ref:p,value:c,onChange:x=>d(x.target.value),onBlur:g,onKeyDown:b,className:"h-5 w-20 px-1 text-xs"}),w.jsx(Ve,{variant:"ghost",size:"icon-xs",onClick:g,className:"h-4 w-4",children:w.jsx(Ee,{icon:J3,size:12,strokeWidth:2})})]}):w.jsxs(w.Fragment,{children:[C.name,e.length>1&&w.jsx("button",{onClick:x=>{x.stopPropagation(),s(C.id)},className:"ml-1 rounded opacity-0 hover:bg-muted group-hover:opacity-100",children:w.jsx(Ee,{icon:ho,size:12,strokeWidth:2})})]})},C.id)),w.jsx(Ve,{variant:"ghost",size:"icon-xs",onClick:o,className:"ml-1",children:w.jsx(Ee,{icon:ql,size:14,strokeWidth:2})})]})}async function y7(e){const t=new FormData;t.append("file",e);const n=await fetch("/api/uploads",{method:"POST",body:t});if(!n.ok)throw new Error("Failed to upload image");return(await n.json()).path}function b7(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}function V0(e={}){const{url:t=b7(),reconnectInterval:n=2e3,maxReconnectAttempts:s=10}=e,[o,u]=k.useState([]),[h,a]=k.useState(!1),[c,d]=k.useState([]),[p,f]=k.useState(!1),g=k.useRef(null),b=k.useRef(0),C=k.useRef(void 0),x=k.useRef(new Map),y=k.useRef(new Set),_=k.useRef(()=>{}),v=k.useCallback(q=>{g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify(q))},[]),S=k.useCallback(q=>{try{const H=JSON.parse(q.data);switch(H.type){case"terminals:list":u(H.payload.terminals),a(!0);break;case"terminal:created":u(P=>[...P,H.payload.terminal]),H.payload.isNew&&y.current.add(H.payload.terminal.id);break;case"terminal:output":{const P=x.current.get(H.payload.terminalId);P&&P.write(H.payload.data);break}case"terminal:attached":{const P=x.current.get(H.payload.terminalId);P&&H.payload.buffer&&P.write(H.payload.buffer);break}case"terminal:exit":u(P=>P.map(B=>B.id===H.payload.terminalId?{...B,status:"exited",exitCode:H.payload.exitCode}:B));break;case"terminal:error":console.error("Terminal error:",H.payload.error);break;case"terminal:renamed":u(P=>P.map(B=>B.id===H.payload.terminalId?{...B,name:H.payload.name}:B));break;case"terminal:destroyed":x.current.delete(H.payload.terminalId),u(P=>P.filter(B=>B.id!==H.payload.terminalId));break;case"terminal:tabAssigned":u(P=>P.map(B=>B.id===H.payload.terminalId?{...B,tabId:H.payload.tabId??void 0,positionInTab:H.payload.positionInTab}:B));break;case"tabs:list":d(H.payload.tabs);break;case"tab:created":d(P=>[...P,H.payload.tab].sort((B,I)=>B.position-I.position));break;case"tab:renamed":d(P=>P.map(B=>B.id===H.payload.tabId?{...B,name:H.payload.name}:B));break;case"tab:deleted":d(P=>P.filter(B=>B.id!==H.payload.tabId));break;case"tab:reordered":d(P=>P.map(B=>B.id===H.payload.tabId?{...B,position:H.payload.position}:B).sort((B,I)=>B.position-I.position));break}}catch(H){console.error("Failed to parse WebSocket message:",H)}},[]),E=k.useCallback(()=>{const q=g.current;if(q&&(q.readyState===WebSocket.CONNECTING||q.readyState===WebSocket.OPEN))return;const H=new WebSocket(t);g.current=H,H.onopen=()=>{f(!0),b.current=0},H.onmessage=S,H.onclose=()=>{f(!1),a(!1),g.current===H&&(g.current=null),b.current<s&&(b.current++,C.current=setTimeout(()=>_.current(),n))},H.onerror=()=>{}},[t,n,s,S]);_.current=E,k.useEffect(()=>(E(),()=>{C.current&&clearTimeout(C.current),g.current&&(g.current.close(),g.current=null)}),[E]);const T=k.useCallback(q=>{v({type:"terminal:create",payload:q})},[v]),A=k.useCallback(q=>{v({type:"terminal:destroy",payload:{terminalId:q}}),x.current.delete(q),u(H=>H.filter(P=>P.id!==q))},[v]),M=k.useCallback((q,H)=>{v({type:"terminal:input",payload:{terminalId:q,data:H}})},[v]),L=k.useCallback((q,H,P)=>{v({type:"terminal:resize",payload:{terminalId:q,cols:H,rows:P}})},[v]),D=k.useCallback((q,H)=>{v({type:"terminal:rename",payload:{terminalId:q,name:H}})},[v]),U=k.useCallback((q,H,P)=>{v({type:"terminal:assignTab",payload:{terminalId:q,tabId:H,positionInTab:P}})},[v]),z=k.useCallback((q,H)=>{v({type:"tab:create",payload:{name:q,position:H}})},[v]),W=k.useCallback((q,H)=>{v({type:"tab:rename",payload:{tabId:q,name:H}})},[v]),N=k.useCallback(q=>{v({type:"tab:delete",payload:{tabId:q}})},[v]),Y=k.useCallback((q,H)=>{v({type:"tab:reorder",payload:{tabId:q,position:H}})},[v]),$=k.useCallback((q,H)=>{x.current.set(q,H);const P=H.onData(B=>{M(q,B)});return v({type:"terminal:attach",payload:{terminalId:q}}),()=>{P.dispose(),x.current.delete(q)}},[v,M]),F=k.useCallback((q,H)=>{const P=async B=>{const I=B.clipboardData?.items;if(I){for(const G of I)if(G.type.startsWith("image/")){B.preventDefault(),B.stopPropagation();const K=G.getAsFile();if(!K)return;try{const J=await y7(K);M(H,J)}catch(J){console.error("Failed to upload image:",J)}return}}};return q.addEventListener("paste",P,!0),()=>{q.removeEventListener("paste",P,!0)}},[M]);return{terminals:o,terminalsLoaded:h,tabs:c,connected:p,newTerminalIds:y.current,createTerminal:T,destroyTerminal:A,writeToTerminal:M,resizeTerminal:L,renameTerminal:D,assignTerminalToTab:U,createTab:z,renameTab:W,deleteTab:N,reorderTab:Y,attachXterm:$,setupImagePaste:F}}const Es="all-tasks",NC=["IN_PROGRESS","IN_REVIEW"],S7=Ns("/terminals/")({component:x7});function x7(){const{terminals:e,tabs:t,connected:n,createTerminal:s,destroyTerminal:o,renameTerminal:u,assignTerminalToTab:h,createTab:a,renameTab:c,deleteTab:d,attachXterm:p,resizeTerminal:f,setupImagePaste:g}=V0(),{activeTabId:b,setActiveTab:C,isLoading:x}=ek();k.useEffect(()=>{if(t.length>0&&!x){const Z=t.map(ee=>ee.id);(!b||!Z.includes(b)&&b!==Es)&&C(t[0].id)}},[t,b,x,C]);const{data:y=[]}=L0(),{data:_=[]}=D0(),{data:v}=O0(),[S,E]=k.useState(null),T=k.useMemo(()=>{const Z=new Map;for(const ee of _)Z.set(ee.path,ee.id);return Z},[_]),A=k.useMemo(()=>new Set(y.filter(Z=>NC.includes(Z.status)&&Z.worktreePath).map(Z=>Z.worktreePath)),[y]),M=k.useMemo(()=>new Set(y.filter(Z=>Z.worktreePath).map(Z=>Z.worktreePath)),[y]),L=k.useMemo(()=>{const Z=new Map;for(const ee of y)ee.worktreePath&&Z.set(ee.worktreePath,{taskId:ee.id,repoId:T.get(ee.repoPath),repoName:ee.repoName,title:ee.title,repoPath:ee.repoPath,worktreePath:ee.worktreePath,baseBranch:ee.baseBranch,branch:ee.branch});return Z},[y,T]),D=k.useMemo(()=>{const Z=new Set(y.filter(ee=>NC.includes(ee.status)).map(ee=>ee.repoName));return Array.from(Z).sort()},[y]),U=k.useRef(new Map),z=k.useRef(new Map),W=k.useRef(new Map),N=k.useRef(0);k.useEffect(()=>{if(v)for(const Z of e){const ee=Z.cwd?.startsWith(v),X=Z.cwd&&M.has(Z.cwd);ee&&!X&&o(Z.id)}},[e,M,v,o]);const Y=k.useMemo(()=>b===Es?e.filter(Z=>Z.cwd&&A.has(Z.cwd)).filter(Z=>S?y.find(X=>X.worktreePath===Z.cwd)?.repoName===S:!0).sort((Z,ee)=>{const X=y.find(se=>se.worktreePath===Z.cwd),V=y.find(se=>se.worktreePath===ee.cwd);return!X||!V?0:new Date(V.createdAt).getTime()-new Date(X.createdAt).getTime()}):e.filter(Z=>Z.tabId===b).sort((Z,ee)=>(Z.positionInTab??0)-(ee.positionInTab??0)),[b,e,A,S,y]),$=k.useCallback(()=>{N.current++;const ee=e.filter(X=>X.tabId===b).length;s({name:`Terminal ${N.current}`,cols:80,rows:24,tabId:b??void 0,positionInTab:ee})},[s,b,e]);k.useEffect(()=>{for(const Z of e)Z.cwd&&M.has(Z.cwd)&&Z.tabId&&h(Z.id,null)},[e,M,h]);const F=k.useCallback(Z=>{const ee=W.current.get(Z);if(!ee||z.current.has(Z))return;const X=g(ee,Z);z.current.set(Z,X)},[g]),q=k.useCallback(Z=>{const ee=U.current.get(Z);ee&&(ee(),U.current.delete(Z));const X=z.current.get(Z);X&&(X(),z.current.delete(Z)),W.current.delete(Z),o(Z)},[o]),H=k.useCallback((Z,ee)=>{const X=p(Z,ee);U.current.set(Z,X)},[p]),P=k.useCallback((Z,ee)=>{W.current.set(Z,ee),F(Z)},[F]),B=k.useCallback((Z,ee,X)=>{f(Z,ee,X)},[f]),I=k.useCallback((Z,ee)=>{u(Z,ee)},[u]),G=k.useCallback(()=>{const Z=t.length;a(`Tab ${Z+1}`)},[a,t.length]),K=k.useCallback(Z=>{const ee=e.filter(X=>X.tabId===Z);for(const X of ee)q(X.id);d(Z)},[e,d,q]),J=t.map((Z,ee)=>({id:Z.id,name:Z.name,layout:"single",position:ee}));return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-muted/30 px-2 py-1",children:[w.jsx(_7,{tabs:J,activeTabId:b??"",onTabSelect:C,onTabClose:K,onTabCreate:G,onTabRename:c}),w.jsxs("div",{className:"flex items-center gap-3",children:[b===Es&&D.length>1&&w.jsxs(v0,{value:S??"",onValueChange:Z=>E(Z||null),children:[w.jsxs(y0,{size:"sm",className:"min-w-[120px]",children:[w.jsx(Ee,{icon:N2,size:12,strokeWidth:2,className:"text-muted-foreground"}),w.jsx(_0,{children:S||"All Repos"})]}),w.jsxs(b0,{className:"min-w-[200px]",children:[w.jsx(Ru,{value:"",children:"All Repos"}),D.map(Z=>w.jsx(Ru,{value:Z,children:Z},Z))]})]}),w.jsxs("button",{onClick:()=>C(Es),className:Be("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs transition-colors",b===Es?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[w.jsx(Ee,{icon:Sh,size:12,strokeWidth:2}),"Task Terminals"]}),w.jsxs(Ve,{variant:"outline",size:"sm",onClick:$,disabled:!n||e.length>=12||b===Es,children:[w.jsx(Ee,{icon:ql,size:14,strokeWidth:2,"data-slot":"icon"}),"New Terminal"]})]})]}),w.jsx("div",{className:"pixel-grid flex-1 overflow-hidden",children:w.jsx(v7,{terminals:Y,onTerminalClose:b===Es?void 0:q,onTerminalAdd:n&&b!==Es?$:void 0,onTerminalReady:H,onTerminalResize:B,onTerminalRename:b===Es?void 0:I,onTerminalContainerReady:P,taskInfoByCwd:b===Es?L:void 0})})]})}function C7(e){if(Array.isArray(e))return e}function w7(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,o,u,h,a=[],c=!0,d=!1;try{if(u=(n=n.call(e)).next,t!==0)for(;!(c=(s=u.call(n)).done)&&(a.push(s.value),a.length!==t);c=!0);}catch(p){d=!0,o=p}finally{try{if(!c&&n.return!=null&&(h=n.return(),Object(h)!==h))return}finally{if(d)throw o}}return a}}function i_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function Ek(e,t){if(e){if(typeof e=="string")return i_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i_(e,t):void 0}}function E7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rk(e,t){return C7(e)||w7(e,t)||Ek(e,t)||E7()}var gv={},nu={},jC;function kk(){if(jC)return nu;jC=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.bind=void 0;function e(t,n){var s=n.type,o=n.listener,u=n.options;return t.addEventListener(s,o,u),function(){t.removeEventListener(s,o,u)}}return nu.bind=e,nu}var Fo={},BC;function R7(){if(BC)return Fo;BC=1;var e=Fo&&Fo.__assign||function(){return e=Object.assign||function(u){for(var h,a=1,c=arguments.length;a<c;a++){h=arguments[a];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(u[d]=h[d])}return u},e.apply(this,arguments)};Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.bindAll=void 0;var t=kk();function n(u){if(!(typeof u>"u"))return typeof u=="boolean"?{capture:u}:u}function s(u,h){if(h==null)return u;var a=e(e({},u),{options:e(e({},n(h)),n(u.options))});return a}function o(u,h,a){var c=h.map(function(d){var p=s(d,a);return(0,t.bind)(u,p)});return function(){c.forEach(function(p){return p()})}}return Fo.bindAll=o,Fo}var zC;function k7(){return zC||(zC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=kk();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=R7();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})})(gv)),gv}var zl=k7(),Tk="data-pdnd-honey-pot";function Lk(e){return e instanceof Element&&e.hasAttribute(Tk)}function Ak(e){var t=document.elementsFromPoint(e.x,e.y),n=Rk(t,2),s=n[0],o=n[1];return s?Lk(s)?o??null:s:null}function Lu(e){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(e)}function T7(e,t){if(Lu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(Lu(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function L7(e){var t=T7(e,"string");return Lu(t)=="symbol"?t:t+""}function id(e,t,n){return(t=L7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ok=2147483647;function HC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function VC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HC(Object(n),!0).forEach(function(s){id(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HC(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var Au=2,FC=Au/2;function A7(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function O7(e){return{x:e.x-FC,y:e.y-FC}}function M7(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function D7(e){return{x:Math.min(e.x,window.innerWidth-Au),y:Math.min(e.y,window.innerHeight-Au)}}function UC(e){var t=e.client,n=D7(M7(O7(A7(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:Au,height:Au})}function WC(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function P7(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function I7(e){var t=e.initial,n=document.createElement("div");n.setAttribute(Tk,"true");var s=UC({client:t});Object.assign(n.style,VC(VC({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},WC({clientRect:s})),{},{pointerEvents:"auto",zIndex:Ok})),document.body.appendChild(n);var o=zl.bind(window,{type:"pointermove",listener:function(h){var a={x:h.clientX,y:h.clientY};s=UC({client:a}),Object.assign(n.style,WC({clientRect:s}))},options:{capture:!0}});return function(h){var a=h.current;if(o(),P7({client:a,clientRect:s})){n.remove();return}function c(){d(),n.remove()}var d=zl.bindAll(window,[{type:"pointerdown",listener:c},{type:"pointermove",listener:c},{type:"focusin",listener:c},{type:"focusout",listener:c},{type:"dragstart",listener:c},{type:"dragenter",listener:c},{type:"dragover",listener:c}],{capture:!0})}}function N7(){var e=null;function t(){return e=null,zl.bind(window,{type:"pointermove",listener:function(o){e={x:o.clientX,y:o.clientY}},options:{capture:!0}})}function n(){var s=null;return function(u){var h=u.eventName,a=u.payload;if(h==="onDragStart"){var c=a.location.initial.input,d=e??{x:c.clientX,y:c.clientY};s=I7({initial:d})}if(h==="onDrop"){var p,f=a.location.current.input;(p=s)===null||p===void 0||p({current:{x:f.clientX,y:f.clientY}}),s=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function j7(e){if(Array.isArray(e))return i_(e)}function B7(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function z7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mk(e){return j7(e)||B7(e)||Ek(e)||z7()}function Oa(e){var t=null;return function(){if(!t){for(var s=arguments.length,o=new Array(s),u=0;u<s;u++)o[u]=arguments[u];var h=e.apply(this,o);t={result:h}}return t.result}}var H7=Oa(function(){return navigator.userAgent.includes("Firefox")}),od=Oa(function(){var t=navigator,n=t.userAgent;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),o_={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function V7(e){var t=e.dragLeave;return od()?t.hasOwnProperty(o_.isLeavingWindow):!1}(function(){if(typeof window>"u"||!od())return;function t(){return{enterCount:0,isOverWindow:!1}}var n=t();function s(){n=t()}zl.bindAll(window,[{type:"dragstart",listener:function(){n.enterCount=0,n.isOverWindow=!0}},{type:"drop",listener:s},{type:"dragend",listener:s},{type:"dragenter",listener:function(u){!n.isOverWindow&&n.enterCount===0&&(u[o_.isEnteringWindow]=!0),n.isOverWindow=!0,n.enterCount++}},{type:"dragleave",listener:function(u){n.enterCount--,n.isOverWindow&&n.enterCount===0&&(u[o_.isLeavingWindow]=!0,n.isOverWindow=!1)}}],{capture:!0})})();function F7(e){return"nodeName"in e}function U7(e){return F7(e)&&e.ownerDocument!==document}function W7(e){var t=e.dragLeave,n=t.type,s=t.relatedTarget;return n!=="dragleave"?!1:od()?V7({dragLeave:t}):s==null?!0:H7()?U7(s):s instanceof HTMLIFrameElement}function q7(e){var t=e.onDragEnd;return[{type:"pointermove",listener:(function(){var n=0;return function(){if(n<20){n++;return}t()}})()},{type:"pointerdown",listener:t}]}function mu(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var G7=function(t){var n=[],s=null,o=function(){for(var h=arguments.length,a=new Array(h),c=0;c<h;c++)a[c]=arguments[c];n=a,!s&&(s=requestAnimationFrame(function(){s=null,t.apply(void 0,n)}))};return o.cancel=function(){s&&(cancelAnimationFrame(s),s=null)},o},vv=G7(function(e){return e()}),Kf=(function(){var e=null;function t(s){var o=requestAnimationFrame(function(){e=null,s()});e={frameId:o,fn:s}}function n(){e&&(cancelAnimationFrame(e.frameId),e.fn(),e=null)}return{schedule:t,flush:n}})();function $7(e){var t=e.source,n=e.initial,s=e.dispatchEvent,o={dropTargets:[]};function u(a){s(a),o={dropTargets:a.payload.location.current.dropTargets}}var h={start:function(c){var d=c.nativeSetDragImage,p={current:n,previous:o,initial:n};u({eventName:"onGenerateDragPreview",payload:{source:t,location:p,nativeSetDragImage:d}}),Kf.schedule(function(){u({eventName:"onDragStart",payload:{source:t,location:p}})})},dragUpdate:function(c){var d=c.current;Kf.flush(),vv.cancel(),u({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:o,current:d}}})},drag:function(c){var d=c.current;vv(function(){Kf.flush();var p={initial:n,previous:o,current:d};u({eventName:"onDrag",payload:{source:t,location:p}})})},drop:function(c){var d=c.current,p=c.updatedSourcePayload;Kf.flush(),vv.cancel(),u({eventName:"onDrop",payload:{source:p??t,location:{current:d,previous:o,initial:n}}})}};return h}var a_={isActive:!1};function Dk(){return!a_.isActive}function K7(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function Y7(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var s=0;s<t.length;s++)if(t[s].element!==n[s].element)return!0;return!1}function X7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=e.dispatchEvent;if(!Dk())return;var u=Q7({event:t,dragType:n,getDropTargetsOver:s});a_.isActive=!0;var h={current:u};_v({event:t,current:u.dropTargets});var a=$7({source:n.payload,dispatchEvent:o,initial:u});function c(b){var C=Y7({current:h.current.dropTargets,next:b.dropTargets});h.current=b,C&&a.dragUpdate({current:h.current})}function d(b){var C=mu(b),x=Lk(b.target)?Ak({x:C.clientX,y:C.clientY}):b.target,y=s({target:x,input:C,source:n.payload,current:h.current.dropTargets});y.length&&(b.preventDefault(),_v({event:b,current:y})),c({dropTargets:y,input:C})}function p(){h.current.dropTargets.length&&c({dropTargets:[],input:h.current.input}),a.drop({current:h.current,updatedSourcePayload:null}),f()}function f(){a_.isActive=!1,g()}var g=zl.bindAll(window,[{type:"dragover",listener:function(C){d(C),a.drag({current:h.current})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(C){W7({dragLeave:C})&&(c({input:h.current.input,dropTargets:[]}),n.startedFrom==="external"&&p())}},{type:"drop",listener:function(C){if(h.current={dropTargets:h.current.dropTargets,input:mu(C)},!h.current.dropTargets.length){p();return}C.preventDefault(),_v({event:C,current:h.current.dropTargets}),a.drop({current:h.current,updatedSourcePayload:n.type==="external"?n.getDropPayload(C):null}),f()}},{type:"dragend",listener:function(C){h.current={dropTargets:h.current.dropTargets,input:mu(C)},p()}}].concat(Mk(q7({onDragEnd:p}))),{capture:!0});a.start({nativeSetDragImage:K7(t)})}function _v(e){var t,n=e.event,s=e.current,o=(t=s[0])===null||t===void 0?void 0:t.dropEffect;o!=null&&n.dataTransfer&&(n.dataTransfer.dropEffect=o)}function Q7(e){var t=e.event,n=e.dragType,s=e.getDropTargetsOver,o=mu(t);if(n.startedFrom==="external")return{input:o,dropTargets:[]};var u=s({input:o,source:n.payload,target:t.target,current:[]});return{input:o,dropTargets:u}}var qC={canStart:Dk,start:X7},l_=new Map;function Z7(e){var t=e.typeKey,n=e.mount,s=l_.get(t);if(s)return s.usageCount++,s;var o={typeKey:t,unmount:n(),usageCount:1};return l_.set(t,o),o}function J7(e){var t=Z7(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),l_.delete(e.typeKey))}}function xp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(o){return o()})}}function Pk(e,t){var n=t.attribute,s=t.value;return e.setAttribute(n,s),function(){return e.removeAttribute(n)}}function GC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function Zi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GC(Object(n),!0).forEach(function(s){id(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GC(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function yv(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ej(e))||t){n&&(e=n);var s=0,o=function(){};return{s:o,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,h=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var d=n.next();return h=d.done,d},e:function(d){a=!0,u=d},f:function(){try{h||n.return==null||n.return()}finally{if(a)throw u}}}}function ej(e,t){if(e){if(typeof e=="string")return $C(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$C(e,t):void 0}}function $C(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function bv(e){return e.slice(0).reverse()}function tj(e){var t=e.typeKey,n=e.defaultDropEffect,s=new WeakMap,o="data-drop-target-for-".concat(t),u="[".concat(o,"]");function h(b){return s.set(b.element,b),function(){return s.delete(b.element)}}function a(b){var C=xp(Pk(b.element,{attribute:o,value:"true"}),h(b));return Oa(C)}function c(b){var C,x,y,_,v=b.source,S=b.target,E=b.input,T=b.result,A=T===void 0?[]:T;if(S==null)return A;if(!(S instanceof Element))return S instanceof Node?c({source:v,target:S.parentElement,input:E,result:A}):A;var M=S.closest(u);if(M==null)return A;var L=s.get(M);if(L==null)return A;var D={input:E,source:v,element:L.element};if(L.canDrop&&!L.canDrop(D))return c({source:v,target:L.element.parentElement,input:E,result:A});var U=(C=(x=L.getData)===null||x===void 0?void 0:x.call(L,D))!==null&&C!==void 0?C:{},z=(y=(_=L.getDropEffect)===null||_===void 0?void 0:_.call(L,D))!==null&&y!==void 0?y:n,W={data:U,element:L.element,dropEffect:z,isActiveDueToStickiness:!1};return c({source:v,target:L.element.parentElement,input:E,result:[].concat(Mk(A),[W])})}function d(b){var C=b.eventName,x=b.payload,y=yv(x.location.current.dropTargets),_;try{for(y.s();!(_=y.n()).done;){var v,S=_.value,E=s.get(S.element),T=Zi(Zi({},x),{},{self:S});E==null||(v=E[C])===null||v===void 0||v.call(E,T)}}catch(A){y.e(A)}finally{y.f()}}var p={onGenerateDragPreview:d,onDrag:d,onDragStart:d,onDrop:d,onDropTargetChange:function(C){var x=C.payload,y=new Set(x.location.current.dropTargets.map(function(q){return q.element})),_=new Set,v=yv(x.location.previous.dropTargets),S;try{for(v.s();!(S=v.n()).done;){var E,T=S.value;_.add(T.element);var A=s.get(T.element),M=y.has(T.element),L=Zi(Zi({},x),{},{self:T});if(A==null||(E=A.onDropTargetChange)===null||E===void 0||E.call(A,L),!M){var D;A==null||(D=A.onDragLeave)===null||D===void 0||D.call(A,L)}}}catch(q){v.e(q)}finally{v.f()}var U=yv(x.location.current.dropTargets),z;try{for(U.s();!(z=U.n()).done;){var W,N,Y=z.value;if(!_.has(Y.element)){var $=Zi(Zi({},x),{},{self:Y}),F=s.get(Y.element);F==null||(W=F.onDropTargetChange)===null||W===void 0||W.call(F,$),F==null||(N=F.onDragEnter)===null||N===void 0||N.call(F,$)}}}catch(q){U.e(q)}finally{U.f()}}};function f(b){p[b.eventName](b)}function g(b){var C=b.source,x=b.target,y=b.input,_=b.current,v=c({source:C,target:x,input:y});if(v.length>=_.length)return v;for(var S=bv(_),E=bv(v),T=[],A=0;A<S.length;A++){var M,L=S[A],D=E[A];if(D!=null){T.push(D);continue}var U=T[A-1],z=S[A-1];if(U?.element!==z?.element)break;var W=s.get(L.element);if(!W)break;var N={input:y,source:C,element:W.element};if(W.canDrop&&!W.canDrop(N)||!((M=W.getIsSticky)!==null&&M!==void 0&&M.call(W,N)))break;T.push(Zi(Zi({},L),{},{isActiveDueToStickiness:!0}))}return bv(T)}return{dropTargetForConsumers:a,getIsOver:g,dispatchEvent:f}}function nj(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=rj(e))||t){n&&(e=n);var s=0,o=function(){};return{s:o,n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u,h=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var d=n.next();return h=d.done,d},e:function(d){a=!0,u=d},f:function(){try{h||n.return==null||n.return()}finally{if(a)throw u}}}}function rj(e,t){if(e){if(typeof e=="string")return KC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?KC(e,t):void 0}}function KC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function YC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function sj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YC(Object(n),!0).forEach(function(s){id(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YC(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function ij(){var e=new Set,t=null;function n(u){t&&(!u.canMonitor||u.canMonitor(t.canMonitorArgs))&&t.active.add(u)}function s(u){var h=sj({},u);e.add(h),n(h);function a(){e.delete(h),t&&t.active.delete(h)}return Oa(a)}function o(u){var h=u.eventName,a=u.payload;if(h==="onGenerateDragPreview"){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var c=nj(e),d;try{for(c.s();!(d=c.n()).done;){var p=d.value;n(p)}}catch(y){c.e(y)}finally{c.f()}}if(t){for(var f=Array.from(t.active),g=0,b=f;g<b.length;g++){var C=b[g];if(t.active.has(C)){var x;(x=C[h])===null||x===void 0||x.call(C,a)}}h==="onDrop"&&(t.active.clear(),t=null)}}return{dispatchEvent:o,monitorForConsumers:s}}function oj(e){var t=e.typeKey,n=e.mount,s=e.dispatchEventToSource,o=e.onPostDispatch,u=e.defaultDropEffect,h=ij(),a=tj({typeKey:t,defaultDropEffect:u});function c(f){s?.(f),a.dispatchEvent(f),h.dispatchEvent(f),o?.(f)}function d(f){var g=f.event,b=f.dragType;qC.start({event:g,dragType:b,getDropTargetsOver:a.getIsOver,dispatchEvent:c})}function p(){function f(){var g={canStart:qC.canStart,start:d};return n(g)}return J7({typeKey:t,mount:f})}return{registerUsage:p,dropTarget:a.dropTargetForConsumers,monitor:h.monitorForConsumers}}var Ik=Oa(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),aj="pdnd:android-fallback",XC="text/plain",lj="text/uri-list",cj="application/vnd.pdnd",Nh=new WeakMap;function uj(e){return Nh.set(e.element,e),function(){Nh.delete(e.element)}}var QC=N7(),F0=oj({typeKey:"element",defaultDropEffect:"move",mount:function(t){return xp(QC.bindEvents(),zl.bind(document,{type:"dragstart",listener:function(s){var o,u,h,a,c,d;if(t.canStart(s)&&!s.defaultPrevented&&s.dataTransfer){var p=s.target;if(p instanceof HTMLElement){var f=Nh.get(p);if(f){var g=mu(s),b={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:g};if(f.canDrag&&!f.canDrag(b)){s.preventDefault();return}if(f.dragHandle){var C=Ak({x:g.clientX,y:g.clientY});if(!f.dragHandle.contains(C)){s.preventDefault();return}}var x=(u=(h=f.getInitialDataForExternal)===null||h===void 0?void 0:h.call(f,b))!==null&&u!==void 0?u:null;if(x)for(var y=0,_=Object.entries(x);y<_.length;y++){var v=Rk(_[y],2),S=v[0],E=v[1];s.dataTransfer.setData(S,E??"")}Ik()&&!s.dataTransfer.types.includes(XC)&&!s.dataTransfer.types.includes(lj)&&s.dataTransfer.setData(XC,aj),s.dataTransfer.setData(cj,"");var T={element:f.element,dragHandle:(a=f.dragHandle)!==null&&a!==void 0?a:null,data:(c=(d=f.getInitialData)===null||d===void 0?void 0:d.call(f,b))!==null&&c!==void 0?c:{}},A={type:"element",payload:T,startedFrom:"internal"};t.start({event:s,dragType:A})}}}}}))},dispatchEventToSource:function(t){var n,s,o=t.eventName,u=t.payload;(n=Nh.get(u.source.element))===null||n===void 0||(s=n[o])===null||s===void 0||s.call(n,u)},onPostDispatch:QC.getOnPostDispatch()}),U0=F0.dropTarget,Nk=F0.monitor;function dj(e){var t=xp(F0.registerUsage(),uj(e),Pk(e.element,{attribute:"draggable",value:"true"}));return Oa(t)}function ZC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function JC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZC(Object(n),!0).forEach(function(s){id(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZC(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var fj={top:function(t,n){return Math.abs(n.y-t.top)},right:function(t,n){return Math.abs(t.right-n.x)},bottom:function(t,n){return Math.abs(t.bottom-n.y)},left:function(t,n){return Math.abs(n.x-t.left)}},jk=Symbol("closestEdge");function hj(e,t){var n,s,o=t.element,u=t.input,h=t.allowedEdges,a={x:u.clientX,y:u.clientY},c=o.getBoundingClientRect(),d=h.map(function(f){return{edge:f,value:fj[f](c,a)}}),p=(n=(s=d.sort(function(f,g){return f.value-g.value})[0])===null||s===void 0?void 0:s.edge)!==null&&n!==void 0?n:null;return JC(JC({},e),{},id({},jk,p))}function c_(e){var t;return(t=e[jk])!==null&&t!==void 0?t:null}function pj(){return{x:0,y:0}}function mj(e){var t=e.render,n=e.nativeSetDragImage,s=e.getOffset,o=s===void 0?pj:s,u=document.createElement("div");Object.assign(u.style,{position:"fixed",top:0,left:0,zIndex:Ok,pointerEvents:"none"}),document.body.append(u);var h=t({container:u});queueMicrotask(function(){var d=o({container:u});if(od()){var p=u.getBoundingClientRect();if(p.width===0)return;u.style.left="-".concat(p.width-1e-4,"px")}n?.(u,d.x,d.y)});function a(){c(),h?.(),document.body.removeChild(u)}var c=Nk({onDragStart:a,onDrop:a})}var gj=Oa(function(){return od()&&"ontouchend"in document}),vj=function(t){var n=t.container,s=n.getBoundingClientRect();return{x:s.width/2,y:s.height/2}};function _j(e){return function(n){var s=n.container;if(gj()||Ik())return vj({container:s});Object.assign(s.style,{borderInlineStart:"".concat(e.x," solid transparent"),borderTop:"".concat(e.y," solid transparent")});var o=window.getComputedStyle(s);if(o.direction==="rtl"){var u=s.getBoundingClientRect();return{x:u.width,y:0}}return{x:0,y:0}}}const Bk=k.forwardRef(({className:e,...t},n)=>w.jsx(qP,{ref:n,className:Be("peer size-4 shrink-0 rounded border border-input ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-checked:bg-primary data-checked:border-primary data-checked:text-primary-foreground","flex items-center justify-center transition-colors",e),...t,children:w.jsx(GP,{className:"flex items-center justify-center",children:w.jsx(Ee,{icon:ju,size:12,strokeWidth:3})})}));Bk.displayName="Checkbox";const zk=k.createContext(null);function yj({children:e}){const[t,n]=k.useState(!1),[s,o]=k.useState(new Set),u=k.useCallback(p=>{o(f=>{const g=new Set(f);return g.has(p)?g.delete(p):g.add(p),g})},[]),h=k.useCallback(p=>{o(new Set(p))},[]),a=k.useCallback(()=>{o(new Set)},[]),c=k.useCallback(()=>{n(!1),o(new Set)},[]),d=k.useCallback(p=>s.has(p),[s]);return w.jsx(zk.Provider,{value:{selectMode:t,setSelectMode:n,selectedIds:s,isSelected:d,toggle:u,selectAll:h,clearSelection:a,exitSelectMode:c,selectedCount:s.size},children:e})}function Hk(){const e=k.useContext(zk);if(!e)throw new Error("useSelection must be used within a SelectionProvider");return e}const Vk=k.createContext(null);function bj({children:e}){const[t,n]=k.useState(null);return w.jsx(Vk.Provider,{value:{activeTask:t,setActiveTask:n},children:e})}function Fk(){const e=k.useContext(Vk);if(!e)throw new Error("useDrag must be used within DragProvider");return e}function Sj(e){return e.match(/\/issue\/([A-Z]+-\d+)/i)?.[1]??null}function Uk({task:e,open:t,onOpenChange:n}){const s=A0(),[o,u]=k.useState(e.title),[h,a]=k.useState(e.description||""),[c,d]=k.useState(e.prUrl||""),[p,f]=k.useState(e.linearTicketUrl||"");k.useEffect(()=>{t&&(u(e.title),a(e.description||""),d(e.prUrl||""),f(e.linearTicketUrl||""))},[t,e]);const g=()=>{const C={},x=o.trim();if(!x)return;x!==e.title&&(C.title=x);const y=h.trim();y!==(e.description||"")&&(C.description=y);const _=c.trim();_!==(e.prUrl||"")&&(C.prUrl=_||null);const v=p.trim();v!==(e.linearTicketUrl||"")&&(C.linearTicketUrl=v||null,C.linearTicketId=v?Sj(v):null),Object.keys(C).length>0&&s.mutate({taskId:e.id,updates:C}),n(!1)},b=C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),g())};return w.jsx(As,{open:t,onOpenChange:n,children:w.jsxs(Os,{className:"sm:max-w-md",onKeyDown:b,children:[w.jsx(mi,{children:w.jsx(gi,{children:"Task Settings"})}),w.jsxs(gp,{className:"mt-4",children:[w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"config-title",children:"Title"}),w.jsx(Kt,{id:"config-title",value:o,onChange:C=>u(C.target.value),autoFocus:!0})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"config-description",children:"Description"}),w.jsx(mp,{id:"config-description",value:h,onChange:C=>a(C.target.value),rows:3})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"config-pr-url",children:"GitHub PR URL"}),w.jsx(Kt,{id:"config-pr-url",value:c,onChange:C=>d(C.target.value),placeholder:"https://github.com/owner/repo/pull/123"})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"config-linear-url",children:"Linear Ticket URL"}),w.jsx(Kt,{id:"config-linear-url",value:p,onChange:C=>f(C.target.value),placeholder:"https://linear.app/team/issue/TEAM-123"})]})]}),w.jsxs(ua,{className:"mt-4",children:[w.jsx(Ve,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),w.jsx(Ve,{onClick:g,disabled:!o.trim(),children:"Save"})]})]})})}function Wk({task:e,isDragPreview:t}){const{selectMode:n,isSelected:s,toggle:o}=Hk(),{setActiveTask:u}=Fk(),h=s(e.id),a=po(),c=k.useRef(null),[d,p]=k.useState(!1),[f,g]=k.useState(null),[b,C]=k.useState(null),[x,y]=k.useState(!1),_=k.useRef(!1);k.useEffect(()=>{const T=c.current;if(!(!T||n||t))return xp(dj({element:T,getInitialData:()=>({type:"task",taskId:e.id,status:e.status}),onGenerateDragPreview:({nativeSetDragImage:A})=>{mj({nativeSetDragImage:A,getOffset:_j({x:"16px",y:"8px"}),render:({container:M})=>{C(M)}})},onDragStart:()=>{p(!0),u(e),_.current=!0},onDrop:()=>{p(!1),u(null),C(null)}}),U0({element:T,getData:({input:A,element:M})=>{const L={type:"task",taskId:e.id,status:e.status};return hj(L,{input:A,element:M,allowedEdges:["top","bottom"]})},canDrop:({source:A})=>A.data.taskId!==e.id,onDragEnter:({self:A})=>{g(c_(A.data))},onDrag:({self:A})=>{g(c_(A.data))},onDragLeave:()=>{g(null)},onDrop:()=>{g(null)}}))},[e,n,t,u]);const v=()=>{_.current=!1},S=T=>{if(n){T.preventDefault(),o(e.id);return}_.current||a({to:"/tasks/$taskId",params:{taskId:e.id}}),_.current=!1},E=w.jsxs(bp,{ref:t?void 0:c,onPointerDown:v,onClick:S,className:Be("transition-shadow hover:shadow-md relative",n?"cursor-pointer":"cursor-grab active:cursor-grabbing",d&&"opacity-50",h&&"ring-2 ring-primary"),children:[f&&w.jsx("div",{className:Be("absolute left-0 right-0 h-0.5 bg-primary z-10",f==="top"&&"-top-1",f==="bottom"&&"-bottom-1")}),n&&w.jsx("div",{className:"absolute right-2 top-2 z-10 cursor-pointer",onClick:T=>{T.stopPropagation(),o(e.id)},children:w.jsx(Bk,{checked:h,className:"cursor-pointer pointer-events-none"})}),w.jsxs(vN,{className:Be("p-3 pb-1 flex flex-row items-start justify-between gap-2",n&&"pr-8"),children:[w.jsx(_N,{className:"text-sm font-medium leading-tight flex-1",children:e.title}),!n&&!t&&w.jsx("button",{type:"button",className:"shrink-0 p-0.5 -m-0.5 rounded hover:bg-muted transition-colors cursor-pointer",onClick:T=>{T.stopPropagation(),y(!0)},onPointerDown:T=>T.stopPropagation(),children:w.jsx(Ee,{icon:F2,size:14,strokeWidth:2,className:"text-muted-foreground"})})]}),w.jsxs(Sp,{className:"p-3 pt-1",children:[e.description&&w.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:e.description}),w.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-muted-foreground/70",children:[w.jsx(Ee,{icon:ms,size:12,strokeWidth:2}),w.jsx("span",{children:e.repoName}),e.prUrl&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-muted-foreground/30",children:"•"}),w.jsx(Ee,{icon:z2,size:12,strokeWidth:2,className:"text-foreground"})]}),e.linearTicketId&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-muted-foreground/30",children:"•"}),w.jsx(Ee,{icon:U_,size:12,strokeWidth:2,className:"text-foreground"})]})]})]})]});return w.jsxs(w.Fragment,{children:[E,b&&Qn.createPortal(w.jsx("div",{className:"w-72",children:w.jsx(Wk,{task:e,isDragPreview:!0})}),b),w.jsx(Uk,{task:e,open:x,onOpenChange:y})]})}const xj={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},Cj={IN_PROGRESS:"border-t-slate-400",IN_REVIEW:"border-t-violet-400",DONE:"border-t-emerald-400",CANCELED:"border-t-rose-500"};function ew({status:e,tasks:t,isMobile:n}){const s=k.useRef(null),[o,u]=k.useState(!1),h=[...t].sort((a,c)=>a.position-c.position);return k.useEffect(()=>{const a=s.current;if(a)return U0({element:a,getData:()=>({type:"column",status:e}),canDrop:({source:c})=>c.data.type==="task",onDragEnter:()=>u(!0),onDragLeave:()=>u(!1),onDrop:()=>u(!1)})},[e]),w.jsxs("div",{ref:s,className:Be("flex flex-col rounded-lg border border-t-4 bg-card",n?"h-full w-full":"h-full w-72 flex-shrink-0",Cj[e],o&&"ring-2 ring-primary ring-offset-2 ring-offset-background"),children:[w.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[w.jsx("h3",{className:"text-sm font-medium",children:xj[e]}),w.jsx("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-muted px-1.5 text-xs font-medium",children:t.length})]}),w.jsx(Xu,{className:"flex-1",children:w.jsx("div",{className:"flex flex-col gap-2 p-2",children:h.map(a=>w.jsx(Wk,{task:a},a.id))})})]})}const Sv=["IN_PROGRESS","IN_REVIEW","DONE","CANCELED"],qk={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"};function wj({status:e}){const t=k.useRef(null),[n,s]=k.useState(!1);return k.useEffect(()=>{const o=t.current;if(o)return U0({element:o,getData:()=>({type:"column",status:e}),canDrop:({source:u})=>u.data.type==="task",onDragEnter:()=>s(!0),onDragLeave:()=>s(!1),onDrop:()=>s(!1)})},[e]),w.jsx("div",{ref:t,className:Be("flex-1 rounded-lg border-2 border-dashed px-3 py-2 text-center text-xs font-medium transition-colors",n?"border-primary bg-primary/10 text-primary":"border-muted-foreground/30 text-muted-foreground"),children:qk[e]})}function Ej({repoFilter:e}){const{data:t=[],isLoading:n}=L0(),s=XI(),{activeTask:o}=Fk(),[u,h]=k.useState("IN_PROGRESS"),a=k.useMemo(()=>e?t.filter(d=>d.repoName===e):t,[t,e]),c=k.useMemo(()=>{const d={IN_PROGRESS:0,IN_REVIEW:0,DONE:0,CANCELED:0};for(const p of a)d[p.status]++;return d},[a]);return k.useEffect(()=>Nk({canMonitor:({source:d})=>d.data.type==="task",onDrop:({source:d,location:p})=>{const f=p.current.dropTargets;if(f.length===0)return;const g=d.data.taskId,b=a.find(y=>y.id===g);if(!b)return;const C=f[0],x=C.data;if(x.type==="column"){const y=x.status;if(y!==b.status){const _=a.filter(v=>v.status===y);s.mutate({taskId:g,status:y,position:_.length})}}else if(x.type==="task"){const y=c_(C.data),_=x.status,v=a.filter(T=>T.status===_).sort((T,A)=>T.position-A.position),S=v.findIndex(T=>T.id===x.taskId);let E=S;y==="bottom"&&(E=S+1),b.status===_&&v.findIndex(A=>A.id===g)<S&&(E=Math.max(0,E-1)),(b.status!==_||E!==b.position)&&s.mutate({taskId:g,status:_,position:E})}}}),[a,s]),n?w.jsx("div",{className:"flex h-full items-center justify-center",children:w.jsx("p",{className:"text-muted-foreground",children:"Loading tasks..."})}):w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsx("div",{className:"border-b lg:hidden",children:w.jsx(C0,{value:u,onValueChange:d=>h(d),children:w.jsx(w0,{variant:"line",className:"w-full justify-start px-4",children:Sv.map(d=>w.jsxs(kl,{value:d,className:"gap-1.5",children:[w.jsx("span",{className:"truncate",children:qk[d]}),w.jsx("span",{className:"text-muted-foreground",children:c[d]})]},d))})})}),w.jsx("div",{className:"pixel-grid hidden h-full justify-center gap-4 overflow-x-auto p-4 lg:flex",children:Sv.map(d=>w.jsx(ew,{status:d,tasks:a.filter(p=>p.status===d)},d))}),w.jsx("div",{className:"pixel-grid flex-1 overflow-y-auto p-4 lg:hidden",children:w.jsx(ew,{status:u,tasks:a.filter(d=>d.status===u),isMobile:!0})}),o&&w.jsx("div",{className:"fixed inset-x-0 bottom-0 flex gap-2 border-t bg-background/95 p-4 backdrop-blur-sm lg:hidden",children:Sv.filter(d=>d!==u).map(d=>w.jsx(wj,{status:d},d))})]})}function Rj(e){return w.jsx(bj,{children:w.jsx(Ej,{...e})})}const kj=Ns("/tasks/")({component:Tj});function Tj(){return w.jsx(yj,{children:w.jsx(Lj,{})})}function Lj(){const{selectMode:e,setSelectMode:t,selectedIds:n,selectedCount:s,exitSelectMode:o}=Hk(),u=ZI(),{data:h=[]}=L0(),[a,c]=k.useState(null),d=k.useMemo(()=>{const f=new Set(h.map(g=>g.repoName));return Array.from(f).sort()},[h]),p=()=>{const f=Array.from(n);u.mutate(f,{onSuccess:()=>{o()}})};return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:e?w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"text-sm font-medium",children:s>0?`${s} selected`:"Select tasks"}),w.jsxs(Ve,{variant:"ghost",size:"sm",onClick:o,children:[w.jsx(Ee,{icon:ho,size:14,strokeWidth:2,"data-slot":"icon"}),"Cancel"]})]}),w.jsxs(Qu,{children:[w.jsxs(Zu,{render:w.jsx(Ve,{variant:"destructive",size:"sm",disabled:u.isPending||s===0}),children:[w.jsx(Ee,{icon:Nu,size:14,strokeWidth:2,"data-slot":"icon"}),u.isPending?"Deleting...":`Delete${s>0?` (${s})`:""}`]}),w.jsxs(Ju,{children:[w.jsxs(ed,{children:[w.jsxs(nd,{children:["Delete ",s," Tasks"]}),w.jsx(rd,{children:"This will permanently delete the selected tasks and remove their worktrees. This action cannot be undone."})]}),w.jsxs(td,{children:[w.jsx(sd,{children:"Cancel"}),w.jsx(nk,{onClick:p,variant:"destructive",disabled:u.isPending,children:u.isPending?"Deleting...":"Delete All"})]})]})]})]}):w.jsxs(w.Fragment,{children:[w.jsx("h1",{className:"text-sm font-medium",children:"Tasks"}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs(v0,{value:a??"",onValueChange:f=>c(f||null),children:[w.jsxs(y0,{size:"sm",className:"min-w-[120px]",children:[w.jsx(Ee,{icon:N2,size:12,strokeWidth:2,className:"text-muted-foreground"}),w.jsx(_0,{children:a||"All Repos"})]}),w.jsxs(b0,{className:"min-w-[200px]",children:[w.jsx(Ru,{value:"",children:"All Repos"}),d.map(f=>w.jsx(Ru,{value:f,children:f},f))]})]}),w.jsxs(Ve,{variant:"ghost",size:"sm",onClick:()=>t(!0),children:[w.jsx(Ee,{icon:B3,size:14,strokeWidth:2,"data-slot":"icon"}),"Select"]})]})]})}),w.jsx("div",{className:"flex-1 overflow-hidden",children:w.jsx(Rj,{repoFilter:a})})]})}const Aj=Ns("/settings/")({component:Oj});function Oj(){const{data:e,isLoading:t}=a9(),{data:n,isLoading:s}=O0(),{data:o,isLoading:u}=M0(),{data:h,isLoading:a}=GR(),{data:c,isLoading:d}=$R(),{data:p,isLoading:f}=KR(),{data:g,isLoading:b}=l9(),{data:C,isLoading:x}=d9(),y=c9(),_=u9(),v=f9(),S=h9(),[E,T]=k.useState(""),[A,M]=k.useState(""),[L,D]=k.useState(""),[U,z]=k.useState(""),[W,N]=k.useState(""),[Y,$]=k.useState(""),[F,q]=k.useState(!1),[H,P]=k.useState(!1),[B,I]=k.useState(!1),[G,K]=k.useState(!1),[J,Z]=k.useState(!1),[ee,X]=k.useState(""),[V,se]=k.useState(!1),[re,ne]=k.useState(""),[oe,ce]=k.useState(!1),[ve,ge]=k.useState(""),[he,de]=k.useState("");k.useEffect(()=>{e!==void 0&&T(String(e)),o!==void 0&&M(o),h!==void 0&&D(h),c!==void 0&&z(c),p!==void 0&&N(String(p)),g!==void 0&&$(g)},[e,o,h,c,p,g]),k.useEffect(()=>{C&&(I(C.enabled),K(C.sound?.enabled??!1),Z(C.slack?.enabled??!1),X(C.slack?.webhookUrl??""),se(C.discord?.enabled??!1),ne(C.discord?.webhookUrl??""),ce(C.pushover?.enabled??!1),ge(C.pushover?.appToken??""),de(C.pushover?.userKey??""))},[C]);const Le=t||s||u||a||d||f||b||x,Oe=C&&(B!==C.enabled||G!==(C.sound?.enabled??!1)||J!==(C.slack?.enabled??!1)||ee!==(C.slack?.webhookUrl??"")||V!==(C.discord?.enabled??!1)||re!==(C.discord?.webhookUrl??"")||oe!==(C.pushover?.enabled??!1)||ve!==(C.pushover?.appToken??"")||he!==(C.pushover?.userKey??"")),Ne=E!==String(e)||A!==o||L!==h||U!==c||W!==String(p)||Y!==g||Oe,ye=async()=>{const Me=[];if(E!==String(e)){const He=parseInt(E,10);!isNaN(He)&&He>=1&&He<=65535&&Me.push(new Promise(dt=>{y.mutate({key:Rn.PORT,value:He},{onSettled:dt})}))}if(A!==o&&Me.push(new Promise(He=>{y.mutate({key:Rn.DEFAULT_GIT_REPOS_DIR,value:A},{onSettled:He})})),L!==h&&Me.push(new Promise(He=>{y.mutate({key:Rn.TASK_CREATION_COMMAND,value:L},{onSettled:He})})),U!==c&&Me.push(new Promise(He=>{y.mutate({key:Rn.HOSTNAME,value:U},{onSettled:He})})),W!==String(p)){const He=parseInt(W,10);!isNaN(He)&&He>=1&&He<=65535&&Me.push(new Promise(dt=>{y.mutate({key:Rn.SSH_PORT,value:He},{onSettled:dt})}))}Y!==g&&Me.push(new Promise(He=>{y.mutate({key:Rn.LINEAR_API_KEY,value:Y},{onSettled:He})})),Oe&&Me.push(new Promise(He=>{v.mutate({enabled:B,sound:{enabled:G},slack:{enabled:J,webhookUrl:ee},discord:{enabled:V,webhookUrl:re},pushover:{enabled:oe,appToken:ve,userKey:he}},{onSettled:He})})),await Promise.all(Me),P(!0),setTimeout(()=>P(!1),2e3)},Ae=()=>{_.mutate(Rn.PORT,{onSuccess:Me=>{Me.value!==null&&T(String(Me.value))}})},ae=()=>{_.mutate(Rn.DEFAULT_GIT_REPOS_DIR,{onSuccess:Me=>{Me.value&&M(String(Me.value))}})},be=()=>{_.mutate(Rn.TASK_CREATION_COMMAND,{onSuccess:Me=>{Me.value!==null&&Me.value!==void 0&&D(String(Me.value))}})},Ce=()=>{_.mutate(Rn.HOSTNAME,{onSuccess:Me=>{Me.value!==null&&Me.value!==void 0&&z(String(Me.value))}})},We=()=>{_.mutate(Rn.SSH_PORT,{onSuccess:Me=>{Me.value!==null&&Me.value!==void 0&&N(String(Me.value))}})},rt=()=>{_.mutate(Rn.LINEAR_API_KEY,{onSuccess:Me=>{$(Me.value!==null&&Me.value!==void 0?String(Me.value):"")}})},ze=async Me=>{S.mutate(Me,{onSuccess:He=>{He.success?Ar.success(`${Me} test successful`):Ar.error(`${Me} test failed: ${He.error}`)},onError:He=>{Ar.error(`Test failed: ${He.message}`)}})};return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:w.jsx("h1",{className:"text-sm font-medium",children:"Settings"})}),w.jsx("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:w.jsx("div",{className:"mx-auto max-w-2xl",children:w.jsxs(bp,{children:[w.jsxs(Sp,{className:"space-y-6 pt-6",children:[w.jsxs("div",{className:"space-y-4",children:[w.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Server"}),w.jsxs("div",{className:"space-y-1",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Port"}),w.jsx(Kt,{type:"number",min:1,max:65535,value:E,onChange:Me=>T(Me.target.value),placeholder:"3333",disabled:Le,className:"w-24 font-mono text-sm"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ae,disabled:Le||_.isPending,title:"Reset to default",children:w.jsx(Ee,{icon:ml,size:14,strokeWidth:2})})]}),w.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Requires server restart"})]})]}),w.jsx("div",{className:"border-t border-border"}),w.jsxs("div",{className:"space-y-4",children:[w.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Paths"}),w.jsxs("div",{className:"space-y-1",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Worktree Directory"}),w.jsx(Kt,{value:n,disabled:!0,className:"flex-1 font-mono text-sm bg-muted"})]}),w.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Derived from VIBORA_DIR (read-only)"})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Git Repos Directory"}),w.jsx(Kt,{value:A,onChange:Me=>M(Me.target.value),placeholder:"~/projects",disabled:Le,className:"flex-1 font-mono text-sm"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>q(!0),disabled:Le,title:"Browse",children:w.jsx(Ee,{icon:ms,size:14,strokeWidth:2})}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:ae,disabled:Le||_.isPending,title:"Reset to default",children:w.jsx(Ee,{icon:ml,size:14,strokeWidth:2})})]}),w.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Starting directory for repo picker"})]})]}),w.jsx("div",{className:"border-t border-border"}),w.jsxs("div",{className:"space-y-4",children:[w.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Task Defaults"}),w.jsxs("div",{className:"space-y-1",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Startup Command"}),w.jsx(Kt,{value:L,onChange:Me=>D(Me.target.value),placeholder:"claude --dangerously-skip-permissions",disabled:Le,className:"flex-1 font-mono text-sm"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:be,disabled:Le||_.isPending,title:"Reset to default",children:w.jsx(Ee,{icon:ml,size:14,strokeWidth:2})})]}),w.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Command to run when a new task terminal is created (leave empty to disable)"})]})]}),w.jsx("div",{className:"border-t border-border"}),w.jsxs("div",{className:"space-y-4",children:[w.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Remote Access"}),w.jsxs("div",{className:"space-y-1",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Hostname"}),w.jsx(Kt,{value:U,onChange:Me=>z(Me.target.value),placeholder:"e.g., citadel",disabled:Le,className:"flex-1 font-mono text-sm"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:Ce,disabled:Le||_.isPending,title:"Reset to default",children:w.jsx(Ee,{icon:ml,size:14,strokeWidth:2})})]}),w.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Remote machine hostname for VS Code SSH URLs (leave empty for local)"})]}),w.jsxs("div",{className:"space-y-1",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"SSH Port"}),w.jsx(Kt,{type:"number",min:1,max:65535,value:W,onChange:Me=>N(Me.target.value),placeholder:"22",disabled:Le,className:"w-24 font-mono text-sm"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:We,disabled:Le||_.isPending,title:"Reset to default",children:w.jsx(Ee,{icon:ml,size:14,strokeWidth:2})})]}),w.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"SSH port for VS Code remote connections"})]})]}),w.jsx("div",{className:"border-t border-border"}),w.jsxs("div",{className:"space-y-4",children:[w.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Integrations"}),w.jsxs("div",{className:"space-y-1",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Linear API Key"}),w.jsx(Kt,{type:"password",value:Y,onChange:Me=>$(Me.target.value),placeholder:"lin_api_...",disabled:Le,className:"flex-1 font-mono text-sm"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:rt,disabled:Le||_.isPending,title:"Reset to default",children:w.jsx(Ee,{icon:ml,size:14,strokeWidth:2})})]}),w.jsx("p",{className:"ml-40 pl-2 text-xs text-muted-foreground",children:"Personal API key from Linear for syncing ticket status"})]})]}),w.jsx("div",{className:"border-t border-border"}),w.jsxs("div",{className:"space-y-4",children:[w.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Notifications"}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("label",{className:"w-40 shrink-0 text-sm text-muted-foreground",children:"Enable Notifications"}),w.jsx(Go,{checked:B,onCheckedChange:I,disabled:Le})]}),w.jsx("div",{className:"space-y-2 pl-4",children:w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(Go,{checked:G,onCheckedChange:K,disabled:Le||!B}),w.jsx("label",{className:"text-sm text-muted-foreground",children:"Sound (macOS only)"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ze("sound"),disabled:Le||!B||!G||S.isPending,title:"Test sound",children:S.isPending?w.jsx(Ee,{icon:Ls,size:14,strokeWidth:2,className:"animate-spin"}):w.jsx(Ee,{icon:Af,size:14,strokeWidth:2})})]})}),w.jsxs("div",{className:"space-y-2 pl-4",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(Go,{checked:J,onCheckedChange:Z,disabled:Le||!B}),w.jsx("label",{className:"text-sm text-muted-foreground",children:"Slack"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ze("slack"),disabled:Le||!B||!J||!ee||S.isPending,title:"Test Slack",children:S.isPending?w.jsx(Ee,{icon:Ls,size:14,strokeWidth:2,className:"animate-spin"}):w.jsx(Ee,{icon:Af,size:14,strokeWidth:2})})]}),J&&w.jsx(Kt,{type:"password",value:ee,onChange:Me=>X(Me.target.value),placeholder:"https://hooks.slack.com/services/...",disabled:Le||!B,className:"ml-6 flex-1 font-mono text-sm"})]}),w.jsxs("div",{className:"space-y-2 pl-4",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(Go,{checked:V,onCheckedChange:se,disabled:Le||!B}),w.jsx("label",{className:"text-sm text-muted-foreground",children:"Discord"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ze("discord"),disabled:Le||!B||!V||!re||S.isPending,title:"Test Discord",children:S.isPending?w.jsx(Ee,{icon:Ls,size:14,strokeWidth:2,className:"animate-spin"}):w.jsx(Ee,{icon:Af,size:14,strokeWidth:2})})]}),V&&w.jsx(Kt,{type:"password",value:re,onChange:Me=>ne(Me.target.value),placeholder:"https://discord.com/api/webhooks/...",disabled:Le||!B,className:"ml-6 flex-1 font-mono text-sm"})]}),w.jsxs("div",{className:"space-y-2 pl-4",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(Go,{checked:oe,onCheckedChange:ce,disabled:Le||!B}),w.jsx("label",{className:"text-sm text-muted-foreground",children:"Pushover"}),w.jsx(Ve,{variant:"ghost",size:"icon",className:"ml-auto h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>ze("pushover"),disabled:Le||!B||!oe||!ve||!he||S.isPending,title:"Test Pushover",children:S.isPending?w.jsx(Ee,{icon:Ls,size:14,strokeWidth:2,className:"animate-spin"}):w.jsx(Ee,{icon:Af,size:14,strokeWidth:2})})]}),oe&&w.jsxs("div",{className:"ml-6 space-y-2",children:[w.jsx(Kt,{type:"password",value:ve,onChange:Me=>ge(Me.target.value),placeholder:"App Token",disabled:Le||!B,className:"flex-1 font-mono text-sm"}),w.jsx(Kt,{type:"password",value:he,onChange:Me=>de(Me.target.value),placeholder:"User Key",disabled:Le||!B,className:"flex-1 font-mono text-sm"})]})]})]})]}),w.jsxs(yN,{className:"flex items-center justify-end gap-2 border-t border-border",children:[H&&w.jsxs("span",{className:"flex items-center gap-1 text-xs text-emerald-500",children:[w.jsx(Ee,{icon:ju,size:12,strokeWidth:2}),"Saved"]}),w.jsx(Ve,{size:"sm",onClick:ye,disabled:!Ne||Le||y.isPending,children:"Save Changes"})]})]})})}),w.jsx(P0,{open:F,onOpenChange:q,onSelect:Me=>M(Me),initialPath:A||void 0})]})}const Mj=Ns("/repositories/")({component:Ij});function Dj({repository:e,onDelete:t}){const[n,s]=k.useState(!1),[o,u]=k.useState(!1),h=async a=>{a.preventDefault(),a.stopPropagation(),u(!0);try{await t(),s(!1)}catch{}finally{u(!1)}};return w.jsx(rr,{to:"/repositories/$repoId",params:{repoId:e.id},children:w.jsx(bp,{className:"transition-colors hover:border-border/80 cursor-pointer",children:w.jsxs(Sp,{className:"flex items-start justify-between gap-4 py-4",children:[w.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[w.jsx("div",{className:"flex items-center gap-2",children:w.jsx("span",{className:"truncate font-medium",children:e.displayName})}),w.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground",children:[w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx(Ee,{icon:ms,size:12,strokeWidth:2,className:"shrink-0"}),w.jsx("span",{className:"truncate font-mono",children:e.path})]}),e.startupScript&&w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx(Ee,{icon:F_,size:12,strokeWidth:2,className:"shrink-0"}),w.jsx("span",{className:"truncate font-mono",children:e.startupScript})]}),e.copyFiles&&w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx(Ee,{icon:V3,size:12,strokeWidth:2,className:"shrink-0"}),w.jsx("span",{className:"truncate font-mono",children:e.copyFiles})]})]})]}),w.jsx("div",{className:"flex items-center gap-1",onClick:a=>a.preventDefault(),children:w.jsxs(Qu,{open:n,onOpenChange:s,children:[w.jsx(Zu,{render:w.jsx(Ve,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive",onClick:a=>a.stopPropagation()}),children:w.jsx(Ee,{icon:Nu,size:14,strokeWidth:2})}),w.jsxs(Ju,{children:[w.jsxs(ed,{children:[w.jsx(nd,{children:"Delete Repository"}),w.jsxs(rd,{children:['This will remove "',e.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),w.jsxs(td,{children:[w.jsx(sd,{disabled:o,children:"Cancel"}),w.jsxs(Ve,{variant:"destructive",onClick:h,disabled:o,className:"gap-2",children:[o&&w.jsx(Ee,{icon:Ls,size:14,strokeWidth:2,className:"animate-spin"}),o?"Deleting...":"Delete"]})]})]})]})})]})})})}function Pj(){const[e,t]=k.useState(!1),[n,s]=k.useState(!1),[o,u]=k.useState(""),[h,a]=k.useState(""),[c,d]=k.useState(""),[p,f]=k.useState(""),g=YR(),{data:b}=M0(),C=_=>{u(_),h||a(_.split("/").pop()||"")},x=_=>{_.preventDefault(),o.trim()&&g.mutate({path:o.trim(),displayName:h.trim()||o.split("/").pop()||"repo",startupScript:c.trim()||null,copyFiles:p.trim()||null},{onSuccess:()=>{t(!1),u(""),a(""),d(""),f("")}})},y=o?o.split("/").pop():"";return w.jsxs(w.Fragment,{children:[w.jsxs(As,{open:e,onOpenChange:t,children:[w.jsxs(JE,{render:w.jsx(Ve,{size:"sm"}),children:[w.jsx(Ee,{icon:ql,size:16,strokeWidth:2,"data-slot":"icon"}),"Add Repository"]}),w.jsx(Os,{className:"sm:max-w-md",children:w.jsxs("form",{onSubmit:x,children:[w.jsxs(mi,{children:[w.jsx(gi,{children:"Add Repository"}),w.jsx(Jo,{children:"Add a git repository for quick access when creating tasks."})]}),w.jsxs(gp,{className:"mt-4",children:[w.jsxs(In,{children:[w.jsx(Nn,{children:"Repository Path"}),w.jsxs(Ve,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>s(!0),children:[w.jsx(Ee,{icon:ms,size:14,strokeWidth:2,className:"mr-2"}),y?w.jsx("span",{className:"truncate",children:o}):w.jsx("span",{className:"text-muted-foreground",children:"Select repository..."})]})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"displayName",children:"Display Name"}),w.jsx(Kt,{id:"displayName",value:h,onChange:_=>a(_.target.value),placeholder:y||"My Project"})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"startupScript",children:"Startup Script"}),w.jsx(mp,{id:"startupScript",value:c,onChange:_=>d(_.target.value),placeholder:"npm install && npm run dev",rows:2}),w.jsx(pi,{children:"Command to run in the terminal when creating a worktree."})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"copyFiles",children:"Copy Files"}),w.jsx(Kt,{id:"copyFiles",value:p,onChange:_=>f(_.target.value),placeholder:".env, config.local.json"}),w.jsx(pi,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]}),w.jsxs(ua,{className:"mt-4",children:[w.jsx(u0,{render:w.jsx(Ve,{variant:"outline",type:"button"}),children:"Cancel"}),w.jsx(Ve,{type:"submit",disabled:g.isPending||!o.trim(),children:g.isPending?"Adding...":"Add Repository"})]})]})})]}),w.jsx(P0,{open:n,onOpenChange:s,onSelect:C,initialPath:b||void 0})]})}function Ij(){const{data:e,isLoading:t,error:n}=D0(),s=XR(),o=async u=>{await s.mutateAsync(u)};return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[w.jsxs("div",{className:"flex items-center gap-4",children:[w.jsx("h1",{className:"text-sm font-medium",children:"Repositories"}),e&&w.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.length," total"]})]}),w.jsx(Pj,{})]}),w.jsxs("div",{className:"pixel-grid flex-1 overflow-auto p-4",children:[t&&w.jsx("div",{className:"flex items-center justify-center py-12",children:w.jsx(Ee,{icon:Ls,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}),n&&w.jsxs("div",{className:"flex items-center gap-3 py-6 text-destructive",children:[w.jsx(Ee,{icon:tp,size:20,strokeWidth:2}),w.jsxs("span",{className:"text-sm",children:["Failed to load repositories: ",n.message]})]}),!t&&!n&&e?.length===0&&w.jsx("div",{className:"py-12 text-muted-foreground",children:w.jsx("p",{className:"text-sm",children:"No repositories added yet. Add a repository for quick access when creating tasks."})}),w.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:e?.map(u=>w.jsx(Dj,{repository:u,onDelete:()=>o(u.id)},u.id))})]})]})}const Nj=()=>`http://${window.location.hostname}:3000`,ru={activeTab:"diff",browserUrl:Nj(),diffOptions:{wrap:!0,ignoreWhitespace:!0,includeUntracked:!1},filesViewState:{selectedFile:null,expandedDirs:[]}};function Cp(e){const t=qn(),n=k.useRef(void 0),s=k.useRef({}),{data:o}=qR(e),u=k.useMemo(()=>{const g=o?.viewState;return g?{activeTab:g.activeTab??ru.activeTab,browserUrl:g.browserUrl??ru.browserUrl,diffOptions:{...ru.diffOptions,...g.diffOptions},filesViewState:{...ru.filesViewState,...g.filesViewState}}:ru},[o?.viewState]),h=jn({mutationFn:async g=>{const b=await fetch(`/api/tasks/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({viewState:g})});if(!b.ok)throw new Error("Failed to update view state");return b.json()},onSuccess:g=>{t.setQueryData(["tasks",e],g),t.setQueryData(["tasks"],b=>b&&b.map(C=>C.id===e?g:C))}}),a=k.useCallback(g=>{const b=s.current;s.current={...b,...g,diffOptions:g.diffOptions||b.diffOptions?{...b.diffOptions,...g.diffOptions}:void 0,filesViewState:g.filesViewState||b.filesViewState?{...b.filesViewState,...g.filesViewState}:void 0};const C=s.current,x={activeTab:C.activeTab??u.activeTab,browserUrl:C.browserUrl??u.browserUrl,diffOptions:{...u.diffOptions,...C.diffOptions},filesViewState:{...u.filesViewState,...C.filesViewState}};t.setQueryData(["tasks",e],y=>y&&{...y,viewState:x}),t.setQueryData(["tasks"],y=>y&&y.map(_=>_.id===e?{..._,viewState:x}:_)),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{h.mutate(x),s.current={}},500)},[t,e,u,h]),c=k.useCallback(g=>{a({activeTab:g})},[a]),d=k.useCallback(g=>{a({browserUrl:g})},[a]),p=k.useCallback(g=>{a({diffOptions:g})},[a]),f=k.useCallback(g=>{a({filesViewState:g})},[a]);return{viewState:u,setActiveTab:c,setBrowserUrl:d,setDiffOptions:p,setFilesViewState:f}}function jj(e){const{viewState:t,setActiveTab:n}=Cp(e);return{tab:t.activeTab,setTab:n}}function Bj(e){return Nr({queryKey:["linear-ticket",e],queryFn:async()=>{if(!e)return null;const t=await fetch(`/api/linear/ticket/${e}`);return t.ok?t.json():null},enabled:!!e,staleTime:300*1e3})}function tw(e,t,n){return t?`vscode://vscode-remote/ssh-remote+${n!==22?`${t}:${n}`:t}${e}`:`vscode://file${e}`}function zj({taskName:e,cwd:t,className:n,planModeDescription:s,startupScript:o}){const u=k.useRef(null),h=k.useRef(null),a=k.useRef(null),c=k.useRef(!1),d=k.useRef(!1),[p,f]=k.useState(null),[g,b]=k.useState(!1),{data:C}=GR(),{setTerminalFocused:x}=I0(),{terminals:y,terminalsLoaded:_,connected:v,newTerminalIds:S,createTerminal:E,attachXterm:T,resizeTerminal:A,setupImagePaste:M,writeToTerminal:L}=V0(),D=p?y.find(W=>W.id===p):null,U=D?.status;k.useEffect(()=>{if(!u.current||h.current)return;const W=new yk.Terminal({cursorBlink:!0,fontSize:13,fontFamily:"JetBrains Mono Variable, Menlo, Monaco, monospace",lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}}),N=new bk.FitAddon,Y=new Sk.WebLinksAddon;W.loadAddon(N),W.loadAddon(Y),W.open(u.current),h.current=W,a.current=N,requestAnimationFrame(()=>{N.fit(),b(!0)});const $=setTimeout(()=>{N.fit(),W.refresh(0,W.rows-1)},100),F=()=>x(!0),q=()=>x(!1);return W.textarea&&(W.textarea.addEventListener("focus",F),W.textarea.addEventListener("blur",q)),()=>{clearTimeout($),W.textarea&&(W.textarea.removeEventListener("focus",F),W.textarea.removeEventListener("blur",q)),x(!1),W.dispose(),h.current=null,a.current=null,b(!1)}},[x]);const z=k.useCallback(()=>{if(!a.current||!h.current)return;a.current.fit();const{cols:W,rows:N}=h.current;p&&A(p,W,N)},[p,A]);return k.useEffect(()=>{if(!u.current)return;const W=()=>{requestAnimationFrame(z)};window.addEventListener("resize",W);const N=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{z(),h.current&&h.current.refresh(0,h.current.rows-1)})};document.addEventListener("visibilitychange",N);const Y=new ResizeObserver(W);Y.observe(u.current);const $=new IntersectionObserver(F=>{F[0]?.isIntersecting&&requestAnimationFrame(()=>{z(),h.current&&h.current.refresh(0,h.current.rows-1)})},{threshold:.1});return $.observe(u.current),()=>{window.removeEventListener("resize",W),document.removeEventListener("visibilitychange",N),Y.disconnect(),$.disconnect()}},[z]),k.useEffect(()=>{if(!v||!t||!g||!_)return;const W=y.find(N=>N.cwd===t);if(W){f(W.id);return}if(!c.current&&h.current){c.current=!0;const{cols:N,rows:Y}=h.current;E({name:e,cols:N,rows:Y,cwd:t})}},[v,t,g,_,y,e,E]),k.useEffect(()=>{if(!t||p)return;const W=y.find(N=>N.cwd===t);W&&f(W.id)},[y,t,p]),k.useEffect(()=>{if(!p||!h.current||!u.current||d.current)return;const W=T(p,h.current),N=M(u.current,p);if(d.current=!0,requestAnimationFrame(z),S.has(p)){S.delete(p),o&&setTimeout(()=>{L(p,o+"\r")},100);let Y=C;s&&(Y=`claude "${`${e}: ${s}`.replace(/"/g,'\\"')}" --allow-dangerously-skip-permissions --permission-mode plan`),Y&&setTimeout(()=>{L(p,Y+"\r")},o?300:100)}return()=>{W(),N(),d.current=!1}},[p,T,M,t,z,C,L,s,e,o,S]),t?w.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!v&&w.jsx("div",{className:"shrink-0 px-2 py-1 bg-yellow-500/20 text-yellow-500 text-xs",children:"Connecting to terminal server..."}),U==="error"&&w.jsx("div",{className:"shrink-0 px-2 py-1 bg-red-500/20 text-red-500 text-xs",children:"Terminal failed to start. The worktree directory may not exist."}),U==="exited"&&w.jsxs("div",{className:"shrink-0 px-2 py-1 bg-muted text-muted-foreground text-xs",children:["Terminal exited (code: ",D?.exitCode,")"]}),w.jsxs("div",{className:"relative flex-1",children:[w.jsx("div",{ref:u,className:Be("h-full w-full overflow-hidden bg-[#0a0a0a] p-2",n)}),w.jsx("button",{onClick:()=>h.current?.scrollToBottom(),className:"absolute top-2 right-5 p-1 text-white/50 hover:text-white/80 transition-colors",children:w.jsx(Ee,{icon:O2,size:20,strokeWidth:2})})]})]}):w.jsx("div",{className:Be("flex h-full items-center justify-center bg-[#0a0a0a] text-muted-foreground text-sm",n),children:"No worktree path configured for this task"})}function Hj(e){const{viewState:t,setDiffOptions:n}=Cp(e);return{options:t.diffOptions,setOption:(s,o)=>{n({[s]:o})},setOptions:n}}function Vj(e){const t=[];let n=0,s=0;for(const o of e.split(`
34
+ `))if(o.startsWith("diff --git"))t.push({type:"header",content:o});else if(o.startsWith("index ")||o.startsWith("---")||o.startsWith("+++"))t.push({type:"header",content:o});else if(o.startsWith("@@")){const u=o.match(/@@ -(\d+),?\d* \+(\d+),?\d* @@/);u&&(n=parseInt(u[1],10),s=parseInt(u[2],10)),t.push({type:"hunk",content:o})}else o.startsWith("+")?t.push({type:"added",content:o.slice(1),newLineNumber:s++}):o.startsWith("-")?t.push({type:"removed",content:o.slice(1),oldLineNumber:n++}):o.startsWith(" ")&&t.push({type:"context",content:o.slice(1),oldLineNumber:n++,newLineNumber:s++});return t}function Fj({taskId:e,worktreePath:t}){const{options:n,setOption:s}=Hj(e),{wrap:o,ignoreWhitespace:u,includeUntracked:h}=n,{data:a,isLoading:c,error:d}=t9(t,{ignoreWhitespace:u,includeUntracked:h}),p=k.useMemo(()=>a?.diff?Vj(a.diff):[],[a?.diff]);if(!t)return w.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"});if(c)return w.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading diff..."});if(d)return w.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:d.message});const f=a?.files?.some(g=>g.status==="untracked")??!1;return p.length===0?w.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[w.jsx("p",{children:"No changes detected"}),a?.files&&a.files.length>0&&w.jsxs("div",{className:"text-xs",children:[w.jsx("p",{className:"text-center mb-2",children:"Modified files:"}),w.jsxs("div",{className:"flex flex-col gap-1",children:[a.files.map(g=>w.jsxs("div",{className:"flex gap-2",children:[w.jsxs("span",{className:Be("w-4 text-center",g.status==="added"&&"text-green-500",g.status==="deleted"&&"text-red-500",g.status==="modified"&&"text-yellow-500",g.status==="untracked"&&"text-gray-500"),children:[g.status==="added"&&"A",g.status==="deleted"&&"D",g.status==="modified"&&"M",g.status==="untracked"&&"?"]}),w.jsx("span",{children:g.path})]},g.path)),f&&w.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-muted-foreground hover:text-foreground mt-1",children:[w.jsx("input",{type:"checkbox",checked:h,onChange:g=>s("includeUntracked",g.target.checked),className:"w-4 h-3"}),w.jsx("span",{children:"Show untracked files"})]})]})]})]}):w.jsxs("div",{className:"flex flex-col h-full",children:[w.jsxs("div",{className:"flex items-center gap-3 px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[a?.branch&&w.jsxs("span",{className:"text-muted-foreground",children:[a.branch,a.isBranchDiff&&w.jsx("span",{className:"opacity-70",children:" (vs master)"})]}),w.jsx("div",{className:"flex-1"}),w.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[w.jsx("input",{type:"checkbox",checked:o,onChange:g=>s("wrap",g.target.checked),className:"w-3 h-3"}),"Wrap"]}),w.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[w.jsx("input",{type:"checkbox",checked:u,onChange:g=>s("ignoreWhitespace",g.target.checked),className:"w-3 h-3"}),"Ignore whitespace"]}),w.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[w.jsx("input",{type:"checkbox",checked:h,onChange:g=>s("includeUntracked",g.target.checked),className:"w-3 h-3"}),"Untracked"]})]}),w.jsx(Xu,{className:"flex-1 min-h-0",children:w.jsx("div",{className:"font-mono text-xs",children:p.map((g,b)=>w.jsxs("div",{className:Be("flex px-2 py-0.5",g.type==="added"&&"bg-green-500/10",g.type==="removed"&&"bg-red-500/10",g.type==="header"&&"bg-muted/50 text-muted-foreground",g.type==="hunk"&&"bg-blue-500/10 text-blue-400"),children:[(g.type==="added"||g.type==="removed"||g.type==="context")&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:g.oldLineNumber??""}),w.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground",children:g.newLineNumber??""})]}),w.jsxs("span",{className:Be("w-4 shrink-0 select-none text-center",g.type==="added"&&"text-green-500",g.type==="removed"&&"text-red-500"),children:[g.type==="added"&&"+",g.type==="removed"&&"-"]}),w.jsx("span",{className:Be("flex-1",o?"whitespace-pre-wrap break-all":"whitespace-pre",g.type==="added"&&"text-green-400",g.type==="removed"&&"text-red-400"),children:g.content})]},b))})})]})}function Uj(e){const{viewState:t,setBrowserUrl:n}=Cp(e);return{url:t.browserUrl,setUrl:n}}function Wj({taskId:e}){const{url:t,setUrl:n}=Uj(e),[s,o]=k.useState(t),[u,h]=k.useState(0);k.useEffect(()=>{o(t)},[t]);const a=k.useCallback(()=>{h(d=>d+1)},[]),c=k.useCallback(d=>{d.preventDefault();let p=s.trim();!p.startsWith("http://")&&!p.startsWith("https://")&&(p=`http://${p}`),n(p),h(f=>f+1)},[s,n]);return w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-muted/30 px-2 py-1.5",children:[w.jsx(Ve,{variant:"ghost",size:"icon-xs",disabled:!0,children:w.jsx(Ee,{icon:I3,size:14,strokeWidth:2})}),w.jsx(Ve,{variant:"ghost",size:"icon-xs",disabled:!0,children:w.jsx(Ee,{icon:M2,size:14,strokeWidth:2})}),w.jsx(Ve,{variant:"ghost",size:"icon-xs",onClick:a,children:w.jsx(Ee,{icon:Q3,size:14,strokeWidth:2})}),w.jsx("form",{onSubmit:c,className:"flex-1",children:w.jsx(Kt,{value:s,onChange:d=>o(d.target.value),className:"h-7 bg-background text-xs",placeholder:"Enter URL..."})})]}),w.jsx("div",{className:"flex-1 overflow-hidden bg-white",children:w.jsx("iframe",{src:t,className:"h-full w-full border-0",title:"Browser Preview",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"},u)})]})}function qj(e){const{viewState:t,setFilesViewState:n}=Cp(e),s=t.filesViewState??{selectedFile:null,expandedDirs:[]},o=k.useCallback(a=>{n({selectedFile:a})},[n]),u=k.useCallback(a=>{const d=s.expandedDirs.includes(a)?s.expandedDirs.filter(p=>p!==a):[...s.expandedDirs,a];n({expandedDirs:d})},[s.expandedDirs,n]),h=k.useCallback(()=>{n({expandedDirs:[]})},[n]);return{selectedFile:s.selectedFile,expandedDirs:s.expandedDirs,setSelectedFile:o,toggleDir:u,collapseAll:h}}function Gj(e){const t=e.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","svg","webp","ico"].includes(t)?$3:["ts","tsx","js","jsx","json","css","html","md","yaml","yml","toml","sh","py","rs","go","sql"].includes(t)?F3:U3}function Gk({entry:e,depth:t,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u}){const h=s.includes(e.path),a=n===e.path,c=e.type==="directory",d=k.useCallback(()=>{c?u(e.path):o(e.path)},[c,e.path,o,u]);return w.jsxs("div",{children:[w.jsxs("div",{className:Be("flex items-center gap-1.5 px-2 py-0.5 cursor-pointer text-sm hover:bg-muted/50",a&&"bg-primary/10 text-primary"),style:{paddingLeft:`${t*12+8}px`},onClick:d,children:[w.jsx(Ee,{icon:c?h?j2:ms:Gj(e.name),size:14,strokeWidth:2,className:Be("shrink-0",c?"text-yellow-500":"text-muted-foreground")}),w.jsx("span",{className:"break-all",children:e.name})]}),c&&h&&e.children&&w.jsx("div",{children:e.children.map(p=>w.jsx(Gk,{entry:p,depth:t+1,selectedFile:n,expandedDirs:s,onSelectFile:o,onToggleDir:u},p.path))})]})}function $j({entries:e,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o,onCollapseAll:u}){return e.length===0?w.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No files"}):w.jsxs("div",{className:"flex flex-col h-full",children:[w.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1 border-b border-border",children:[w.jsx("span",{className:"text-xs text-muted-foreground",children:"Files"}),w.jsx("button",{onClick:u,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Collapse all",children:w.jsx(Ee,{icon:Y3,size:14,strokeWidth:2})})]}),w.jsx("div",{className:"py-1 flex-1 overflow-auto",children:e.map(h=>w.jsx(Gk,{entry:h,depth:0,selectedFile:t,expandedDirs:n,onSelectFile:s,onToggleDir:o},h.path))})]})}const Kj="modulepreload",Yj=function(e){return"/"+e},nw={},te=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let d=function(p){return Promise.all(p.map(f=>Promise.resolve(f).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};var h=d;document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");o=d(n.map(p=>{if(p=Yj(p),p in nw)return;nw[p]=!0;const f=p.endsWith(".css"),g=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const b=document.createElement("link");if(b.rel=f?"stylesheet":Kj,f||(b.as="script"),b.crossOrigin="",b.href=p,c&&b.setAttribute("nonce",c),document.head.appendChild(b),f)return new Promise((C,x)=>{b.addEventListener("load",C),b.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return o.then(a=>{for(const c of a||[])c.status==="rejected"&&u(c.reason);return t().catch(u)})};let Sn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Xj(e){return W0(e)}function W0(e){return Array.isArray(e)?Qj(e):e instanceof RegExp?e:typeof e=="object"?Zj(e):e}function Qj(e){let t=[];for(let n=0,s=e.length;n<s;n++)t[n]=W0(e[n]);return t}function Zj(e){let t={};for(let n in e)t[n]=W0(e[n]);return t}function $k(e,...t){return t.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function Kk(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Kk(e.substring(0,e.length-1)):e.substr(~t+1)}var xv=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Yf=class{static hasCaptures(e){return e===null?!1:(xv.lastIndex=0,xv.test(e))}static replaceCaptures(e,t,n){return e.replace(xv,(s,o,u,h)=>{let a=n[parseInt(o||u,10)];if(a){let c=t.substring(a.start,a.end);for(;c[0]===".";)c=c.substring(1);switch(h){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function Yk(e,t){return e<t?-1:e>t?1:0}function Xk(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,s=t.length;if(n===s){for(let o=0;o<n;o++){let u=Yk(e[o],t[o]);if(u!==0)return u}return 0}return n-s}function rw(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Qk(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Zk=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},jh=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(tB(e),t)}static createFromParsedTheme(e,t){return rB(e,t)}_cachedMatchRoot=new Zk(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,s=this._cachedMatchRoot.get(t).find(o=>Jj(e.parent,o.parentScopes));return s?new Jk(s.fontStyle,s.foreground,s.background):null}},Cv=class ah{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const s of n)t=new ah(t,s);return t}static from(...t){let n=null;for(let s=0;s<t.length;s++)n=new ah(n,t[s]);return n}push(t){return new ah(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let s=this;for(;s&&s!==t;)n.push(s.scopeName),s=s.parent;return s===t?n.reverse():void 0}};function Jj(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let s=t[n],o=!1;if(s===">"){if(n===t.length-1)return!1;s=t[++n],o=!0}for(;e&&!eB(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function eB(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Jk=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function tB(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],s=0;for(let o=0,u=t.length;o<u;o++){let h=t[o];if(!h.settings)continue;let a;if(typeof h.scope=="string"){let f=h.scope;f=f.replace(/^[,]+/,""),f=f.replace(/[,]+$/,""),a=f.split(",")}else Array.isArray(h.scope)?a=h.scope:a=[""];let c=-1;if(typeof h.settings.fontStyle=="string"){c=0;let f=h.settings.fontStyle.split(" ");for(let g=0,b=f.length;g<b;g++)switch(f[g]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let d=null;typeof h.settings.foreground=="string"&&rw(h.settings.foreground)&&(d=h.settings.foreground);let p=null;typeof h.settings.background=="string"&&rw(h.settings.background)&&(p=h.settings.background);for(let f=0,g=a.length;f<g;f++){let C=a[f].trim().split(" "),x=C[C.length-1],y=null;C.length>1&&(y=C.slice(0,C.length-1),y.reverse()),n[s++]=new nB(x,y,o,c,d,p)}}return n}var nB=class{constructor(e,t,n,s,o,u){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=s,this.foreground=o,this.background=u}},Yn=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Yn||{});function rB(e,t){e.sort((c,d)=>{let p=Yk(c.scope,d.scope);return p!==0||(p=Xk(c.parentScopes,d.parentScopes),p!==0)?p:c.index-d.index});let n=0,s="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let c=e.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(s=c.foreground),c.background!==null&&(o=c.background)}let u=new sB(t),h=new Jk(n,u.getId(s),u.getId(o)),a=new oB(new u_(0,null,-1,0,0),[]);for(let c=0,d=e.length;c<d;c++){let p=e[c];a.insert(0,p.scope,p.parentScopes,p.fontStyle,u.getId(p.foreground),u.getId(p.background))}return new jh(u,h,a)}var sB=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},iB=Object.freeze([]),u_=class eT{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,s,o,u){this.scopeDepth=t,this.parentScopes=n||iB,this.fontStyle=s,this.foreground=o,this.background=u}clone(){return new eT(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let s=0,o=t.length;s<o;s++)n[s]=t[s].clone();return n}acceptOverwrite(t,n,s,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),o!==0&&(this.background=o)}},oB=class d_{constructor(t,n=[],s={}){this._mainRule=t,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let s=0,o=0;for(;t.parentScopes[s]===">"&&s++,n.parentScopes[o]===">"&&o++,!(s>=t.parentScopes.length||o>=n.parentScopes.length);){const u=n.parentScopes[o].length-t.parentScopes[s].length;if(u!==0)return u;s++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let s=t.indexOf("."),o,u;if(s===-1?(o=t,u=""):(o=t.substring(0,s),u=t.substring(s+1)),this._children.hasOwnProperty(o))return this._children[o].match(u)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(d_._cmpBySpecificity),n}insert(t,n,s,o,u,h){if(n===""){this._doInsertHere(t,s,o,u,h);return}let a=n.indexOf("."),c,d;a===-1?(c=n,d=""):(c=n.substring(0,a),d=n.substring(a+1));let p;this._children.hasOwnProperty(c)?p=this._children[c]:(p=new d_(this._mainRule.clone(),u_.cloneArr(this._rulesWithParentScopes)),this._children[c]=p),p.insert(t+1,d,s,o,u,h)}_doInsertHere(t,n,s,o,u){if(n===null){this._mainRule.acceptOverwrite(t,s,o,u);return}for(let h=0,a=this._rulesWithParentScopes.length;h<a;h++){let c=this._rulesWithParentScopes[h];if(Xk(c.parentScopes,n)===0){c.acceptOverwrite(t,s,o,u);return}}s===-1&&(s=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),u===0&&(u=this._mainRule.background),this._rulesWithParentScopes.push(new u_(t,n,s,o,u))}},Hl=class Kr{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Kr.getLanguageId(t),s=Kr.getTokenType(t),o=Kr.getFontStyle(t),u=Kr.getForeground(t),h=Kr.getBackground(t);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:u,background:h})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,s,o,u,h,a){let c=Kr.getLanguageId(t),d=Kr.getTokenType(t),p=Kr.containsBalancedBrackets(t)?1:0,f=Kr.getFontStyle(t),g=Kr.getForeground(t),b=Kr.getBackground(t);return n!==0&&(c=n),s!==8&&(d=s),o!==null&&(p=o?1:0),u!==-1&&(f=u),h!==0&&(g=h),a!==0&&(b=a),(c<<0|d<<8|p<<10|f<<11|g<<15|b<<24)>>>0}};function Bh(e,t){const n=[],s=aB(e);let o=s.next();for(;o!==null;){let c=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=s.next()}let d=h();if(n.push({matcher:d,priority:c}),o!==",")break;o=s.next()}return n;function u(){if(o==="-"){o=s.next();const c=u();return d=>!!c&&!c(d)}if(o==="("){o=s.next();const c=a();return o===")"&&(o=s.next()),c}if(sw(o)){const c=[];do c.push(o),o=s.next();while(sw(o));return d=>t(c,d)}return null}function h(){const c=[];let d=u();for(;d;)c.push(d),d=u();return p=>c.every(f=>f(p))}function a(){const c=[];let d=h();for(;d&&(c.push(d),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");d=h()}return p=>c.some(f=>f(p))}}function sw(e){return!!e&&!!e.match(/[\w\.:]+/)}function aB(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const s=n[0];return n=t.exec(e),s}}}function tT(e){typeof e.dispose=="function"&&e.dispose()}var Ou=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},lB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},cB=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},uB=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ou(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new cB;for(const n of e)dB(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Ou){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function dB(e,t,n,s){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const u=n.lookup(t);e instanceof Ou?lh({baseGrammar:u,selfGrammar:o},s):f_(e.ruleName,{baseGrammar:u,selfGrammar:o,repository:o.repository},s);const h=n.injections(e.scopeName);if(h)for(const a of h)s.add(new Ou(a))}function f_(e,t,n){if(t.repository&&t.repository[e]){const s=t.repository[e];zh([s],t,n)}}function lh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&zh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&zh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function zh(e,t,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?$k({},t.repository,s.repository):t.repository;Array.isArray(s.patterns)&&zh(s.patterns,{...t,repository:o},n);const u=s.include;if(!u)continue;const h=nT(u);switch(h.kind){case 0:lh({...t,selfGrammar:t.baseGrammar},n);break;case 1:lh(t,n);break;case 2:f_(h.ruleName,{...t,repository:o},n);break;case 3:case 4:const a=h.scopeName===t.selfGrammar.scopeName?t.selfGrammar:h.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const c={baseGrammar:t.baseGrammar,selfGrammar:a,repository:o};h.kind===4?f_(h.ruleName,c,n):lh(c,n)}else h.kind===4?n.add(new lB(h.scopeName,h.ruleName)):n.add(new Ou(h.scopeName));break}}}var fB=class{kind=0},hB=class{kind=1},pB=class{constructor(e){this.ruleName=e}kind=2},mB=class{constructor(e){this.scopeName=e}kind=3},gB=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function nT(e){if(e==="$base")return new fB;if(e==="$self")return new hB;const t=e.indexOf("#");if(t===-1)return new mB(e);if(t===0)return new pB(e.substring(1));{const n=e.substring(0,t),s=e.substring(t+1);return new gB(n,s)}}var vB=/\\(\d+)/,iw=/\\(\d+)/g,_B=-1,rT=-2;var ad=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,s){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Yf.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=Yf.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Kk(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Yf.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Yf.replaceCaptures(this._contentName,e,t)}},yB=class extends ad{retokenizeCapturedWithRuleId;constructor(e,t,n,s,o){super(e,t,n,s),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,s){throw new Error("Not supported!")}},bB=class extends ad{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,s,o){super(e,t,n,null),this._match=new Mu(s,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e).compileAG(e,n,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Du,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ow=class extends ad{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,s,o){super(e,t,n,s),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e).compileAG(e,n,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Du,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},h_=class extends ad{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,s,o,u,h,a,c,d){super(e,t,n,s),this._begin=new Mu(o,this.id),this.beginCaptures=u,this._end=new Mu(h||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,s)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Du;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Hh=class extends ad{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,s,o,u,h,a,c){super(e,t,n,s),this._begin=new Mu(o,this.id),this.beginCaptures=u,this.whileCaptures=a,this._while=new Mu(h,rT),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,s){return this._getCachedCompiledPatterns(e).compileAG(e,n,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Du;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,s){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,s)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Du,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},sT=class Kn{static createCaptureRule(t,n,s,o,u){return t.registerRule(h=>new yB(n,h,s,o,u))}static getCompiledRuleId(t,n,s){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new bB(t.$vscodeTextmateLocation,t.id,t.name,t.match,Kn._compileCaptures(t.captures,n,s));if(typeof t.begin>"u"){t.repository&&(s=$k({},s,t.repository));let u=t.patterns;return typeof u>"u"&&t.include&&(u=[{include:t.include}]),new ow(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Kn._compilePatterns(u,n,s))}return t.while?new Hh(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Kn._compileCaptures(t.beginCaptures||t.captures,n,s),t.while,Kn._compileCaptures(t.whileCaptures||t.captures,n,s),Kn._compilePatterns(t.patterns,n,s)):new h_(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Kn._compileCaptures(t.beginCaptures||t.captures,n,s),t.end,Kn._compileCaptures(t.endCaptures||t.captures,n,s),t.applyEndPatternLast,Kn._compilePatterns(t.patterns,n,s))}),t.id}static _compileCaptures(t,n,s){let o=[];if(t){let u=0;for(const h in t){if(h==="$vscodeTextmateLocation")continue;const a=parseInt(h,10);a>u&&(u=a)}for(let h=0;h<=u;h++)o[h]=null;for(const h in t){if(h==="$vscodeTextmateLocation")continue;const a=parseInt(h,10);let c=0;t[h].patterns&&(c=Kn.getCompiledRuleId(t[h],n,s)),o[a]=Kn.createCaptureRule(n,t[h].$vscodeTextmateLocation,t[h].name,t[h].contentName,c)}}return o}static _compilePatterns(t,n,s){let o=[];if(t)for(let u=0,h=t.length;u<h;u++){const a=t[u];let c=-1;if(a.include){const d=nT(a.include);switch(d.kind){case 0:case 1:c=Kn.getCompiledRuleId(s[a.include],n,s);break;case 2:let p=s[d.ruleName];p&&(c=Kn.getCompiledRuleId(p,n,s));break;case 3:case 4:const f=d.scopeName,g=d.kind===4?d.ruleName:null,b=n.getExternalGrammar(f,s);if(b)if(g){let C=b.repository[g];C&&(c=Kn.getCompiledRuleId(C,n,b.repository))}else c=Kn.getCompiledRuleId(b.repository.$self,n,b.repository);break}}else c=Kn.getCompiledRuleId(a,n,s);if(c!==-1){const d=n.getRule(c);let p=!1;if((d instanceof ow||d instanceof h_||d instanceof Hh)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;o.push(c)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Mu=class iT{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const s=t.length;let o=0,u=[],h=!1;for(let a=0;a<s;a++)if(t.charAt(a)==="\\"&&a+1<s){const d=t.charAt(a+1);d==="z"?(u.push(t.substring(o,a)),u.push("$(?!\\n)(?<!\\n)"),o=a+2):(d==="A"||d==="G")&&(h=!0),a++}this.hasAnchor=h,o===0?this.source=t:(u.push(t.substring(o,s)),this.source=u.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=vB.test(this.source):this.hasBackReferences=!1}clone(){return new iT(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=n.map(o=>t.substring(o.start,o.end));return iw.lastIndex=0,this.source.replace(iw,(o,u)=>Qk(s[parseInt(u,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],s=[],o=[],u,h,a,c;for(u=0,h=this.source.length;u<h;u++)a=this.source.charAt(u),t[u]=a,n[u]=a,s[u]=a,o[u]=a,a==="\\"&&u+1<h&&(c=this.source.charAt(u+1),c==="A"?(t[u+1]="￿",n[u+1]="￿",s[u+1]="A",o[u+1]="A"):c==="G"?(t[u+1]="￿",n[u+1]="G",s[u+1]="￿",o[u+1]="G"):(t[u+1]=c,n[u+1]=c,s[u+1]=c,o[u+1]=c),u++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Du=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new aw(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let s=this._items.map(o=>o.resolveAnchors(t,n));return new aw(e,s,this._items.map(o=>o.ruleId))}},aw=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
35
+ `)}findNextMatchSync(e,t,n){const s=this.scanner.findNextMatchSync(e,t,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},wv=class{constructor(e,t){this.languageId=e,this.tokenType=t}},SB=class p_{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new wv(t,8),this._embeddedLanguagesMatcher=new xB(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?p_._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new wv(0,0);_getBasicScopeAttributes=new Zk(t=>{const n=this._scopeToLanguage(t),s=this._toStandardTokenType(t);return new wv(n,s)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(p_.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},xB=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,s])=>Qk(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},lw=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function oT(e,t,n,s,o,u,h,a){const c=t.content.length;let d=!1,p=-1;if(h){const b=CB(e,t,n,s,o,u);o=b.stack,s=b.linePos,n=b.isFirstLine,p=b.anchorPosition}const f=Date.now();for(;!d;){if(a!==0&&Date.now()-f>a)return new lw(o,!0);g()}return new lw(o,!1);function g(){const b=wB(e,t,n,s,o,p);if(!b){u.produce(o,c),d=!0;return}const C=b.captureIndices,x=b.matchedRuleId,y=C&&C.length>0?C[0].end>s:!1;if(x===_B){const _=o.getRule(e);u.produce(o,C[0].start),o=o.withContentNameScopesList(o.nameScopesList),lu(e,t,n,o,u,_.endCaptures,C),u.produce(o,C[0].end);const v=o;if(o=o.parent,p=v.getAnchorPos(),!y&&v.getEnterPos()===s){o=v,u.produce(o,c),d=!0;return}}else{const _=e.getRule(x);u.produce(o,C[0].start);const v=o,S=_.getName(t.content,C),E=o.contentNameScopesList.pushAttributed(S,e);if(o=o.push(x,s,p,C[0].end===c,null,E,E),_ instanceof h_){const T=_;lu(e,t,n,o,u,T.beginCaptures,C),u.produce(o,C[0].end),p=C[0].end;const A=T.getContentName(t.content,C),M=E.pushAttributed(A,e);if(o=o.withContentNameScopesList(M),T.endHasBackReferences&&(o=o.withEndRule(T.getEndWithResolvedBackReferences(t.content,C))),!y&&v.hasSameRuleAs(o)){o=o.pop(),u.produce(o,c),d=!0;return}}else if(_ instanceof Hh){const T=_;lu(e,t,n,o,u,T.beginCaptures,C),u.produce(o,C[0].end),p=C[0].end;const A=T.getContentName(t.content,C),M=E.pushAttributed(A,e);if(o=o.withContentNameScopesList(M),T.whileHasBackReferences&&(o=o.withEndRule(T.getWhileWithResolvedBackReferences(t.content,C))),!y&&v.hasSameRuleAs(o)){o=o.pop(),u.produce(o,c),d=!0;return}}else if(lu(e,t,n,o,u,_.captures,C),u.produce(o,C[0].end),o=o.pop(),!y){o=o.safePop(),u.produce(o,c),d=!0;return}}C[0].end>s&&(s=C[0].end,n=!1)}}function CB(e,t,n,s,o,u){let h=o.beginRuleCapturedEOL?0:-1;const a=[];for(let c=o;c;c=c.pop()){const d=c.getRule(e);d instanceof Hh&&a.push({rule:d,stack:c})}for(let c=a.pop();c;c=a.pop()){const{ruleScanner:d,findOptions:p}=kB(c.rule,e,c.stack.endRule,n,s===h),f=d.findNextMatchSync(t,s,p);if(f){if(f.ruleId!==rT){o=c.stack.pop();break}f.captureIndices&&f.captureIndices.length&&(u.produce(c.stack,f.captureIndices[0].start),lu(e,t,n,c.stack,u,c.rule.whileCaptures,f.captureIndices),u.produce(c.stack,f.captureIndices[0].end),h=f.captureIndices[0].end,f.captureIndices[0].end>s&&(s=f.captureIndices[0].end,n=!1))}else{o=c.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:h,isFirstLine:n}}function wB(e,t,n,s,o,u){const h=EB(e,t,n,s,o,u),a=e.getInjections();if(a.length===0)return h;const c=RB(a,e,t,n,s,o,u);if(!c)return h;if(!h)return c;const d=h.captureIndices[0].start,p=c.captureIndices[0].start;return p<d||c.priorityMatch&&p===d?c:h}function EB(e,t,n,s,o,u){const h=o.getRule(e),{ruleScanner:a,findOptions:c}=aT(h,e,o.endRule,n,s===u),d=a.findNextMatchSync(t,s,c);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function RB(e,t,n,s,o,u,h){let a=Number.MAX_VALUE,c=null,d,p=0;const f=u.contentNameScopesList.getScopeNames();for(let g=0,b=e.length;g<b;g++){const C=e[g];if(!C.matcher(f))continue;const x=t.getRule(C.ruleId),{ruleScanner:y,findOptions:_}=aT(x,t,null,s,o===h),v=y.findNextMatchSync(n,o,_);if(!v)continue;const S=v.captureIndices[0].start;if(!(S>=a)&&(a=S,c=v.captureIndices,d=v.ruleId,p=C.priority,a===o))break}return c?{priorityMatch:p===-1,captureIndices:c,matchedRuleId:d}:null}function aT(e,t,n,s,o){return{ruleScanner:e.compileAG(t,n,s,o),findOptions:0}}function kB(e,t,n,s,o){return{ruleScanner:e.compileWhileAG(t,n,s,o),findOptions:0}}function lu(e,t,n,s,o,u,h){if(u.length===0)return;const a=t.content,c=Math.min(u.length,h.length),d=[],p=h[0].end;for(let f=0;f<c;f++){const g=u[f];if(g===null)continue;const b=h[f];if(b.length===0)continue;if(b.start>p)break;for(;d.length>0&&d[d.length-1].endPos<=b.start;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?o.produceFromScopes(d[d.length-1].scopes,b.start):o.produce(s,b.start),g.retokenizeCapturedWithRuleId){const x=g.getName(a,h),y=s.contentNameScopesList.pushAttributed(x,e),_=g.getContentName(a,h),v=y.pushAttributed(_,e),S=s.push(g.retokenizeCapturedWithRuleId,b.start,-1,!1,null,y,v),E=e.createOnigString(a.substring(0,b.end));oT(e,E,n&&b.start===0,b.start,S,o,!1,0),tT(E);continue}const C=g.getName(a,h);if(C!==null){const y=(d.length>0?d[d.length-1].scopes:s.contentNameScopesList).pushAttributed(C,e);d.push(new TB(y,b.end))}}for(;d.length>0;)o.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var TB=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function LB(e,t,n,s,o,u,h,a){return new OB(e,t,n,s,o,u,h,a)}function cw(e,t,n,s,o){const u=Bh(t,Vh),h=sT.getCompiledRuleId(n,s,o.repository);for(const a of u)e.push({debugSelector:t,matcher:a.matcher,ruleId:h,grammar:o,priority:a.priority})}function Vh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(s=>{for(let o=n;o<t.length;o++)if(AB(t[o],s))return n=o+1,!0;return!1})}function AB(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var OB=class{constructor(e,t,n,s,o,u,h,a){if(this._rootScopeName=e,this.balancedBracketSelectors=u,this._onigLib=a,this._basicScopeAttributesProvider=new SB(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=h,this._grammar=uw(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const c of Object.keys(o)){const d=Bh(c,Vh);for(const p of d)this._tokenTypeMatchers.push({matcher:p.matcher,type:o[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,s=e.lookup(n);if(s){const o=s.injections;if(o)for(let h in o)cw(t,h,o[h],this,s);const u=this._grammarRepository.injections(n);u&&u.forEach(h=>{const a=this.getExternalGrammar(h);if(a){const c=a.injectionSelector;c&&cw(t,c,a,this,a)}})}return t.sort((o,u)=>o.priority-u.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=uw(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const s=this._tokenize(e,t,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(e,t,n=0){const s=this._tokenize(e,t,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(e,t,n,s){this._rootId===-1&&(this._rootId=sT.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===m_.NULL){o=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),f=Hl.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),g=this.getRule(this._rootId).getName(null,null);let b;g?b=gu.createRootAndLookUpScopeName(g,f,this):b=gu.createRoot("unknown",f),t=new m_(null,this._rootId,-1,-1,!1,null,b,b)}else o=!1,t.reset();e=e+`
36
+ `;const u=this.createOnigString(e),h=u.content.length,a=new DB(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=oT(this,u,o,0,t,a,!0,s);return tT(u),{lineLength:h,lineTokens:a,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function uw(e,t){return e=Xj(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var gu=class Rs{constructor(t,n,s){this.parent=t,this.scopePath=n,this.tokenAttributes=s}static fromExtension(t,n){let s=t,o=t?.scopePath??null;for(const u of n)o=Cv.push(o,u.scopeNames),s=new Rs(s,o,u.encodedTokenAttributes);return s}static createRoot(t,n){return new Rs(null,new Cv(null,t),n)}static createRootAndLookUpScopeName(t,n,s){const o=s.getMetadataForScope(t),u=new Cv(null,t),h=s.themeProvider.themeMatch(u),a=Rs.mergeAttributes(n,o,h);return new Rs(null,u,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Rs.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,s){let o=-1,u=0,h=0;return s!==null&&(o=s.fontStyle,u=s.foregroundId,h=s.backgroundId),Hl.set(t,n.languageId,n.tokenType,null,o,u,h)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Rs._pushAttributed(this,t,n);const s=t.split(/ /g);let o=this;for(const u of s)o=Rs._pushAttributed(o,u,n);return o}static _pushAttributed(t,n,s){const o=s.getMetadataForScope(n),u=t.scopePath.push(n),h=s.themeProvider.themeMatch(u),a=Rs.mergeAttributes(t.tokenAttributes,o,h);return new Rs(t,u,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let s=this;for(;s&&s!==t;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===t?n.reverse():void 0}},m_=class Wo{constructor(t,n,s,o,u,h,a,c){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=u,this.endRule=h,this.nameScopesList=a,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new Wo(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Wo._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?gu.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Wo._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,s,o,u,h,a){return new Wo(this,t,n,s,o,u,h,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Wo(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const s=gu.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Wo(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,gu.fromExtension(s,n.contentNameScopesList))}},MB=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Bh(n,Vh).map(s=>s.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Bh(n,Vh).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},DB=class{constructor(e,t,n,s){this.balancedBracketSelectors=s,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let s=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const u=e?.getScopeNames()??[];for(const h of this._tokenTypeOverrides)h.matcher(u)&&(s=Hl.set(s,0,h.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(u))}if(o&&(s=Hl.set(s,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let s=0,o=this._binaryTokens.length;s<o;s++)n[s]=this._binaryTokens[s];return n}},PB=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,s,o){if(!this._grammars.has(e)){let u=this._rawGrammars.get(e);if(!u)return null;this._grammars.set(e,LB(e,u,t,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},IB=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new PB(jh.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(jh.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,s){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(t,n,s){return this._loadGrammar(t,n,s.embeddedLanguages,s.tokenTypes,new MB(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,s,o,u){const h=new uB(this._syncRegistry,t);for(;h.Q.length>0;)h.Q.map(a=>this._loadSingleGrammar(a.scopeName)),h.processQueue();return this._grammarForScopeName(t,n,s,o,u)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(t,n=[],s=0,o=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,s,o)}_grammarForScopeName(t,n=0,s=null,o=null,u=null){return this._syncRegistry.grammarForScopeName(t,n,s,o,u)}},g_=m_.NULL;const NB=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ld{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}ld.prototype.normal={};ld.prototype.property={};ld.prototype.space=void 0;function lT(e,t){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new ld(n,s,t)}function v_(e){return e.toLowerCase()}class mr{constructor(t,n){this.attribute=n,this.property=t}}mr.prototype.attribute="";mr.prototype.booleanish=!1;mr.prototype.boolean=!1;mr.prototype.commaOrSpaceSeparated=!1;mr.prototype.commaSeparated=!1;mr.prototype.defined=!1;mr.prototype.mustUseProperty=!1;mr.prototype.number=!1;mr.prototype.overloadedBoolean=!1;mr.prototype.property="";mr.prototype.spaceSeparated=!1;mr.prototype.space=void 0;let jB=0;const yt=Ma(),bn=Ma(),__=Ma(),Pe=Ma(),$t=Ma(),Tl=Ma(),kr=Ma();function Ma(){return 2**++jB}const y_=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:bn,commaOrSpaceSeparated:kr,commaSeparated:Tl,number:Pe,overloadedBoolean:__,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),Ev=Object.keys(y_);class q0 extends mr{constructor(t,n,s,o){let u=-1;if(super(t,n),dw(this,"space",o),typeof s=="number")for(;++u<Ev.length;){const h=Ev[u];dw(this,Ev[u],(s&y_[h])===y_[h])}}}q0.prototype.defined=!0;function dw(e,t,n){n&&(e[t]=n)}function ec(e){const t={},n={};for(const[s,o]of Object.entries(e.properties)){const u=new q0(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,n[v_(s)]=s,n[v_(u.attribute)]=s}return new ld(t,n,e.space)}const cT=ec({properties:{ariaActiveDescendant:null,ariaAtomic:bn,ariaAutoComplete:null,ariaBusy:bn,ariaChecked:bn,ariaColCount:Pe,ariaColIndex:Pe,ariaColSpan:Pe,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:bn,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:bn,ariaFlowTo:$t,ariaGrabbed:bn,ariaHasPopup:null,ariaHidden:bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:Pe,ariaLive:null,ariaModal:bn,ariaMultiLine:bn,ariaMultiSelectable:bn,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:Pe,ariaPressed:bn,ariaReadOnly:bn,ariaRelevant:null,ariaRequired:bn,ariaRoleDescription:$t,ariaRowCount:Pe,ariaRowIndex:Pe,ariaRowSpan:Pe,ariaSelected:bn,ariaSetSize:Pe,ariaSort:null,ariaValueMax:Pe,ariaValueMin:Pe,ariaValueNow:Pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function uT(e,t){return t in e?e[t]:t}function dT(e,t){return uT(e,t.toLowerCase())}const BB=ec({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Tl,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:$t,autoFocus:yt,autoPlay:yt,blocking:$t,capture:null,charSet:null,checked:yt,cite:null,className:$t,cols:Pe,colSpan:null,content:null,contentEditable:bn,controls:yt,controlsList:$t,coords:Pe|Tl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:__,draggable:bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:$t,height:Pe,hidden:__,high:Pe,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:$t,itemRef:$t,itemScope:yt,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:Pe,manifest:null,max:null,maxLength:Pe,media:null,method:null,min:null,minLength:Pe,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:yt,optimum:Pe,pattern:null,ping:$t,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:$t,required:yt,reversed:yt,rows:Pe,rowSpan:Pe,sandbox:$t,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shape:null,size:Pe,sizes:null,slot:null,span:Pe,spellCheck:bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pe,step:null,style:null,tabIndex:Pe,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:bn,width:Pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,axis:null,background:null,bgColor:null,border:Pe,borderColor:null,bottomMargin:Pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:Pe,leftMargin:Pe,link:null,longDesc:null,lowSrc:null,marginHeight:Pe,marginWidth:Pe,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:Pe,rules:null,scheme:null,scrolling:bn,standby:null,summary:null,text:null,topMargin:Pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:yt,disableRemotePlayback:yt,prefix:null,property:null,results:Pe,security:null,unselectable:null},space:"html",transform:dT}),zB=ec({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:kr,accentHeight:Pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pe,amplitude:Pe,arabicForm:null,ascent:Pe,attributeName:null,attributeType:null,azimuth:Pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pe,by:null,calcMode:null,capHeight:Pe,className:$t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Pe,diffuseConstant:Pe,direction:null,display:null,dur:null,divisor:Pe,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pe,enableBackground:null,end:null,event:null,exponent:Pe,externalResourcesRequired:null,fill:null,fillOpacity:Pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Tl,g2:Tl,glyphName:Tl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pe,horizOriginX:Pe,horizOriginY:Pe,id:null,ideographic:Pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pe,k:Pe,k1:Pe,k2:Pe,k3:Pe,k4:Pe,kernelMatrix:kr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Pe,overlineThickness:Pe,paintOrder:null,panose1:null,path:null,pathLength:Pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pe,pointsAtY:Pe,pointsAtZ:Pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kr,rev:kr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kr,requiredFeatures:kr,requiredFonts:kr,requiredFormats:kr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Pe,specularExponent:Pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pe,strikethroughThickness:Pe,string:null,stroke:null,strokeDashArray:kr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pe,strokeOpacity:Pe,strokeWidth:null,style:null,surfaceScale:Pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kr,tabIndex:Pe,tableValues:null,target:null,targetX:Pe,targetY:Pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pe,underlineThickness:Pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pe,values:null,vAlphabetic:Pe,vMathematical:Pe,vectorEffect:null,vHanging:Pe,vIdeographic:Pe,version:null,vertAdvY:Pe,vertOriginX:Pe,vertOriginY:Pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:uT}),fT=ec({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),hT=ec({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dT}),pT=ec({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),HB=/[A-Z]/g,fw=/-[a-z]/g,VB=/^data[-\w.:]+$/i;function FB(e,t){const n=v_(t);let s=t,o=mr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&VB.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(fw,WB);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!fw.test(u)){let h=u.replace(HB,UB);h.charAt(0)!=="-"&&(h="-"+h),t="data"+h}}o=q0}return new o(s,t)}function UB(e){return"-"+e.toLowerCase()}function WB(e){return e.charAt(1).toUpperCase()}const qB=lT([cT,BB,fT,hT,pT],"html"),mT=lT([cT,zB,fT,hT,pT],"svg"),hw={}.hasOwnProperty;function GB(e,t){const n=t||{};function s(o,...u){let h=s.invalid;const a=s.handlers;if(o&&hw.call(o,e)){const c=String(o[e]);h=hw.call(a,c)?a[c]:s.unknown}if(h)return h.call(this,o,...u)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const $B=/["&'<>`]/g,KB=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,YB=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,XB=/[|\\{}()[\]^$+*?.]/g,pw=new WeakMap;function QB(e,t){if(e=e.replace(t.subset?ZB(t.subset):$B,s),t.subset||t.escapeOnly)return e;return e.replace(KB,n).replace(YB,s);function n(o,u,h){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,h.charCodeAt(u+2),t)}function s(o,u,h){return t.format(o.charCodeAt(0),h.charCodeAt(u+1),t)}}function ZB(e){let t=pw.get(e);return t||(t=JB(e),pw.set(e,t)),t}function JB(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(XB,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const ez=/[\dA-Fa-f]/;function tz(e,t,n){const s="&#x"+e.toString(16).toUpperCase();return n&&t&&!ez.test(String.fromCharCode(t))?s:s+";"}const nz=/\d/;function rz(e,t,n){const s="&#"+String(e);return n&&t&&!nz.test(String.fromCharCode(t))?s:s+";"}const sz=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Rv={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},iz=["cent","copy","divide","gt","lt","not","para","times"],gT={}.hasOwnProperty,b_={};let Xf;for(Xf in Rv)gT.call(Rv,Xf)&&(b_[Rv[Xf]]=Xf);const oz=/[^\dA-Za-z]/;function az(e,t,n,s){const o=String.fromCharCode(e);if(gT.call(b_,o)){const u=b_[o],h="&"+u;return n&&sz.includes(u)&&!iz.includes(u)&&(!s||t&&t!==61&&oz.test(String.fromCharCode(t)))?h:h+";"}return""}function lz(e,t,n){let s=tz(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=az(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const u=rz(e,t,n.omitOptionalSemicolons);u.length<s.length&&(s=u)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function Ll(e,t){return QB(e,Object.assign({format:lz},t))}const cz=/^>|^->|<!--|-->|--!>|<!-$/g,uz=[">"],dz=["<",">"];function fz(e,t,n,s){return s.settings.bogusComments?"<?"+Ll(e.value,Object.assign({},s.settings.characterReferences,{subset:uz}))+">":"<!--"+e.value.replace(cz,o)+"-->";function o(u){return Ll(u,Object.assign({},s.settings.characterReferences,{subset:dz}))}}function hz(e,t,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function mw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,o=n.indexOf(t);for(;o!==-1;)s++,o=n.indexOf(t,o+t.length);return s}function pz(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function mz(e){return e.join(" ").trim()}const gz=/[ \t\n\f\r]/g;function G0(e){return typeof e=="object"?e.type==="text"?gw(e.value):!1:gw(e)}function gw(e){return e.replace(gz,"")===""}const On=_T(1),vT=_T(-1),vz=[];function _T(e){return t;function t(n,s,o){const u=n?n.children:vz;let h=(s||0)+e,a=u[h];if(!o)for(;a&&G0(a);)h+=e,a=u[h];return a}}const _z={}.hasOwnProperty;function yT(e){return t;function t(n,s,o){return _z.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const $0=yT({body:bz,caption:kv,colgroup:kv,dd:wz,dt:Cz,head:kv,html:yz,li:xz,optgroup:Ez,option:Rz,p:Sz,rp:vw,rt:vw,tbody:Tz,td:_w,tfoot:Lz,th:_w,thead:kz,tr:Az});function kv(e,t,n){const s=On(n,t,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&G0(s.value.charAt(0)))}function yz(e,t,n){const s=On(n,t);return!s||s.type!=="comment"}function bz(e,t,n){const s=On(n,t);return!s||s.type!=="comment"}function Sz(e,t,n){const s=On(n,t);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function xz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&s.tagName==="li"}function Cz(e,t,n){const s=On(n,t);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function wz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function vw(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function Ez(e,t,n){const s=On(n,t);return!s||s.type==="element"&&s.tagName==="optgroup"}function Rz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function kz(e,t,n){const s=On(n,t);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function Tz(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function Lz(e,t,n){return!On(n,t)}function Az(e,t,n){const s=On(n,t);return!s||s.type==="element"&&s.tagName==="tr"}function _w(e,t,n){const s=On(n,t);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const Oz=yT({body:Pz,colgroup:Iz,head:Dz,html:Mz,tbody:Nz});function Mz(e){const t=On(e,-1);return!t||t.type!=="comment"}function Dz(e){const t=new Set;for(const s of e.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(t.has(s.tagName))return!1;t.add(s.tagName)}const n=e.children[0];return!n||n.type==="element"}function Pz(e){const t=On(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&G0(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Iz(e,t,n){const s=vT(n,t),o=On(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&$0(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function Nz(e,t,n){const s=vT(n,t),o=On(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&$0(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const Qf={name:[[`
37
+ \f\r &/=>`.split(""),`
38
+ \f\r "&'/=>\``.split("")],[`\0
39
+ \f\r "&'/<=>`.split(""),`\0
40
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
41
+ \f\r &>`.split(""),`\0
42
+ \f\r "&'<=>\``.split("")],[`\0
43
+ \f\r "&'<=>\``.split(""),`\0
44
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function jz(e,t,n,s){const o=s.schema,u=o.space==="svg"?!1:s.settings.omitOptionalTags;let h=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const a=[];let c;o.space==="html"&&e.tagName==="svg"&&(s.schema=mT);const d=Bz(s,e.properties),p=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,p&&(h=!1),(d||!u||!Oz(e,t,n))&&(a.push("<",e.tagName,d?" "+d:""),h&&(o.space==="svg"||s.settings.closeSelfClosing)&&(c=d.charAt(d.length-1),(!s.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(p),!h&&(!u||!$0(e,t,n))&&a.push("</"+e.tagName+">"),a.join("")}function Bz(e,t){const n=[];let s=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const u=zz(e,o,t[o]);u&&n.push(u)}}for(;++s<n.length;){const u=e.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&u!=='"'&&u!=="'"&&(n[s]+=" ")}return n.join("")}function zz(e,t,n){const s=FB(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,u=e.settings.allowDangerousCharacters?0:1;let h=e.quote,a;if(s.overloadedBoolean&&(n===s.attribute||n==="")?n=!0:(s.boolean||s.overloadedBoolean)&&(typeof n!="string"||n===s.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=Ll(s.attribute,Object.assign({},e.settings.characterReferences,{subset:Qf.name[o][u]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?pz:mz)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(a=Ll(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Qf.unquoted[o][u]}))),a!==n&&(e.settings.quoteSmart&&mw(n,h)>mw(n,e.alternative)&&(h=e.alternative),a=h+Ll(n,Object.assign({},e.settings.characterReferences,{subset:(h==="'"?Qf.single:Qf.double)[o][u],attribute:!0}))+h),c+(a&&"="+a))}const Hz=["<","&"];function bT(e,t,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Ll(e.value,Object.assign({},s.settings.characterReferences,{subset:Hz}))}function Vz(e,t,n,s){return s.settings.allowDangerousHtml?e.value:bT(e,t,n,s)}function Fz(e,t,n,s){return s.all(e)}const Uz=GB("type",{invalid:Wz,unknown:qz,handlers:{comment:fz,doctype:hz,element:jz,raw:Vz,root:Fz,text:bT}});function Wz(e){throw new Error("Expected node, not `"+e+"`")}function qz(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Gz={},$z={},Kz=[];function Yz(e,t){const n=t||Gz,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:Xz,all:Qz,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||NB,characterReferences:n.characterReferences||$z,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?mT:qB,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Xz(e,t,n){return Uz(e,t,n,this)}function Qz(e){const t=[],n=e&&e.children||Kz;let s=-1;for(;++s<n.length;)t[s]=this.one(n[s],s,e);return t.join("")}function Fh(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},s=typeof e=="string"?e:e.name;for(const[o,u]of Object.entries(t?.colorReplacements||{}))typeof u=="string"?n[o]=u:o===s&&Object.assign(n,u);return n}function fo(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Zz(e){return Array.isArray(e)?e:[e]}async function ST(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function K0(e){return!e||["plaintext","txt","text","plain"].includes(e)}function xT(e){return e==="ansi"||K0(e)}function Y0(e){return e==="none"}function CT(e){return Y0(e)}function wT(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const s of n)s&&!e.properties.class.includes(s)&&e.properties.class.push(s);return e}function wp(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let s=0;const o=[];for(let u=0;u<n.length;u+=2){const h=t?n[u]+(n[u+1]||""):n[u];o.push([h,s]),s+=n[u].length,s+=n[u+1]?.length||0}return o}function Jz(e){const t=wp(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let u=o,h=0;for(const a of t){if(u<a.length)break;u-=a.length,h++}return{line:h,character:u}}function s(o,u){let h=0;for(let a=0;a<o;a++)h+=t[a].length;return h+=u,h}return{lines:t,indexToPos:n,posToIndex:s}}const X0="light-dark()",eH=["color","background-color"];function tH(e,t){let n=0;const s=[];for(const o of t)o>n&&s.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&s.push({...e,content:e.content.slice(n),offset:e.offset+n}),s}function nH(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((s,o)=>s-o);return n.length?e.map(s=>s.flatMap(o=>{const u=n.filter(h=>o.offset<h&&h<o.offset+o.content.length).map(h=>h-o.offset).sort((h,a)=>h-a);return u.length?tH(o,u):o})):e}function rH(e,t,n,s,o="css-vars"){const u={content:e.content,explanation:e.explanation,offset:e.offset},h=t.map(p=>Uh(e.variants[p])),a=new Set(h.flatMap(p=>Object.keys(p))),c={},d=(p,f)=>{const g=f==="color"?"":f==="background-color"?"-bg":`-${f}`;return n+t[p]+(f==="color"?"":g)};return h.forEach((p,f)=>{for(const g of a){const b=p[g]||"inherit";if(f===0&&s&&eH.includes(g))if(s===X0&&h.length>1){const C=t.findIndex(v=>v==="light"),x=t.findIndex(v=>v==="dark");if(C===-1||x===-1)throw new Sn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const y=h[C][g]||"inherit",_=h[x][g]||"inherit";c[g]=`light-dark(${y}, ${_})`,o==="css-vars"&&(c[d(f,g)]=b)}else c[g]=b;else o==="css-vars"&&(c[d(f,g)]=b)}}),u.htmlStyle=c,u}function Uh(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Yn.Italic&&(t["font-style"]="italic"),e.fontStyle&Yn.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Yn.Underline&&n.push("underline"),e.fontStyle&Yn.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function S_(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const ET=new WeakMap;function Ep(e,t){ET.set(e,t)}function Pu(e){return ET.get(e)}class tc{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new tc(Object.fromEntries(Zz(n).map(s=>[s,g_])),t)}constructor(...t){if(t.length===2){const[n,s]=t;this.lang=s,this._stacks=n}else{const[n,s,o]=t;this.lang=s,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return sH(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function sH(e){const t=[],n=new Set;function s(o){if(n.has(o))return;n.add(o);const u=o?.nameScopesList?.scopeName;u&&t.push(u),o.parent&&s(o.parent)}return s(e),t}function iH(e,t){if(!(e instanceof tc))throw new Sn("Invalid grammar state");return e.getInternalStack(t)}function oH(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let s=function(h){if(typeof h=="number"){if(h<0||h>n.source.length)throw new Sn(`Invalid decoration offset: ${h}. Code length: ${n.source.length}`);return{...o.indexToPos(h),offset:h}}else{const a=o.lines[h.line];if(a===void 0)throw new Sn(`Invalid decoration position ${JSON.stringify(h)}. Lines length: ${o.lines.length}`);let c=h.character;if(c<0&&(c=a.length+c),c<0||c>a.length)throw new Sn(`Invalid decoration position ${JSON.stringify(h)}. Line ${h.line} length: ${a.length}`);return{...h,character:c,offset:o.posToIndex(h.line,c)}}};const o=Jz(n.source),u=(n.options.decorations||[]).map(h=>({...h,start:s(h.start),end:s(h.end)}));aH(u),e.set(n.meta,{decorations:u,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const o=t(this).decorations.flatMap(h=>[h.start.offset,h.end.offset]);return nH(n,o)},code(n){if(!this.options.decorations?.length)return;const s=t(this),o=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==s.converter.lines.length)throw new Sn(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${s.converter.lines.length}). Failed to apply decorations.`);function u(p,f,g,b){const C=o[p];let x="",y=-1,_=-1;if(f===0&&(y=0),g===0&&(_=0),g===Number.POSITIVE_INFINITY&&(_=C.children.length),y===-1||_===-1)for(let S=0;S<C.children.length;S++)x+=RT(C.children[S]),y===-1&&x.length===f&&(y=S+1),_===-1&&x.length===g&&(_=S+1);if(y===-1)throw new Sn(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(_===-1)throw new Sn(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const v=C.children.slice(y,_);if(!b.alwaysWrap&&v.length===C.children.length)a(C,b,"line");else if(!b.alwaysWrap&&v.length===1&&v[0].type==="element")a(v[0],b,"token");else{const S={type:"element",tagName:"span",properties:{},children:v};a(S,b,"wrapper"),C.children.splice(y,v.length,S)}}function h(p,f){o[p]=a(o[p],f,"line")}function a(p,f,g){const b=f.properties||{},C=f.transform||(x=>x);return p.tagName=f.tagName||"span",p.properties={...p.properties,...b,class:p.properties.class},f.properties?.class&&wT(p,f.properties.class),p=C(p,g)||p,p}const c=[],d=s.decorations.sort((p,f)=>f.start.offset-p.start.offset||p.end.offset-f.end.offset);for(const p of d){const{start:f,end:g}=p;if(f.line===g.line)u(f.line,f.character,g.character,p);else if(f.line<g.line){u(f.line,f.character,Number.POSITIVE_INFINITY,p);for(let b=f.line+1;b<g.line;b++)c.unshift(()=>h(b,p));u(g.line,0,g.character,p)}}c.forEach(p=>p())}}}function aH(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Sn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=t+1;s<e.length;s++){const o=e[s],u=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,h=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,a=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,c=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(u||h||a||c){if(u&&h||a&&c||a&&n.start.offset===n.end.offset||h&&o.start.offset===o.end.offset)continue;throw new Sn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function RT(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(RT).join(""):""}const lH=[oH()];function Wh(e){const t=cH(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...lH]}function cH(e){const t=[],n=[],s=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:s.push(o)}return{pre:t,post:n,normal:s}}var na=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Tv={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function uH(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const s=e.indexOf("m",n);if(s!==-1)return{sequence:e.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:e.length}}function yw(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(s=>Number.parseInt(s));return n.length!==3||n.some(s=>Number.isNaN(s))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function dH(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const s=Number.parseInt(n);if(!Number.isNaN(s))if(s===0)t.push({type:"resetAll"});else if(s<=9)Tv[s]&&t.push({type:"setDecoration",value:Tv[s]});else if(s<=29){const o=Tv[s-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(s<=37)t.push({type:"setForegroundColor",value:{type:"named",name:na[s-30]}});else if(s===38){const o=yw(e);o&&t.push({type:"setForegroundColor",value:o})}else if(s===39)t.push({type:"resetForegroundColor"});else if(s<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:na[s-40]}});else if(s===48){const o=yw(e);o&&t.push({type:"setBackgroundColor",value:o})}else s===49?t.push({type:"resetBackgroundColor"}):s===53?t.push({type:"setDecoration",value:"overline"}):s===55?t.push({type:"resetDecoration",value:"overline"}):s>=90&&s<=97?t.push({type:"setForegroundColor",value:{type:"named",name:na[s-90+8]}}):s>=100&&s<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:na[s-100+8]}})}return t}function fH(){let e=null,t=null,n=new Set;return{parse(s){const o=[];let u=0;do{const h=uH(s,u),a=h.sequence?s.substring(u,h.startPosition):s.substring(u);if(a.length>0&&o.push({value:a,foreground:e,background:t,decorations:new Set(n)}),h.sequence){const c=dH(h.sequence);for(const d of c)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of c)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}u=h.position}while(u<s.length);return o}}}var hH={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function pH(e=hH){function t(a){return e[a]}function n(a){return`#${a.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let s;function o(){if(s)return s;s=[];for(let d=0;d<na.length;d++)s.push(t(na[d]));let a=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let p=0;p<6;p++)for(let f=0;f<6;f++)s.push(n([a[d],a[p],a[f]]));let c=8;for(let d=0;d<24;d++,c+=10)s.push(n([c,c,c]));return s}function u(a){return o()[a]}function h(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return u(a.index)}}return{value:h}}const mH={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function gH(e,t,n){const s=Fh(e,n),o=wp(t),u=Object.fromEntries(na.map(c=>{const d=`terminal.ansi${c[0].toUpperCase()}${c.substring(1)}`,p=e.colors?.[d];return[c,p||mH[c]]})),h=pH(u),a=fH();return o.map(c=>a.parse(c[0]).map(d=>{let p,f;d.decorations.has("reverse")?(p=d.background?h.value(d.background):e.bg,f=d.foreground?h.value(d.foreground):e.fg):(p=d.foreground?h.value(d.foreground):e.fg,f=d.background?h.value(d.background):void 0),p=fo(p,s),f=fo(f,s),d.decorations.has("dim")&&(p=vH(p));let g=Yn.None;return d.decorations.has("bold")&&(g|=Yn.Bold),d.decorations.has("italic")&&(g|=Yn.Italic),d.decorations.has("underline")&&(g|=Yn.Underline),d.decorations.has("strikethrough")&&(g|=Yn.Strikethrough),{content:d.value,offset:c[1],color:p,bgColor:f,fontStyle:g}}))}function vH(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const s=t[1];if(s.length===8){const o=Math.round(Number.parseInt(s.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${s.slice(0,6)}${o}`}else{if(s.length===6)return`#${s}80`;if(s.length===4){const o=s[0],u=s[1],h=s[2],a=s[3],c=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${u}${u}${h}${h}${c}`}else if(s.length===3){const o=s[0],u=s[1],h=s[2];return`#${o}${o}${u}${u}${h}${h}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Q0(e,t,n={}){const{theme:s=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(K0(o)||Y0(s))return wp(t).map(c=>[{content:c[0],offset:c[1]}]);const{theme:u,colorMap:h}=e.setTheme(s);if(o==="ansi")return gH(u,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Sn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(u.name))throw new Sn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${u.name}"`)}return yH(t,a,u,h,n)}function _H(...e){if(e.length===2)return Pu(e[1]);const[t,n,s={}]=e,{lang:o="text",theme:u=t.getLoadedThemes()[0]}=s;if(K0(o)||Y0(u))throw new Sn("Plain language does not have grammar state");if(o==="ansi")throw new Sn("ANSI language does not have grammar state");const{theme:h,colorMap:a}=t.setTheme(u),c=t.getLanguage(o);return new tc(Z0(n,c,h,a,s).stateStack,c.name,h.name)}function yH(e,t,n,s,o){const u=Z0(e,t,n,s,o),h=new tc(u.stateStack,t.name,n.name);return Ep(u.tokens,h),u.tokens}function Z0(e,t,n,s,o){const u=Fh(n,o),{tokenizeMaxLineLength:h=0,tokenizeTimeLimit:a=500}=o,c=wp(e);let d=o.grammarState?iH(o.grammarState,n.name)??g_:o.grammarContextCode!=null?Z0(o.grammarContextCode,t,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:g_,p=[];const f=[];for(let g=0,b=c.length;g<b;g++){const[C,x]=c[g];if(C===""){p=[],f.push([]);continue}if(h>0&&C.length>=h){p=[],f.push([{content:C,offset:x,color:"",fontStyle:0}]);continue}let y,_,v;o.includeExplanation&&(y=t.tokenizeLine(C,d,a),_=y.tokens,v=0);const S=t.tokenizeLine2(C,d,a),E=S.tokens.length/2;for(let T=0;T<E;T++){const A=S.tokens[2*T],M=T+1<E?S.tokens[2*T+2]:C.length;if(A===M)continue;const L=S.tokens[2*T+1],D=fo(s[Hl.getForeground(L)],u),U=Hl.getFontStyle(L),z={content:C.substring(A,M),offset:x+A,color:D,fontStyle:U};if(o.includeExplanation){const W=[];if(o.includeExplanation!=="scopeName")for(const Y of n.settings){let $;switch(typeof Y.scope){case"string":$=Y.scope.split(/,/).map(F=>F.trim());break;case"object":$=Y.scope;break;default:continue}W.push({settings:Y,selectors:$.map(F=>F.split(/ /))})}z.explanation=[];let N=0;for(;A+N<M;){const Y=_[v],$=C.substring(Y.startIndex,Y.endIndex);N+=$.length,z.explanation.push({content:$,scopes:o.includeExplanation==="scopeName"?bH(Y.scopes):SH(W,Y.scopes)}),v+=1}}p.push(z)}f.push(p),p=[],d=S.ruleStack}return{tokens:f,stateStack:d}}function bH(e){return e.map(t=>({scopeName:t}))}function SH(e,t){const n=[];for(let s=0,o=t.length;s<o;s++){const u=t[s];n[s]={scopeName:u,themeMatches:CH(e,u,t.slice(0,s))}}return n}function bw(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function xH(e,t,n){if(!bw(e[e.length-1],t))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)bw(e[s],n[o])&&(s-=1),o-=1;return s===-1}function CH(e,t,n){const s=[];for(const{selectors:o,settings:u}of e)for(const h of o)if(xH(h,t,n)){s.push(u);break}return s}function kT(e,t,n){const s=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),o=s.map(c=>{const d=Q0(e,t,{...n,theme:c.theme}),p=Pu(d),f=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:d,state:p,theme:f}}),u=wH(...o.map(c=>c.tokens)),h=u[0].map((c,d)=>c.map((p,f)=>{const g={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=p.explanation),u.forEach((b,C)=>{const{content:x,explanation:y,offset:_,...v}=b[d][f];g.variants[s[C].color]=v}),g})),a=o[0].state?new tc(Object.fromEntries(o.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),o[0].state.lang):void 0;return a&&Ep(h,a),h}function wH(...e){const t=e.map(()=>[]),n=e.length;for(let s=0;s<e[0].length;s++){const o=e.map(c=>c[s]),u=t.map(()=>[]);t.forEach((c,d)=>c.push(u[d]));const h=o.map(()=>0),a=o.map(c=>c[0]);for(;a.every(c=>c);){const c=Math.min(...a.map(d=>d.content.length));for(let d=0;d<n;d++){const p=a[d];p.content.length===c?(u[d].push(p),h[d]+=1,a[d]=o[d][h[d]]):(u[d].push({...p,content:p.content.slice(0,c)}),a[d]={...p,content:p.content.slice(c),offset:p.offset+c})}}}return t}function qh(e,t,n){let s,o,u,h,a,c;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:p="--shiki-",colorsRendering:f="css-vars"}=n,g=Object.entries(n.themes).filter(_=>_[1]).map(_=>({color:_[0],theme:_[1]})).sort((_,v)=>_.color===d?-1:v.color===d?1:0);if(g.length===0)throw new Sn("`themes` option must not be empty");const b=kT(e,t,n);if(c=Pu(b),d&&X0!==d&&!g.find(_=>_.color===d))throw new Sn(`\`themes\` option must contain the defaultColor key \`${d}\``);const C=g.map(_=>e.getTheme(_.theme)),x=g.map(_=>_.color);u=b.map(_=>_.map(v=>rH(v,x,p,d,f))),c&&Ep(u,c);const y=g.map(_=>Fh(_.theme,n));o=Sw(g,C,y,p,d,"fg",f),s=Sw(g,C,y,p,d,"bg",f),h=`shiki-themes ${C.map(_=>_.name).join(" ")}`,a=d?void 0:[o,s].join(";")}else if("theme"in n){const d=Fh(n.theme,n);u=Q0(e,t,n);const p=e.getTheme(n.theme);s=fo(p.bg,d),o=fo(p.fg,d),h=p.name,c=Pu(u)}else throw new Sn("Invalid options, either `theme` or `themes` must be provided");return{tokens:u,fg:o,bg:s,themeName:h,rootStyle:a,grammarState:c}}function Sw(e,t,n,s,o,u,h){return e.map((a,c)=>{const d=fo(t[c][u],n[c])||"inherit",p=`${s+a.color}${u==="bg"?"-bg":""}:${d}`;if(c===0&&o){if(o===X0&&e.length>1){const f=e.findIndex(x=>x.color==="light"),g=e.findIndex(x=>x.color==="dark");if(f===-1||g===-1)throw new Sn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=fo(t[f][u],n[f])||"inherit",C=fo(t[g][u],n[g])||"inherit";return`light-dark(${b}, ${C});${p}`}return d}return h==="css-vars"?p:null}).filter(a=>!!a).join(";")}function Gh(e,t,n,s={meta:{},options:n,codeToHast:(o,u)=>Gh(e,o,u),codeToTokens:(o,u)=>qh(e,o,u)}){let o=t;for(const C of Wh(n))o=C.preprocess?.call(s,o,n)||o;let{tokens:u,fg:h,bg:a,themeName:c,rootStyle:d,grammarState:p}=qh(e,o,n);const{mergeWhitespaces:f=!0,mergeSameStyleTokens:g=!1}=n;f===!0?u=RH(u):f==="never"&&(u=kH(u)),g&&(u=TH(u));const b={...s,get source(){return o}};for(const C of Wh(n))u=C.tokens?.call(b,u)||u;return EH(u,{...n,fg:h,bg:a,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},b,p)}function EH(e,t,n,s=Pu(e)){const o=Wh(t),u=[],h={type:"root",children:[]},{structure:a="classic",tabindex:c="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),c!==!1&&c!=null&&(d.tabindex=c.toString());for(const[x,y]of Object.entries(t.meta||{}))x.startsWith("_")||(d[x]=y);let p={type:"element",tagName:"pre",properties:d,children:[]},f={type:"element",tagName:"code",properties:{},children:u};const g=[],b={...n,structure:a,addClassToHast:wT,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return h},get pre(){return p},get code(){return f},get lines(){return g}};if(e.forEach((x,y)=>{y&&(a==="inline"?h.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&u.push({type:"text",value:`
45
+ `}));let _={type:"element",tagName:"span",properties:{class:"line"},children:[]},v=0;for(const S of x){let E={type:"element",tagName:"span",properties:{...S.htmlAttrs},children:[{type:"text",value:S.content}]};const T=S_(S.htmlStyle||Uh(S));T&&(E.properties.style=T);for(const A of o)E=A?.span?.call(b,E,y+1,v,_,S)||E;a==="inline"?h.children.push(E):a==="classic"&&_.children.push(E),v+=S.content.length}if(a==="classic"){for(const S of o)_=S?.line?.call(b,_,y+1)||_;g.push(_),u.push(_)}else a==="inline"&&g.push(_)}),a==="classic"){for(const x of o)f=x?.code?.call(b,f)||f;p.children.push(f);for(const x of o)p=x?.pre?.call(b,p)||p;h.children.push(p)}else if(a==="inline"){const x=[];let y={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const S of h.children)S.type==="element"&&S.tagName==="br"?(x.push(y),y={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(S.type==="element"||S.type==="text")&&y.children.push(S);x.push(y);let v={type:"element",tagName:"code",properties:{},children:x};for(const S of o)v=S?.code?.call(b,v)||v;h.children=[];for(let S=0;S<v.children.length;S++){S>0&&h.children.push({type:"element",tagName:"br",properties:{},children:[]});const E=v.children[S];E.type==="element"&&h.children.push(...E.children)}}let C=h;for(const x of o)C=x?.root?.call(b,C)||C;return s&&Ep(C,s),C}function RH(e){return e.map(t=>{const n=[];let s="",o;return t.forEach((u,h)=>{const c=!(u.fontStyle&&(u.fontStyle&Yn.Underline||u.fontStyle&Yn.Strikethrough));c&&u.content.match(/^\s+$/)&&t[h+1]?(o===void 0&&(o=u.offset),s+=u.content):s?(c?n.push({...u,offset:o,content:s+u.content}):n.push({content:s,offset:o},u),o=void 0,s=""):n.push(u)}),n})}function kH(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,o,u,h]=s;if(!o&&!h)return n;const a=[{...n,offset:n.offset+o.length,content:u}];return o&&a.unshift({content:o,offset:n.offset}),h&&a.push({content:h,offset:n.offset+o.length+u.length}),a}))}function TH(e){return e.map(t=>{const n=[];for(const s of t){if(n.length===0){n.push({...s});continue}const o=n[n.length-1],u=S_(o.htmlStyle||Uh(o)),h=S_(s.htmlStyle||Uh(s)),a=o.fontStyle&&(o.fontStyle&Yn.Underline||o.fontStyle&Yn.Strikethrough),c=s.fontStyle&&(s.fontStyle&Yn.Underline||s.fontStyle&Yn.Strikethrough);!a&&!c&&u===h?o.content+=s.content:n.push({...s})}return n})}const LH=Yz;function AH(e,t,n){const s={meta:{},options:n,codeToHast:(u,h)=>Gh(e,u,h),codeToTokens:(u,h)=>qh(e,u,h)};let o=LH(Gh(e,t,n,s));for(const u of Wh(n))o=u.postprocess?.call(s,o,n)||o;return o}const xw={light:"#333333",dark:"#bbbbbb"},Cw={light:"#fffffe",dark:"#1e1e1e"},ww="__shiki_resolved";function J0(e){if(e?.[ww])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:s}=t;if(!n||!s){const a=t.settings?t.settings.find(c=>!c.name&&!c.scope):void 0;a?.settings?.foreground&&(s=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!s&&t?.colors?.["editor.foreground"]&&(s=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),s||(s=t.type==="light"?xw.light:xw.dark),n||(n=t.type==="light"?Cw.light:Cw.dark),t.fg=s,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const u=new Map;function h(a){if(u.has(a))return u.get(a);o+=1;const c=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${c}`]?h(a):(u.set(a,c),c)}t.settings=t.settings.map(a=>{const c=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),d=a.settings?.background&&!a.settings.background.startsWith("#");if(!c&&!d)return a;const p={...a,settings:{...a.settings}};if(c){const f=h(a.settings.foreground);t.colorReplacements[f]=a.settings.foreground,p.settings.foreground=f}if(d){const f=h(a.settings.background);t.colorReplacements[f]=a.settings.background,p.settings.background=f}return p});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const c=h(t.colors[a]);t.colorReplacements[c]=t.colors[a],t.colors[a]=c}return Object.defineProperty(t,ww,{enumerable:!1,writable:!1,value:!0}),t}async function TT(e){return Array.from(new Set((await Promise.all(e.filter(t=>!xT(t)).map(async t=>await ST(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function LT(e){return(await Promise.all(e.map(async n=>CT(n)?null:J0(await ST(n))))).filter(n=>!!n)}let OH=3;function MH(e,t=3){t>OH||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let bl=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function AT(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new bl(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class DH extends IB{constructor(t,n,s,o={}){super(t),this._resolver=t,this._themes=n,this._langs=s,this._alias=o,this._themes.map(u=>this.loadTheme(u)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=J0(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=jh.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=AT(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(u=>u.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const s={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const o=this.loadGrammarWithConfiguration(t.scopeName,1,s);if(o.name=t.name,this._resolvedGrammars.set(t.name,o),t.aliases&&t.aliases.forEach(u=>{this._alias[u]=t.name}),this._loadedLanguagesCache=null,n.size)for(const u of n)this._resolvedGrammars.delete(u.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(u.scopeName),this._syncRegistry?._grammars?.delete(u.scopeName),this.loadLanguage(this._langMap.get(u.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const o of t)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),s=n.filter(([o,u])=>!u);if(s.length){const o=n.filter(([u,h])=>h?(h.embeddedLanguages||h.embeddedLangs)?.some(c=>s.map(([d])=>d).includes(c)):!1).filter(u=>!s.includes(u));throw new bl(`Missing languages ${s.map(([u])=>`\`${u}\``).join(", ")}, required by ${o.map(([u])=>`\`${u}\``).join(", ")}`)}for(const[o,u]of n)this._resolver.addLanguage(u);for(const[o,u]of n)this.loadLanguage(u)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const s of n)this._langGraph.set(s,this._langMap.get(s))}}class PH{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:s=>t.createScanner(s),createOnigString:s=>t.createString(s)},n.forEach(s=>this.addLanguage(s))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let s=[];for(let o=1;o<=n.length;o++){const u=n.slice(0,o).join(".");s=[...s,...this._injections.get(u)||[]]}return s}}let su=0;function IH(e){su+=1,e.warnings!==!1&&su>=10&&su%10===0&&console.warn(`[Shiki] ${su} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new bl("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(J0),o=new PH(e.engine,n),u=new DH(o,s,n,e.langAlias);let h;function a(S){return AT(S,e.langAlias)}function c(S){_();const E=u.getGrammar(typeof S=="string"?S:S.name);if(!E)throw new bl(`Language \`${S}\` not found, you may need to load it first`);return E}function d(S){if(S==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};_();const E=u.getTheme(S);if(!E)throw new bl(`Theme \`${S}\` not found, you may need to load it first`);return E}function p(S){_();const E=d(S);h!==S&&(u.setTheme(E),h=S);const T=u.getColorMap();return{theme:E,colorMap:T}}function f(){return _(),u.getLoadedThemes()}function g(){return _(),u.getLoadedLanguages()}function b(...S){_(),u.loadLanguages(S.flat(1))}async function C(...S){return b(await TT(S))}function x(...S){_();for(const E of S.flat(1))u.loadTheme(E)}async function y(...S){return _(),x(await LT(S))}function _(){if(t)throw new bl("Shiki instance has been disposed")}function v(){t||(t=!0,u.dispose(),su-=1)}return{setTheme:p,getTheme:d,getLanguage:c,getLoadedThemes:f,getLoadedLanguages:g,resolveLangAlias:a,loadLanguage:C,loadLanguageSync:b,loadTheme:y,loadThemeSync:x,dispose:v,[Symbol.dispose]:v}}async function NH(e){e.engine||MH("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,s]=await Promise.all([LT(e.themes||[]),TT(e.langs||[]),e.engine]);return IH({...e,themes:t,langs:n,engine:s})}async function jH(e){const t=await NH(e);return{getLastGrammarState:(...n)=>_H(t,...n),codeToTokensBase:(n,s)=>Q0(t,n,s),codeToTokensWithThemes:(n,s)=>kT(t,n,s),codeToTokens:(n,s)=>qh(t,n,s),codeToHast:(n,s)=>Gh(t,n,s),codeToHtml:(n,s)=>AH(t,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function BH(e){const t=e.langs,n=e.themes,s=e.engine;async function o(u){function h(f){if(typeof f=="string"){if(f=u.langAlias?.[f]||f,xT(f))return[];const g=t[f];if(!g)throw new Sn(`Language \`${f}\` is not included in this bundle. You may want to load it from external source.`);return g}return f}function a(f){if(CT(f))return"none";if(typeof f=="string"){const g=n[f];if(!g)throw new Sn(`Theme \`${f}\` is not included in this bundle. You may want to load it from external source.`);return g}return f}const c=(u.themes??[]).map(f=>a(f)),d=(u.langs??[]).map(f=>h(f)),p=await jH({engine:u.engine??s(),...u,themes:c,langs:d});return{...p,loadLanguage(...f){return p.loadLanguage(...f.map(h))},loadTheme(...f){return p.loadTheme(...f.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return o}const OT=[{id:"abap",name:"ABAP",import:(()=>te(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>te(()=>import("./actionscript-3-CfeIJUat.js"),[]))},{id:"ada",name:"Ada",import:(()=>te(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>te(()=>import("./angular-html-CU67Zn6k.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>te(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>te(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>te(()=>import("./apex-DDbsPZ6N.js"),[]))},{id:"apl",name:"APL",import:(()=>te(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>te(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>te(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>te(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>te(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>te(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>te(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>te(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>te(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>te(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>te(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>te(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>te(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>te(()=>import("./blade-DVc8C-J4.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>te(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>te(()=>import("./c-BIGW1oBm.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>te(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>te(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>te(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>te(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>te(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>te(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>te(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>te(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>te(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>te(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>te(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>te(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>te(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>te(()=>import("./csharp-K5feNrxe.js"),[]))},{id:"css",name:"CSS",import:(()=>te(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>te(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>te(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>te(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>te(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>te(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>te(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>te(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>te(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>te(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>te(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>te(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>te(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>te(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>te(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>te(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>te(()=>import("./erb-BOJIQeun.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>te(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>te(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>te(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>te(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>te(()=>import("./fortran-fixed-form-BZjJHVRy.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>te(()=>import("./fortran-free-form-D22FLkUw.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>te(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>te(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>te(()=>import("./gdscript-DTMYz4Jt.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>te(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>te(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>te(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>te(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>te(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>te(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>te(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>te(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>te(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gnuplot",name:"Gnuplot",import:(()=>te(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>te(()=>import("./go-Dn2_MT6a.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>te(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>te(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>te(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>te(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>te(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>te(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>te(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>te(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>te(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>te(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>te(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>te(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>te(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>te(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>te(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>te(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>te(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>te(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>te(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>te(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>te(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>te(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>te(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>te(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>te(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>te(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>te(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>te(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>te(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>te(()=>import("./julia-C8NyazO9.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>te(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>te(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>te(()=>import("./kusto-BvAqAH-y.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>te(()=>import("./latex-BdAV_C_H.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>te(()=>import("./lean-Bc6EcWN3.js"),[]))},{id:"less",name:"Less",import:(()=>te(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>te(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>te(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>te(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>te(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>te(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>te(()=>import("./luau-CXu1NL6O.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>te(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>te(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>te(()=>import("./marko-CPi9NSCl.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>te(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>te(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>te(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>te(()=>import("./mermaid-DKYwYmdq.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>te(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>te(()=>import("./mojo-1DNp92w6.js"),[]))},{id:"move",name:"Move",import:(()=>te(()=>import("./move-Bu9oaDYs.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>te(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>te(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>te(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>te(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>te(()=>import("./nix-c8nO5XWb.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>te(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>te(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>te(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>te(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>te(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>te(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>te(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>te(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>te(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>te(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>te(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>te(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>te(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>te(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>te(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>te(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>te(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>te(()=>import("./proto-DyJlTyXw.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>te(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>te(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>te(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>te(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>te(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>te(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>te(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>te(()=>import("./r-DiinP2Uv.js"),[]))},{id:"racket",name:"Racket",import:(()=>te(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>te(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>te(()=>import("./razor-CE9lU5zL.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>te(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>te(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>te(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>te(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>te(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>te(()=>import("./rst-B0xPkSld.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>te(()=>import("./ruby-BvKwtOVI.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>te(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>te(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>te(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>te(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>te(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>te(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>te(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>te(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>te(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>te(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>te(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>te(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>te(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>te(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>te(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>te(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>te(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>te(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>te(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>te(()=>import("./svelte-3Dk4HxPD.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>te(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>te(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>te(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>te(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>te(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>te(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>te(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>te(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>te(()=>import("./tex-CxkMU7Pf.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>te(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>te(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>te(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>te(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>te(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>te(()=>import("./twig-CO9l9SDP.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>te(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>te(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>te(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>te(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>te(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>te(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>te(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>te(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>te(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>te(()=>import("./vue-DnHKYNfI.js"),__vite__mapDeps([92,3,2,11,9,15,1])))},{id:"vue-html",name:"Vue HTML",import:(()=>te(()=>import("./vue-html-CChd_i61.js"),__vite__mapDeps([93,92,3,2,11,9,15,1])))},{id:"vue-vine",name:"Vue Vine",import:(()=>te(()=>import("./vue-vine-8moa0y9V.js"),__vite__mapDeps([94,3,5,67,95,12,92,2,11,9,15,1])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>te(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>te(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>te(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>te(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>te(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>te(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>te(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>te(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>te(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>te(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>te(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>te(()=>import("./zig-VOosw3JB.js"),[]))}],zH=Object.fromEntries(OT.map(e=>[e.id,e.import])),HH=Object.fromEntries(OT.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),VH={...zH,...HH},FH=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>te(()=>import("./andromeeda-C-Jbm3Hp.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>te(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>te(()=>import("./ayu-dark-Cv9koXgw.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>te(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>te(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>te(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>te(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>te(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>te(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>te(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>te(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>te(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>te(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>te(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>te(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>te(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>te(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>te(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>te(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>te(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>te(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>te(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>te(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>te(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>te(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>te(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>te(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>te(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>te(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>te(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>te(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>te(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>te(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>te(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>te(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>te(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>te(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>te(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>te(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>te(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>te(()=>import("./one-light-PoHY5YXO.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>te(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>te(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>te(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>te(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>te(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>te(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>te(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>te(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>te(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>te(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>te(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>te(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>te(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>te(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>te(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>te(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>te(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],UH=Object.fromEntries(FH.map(e=>[e.id,e.import]));class ey extends Error{constructor(t){super(t),this.name="ShikiError"}}function WH(){return 2147483648}function qH(){return typeof performance<"u"?performance.now():Date.now()}const GH=(e,t)=>e+(t-e%t)%t;async function $H(e){let t,n;const s={};function o(b){n=b,s.HEAPU8=new Uint8Array(b),s.HEAPU32=new Uint32Array(b)}function u(b,C,x){s.HEAPU8.copyWithin(b,C,C+x)}function h(b){try{return t.grow(b-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function a(b){const C=s.HEAPU8.length;b=b>>>0;const x=WH();if(b>x)return!1;for(let y=1;y<=4;y*=2){let _=C*(1+.2/y);_=Math.min(_,b+100663296);const v=Math.min(x,GH(Math.max(b,_),65536));if(h(v))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(b,C,x=1024){const y=C+x;let _=C;for(;b[_]&&!(_>=y);)++_;if(_-C>16&&b.buffer&&c)return c.decode(b.subarray(C,_));let v="";for(;C<_;){let S=b[C++];if(!(S&128)){v+=String.fromCharCode(S);continue}const E=b[C++]&63;if((S&224)===192){v+=String.fromCharCode((S&31)<<6|E);continue}const T=b[C++]&63;if((S&240)===224?S=(S&15)<<12|E<<6|T:S=(S&7)<<18|E<<12|T<<6|b[C++]&63,S<65536)v+=String.fromCharCode(S);else{const A=S-65536;v+=String.fromCharCode(55296|A>>10,56320|A&1023)}}return v}function p(b,C){return b?d(s.HEAPU8,b,C):""}const f={emscripten_get_now:qH,emscripten_memcpy_big:u,emscripten_resize_heap:a,fd_write:()=>0};async function g(){const C=await e({env:f,wasi_snapshot_preview1:f});t=C.memory,o(t.buffer),Object.assign(s,C),s.UTF8ToString=p}return await g(),s}var KH=Object.defineProperty,YH=(e,t,n)=>t in e?KH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tn=(e,t,n)=>YH(e,typeof t!="symbol"?t+"":t,n);let Dn=null;function XH(e){throw new ey(e.UTF8ToString(e.getLastOnigError()))}class Rp{constructor(t){Tn(this,"utf16Length"),Tn(this,"utf8Length"),Tn(this,"utf16Value"),Tn(this,"utf8Value"),Tn(this,"utf16OffsetToUtf8"),Tn(this,"utf8OffsetToUtf16");const n=t.length,s=Rp._utf8ByteLength(t),o=s!==n,u=o?new Uint32Array(n+1):null;o&&(u[n]=s);const h=o?new Uint32Array(s+1):null;o&&(h[s]=n);const a=new Uint8Array(s);let c=0;for(let d=0;d<n;d++){const p=t.charCodeAt(d);let f=p,g=!1;if(p>=55296&&p<=56319&&d+1<n){const b=t.charCodeAt(d+1);b>=56320&&b<=57343&&(f=(p-55296<<10)+65536|b-56320,g=!0)}o&&(u[d]=c,g&&(u[d+1]=c),f<=127?h[c+0]=d:f<=2047?(h[c+0]=d,h[c+1]=d):f<=65535?(h[c+0]=d,h[c+1]=d,h[c+2]=d):(h[c+0]=d,h[c+1]=d,h[c+2]=d,h[c+3]=d)),f<=127?a[c++]=f:f<=2047?(a[c++]=192|(f&1984)>>>6,a[c++]=128|(f&63)>>>0):f<=65535?(a[c++]=224|(f&61440)>>>12,a[c++]=128|(f&4032)>>>6,a[c++]=128|(f&63)>>>0):(a[c++]=240|(f&1835008)>>>18,a[c++]=128|(f&258048)>>>12,a[c++]=128|(f&4032)>>>6,a[c++]=128|(f&63)>>>0),g&&d++}this.utf16Length=n,this.utf8Length=s,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=u,this.utf8OffsetToUtf16=h}static _utf8ByteLength(t){let n=0;for(let s=0,o=t.length;s<o;s++){const u=t.charCodeAt(s);let h=u,a=!1;if(u>=55296&&u<=56319&&s+1<o){const c=t.charCodeAt(s+1);c>=56320&&c<=57343&&(h=(u-55296<<10)+65536|c-56320,a=!0)}h<=127?n+=1:h<=2047?n+=2:h<=65535?n+=3:n+=4,a&&s++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const kp=class ks{constructor(t){if(Tn(this,"id",++ks.LAST_ID),Tn(this,"_onigBinding"),Tn(this,"content"),Tn(this,"utf16Length"),Tn(this,"utf8Length"),Tn(this,"utf16OffsetToUtf8"),Tn(this,"utf8OffsetToUtf16"),Tn(this,"ptr"),!Dn)throw new ey("Must invoke loadWasm first.");this._onigBinding=Dn,this.content=t;const n=new Rp(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!ks._sharedPtrInUse?(ks._sharedPtr||(ks._sharedPtr=Dn.omalloc(1e4)),ks._sharedPtrInUse=!0,Dn.HEAPU8.set(n.utf8Value,ks._sharedPtr),this.ptr=ks._sharedPtr):this.ptr=n.createString(Dn)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===ks._sharedPtr?ks._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Tn(kp,"LAST_ID",0);Tn(kp,"_sharedPtr",0);Tn(kp,"_sharedPtrInUse",!1);let MT=kp;class QH{constructor(t){if(Tn(this,"_onigBinding"),Tn(this,"_ptr"),!Dn)throw new ey("Must invoke loadWasm first.");const n=[],s=[];for(let a=0,c=t.length;a<c;a++){const d=new Rp(t[a]);n[a]=d.createString(Dn),s[a]=d.utf8Length}const o=Dn.omalloc(4*t.length);Dn.HEAPU32.set(n,o/4);const u=Dn.omalloc(4*t.length);Dn.HEAPU32.set(s,u/4);const h=Dn.createOnigScanner(o,u,t.length);for(let a=0,c=t.length;a<c;a++)Dn.ofree(n[a]);Dn.ofree(u),Dn.ofree(o),h===0&&XH(Dn),this._onigBinding=Dn,this._ptr=h}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof t=="string"){t=new MT(t);const u=this._findNextMatchSync(t,n,!1,o);return t.dispose(),u}return this._findNextMatchSync(t,n,!1,o)}_findNextMatchSync(t,n,s,o){const u=this._onigBinding,h=u.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(h===0)return null;const a=u.HEAPU32;let c=h/4;const d=a[c++],p=a[c++],f=[];for(let g=0;g<p;g++){const b=t.convertUtf8OffsetToUtf16(a[c++]),C=t.convertUtf8OffsetToUtf16(a[c++]);f[g]={start:b,end:C,length:C-b}}return{index:d,captureIndices:f}}}function ZH(e){return typeof e.instantiator=="function"}function JH(e){return typeof e.default=="function"}function eV(e){return typeof e.data<"u"}function tV(e){return typeof Response<"u"&&e instanceof Response}function nV(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Zf;function rV(e){if(Zf)return Zf;async function t(){Dn=await $H(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),ZH(s)?s=await s.instantiator(n):JH(s)?s=await s.default(n):(eV(s)&&(s=s.data),tV(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await sV(s)(n):s=await iV(s)(n):nV(s)?s=await Lv(s)(n):s instanceof WebAssembly.Module?s=await Lv(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Lv(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return Zf=t(),Zf}function Lv(e){return t=>WebAssembly.instantiate(e,t)}function sV(e){return t=>WebAssembly.instantiateStreaming(e,t)}function iV(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function oV(e){return e&&await rV(e),{createScanner(t){return new QH(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new MT(t)}}}const aV=BH({langs:VH,themes:UH,engine:()=>oV(te(()=>import("./wasm-CG6Dc4jp.js"),[]))});let Jf=null,eh=null;const lV=["typescript","tsx","javascript","jsx","json","css","html","markdown","yaml","toml","bash","shell","python","rust","go","sql","diff","plaintext"];async function cV(){return Jf||eh||(eh=aV({themes:["github-dark"],langs:lV}),Jf=await eh,Jf)}async function uV(e,t){const n=await cV(),s=dV(t);if(!n.getLoadedLanguages().includes(s))try{await n.loadLanguage(s)}catch{return n.codeToHtml(e,{lang:"plaintext",theme:"github-dark"})}return n.codeToHtml(e,{lang:s,theme:"github-dark"})}function dV(e){return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rb:"ruby",rs:"rust",sh:"bash",yml:"yaml",md:"markdown"}[e]||e}function fV(e){const t=e.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",css:"css",html:"html",md:"markdown",yaml:"yaml",yml:"yaml",toml:"toml",sh:"bash",bash:"bash",zsh:"bash",py:"python",rs:"rust",go:"go",sql:"sql",diff:"diff",txt:"plaintext"}[t]||"plaintext"}function hV({filePath:e,content:t,isLoading:n,error:s,onClose:o}){const[u,h]=k.useState(null),[a,c]=k.useState(!1),[d,p]=k.useState(!0);if(k.useEffect(()=>{if(!t||!e){h(null);return}if(t.mimeType.startsWith("image/")||t.mimeType==="application/octet-stream"){h(null);return}c(!0);const g=fV(e);uV(t.content,g).then(b=>{h(b),c(!1)}).catch(()=>{h(null),c(!1)})},[t,e]),!e)return w.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Select a file to view"});if(n)return w.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading file..."});if(s)return w.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:s.message});if(!t)return w.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Unable to load file"});if(t.mimeType==="application/octet-stream")return w.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-muted-foreground text-sm gap-2",children:[w.jsx("p",{children:"Binary file"}),w.jsxs("p",{className:"text-xs",children:[(t.size/1024).toFixed(1)," KB"]})]});if(t.mimeType.startsWith("image/"))return w.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[w.jsxs("div",{className:"flex shrink-0 items-center justify-between px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[w.jsx("span",{className:"text-muted-foreground truncate",title:e,children:e.split("/").pop()||e}),w.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:w.jsx(Ee,{icon:ho,size:14,strokeWidth:2})})]}),w.jsx("div",{className:"flex flex-1 items-center justify-center p-4 bg-[#0d1117]",children:w.jsx("img",{src:t.content,alt:e,className:"max-w-full max-h-full object-contain"})})]});const f=e.split("/").pop()||e;return w.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[w.jsxs("div",{className:"flex shrink-0 items-center gap-3 px-2 py-1.5 bg-muted/50 border-b border-border text-xs",children:[w.jsx("span",{className:"text-muted-foreground truncate flex-1",title:e,children:f}),t.truncated&&w.jsxs("span",{className:"text-yellow-500",children:["Truncated (",t.lineCount.toLocaleString()," lines)"]}),w.jsxs("span",{className:"text-muted-foreground",children:[(t.size/1024).toFixed(1)," KB"]}),w.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer text-muted-foreground hover:text-foreground",children:[w.jsx("input",{type:"checkbox",checked:d,onChange:g=>p(g.target.checked),className:"w-3 h-3"}),"Wrap"]}),w.jsx("button",{onClick:o,className:"p-1 text-muted-foreground hover:text-foreground rounded hover:bg-muted/50",title:"Close file",children:w.jsx(Ee,{icon:ho,size:14,strokeWidth:2})})]}),w.jsx(Xu,{className:"flex-1 min-h-0",children:a?w.jsx("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm",children:"Highlighting..."}):u?w.jsx("div",{className:Be("text-xs [&_pre]:!bg-transparent [&_pre]:!m-0 [&_pre]:!p-2 [&_code]:!bg-transparent",d?"[&_pre]:whitespace-pre-wrap [&_pre]:break-all":"[&_pre]:whitespace-pre"),dangerouslySetInnerHTML:{__html:u}}):w.jsx("pre",{className:Be("p-2 font-mono text-xs",d?"whitespace-pre-wrap break-all":"whitespace-pre"),children:t.content})})]})}function pV({taskId:e,worktreePath:t}){const{selectedFile:n,expandedDirs:s,setSelectedFile:o,toggleDir:u,collapseAll:h}=qj(e),{data:a,isLoading:c,error:d}=n9(t),{data:p,isLoading:f,error:g}=r9(t,n),b=k.useCallback(y=>{o(y)},[o]),C=k.useCallback(()=>{o(null)},[o]),x=k.useCallback(y=>{u(y)},[u]);return t?c?w.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"Loading files..."}):d?w.jsx("div",{className:"flex h-full items-center justify-center text-destructive text-sm",children:d.message}):w.jsxs($o,{direction:"horizontal",className:"h-full",children:[w.jsx(Xr,{defaultSize:65,minSize:30,className:"overflow-hidden",children:w.jsx(hV,{filePath:n,content:p??null,isLoading:f,error:g,onClose:C})}),w.jsx(Ko,{withHandle:!0}),w.jsx(Xr,{defaultSize:35,minSize:15,children:w.jsx(Xu,{className:"h-full",children:w.jsx($j,{entries:a?.entries||[],selectedFile:n,expandedDirs:s,onSelectFile:b,onToggleDir:x,onCollapseAll:h})})})]}):w.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground text-sm",children:"No worktree selected"})}function mV({...e}){return w.jsx(pI,{"data-slot":"dropdown-menu",...e})}function gV({...e}){return w.jsx(vI,{"data-slot":"dropdown-menu-trigger",...e})}function vV({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:s=4,className:o,...u}){return w.jsx(nI,{children:w.jsx(rI,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:s,children:w.jsx(eI,{"data-slot":"dropdown-menu-content",className:Be("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",o),...u})})})}function _V({...e}){return w.jsx(iI,{"data-slot":"dropdown-menu-radio-group",...e})}function yV({className:e,children:t,...n}){return w.jsxs(aI,{"data-slot":"dropdown-menu-radio-item",className:Be("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[w.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none","data-slot":"dropdown-menu-radio-item-indicator",children:w.jsx(lI,{children:w.jsx(Ee,{icon:ju,strokeWidth:2})})}),t]})}const DT=Ns("/tasks/$taskId")({component:SV}),Ew={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled"},bV={IN_PROGRESS:"bg-blue-500/20 text-blue-500",IN_REVIEW:"bg-yellow-500/20 text-yellow-600",DONE:"bg-green-500/20 text-green-600",CANCELED:"bg-red-500/20 text-red-500"};function SV(){const{taskId:e}=DT.useParams(),t=po(),n=kO(),{data:s,isLoading:o}=qR(e),u=A0(),h=QI(),{tab:a,setTab:c}=jj(e),d=xk(),p=Ck(),f=wk(),{data:g}=$R(),{data:b}=KR(),{data:C}=Bj(s?.linearTicketId??null),x=n.state,y=x?.planMode&&x?.description?x.description:void 0,[_,v]=k.useState(!1),[S,E]=k.useState(null),[T,A]=k.useState(!1),[M,L]=k.useState(!1),[D,U]=k.useState(null),[z,W]=k.useState(!1),[N,Y]=k.useState(!1),[$,F]=k.useState(null),[q,H]=k.useState(!1),[P,B]=k.useState(!1),[I,G]=k.useState(!1),{terminals:K,writeToTerminal:J}=V0();k.useEffect(()=>{if(M){const ae=setTimeout(()=>L(!1),3e3);return()=>clearTimeout(ae)}},[M]),k.useEffect(()=>{if(N){const ae=setTimeout(()=>Y(!1),3e3);return()=>clearTimeout(ae)}},[N]),k.useEffect(()=>{if(P){const ae=setTimeout(()=>B(!1),3e3);return()=>clearTimeout(ae)}},[P]);const Z=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){E(null),L(!1);try{await d.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),L(!0)}catch(ae){const be=ae instanceof Error?ae.message:"Sync failed";E(be),A(!0)}}},ee=()=>{if(!s||!S)return"";const ae=s.baseBranch||"main";return`Fix the git sync issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${ae} | Error: ${S} | Steps: 1) Check git status 2) Resolve conflicts or commit/stash changes 3) Rebase onto the parent repo's ${ae} branch`},X=()=>{if(!s||!D)return"";const ae=s.baseBranch||"main";return`Fix the git merge issue. Worktree: ${s.worktreePath} | Parent repo: ${s.repoPath} | Branch: ${s.branch} | Base: ${ae} | Error: ${D} | Steps: 1) Check git status in both worktree and parent 2) Resolve any conflicts 3) Ensure worktree changes are committed 4) Retry merge to ${ae} 5) On successful merge, run: vibora tasks move ${s.id} --status done`},V=async()=>{if(!(!s?.repoPath||!s?.worktreePath)){U(null),Y(!1);try{await p.mutateAsync({repoPath:s.repoPath,worktreePath:s.worktreePath,baseBranch:s.baseBranch}),Y(!0),u.mutate({taskId:s.id,updates:{status:"DONE"}})}catch(ae){const be=ae instanceof Error?ae.message:"Merge failed";U(be),W(!0)}}},se=async()=>{if(s?.repoPath){F(null),B(!1);try{await f.mutateAsync({repoPath:s.repoPath,baseBranch:s.baseBranch}),B(!0)}catch(ae){const be=ae instanceof Error?ae.message:"Sync parent failed";F(be),H(!0)}}},re=()=>{if(!s||!$)return"";const ae=s.baseBranch||"main";return`Fix the git sync parent issue. Parent repo: ${s.repoPath} | Base branch: ${ae} | Error: ${$} | Steps: 1) Check git status in parent repo 2) Resolve any local changes or divergence 3) Fetch and merge/rebase from origin/${ae}`},ne=K.find(ae=>ae.cwd===s?.worktreePath),oe=()=>{if(!ne)return;const ae=ee();J(ne.id,ae+"\r"),A(!1)},ce=()=>{if(!ne)return;const be=`claude -p "${ee().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;J(ne.id,be),A(!1)},ve=()=>{if(!ne)return;const ae=X();J(ne.id,ae+"\r"),W(!1)},ge=()=>{if(!ne)return;const be=`claude -p "${X().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;J(ne.id,be),W(!1)},he=()=>{if(!ne)return;const ae=re();J(ne.id,ae+"\r"),H(!1)},de=()=>{if(!ne)return;const be=`claude -p "${re().replace(/"/g,'\\"')}" --dangerously-skip-permissions\r`;J(ne.id,be),H(!1)},Le=()=>{G(!0)},Oe=()=>{if(!s?.worktreePath)return;const ae=tw(s.worktreePath,g,b);window.open(ae,"_blank"),G(!1)},Ne=()=>{if(!s?.repoPath)return;const ae=tw(s.repoPath,g,b);window.open(ae,"_blank"),G(!1)},ye=ae=>{s&&u.mutate({taskId:s.id,updates:{status:ae}})},Ae=()=>{s&&h.mutate(s.id,{onSuccess:()=>{t({to:"/tasks"})}})};return o?w.jsx("div",{className:"flex h-full items-center justify-center",children:w.jsx("p",{className:"text-muted-foreground",children:"Loading task..."})}):s?w.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[w.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[w.jsxs("div",{className:"flex-1",children:[w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx("h1",{className:"text-sm font-medium",children:s.title}),w.jsx("button",{type:"button",className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>v(!0),title:"Task settings",children:w.jsx(Ee,{icon:F2,size:14,strokeWidth:2})})]}),w.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[w.jsx("span",{children:s.repoName}),w.jsx(Ee,{icon:qv,size:12,strokeWidth:2}),w.jsx("span",{className:"font-mono",children:s.branch}),s.prUrl&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-muted-foreground/50",children:"•"}),w.jsxs("a",{href:s.prUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:ae=>ae.stopPropagation(),children:[w.jsx(Ee,{icon:z2,size:14,strokeWidth:2}),w.jsxs("span",{children:["#",s.prUrl.match(/\/pull\/(\d+)/)?.[1]??"PR"]})]})]}),s.linearTicketUrl&&w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"text-muted-foreground/50",children:"•"}),w.jsxs("a",{href:s.linearTicketUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-foreground hover:text-primary font-medium",onClick:ae=>ae.stopPropagation(),title:C?.title,children:[w.jsx(Ee,{icon:U_,size:14,strokeWidth:2}),w.jsx("span",{children:s.linearTicketId}),C?.status&&w.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",C.status,")"]})]})]})]})]}),w.jsxs(mV,{children:[w.jsx(gV,{render:w.jsx(Ve,{variant:"ghost",size:"sm",className:bV[s.status]}),children:Ew[s.status]}),w.jsx(vV,{align:"end",children:w.jsx(_V,{value:s.status,onValueChange:ye,children:Object.entries(Ew).map(([ae,be])=>w.jsx(yV,{value:ae,children:be},ae))})})]}),w.jsx(Ve,{variant:"ghost",size:"icon-sm",onClick:Z,disabled:d.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Pull from main",children:w.jsx(Ee,{icon:A2,size:16,strokeWidth:2,className:d.isPending?"animate-spin":""})}),w.jsx(Ve,{variant:"ghost",size:"icon-sm",onClick:V,disabled:p.isPending||!s.worktreePath,className:"text-muted-foreground hover:text-foreground",title:"Merge to main",children:w.jsx(Ee,{icon:P2,size:16,strokeWidth:2,className:p.isPending?"animate-pulse":""})}),w.jsx(Ve,{variant:"ghost",size:"icon-sm",onClick:se,disabled:f.isPending||!s.repoPath,className:"text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:w.jsx(Ee,{icon:H2,size:16,strokeWidth:2,className:f.isPending?"animate-spin":""})}),w.jsx(Ve,{variant:"ghost",size:"icon-sm",onClick:Le,className:"text-muted-foreground hover:text-foreground",title:"Open in VS Code",children:w.jsx(Ee,{icon:t4,size:16,strokeWidth:2})}),M&&w.jsx("span",{className:"text-xs text-green-600",children:"Synced!"}),N&&w.jsx("span",{className:"text-xs text-green-600",children:"Merged!"}),P&&w.jsx("span",{className:"text-xs text-green-600",children:"Parent synced!"}),w.jsxs(Qu,{children:[w.jsx(Zu,{render:w.jsx(Ve,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive"}),children:w.jsx(Ee,{icon:Nu,size:16,strokeWidth:2})}),w.jsxs(Ju,{children:[w.jsxs(ed,{children:[w.jsx(nd,{children:"Delete Task"}),w.jsxs(rd,{children:['This will permanently delete "',s.title,'", close its terminal, and remove its worktree. This action cannot be undone.']})]}),w.jsxs(td,{children:[w.jsx(sd,{children:"Cancel"}),w.jsx(nk,{onClick:Ae,variant:"destructive",disabled:h.isPending,children:h.isPending?"Deleting...":"Delete"})]})]})]})]}),w.jsxs($o,{direction:"horizontal",className:"min-h-0 flex-1",children:[w.jsx(Xr,{defaultSize:50,minSize:30,children:w.jsx(zj,{taskId:s.id,taskName:s.title,cwd:s.worktreePath,planModeDescription:y,startupScript:s.startupScript})}),w.jsx(Ko,{withHandle:!0}),w.jsx(Xr,{defaultSize:50,minSize:30,children:w.jsxs(C0,{value:a,onValueChange:c,className:"flex h-full flex-col",children:[w.jsx("div",{className:"shrink-0 border-b border-border px-2 py-1",children:w.jsxs(w0,{variant:"line",children:[w.jsxs(kl,{value:"diff",children:[w.jsx(Ee,{icon:H3,size:14,strokeWidth:2,"data-slot":"icon"}),"Diff"]}),w.jsxs(kl,{value:"browser",children:[w.jsx(Ee,{icon:N3,size:14,strokeWidth:2,"data-slot":"icon"}),"Browser"]}),w.jsxs(kl,{value:"files",children:[w.jsx(Ee,{icon:ms,size:14,strokeWidth:2,"data-slot":"icon"}),"Files"]})]})}),w.jsx(pu,{value:"diff",className:"flex-1 overflow-hidden",children:w.jsx(Fj,{taskId:s.id,worktreePath:s.worktreePath})}),w.jsx(pu,{value:"browser",className:"flex-1 overflow-hidden",children:w.jsx(Wj,{taskId:s.id})}),w.jsx(pu,{value:"files",className:"flex-1 overflow-hidden",children:w.jsx(pV,{taskId:s.id,worktreePath:s.worktreePath})})]})})]}),w.jsx(Uk,{task:s,open:_,onOpenChange:v}),w.jsx(As,{open:I,onOpenChange:G,children:w.jsxs(Os,{className:"sm:max-w-sm",children:[w.jsxs(mi,{children:[w.jsx(gi,{children:"Open in VS Code"}),w.jsx(Jo,{children:"Choose which folder to open"})]}),w.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[w.jsxs(Ve,{variant:"outline",className:"justify-start font-mono text-sm",onClick:Oe,disabled:!s.worktreePath,children:[w.jsx(Ee,{icon:qv,size:16,strokeWidth:2,className:"mr-2"}),"Worktree",w.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.branch})]}),w.jsxs(Ve,{variant:"outline",className:"justify-start font-mono text-sm",onClick:Ne,disabled:!s.repoPath,children:[w.jsx(Ee,{icon:ms,size:16,strokeWidth:2,className:"mr-2"}),"Repository",w.jsx("span",{className:"ml-auto text-xs text-muted-foreground truncate max-w-32",children:s.repoName})]})]})]})}),w.jsx(As,{open:T,onOpenChange:A,children:w.jsxs(Os,{className:"sm:max-w-md",children:[w.jsxs(mi,{children:[w.jsx(gi,{className:"text-destructive",children:"Sync Failed"}),w.jsx(Jo,{children:"An error occurred while syncing with upstream."})]}),w.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:S}),w.jsxs(ua,{className:"mt-4 gap-2",children:[w.jsx(Ve,{variant:"outline",onClick:()=>A(!1),children:"Close"}),w.jsx(Ve,{variant:"outline",onClick:oe,disabled:!ne,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),w.jsx(Ve,{variant:"destructive",onClick:ce,disabled:!ne,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),w.jsx(As,{open:z,onOpenChange:W,children:w.jsxs(Os,{className:"sm:max-w-md",children:[w.jsxs(mi,{children:[w.jsx(gi,{className:"text-destructive",children:"Merge Failed"}),w.jsxs(Jo,{children:["An error occurred while merging to ",s?.baseBranch||"main","."]})]}),w.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:D}),w.jsxs(ua,{className:"mt-4 gap-2",children:[w.jsx(Ve,{variant:"outline",onClick:()=>W(!1),children:"Close"}),w.jsx(Ve,{variant:"outline",onClick:ve,disabled:!ne,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),w.jsx(Ve,{variant:"destructive",onClick:ge,disabled:!ne,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})}),w.jsx(As,{open:q,onOpenChange:H,children:w.jsxs(Os,{className:"sm:max-w-md",children:[w.jsxs(mi,{children:[w.jsx(gi,{className:"text-destructive",children:"Sync Parent Failed"}),w.jsx(Jo,{children:"An error occurred while syncing the parent repository with origin."})]}),w.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 p-3 text-sm text-destructive",children:$}),w.jsxs(ua,{className:"mt-4 gap-2",children:[w.jsx(Ve,{variant:"outline",onClick:()=>H(!1),children:"Close"}),w.jsx(Ve,{variant:"outline",onClick:he,disabled:!ne,title:"Send prompt to running Claude Code session",children:"Send Prompt"}),w.jsx(Ve,{variant:"destructive",onClick:de,disabled:!ne,title:"Launch Claude Code with -p flag",children:"Launch Claude"})]})]})})]}):w.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[w.jsx("p",{className:"text-muted-foreground",children:"Task not found"}),w.jsx(rr,{to:"/tasks",children:w.jsx(Ve,{variant:"outline",children:"Back to Tasks"})})]})}const PT=Ns("/repositories/$repoId")({component:xV});function xV(){const{repoId:e}=PT.useParams(),t=po(),{data:n,isLoading:s,error:o}=p9(e),u=m9(),h=XR(),[a,c]=k.useState(""),[d,p]=k.useState(""),[f,g]=k.useState(""),[b,C]=k.useState(!1);k.useEffect(()=>{n&&(c(n.displayName),p(n.startupScript||""),g(n.copyFiles||""),C(!1))},[n]),k.useEffect(()=>{if(n){const _=a!==n.displayName||d!==(n.startupScript||"")||f!==(n.copyFiles||"");C(_)}},[a,d,f,n]);const x=()=>{n&&u.mutate({id:n.id,updates:{displayName:a.trim()||n.path.split("/").pop()||"repo",startupScript:d.trim()||null,copyFiles:f.trim()||null}})},y=async()=>{n&&(await h.mutateAsync(n.id),t({to:"/repositories"}))};return s?w.jsx("div",{className:"flex h-full items-center justify-center",children:w.jsx(Ee,{icon:Ls,size:24,strokeWidth:2,className:"animate-spin text-muted-foreground"})}):o||!n?w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2",children:w.jsxs(rr,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[w.jsx(Ee,{icon:Tx,size:16,strokeWidth:2}),"Repositories"]})}),w.jsx("div",{className:"flex flex-1 items-center justify-center",children:w.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[w.jsx(Ee,{icon:tp,size:20,strokeWidth:2}),w.jsx("span",{className:"text-sm",children:"Repository not found"})]})})]}):w.jsxs("div",{className:"flex h-full flex-col",children:[w.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border px-4 py-2",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs(rr,{to:"/repositories",className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[w.jsx(Ee,{icon:Tx,size:16,strokeWidth:2}),"Repositories"]}),w.jsx("span",{className:"text-muted-foreground",children:"/"}),w.jsx("span",{className:"text-sm font-medium",children:n.displayName})]}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsxs(Qu,{children:[w.jsxs(Zu,{render:w.jsx(Ve,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-destructive"}),children:[w.jsx(Ee,{icon:Nu,size:14,strokeWidth:2,"data-slot":"icon"}),"Delete"]}),w.jsxs(Ju,{children:[w.jsxs(ed,{children:[w.jsx(nd,{children:"Delete Repository"}),w.jsxs(rd,{children:['This will remove "',n.displayName,'" from Vibora. The actual repository files will not be affected.']})]}),w.jsxs(td,{children:[w.jsx(sd,{children:"Cancel"}),w.jsx(Ve,{variant:"destructive",onClick:y,children:"Delete"})]})]})]}),w.jsx(Ve,{size:"sm",onClick:x,disabled:!b||u.isPending,children:u.isPending?"Saving...":"Save"})]})]}),w.jsx("div",{className:"flex-1 overflow-auto p-4",children:w.jsxs("div",{className:"mx-auto max-w-xl space-y-6",children:[w.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[w.jsx(Ee,{icon:ms,size:14,strokeWidth:2}),w.jsx("span",{className:"font-mono",children:n.path})]}),w.jsxs(gp,{children:[w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"displayName",children:"Display Name"}),w.jsx(Kt,{id:"displayName",value:a,onChange:_=>c(_.target.value),placeholder:n.path.split("/").pop()||"My Project"})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"startupScript",children:"Startup Script"}),w.jsx(mp,{id:"startupScript",value:d,onChange:_=>p(_.target.value),placeholder:"npm install && npm run dev",rows:3}),w.jsx(pi,{children:"Command to run in the terminal when creating a worktree."})]}),w.jsxs(In,{children:[w.jsx(Nn,{htmlFor:"copyFiles",children:"Copy Files"}),w.jsx(Kt,{id:"copyFiles",value:f,onChange:_=>g(_.target.value),placeholder:".env, config.local.json"}),w.jsx(pi,{children:"Comma-separated glob patterns for files to copy into new worktrees."})]})]})]})})]})}const CV=fN.update({id:"/",path:"/",getParentRoute:()=>wi}),wV=xN.update({id:"/worktrees/",path:"/worktrees/",getParentRoute:()=>wi}),EV=S7.update({id:"/terminals/",path:"/terminals/",getParentRoute:()=>wi}),RV=kj.update({id:"/tasks/",path:"/tasks/",getParentRoute:()=>wi}),kV=Aj.update({id:"/settings/",path:"/settings/",getParentRoute:()=>wi}),TV=Mj.update({id:"/repositories/",path:"/repositories/",getParentRoute:()=>wi}),LV=DT.update({id:"/tasks/$taskId",path:"/tasks/$taskId",getParentRoute:()=>wi}),AV=PT.update({id:"/repositories/$repoId",path:"/repositories/$repoId",getParentRoute:()=>wi}),OV={IndexRoute:CV,RepositoriesRepoIdRoute:AV,TasksTaskIdRoute:LV,RepositoriesIndexRoute:TV,SettingsIndexRoute:kV,TasksIndexRoute:RV,TerminalsIndexRoute:EV,WorktreesIndexRoute:wV},MV=wi._addFileChildren(OV)._addFileTypes(),DV=new XO({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}}),PV=CO({routeTree:MV});GL.createRoot(document.getElementById("root")).render(w.jsx(k.StrictMode,{children:w.jsx(QO,{client:DV,children:w.jsx(RO,{router:PV})})}));