@tiflis-io/tiflis-code-web 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (557) hide show
  1. package/LICENSE +100 -0
  2. package/dist/assets/abap-DsBKuouk.js +2 -0
  3. package/dist/assets/abap-DsBKuouk.js.map +1 -0
  4. package/dist/assets/actionscript-3-D_z4Izcz.js +2 -0
  5. package/dist/assets/actionscript-3-D_z4Izcz.js.map +1 -0
  6. package/dist/assets/ada-727ZlQH0.js +2 -0
  7. package/dist/assets/ada-727ZlQH0.js.map +1 -0
  8. package/dist/assets/andromeeda-C3khCPGq.js +2 -0
  9. package/dist/assets/andromeeda-C3khCPGq.js.map +1 -0
  10. package/dist/assets/angular-html-LfdN0zeE.js +2 -0
  11. package/dist/assets/angular-html-LfdN0zeE.js.map +1 -0
  12. package/dist/assets/angular-ts-CKsD7JZE.js +2 -0
  13. package/dist/assets/angular-ts-CKsD7JZE.js.map +1 -0
  14. package/dist/assets/apache-Dn00JSTd.js +2 -0
  15. package/dist/assets/apache-Dn00JSTd.js.map +1 -0
  16. package/dist/assets/apex-COJ4H7py.js +2 -0
  17. package/dist/assets/apex-COJ4H7py.js.map +1 -0
  18. package/dist/assets/apl-BBq3IX1j.js +2 -0
  19. package/dist/assets/apl-BBq3IX1j.js.map +1 -0
  20. package/dist/assets/applescript-Bu5BbsvL.js +2 -0
  21. package/dist/assets/applescript-Bu5BbsvL.js.map +1 -0
  22. package/dist/assets/ara-7O62HKoU.js +2 -0
  23. package/dist/assets/ara-7O62HKoU.js.map +1 -0
  24. package/dist/assets/asciidoc-BPT9niGB.js +2 -0
  25. package/dist/assets/asciidoc-BPT9niGB.js.map +1 -0
  26. package/dist/assets/asm-Dhn9LcZ4.js +2 -0
  27. package/dist/assets/asm-Dhn9LcZ4.js.map +1 -0
  28. package/dist/assets/astro-CqkE3fuf.js +2 -0
  29. package/dist/assets/astro-CqkE3fuf.js.map +1 -0
  30. package/dist/assets/aurora-x-D-2ljcwZ.js +2 -0
  31. package/dist/assets/aurora-x-D-2ljcwZ.js.map +1 -0
  32. package/dist/assets/awk-eg146-Ew.js +2 -0
  33. package/dist/assets/awk-eg146-Ew.js.map +1 -0
  34. package/dist/assets/ayu-dark-Cv9koXgw.js +2 -0
  35. package/dist/assets/ayu-dark-Cv9koXgw.js.map +1 -0
  36. package/dist/assets/ballerina-Du268qiB.js +2 -0
  37. package/dist/assets/ballerina-Du268qiB.js.map +1 -0
  38. package/dist/assets/bat-fje9CFhw.js +2 -0
  39. package/dist/assets/bat-fje9CFhw.js.map +1 -0
  40. package/dist/assets/beancount-BwXTMy5W.js +2 -0
  41. package/dist/assets/beancount-BwXTMy5W.js.map +1 -0
  42. package/dist/assets/berry-3xVqZejG.js +2 -0
  43. package/dist/assets/berry-3xVqZejG.js.map +1 -0
  44. package/dist/assets/bibtex-xW4inM5L.js +2 -0
  45. package/dist/assets/bibtex-xW4inM5L.js.map +1 -0
  46. package/dist/assets/bicep-DHo0CJ0O.js +2 -0
  47. package/dist/assets/bicep-DHo0CJ0O.js.map +1 -0
  48. package/dist/assets/blade-a8OxSdnT.js +2 -0
  49. package/dist/assets/blade-a8OxSdnT.js.map +1 -0
  50. package/dist/assets/bsl-Dgyn0ogV.js +2 -0
  51. package/dist/assets/bsl-Dgyn0ogV.js.map +1 -0
  52. package/dist/assets/c-C3t2pwGQ.js +2 -0
  53. package/dist/assets/c-C3t2pwGQ.js.map +1 -0
  54. package/dist/assets/cadence-DNquZEk8.js +2 -0
  55. package/dist/assets/cadence-DNquZEk8.js.map +1 -0
  56. package/dist/assets/cairo--RitsXJZ.js +2 -0
  57. package/dist/assets/cairo--RitsXJZ.js.map +1 -0
  58. package/dist/assets/catppuccin-frappe-CD_QflpE.js +2 -0
  59. package/dist/assets/catppuccin-frappe-CD_QflpE.js.map +1 -0
  60. package/dist/assets/catppuccin-latte-DRW-0cLl.js +2 -0
  61. package/dist/assets/catppuccin-latte-DRW-0cLl.js.map +1 -0
  62. package/dist/assets/catppuccin-macchiato-C-_shW-Y.js +2 -0
  63. package/dist/assets/catppuccin-macchiato-C-_shW-Y.js.map +1 -0
  64. package/dist/assets/catppuccin-mocha-LGGdnPYs.js +2 -0
  65. package/dist/assets/catppuccin-mocha-LGGdnPYs.js.map +1 -0
  66. package/dist/assets/clarity-BHOwM8T6.js +2 -0
  67. package/dist/assets/clarity-BHOwM8T6.js.map +1 -0
  68. package/dist/assets/clojure-DxSadP1t.js +2 -0
  69. package/dist/assets/clojure-DxSadP1t.js.map +1 -0
  70. package/dist/assets/cmake-DbXoA79R.js +2 -0
  71. package/dist/assets/cmake-DbXoA79R.js.map +1 -0
  72. package/dist/assets/cobol-PTqiYgYu.js +2 -0
  73. package/dist/assets/cobol-PTqiYgYu.js.map +1 -0
  74. package/dist/assets/codeowners-Bp6g37R7.js +2 -0
  75. package/dist/assets/codeowners-Bp6g37R7.js.map +1 -0
  76. package/dist/assets/codeql-sacFqUAJ.js +2 -0
  77. package/dist/assets/codeql-sacFqUAJ.js.map +1 -0
  78. package/dist/assets/coffee-dyiR41kL.js +2 -0
  79. package/dist/assets/coffee-dyiR41kL.js.map +1 -0
  80. package/dist/assets/common-lisp-C7gG9l05.js +2 -0
  81. package/dist/assets/common-lisp-C7gG9l05.js.map +1 -0
  82. package/dist/assets/coq-Dsg_Bt_b.js +2 -0
  83. package/dist/assets/coq-Dsg_Bt_b.js.map +1 -0
  84. package/dist/assets/cpp-BksuvNSY.js +2 -0
  85. package/dist/assets/cpp-BksuvNSY.js.map +1 -0
  86. package/dist/assets/crystal-DtDmRg-F.js +2 -0
  87. package/dist/assets/crystal-DtDmRg-F.js.map +1 -0
  88. package/dist/assets/csharp-D9R-vmeu.js +2 -0
  89. package/dist/assets/csharp-D9R-vmeu.js.map +1 -0
  90. package/dist/assets/css-BPhBrDlE.js +2 -0
  91. package/dist/assets/css-BPhBrDlE.js.map +1 -0
  92. package/dist/assets/csv-B0qRVHPH.js +2 -0
  93. package/dist/assets/csv-B0qRVHPH.js.map +1 -0
  94. package/dist/assets/cue-DtFQj3wx.js +2 -0
  95. package/dist/assets/cue-DtFQj3wx.js.map +1 -0
  96. package/dist/assets/cypher-m2LEI-9-.js +2 -0
  97. package/dist/assets/cypher-m2LEI-9-.js.map +1 -0
  98. package/dist/assets/d-BoXegm-a.js +2 -0
  99. package/dist/assets/d-BoXegm-a.js.map +1 -0
  100. package/dist/assets/dark-plus-C3mMm8J8.js +2 -0
  101. package/dist/assets/dark-plus-C3mMm8J8.js.map +1 -0
  102. package/dist/assets/dart-B9wLZaAG.js +2 -0
  103. package/dist/assets/dart-B9wLZaAG.js.map +1 -0
  104. package/dist/assets/dax-ClGRhx96.js +2 -0
  105. package/dist/assets/dax-ClGRhx96.js.map +1 -0
  106. package/dist/assets/desktop-DEIpsLCJ.js +2 -0
  107. package/dist/assets/desktop-DEIpsLCJ.js.map +1 -0
  108. package/dist/assets/diff-BgYniUM_.js +2 -0
  109. package/dist/assets/diff-BgYniUM_.js.map +1 -0
  110. package/dist/assets/docker-COcR7UxN.js +2 -0
  111. package/dist/assets/docker-COcR7UxN.js.map +1 -0
  112. package/dist/assets/dotenv-BjQB5zDj.js +2 -0
  113. package/dist/assets/dotenv-BjQB5zDj.js.map +1 -0
  114. package/dist/assets/dracula-BzJJZx-M.js +2 -0
  115. package/dist/assets/dracula-BzJJZx-M.js.map +1 -0
  116. package/dist/assets/dracula-soft-BXkSAIEj.js +2 -0
  117. package/dist/assets/dracula-soft-BXkSAIEj.js.map +1 -0
  118. package/dist/assets/dream-maker-C-nORZOA.js +2 -0
  119. package/dist/assets/dream-maker-C-nORZOA.js.map +1 -0
  120. package/dist/assets/edge-D5gP-w-T.js +2 -0
  121. package/dist/assets/edge-D5gP-w-T.js.map +1 -0
  122. package/dist/assets/elixir-CLiX3zqd.js +2 -0
  123. package/dist/assets/elixir-CLiX3zqd.js.map +1 -0
  124. package/dist/assets/elm-CmHSxxaM.js +2 -0
  125. package/dist/assets/elm-CmHSxxaM.js.map +1 -0
  126. package/dist/assets/emacs-lisp-BX77sIaO.js +2 -0
  127. package/dist/assets/emacs-lisp-BX77sIaO.js.map +1 -0
  128. package/dist/assets/erb-BYTLMnw6.js +2 -0
  129. package/dist/assets/erb-BYTLMnw6.js.map +1 -0
  130. package/dist/assets/erlang-B-DoSBHF.js +2 -0
  131. package/dist/assets/erlang-B-DoSBHF.js.map +1 -0
  132. package/dist/assets/everforest-dark-BgDCqdQA.js +2 -0
  133. package/dist/assets/everforest-dark-BgDCqdQA.js.map +1 -0
  134. package/dist/assets/everforest-light-C8M2exoo.js +2 -0
  135. package/dist/assets/everforest-light-C8M2exoo.js.map +1 -0
  136. package/dist/assets/fennel-bCA53EVm.js +2 -0
  137. package/dist/assets/fennel-bCA53EVm.js.map +1 -0
  138. package/dist/assets/fish-w-ucz2PV.js +2 -0
  139. package/dist/assets/fish-w-ucz2PV.js.map +1 -0
  140. package/dist/assets/fluent-Dayu4EKP.js +2 -0
  141. package/dist/assets/fluent-Dayu4EKP.js.map +1 -0
  142. package/dist/assets/fortran-fixed-form-TqA4NnZg.js +2 -0
  143. package/dist/assets/fortran-fixed-form-TqA4NnZg.js.map +1 -0
  144. package/dist/assets/fortran-free-form-DKXYxT9g.js +2 -0
  145. package/dist/assets/fortran-free-form-DKXYxT9g.js.map +1 -0
  146. package/dist/assets/fsharp-XplgxFYe.js +2 -0
  147. package/dist/assets/fsharp-XplgxFYe.js.map +1 -0
  148. package/dist/assets/gdresource-BHYsBjWJ.js +2 -0
  149. package/dist/assets/gdresource-BHYsBjWJ.js.map +1 -0
  150. package/dist/assets/gdscript-DfxzS6Rs.js +2 -0
  151. package/dist/assets/gdscript-DfxzS6Rs.js.map +1 -0
  152. package/dist/assets/gdshader-SKMF96pI.js +2 -0
  153. package/dist/assets/gdshader-SKMF96pI.js.map +1 -0
  154. package/dist/assets/genie-ajMbGru0.js +2 -0
  155. package/dist/assets/genie-ajMbGru0.js.map +1 -0
  156. package/dist/assets/gherkin--30QC5Em.js +2 -0
  157. package/dist/assets/gherkin--30QC5Em.js.map +1 -0
  158. package/dist/assets/git-commit-i4q6IMui.js +2 -0
  159. package/dist/assets/git-commit-i4q6IMui.js.map +1 -0
  160. package/dist/assets/git-rebase-B-v9cOL2.js +2 -0
  161. package/dist/assets/git-rebase-B-v9cOL2.js.map +1 -0
  162. package/dist/assets/github-dark-DHJKELXO.js +2 -0
  163. package/dist/assets/github-dark-DHJKELXO.js.map +1 -0
  164. package/dist/assets/github-dark-default-Cuk6v7N8.js +2 -0
  165. package/dist/assets/github-dark-default-Cuk6v7N8.js.map +1 -0
  166. package/dist/assets/github-dark-dimmed-DH5Ifo-i.js +2 -0
  167. package/dist/assets/github-dark-dimmed-DH5Ifo-i.js.map +1 -0
  168. package/dist/assets/github-dark-high-contrast-E3gJ1_iC.js +2 -0
  169. package/dist/assets/github-dark-high-contrast-E3gJ1_iC.js.map +1 -0
  170. package/dist/assets/github-light-DAi9KRSo.js +2 -0
  171. package/dist/assets/github-light-DAi9KRSo.js.map +1 -0
  172. package/dist/assets/github-light-default-D7oLnXFd.js +2 -0
  173. package/dist/assets/github-light-default-D7oLnXFd.js.map +1 -0
  174. package/dist/assets/github-light-high-contrast-BfjtVDDH.js +2 -0
  175. package/dist/assets/github-light-high-contrast-BfjtVDDH.js.map +1 -0
  176. package/dist/assets/gleam-B430Bg39.js +2 -0
  177. package/dist/assets/gleam-B430Bg39.js.map +1 -0
  178. package/dist/assets/glimmer-js-D-cwc0-E.js +2 -0
  179. package/dist/assets/glimmer-js-D-cwc0-E.js.map +1 -0
  180. package/dist/assets/glimmer-ts-pgjy16dm.js +2 -0
  181. package/dist/assets/glimmer-ts-pgjy16dm.js.map +1 -0
  182. package/dist/assets/glsl-DBO2IWDn.js +2 -0
  183. package/dist/assets/glsl-DBO2IWDn.js.map +1 -0
  184. package/dist/assets/gnuplot-CM8KxXT1.js +2 -0
  185. package/dist/assets/gnuplot-CM8KxXT1.js.map +1 -0
  186. package/dist/assets/go-B1SYOhNW.js +2 -0
  187. package/dist/assets/go-B1SYOhNW.js.map +1 -0
  188. package/dist/assets/graphql-cDcHW_If.js +2 -0
  189. package/dist/assets/graphql-cDcHW_If.js.map +1 -0
  190. package/dist/assets/groovy-DkBy-JyN.js +2 -0
  191. package/dist/assets/groovy-DkBy-JyN.js.map +1 -0
  192. package/dist/assets/hack-D1yCygmZ.js +2 -0
  193. package/dist/assets/hack-D1yCygmZ.js.map +1 -0
  194. package/dist/assets/haml-B2EZWmdv.js +2 -0
  195. package/dist/assets/haml-B2EZWmdv.js.map +1 -0
  196. package/dist/assets/handlebars-BQGss363.js +2 -0
  197. package/dist/assets/handlebars-BQGss363.js.map +1 -0
  198. package/dist/assets/haskell-BILxekzW.js +2 -0
  199. package/dist/assets/haskell-BILxekzW.js.map +1 -0
  200. package/dist/assets/haxe-C5wWYbrZ.js +2 -0
  201. package/dist/assets/haxe-C5wWYbrZ.js.map +1 -0
  202. package/dist/assets/hcl-HzYwdGDm.js +2 -0
  203. package/dist/assets/hcl-HzYwdGDm.js.map +1 -0
  204. package/dist/assets/hjson-T-Tgc4AT.js +2 -0
  205. package/dist/assets/hjson-T-Tgc4AT.js.map +1 -0
  206. package/dist/assets/hlsl-ifBTmRxC.js +2 -0
  207. package/dist/assets/hlsl-ifBTmRxC.js.map +1 -0
  208. package/dist/assets/houston-DnULxvSX.js +2 -0
  209. package/dist/assets/houston-DnULxvSX.js.map +1 -0
  210. package/dist/assets/html-C2L_23MC.js +2 -0
  211. package/dist/assets/html-C2L_23MC.js.map +1 -0
  212. package/dist/assets/html-derivative-CSfWNPLT.js +2 -0
  213. package/dist/assets/html-derivative-CSfWNPLT.js.map +1 -0
  214. package/dist/assets/http-FRrOvY1W.js +2 -0
  215. package/dist/assets/http-FRrOvY1W.js.map +1 -0
  216. package/dist/assets/hxml-TIA70rKU.js +2 -0
  217. package/dist/assets/hxml-TIA70rKU.js.map +1 -0
  218. package/dist/assets/hy-BMj5Y0dO.js +2 -0
  219. package/dist/assets/hy-BMj5Y0dO.js.map +1 -0
  220. package/dist/assets/imba-bv_oIlVt.js +2 -0
  221. package/dist/assets/imba-bv_oIlVt.js.map +1 -0
  222. package/dist/assets/index-GhltkWpx.js +420 -0
  223. package/dist/assets/index-GhltkWpx.js.map +1 -0
  224. package/dist/assets/index-JMuI9hqN.css +32 -0
  225. package/dist/assets/ini-BjABl1g7.js +2 -0
  226. package/dist/assets/ini-BjABl1g7.js.map +1 -0
  227. package/dist/assets/java-xI-RfyKK.js +2 -0
  228. package/dist/assets/java-xI-RfyKK.js.map +1 -0
  229. package/dist/assets/javascript-ySlJ1b_l.js +2 -0
  230. package/dist/assets/javascript-ySlJ1b_l.js.map +1 -0
  231. package/dist/assets/jinja-DGy0s7-h.js +2 -0
  232. package/dist/assets/jinja-DGy0s7-h.js.map +1 -0
  233. package/dist/assets/jison-BqZprYcd.js +2 -0
  234. package/dist/assets/jison-BqZprYcd.js.map +1 -0
  235. package/dist/assets/json-BQoSv7ci.js +2 -0
  236. package/dist/assets/json-BQoSv7ci.js.map +1 -0
  237. package/dist/assets/json5-w8dY5SsB.js +2 -0
  238. package/dist/assets/json5-w8dY5SsB.js.map +1 -0
  239. package/dist/assets/jsonc-TU54ms6u.js +2 -0
  240. package/dist/assets/jsonc-TU54ms6u.js.map +1 -0
  241. package/dist/assets/jsonl-DREVFZK8.js +2 -0
  242. package/dist/assets/jsonl-DREVFZK8.js.map +1 -0
  243. package/dist/assets/jsonnet-BfivnA6A.js +2 -0
  244. package/dist/assets/jsonnet-BfivnA6A.js.map +1 -0
  245. package/dist/assets/jssm-P4WzXJd0.js +2 -0
  246. package/dist/assets/jssm-P4WzXJd0.js.map +1 -0
  247. package/dist/assets/jsx-BAng5TT0.js +2 -0
  248. package/dist/assets/jsx-BAng5TT0.js.map +1 -0
  249. package/dist/assets/julia-BBuGR-5E.js +2 -0
  250. package/dist/assets/julia-BBuGR-5E.js.map +1 -0
  251. package/dist/assets/kanagawa-dragon-CkXjmgJE.js +2 -0
  252. package/dist/assets/kanagawa-dragon-CkXjmgJE.js.map +1 -0
  253. package/dist/assets/kanagawa-lotus-CfQXZHmo.js +2 -0
  254. package/dist/assets/kanagawa-lotus-CfQXZHmo.js.map +1 -0
  255. package/dist/assets/kanagawa-wave-DWedfzmr.js +2 -0
  256. package/dist/assets/kanagawa-wave-DWedfzmr.js.map +1 -0
  257. package/dist/assets/kotlin-B5lbUyaz.js +2 -0
  258. package/dist/assets/kotlin-B5lbUyaz.js.map +1 -0
  259. package/dist/assets/kusto-mebxcVVE.js +2 -0
  260. package/dist/assets/kusto-mebxcVVE.js.map +1 -0
  261. package/dist/assets/laserwave-DUszq2jm.js +2 -0
  262. package/dist/assets/laserwave-DUszq2jm.js.map +1 -0
  263. package/dist/assets/latex-C-cWTeAZ.js +2 -0
  264. package/dist/assets/latex-C-cWTeAZ.js.map +1 -0
  265. package/dist/assets/lean-XBlWyCtg.js +2 -0
  266. package/dist/assets/lean-XBlWyCtg.js.map +1 -0
  267. package/dist/assets/less-BfCpw3nA.js +2 -0
  268. package/dist/assets/less-BfCpw3nA.js.map +1 -0
  269. package/dist/assets/light-plus-B7mTdjB0.js +2 -0
  270. package/dist/assets/light-plus-B7mTdjB0.js.map +1 -0
  271. package/dist/assets/liquid-D3W5UaiH.js +2 -0
  272. package/dist/assets/liquid-D3W5UaiH.js.map +1 -0
  273. package/dist/assets/log-Cc5clBb7.js +2 -0
  274. package/dist/assets/log-Cc5clBb7.js.map +1 -0
  275. package/dist/assets/logo-IuBKFhSY.js +2 -0
  276. package/dist/assets/logo-IuBKFhSY.js.map +1 -0
  277. package/dist/assets/lua-CvWAzNxB.js +2 -0
  278. package/dist/assets/lua-CvWAzNxB.js.map +1 -0
  279. package/dist/assets/luau-Du5NY7AG.js +2 -0
  280. package/dist/assets/luau-Du5NY7AG.js.map +1 -0
  281. package/dist/assets/make-Bvotw-X0.js +2 -0
  282. package/dist/assets/make-Bvotw-X0.js.map +1 -0
  283. package/dist/assets/markdown-UIAJJxZW.js +2 -0
  284. package/dist/assets/markdown-UIAJJxZW.js.map +1 -0
  285. package/dist/assets/marko-z0MBrx5-.js +2 -0
  286. package/dist/assets/marko-z0MBrx5-.js.map +1 -0
  287. package/dist/assets/material-theme-D5KoaKCx.js +2 -0
  288. package/dist/assets/material-theme-D5KoaKCx.js.map +1 -0
  289. package/dist/assets/material-theme-darker-BfHTSMKl.js +2 -0
  290. package/dist/assets/material-theme-darker-BfHTSMKl.js.map +1 -0
  291. package/dist/assets/material-theme-lighter-B0m2ddpp.js +2 -0
  292. package/dist/assets/material-theme-lighter-B0m2ddpp.js.map +1 -0
  293. package/dist/assets/material-theme-ocean-CyktbL80.js +2 -0
  294. package/dist/assets/material-theme-ocean-CyktbL80.js.map +1 -0
  295. package/dist/assets/material-theme-palenight-Csfq5Kiy.js +2 -0
  296. package/dist/assets/material-theme-palenight-Csfq5Kiy.js.map +1 -0
  297. package/dist/assets/matlab-D9-PGadD.js +2 -0
  298. package/dist/assets/matlab-D9-PGadD.js.map +1 -0
  299. package/dist/assets/mdc-DB_EDNY_.js +2 -0
  300. package/dist/assets/mdc-DB_EDNY_.js.map +1 -0
  301. package/dist/assets/mdx-sdHcTMYB.js +2 -0
  302. package/dist/assets/mdx-sdHcTMYB.js.map +1 -0
  303. package/dist/assets/mermaid-Ci6OQyBP.js +2 -0
  304. package/dist/assets/mermaid-Ci6OQyBP.js.map +1 -0
  305. package/dist/assets/min-dark-CafNBF8u.js +2 -0
  306. package/dist/assets/min-dark-CafNBF8u.js.map +1 -0
  307. package/dist/assets/min-light-CTRr51gU.js +2 -0
  308. package/dist/assets/min-light-CTRr51gU.js.map +1 -0
  309. package/dist/assets/mipsasm-BC5c_5Pe.js +2 -0
  310. package/dist/assets/mipsasm-BC5c_5Pe.js.map +1 -0
  311. package/dist/assets/mojo-Tz6hzZYG.js +2 -0
  312. package/dist/assets/mojo-Tz6hzZYG.js.map +1 -0
  313. package/dist/assets/monokai-D4h5O-jR.js +2 -0
  314. package/dist/assets/monokai-D4h5O-jR.js.map +1 -0
  315. package/dist/assets/move-DB_GagMm.js +2 -0
  316. package/dist/assets/move-DB_GagMm.js.map +1 -0
  317. package/dist/assets/narrat-DLbgOhZU.js +2 -0
  318. package/dist/assets/narrat-DLbgOhZU.js.map +1 -0
  319. package/dist/assets/nextflow-B0XVJmRM.js +2 -0
  320. package/dist/assets/nextflow-B0XVJmRM.js.map +1 -0
  321. package/dist/assets/nginx-D_VnBJ67.js +2 -0
  322. package/dist/assets/nginx-D_VnBJ67.js.map +1 -0
  323. package/dist/assets/night-owl-C39BiMTA.js +2 -0
  324. package/dist/assets/night-owl-C39BiMTA.js.map +1 -0
  325. package/dist/assets/nim-ZlGxZxc3.js +2 -0
  326. package/dist/assets/nim-ZlGxZxc3.js.map +1 -0
  327. package/dist/assets/nix-shcSOmrb.js +2 -0
  328. package/dist/assets/nix-shcSOmrb.js.map +1 -0
  329. package/dist/assets/nord-Ddv68eIx.js +2 -0
  330. package/dist/assets/nord-Ddv68eIx.js.map +1 -0
  331. package/dist/assets/nushell-D4Tzg5kh.js +2 -0
  332. package/dist/assets/nushell-D4Tzg5kh.js.map +1 -0
  333. package/dist/assets/objective-c-Deuh7S70.js +2 -0
  334. package/dist/assets/objective-c-Deuh7S70.js.map +1 -0
  335. package/dist/assets/objective-cpp-BUEGK8hf.js +2 -0
  336. package/dist/assets/objective-cpp-BUEGK8hf.js.map +1 -0
  337. package/dist/assets/ocaml-BNioltXt.js +2 -0
  338. package/dist/assets/ocaml-BNioltXt.js.map +1 -0
  339. package/dist/assets/one-dark-pro-GBQ2dnAY.js +2 -0
  340. package/dist/assets/one-dark-pro-GBQ2dnAY.js.map +1 -0
  341. package/dist/assets/one-light-PoHY5YXO.js +2 -0
  342. package/dist/assets/one-light-PoHY5YXO.js.map +1 -0
  343. package/dist/assets/pascal-JqZropPD.js +2 -0
  344. package/dist/assets/pascal-JqZropPD.js.map +1 -0
  345. package/dist/assets/perl-CHQXSrWU.js +2 -0
  346. package/dist/assets/perl-CHQXSrWU.js.map +1 -0
  347. package/dist/assets/php-B5ebYQev.js +2 -0
  348. package/dist/assets/php-B5ebYQev.js.map +1 -0
  349. package/dist/assets/plastic-3e1v2bzS.js +2 -0
  350. package/dist/assets/plastic-3e1v2bzS.js.map +1 -0
  351. package/dist/assets/plsql-LKU2TuZ1.js +2 -0
  352. package/dist/assets/plsql-LKU2TuZ1.js.map +1 -0
  353. package/dist/assets/po-BFLt1xDp.js +2 -0
  354. package/dist/assets/po-BFLt1xDp.js.map +1 -0
  355. package/dist/assets/poimandres-CS3Unz2-.js +2 -0
  356. package/dist/assets/poimandres-CS3Unz2-.js.map +1 -0
  357. package/dist/assets/polar-DKykz6zU.js +2 -0
  358. package/dist/assets/polar-DKykz6zU.js.map +1 -0
  359. package/dist/assets/postcss-B3ZDOciz.js +2 -0
  360. package/dist/assets/postcss-B3ZDOciz.js.map +1 -0
  361. package/dist/assets/powerquery-CSHBycmS.js +2 -0
  362. package/dist/assets/powerquery-CSHBycmS.js.map +1 -0
  363. package/dist/assets/powershell-BIEUsx6d.js +2 -0
  364. package/dist/assets/powershell-BIEUsx6d.js.map +1 -0
  365. package/dist/assets/prisma-B48N-Iqd.js +2 -0
  366. package/dist/assets/prisma-B48N-Iqd.js.map +1 -0
  367. package/dist/assets/prolog-BY-TUvya.js +2 -0
  368. package/dist/assets/prolog-BY-TUvya.js.map +1 -0
  369. package/dist/assets/proto-zocC4JxJ.js +2 -0
  370. package/dist/assets/proto-zocC4JxJ.js.map +1 -0
  371. package/dist/assets/pug-CM9l7STV.js +2 -0
  372. package/dist/assets/pug-CM9l7STV.js.map +1 -0
  373. package/dist/assets/puppet-Cza_XSSt.js +2 -0
  374. package/dist/assets/puppet-Cza_XSSt.js.map +1 -0
  375. package/dist/assets/purescript-Bg-kzb6g.js +2 -0
  376. package/dist/assets/purescript-Bg-kzb6g.js.map +1 -0
  377. package/dist/assets/python-DhUJRlN_.js +2 -0
  378. package/dist/assets/python-DhUJRlN_.js.map +1 -0
  379. package/dist/assets/qml-D8XfuvdV.js +2 -0
  380. package/dist/assets/qml-D8XfuvdV.js.map +1 -0
  381. package/dist/assets/qmldir-C8lEn-DE.js +2 -0
  382. package/dist/assets/qmldir-C8lEn-DE.js.map +1 -0
  383. package/dist/assets/qss-DhMKtDLN.js +2 -0
  384. package/dist/assets/qss-DhMKtDLN.js.map +1 -0
  385. package/dist/assets/r-CwjWoCRV.js +2 -0
  386. package/dist/assets/r-CwjWoCRV.js.map +1 -0
  387. package/dist/assets/racket-CzouJOBO.js +2 -0
  388. package/dist/assets/racket-CzouJOBO.js.map +1 -0
  389. package/dist/assets/raku-B1bQXN8T.js +2 -0
  390. package/dist/assets/raku-B1bQXN8T.js.map +1 -0
  391. package/dist/assets/razor-CNLDkMZG.js +2 -0
  392. package/dist/assets/razor-CNLDkMZG.js.map +1 -0
  393. package/dist/assets/red-bN70gL4F.js +2 -0
  394. package/dist/assets/red-bN70gL4F.js.map +1 -0
  395. package/dist/assets/reg-5LuOXUq_.js +2 -0
  396. package/dist/assets/reg-5LuOXUq_.js.map +1 -0
  397. package/dist/assets/regexp-DWJ3fJO_.js +2 -0
  398. package/dist/assets/regexp-DWJ3fJO_.js.map +1 -0
  399. package/dist/assets/rel-DJlmqQ1C.js +2 -0
  400. package/dist/assets/rel-DJlmqQ1C.js.map +1 -0
  401. package/dist/assets/riscv-QhoSD0DR.js +2 -0
  402. package/dist/assets/riscv-QhoSD0DR.js.map +1 -0
  403. package/dist/assets/rose-pine-CmCqftbK.js +2 -0
  404. package/dist/assets/rose-pine-CmCqftbK.js.map +1 -0
  405. package/dist/assets/rose-pine-dawn-Ds-gbosJ.js +2 -0
  406. package/dist/assets/rose-pine-dawn-Ds-gbosJ.js.map +1 -0
  407. package/dist/assets/rose-pine-moon-CjDtw9vr.js +2 -0
  408. package/dist/assets/rose-pine-moon-CjDtw9vr.js.map +1 -0
  409. package/dist/assets/rst-4NLicBqY.js +2 -0
  410. package/dist/assets/rst-4NLicBqY.js.map +1 -0
  411. package/dist/assets/ruby-DeZ3UC14.js +2 -0
  412. package/dist/assets/ruby-DeZ3UC14.js.map +1 -0
  413. package/dist/assets/rust-Be6lgOlo.js +2 -0
  414. package/dist/assets/rust-Be6lgOlo.js.map +1 -0
  415. package/dist/assets/sas-BmTFh92c.js +2 -0
  416. package/dist/assets/sas-BmTFh92c.js.map +1 -0
  417. package/dist/assets/sass-BJ4Li9vH.js +2 -0
  418. package/dist/assets/sass-BJ4Li9vH.js.map +1 -0
  419. package/dist/assets/scala-DQVVAn-B.js +2 -0
  420. package/dist/assets/scala-DQVVAn-B.js.map +1 -0
  421. package/dist/assets/scheme-BJGe-b2p.js +2 -0
  422. package/dist/assets/scheme-BJGe-b2p.js.map +1 -0
  423. package/dist/assets/scss-C31hgJw-.js +2 -0
  424. package/dist/assets/scss-C31hgJw-.js.map +1 -0
  425. package/dist/assets/sdbl-BLhTXw86.js +2 -0
  426. package/dist/assets/sdbl-BLhTXw86.js.map +1 -0
  427. package/dist/assets/shaderlab-B7qAK45m.js +2 -0
  428. package/dist/assets/shaderlab-B7qAK45m.js.map +1 -0
  429. package/dist/assets/shellscript-atvbtKCR.js +2 -0
  430. package/dist/assets/shellscript-atvbtKCR.js.map +1 -0
  431. package/dist/assets/shellsession-C_rIy8kc.js +2 -0
  432. package/dist/assets/shellsession-C_rIy8kc.js.map +1 -0
  433. package/dist/assets/slack-dark-BthQWCQV.js +2 -0
  434. package/dist/assets/slack-dark-BthQWCQV.js.map +1 -0
  435. package/dist/assets/slack-ochin-DqwNpetd.js +2 -0
  436. package/dist/assets/slack-ochin-DqwNpetd.js.map +1 -0
  437. package/dist/assets/smalltalk-DkLiglaE.js +2 -0
  438. package/dist/assets/smalltalk-DkLiglaE.js.map +1 -0
  439. package/dist/assets/snazzy-light-Bw305WKR.js +2 -0
  440. package/dist/assets/snazzy-light-Bw305WKR.js.map +1 -0
  441. package/dist/assets/solarized-dark-DXbdFlpD.js +2 -0
  442. package/dist/assets/solarized-dark-DXbdFlpD.js.map +1 -0
  443. package/dist/assets/solarized-light-L9t79GZl.js +2 -0
  444. package/dist/assets/solarized-light-L9t79GZl.js.map +1 -0
  445. package/dist/assets/solidity-C1w2a3ep.js +2 -0
  446. package/dist/assets/solidity-C1w2a3ep.js.map +1 -0
  447. package/dist/assets/soy-C-lX7w71.js +2 -0
  448. package/dist/assets/soy-C-lX7w71.js.map +1 -0
  449. package/dist/assets/sparql-bYkjHRlG.js +2 -0
  450. package/dist/assets/sparql-bYkjHRlG.js.map +1 -0
  451. package/dist/assets/splunk-Cf8iN4DR.js +2 -0
  452. package/dist/assets/splunk-Cf8iN4DR.js.map +1 -0
  453. package/dist/assets/sql-COK4E0Yg.js +2 -0
  454. package/dist/assets/sql-COK4E0Yg.js.map +1 -0
  455. package/dist/assets/ssh-config-BknIz3MU.js +2 -0
  456. package/dist/assets/ssh-config-BknIz3MU.js.map +1 -0
  457. package/dist/assets/stata-DorPZHa4.js +2 -0
  458. package/dist/assets/stata-DorPZHa4.js.map +1 -0
  459. package/dist/assets/stylus-BeQkCIfX.js +2 -0
  460. package/dist/assets/stylus-BeQkCIfX.js.map +1 -0
  461. package/dist/assets/svelte-MSaWC3Je.js +2 -0
  462. package/dist/assets/svelte-MSaWC3Je.js.map +1 -0
  463. package/dist/assets/swift-BSxZ-RaX.js +2 -0
  464. package/dist/assets/swift-BSxZ-RaX.js.map +1 -0
  465. package/dist/assets/synthwave-84-CbfX1IO0.js +2 -0
  466. package/dist/assets/synthwave-84-CbfX1IO0.js.map +1 -0
  467. package/dist/assets/system-verilog-C7L56vO4.js +2 -0
  468. package/dist/assets/system-verilog-C7L56vO4.js.map +1 -0
  469. package/dist/assets/systemd-CUnW07Te.js +2 -0
  470. package/dist/assets/systemd-CUnW07Te.js.map +1 -0
  471. package/dist/assets/talonscript-C1XDQQGZ.js +2 -0
  472. package/dist/assets/talonscript-C1XDQQGZ.js.map +1 -0
  473. package/dist/assets/tasl-CQjiPCtT.js +2 -0
  474. package/dist/assets/tasl-CQjiPCtT.js.map +1 -0
  475. package/dist/assets/tcl-DQ1-QYvQ.js +2 -0
  476. package/dist/assets/tcl-DQ1-QYvQ.js.map +1 -0
  477. package/dist/assets/templ-dwX3ZSMB.js +2 -0
  478. package/dist/assets/templ-dwX3ZSMB.js.map +1 -0
  479. package/dist/assets/terraform-BbSNqyBO.js +2 -0
  480. package/dist/assets/terraform-BbSNqyBO.js.map +1 -0
  481. package/dist/assets/tex-rYs2v40G.js +2 -0
  482. package/dist/assets/tex-rYs2v40G.js.map +1 -0
  483. package/dist/assets/tokyo-night-DBQeEorK.js +2 -0
  484. package/dist/assets/tokyo-night-DBQeEorK.js.map +1 -0
  485. package/dist/assets/toml-CB2ApiWb.js +2 -0
  486. package/dist/assets/toml-CB2ApiWb.js.map +1 -0
  487. package/dist/assets/ts-tags-CipyTH0X.js +2 -0
  488. package/dist/assets/ts-tags-CipyTH0X.js.map +1 -0
  489. package/dist/assets/tsv-B_m7g4N7.js +2 -0
  490. package/dist/assets/tsv-B_m7g4N7.js.map +1 -0
  491. package/dist/assets/tsx-B6W0miNI.js +2 -0
  492. package/dist/assets/tsx-B6W0miNI.js.map +1 -0
  493. package/dist/assets/turtle-BMR_PYu6.js +2 -0
  494. package/dist/assets/turtle-BMR_PYu6.js.map +1 -0
  495. package/dist/assets/twig-NC5TFiHP.js +2 -0
  496. package/dist/assets/twig-NC5TFiHP.js.map +1 -0
  497. package/dist/assets/typescript-Dj6nwHGl.js +2 -0
  498. package/dist/assets/typescript-Dj6nwHGl.js.map +1 -0
  499. package/dist/assets/typespec-BpWG_bgh.js +2 -0
  500. package/dist/assets/typespec-BpWG_bgh.js.map +1 -0
  501. package/dist/assets/typst-BVUVsWT6.js +2 -0
  502. package/dist/assets/typst-BVUVsWT6.js.map +1 -0
  503. package/dist/assets/v-CAQ2eGtk.js +2 -0
  504. package/dist/assets/v-CAQ2eGtk.js.map +1 -0
  505. package/dist/assets/vala-BFOHcciG.js +2 -0
  506. package/dist/assets/vala-BFOHcciG.js.map +1 -0
  507. package/dist/assets/vb-CdO5JTpU.js +2 -0
  508. package/dist/assets/vb-CdO5JTpU.js.map +1 -0
  509. package/dist/assets/verilog-CJaU5se_.js +2 -0
  510. package/dist/assets/verilog-CJaU5se_.js.map +1 -0
  511. package/dist/assets/vesper-BEBZ7ncR.js +2 -0
  512. package/dist/assets/vesper-BEBZ7ncR.js.map +1 -0
  513. package/dist/assets/vhdl-DYoNaHQp.js +2 -0
  514. package/dist/assets/vhdl-DYoNaHQp.js.map +1 -0
  515. package/dist/assets/viml-m4uW47V2.js +2 -0
  516. package/dist/assets/viml-m4uW47V2.js.map +1 -0
  517. package/dist/assets/vitesse-black-Bkuqu6BP.js +2 -0
  518. package/dist/assets/vitesse-black-Bkuqu6BP.js.map +1 -0
  519. package/dist/assets/vitesse-dark-D0r3Knsf.js +2 -0
  520. package/dist/assets/vitesse-dark-D0r3Knsf.js.map +1 -0
  521. package/dist/assets/vitesse-light-CVO1_9PV.js +2 -0
  522. package/dist/assets/vitesse-light-CVO1_9PV.js.map +1 -0
  523. package/dist/assets/vue-BuYVFjOK.js +2 -0
  524. package/dist/assets/vue-BuYVFjOK.js.map +1 -0
  525. package/dist/assets/vue-html-xdeiXROB.js +2 -0
  526. package/dist/assets/vue-html-xdeiXROB.js.map +1 -0
  527. package/dist/assets/vyper-nyqBNV6O.js +2 -0
  528. package/dist/assets/vyper-nyqBNV6O.js.map +1 -0
  529. package/dist/assets/wasm-C6j12Q_x.js +2 -0
  530. package/dist/assets/wasm-C6j12Q_x.js.map +1 -0
  531. package/dist/assets/wasm-CG6Dc4jp.js +2 -0
  532. package/dist/assets/wasm-CG6Dc4jp.js.map +1 -0
  533. package/dist/assets/wenyan-7A4Fjokl.js +2 -0
  534. package/dist/assets/wenyan-7A4Fjokl.js.map +1 -0
  535. package/dist/assets/wgsl-CB0Krxn9.js +2 -0
  536. package/dist/assets/wgsl-CB0Krxn9.js.map +1 -0
  537. package/dist/assets/wikitext-DCE3LsBG.js +2 -0
  538. package/dist/assets/wikitext-DCE3LsBG.js.map +1 -0
  539. package/dist/assets/wolfram-C3FkfJm5.js +2 -0
  540. package/dist/assets/wolfram-C3FkfJm5.js.map +1 -0
  541. package/dist/assets/xml-e3z08dGr.js +2 -0
  542. package/dist/assets/xml-e3z08dGr.js.map +1 -0
  543. package/dist/assets/xsl-Dd0NUgwM.js +2 -0
  544. package/dist/assets/xsl-Dd0NUgwM.js.map +1 -0
  545. package/dist/assets/yaml-CVw76BM1.js +2 -0
  546. package/dist/assets/yaml-CVw76BM1.js.map +1 -0
  547. package/dist/assets/zenscript-HnGAYVZD.js +2 -0
  548. package/dist/assets/zenscript-HnGAYVZD.js.map +1 -0
  549. package/dist/assets/zig-BVz_zdnA.js +2 -0
  550. package/dist/assets/zig-BVz_zdnA.js.map +1 -0
  551. package/dist/icons/claude-logo.png +0 -0
  552. package/dist/icons/cursor-logo.png +0 -0
  553. package/dist/icons/opencode-logo-dark.png +0 -0
  554. package/dist/icons/opencode-logo-light.png +0 -0
  555. package/dist/index.html +26 -0
  556. package/dist/tiflis-logo.svg +13 -0
  557. package/package.json +89 -0
@@ -0,0 +1,420 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-LfdN0zeE.js","assets/html-C2L_23MC.js","assets/javascript-ySlJ1b_l.js","assets/css-BPhBrDlE.js","assets/angular-ts-CKsD7JZE.js","assets/scss-C31hgJw-.js","assets/apl-BBq3IX1j.js","assets/xml-e3z08dGr.js","assets/java-xI-RfyKK.js","assets/json-BQoSv7ci.js","assets/astro-CqkE3fuf.js","assets/typescript-Dj6nwHGl.js","assets/postcss-B3ZDOciz.js","assets/blade-a8OxSdnT.js","assets/sql-COK4E0Yg.js","assets/bsl-Dgyn0ogV.js","assets/sdbl-BLhTXw86.js","assets/cairo--RitsXJZ.js","assets/python-DhUJRlN_.js","assets/cobol-PTqiYgYu.js","assets/coffee-dyiR41kL.js","assets/cpp-BksuvNSY.js","assets/regexp-DWJ3fJO_.js","assets/glsl-DBO2IWDn.js","assets/c-C3t2pwGQ.js","assets/crystal-DtDmRg-F.js","assets/shellscript-atvbtKCR.js","assets/edge-D5gP-w-T.js","assets/html-derivative-CSfWNPLT.js","assets/elixir-CLiX3zqd.js","assets/elm-CmHSxxaM.js","assets/erb-BYTLMnw6.js","assets/ruby-DeZ3UC14.js","assets/haml-B2EZWmdv.js","assets/graphql-cDcHW_If.js","assets/jsx-BAng5TT0.js","assets/tsx-B6W0miNI.js","assets/lua-CvWAzNxB.js","assets/yaml-CVw76BM1.js","assets/fortran-fixed-form-TqA4NnZg.js","assets/fortran-free-form-DKXYxT9g.js","assets/fsharp-XplgxFYe.js","assets/markdown-UIAJJxZW.js","assets/gdresource-BHYsBjWJ.js","assets/gdshader-SKMF96pI.js","assets/gdscript-DfxzS6Rs.js","assets/git-commit-i4q6IMui.js","assets/diff-BgYniUM_.js","assets/git-rebase-B-v9cOL2.js","assets/glimmer-js-D-cwc0-E.js","assets/glimmer-ts-pgjy16dm.js","assets/hack-D1yCygmZ.js","assets/handlebars-BQGss363.js","assets/http-FRrOvY1W.js","assets/hxml-TIA70rKU.js","assets/haxe-C5wWYbrZ.js","assets/imba-bv_oIlVt.js","assets/jinja-DGy0s7-h.js","assets/jison-BqZprYcd.js","assets/julia-BBuGR-5E.js","assets/r-CwjWoCRV.js","assets/latex-C-cWTeAZ.js","assets/tex-rYs2v40G.js","assets/liquid-D3W5UaiH.js","assets/marko-z0MBrx5-.js","assets/less-BfCpw3nA.js","assets/mdc-DB_EDNY_.js","assets/nginx-D_VnBJ67.js","assets/nim-ZlGxZxc3.js","assets/perl-CHQXSrWU.js","assets/php-B5ebYQev.js","assets/pug-CM9l7STV.js","assets/qml-D8XfuvdV.js","assets/razor-CNLDkMZG.js","assets/csharp-D9R-vmeu.js","assets/rst-4NLicBqY.js","assets/cmake-DbXoA79R.js","assets/sas-BmTFh92c.js","assets/shaderlab-B7qAK45m.js","assets/hlsl-ifBTmRxC.js","assets/shellsession-C_rIy8kc.js","assets/soy-C-lX7w71.js","assets/sparql-bYkjHRlG.js","assets/turtle-BMR_PYu6.js","assets/stata-DorPZHa4.js","assets/svelte-MSaWC3Je.js","assets/templ-dwX3ZSMB.js","assets/go-B1SYOhNW.js","assets/ts-tags-CipyTH0X.js","assets/twig-NC5TFiHP.js","assets/vue-BuYVFjOK.js","assets/vue-html-xdeiXROB.js","assets/xsl-Dd0NUgwM.js"])))=>i.map(i=>d[i]);
2
+ var PT=Object.defineProperty;var jT=(e,r,n)=>r in e?PT(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var _e=(e,r,n)=>jT(e,typeof r!="symbol"?r+"":r,n);function AC(e,r){for(var n=0;n<r.length;n++){const s=r[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 r=document.createElement("link").relList;if(r&&r.supports&&r.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 f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).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 Rg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var em={exports:{}},Il={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var O0;function UT(){if(O0)return Il;O0=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(s,o,u){var f=null;if(u!==void 0&&(f=""+u),o.key!==void 0&&(f=""+o.key),"key"in o){u={};for(var l in o)l!=="key"&&(u[l]=o[l])}else u=o;return o=u.ref,{$$typeof:e,type:s,key:f,ref:o!==void 0?o:null,props:u}}return Il.Fragment=r,Il.jsx=n,Il.jsxs=n,Il}var B0;function FT(){return B0||(B0=1,em.exports=UT()),em.exports}var b=FT(),tm={exports:{}},He={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var N0;function HT(){if(N0)return He;N0=1;var e=Symbol.for("react.transitional.element"),r=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"),f=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),_=Symbol.iterator;function E(P){return P===null||typeof P!="object"?null:(P=_&&P[_]||P["@@iterator"],typeof P=="function"?P:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,v={};function S(P,G,ne){this.props=P,this.context=G,this.refs=v,this.updater=ne||A}S.prototype.isReactComponent={},S.prototype.setState=function(P,G){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,G,"setState")},S.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function g(){}g.prototype=S.prototype;function y(P,G,ne){this.props=P,this.context=G,this.refs=v,this.updater=ne||A}var T=y.prototype=new g;T.constructor=y,w(T,S.prototype),T.isPureReactComponent=!0;var M=Array.isArray;function k(){}var L={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function j(P,G,ne){var X=ne.ref;return{$$typeof:e,type:P,key:G,ref:X!==void 0?X:null,props:ne}}function K(P,G){return j(P.type,G,P.props)}function Q(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function H(P){var G={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(ne){return G[ne]})}var U=/\/+/g;function $(P,G){return typeof P=="object"&&P!==null&&P.key!=null?H(""+P.key):G.toString(36)}function te(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(k,k):(P.status="pending",P.then(function(G){P.status==="pending"&&(P.status="fulfilled",P.value=G)},function(G){P.status==="pending"&&(P.status="rejected",P.reason=G)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function Y(P,G,ne,X,Ce){var fe=typeof P;(fe==="undefined"||fe==="boolean")&&(P=null);var W=!1;if(P===null)W=!0;else switch(fe){case"bigint":case"string":case"number":W=!0;break;case"object":switch(P.$$typeof){case e:case r:W=!0;break;case m:return W=P._init,Y(W(P._payload),G,ne,X,Ce)}}if(W)return Ce=Ce(P),W=X===""?"."+$(P,0):X,M(Ce)?(ne="",W!=null&&(ne=W.replace(U,"$&/")+"/"),Y(Ce,G,ne,"",function(oe){return oe})):Ce!=null&&(Q(Ce)&&(Ce=K(Ce,ne+(Ce.key==null||P&&P.key===Ce.key?"":(""+Ce.key).replace(U,"$&/")+"/")+W)),G.push(Ce)),1;W=0;var F=X===""?".":X+":";if(M(P))for(var ue=0;ue<P.length;ue++)X=P[ue],fe=F+$(X,ue),W+=Y(X,G,ne,fe,Ce);else if(ue=E(P),typeof ue=="function")for(P=ue.call(P),ue=0;!(X=P.next()).done;)X=X.value,fe=F+$(X,ue++),W+=Y(X,G,ne,fe,Ce);else if(fe==="object"){if(typeof P.then=="function")return Y(te(P),G,ne,X,Ce);throw G=String(P),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return W}function ie(P,G,ne){if(P==null)return P;var X=[],Ce=0;return Y(P,X,"","",function(fe){return G.call(ne,fe,Ce++)}),X}function ee(P){if(P._status===-1){var G=P._result;G=G(),G.then(function(ne){(P._status===0||P._status===-1)&&(P._status=1,P._result=ne)},function(ne){(P._status===0||P._status===-1)&&(P._status=2,P._result=ne)}),P._status===-1&&(P._status=0,P._result=G)}if(P._status===1)return P._result.default;throw P._result}var I=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},z={map:ie,forEach:function(P,G,ne){ie(P,function(){G.apply(this,arguments)},ne)},count:function(P){var G=0;return ie(P,function(){G++}),G},toArray:function(P){return ie(P,function(G){return G})||[]},only:function(P){if(!Q(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return He.Activity=p,He.Children=z,He.Component=S,He.Fragment=n,He.Profiler=o,He.PureComponent=y,He.StrictMode=s,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,He.__COMPILER_RUNTIME={__proto__:null,c:function(P){return L.H.useMemoCache(P)}},He.cache=function(P){return function(){return P.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(P,G,ne){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var X=w({},P.props),Ce=P.key;if(G!=null)for(fe in G.key!==void 0&&(Ce=""+G.key),G)!D.call(G,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&G.ref===void 0||(X[fe]=G[fe]);var fe=arguments.length-2;if(fe===1)X.children=ne;else if(1<fe){for(var W=Array(fe),F=0;F<fe;F++)W[F]=arguments[F+2];X.children=W}return j(P.type,Ce,X)},He.createContext=function(P){return P={$$typeof:f,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:u,_context:P},P},He.createElement=function(P,G,ne){var X,Ce={},fe=null;if(G!=null)for(X in G.key!==void 0&&(fe=""+G.key),G)D.call(G,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(Ce[X]=G[X]);var W=arguments.length-2;if(W===1)Ce.children=ne;else if(1<W){for(var F=Array(W),ue=0;ue<W;ue++)F[ue]=arguments[ue+2];Ce.children=F}if(P&&P.defaultProps)for(X in W=P.defaultProps,W)Ce[X]===void 0&&(Ce[X]=W[X]);return j(P,fe,Ce)},He.createRef=function(){return{current:null}},He.forwardRef=function(P){return{$$typeof:l,render:P}},He.isValidElement=Q,He.lazy=function(P){return{$$typeof:m,_payload:{_status:-1,_result:P},_init:ee}},He.memo=function(P,G){return{$$typeof:h,type:P,compare:G===void 0?null:G}},He.startTransition=function(P){var G=L.T,ne={};L.T=ne;try{var X=P(),Ce=L.S;Ce!==null&&Ce(ne,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(k,I)}catch(fe){I(fe)}finally{G!==null&&ne.types!==null&&(G.types=ne.types),L.T=G}},He.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},He.use=function(P){return L.H.use(P)},He.useActionState=function(P,G,ne){return L.H.useActionState(P,G,ne)},He.useCallback=function(P,G){return L.H.useCallback(P,G)},He.useContext=function(P){return L.H.useContext(P)},He.useDebugValue=function(){},He.useDeferredValue=function(P,G){return L.H.useDeferredValue(P,G)},He.useEffect=function(P,G){return L.H.useEffect(P,G)},He.useEffectEvent=function(P){return L.H.useEffectEvent(P)},He.useId=function(){return L.H.useId()},He.useImperativeHandle=function(P,G,ne){return L.H.useImperativeHandle(P,G,ne)},He.useInsertionEffect=function(P,G){return L.H.useInsertionEffect(P,G)},He.useLayoutEffect=function(P,G){return L.H.useLayoutEffect(P,G)},He.useMemo=function(P,G){return L.H.useMemo(P,G)},He.useOptimistic=function(P,G){return L.H.useOptimistic(P,G)},He.useReducer=function(P,G,ne){return L.H.useReducer(P,G,ne)},He.useRef=function(P){return L.H.useRef(P)},He.useState=function(P){return L.H.useState(P)},He.useSyncExternalStore=function(P,G,ne){return L.H.useSyncExternalStore(P,G,ne)},He.useTransition=function(){return L.H.useTransition()},He.version="19.2.1",He}var I0;function Dg(){return I0||(I0=1,tm.exports=HT()),tm.exports}var R=Dg();const nn=Rg(R),Mg=AC({__proto__:null,default:nn},[R]);var rm={exports:{}},Pl={},nm={exports:{}},im={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var P0;function VT(){return P0||(P0=1,(function(e){function r(Y,ie){var ee=Y.length;Y.push(ie);e:for(;0<ee;){var I=ee-1>>>1,z=Y[I];if(0<o(z,ie))Y[I]=ie,Y[ee]=z,ee=I;else break e}}function n(Y){return Y.length===0?null:Y[0]}function s(Y){if(Y.length===0)return null;var ie=Y[0],ee=Y.pop();if(ee!==ie){Y[0]=ee;e:for(var I=0,z=Y.length,P=z>>>1;I<P;){var G=2*(I+1)-1,ne=Y[G],X=G+1,Ce=Y[X];if(0>o(ne,ee))X<z&&0>o(Ce,ne)?(Y[I]=Ce,Y[X]=ee,I=X):(Y[I]=ne,Y[G]=ee,I=G);else if(X<z&&0>o(Ce,ee))Y[I]=Ce,Y[X]=ee,I=X;else break e}}return ie}function o(Y,ie){var ee=Y.sortIndex-ie.sortIndex;return ee!==0?ee:Y.id-ie.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 f=Date,l=f.now();e.unstable_now=function(){return f.now()-l}}var c=[],h=[],m=1,p=null,_=3,E=!1,A=!1,w=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function T(Y){for(var ie=n(h);ie!==null;){if(ie.callback===null)s(h);else if(ie.startTime<=Y)s(h),ie.sortIndex=ie.expirationTime,r(c,ie);else break;ie=n(h)}}function M(Y){if(w=!1,T(Y),!A)if(n(c)!==null)A=!0,k||(k=!0,H());else{var ie=n(h);ie!==null&&te(M,ie.startTime-Y)}}var k=!1,L=-1,D=5,j=-1;function K(){return v?!0:!(e.unstable_now()-j<D)}function Q(){if(v=!1,k){var Y=e.unstable_now();j=Y;var ie=!0;try{e:{A=!1,w&&(w=!1,g(L),L=-1),E=!0;var ee=_;try{t:{for(T(Y),p=n(c);p!==null&&!(p.expirationTime>Y&&K());){var I=p.callback;if(typeof I=="function"){p.callback=null,_=p.priorityLevel;var z=I(p.expirationTime<=Y);if(Y=e.unstable_now(),typeof z=="function"){p.callback=z,T(Y),ie=!0;break t}p===n(c)&&s(c),T(Y)}else s(c);p=n(c)}if(p!==null)ie=!0;else{var P=n(h);P!==null&&te(M,P.startTime-Y),ie=!1}}break e}finally{p=null,_=ee,E=!1}ie=void 0}}finally{ie?H():k=!1}}}var H;if(typeof y=="function")H=function(){y(Q)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,$=U.port2;U.port1.onmessage=Q,H=function(){$.postMessage(null)}}else H=function(){S(Q,0)};function te(Y,ie){L=S(function(){Y(e.unstable_now())},ie)}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(Y){Y.callback=null},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(Y){switch(_){case 1:case 2:case 3:var ie=3;break;default:ie=_}var ee=_;_=ie;try{return Y()}finally{_=ee}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(Y,ie){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var ee=_;_=Y;try{return ie()}finally{_=ee}},e.unstable_scheduleCallback=function(Y,ie,ee){var I=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?I+ee:I):ee=I,Y){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=ee+z,Y={id:m++,callback:ie,priorityLevel:Y,startTime:ee,expirationTime:z,sortIndex:-1},ee>I?(Y.sortIndex=ee,r(h,Y),n(c)===null&&Y===n(h)&&(w?(g(L),L=-1):w=!0,te(M,ee-I))):(Y.sortIndex=z,r(c,Y),A||E||(A=!0,k||(k=!0,H()))),Y},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(Y){var ie=_;return function(){var ee=_;_=ie;try{return Y.apply(this,arguments)}finally{_=ee}}}})(im)),im}var j0;function qT(){return j0||(j0=1,nm.exports=VT()),nm.exports}var sm={exports:{}},dr={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var U0;function GT(){if(U0)return dr;U0=1;var e=Dg();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+h+" 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(r(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,h,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:p==null?null:""+p,children:c,containerInfo:h,implementation:m}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return dr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,dr.createPortal=function(c,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return u(c,h,null,m)},dr.flushSync=function(c){var h=f.T,m=s.p;try{if(f.T=null,s.p=2,c)return c()}finally{f.T=h,s.p=m,s.d.f()}},dr.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(c,h))},dr.prefetchDNS=function(c){typeof c=="string"&&s.d.D(c)},dr.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var m=h.as,p=l(m,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,E=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?s.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:_,fetchPriority:E}):m==="script"&&s.d.X(c,{crossOrigin:p,integrity:_,fetchPriority:E,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},dr.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=l(h.as,h.crossOrigin);s.d.M(c,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(c)},dr.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,p=l(m,h.crossOrigin);s.d.L(c,m,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},dr.preloadModule=function(c,h){if(typeof c=="string")if(h){var m=l(h.as,h.crossOrigin);s.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(c)},dr.requestFormReset=function(c){s.d.r(c)},dr.unstable_batchedUpdates=function(c,h){return c(h)},dr.useFormState=function(c,h,m){return f.H.useFormState(c,h,m)},dr.useFormStatus=function(){return f.H.useHostTransitionStatus()},dr.version="19.2.1",dr}var F0;function TC(){if(F0)return sm.exports;F0=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(r){console.error(r)}}return e(),sm.exports=GT(),sm.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var H0;function zT(){if(H0)return Pl;H0=1;var e=qT(),r=Dg(),n=TC();function s(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var i=t,a=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(a=i.return),t=i.return;while(t)}return i.tag===3?a:null}function f(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function l(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function c(t){if(u(t)!==t)throw Error(s(188))}function h(t){var i=t.alternate;if(!i){if(i=u(t),i===null)throw Error(s(188));return i!==t?null:t}for(var a=t,d=i;;){var C=a.return;if(C===null)break;var x=C.alternate;if(x===null){if(d=C.return,d!==null){a=d;continue}break}if(C.child===x.child){for(x=C.child;x;){if(x===a)return c(C),t;if(x===d)return c(C),i;x=x.sibling}throw Error(s(188))}if(a.return!==d.return)a=C,d=x;else{for(var O=!1,V=C.child;V;){if(V===a){O=!0,a=C,d=x;break}if(V===d){O=!0,d=C,a=x;break}V=V.sibling}if(!O){for(V=x.child;V;){if(V===a){O=!0,a=x,d=C;break}if(V===d){O=!0,d=x,a=C;break}V=V.sibling}if(!O)throw Error(s(189))}}if(a.alternate!==d)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:i}function m(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=m(t),i!==null)return i;t=t.sibling}return null}var p=Object.assign,_=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),y=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function H(t){return t===null||typeof t!="object"?null:(t=Q&&t[Q]||t["@@iterator"],typeof t=="function"?t:null)}var U=Symbol.for("react.client.reference");function $(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===U?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case w:return"Fragment";case S:return"Profiler";case v:return"StrictMode";case M:return"Suspense";case k:return"SuspenseList";case j:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case y:return t.displayName||"Context";case g:return(t._context.displayName||"Context")+".Consumer";case T:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case L:return i=t.displayName||null,i!==null?i:$(t.type)||"Memo";case D:i=t._payload,t=t._init;try{return $(t(i))}catch{}}return null}var te=Array.isArray,Y=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},I=[],z=-1;function P(t){return{current:t}}function G(t){0>z||(t.current=I[z],I[z]=null,z--)}function ne(t,i){z++,I[z]=t.current,t.current=i}var X=P(null),Ce=P(null),fe=P(null),W=P(null);function F(t,i){switch(ne(fe,i),ne(Ce,t),ne(X,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?r0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=r0(i),t=n0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}G(X),ne(X,t)}function ue(){G(X),G(Ce),G(fe)}function oe(t){t.memoizedState!==null&&ne(W,t);var i=X.current,a=n0(i,t.type);i!==a&&(ne(Ce,t),ne(X,a))}function de(t){Ce.current===t&&(G(X),G(Ce)),W.current===t&&(G(W),Ll._currentValue=ee)}var he,De;function Ie(t){if(he===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);he=i&&i[1]||"",De=-1<a.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+he+t+De}var Fe=!1;function je(t,i){if(!t||Fe)return"";Fe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(Se){var ve=Se}Reflect.construct(t,[],Ee)}else{try{Ee.call()}catch(Se){ve=Se}t.call(Ee.prototype)}}else{try{throw Error()}catch(Se){ve=Se}(Ee=t())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(Se){if(Se&&ve&&typeof Se.stack=="string")return[Se.stack,ve.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=d.DetermineComponentFrameRoot(),O=x[0],V=x[1];if(O&&V){var re=O.split(`
45
+ `),me=V.split(`
46
+ `);for(C=d=0;d<re.length&&!re[d].includes("DetermineComponentFrameRoot");)d++;for(;C<me.length&&!me[C].includes("DetermineComponentFrameRoot");)C++;if(d===re.length||C===me.length)for(d=re.length-1,C=me.length-1;1<=d&&0<=C&&re[d]!==me[C];)C--;for(;1<=d&&0<=C;d--,C--)if(re[d]!==me[C]){if(d!==1||C!==1)do if(d--,C--,0>C||re[d]!==me[C]){var be=`
47
+ `+re[d].replace(" at new "," at ");return t.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",t.displayName)),be}while(1<=d&&0<=C);break}}}finally{Fe=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Ie(a):""}function Oe(t,i){switch(t.tag){case 26:case 27:case 5:return Ie(t.type);case 16:return Ie("Lazy");case 13:return t.child!==i&&i!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return je(t.type,!1);case 11:return je(t.type.render,!1);case 1:return je(t.type,!0);case 31:return Ie("Activity");default:return""}}function Mt(t){try{var i="",a=null;do i+=Oe(t,a),a=t,t=t.return;while(t);return i}catch(d){return`
48
+ Error generating stack: `+d.message+`
49
+ `+d.stack}}var At=Object.prototype.hasOwnProperty,Ht=e.unstable_scheduleCallback,Tt=e.unstable_cancelCallback,Cn=e.unstable_shouldYield,Zt=e.unstable_requestPaint,kt=e.unstable_now,ar=e.unstable_getCurrentPriorityLevel,Yr=e.unstable_ImmediatePriority,bn=e.unstable_UserBlockingPriority,pr=e.unstable_NormalPriority,un=e.unstable_LowPriority,mr=e.unstable_IdlePriority,Or=e.log,ot=e.unstable_setDisableYieldValue,gr=null,Xt=null;function wn(t){if(typeof Or=="function"&&ot(t),Xt&&typeof Xt.setStrictMode=="function")try{Xt.setStrictMode(gr,t)}catch{}}var er=Math.clz32?Math.clz32:jh,Yn=Math.log,Ph=Math.LN2;function jh(t){return t>>>=0,t===0?32:31-(Yn(t)/Ph|0)|0}var Vt=256,En=262144,rt=4194304;function Wn(t){var i=t&42;if(i!==0)return i;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function vr(t,i,a){var d=t.pendingLanes;if(d===0)return 0;var C=0,x=t.suspendedLanes,O=t.pingedLanes;t=t.warmLanes;var V=d&134217727;return V!==0?(d=V&~x,d!==0?C=Wn(d):(O&=V,O!==0?C=Wn(O):a||(a=V&~t,a!==0&&(C=Wn(a))))):(V=d&~x,V!==0?C=Wn(V):O!==0?C=Wn(O):a||(a=d&~t,a!==0&&(C=Wn(a)))),C===0?0:i!==0&&i!==C&&(i&x)===0&&(x=C&-C,a=i&-i,x>=a||x===32&&(a&4194048)!==0)?i:C}function bs(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function Uh(t,i){switch(t){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 po(){var t=rt;return rt<<=1,(rt&62914560)===0&&(rt=4194304),t}function ws(t){for(var i=[],a=0;31>a;a++)i.push(t);return i}function Ti(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Fh(t,i,a,d,C,x){var O=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var V=t.entanglements,re=t.expirationTimes,me=t.hiddenUpdates;for(a=O&~a;0<a;){var be=31-er(a),Ee=1<<be;V[be]=0,re[be]=-1;var ve=me[be];if(ve!==null)for(me[be]=null,be=0;be<ve.length;be++){var Se=ve[be];Se!==null&&(Se.lane&=-536870913)}a&=~Ee}d!==0&&Ra(t,d,0),x!==0&&C===0&&t.tag!==0&&(t.suspendedLanes|=x&~(O&~i))}function Ra(t,i,a){t.pendingLanes|=i,t.suspendedLanes&=~i;var d=31-er(i);t.entangledLanes|=i,t.entanglements[d]=t.entanglements[d]|1073741824|a&261930}function Ri(t,i){var a=t.entangledLanes|=i;for(t=t.entanglements;a;){var d=31-er(a),C=1<<d;C&i|t[d]&i&&(t[d]|=i),a&=~C}}function Nc(t,i){var a=i&-i;return a=(a&42)!==0?1:Di(a),(a&(t.suspendedLanes|i))!==0?0:a}function Di(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Es(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Da(){var t=ie.p;return t!==0?t:(t=window.event,t===void 0?32:A0(t.type))}function Ma(t,i){var a=ie.p;try{return ie.p=t,i()}finally{ie.p=a}}var dn=Math.random().toString(36).slice(2),Kt="__reactFiber$"+dn,lr="__reactProps$"+dn,Mi="__reactContainer$"+dn,ka="__reactEvents$"+dn,La="__reactListeners$"+dn,Oa="__reactHandles$"+dn,Ic="__reactResources$"+dn,xs="__reactMarker$"+dn;function Ba(t){delete t[Kt],delete t[lr],delete t[ka],delete t[La],delete t[Oa]}function Kn(t){var i=t[Kt];if(i)return i;for(var a=t.parentNode;a;){if(i=a[Mi]||a[Kt]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(t=u0(t);t!==null;){if(a=t[Kt])return a;t=u0(t)}return i}t=a,a=t.parentNode}return null}function ki(t){if(t=t[Kt]||t[Mi]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function As(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(s(33))}function Li(t){var i=t[Ic];return i||(i=t[Ic]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Lt(t){t[xs]=!0}var Pc=new Set,jc={};function Wr(t,i){Qn(t,i),Qn(t+"Capture",i)}function Qn(t,i){for(jc[t]=i,t=0;t<i.length;t++)Pc.add(i[t])}var xn=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]*$"),Uc={},Na={};function Je(t){return At.call(Na,t)?!0:At.call(Uc,t)?!1:xn.test(t)?Na[t]=!0:(Uc[t]=!0,!1)}function mo(t,i,a){if(Je(i))if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+a)}}function go(t,i,a){if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+a)}}function jt(t,i,a,d){if(d===null)t.removeAttribute(a);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(i,a,""+d)}}function br(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ia(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function vo(t,i,a){var d=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var C=d.get,x=d.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return C.call(this)},set:function(O){a=""+O,x.call(this,O)}}),Object.defineProperty(t,i,{enumerable:d.enumerable}),{getValue:function(){return a},setValue:function(O){a=""+O},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function Pa(t){if(!t._valueTracker){var i=Ia(t)?"checked":"value";t._valueTracker=vo(t,i,""+t[i])}}function _o(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var a=i.getValue(),d="";return t&&(d=Ia(t)?t.checked?"true":"false":t.value),t=d,t!==a?(i.setValue(t),!0):!1}function yo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ja=/[\n"\\]/g;function wr(t){return t.replace(ja,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function So(t,i,a,d,C,x,O,V){t.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?t.type=O:t.removeAttribute("type"),i!=null?O==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+br(i)):t.value!==""+br(i)&&(t.value=""+br(i)):O!=="submit"&&O!=="reset"||t.removeAttribute("value"),i!=null?Co(t,O,br(i)):a!=null?Co(t,O,br(a)):d!=null&&t.removeAttribute("value"),C==null&&x!=null&&(t.defaultChecked=!!x),C!=null&&(t.checked=C&&typeof C!="function"&&typeof C!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?t.name=""+br(V):t.removeAttribute("name")}function Fc(t,i,a,d,C,x,O,V){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),i!=null||a!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){Pa(t);return}a=a!=null?""+br(a):"",i=i!=null?""+br(i):a,V||i===t.value||(t.value=i),t.defaultValue=i}d=d??C,d=typeof d!="function"&&typeof d!="symbol"&&!!d,t.checked=V?t.checked:!!d,t.defaultChecked=!!d,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(t.name=O),Pa(t)}function Co(t,i,a){i==="number"&&yo(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Er(t,i,a,d){if(t=t.options,i){i={};for(var C=0;C<a.length;C++)i["$"+a[C]]=!0;for(a=0;a<t.length;a++)C=i.hasOwnProperty("$"+t[a].value),t[a].selected!==C&&(t[a].selected=C),C&&d&&(t[a].defaultSelected=!0)}else{for(a=""+br(a),i=null,C=0;C<t.length;C++){if(t[C].value===a){t[C].selected=!0,d&&(t[C].defaultSelected=!0);return}i!==null||t[C].disabled||(i=t[C])}i!==null&&(i.selected=!0)}}function bo(t,i,a){if(i!=null&&(i=""+br(i),i!==t.value&&(t.value=i),a==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=a!=null?""+br(a):""}function Br(t,i,a,d){if(i==null){if(d!=null){if(a!=null)throw Error(s(92));if(te(d)){if(1<d.length)throw Error(s(93));d=d[0]}a=d}a==null&&(a=""),i=a}a=br(i),t.defaultValue=a,d=t.textContent,d===a&&d!==""&&d!==null&&(t.value=d),Pa(t)}function $n(t,i){if(i){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=i;return}}t.textContent=i}var Hh=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 Hc(t,i,a){var d=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?d?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":d?t.setProperty(i,a):typeof a!="number"||a===0||Hh.has(i)?i==="float"?t.cssFloat=a:t[i]=(""+a).trim():t[i]=a+"px"}function Vc(t,i,a){if(i!=null&&typeof i!="object")throw Error(s(62));if(t=t.style,a!=null){for(var d in a)!a.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?t.setProperty(d,""):d==="float"?t.cssFloat="":t[d]="");for(var C in i)d=i[C],i.hasOwnProperty(C)&&a[C]!==d&&Hc(t,C,d)}else for(var x in i)i.hasOwnProperty(x)&&Hc(t,x,i[x])}function Ua(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Vh=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"]]),qh=/^[\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 wo(t){return qh.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function hn(){}var Fa=null;function Ha(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Nr=null,Jn=null;function Va(t){var i=ki(t);if(i&&(t=i.stateNode)){var a=t[lr]||null;e:switch(t=i.stateNode,i.type){case"input":if(So(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+wr(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var d=a[i];if(d!==t&&d.form===t.form){var C=d[lr]||null;if(!C)throw Error(s(90));So(d,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(i=0;i<a.length;i++)d=a[i],d.form===t.form&&_o(d)}break e;case"textarea":bo(t,a.value,a.defaultValue);break e;case"select":i=a.value,i!=null&&Er(t,!!a.multiple,i,!1)}}}var Eo=!1;function qa(t,i,a){if(Eo)return t(i,a);Eo=!0;try{var d=t(i);return d}finally{if(Eo=!1,(Nr!==null||Jn!==null)&&(Vu(),Nr&&(i=Nr,t=Jn,Jn=Nr=null,Va(i),t)))for(i=0;i<t.length;i++)Va(t[i])}}function Ts(t,i){var a=t.stateNode;if(a===null)return null;var d=a[lr]||null;if(d===null)return null;a=d[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":(d=!d.disabled)||(t=t.type,d=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!d;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,i,typeof a));return a}var fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xo=!1;if(fn)try{var Rs={};Object.defineProperty(Rs,"passive",{get:function(){xo=!0}}),window.addEventListener("test",Rs,Rs),window.removeEventListener("test",Rs,Rs)}catch{xo=!1}var An=null,Ga=null,Ao=null;function qc(){if(Ao)return Ao;var t,i=Ga,a=i.length,d,C="value"in An?An.value:An.textContent,x=C.length;for(t=0;t<a&&i[t]===C[t];t++);var O=a-t;for(d=1;d<=O&&i[a-d]===C[x-d];d++);return Ao=C.slice(t,1<d?1-d:void 0)}function To(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Ro(){return!0}function Gc(){return!1}function cr(t){function i(a,d,C,x,O){this._reactName=a,this._targetInst=C,this.type=d,this.nativeEvent=x,this.target=O,this.currentTarget=null;for(var V in t)t.hasOwnProperty(V)&&(a=t[V],this[V]=a?a(x):x[V]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Ro:Gc,this.isPropagationStopped=Gc,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ro)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ro)},persist:function(){},isPersistent:Ro}),i}var Zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oi=cr(Zn),Ds=p({},Zn,{view:0,detail:0}),Gh=cr(Ds),za,Ya,Ms,ks=p({},Ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ka,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ms&&(Ms&&t.type==="mousemove"?(za=t.screenX-Ms.screenX,Ya=t.screenY-Ms.screenY):Ya=za=0,Ms=t),za)},movementY:function(t){return"movementY"in t?t.movementY:Ya}}),zc=cr(ks),zh=p({},ks,{dataTransfer:0}),Yh=cr(zh),Wh=p({},Ds,{relatedTarget:0}),Wa=cr(Wh),Kh=p({},Zn,{animationName:0,elapsedTime:0,pseudoElement:0}),Qh=cr(Kh),$h=p({},Zn,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Jh=cr($h),Zh=p({},Zn,{data:0}),Do=cr(Zh),Xh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ls={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"},ef={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tf(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=ef[t])?!!i[t]:!1}function Ka(){return tf}var rf=p({},Ds,{key:function(t){if(t.key){var i=Xh[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=To(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Ls[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ka,charCode:function(t){return t.type==="keypress"?To(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?To(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),nf=cr(rf),sf=p({},ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yc=cr(sf),of=p({},Ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ka}),Wc=cr(of),Tn=p({},Zn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qa=cr(Tn),Kc=p({},ks,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Ke=cr(Kc),Qc=p({},Zn,{newState:0,oldState:0}),$c=cr(Qc),Jc=[9,13,27,32],Mo=fn&&"CompositionEvent"in window,Bi=null;fn&&"documentMode"in document&&(Bi=document.documentMode);var Zc=fn&&"TextEvent"in window&&!Bi,$a=fn&&(!Mo||Bi&&8<Bi&&11>=Bi),Ja=" ",Os=!1;function Za(t,i){switch(t){case"keyup":return Jc.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xc(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ni=!1;function af(t,i){switch(t){case"compositionend":return Xc(i);case"keypress":return i.which!==32?null:(Os=!0,Ja);case"textInput":return t=i.data,t===Ja&&Os?null:t;default:return null}}function lf(t,i){if(Ni)return t==="compositionend"||!Mo&&Za(t,i)?(t=qc(),Ao=Ga=An=null,Ni=!1,t):null;switch(t){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 $a&&i.locale!=="ko"?null:i.data;default:return null}}var cf={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 eu(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!cf[t.type]:i==="textarea"}function tu(t,i,a,d){Nr?Jn?Jn.push(d):Jn=[d]:Nr=d,i=Qu(i,"onChange"),0<i.length&&(a=new Oi("onChange","change",null,a,d),t.push({event:a,listeners:i}))}var Bs=null,Ns=null;function uf(t){$y(t,0)}function ko(t){var i=As(t);if(_o(i))return t}function ru(t,i){if(t==="change")return i}var nu=!1;if(fn){var Xa;if(fn){var el="oninput"in document;if(!el){var iu=document.createElement("div");iu.setAttribute("oninput","return;"),el=typeof iu.oninput=="function"}Xa=el}else Xa=!1;nu=Xa&&(!document.documentMode||9<document.documentMode)}function su(){Bs&&(Bs.detachEvent("onpropertychange",ou),Ns=Bs=null)}function ou(t){if(t.propertyName==="value"&&ko(Ns)){var i=[];tu(i,Ns,t,Ha(t)),qa(uf,i)}}function df(t,i,a){t==="focusin"?(su(),Bs=i,Ns=a,Bs.attachEvent("onpropertychange",ou)):t==="focusout"&&su()}function hf(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ko(Ns)}function ff(t,i){if(t==="click")return ko(i)}function pf(t,i){if(t==="input"||t==="change")return ko(i)}function mf(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var _r=typeof Object.is=="function"?Object.is:mf;function Is(t,i){if(_r(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var a=Object.keys(t),d=Object.keys(i);if(a.length!==d.length)return!1;for(d=0;d<a.length;d++){var C=a[d];if(!At.call(i,C)||!_r(t[C],i[C]))return!1}return!0}function au(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function lu(t,i){var a=au(t);t=0;for(var d;a;){if(a.nodeType===3){if(d=t+a.textContent.length,t<=i&&d>=i)return{node:a,offset:i-t};t=d}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=au(a)}}function cu(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?cu(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function uu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=yo(t.document);i instanceof t.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)t=i.contentWindow;else break;i=yo(t.document)}return i}function tl(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var gf=fn&&"documentMode"in document&&11>=document.documentMode,Ii=null,rl=null,Ps=null,nl=!1;function du(t,i,a){var d=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;nl||Ii==null||Ii!==yo(d)||(d=Ii,"selectionStart"in d&&tl(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Ps&&Is(Ps,d)||(Ps=d,d=Qu(rl,"onSelect"),0<d.length&&(i=new Oi("onSelect","select",null,i,a),t.push({event:i,listeners:d}),i.target=Ii)))}function Xn(t,i){var a={};return a[t.toLowerCase()]=i.toLowerCase(),a["Webkit"+t]="webkit"+i,a["Moz"+t]="moz"+i,a}var Pi={animationend:Xn("Animation","AnimationEnd"),animationiteration:Xn("Animation","AnimationIteration"),animationstart:Xn("Animation","AnimationStart"),transitionrun:Xn("Transition","TransitionRun"),transitionstart:Xn("Transition","TransitionStart"),transitioncancel:Xn("Transition","TransitionCancel"),transitionend:Xn("Transition","TransitionEnd")},ei={},B={};fn&&(B=document.createElement("div").style,"AnimationEvent"in window||(delete Pi.animationend.animation,delete Pi.animationiteration.animation,delete Pi.animationstart.animation),"TransitionEvent"in window||delete Pi.transitionend.transition);function N(t){if(ei[t])return ei[t];if(!Pi[t])return t;var i=Pi[t],a;for(a in i)if(i.hasOwnProperty(a)&&a in B)return ei[t]=i[a];return t}var q=N("animationend"),Z=N("animationiteration"),se=N("animationstart"),le=N("transitionrun"),ge=N("transitionstart"),ye=N("transitioncancel"),xe=N("transitionend"),Re=new Map,Me="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(" ");Me.push("scrollEnd");function Ne(t,i){Re.set(t,i),Wr(i,[t])}var it=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Qe=[],gt=0,Ct=0;function ft(){for(var t=gt,i=Ct=gt=0;i<t;){var a=Qe[i];Qe[i++]=null;var d=Qe[i];Qe[i++]=null;var C=Qe[i];Qe[i++]=null;var x=Qe[i];if(Qe[i++]=null,d!==null&&C!==null){var O=d.pending;O===null?C.next=C:(C.next=O.next,O.next=C),d.pending=C}x!==0&&Kr(a,C,x)}}function ut(t,i,a,d){Qe[gt++]=t,Qe[gt++]=i,Qe[gt++]=a,Qe[gt++]=d,Ct|=d,t.lanes|=d,t=t.alternate,t!==null&&(t.lanes|=d)}function pn(t,i,a,d){return ut(t,i,a,d),ti(t)}function Ot(t,i){return ut(t,null,null,i),ti(t)}function Kr(t,i,a){t.lanes|=a;var d=t.alternate;d!==null&&(d.lanes|=a);for(var C=!1,x=t.return;x!==null;)x.childLanes|=a,d=x.alternate,d!==null&&(d.childLanes|=a),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(C=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,C&&i!==null&&(C=31-er(a),t=x.hiddenUpdates,d=t[C],d===null?t[C]=[i]:d.push(i),i.lane=a|536870912),x):null}function ti(t){if(50<xl)throw xl=0,Ep=null,Error(s(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ji={};function hu(t,i,a,d){this.tag=t,this.key=a,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=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ur(t,i,a,d){return new hu(t,i,a,d)}function Lo(t){return t=t.prototype,!(!t||!t.isReactComponent)}function xr(t,i){var a=t.alternate;return a===null?(a=ur(t.tag,i,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=i,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,i=t.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function js(t,i){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,i=a.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function Us(t,i,a,d,C,x){var O=0;if(d=t,typeof t=="function")Lo(t)&&(O=1);else if(typeof t=="string")O=xT(t,a,X.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case j:return t=ur(31,a,i,C),t.elementType=j,t.lanes=x,t;case w:return Fs(a.children,C,x,i);case v:O=8,C|=24;break;case S:return t=ur(12,a,i,C|2),t.elementType=S,t.lanes=x,t;case M:return t=ur(13,a,i,C),t.elementType=M,t.lanes=x,t;case k:return t=ur(19,a,i,C),t.elementType=k,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case y:O=10;break e;case g:O=9;break e;case T:O=11;break e;case L:O=14;break e;case D:O=16,d=null;break e}O=29,a=Error(s(130,t===null?"null":typeof t,"")),d=null}return i=ur(O,a,i,C),i.elementType=t,i.type=d,i.lanes=x,i}function Fs(t,i,a,d){return t=ur(7,t,d,i),t.lanes=a,t}function vf(t,i,a){return t=ur(6,t,null,i),t.lanes=a,t}function Ov(t){var i=ur(18,null,null,0);return i.stateNode=t,i}function _f(t,i,a){return i=ur(4,t.children!==null?t.children:[],t.key,i),i.lanes=a,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var Bv=new WeakMap;function Qr(t,i){if(typeof t=="object"&&t!==null){var a=Bv.get(t);return a!==void 0?a:(i={value:t,source:i,stack:Mt(i)},Bv.set(t,i),i)}return{value:t,source:i,stack:Mt(i)}}var Oo=[],Bo=0,fu=null,il=0,$r=[],Jr=0,Ui=null,Rn=1,Dn="";function ri(t,i){Oo[Bo++]=il,Oo[Bo++]=fu,fu=t,il=i}function Nv(t,i,a){$r[Jr++]=Rn,$r[Jr++]=Dn,$r[Jr++]=Ui,Ui=t;var d=Rn;t=Dn;var C=32-er(d)-1;d&=~(1<<C),a+=1;var x=32-er(i)+C;if(30<x){var O=C-C%5;x=(d&(1<<O)-1).toString(32),d>>=O,C-=O,Rn=1<<32-er(i)+C|a<<C|d,Dn=x+t}else Rn=1<<x|a<<C|d,Dn=t}function yf(t){t.return!==null&&(ri(t,1),Nv(t,1,0))}function Sf(t){for(;t===fu;)fu=Oo[--Bo],Oo[Bo]=null,il=Oo[--Bo],Oo[Bo]=null;for(;t===Ui;)Ui=$r[--Jr],$r[Jr]=null,Dn=$r[--Jr],$r[Jr]=null,Rn=$r[--Jr],$r[Jr]=null}function Iv(t,i){$r[Jr++]=Rn,$r[Jr++]=Dn,$r[Jr++]=Ui,Rn=i.id,Dn=i.overflow,Ui=t}var nr=null,wt=null,nt=!1,Fi=null,Zr=!1,Cf=Error(s(519));function Hi(t){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw sl(Qr(i,t)),Cf}function Pv(t){var i=t.stateNode,a=t.type,d=t.memoizedProps;switch(i[Kt]=t,i[lr]=d,a){case"dialog":Xe("cancel",i),Xe("close",i);break;case"iframe":case"object":case"embed":Xe("load",i);break;case"video":case"audio":for(a=0;a<Tl.length;a++)Xe(Tl[a],i);break;case"source":Xe("error",i);break;case"img":case"image":case"link":Xe("error",i),Xe("load",i);break;case"details":Xe("toggle",i);break;case"input":Xe("invalid",i),Fc(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Xe("invalid",i);break;case"textarea":Xe("invalid",i),Br(i,d.value,d.defaultValue,d.children)}a=d.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||d.suppressHydrationWarning===!0||e0(i.textContent,a)?(d.popover!=null&&(Xe("beforetoggle",i),Xe("toggle",i)),d.onScroll!=null&&Xe("scroll",i),d.onScrollEnd!=null&&Xe("scrollend",i),d.onClick!=null&&(i.onclick=hn),i=!0):i=!1,i||Hi(t,!0)}function jv(t){for(nr=t.return;nr;)switch(nr.tag){case 5:case 31:case 13:Zr=!1;return;case 27:case 3:Zr=!0;return;default:nr=nr.return}}function No(t){if(t!==nr)return!1;if(!nt)return jv(t),nt=!0,!1;var i=t.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Up(t.type,t.memoizedProps)),a=!a),a&&wt&&Hi(t),jv(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));wt=c0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));wt=c0(t)}else i===27?(i=wt,ts(t.type)?(t=Gp,Gp=null,wt=t):wt=i):wt=nr?en(t.stateNode.nextSibling):null;return!0}function Hs(){wt=nr=null,nt=!1}function bf(){var t=Fi;return t!==null&&(Dr===null?Dr=t:Dr.push.apply(Dr,t),Fi=null),t}function sl(t){Fi===null?Fi=[t]:Fi.push(t)}var wf=P(null),Vs=null,ni=null;function Vi(t,i,a){ne(wf,i._currentValue),i._currentValue=a}function ii(t){t._currentValue=wf.current,G(wf)}function Ef(t,i,a){for(;t!==null;){var d=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),t===a)break;t=t.return}}function xf(t,i,a,d){var C=t.child;for(C!==null&&(C.return=t);C!==null;){var x=C.dependencies;if(x!==null){var O=C.child;x=x.firstContext;e:for(;x!==null;){var V=x;x=C;for(var re=0;re<i.length;re++)if(V.context===i[re]){x.lanes|=a,V=x.alternate,V!==null&&(V.lanes|=a),Ef(x.return,a,t),d||(O=null);break e}x=V.next}}else if(C.tag===18){if(O=C.return,O===null)throw Error(s(341));O.lanes|=a,x=O.alternate,x!==null&&(x.lanes|=a),Ef(O,a,t),O=null}else O=C.child;if(O!==null)O.return=C;else for(O=C;O!==null;){if(O===t){O=null;break}if(C=O.sibling,C!==null){C.return=O.return,O=C;break}O=O.return}C=O}}function Io(t,i,a,d){t=null;for(var C=i,x=!1;C!==null;){if(!x){if((C.flags&524288)!==0)x=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var O=C.alternate;if(O===null)throw Error(s(387));if(O=O.memoizedProps,O!==null){var V=C.type;_r(C.pendingProps.value,O.value)||(t!==null?t.push(V):t=[V])}}else if(C===W.current){if(O=C.alternate,O===null)throw Error(s(387));O.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(t!==null?t.push(Ll):t=[Ll])}C=C.return}t!==null&&xf(i,t,a,d),i.flags|=262144}function pu(t){for(t=t.firstContext;t!==null;){if(!_r(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function qs(t){Vs=t,ni=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function ir(t){return Uv(Vs,t)}function mu(t,i){return Vs===null&&qs(t),Uv(t,i)}function Uv(t,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},ni===null){if(t===null)throw Error(s(308));ni=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else ni=ni.next=i;return a}var CA=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(a,d){t.push(d)}};this.abort=function(){i.aborted=!0,t.forEach(function(a){return a()})}},bA=e.unstable_scheduleCallback,wA=e.unstable_NormalPriority,qt={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Af(){return{controller:new CA,data:new Map,refCount:0}}function ol(t){t.refCount--,t.refCount===0&&bA(wA,function(){t.controller.abort()})}var al=null,Tf=0,Po=0,jo=null;function EA(t,i){if(al===null){var a=al=[];Tf=0,Po=Mp(),jo={status:"pending",value:void 0,then:function(d){a.push(d)}}}return Tf++,i.then(Fv,Fv),i}function Fv(){if(--Tf===0&&al!==null){jo!==null&&(jo.status="fulfilled");var t=al;al=null,Po=0,jo=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function xA(t,i){var a=[],d={status:"pending",value:null,reason:null,then:function(C){a.push(C)}};return t.then(function(){d.status="fulfilled",d.value=i;for(var C=0;C<a.length;C++)(0,a[C])(i)},function(C){for(d.status="rejected",d.reason=C,C=0;C<a.length;C++)(0,a[C])(void 0)}),d}var Hv=Y.S;Y.S=function(t,i){Ey=kt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&EA(t,i),Hv!==null&&Hv(t,i)};var Gs=P(null);function Rf(){var t=Gs.current;return t!==null?t:St.pooledCache}function gu(t,i){i===null?ne(Gs,Gs.current):ne(Gs,i.pool)}function Vv(){var t=Rf();return t===null?null:{parent:qt._currentValue,pool:t}}var Uo=Error(s(460)),Df=Error(s(474)),vu=Error(s(542)),_u={then:function(){}};function qv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Gv(t,i,a){switch(a=t[a],a===void 0?t.push(i):a!==i&&(i.then(hn,hn),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Yv(t),t;default:if(typeof i.status=="string")i.then(hn,hn);else{if(t=St,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=i,t.status="pending",t.then(function(d){if(i.status==="pending"){var C=i;C.status="fulfilled",C.value=d}},function(d){if(i.status==="pending"){var C=i;C.status="rejected",C.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Yv(t),t}throw Ys=i,Uo}}function zs(t){try{var i=t._init;return i(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ys=a,Uo):a}}var Ys=null;function zv(){if(Ys===null)throw Error(s(459));var t=Ys;return Ys=null,t}function Yv(t){if(t===Uo||t===vu)throw Error(s(483))}var Fo=null,ll=0;function yu(t){var i=ll;return ll+=1,Fo===null&&(Fo=[]),Gv(Fo,t,i)}function cl(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Su(t,i){throw i.$$typeof===_?Error(s(525)):(t=Object.prototype.toString.call(i),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Wv(t){function i(ce,ae){if(t){var pe=ce.deletions;pe===null?(ce.deletions=[ae],ce.flags|=16):pe.push(ae)}}function a(ce,ae){if(!t)return null;for(;ae!==null;)i(ce,ae),ae=ae.sibling;return null}function d(ce){for(var ae=new Map;ce!==null;)ce.key!==null?ae.set(ce.key,ce):ae.set(ce.index,ce),ce=ce.sibling;return ae}function C(ce,ae){return ce=xr(ce,ae),ce.index=0,ce.sibling=null,ce}function x(ce,ae,pe){return ce.index=pe,t?(pe=ce.alternate,pe!==null?(pe=pe.index,pe<ae?(ce.flags|=67108866,ae):pe):(ce.flags|=67108866,ae)):(ce.flags|=1048576,ae)}function O(ce){return t&&ce.alternate===null&&(ce.flags|=67108866),ce}function V(ce,ae,pe,we){return ae===null||ae.tag!==6?(ae=vf(pe,ce.mode,we),ae.return=ce,ae):(ae=C(ae,pe),ae.return=ce,ae)}function re(ce,ae,pe,we){var Pe=pe.type;return Pe===w?be(ce,ae,pe.props.children,we,pe.key):ae!==null&&(ae.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===D&&zs(Pe)===ae.type)?(ae=C(ae,pe.props),cl(ae,pe),ae.return=ce,ae):(ae=Us(pe.type,pe.key,pe.props,null,ce.mode,we),cl(ae,pe),ae.return=ce,ae)}function me(ce,ae,pe,we){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==pe.containerInfo||ae.stateNode.implementation!==pe.implementation?(ae=_f(pe,ce.mode,we),ae.return=ce,ae):(ae=C(ae,pe.children||[]),ae.return=ce,ae)}function be(ce,ae,pe,we,Pe){return ae===null||ae.tag!==7?(ae=Fs(pe,ce.mode,we,Pe),ae.return=ce,ae):(ae=C(ae,pe),ae.return=ce,ae)}function Ee(ce,ae,pe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=vf(""+ae,ce.mode,pe),ae.return=ce,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case E:return pe=Us(ae.type,ae.key,ae.props,null,ce.mode,pe),cl(pe,ae),pe.return=ce,pe;case A:return ae=_f(ae,ce.mode,pe),ae.return=ce,ae;case D:return ae=zs(ae),Ee(ce,ae,pe)}if(te(ae)||H(ae))return ae=Fs(ae,ce.mode,pe,null),ae.return=ce,ae;if(typeof ae.then=="function")return Ee(ce,yu(ae),pe);if(ae.$$typeof===y)return Ee(ce,mu(ce,ae),pe);Su(ce,ae)}return null}function ve(ce,ae,pe,we){var Pe=ae!==null?ae.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return Pe!==null?null:V(ce,ae,""+pe,we);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case E:return pe.key===Pe?re(ce,ae,pe,we):null;case A:return pe.key===Pe?me(ce,ae,pe,we):null;case D:return pe=zs(pe),ve(ce,ae,pe,we)}if(te(pe)||H(pe))return Pe!==null?null:be(ce,ae,pe,we,null);if(typeof pe.then=="function")return ve(ce,ae,yu(pe),we);if(pe.$$typeof===y)return ve(ce,ae,mu(ce,pe),we);Su(ce,pe)}return null}function Se(ce,ae,pe,we,Pe){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return ce=ce.get(pe)||null,V(ae,ce,""+we,Pe);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case E:return ce=ce.get(we.key===null?pe:we.key)||null,re(ae,ce,we,Pe);case A:return ce=ce.get(we.key===null?pe:we.key)||null,me(ae,ce,we,Pe);case D:return we=zs(we),Se(ce,ae,pe,we,Pe)}if(te(we)||H(we))return ce=ce.get(pe)||null,be(ae,ce,we,Pe,null);if(typeof we.then=="function")return Se(ce,ae,pe,yu(we),Pe);if(we.$$typeof===y)return Se(ce,ae,pe,mu(ae,we),Pe);Su(ae,we)}return null}function ke(ce,ae,pe,we){for(var Pe=null,at=null,Be=ae,ze=ae=0,tt=null;Be!==null&&ze<pe.length;ze++){Be.index>ze?(tt=Be,Be=null):tt=Be.sibling;var lt=ve(ce,Be,pe[ze],we);if(lt===null){Be===null&&(Be=tt);break}t&&Be&&lt.alternate===null&&i(ce,Be),ae=x(lt,ae,ze),at===null?Pe=lt:at.sibling=lt,at=lt,Be=tt}if(ze===pe.length)return a(ce,Be),nt&&ri(ce,ze),Pe;if(Be===null){for(;ze<pe.length;ze++)Be=Ee(ce,pe[ze],we),Be!==null&&(ae=x(Be,ae,ze),at===null?Pe=Be:at.sibling=Be,at=Be);return nt&&ri(ce,ze),Pe}for(Be=d(Be);ze<pe.length;ze++)tt=Se(Be,ce,ze,pe[ze],we),tt!==null&&(t&&tt.alternate!==null&&Be.delete(tt.key===null?ze:tt.key),ae=x(tt,ae,ze),at===null?Pe=tt:at.sibling=tt,at=tt);return t&&Be.forEach(function(os){return i(ce,os)}),nt&&ri(ce,ze),Pe}function Ue(ce,ae,pe,we){if(pe==null)throw Error(s(151));for(var Pe=null,at=null,Be=ae,ze=ae=0,tt=null,lt=pe.next();Be!==null&&!lt.done;ze++,lt=pe.next()){Be.index>ze?(tt=Be,Be=null):tt=Be.sibling;var os=ve(ce,Be,lt.value,we);if(os===null){Be===null&&(Be=tt);break}t&&Be&&os.alternate===null&&i(ce,Be),ae=x(os,ae,ze),at===null?Pe=os:at.sibling=os,at=os,Be=tt}if(lt.done)return a(ce,Be),nt&&ri(ce,ze),Pe;if(Be===null){for(;!lt.done;ze++,lt=pe.next())lt=Ee(ce,lt.value,we),lt!==null&&(ae=x(lt,ae,ze),at===null?Pe=lt:at.sibling=lt,at=lt);return nt&&ri(ce,ze),Pe}for(Be=d(Be);!lt.done;ze++,lt=pe.next())lt=Se(Be,ce,ze,lt.value,we),lt!==null&&(t&&lt.alternate!==null&&Be.delete(lt.key===null?ze:lt.key),ae=x(lt,ae,ze),at===null?Pe=lt:at.sibling=lt,at=lt);return t&&Be.forEach(function(IT){return i(ce,IT)}),nt&&ri(ce,ze),Pe}function yt(ce,ae,pe,we){if(typeof pe=="object"&&pe!==null&&pe.type===w&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case E:e:{for(var Pe=pe.key;ae!==null;){if(ae.key===Pe){if(Pe=pe.type,Pe===w){if(ae.tag===7){a(ce,ae.sibling),we=C(ae,pe.props.children),we.return=ce,ce=we;break e}}else if(ae.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===D&&zs(Pe)===ae.type){a(ce,ae.sibling),we=C(ae,pe.props),cl(we,pe),we.return=ce,ce=we;break e}a(ce,ae);break}else i(ce,ae);ae=ae.sibling}pe.type===w?(we=Fs(pe.props.children,ce.mode,we,pe.key),we.return=ce,ce=we):(we=Us(pe.type,pe.key,pe.props,null,ce.mode,we),cl(we,pe),we.return=ce,ce=we)}return O(ce);case A:e:{for(Pe=pe.key;ae!==null;){if(ae.key===Pe)if(ae.tag===4&&ae.stateNode.containerInfo===pe.containerInfo&&ae.stateNode.implementation===pe.implementation){a(ce,ae.sibling),we=C(ae,pe.children||[]),we.return=ce,ce=we;break e}else{a(ce,ae);break}else i(ce,ae);ae=ae.sibling}we=_f(pe,ce.mode,we),we.return=ce,ce=we}return O(ce);case D:return pe=zs(pe),yt(ce,ae,pe,we)}if(te(pe))return ke(ce,ae,pe,we);if(H(pe)){if(Pe=H(pe),typeof Pe!="function")throw Error(s(150));return pe=Pe.call(pe),Ue(ce,ae,pe,we)}if(typeof pe.then=="function")return yt(ce,ae,yu(pe),we);if(pe.$$typeof===y)return yt(ce,ae,mu(ce,pe),we);Su(ce,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,ae!==null&&ae.tag===6?(a(ce,ae.sibling),we=C(ae,pe),we.return=ce,ce=we):(a(ce,ae),we=vf(pe,ce.mode,we),we.return=ce,ce=we),O(ce)):a(ce,ae)}return function(ce,ae,pe,we){try{ll=0;var Pe=yt(ce,ae,pe,we);return Fo=null,Pe}catch(Be){if(Be===Uo||Be===vu)throw Be;var at=ur(29,Be,null,ce.mode);return at.lanes=we,at.return=ce,at}finally{}}}var Ws=Wv(!0),Kv=Wv(!1),qi=!1;function Mf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kf(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function zi(t,i,a){var d=t.updateQueue;if(d===null)return null;if(d=d.shared,(dt&2)!==0){var C=d.pending;return C===null?i.next=i:(i.next=C.next,C.next=i),d.pending=i,i=ti(t),Kr(t,null,a),i}return ut(t,d,i,a),ti(t)}function ul(t,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var d=i.lanes;d&=t.pendingLanes,a|=d,i.lanes=a,Ri(t,a)}}function Lf(t,i){var a=t.updateQueue,d=t.alternate;if(d!==null&&(d=d.updateQueue,a===d)){var C=null,x=null;if(a=a.firstBaseUpdate,a!==null){do{var O={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};x===null?C=x=O:x=x.next=O,a=a.next}while(a!==null);x===null?C=x=i:x=x.next=i}else C=x=i;a={baseState:d.baseState,firstBaseUpdate:C,lastBaseUpdate:x,shared:d.shared,callbacks:d.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=i:t.next=i,a.lastBaseUpdate=i}var Of=!1;function dl(){if(Of){var t=jo;if(t!==null)throw t}}function hl(t,i,a,d){Of=!1;var C=t.updateQueue;qi=!1;var x=C.firstBaseUpdate,O=C.lastBaseUpdate,V=C.shared.pending;if(V!==null){C.shared.pending=null;var re=V,me=re.next;re.next=null,O===null?x=me:O.next=me,O=re;var be=t.alternate;be!==null&&(be=be.updateQueue,V=be.lastBaseUpdate,V!==O&&(V===null?be.firstBaseUpdate=me:V.next=me,be.lastBaseUpdate=re))}if(x!==null){var Ee=C.baseState;O=0,be=me=re=null,V=x;do{var ve=V.lane&-536870913,Se=ve!==V.lane;if(Se?(et&ve)===ve:(d&ve)===ve){ve!==0&&ve===Po&&(Of=!0),be!==null&&(be=be.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var ke=t,Ue=V;ve=i;var yt=a;switch(Ue.tag){case 1:if(ke=Ue.payload,typeof ke=="function"){Ee=ke.call(yt,Ee,ve);break e}Ee=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ue.payload,ve=typeof ke=="function"?ke.call(yt,Ee,ve):ke,ve==null)break e;Ee=p({},Ee,ve);break e;case 2:qi=!0}}ve=V.callback,ve!==null&&(t.flags|=64,Se&&(t.flags|=8192),Se=C.callbacks,Se===null?C.callbacks=[ve]:Se.push(ve))}else Se={lane:ve,tag:V.tag,payload:V.payload,callback:V.callback,next:null},be===null?(me=be=Se,re=Ee):be=be.next=Se,O|=ve;if(V=V.next,V===null){if(V=C.shared.pending,V===null)break;Se=V,V=Se.next,Se.next=null,C.lastBaseUpdate=Se,C.shared.pending=null}}while(!0);be===null&&(re=Ee),C.baseState=re,C.firstBaseUpdate=me,C.lastBaseUpdate=be,x===null&&(C.shared.lanes=0),$i|=O,t.lanes=O,t.memoizedState=Ee}}function Qv(t,i){if(typeof t!="function")throw Error(s(191,t));t.call(i)}function $v(t,i){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Qv(a[t],i)}var Ho=P(null),Cu=P(0);function Jv(t,i){t=fi,ne(Cu,t),ne(Ho,i),fi=t|i.baseLanes}function Bf(){ne(Cu,fi),ne(Ho,Ho.current)}function Nf(){fi=Cu.current,G(Ho),G(Cu)}var Ir=P(null),Xr=null;function Yi(t){var i=t.alternate;ne(Ut,Ut.current&1),ne(Ir,t),Xr===null&&(i===null||Ho.current!==null||i.memoizedState!==null)&&(Xr=t)}function If(t){ne(Ut,Ut.current),ne(Ir,t),Xr===null&&(Xr=t)}function Zv(t){t.tag===22?(ne(Ut,Ut.current),ne(Ir,t),Xr===null&&(Xr=t)):Wi()}function Wi(){ne(Ut,Ut.current),ne(Ir,Ir.current)}function Pr(t){G(Ir),Xr===t&&(Xr=null),G(Ut)}var Ut=P(0);function bu(t){for(var i=t;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Vp(a)||qp(a)))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===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var si=0,qe=null,vt=null,Gt=null,wu=!1,Vo=!1,Ks=!1,Eu=0,fl=0,qo=null,AA=0;function It(){throw Error(s(321))}function Pf(t,i){if(i===null)return!1;for(var a=0;a<i.length&&a<t.length;a++)if(!_r(t[a],i[a]))return!1;return!0}function jf(t,i,a,d,C,x){return si=x,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Y.H=t===null||t.memoizedState===null?N_:Xf,Ks=!1,x=a(d,C),Ks=!1,Vo&&(x=e_(i,a,d,C)),Xv(t),x}function Xv(t){Y.H=gl;var i=vt!==null&&vt.next!==null;if(si=0,Gt=vt=qe=null,wu=!1,fl=0,qo=null,i)throw Error(s(300));t===null||zt||(t=t.dependencies,t!==null&&pu(t)&&(zt=!0))}function e_(t,i,a,d){qe=t;var C=0;do{if(Vo&&(qo=null),fl=0,Vo=!1,25<=C)throw Error(s(301));if(C+=1,Gt=vt=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}Y.H=I_,x=i(a,d)}while(Vo);return x}function TA(){var t=Y.H,i=t.useState()[0];return i=typeof i.then=="function"?pl(i):i,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(qe.flags|=1024),i}function Uf(){var t=Eu!==0;return Eu=0,t}function Ff(t,i,a){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~a}function Hf(t){if(wu){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}wu=!1}si=0,Gt=vt=qe=null,Vo=!1,fl=Eu=0,qo=null}function yr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gt===null?qe.memoizedState=Gt=t:Gt=Gt.next=t,Gt}function Ft(){if(vt===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var i=Gt===null?qe.memoizedState:Gt.next;if(i!==null)Gt=i,vt=t;else{if(t===null)throw qe.alternate===null?Error(s(467)):Error(s(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Gt===null?qe.memoizedState=Gt=t:Gt=Gt.next=t}return Gt}function xu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pl(t){var i=fl;return fl+=1,qo===null&&(qo=[]),t=Gv(qo,t,i),i=qe,(Gt===null?i.memoizedState:Gt.next)===null&&(i=i.alternate,Y.H=i===null||i.memoizedState===null?N_:Xf),t}function Au(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return pl(t);if(t.$$typeof===y)return ir(t)}throw Error(s(438,String(t)))}function Vf(t){var i=null,a=qe.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var d=qe.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(C){return C.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=xu(),qe.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(t),d=0;d<t;d++)a[d]=K;return i.index++,a}function oi(t,i){return typeof i=="function"?i(t):i}function Tu(t){var i=Ft();return qf(i,vt,t)}function qf(t,i,a){var d=t.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=a;var C=t.baseQueue,x=d.pending;if(x!==null){if(C!==null){var O=C.next;C.next=x.next,x.next=O}i.baseQueue=C=x,d.pending=null}if(x=t.baseState,C===null)t.memoizedState=x;else{i=C.next;var V=O=null,re=null,me=i,be=!1;do{var Ee=me.lane&-536870913;if(Ee!==me.lane?(et&Ee)===Ee:(si&Ee)===Ee){var ve=me.revertLane;if(ve===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),Ee===Po&&(be=!0);else if((si&ve)===ve){me=me.next,ve===Po&&(be=!0);continue}else Ee={lane:0,revertLane:me.revertLane,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},re===null?(V=re=Ee,O=x):re=re.next=Ee,qe.lanes|=ve,$i|=ve;Ee=me.action,Ks&&a(x,Ee),x=me.hasEagerState?me.eagerState:a(x,Ee)}else ve={lane:Ee,revertLane:me.revertLane,gesture:me.gesture,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},re===null?(V=re=ve,O=x):re=re.next=ve,qe.lanes|=Ee,$i|=Ee;me=me.next}while(me!==null&&me!==i);if(re===null?O=x:re.next=V,!_r(x,t.memoizedState)&&(zt=!0,be&&(a=jo,a!==null)))throw a;t.memoizedState=x,t.baseState=O,t.baseQueue=re,d.lastRenderedState=x}return C===null&&(d.lanes=0),[t.memoizedState,d.dispatch]}function Gf(t){var i=Ft(),a=i.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var d=a.dispatch,C=a.pending,x=i.memoizedState;if(C!==null){a.pending=null;var O=C=C.next;do x=t(x,O.action),O=O.next;while(O!==C);_r(x,i.memoizedState)||(zt=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),a.lastRenderedState=x}return[x,d]}function t_(t,i,a){var d=qe,C=Ft(),x=nt;if(x){if(a===void 0)throw Error(s(407));a=a()}else a=i();var O=!_r((vt||C).memoizedState,a);if(O&&(C.memoizedState=a,zt=!0),C=C.queue,Wf(i_.bind(null,d,C,t),[t]),C.getSnapshot!==i||O||Gt!==null&&Gt.memoizedState.tag&1){if(d.flags|=2048,Go(9,{destroy:void 0},n_.bind(null,d,C,a,i),null),St===null)throw Error(s(349));x||(si&127)!==0||r_(d,i,a)}return a}function r_(t,i,a){t.flags|=16384,t={getSnapshot:i,value:a},i=qe.updateQueue,i===null?(i=xu(),qe.updateQueue=i,i.stores=[t]):(a=i.stores,a===null?i.stores=[t]:a.push(t))}function n_(t,i,a,d){i.value=a,i.getSnapshot=d,s_(i)&&o_(t)}function i_(t,i,a){return a(function(){s_(i)&&o_(t)})}function s_(t){var i=t.getSnapshot;t=t.value;try{var a=i();return!_r(t,a)}catch{return!0}}function o_(t){var i=Ot(t,2);i!==null&&Mr(i,t,2)}function zf(t){var i=yr();if(typeof t=="function"){var a=t;if(t=a(),Ks){wn(!0);try{a()}finally{wn(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:t},i}function a_(t,i,a,d){return t.baseState=a,qf(t,vt,typeof d=="function"?d:oi)}function RA(t,i,a,d,C){if(Mu(t))throw Error(s(485));if(t=i.action,t!==null){var x={payload:C,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){x.listeners.push(O)}};Y.T!==null?a(!0):x.isTransition=!1,d(x),a=i.pending,a===null?(x.next=i.pending=x,l_(i,x)):(x.next=a.next,i.pending=a.next=x)}}function l_(t,i){var a=i.action,d=i.payload,C=t.state;if(i.isTransition){var x=Y.T,O={};Y.T=O;try{var V=a(C,d),re=Y.S;re!==null&&re(O,V),c_(t,i,V)}catch(me){Yf(t,i,me)}finally{x!==null&&O.types!==null&&(x.types=O.types),Y.T=x}}else try{x=a(C,d),c_(t,i,x)}catch(me){Yf(t,i,me)}}function c_(t,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(d){u_(t,i,d)},function(d){return Yf(t,i,d)}):u_(t,i,a)}function u_(t,i,a){i.status="fulfilled",i.value=a,d_(i),t.state=a,i=t.pending,i!==null&&(a=i.next,a===i?t.pending=null:(a=a.next,i.next=a,l_(t,a)))}function Yf(t,i,a){var d=t.pending;if(t.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=a,d_(i),i=i.next;while(i!==d)}t.action=null}function d_(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function h_(t,i){return i}function f_(t,i){if(nt){var a=St.formState;if(a!==null){e:{var d=qe;if(nt){if(wt){t:{for(var C=wt,x=Zr;C.nodeType!==8;){if(!x){C=null;break t}if(C=en(C.nextSibling),C===null){C=null;break t}}x=C.data,C=x==="F!"||x==="F"?C:null}if(C){wt=en(C.nextSibling),d=C.data==="F!";break e}}Hi(d)}d=!1}d&&(i=a[0])}}return a=yr(),a.memoizedState=a.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h_,lastRenderedState:i},a.queue=d,a=L_.bind(null,qe,d),d.dispatch=a,d=zf(!1),x=Zf.bind(null,qe,!1,d.queue),d=yr(),C={state:i,dispatch:null,action:t,pending:null},d.queue=C,a=RA.bind(null,qe,C,x,a),C.dispatch=a,d.memoizedState=t,[i,a,!1]}function p_(t){var i=Ft();return m_(i,vt,t)}function m_(t,i,a){if(i=qf(t,i,h_)[0],t=Tu(oi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=pl(i)}catch(O){throw O===Uo?vu:O}else d=i;i=Ft();var C=i.queue,x=C.dispatch;return a!==i.memoizedState&&(qe.flags|=2048,Go(9,{destroy:void 0},DA.bind(null,C,a),null)),[d,x,t]}function DA(t,i){t.action=i}function g_(t){var i=Ft(),a=vt;if(a!==null)return m_(i,a,t);Ft(),i=i.memoizedState,a=Ft();var d=a.queue.dispatch;return a.memoizedState=t,[i,d,!1]}function Go(t,i,a,d){return t={tag:t,create:a,deps:d,inst:i,next:null},i=qe.updateQueue,i===null&&(i=xu(),qe.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=t.next=t:(d=a.next,a.next=t,t.next=d,i.lastEffect=t),t}function v_(){return Ft().memoizedState}function Ru(t,i,a,d){var C=yr();qe.flags|=t,C.memoizedState=Go(1|i,{destroy:void 0},a,d===void 0?null:d)}function Du(t,i,a,d){var C=Ft();d=d===void 0?null:d;var x=C.memoizedState.inst;vt!==null&&d!==null&&Pf(d,vt.memoizedState.deps)?C.memoizedState=Go(i,x,a,d):(qe.flags|=t,C.memoizedState=Go(1|i,x,a,d))}function __(t,i){Ru(8390656,8,t,i)}function Wf(t,i){Du(2048,8,t,i)}function MA(t){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=xu(),qe.updateQueue=i,i.events=[t];else{var a=i.events;a===null?i.events=[t]:a.push(t)}}function y_(t){var i=Ft().memoizedState;return MA({ref:i,nextImpl:t}),function(){if((dt&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function S_(t,i){return Du(4,2,t,i)}function C_(t,i){return Du(4,4,t,i)}function b_(t,i){if(typeof i=="function"){t=t();var a=i(t);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function w_(t,i,a){a=a!=null?a.concat([t]):null,Du(4,4,b_.bind(null,i,t),a)}function Kf(){}function E_(t,i){var a=Ft();i=i===void 0?null:i;var d=a.memoizedState;return i!==null&&Pf(i,d[1])?d[0]:(a.memoizedState=[t,i],t)}function x_(t,i){var a=Ft();i=i===void 0?null:i;var d=a.memoizedState;if(i!==null&&Pf(i,d[1]))return d[0];if(d=t(),Ks){wn(!0);try{t()}finally{wn(!1)}}return a.memoizedState=[d,i],d}function Qf(t,i,a){return a===void 0||(si&1073741824)!==0&&(et&261930)===0?t.memoizedState=i:(t.memoizedState=a,t=Ay(),qe.lanes|=t,$i|=t,a)}function A_(t,i,a,d){return _r(a,i)?a:Ho.current!==null?(t=Qf(t,a,d),_r(t,i)||(zt=!0),t):(si&42)===0||(si&1073741824)!==0&&(et&261930)===0?(zt=!0,t.memoizedState=a):(t=Ay(),qe.lanes|=t,$i|=t,i)}function T_(t,i,a,d,C){var x=ie.p;ie.p=x!==0&&8>x?x:8;var O=Y.T,V={};Y.T=V,Zf(t,!1,i,a);try{var re=C(),me=Y.S;if(me!==null&&me(V,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var be=xA(re,d);ml(t,i,be,Fr(t))}else ml(t,i,d,Fr(t))}catch(Ee){ml(t,i,{then:function(){},status:"rejected",reason:Ee},Fr())}finally{ie.p=x,O!==null&&V.types!==null&&(O.types=V.types),Y.T=O}}function kA(){}function $f(t,i,a,d){if(t.tag!==5)throw Error(s(476));var C=R_(t).queue;T_(t,C,i,ee,a===null?kA:function(){return D_(t),a(d)})}function R_(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:ee},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:a},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function D_(t){var i=R_(t);i.next===null&&(i=t.alternate.memoizedState),ml(t,i.next.queue,{},Fr())}function Jf(){return ir(Ll)}function M_(){return Ft().memoizedState}function k_(){return Ft().memoizedState}function LA(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var a=Fr();t=Gi(a);var d=zi(i,t,a);d!==null&&(Mr(d,i,a),ul(d,i,a)),i={cache:Af()},t.payload=i;return}i=i.return}}function OA(t,i,a){var d=Fr();a={lane:d,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Mu(t)?O_(i,a):(a=pn(t,i,a,d),a!==null&&(Mr(a,t,d),B_(a,i,d)))}function L_(t,i,a){var d=Fr();ml(t,i,a,d)}function ml(t,i,a,d){var C={lane:d,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Mu(t))O_(i,C);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var O=i.lastRenderedState,V=x(O,a);if(C.hasEagerState=!0,C.eagerState=V,_r(V,O))return ut(t,i,C,0),St===null&&ft(),!1}catch{}finally{}if(a=pn(t,i,C,d),a!==null)return Mr(a,t,d),B_(a,i,d),!0}return!1}function Zf(t,i,a,d){if(d={lane:2,revertLane:Mp(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Mu(t)){if(i)throw Error(s(479))}else i=pn(t,a,d,2),i!==null&&Mr(i,t,2)}function Mu(t){var i=t.alternate;return t===qe||i!==null&&i===qe}function O_(t,i){Vo=wu=!0;var a=t.pending;a===null?i.next=i:(i.next=a.next,a.next=i),t.pending=i}function B_(t,i,a){if((a&4194048)!==0){var d=i.lanes;d&=t.pendingLanes,a|=d,i.lanes=a,Ri(t,a)}}var gl={readContext:ir,use:Au,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};gl.useEffectEvent=It;var N_={readContext:ir,use:Au,useCallback:function(t,i){return yr().memoizedState=[t,i===void 0?null:i],t},useContext:ir,useEffect:__,useImperativeHandle:function(t,i,a){a=a!=null?a.concat([t]):null,Ru(4194308,4,b_.bind(null,i,t),a)},useLayoutEffect:function(t,i){return Ru(4194308,4,t,i)},useInsertionEffect:function(t,i){Ru(4,2,t,i)},useMemo:function(t,i){var a=yr();i=i===void 0?null:i;var d=t();if(Ks){wn(!0);try{t()}finally{wn(!1)}}return a.memoizedState=[d,i],d},useReducer:function(t,i,a){var d=yr();if(a!==void 0){var C=a(i);if(Ks){wn(!0);try{a(i)}finally{wn(!1)}}}else C=i;return d.memoizedState=d.baseState=C,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:C},d.queue=t,t=t.dispatch=OA.bind(null,qe,t),[d.memoizedState,t]},useRef:function(t){var i=yr();return t={current:t},i.memoizedState=t},useState:function(t){t=zf(t);var i=t.queue,a=L_.bind(null,qe,i);return i.dispatch=a,[t.memoizedState,a]},useDebugValue:Kf,useDeferredValue:function(t,i){var a=yr();return Qf(a,t,i)},useTransition:function(){var t=zf(!1);return t=T_.bind(null,qe,t.queue,!0,!1),yr().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,a){var d=qe,C=yr();if(nt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=i(),St===null)throw Error(s(349));(et&127)!==0||r_(d,i,a)}C.memoizedState=a;var x={value:a,getSnapshot:i};return C.queue=x,__(i_.bind(null,d,x,t),[t]),d.flags|=2048,Go(9,{destroy:void 0},n_.bind(null,d,x,a,i),null),a},useId:function(){var t=yr(),i=St.identifierPrefix;if(nt){var a=Dn,d=Rn;a=(d&~(1<<32-er(d)-1)).toString(32)+a,i="_"+i+"R_"+a,a=Eu++,0<a&&(i+="H"+a.toString(32)),i+="_"}else a=AA++,i="_"+i+"r_"+a.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Jf,useFormState:f_,useActionState:f_,useOptimistic:function(t){var i=yr();i.memoizedState=i.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=Zf.bind(null,qe,!0,a),a.dispatch=i,[t,i]},useMemoCache:Vf,useCacheRefresh:function(){return yr().memoizedState=LA.bind(null,qe)},useEffectEvent:function(t){var i=yr(),a={impl:t};return i.memoizedState=a,function(){if((dt&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Xf={readContext:ir,use:Au,useCallback:E_,useContext:ir,useEffect:Wf,useImperativeHandle:w_,useInsertionEffect:S_,useLayoutEffect:C_,useMemo:x_,useReducer:Tu,useRef:v_,useState:function(){return Tu(oi)},useDebugValue:Kf,useDeferredValue:function(t,i){var a=Ft();return A_(a,vt.memoizedState,t,i)},useTransition:function(){var t=Tu(oi)[0],i=Ft().memoizedState;return[typeof t=="boolean"?t:pl(t),i]},useSyncExternalStore:t_,useId:M_,useHostTransitionStatus:Jf,useFormState:p_,useActionState:p_,useOptimistic:function(t,i){var a=Ft();return a_(a,vt,t,i)},useMemoCache:Vf,useCacheRefresh:k_};Xf.useEffectEvent=y_;var I_={readContext:ir,use:Au,useCallback:E_,useContext:ir,useEffect:Wf,useImperativeHandle:w_,useInsertionEffect:S_,useLayoutEffect:C_,useMemo:x_,useReducer:Gf,useRef:v_,useState:function(){return Gf(oi)},useDebugValue:Kf,useDeferredValue:function(t,i){var a=Ft();return vt===null?Qf(a,t,i):A_(a,vt.memoizedState,t,i)},useTransition:function(){var t=Gf(oi)[0],i=Ft().memoizedState;return[typeof t=="boolean"?t:pl(t),i]},useSyncExternalStore:t_,useId:M_,useHostTransitionStatus:Jf,useFormState:g_,useActionState:g_,useOptimistic:function(t,i){var a=Ft();return vt!==null?a_(a,vt,t,i):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Vf,useCacheRefresh:k_};I_.useEffectEvent=y_;function ep(t,i,a,d){i=t.memoizedState,a=a(d,i),a=a==null?i:p({},i,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var tp={enqueueSetState:function(t,i,a){t=t._reactInternals;var d=Fr(),C=Gi(d);C.payload=i,a!=null&&(C.callback=a),i=zi(t,C,d),i!==null&&(Mr(i,t,d),ul(i,t,d))},enqueueReplaceState:function(t,i,a){t=t._reactInternals;var d=Fr(),C=Gi(d);C.tag=1,C.payload=i,a!=null&&(C.callback=a),i=zi(t,C,d),i!==null&&(Mr(i,t,d),ul(i,t,d))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var a=Fr(),d=Gi(a);d.tag=2,i!=null&&(d.callback=i),i=zi(t,d,a),i!==null&&(Mr(i,t,a),ul(i,t,a))}};function P_(t,i,a,d,C,x,O){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(d,x,O):i.prototype&&i.prototype.isPureReactComponent?!Is(a,d)||!Is(C,x):!0}function j_(t,i,a,d){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,d),i.state!==t&&tp.enqueueReplaceState(i,i.state,null)}function Qs(t,i){var a=i;if("ref"in i){a={};for(var d in i)d!=="ref"&&(a[d]=i[d])}if(t=t.defaultProps){a===i&&(a=p({},a));for(var C in t)a[C]===void 0&&(a[C]=t[C])}return a}function U_(t){it(t)}function F_(t){console.error(t)}function H_(t){it(t)}function ku(t,i){try{var a=t.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function V_(t,i,a){try{var d=t.onCaughtError;d(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function rp(t,i,a){return a=Gi(a),a.tag=3,a.payload={element:null},a.callback=function(){ku(t,i)},a}function q_(t){return t=Gi(t),t.tag=3,t}function G_(t,i,a,d){var C=a.type.getDerivedStateFromError;if(typeof C=="function"){var x=d.value;t.payload=function(){return C(x)},t.callback=function(){V_(i,a,d)}}var O=a.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(t.callback=function(){V_(i,a,d),typeof C!="function"&&(Ji===null?Ji=new Set([this]):Ji.add(this));var V=d.stack;this.componentDidCatch(d.value,{componentStack:V!==null?V:""})})}function BA(t,i,a,d,C){if(a.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=a.alternate,i!==null&&Io(i,a,C,!0),a=Ir.current,a!==null){switch(a.tag){case 31:case 13:return Xr===null?qu():a.alternate===null&&Pt===0&&(Pt=3),a.flags&=-257,a.flags|=65536,a.lanes=C,d===_u?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([d]):i.add(d),Tp(t,d,C)),!1;case 22:return a.flags|=65536,d===_u?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([d]):a.add(d)),Tp(t,d,C)),!1}throw Error(s(435,a.tag))}return Tp(t,d,C),qu(),!1}if(nt)return i=Ir.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=C,d!==Cf&&(t=Error(s(422),{cause:d}),sl(Qr(t,a)))):(d!==Cf&&(i=Error(s(423),{cause:d}),sl(Qr(i,a))),t=t.current.alternate,t.flags|=65536,C&=-C,t.lanes|=C,d=Qr(d,a),C=rp(t.stateNode,d,C),Lf(t,C),Pt!==4&&(Pt=2)),!1;var x=Error(s(520),{cause:d});if(x=Qr(x,a),El===null?El=[x]:El.push(x),Pt!==4&&(Pt=2),i===null)return!0;d=Qr(d,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,t=C&-C,a.lanes|=t,t=rp(a.stateNode,d,t),Lf(a,t),!1;case 1:if(i=a.type,x=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ji===null||!Ji.has(x))))return a.flags|=65536,C&=-C,a.lanes|=C,C=q_(C),G_(C,t,a,d),Lf(a,C),!1}a=a.return}while(a!==null);return!1}var np=Error(s(461)),zt=!1;function sr(t,i,a,d){i.child=t===null?Kv(i,null,a,d):Ws(i,t.child,a,d)}function z_(t,i,a,d,C){a=a.render;var x=i.ref;if("ref"in d){var O={};for(var V in d)V!=="ref"&&(O[V]=d[V])}else O=d;return qs(i),d=jf(t,i,a,O,x,C),V=Uf(),t!==null&&!zt?(Ff(t,i,C),ai(t,i,C)):(nt&&V&&yf(i),i.flags|=1,sr(t,i,d,C),i.child)}function Y_(t,i,a,d,C){if(t===null){var x=a.type;return typeof x=="function"&&!Lo(x)&&x.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=x,W_(t,i,x,d,C)):(t=Us(a.type,null,d,i,i.mode,C),t.ref=i.ref,t.return=i,i.child=t)}if(x=t.child,!dp(t,C)){var O=x.memoizedProps;if(a=a.compare,a=a!==null?a:Is,a(O,d)&&t.ref===i.ref)return ai(t,i,C)}return i.flags|=1,t=xr(x,d),t.ref=i.ref,t.return=i,i.child=t}function W_(t,i,a,d,C){if(t!==null){var x=t.memoizedProps;if(Is(x,d)&&t.ref===i.ref)if(zt=!1,i.pendingProps=d=x,dp(t,C))(t.flags&131072)!==0&&(zt=!0);else return i.lanes=t.lanes,ai(t,i,C)}return ip(t,i,a,d,C)}function K_(t,i,a,d){var C=d.children,x=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|a:a,t!==null){for(d=i.child=t.child,C=0;d!==null;)C=C|d.lanes|d.childLanes,d=d.sibling;d=C&~x}else d=0,i.child=null;return Q_(t,i,x,a,d)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&gu(i,x!==null?x.cachePool:null),x!==null?Jv(i,x):Bf(),Zv(i);else return d=i.lanes=536870912,Q_(t,i,x!==null?x.baseLanes|a:a,a,d)}else x!==null?(gu(i,x.cachePool),Jv(i,x),Wi(),i.memoizedState=null):(t!==null&&gu(i,null),Bf(),Wi());return sr(t,i,C,a),i.child}function vl(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Q_(t,i,a,d,C){var x=Rf();return x=x===null?null:{parent:qt._currentValue,pool:x},i.memoizedState={baseLanes:a,cachePool:x},t!==null&&gu(i,null),Bf(),Zv(i),t!==null&&Io(t,i,d,!0),i.childLanes=C,null}function Lu(t,i){return i=Bu({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function $_(t,i,a){return Ws(i,t.child,null,a),t=Lu(i,i.pendingProps),t.flags|=2,Pr(i),i.memoizedState=null,t}function NA(t,i,a){var d=i.pendingProps,C=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(nt){if(d.mode==="hidden")return t=Lu(i,d),i.lanes=536870912,vl(null,t);if(If(i),(t=wt)?(t=l0(t,Zr),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Ui!==null?{id:Rn,overflow:Dn}:null,retryLane:536870912,hydrationErrors:null},a=Ov(t),a.return=i,i.child=a,nr=i,wt=null)):t=null,t===null)throw Hi(i);return i.lanes=536870912,null}return Lu(i,d)}var x=t.memoizedState;if(x!==null){var O=x.dehydrated;if(If(i),C)if(i.flags&256)i.flags&=-257,i=$_(t,i,a);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(s(558));else if(zt||Io(t,i,a,!1),C=(a&t.childLanes)!==0,zt||C){if(d=St,d!==null&&(O=Nc(d,a),O!==0&&O!==x.retryLane))throw x.retryLane=O,Ot(t,O),Mr(d,t,O),np;qu(),i=$_(t,i,a)}else t=x.treeContext,wt=en(O.nextSibling),nr=i,nt=!0,Fi=null,Zr=!1,t!==null&&Iv(i,t),i=Lu(i,d),i.flags|=4096;return i}return t=xr(t.child,{mode:d.mode,children:d.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Ou(t,i){var a=i.ref;if(a===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(i.flags|=4194816)}}function ip(t,i,a,d,C){return qs(i),a=jf(t,i,a,d,void 0,C),d=Uf(),t!==null&&!zt?(Ff(t,i,C),ai(t,i,C)):(nt&&d&&yf(i),i.flags|=1,sr(t,i,a,C),i.child)}function J_(t,i,a,d,C,x){return qs(i),i.updateQueue=null,a=e_(i,d,a,C),Xv(t),d=Uf(),t!==null&&!zt?(Ff(t,i,x),ai(t,i,x)):(nt&&d&&yf(i),i.flags|=1,sr(t,i,a,x),i.child)}function Z_(t,i,a,d,C){if(qs(i),i.stateNode===null){var x=ji,O=a.contextType;typeof O=="object"&&O!==null&&(x=ir(O)),x=new a(d,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=tp,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=d,x.state=i.memoizedState,x.refs={},Mf(i),O=a.contextType,x.context=typeof O=="object"&&O!==null?ir(O):ji,x.state=i.memoizedState,O=a.getDerivedStateFromProps,typeof O=="function"&&(ep(i,a,O,d),x.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(O=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),O!==x.state&&tp.enqueueReplaceState(x,x.state,null),hl(i,d,x,C),dl(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(t===null){x=i.stateNode;var V=i.memoizedProps,re=Qs(a,V);x.props=re;var me=x.context,be=a.contextType;O=ji,typeof be=="object"&&be!==null&&(O=ir(be));var Ee=a.getDerivedStateFromProps;be=typeof Ee=="function"||typeof x.getSnapshotBeforeUpdate=="function",V=i.pendingProps!==V,be||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(V||me!==O)&&j_(i,x,d,O),qi=!1;var ve=i.memoizedState;x.state=ve,hl(i,d,x,C),dl(),me=i.memoizedState,V||ve!==me||qi?(typeof Ee=="function"&&(ep(i,a,Ee,d),me=i.memoizedState),(re=qi||P_(i,a,re,d,ve,me,O))?(be||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=me),x.props=d,x.state=me,x.context=O,d=re):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{x=i.stateNode,kf(t,i),O=i.memoizedProps,be=Qs(a,O),x.props=be,Ee=i.pendingProps,ve=x.context,me=a.contextType,re=ji,typeof me=="object"&&me!==null&&(re=ir(me)),V=a.getDerivedStateFromProps,(me=typeof V=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O!==Ee||ve!==re)&&j_(i,x,d,re),qi=!1,ve=i.memoizedState,x.state=ve,hl(i,d,x,C),dl();var Se=i.memoizedState;O!==Ee||ve!==Se||qi||t!==null&&t.dependencies!==null&&pu(t.dependencies)?(typeof V=="function"&&(ep(i,a,V,d),Se=i.memoizedState),(be=qi||P_(i,a,be,d,ve,Se,re)||t!==null&&t.dependencies!==null&&pu(t.dependencies))?(me||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(d,Se,re),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(d,Se,re)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||O===t.memoizedProps&&ve===t.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&ve===t.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Se),x.props=d,x.state=Se,x.context=re,d=be):(typeof x.componentDidUpdate!="function"||O===t.memoizedProps&&ve===t.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&ve===t.memoizedState||(i.flags|=1024),d=!1)}return x=d,Ou(t,i),d=(i.flags&128)!==0,x||d?(x=i.stateNode,a=d&&typeof a.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,t!==null&&d?(i.child=Ws(i,t.child,null,C),i.child=Ws(i,null,a,C)):sr(t,i,a,C),i.memoizedState=x.state,t=i.child):t=ai(t,i,C),t}function X_(t,i,a,d){return Hs(),i.flags|=256,sr(t,i,a,d),i.child}var sp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function op(t){return{baseLanes:t,cachePool:Vv()}}function ap(t,i,a){return t=t!==null?t.childLanes&~a:0,i&&(t|=Ur),t}function ey(t,i,a){var d=i.pendingProps,C=!1,x=(i.flags&128)!==0,O;if((O=x)||(O=t!==null&&t.memoizedState===null?!1:(Ut.current&2)!==0),O&&(C=!0,i.flags&=-129),O=(i.flags&32)!==0,i.flags&=-33,t===null){if(nt){if(C?Yi(i):Wi(),(t=wt)?(t=l0(t,Zr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Ui!==null?{id:Rn,overflow:Dn}:null,retryLane:536870912,hydrationErrors:null},a=Ov(t),a.return=i,i.child=a,nr=i,wt=null)):t=null,t===null)throw Hi(i);return qp(t)?i.lanes=32:i.lanes=536870912,null}var V=d.children;return d=d.fallback,C?(Wi(),C=i.mode,V=Bu({mode:"hidden",children:V},C),d=Fs(d,C,a,null),V.return=i,d.return=i,V.sibling=d,i.child=V,d=i.child,d.memoizedState=op(a),d.childLanes=ap(t,O,a),i.memoizedState=sp,vl(null,d)):(Yi(i),lp(i,V))}var re=t.memoizedState;if(re!==null&&(V=re.dehydrated,V!==null)){if(x)i.flags&256?(Yi(i),i.flags&=-257,i=cp(t,i,a)):i.memoizedState!==null?(Wi(),i.child=t.child,i.flags|=128,i=null):(Wi(),V=d.fallback,C=i.mode,d=Bu({mode:"visible",children:d.children},C),V=Fs(V,C,a,null),V.flags|=2,d.return=i,V.return=i,d.sibling=V,i.child=d,Ws(i,t.child,null,a),d=i.child,d.memoizedState=op(a),d.childLanes=ap(t,O,a),i.memoizedState=sp,i=vl(null,d));else if(Yi(i),qp(V)){if(O=V.nextSibling&&V.nextSibling.dataset,O)var me=O.dgst;O=me,d=Error(s(419)),d.stack="",d.digest=O,sl({value:d,source:null,stack:null}),i=cp(t,i,a)}else if(zt||Io(t,i,a,!1),O=(a&t.childLanes)!==0,zt||O){if(O=St,O!==null&&(d=Nc(O,a),d!==0&&d!==re.retryLane))throw re.retryLane=d,Ot(t,d),Mr(O,t,d),np;Vp(V)||qu(),i=cp(t,i,a)}else Vp(V)?(i.flags|=192,i.child=t.child,i=null):(t=re.treeContext,wt=en(V.nextSibling),nr=i,nt=!0,Fi=null,Zr=!1,t!==null&&Iv(i,t),i=lp(i,d.children),i.flags|=4096);return i}return C?(Wi(),V=d.fallback,C=i.mode,re=t.child,me=re.sibling,d=xr(re,{mode:"hidden",children:d.children}),d.subtreeFlags=re.subtreeFlags&65011712,me!==null?V=xr(me,V):(V=Fs(V,C,a,null),V.flags|=2),V.return=i,d.return=i,d.sibling=V,i.child=d,vl(null,d),d=i.child,V=t.child.memoizedState,V===null?V=op(a):(C=V.cachePool,C!==null?(re=qt._currentValue,C=C.parent!==re?{parent:re,pool:re}:C):C=Vv(),V={baseLanes:V.baseLanes|a,cachePool:C}),d.memoizedState=V,d.childLanes=ap(t,O,a),i.memoizedState=sp,vl(t.child,d)):(Yi(i),a=t.child,t=a.sibling,a=xr(a,{mode:"visible",children:d.children}),a.return=i,a.sibling=null,t!==null&&(O=i.deletions,O===null?(i.deletions=[t],i.flags|=16):O.push(t)),i.child=a,i.memoizedState=null,a)}function lp(t,i){return i=Bu({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Bu(t,i){return t=ur(22,t,null,i),t.lanes=0,t}function cp(t,i,a){return Ws(i,t.child,null,a),t=lp(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function ty(t,i,a){t.lanes|=i;var d=t.alternate;d!==null&&(d.lanes|=i),Ef(t.return,i,a)}function up(t,i,a,d,C,x){var O=t.memoizedState;O===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:a,tailMode:C,treeForkCount:x}:(O.isBackwards=i,O.rendering=null,O.renderingStartTime=0,O.last=d,O.tail=a,O.tailMode=C,O.treeForkCount=x)}function ry(t,i,a){var d=i.pendingProps,C=d.revealOrder,x=d.tail;d=d.children;var O=Ut.current,V=(O&2)!==0;if(V?(O=O&1|2,i.flags|=128):O&=1,ne(Ut,O),sr(t,i,d,a),d=nt?il:0,!V&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ty(t,a,i);else if(t.tag===19)ty(t,a,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(C){case"forwards":for(a=i.child,C=null;a!==null;)t=a.alternate,t!==null&&bu(t)===null&&(C=a),a=a.sibling;a=C,a===null?(C=i.child,i.child=null):(C=a.sibling,a.sibling=null),up(i,!1,C,a,x,d);break;case"backwards":case"unstable_legacy-backwards":for(a=null,C=i.child,i.child=null;C!==null;){if(t=C.alternate,t!==null&&bu(t)===null){i.child=C;break}t=C.sibling,C.sibling=a,a=C,C=t}up(i,!0,a,null,x,d);break;case"together":up(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function ai(t,i,a){if(t!==null&&(i.dependencies=t.dependencies),$i|=i.lanes,(a&i.childLanes)===0)if(t!==null){if(Io(t,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(s(153));if(i.child!==null){for(t=i.child,a=xr(t,t.pendingProps),i.child=a,a.return=i;t.sibling!==null;)t=t.sibling,a=a.sibling=xr(t,t.pendingProps),a.return=i;a.sibling=null}return i.child}function dp(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&pu(t)))}function IA(t,i,a){switch(i.tag){case 3:F(i,i.stateNode.containerInfo),Vi(i,qt,t.memoizedState.cache),Hs();break;case 27:case 5:oe(i);break;case 4:F(i,i.stateNode.containerInfo);break;case 10:Vi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,If(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Yi(i),i.flags|=128,null):(a&i.child.childLanes)!==0?ey(t,i,a):(Yi(i),t=ai(t,i,a),t!==null?t.sibling:null);Yi(i);break;case 19:var C=(t.flags&128)!==0;if(d=(a&i.childLanes)!==0,d||(Io(t,i,a,!1),d=(a&i.childLanes)!==0),C){if(d)return ry(t,i,a);i.flags|=128}if(C=i.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),ne(Ut,Ut.current),d)break;return null;case 22:return i.lanes=0,K_(t,i,a,i.pendingProps);case 24:Vi(i,qt,t.memoizedState.cache)}return ai(t,i,a)}function ny(t,i,a){if(t!==null)if(t.memoizedProps!==i.pendingProps)zt=!0;else{if(!dp(t,a)&&(i.flags&128)===0)return zt=!1,IA(t,i,a);zt=(t.flags&131072)!==0}else zt=!1,nt&&(i.flags&1048576)!==0&&Nv(i,il,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(t=zs(i.elementType),i.type=t,typeof t=="function")Lo(t)?(d=Qs(t,d),i.tag=1,i=Z_(null,i,t,d,a)):(i.tag=0,i=ip(null,i,t,d,a));else{if(t!=null){var C=t.$$typeof;if(C===T){i.tag=11,i=z_(null,i,t,d,a);break e}else if(C===L){i.tag=14,i=Y_(null,i,t,d,a);break e}}throw i=$(t)||t,Error(s(306,i,""))}}return i;case 0:return ip(t,i,i.type,i.pendingProps,a);case 1:return d=i.type,C=Qs(d,i.pendingProps),Z_(t,i,d,C,a);case 3:e:{if(F(i,i.stateNode.containerInfo),t===null)throw Error(s(387));d=i.pendingProps;var x=i.memoizedState;C=x.element,kf(t,i),hl(i,d,null,a);var O=i.memoizedState;if(d=O.cache,Vi(i,qt,d),d!==x.cache&&xf(i,[qt],a,!0),dl(),d=O.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:O.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=X_(t,i,d,a);break e}else if(d!==C){C=Qr(Error(s(424)),i),sl(C),i=X_(t,i,d,a);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(wt=en(t.firstChild),nr=i,nt=!0,Fi=null,Zr=!0,a=Kv(i,null,d,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Hs(),d===C){i=ai(t,i,a);break e}sr(t,i,d,a)}i=i.child}return i;case 26:return Ou(t,i),t===null?(a=p0(i.type,null,i.pendingProps,null))?i.memoizedState=a:nt||(a=i.type,t=i.pendingProps,d=$u(fe.current).createElement(a),d[Kt]=i,d[lr]=t,or(d,a,t),Lt(d),i.stateNode=d):i.memoizedState=p0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return oe(i),t===null&&nt&&(d=i.stateNode=d0(i.type,i.pendingProps,fe.current),nr=i,Zr=!0,C=wt,ts(i.type)?(Gp=C,wt=en(d.firstChild)):wt=C),sr(t,i,i.pendingProps.children,a),Ou(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&nt&&((C=d=wt)&&(d=hT(d,i.type,i.pendingProps,Zr),d!==null?(i.stateNode=d,nr=i,wt=en(d.firstChild),Zr=!1,C=!0):C=!1),C||Hi(i)),oe(i),C=i.type,x=i.pendingProps,O=t!==null?t.memoizedProps:null,d=x.children,Up(C,x)?d=null:O!==null&&Up(C,O)&&(i.flags|=32),i.memoizedState!==null&&(C=jf(t,i,TA,null,null,a),Ll._currentValue=C),Ou(t,i),sr(t,i,d,a),i.child;case 6:return t===null&&nt&&((t=a=wt)&&(a=fT(a,i.pendingProps,Zr),a!==null?(i.stateNode=a,nr=i,wt=null,t=!0):t=!1),t||Hi(i)),null;case 13:return ey(t,i,a);case 4:return F(i,i.stateNode.containerInfo),d=i.pendingProps,t===null?i.child=Ws(i,null,d,a):sr(t,i,d,a),i.child;case 11:return z_(t,i,i.type,i.pendingProps,a);case 7:return sr(t,i,i.pendingProps,a),i.child;case 8:return sr(t,i,i.pendingProps.children,a),i.child;case 12:return sr(t,i,i.pendingProps.children,a),i.child;case 10:return d=i.pendingProps,Vi(i,i.type,d.value),sr(t,i,d.children,a),i.child;case 9:return C=i.type._context,d=i.pendingProps.children,qs(i),C=ir(C),d=d(C),i.flags|=1,sr(t,i,d,a),i.child;case 14:return Y_(t,i,i.type,i.pendingProps,a);case 15:return W_(t,i,i.type,i.pendingProps,a);case 19:return ry(t,i,a);case 31:return NA(t,i,a);case 22:return K_(t,i,a,i.pendingProps);case 24:return qs(i),d=ir(qt),t===null?(C=Rf(),C===null&&(C=St,x=Af(),C.pooledCache=x,x.refCount++,x!==null&&(C.pooledCacheLanes|=a),C=x),i.memoizedState={parent:d,cache:C},Mf(i),Vi(i,qt,C)):((t.lanes&a)!==0&&(kf(t,i),hl(i,null,null,a),dl()),C=t.memoizedState,x=i.memoizedState,C.parent!==d?(C={parent:d,cache:d},i.memoizedState=C,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=C),Vi(i,qt,d)):(d=x.cache,Vi(i,qt,d),d!==C.cache&&xf(i,[qt],a,!0))),sr(t,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function li(t){t.flags|=4}function hp(t,i,a,d,C){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(C&335544128)===C)if(t.stateNode.complete)t.flags|=8192;else if(My())t.flags|=8192;else throw Ys=_u,Df}else t.flags&=-16777217}function iy(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!y0(i))if(My())t.flags|=8192;else throw Ys=_u,Df}function Nu(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?po():536870912,t.lanes|=i,Ko|=i)}function _l(t,i){if(!nt)switch(t.tailMode){case"hidden":i=t.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:d.sibling=null}}function Et(t){var i=t.alternate!==null&&t.alternate.child===t.child,a=0,d=0;if(i)for(var C=t.child;C!==null;)a|=C.lanes|C.childLanes,d|=C.subtreeFlags&65011712,d|=C.flags&65011712,C.return=t,C=C.sibling;else for(C=t.child;C!==null;)a|=C.lanes|C.childLanes,d|=C.subtreeFlags,d|=C.flags,C.return=t,C=C.sibling;return t.subtreeFlags|=d,t.childLanes=a,i}function PA(t,i,a){var d=i.pendingProps;switch(Sf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(i),null;case 1:return Et(i),null;case 3:return a=i.stateNode,d=null,t!==null&&(d=t.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),ii(qt),ue(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(No(i)?li(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,bf())),Et(i),null;case 26:var C=i.type,x=i.memoizedState;return t===null?(li(i),x!==null?(Et(i),iy(i,x)):(Et(i),hp(i,C,null,d,a))):x?x!==t.memoizedState?(li(i),Et(i),iy(i,x)):(Et(i),i.flags&=-16777217):(t=t.memoizedProps,t!==d&&li(i),Et(i),hp(i,C,t,d,a)),null;case 27:if(de(i),a=fe.current,C=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==d&&li(i);else{if(!d){if(i.stateNode===null)throw Error(s(166));return Et(i),null}t=X.current,No(i)?Pv(i):(t=d0(C,d,a),i.stateNode=t,li(i))}return Et(i),null;case 5:if(de(i),C=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==d&&li(i);else{if(!d){if(i.stateNode===null)throw Error(s(166));return Et(i),null}if(x=X.current,No(i))Pv(i);else{var O=$u(fe.current);switch(x){case 1:x=O.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:x=O.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":x=O.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":x=O.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":x=O.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof d.is=="string"?O.createElement("select",{is:d.is}):O.createElement("select"),d.multiple?x.multiple=!0:d.size&&(x.size=d.size);break;default:x=typeof d.is=="string"?O.createElement(C,{is:d.is}):O.createElement(C)}}x[Kt]=i,x[lr]=d;e:for(O=i.child;O!==null;){if(O.tag===5||O.tag===6)x.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===i)break e;for(;O.sibling===null;){if(O.return===null||O.return===i)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}i.stateNode=x;e:switch(or(x,C,d),C){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&li(i)}}return Et(i),hp(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,a),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==d&&li(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(s(166));if(t=fe.current,No(i)){if(t=i.stateNode,a=i.memoizedProps,d=null,C=nr,C!==null)switch(C.tag){case 27:case 5:d=C.memoizedProps}t[Kt]=i,t=!!(t.nodeValue===a||d!==null&&d.suppressHydrationWarning===!0||e0(t.nodeValue,a)),t||Hi(i,!0)}else t=$u(t).createTextNode(d),t[Kt]=i,i.stateNode=t}return Et(i),null;case 31:if(a=i.memoizedState,t===null||t.memoizedState!==null){if(d=No(i),a!==null){if(t===null){if(!d)throw Error(s(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Kt]=i}else Hs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Et(i),t=!1}else a=bf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return i.flags&256?(Pr(i),i):(Pr(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Et(i),null;case 13:if(d=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(C=No(i),d!==null&&d.dehydrated!==null){if(t===null){if(!C)throw Error(s(318));if(C=i.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(s(317));C[Kt]=i}else Hs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Et(i),C=!1}else C=bf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=C),C=!0;if(!C)return i.flags&256?(Pr(i),i):(Pr(i),null)}return Pr(i),(i.flags&128)!==0?(i.lanes=a,i):(a=d!==null,t=t!==null&&t.memoizedState!==null,a&&(d=i.child,C=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(C=d.alternate.memoizedState.cachePool.pool),x=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(x=d.memoizedState.cachePool.pool),x!==C&&(d.flags|=2048)),a!==t&&a&&(i.child.flags|=8192),Nu(i,i.updateQueue),Et(i),null);case 4:return ue(),t===null&&Bp(i.stateNode.containerInfo),Et(i),null;case 10:return ii(i.type),Et(i),null;case 19:if(G(Ut),d=i.memoizedState,d===null)return Et(i),null;if(C=(i.flags&128)!==0,x=d.rendering,x===null)if(C)_l(d,!1);else{if(Pt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(x=bu(t),x!==null){for(i.flags|=128,_l(d,!1),t=x.updateQueue,i.updateQueue=t,Nu(i,t),i.subtreeFlags=0,t=a,a=i.child;a!==null;)js(a,t),a=a.sibling;return ne(Ut,Ut.current&1|2),nt&&ri(i,d.treeForkCount),i.child}t=t.sibling}d.tail!==null&&kt()>Fu&&(i.flags|=128,C=!0,_l(d,!1),i.lanes=4194304)}else{if(!C)if(t=bu(x),t!==null){if(i.flags|=128,C=!0,t=t.updateQueue,i.updateQueue=t,Nu(i,t),_l(d,!0),d.tail===null&&d.tailMode==="hidden"&&!x.alternate&&!nt)return Et(i),null}else 2*kt()-d.renderingStartTime>Fu&&a!==536870912&&(i.flags|=128,C=!0,_l(d,!1),i.lanes=4194304);d.isBackwards?(x.sibling=i.child,i.child=x):(t=d.last,t!==null?t.sibling=x:i.child=x,d.last=x)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=kt(),t.sibling=null,a=Ut.current,ne(Ut,C?a&1|2:a&1),nt&&ri(i,d.treeForkCount),t):(Et(i),null);case 22:case 23:return Pr(i),Nf(),d=i.memoizedState!==null,t!==null?t.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(a&536870912)!==0&&(i.flags&128)===0&&(Et(i),i.subtreeFlags&6&&(i.flags|=8192)):Et(i),a=i.updateQueue,a!==null&&Nu(i,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==a&&(i.flags|=2048),t!==null&&G(Gs),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),ii(qt),Et(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function jA(t,i){switch(Sf(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return ii(qt),ue(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return de(i),null;case 31:if(i.memoizedState!==null){if(Pr(i),i.alternate===null)throw Error(s(340));Hs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(Pr(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(s(340));Hs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return G(Ut),null;case 4:return ue(),null;case 10:return ii(i.type),null;case 22:case 23:return Pr(i),Nf(),t!==null&&G(Gs),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return ii(qt),null;case 25:return null;default:return null}}function sy(t,i){switch(Sf(i),i.tag){case 3:ii(qt),ue();break;case 26:case 27:case 5:de(i);break;case 4:ue();break;case 31:i.memoizedState!==null&&Pr(i);break;case 13:Pr(i);break;case 19:G(Ut);break;case 10:ii(i.type);break;case 22:case 23:Pr(i),Nf(),t!==null&&G(Gs);break;case 24:ii(qt)}}function yl(t,i){try{var a=i.updateQueue,d=a!==null?a.lastEffect:null;if(d!==null){var C=d.next;a=C;do{if((a.tag&t)===t){d=void 0;var x=a.create,O=a.inst;d=x(),O.destroy=d}a=a.next}while(a!==C)}}catch(V){mt(i,i.return,V)}}function Ki(t,i,a){try{var d=i.updateQueue,C=d!==null?d.lastEffect:null;if(C!==null){var x=C.next;d=x;do{if((d.tag&t)===t){var O=d.inst,V=O.destroy;if(V!==void 0){O.destroy=void 0,C=i;var re=a,me=V;try{me()}catch(be){mt(C,re,be)}}}d=d.next}while(d!==x)}}catch(be){mt(i,i.return,be)}}function oy(t){var i=t.updateQueue;if(i!==null){var a=t.stateNode;try{$v(i,a)}catch(d){mt(t,t.return,d)}}}function ay(t,i,a){a.props=Qs(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(d){mt(t,i,d)}}function Sl(t,i){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var d=t.stateNode;break;case 30:d=t.stateNode;break;default:d=t.stateNode}typeof a=="function"?t.refCleanup=a(d):a.current=d}}catch(C){mt(t,i,C)}}function Mn(t,i){var a=t.ref,d=t.refCleanup;if(a!==null)if(typeof d=="function")try{d()}catch(C){mt(t,i,C)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(C){mt(t,i,C)}else a.current=null}function ly(t){var i=t.type,a=t.memoizedProps,d=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&d.focus();break e;case"img":a.src?d.src=a.src:a.srcSet&&(d.srcset=a.srcSet)}}catch(C){mt(t,t.return,C)}}function fp(t,i,a){try{var d=t.stateNode;oT(d,t.type,a,i),d[lr]=i}catch(C){mt(t,t.return,C)}}function cy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ts(t.type)||t.tag===4}function pp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||cy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ts(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function mp(t,i,a){var d=t.tag;if(d===5||d===6)t=t.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(t),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=hn));else if(d!==4&&(d===27&&ts(t.type)&&(a=t.stateNode,i=null),t=t.child,t!==null))for(mp(t,i,a),t=t.sibling;t!==null;)mp(t,i,a),t=t.sibling}function Iu(t,i,a){var d=t.tag;if(d===5||d===6)t=t.stateNode,i?a.insertBefore(t,i):a.appendChild(t);else if(d!==4&&(d===27&&ts(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Iu(t,i,a),t=t.sibling;t!==null;)Iu(t,i,a),t=t.sibling}function uy(t){var i=t.stateNode,a=t.memoizedProps;try{for(var d=t.type,C=i.attributes;C.length;)i.removeAttributeNode(C[0]);or(i,d,a),i[Kt]=t,i[lr]=a}catch(x){mt(t,t.return,x)}}var ci=!1,Yt=!1,gp=!1,dy=typeof WeakSet=="function"?WeakSet:Set,tr=null;function UA(t,i){if(t=t.containerInfo,Pp=nd,t=uu(t),tl(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var d=a.getSelection&&a.getSelection();if(d&&d.rangeCount!==0){a=d.anchorNode;var C=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{a.nodeType,x.nodeType}catch{a=null;break e}var O=0,V=-1,re=-1,me=0,be=0,Ee=t,ve=null;t:for(;;){for(var Se;Ee!==a||C!==0&&Ee.nodeType!==3||(V=O+C),Ee!==x||d!==0&&Ee.nodeType!==3||(re=O+d),Ee.nodeType===3&&(O+=Ee.nodeValue.length),(Se=Ee.firstChild)!==null;)ve=Ee,Ee=Se;for(;;){if(Ee===t)break t;if(ve===a&&++me===C&&(V=O),ve===x&&++be===d&&(re=O),(Se=Ee.nextSibling)!==null)break;Ee=ve,ve=Ee.parentNode}Ee=Se}a=V===-1||re===-1?null:{start:V,end:re}}else a=null}a=a||{start:0,end:0}}else a=null;for(jp={focusedElem:t,selectionRange:a},nd=!1,tr=i;tr!==null;)if(i=tr,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,tr=t;else for(;tr!==null;){switch(i=tr,x=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)C=t[a],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,a=i,C=x.memoizedProps,x=x.memoizedState,d=a.stateNode;try{var ke=Qs(a.type,C);t=d.getSnapshotBeforeUpdate(ke,x),d.__reactInternalSnapshotBeforeUpdate=t}catch(Ue){mt(a,a.return,Ue)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,a=t.nodeType,a===9)Hp(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Hp(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=i.sibling,t!==null){t.return=i.return,tr=t;break}tr=i.return}}function hy(t,i,a){var d=a.flags;switch(a.tag){case 0:case 11:case 15:di(t,a),d&4&&yl(5,a);break;case 1:if(di(t,a),d&4)if(t=a.stateNode,i===null)try{t.componentDidMount()}catch(O){mt(a,a.return,O)}else{var C=Qs(a.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(C,i,t.__reactInternalSnapshotBeforeUpdate)}catch(O){mt(a,a.return,O)}}d&64&&oy(a),d&512&&Sl(a,a.return);break;case 3:if(di(t,a),d&64&&(t=a.updateQueue,t!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{$v(t,i)}catch(O){mt(a,a.return,O)}}break;case 27:i===null&&d&4&&uy(a);case 26:case 5:di(t,a),i===null&&d&4&&ly(a),d&512&&Sl(a,a.return);break;case 12:di(t,a);break;case 31:di(t,a),d&4&&my(t,a);break;case 13:di(t,a),d&4&&gy(t,a),d&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=KA.bind(null,a),pT(t,a))));break;case 22:if(d=a.memoizedState!==null||ci,!d){i=i!==null&&i.memoizedState!==null||Yt,C=ci;var x=Yt;ci=d,(Yt=i)&&!x?hi(t,a,(a.subtreeFlags&8772)!==0):di(t,a),ci=C,Yt=x}break;case 30:break;default:di(t,a)}}function fy(t){var i=t.alternate;i!==null&&(t.alternate=null,fy(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Ba(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Rt=null,Ar=!1;function ui(t,i,a){for(a=a.child;a!==null;)py(t,i,a),a=a.sibling}function py(t,i,a){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(gr,a)}catch{}switch(a.tag){case 26:Yt||Mn(a,i),ui(t,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Yt||Mn(a,i);var d=Rt,C=Ar;ts(a.type)&&(Rt=a.stateNode,Ar=!1),ui(t,i,a),Dl(a.stateNode),Rt=d,Ar=C;break;case 5:Yt||Mn(a,i);case 6:if(d=Rt,C=Ar,Rt=null,ui(t,i,a),Rt=d,Ar=C,Rt!==null)if(Ar)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(a.stateNode)}catch(x){mt(a,i,x)}else try{Rt.removeChild(a.stateNode)}catch(x){mt(a,i,x)}break;case 18:Rt!==null&&(Ar?(t=Rt,o0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ra(t)):o0(Rt,a.stateNode));break;case 4:d=Rt,C=Ar,Rt=a.stateNode.containerInfo,Ar=!0,ui(t,i,a),Rt=d,Ar=C;break;case 0:case 11:case 14:case 15:Ki(2,a,i),Yt||Ki(4,a,i),ui(t,i,a);break;case 1:Yt||(Mn(a,i),d=a.stateNode,typeof d.componentWillUnmount=="function"&&ay(a,i,d)),ui(t,i,a);break;case 21:ui(t,i,a);break;case 22:Yt=(d=Yt)||a.memoizedState!==null,ui(t,i,a),Yt=d;break;default:ui(t,i,a)}}function my(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ra(t)}catch(a){mt(i,i.return,a)}}}function gy(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ra(t)}catch(a){mt(i,i.return,a)}}function FA(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new dy),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new dy),i;default:throw Error(s(435,t.tag))}}function Pu(t,i){var a=FA(t);i.forEach(function(d){if(!a.has(d)){a.add(d);var C=QA.bind(null,t,d);d.then(C,C)}})}function Tr(t,i){var a=i.deletions;if(a!==null)for(var d=0;d<a.length;d++){var C=a[d],x=t,O=i,V=O;e:for(;V!==null;){switch(V.tag){case 27:if(ts(V.type)){Rt=V.stateNode,Ar=!1;break e}break;case 5:Rt=V.stateNode,Ar=!1;break e;case 3:case 4:Rt=V.stateNode.containerInfo,Ar=!0;break e}V=V.return}if(Rt===null)throw Error(s(160));py(x,O,C),Rt=null,Ar=!1,x=C.alternate,x!==null&&(x.return=null),C.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)vy(i,t),i=i.sibling}var mn=null;function vy(t,i){var a=t.alternate,d=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Tr(i,t),Rr(t),d&4&&(Ki(3,t,t.return),yl(3,t),Ki(5,t,t.return));break;case 1:Tr(i,t),Rr(t),d&512&&(Yt||a===null||Mn(a,a.return)),d&64&&ci&&(t=t.updateQueue,t!==null&&(d=t.callbacks,d!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?d:a.concat(d))));break;case 26:var C=mn;if(Tr(i,t),Rr(t),d&512&&(Yt||a===null||Mn(a,a.return)),d&4){var x=a!==null?a.memoizedState:null;if(d=t.memoizedState,a===null)if(d===null)if(t.stateNode===null){e:{d=t.type,a=t.memoizedProps,C=C.ownerDocument||C;t:switch(d){case"title":x=C.getElementsByTagName("title")[0],(!x||x[xs]||x[Kt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=C.createElement(d),C.head.insertBefore(x,C.querySelector("head > title"))),or(x,d,a),x[Kt]=t,Lt(x),d=x;break e;case"link":var O=v0("link","href",C).get(d+(a.href||""));if(O){for(var V=0;V<O.length;V++)if(x=O[V],x.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&x.getAttribute("rel")===(a.rel==null?null:a.rel)&&x.getAttribute("title")===(a.title==null?null:a.title)&&x.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){O.splice(V,1);break t}}x=C.createElement(d),or(x,d,a),C.head.appendChild(x);break;case"meta":if(O=v0("meta","content",C).get(d+(a.content||""))){for(V=0;V<O.length;V++)if(x=O[V],x.getAttribute("content")===(a.content==null?null:""+a.content)&&x.getAttribute("name")===(a.name==null?null:a.name)&&x.getAttribute("property")===(a.property==null?null:a.property)&&x.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&x.getAttribute("charset")===(a.charSet==null?null:a.charSet)){O.splice(V,1);break t}}x=C.createElement(d),or(x,d,a),C.head.appendChild(x);break;default:throw Error(s(468,d))}x[Kt]=t,Lt(x),d=x}t.stateNode=d}else _0(C,t.type,t.stateNode);else t.stateNode=g0(C,d,t.memoizedProps);else x!==d?(x===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):x.count--,d===null?_0(C,t.type,t.stateNode):g0(C,d,t.memoizedProps)):d===null&&t.stateNode!==null&&fp(t,t.memoizedProps,a.memoizedProps)}break;case 27:Tr(i,t),Rr(t),d&512&&(Yt||a===null||Mn(a,a.return)),a!==null&&d&4&&fp(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Tr(i,t),Rr(t),d&512&&(Yt||a===null||Mn(a,a.return)),t.flags&32){C=t.stateNode;try{$n(C,"")}catch(ke){mt(t,t.return,ke)}}d&4&&t.stateNode!=null&&(C=t.memoizedProps,fp(t,C,a!==null?a.memoizedProps:C)),d&1024&&(gp=!0);break;case 6:if(Tr(i,t),Rr(t),d&4){if(t.stateNode===null)throw Error(s(162));d=t.memoizedProps,a=t.stateNode;try{a.nodeValue=d}catch(ke){mt(t,t.return,ke)}}break;case 3:if(Xu=null,C=mn,mn=Ju(i.containerInfo),Tr(i,t),mn=C,Rr(t),d&4&&a!==null&&a.memoizedState.isDehydrated)try{ra(i.containerInfo)}catch(ke){mt(t,t.return,ke)}gp&&(gp=!1,_y(t));break;case 4:d=mn,mn=Ju(t.stateNode.containerInfo),Tr(i,t),Rr(t),mn=d;break;case 12:Tr(i,t),Rr(t);break;case 31:Tr(i,t),Rr(t),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,Pu(t,d)));break;case 13:Tr(i,t),Rr(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Uu=kt()),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,Pu(t,d)));break;case 22:C=t.memoizedState!==null;var re=a!==null&&a.memoizedState!==null,me=ci,be=Yt;if(ci=me||C,Yt=be||re,Tr(i,t),Yt=be,ci=me,Rr(t),d&8192)e:for(i=t.stateNode,i._visibility=C?i._visibility&-2:i._visibility|1,C&&(a===null||re||ci||Yt||$s(t)),a=null,i=t;;){if(i.tag===5||i.tag===26){if(a===null){re=a=i;try{if(x=re.stateNode,C)O=x.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{V=re.stateNode;var Ee=re.memoizedProps.style,ve=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;V.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(ke){mt(re,re.return,ke)}}}else if(i.tag===6){if(a===null){re=i;try{re.stateNode.nodeValue=C?"":re.memoizedProps}catch(ke){mt(re,re.return,ke)}}}else if(i.tag===18){if(a===null){re=i;try{var Se=re.stateNode;C?a0(Se,!0):a0(re.stateNode,!1)}catch(ke){mt(re,re.return,ke)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=t.updateQueue,d!==null&&(a=d.retryQueue,a!==null&&(d.retryQueue=null,Pu(t,a))));break;case 19:Tr(i,t),Rr(t),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,Pu(t,d)));break;case 30:break;case 21:break;default:Tr(i,t),Rr(t)}}function Rr(t){var i=t.flags;if(i&2){try{for(var a,d=t.return;d!==null;){if(cy(d)){a=d;break}d=d.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var C=a.stateNode,x=pp(t);Iu(t,x,C);break;case 5:var O=a.stateNode;a.flags&32&&($n(O,""),a.flags&=-33);var V=pp(t);Iu(t,V,O);break;case 3:case 4:var re=a.stateNode.containerInfo,me=pp(t);mp(t,me,re);break;default:throw Error(s(161))}}catch(be){mt(t,t.return,be)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function _y(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;_y(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function di(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)hy(t,i.alternate,i),i=i.sibling}function $s(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Ki(4,i,i.return),$s(i);break;case 1:Mn(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&ay(i,i.return,a),$s(i);break;case 27:Dl(i.stateNode);case 26:case 5:Mn(i,i.return),$s(i);break;case 22:i.memoizedState===null&&$s(i);break;case 30:$s(i);break;default:$s(i)}t=t.sibling}}function hi(t,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,C=t,x=i,O=x.flags;switch(x.tag){case 0:case 11:case 15:hi(C,x,a),yl(4,x);break;case 1:if(hi(C,x,a),d=x,C=d.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(me){mt(d,d.return,me)}if(d=x,C=d.updateQueue,C!==null){var V=d.stateNode;try{var re=C.shared.hiddenCallbacks;if(re!==null)for(C.shared.hiddenCallbacks=null,C=0;C<re.length;C++)Qv(re[C],V)}catch(me){mt(d,d.return,me)}}a&&O&64&&oy(x),Sl(x,x.return);break;case 27:uy(x);case 26:case 5:hi(C,x,a),a&&d===null&&O&4&&ly(x),Sl(x,x.return);break;case 12:hi(C,x,a);break;case 31:hi(C,x,a),a&&O&4&&my(C,x);break;case 13:hi(C,x,a),a&&O&4&&gy(C,x);break;case 22:x.memoizedState===null&&hi(C,x,a),Sl(x,x.return);break;case 30:break;default:hi(C,x,a)}i=i.sibling}}function vp(t,i){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&ol(a))}function _p(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&ol(t))}function gn(t,i,a,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)yy(t,i,a,d),i=i.sibling}function yy(t,i,a,d){var C=i.flags;switch(i.tag){case 0:case 11:case 15:gn(t,i,a,d),C&2048&&yl(9,i);break;case 1:gn(t,i,a,d);break;case 3:gn(t,i,a,d),C&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&ol(t)));break;case 12:if(C&2048){gn(t,i,a,d),t=i.stateNode;try{var x=i.memoizedProps,O=x.id,V=x.onPostCommit;typeof V=="function"&&V(O,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(re){mt(i,i.return,re)}}else gn(t,i,a,d);break;case 31:gn(t,i,a,d);break;case 13:gn(t,i,a,d);break;case 23:break;case 22:x=i.stateNode,O=i.alternate,i.memoizedState!==null?x._visibility&2?gn(t,i,a,d):Cl(t,i):x._visibility&2?gn(t,i,a,d):(x._visibility|=2,zo(t,i,a,d,(i.subtreeFlags&10256)!==0||!1)),C&2048&&vp(O,i);break;case 24:gn(t,i,a,d),C&2048&&_p(i.alternate,i);break;default:gn(t,i,a,d)}}function zo(t,i,a,d,C){for(C=C&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=t,O=i,V=a,re=d,me=O.flags;switch(O.tag){case 0:case 11:case 15:zo(x,O,V,re,C),yl(8,O);break;case 23:break;case 22:var be=O.stateNode;O.memoizedState!==null?be._visibility&2?zo(x,O,V,re,C):Cl(x,O):(be._visibility|=2,zo(x,O,V,re,C)),C&&me&2048&&vp(O.alternate,O);break;case 24:zo(x,O,V,re,C),C&&me&2048&&_p(O.alternate,O);break;default:zo(x,O,V,re,C)}i=i.sibling}}function Cl(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=t,d=i,C=d.flags;switch(d.tag){case 22:Cl(a,d),C&2048&&vp(d.alternate,d);break;case 24:Cl(a,d),C&2048&&_p(d.alternate,d);break;default:Cl(a,d)}i=i.sibling}}var bl=8192;function Yo(t,i,a){if(t.subtreeFlags&bl)for(t=t.child;t!==null;)Sy(t,i,a),t=t.sibling}function Sy(t,i,a){switch(t.tag){case 26:Yo(t,i,a),t.flags&bl&&t.memoizedState!==null&&AT(a,mn,t.memoizedState,t.memoizedProps);break;case 5:Yo(t,i,a);break;case 3:case 4:var d=mn;mn=Ju(t.stateNode.containerInfo),Yo(t,i,a),mn=d;break;case 22:t.memoizedState===null&&(d=t.alternate,d!==null&&d.memoizedState!==null?(d=bl,bl=16777216,Yo(t,i,a),bl=d):Yo(t,i,a));break;default:Yo(t,i,a)}}function Cy(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function wl(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var d=i[a];tr=d,wy(d,t)}Cy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)by(t),t=t.sibling}function by(t){switch(t.tag){case 0:case 11:case 15:wl(t),t.flags&2048&&Ki(9,t,t.return);break;case 3:wl(t);break;case 12:wl(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,ju(t)):wl(t);break;default:wl(t)}}function ju(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var d=i[a];tr=d,wy(d,t)}Cy(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Ki(8,i,i.return),ju(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,ju(i));break;default:ju(i)}t=t.sibling}}function wy(t,i){for(;tr!==null;){var a=tr;switch(a.tag){case 0:case 11:case 15:Ki(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var d=a.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:ol(a.memoizedState.cache)}if(d=a.child,d!==null)d.return=a,tr=d;else e:for(a=t;tr!==null;){d=tr;var C=d.sibling,x=d.return;if(fy(d),d===a){tr=null;break e}if(C!==null){C.return=x,tr=C;break e}tr=x}}}var HA={getCacheForType:function(t){var i=ir(qt),a=i.data.get(t);return a===void 0&&(a=t(),i.data.set(t,a)),a},cacheSignal:function(){return ir(qt).controller.signal}},VA=typeof WeakMap=="function"?WeakMap:Map,dt=0,St=null,Ze=null,et=0,pt=0,jr=null,Qi=!1,Wo=!1,yp=!1,fi=0,Pt=0,$i=0,Js=0,Sp=0,Ur=0,Ko=0,El=null,Dr=null,Cp=!1,Uu=0,Ey=0,Fu=1/0,Hu=null,Ji=null,Qt=0,Zi=null,Qo=null,pi=0,bp=0,wp=null,xy=null,xl=0,Ep=null;function Fr(){return(dt&2)!==0&&et!==0?et&-et:Y.T!==null?Mp():Da()}function Ay(){if(Ur===0)if((et&536870912)===0||nt){var t=En;En<<=1,(En&3932160)===0&&(En=262144),Ur=t}else Ur=536870912;return t=Ir.current,t!==null&&(t.flags|=32),Ur}function Mr(t,i,a){(t===St&&(pt===2||pt===9)||t.cancelPendingCommit!==null)&&($o(t,0),Xi(t,et,Ur,!1)),Ti(t,a),((dt&2)===0||t!==St)&&(t===St&&((dt&2)===0&&(Js|=a),Pt===4&&Xi(t,et,Ur,!1)),kn(t))}function Ty(t,i,a){if((dt&6)!==0)throw Error(s(327));var d=!a&&(i&127)===0&&(i&t.expiredLanes)===0||bs(t,i),C=d?zA(t,i):Ap(t,i,!0),x=d;do{if(C===0){Wo&&!d&&Xi(t,i,0,!1);break}else{if(a=t.current.alternate,x&&!qA(a)){C=Ap(t,i,!1),x=!1;continue}if(C===2){if(x=i,t.errorRecoveryDisabledLanes&x)var O=0;else O=t.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){i=O;e:{var V=t;C=El;var re=V.current.memoizedState.isDehydrated;if(re&&($o(V,O).flags|=256),O=Ap(V,O,!1),O!==2){if(yp&&!re){V.errorRecoveryDisabledLanes|=x,Js|=x,C=4;break e}x=Dr,Dr=C,x!==null&&(Dr===null?Dr=x:Dr.push.apply(Dr,x))}C=O}if(x=!1,C!==2)continue}}if(C===1){$o(t,0),Xi(t,i,0,!0);break}e:{switch(d=t,x=C,x){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Xi(d,i,Ur,!Qi);break e;case 2:Dr=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(C=Uu+300-kt(),10<C)){if(Xi(d,i,Ur,!Qi),vr(d,0,!0)!==0)break e;pi=i,d.timeoutHandle=i0(Ry.bind(null,d,a,Dr,Hu,Cp,i,Ur,Js,Ko,Qi,x,"Throttled",-0,0),C);break e}Ry(d,a,Dr,Hu,Cp,i,Ur,Js,Ko,Qi,x,null,-0,0)}}break}while(!0);kn(t)}function Ry(t,i,a,d,C,x,O,V,re,me,be,Ee,ve,Se){if(t.timeoutHandle=-1,Ee=i.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:hn},Sy(i,x,Ee);var ke=(x&62914560)===x?Uu-kt():(x&4194048)===x?Ey-kt():0;if(ke=TT(Ee,ke),ke!==null){pi=x,t.cancelPendingCommit=ke(Iy.bind(null,t,i,x,a,d,C,O,V,re,be,Ee,null,ve,Se)),Xi(t,x,O,!me);return}}Iy(t,i,x,a,d,C,O,V,re)}function qA(t){for(var i=t;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var d=0;d<a.length;d++){var C=a[d],x=C.getSnapshot;C=C.value;try{if(!_r(x(),C))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Xi(t,i,a,d){i&=~Sp,i&=~Js,t.suspendedLanes|=i,t.pingedLanes&=~i,d&&(t.warmLanes|=i),d=t.expirationTimes;for(var C=i;0<C;){var x=31-er(C),O=1<<x;d[x]=-1,C&=~O}a!==0&&Ra(t,a,i)}function Vu(){return(dt&6)===0?(Al(0),!1):!0}function xp(){if(Ze!==null){if(pt===0)var t=Ze.return;else t=Ze,ni=Vs=null,Hf(t),Fo=null,ll=0,t=Ze;for(;t!==null;)sy(t.alternate,t),t=t.return;Ze=null}}function $o(t,i){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,cT(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),pi=0,xp(),St=t,Ze=a=xr(t.current,null),et=i,pt=0,jr=null,Qi=!1,Wo=bs(t,i),yp=!1,Ko=Ur=Sp=Js=$i=Pt=0,Dr=El=null,Cp=!1,(i&8)!==0&&(i|=i&32);var d=t.entangledLanes;if(d!==0)for(t=t.entanglements,d&=i;0<d;){var C=31-er(d),x=1<<C;i|=t[C],d&=~x}return fi=i,ft(),a}function Dy(t,i){qe=null,Y.H=gl,i===Uo||i===vu?(i=zv(),pt=3):i===Df?(i=zv(),pt=4):pt=i===np?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,jr=i,Ze===null&&(Pt=1,ku(t,Qr(i,t.current)))}function My(){var t=Ir.current;return t===null?!0:(et&4194048)===et?Xr===null:(et&62914560)===et||(et&536870912)!==0?t===Xr:!1}function ky(){var t=Y.H;return Y.H=gl,t===null?gl:t}function Ly(){var t=Y.A;return Y.A=HA,t}function qu(){Pt=4,Qi||(et&4194048)!==et&&Ir.current!==null||(Wo=!0),($i&134217727)===0&&(Js&134217727)===0||St===null||Xi(St,et,Ur,!1)}function Ap(t,i,a){var d=dt;dt|=2;var C=ky(),x=Ly();(St!==t||et!==i)&&(Hu=null,$o(t,i)),i=!1;var O=Pt;e:do try{if(pt!==0&&Ze!==null){var V=Ze,re=jr;switch(pt){case 8:xp(),O=6;break e;case 3:case 2:case 9:case 6:Ir.current===null&&(i=!0);var me=pt;if(pt=0,jr=null,Jo(t,V,re,me),a&&Wo){O=0;break e}break;default:me=pt,pt=0,jr=null,Jo(t,V,re,me)}}GA(),O=Pt;break}catch(be){Dy(t,be)}while(!0);return i&&t.shellSuspendCounter++,ni=Vs=null,dt=d,Y.H=C,Y.A=x,Ze===null&&(St=null,et=0,ft()),O}function GA(){for(;Ze!==null;)Oy(Ze)}function zA(t,i){var a=dt;dt|=2;var d=ky(),C=Ly();St!==t||et!==i?(Hu=null,Fu=kt()+500,$o(t,i)):Wo=bs(t,i);e:do try{if(pt!==0&&Ze!==null){i=Ze;var x=jr;t:switch(pt){case 1:pt=0,jr=null,Jo(t,i,x,1);break;case 2:case 9:if(qv(x)){pt=0,jr=null,By(i);break}i=function(){pt!==2&&pt!==9||St!==t||(pt=7),kn(t)},x.then(i,i);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:qv(x)?(pt=0,jr=null,By(i)):(pt=0,jr=null,Jo(t,i,x,7));break;case 5:var O=null;switch(Ze.tag){case 26:O=Ze.memoizedState;case 5:case 27:var V=Ze;if(O?y0(O):V.stateNode.complete){pt=0,jr=null;var re=V.sibling;if(re!==null)Ze=re;else{var me=V.return;me!==null?(Ze=me,Gu(me)):Ze=null}break t}}pt=0,jr=null,Jo(t,i,x,5);break;case 6:pt=0,jr=null,Jo(t,i,x,6);break;case 8:xp(),Pt=6;break e;default:throw Error(s(462))}}YA();break}catch(be){Dy(t,be)}while(!0);return ni=Vs=null,Y.H=d,Y.A=C,dt=a,Ze!==null?0:(St=null,et=0,ft(),Pt)}function YA(){for(;Ze!==null&&!Cn();)Oy(Ze)}function Oy(t){var i=ny(t.alternate,t,fi);t.memoizedProps=t.pendingProps,i===null?Gu(t):Ze=i}function By(t){var i=t,a=i.alternate;switch(i.tag){case 15:case 0:i=J_(a,i,i.pendingProps,i.type,void 0,et);break;case 11:i=J_(a,i,i.pendingProps,i.type.render,i.ref,et);break;case 5:Hf(i);default:sy(a,i),i=Ze=js(i,fi),i=ny(a,i,fi)}t.memoizedProps=t.pendingProps,i===null?Gu(t):Ze=i}function Jo(t,i,a,d){ni=Vs=null,Hf(i),Fo=null,ll=0;var C=i.return;try{if(BA(t,C,i,a,et)){Pt=1,ku(t,Qr(a,t.current)),Ze=null;return}}catch(x){if(C!==null)throw Ze=C,x;Pt=1,ku(t,Qr(a,t.current)),Ze=null;return}i.flags&32768?(nt||d===1?t=!0:Wo||(et&536870912)!==0?t=!1:(Qi=t=!0,(d===2||d===9||d===3||d===6)&&(d=Ir.current,d!==null&&d.tag===13&&(d.flags|=16384))),Ny(i,t)):Gu(i)}function Gu(t){var i=t;do{if((i.flags&32768)!==0){Ny(i,Qi);return}t=i.return;var a=PA(i.alternate,i,fi);if(a!==null){Ze=a;return}if(i=i.sibling,i!==null){Ze=i;return}Ze=i=t}while(i!==null);Pt===0&&(Pt=5)}function Ny(t,i){do{var a=jA(t.alternate,t);if(a!==null){a.flags&=32767,Ze=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(t=t.sibling,t!==null)){Ze=t;return}Ze=t=a}while(t!==null);Pt=6,Ze=null}function Iy(t,i,a,d,C,x,O,V,re){t.cancelPendingCommit=null;do zu();while(Qt!==0);if((dt&6)!==0)throw Error(s(327));if(i!==null){if(i===t.current)throw Error(s(177));if(x=i.lanes|i.childLanes,x|=Ct,Fh(t,a,x,O,V,re),t===St&&(Ze=St=null,et=0),Qo=i,Zi=t,pi=a,bp=x,wp=C,xy=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,$A(pr,function(){return Hy(),null})):(t.callbackNode=null,t.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Y.T,Y.T=null,C=ie.p,ie.p=2,O=dt,dt|=4;try{UA(t,i,a)}finally{dt=O,ie.p=C,Y.T=d}}Qt=1,Py(),jy(),Uy()}}function Py(){if(Qt===1){Qt=0;var t=Zi,i=Qo,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=Y.T,Y.T=null;var d=ie.p;ie.p=2;var C=dt;dt|=4;try{vy(i,t);var x=jp,O=uu(t.containerInfo),V=x.focusedElem,re=x.selectionRange;if(O!==V&&V&&V.ownerDocument&&cu(V.ownerDocument.documentElement,V)){if(re!==null&&tl(V)){var me=re.start,be=re.end;if(be===void 0&&(be=me),"selectionStart"in V)V.selectionStart=me,V.selectionEnd=Math.min(be,V.value.length);else{var Ee=V.ownerDocument||document,ve=Ee&&Ee.defaultView||window;if(ve.getSelection){var Se=ve.getSelection(),ke=V.textContent.length,Ue=Math.min(re.start,ke),yt=re.end===void 0?Ue:Math.min(re.end,ke);!Se.extend&&Ue>yt&&(O=yt,yt=Ue,Ue=O);var ce=lu(V,Ue),ae=lu(V,yt);if(ce&&ae&&(Se.rangeCount!==1||Se.anchorNode!==ce.node||Se.anchorOffset!==ce.offset||Se.focusNode!==ae.node||Se.focusOffset!==ae.offset)){var pe=Ee.createRange();pe.setStart(ce.node,ce.offset),Se.removeAllRanges(),Ue>yt?(Se.addRange(pe),Se.extend(ae.node,ae.offset)):(pe.setEnd(ae.node,ae.offset),Se.addRange(pe))}}}}for(Ee=[],Se=V;Se=Se.parentNode;)Se.nodeType===1&&Ee.push({element:Se,left:Se.scrollLeft,top:Se.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<Ee.length;V++){var we=Ee[V];we.element.scrollLeft=we.left,we.element.scrollTop=we.top}}nd=!!Pp,jp=Pp=null}finally{dt=C,ie.p=d,Y.T=a}}t.current=i,Qt=2}}function jy(){if(Qt===2){Qt=0;var t=Zi,i=Qo,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=Y.T,Y.T=null;var d=ie.p;ie.p=2;var C=dt;dt|=4;try{hy(t,i.alternate,i)}finally{dt=C,ie.p=d,Y.T=a}}Qt=3}}function Uy(){if(Qt===4||Qt===3){Qt=0,Zt();var t=Zi,i=Qo,a=pi,d=xy;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Qt=5:(Qt=0,Qo=Zi=null,Fy(t,t.pendingLanes));var C=t.pendingLanes;if(C===0&&(Ji=null),Es(a),i=i.stateNode,Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(gr,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Y.T,C=ie.p,ie.p=2,Y.T=null;try{for(var x=t.onRecoverableError,O=0;O<d.length;O++){var V=d[O];x(V.value,{componentStack:V.stack})}}finally{Y.T=i,ie.p=C}}(pi&3)!==0&&zu(),kn(t),C=t.pendingLanes,(a&261930)!==0&&(C&42)!==0?t===Ep?xl++:(xl=0,Ep=t):xl=0,Al(0)}}function Fy(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,ol(i)))}function zu(){return Py(),jy(),Uy(),Hy()}function Hy(){if(Qt!==5)return!1;var t=Zi,i=bp;bp=0;var a=Es(pi),d=Y.T,C=ie.p;try{ie.p=32>a?32:a,Y.T=null,a=wp,wp=null;var x=Zi,O=pi;if(Qt=0,Qo=Zi=null,pi=0,(dt&6)!==0)throw Error(s(331));var V=dt;if(dt|=4,by(x.current),yy(x,x.current,O,a),dt=V,Al(0,!1),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(gr,x)}catch{}return!0}finally{ie.p=C,Y.T=d,Fy(t,i)}}function Vy(t,i,a){i=Qr(a,i),i=rp(t.stateNode,i,2),t=zi(t,i,2),t!==null&&(Ti(t,2),kn(t))}function mt(t,i,a){if(t.tag===3)Vy(t,t,a);else for(;i!==null;){if(i.tag===3){Vy(i,t,a);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ji===null||!Ji.has(d))){t=Qr(a,t),a=q_(2),d=zi(i,a,2),d!==null&&(G_(a,d,i,t),Ti(d,2),kn(d));break}}i=i.return}}function Tp(t,i,a){var d=t.pingCache;if(d===null){d=t.pingCache=new VA;var C=new Set;d.set(i,C)}else C=d.get(i),C===void 0&&(C=new Set,d.set(i,C));C.has(a)||(yp=!0,C.add(a),t=WA.bind(null,t,i,a),i.then(t,t))}function WA(t,i,a){var d=t.pingCache;d!==null&&d.delete(i),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,St===t&&(et&a)===a&&(Pt===4||Pt===3&&(et&62914560)===et&&300>kt()-Uu?(dt&2)===0&&$o(t,0):Sp|=a,Ko===et&&(Ko=0)),kn(t)}function qy(t,i){i===0&&(i=po()),t=Ot(t,i),t!==null&&(Ti(t,i),kn(t))}function KA(t){var i=t.memoizedState,a=0;i!==null&&(a=i.retryLane),qy(t,a)}function QA(t,i){var a=0;switch(t.tag){case 31:case 13:var d=t.stateNode,C=t.memoizedState;C!==null&&(a=C.retryLane);break;case 19:d=t.stateNode;break;case 22:d=t.stateNode._retryCache;break;default:throw Error(s(314))}d!==null&&d.delete(i),qy(t,a)}function $A(t,i){return Ht(t,i)}var Yu=null,Zo=null,Rp=!1,Wu=!1,Dp=!1,es=0;function kn(t){t!==Zo&&t.next===null&&(Zo===null?Yu=Zo=t:Zo=Zo.next=t),Wu=!0,Rp||(Rp=!0,ZA())}function Al(t,i){if(!Dp&&Wu){Dp=!0;do for(var a=!1,d=Yu;d!==null;){if(t!==0){var C=d.pendingLanes;if(C===0)var x=0;else{var O=d.suspendedLanes,V=d.pingedLanes;x=(1<<31-er(42|t)+1)-1,x&=C&~(O&~V),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(a=!0,Wy(d,x))}else x=et,x=vr(d,d===St?x:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(x&3)===0||bs(d,x)||(a=!0,Wy(d,x));d=d.next}while(a);Dp=!1}}function JA(){Gy()}function Gy(){Wu=Rp=!1;var t=0;es!==0&&lT()&&(t=es);for(var i=kt(),a=null,d=Yu;d!==null;){var C=d.next,x=zy(d,i);x===0?(d.next=null,a===null?Yu=C:a.next=C,C===null&&(Zo=a)):(a=d,(t!==0||(x&3)!==0)&&(Wu=!0)),d=C}Qt!==0&&Qt!==5||Al(t),es!==0&&(es=0)}function zy(t,i){for(var a=t.suspendedLanes,d=t.pingedLanes,C=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var O=31-er(x),V=1<<O,re=C[O];re===-1?((V&a)===0||(V&d)!==0)&&(C[O]=Uh(V,i)):re<=i&&(t.expiredLanes|=V),x&=~V}if(i=St,a=et,a=vr(t,t===i?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d=t.callbackNode,a===0||t===i&&(pt===2||pt===9)||t.cancelPendingCommit!==null)return d!==null&&d!==null&&Tt(d),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||bs(t,a)){if(i=a&-a,i===t.callbackPriority)return i;switch(d!==null&&Tt(d),Es(a)){case 2:case 8:a=bn;break;case 32:a=pr;break;case 268435456:a=mr;break;default:a=pr}return d=Yy.bind(null,t),a=Ht(a,d),t.callbackPriority=i,t.callbackNode=a,i}return d!==null&&d!==null&&Tt(d),t.callbackPriority=2,t.callbackNode=null,2}function Yy(t,i){if(Qt!==0&&Qt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(zu()&&t.callbackNode!==a)return null;var d=et;return d=vr(t,t===St?d:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d===0?null:(Ty(t,d,i),zy(t,kt()),t.callbackNode!=null&&t.callbackNode===a?Yy.bind(null,t):null)}function Wy(t,i){if(zu())return null;Ty(t,i,!0)}function ZA(){uT(function(){(dt&6)!==0?Ht(Yr,JA):Gy()})}function Mp(){if(es===0){var t=Po;t===0&&(t=Vt,Vt<<=1,(Vt&261888)===0&&(Vt=256)),es=t}return es}function Ky(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:wo(""+t)}function Qy(t,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,t.id&&a.setAttribute("form",t.id),i.parentNode.insertBefore(a,i),t=new FormData(t),a.parentNode.removeChild(a),t}function XA(t,i,a,d,C){if(i==="submit"&&a&&a.stateNode===C){var x=Ky((C[lr]||null).action),O=d.submitter;O&&(i=(i=O[lr]||null)?Ky(i.formAction):O.getAttribute("formAction"),i!==null&&(x=i,O=null));var V=new Oi("action","action",null,d,C);t.push({event:V,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(es!==0){var re=O?Qy(C,O):new FormData(C);$f(a,{pending:!0,data:re,method:C.method,action:x},null,re)}}else typeof x=="function"&&(V.preventDefault(),re=O?Qy(C,O):new FormData(C),$f(a,{pending:!0,data:re,method:C.method,action:x},x,re))},currentTarget:C}]})}}for(var kp=0;kp<Me.length;kp++){var Lp=Me[kp],eT=Lp.toLowerCase(),tT=Lp[0].toUpperCase()+Lp.slice(1);Ne(eT,"on"+tT)}Ne(q,"onAnimationEnd"),Ne(Z,"onAnimationIteration"),Ne(se,"onAnimationStart"),Ne("dblclick","onDoubleClick"),Ne("focusin","onFocus"),Ne("focusout","onBlur"),Ne(le,"onTransitionRun"),Ne(ge,"onTransitionStart"),Ne(ye,"onTransitionCancel"),Ne(xe,"onTransitionEnd"),Qn("onMouseEnter",["mouseout","mouseover"]),Qn("onMouseLeave",["mouseout","mouseover"]),Qn("onPointerEnter",["pointerout","pointerover"]),Qn("onPointerLeave",["pointerout","pointerover"]),Wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tl="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(" "),rT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tl));function $y(t,i){i=(i&4)!==0;for(var a=0;a<t.length;a++){var d=t[a],C=d.event;d=d.listeners;e:{var x=void 0;if(i)for(var O=d.length-1;0<=O;O--){var V=d[O],re=V.instance,me=V.currentTarget;if(V=V.listener,re!==x&&C.isPropagationStopped())break e;x=V,C.currentTarget=me;try{x(C)}catch(be){it(be)}C.currentTarget=null,x=re}else for(O=0;O<d.length;O++){if(V=d[O],re=V.instance,me=V.currentTarget,V=V.listener,re!==x&&C.isPropagationStopped())break e;x=V,C.currentTarget=me;try{x(C)}catch(be){it(be)}C.currentTarget=null,x=re}}}}function Xe(t,i){var a=i[ka];a===void 0&&(a=i[ka]=new Set);var d=t+"__bubble";a.has(d)||(Jy(i,t,2,!1),a.add(d))}function Op(t,i,a){var d=0;i&&(d|=4),Jy(a,t,d,i)}var Ku="_reactListening"+Math.random().toString(36).slice(2);function Bp(t){if(!t[Ku]){t[Ku]=!0,Pc.forEach(function(a){a!=="selectionchange"&&(rT.has(a)||Op(a,!1,t),Op(a,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Ku]||(i[Ku]=!0,Op("selectionchange",!1,i))}}function Jy(t,i,a,d){switch(A0(i)){case 2:var C=MT;break;case 8:C=kT;break;default:C=Qp}a=C.bind(null,i,a,t),C=void 0,!xo||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(C=!0),d?C!==void 0?t.addEventListener(i,a,{capture:!0,passive:C}):t.addEventListener(i,a,!0):C!==void 0?t.addEventListener(i,a,{passive:C}):t.addEventListener(i,a,!1)}function Np(t,i,a,d,C){var x=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var O=d.tag;if(O===3||O===4){var V=d.stateNode.containerInfo;if(V===C)break;if(O===4)for(O=d.return;O!==null;){var re=O.tag;if((re===3||re===4)&&O.stateNode.containerInfo===C)return;O=O.return}for(;V!==null;){if(O=Kn(V),O===null)return;if(re=O.tag,re===5||re===6||re===26||re===27){d=x=O;continue e}V=V.parentNode}}d=d.return}qa(function(){var me=x,be=Ha(a),Ee=[];e:{var ve=Re.get(t);if(ve!==void 0){var Se=Oi,ke=t;switch(t){case"keypress":if(To(a)===0)break e;case"keydown":case"keyup":Se=nf;break;case"focusin":ke="focus",Se=Wa;break;case"focusout":ke="blur",Se=Wa;break;case"beforeblur":case"afterblur":Se=Wa;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=zc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=Yh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=Wc;break;case q:case Z:case se:Se=Qh;break;case xe:Se=Qa;break;case"scroll":case"scrollend":Se=Gh;break;case"wheel":Se=Ke;break;case"copy":case"cut":case"paste":Se=Jh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=Yc;break;case"toggle":case"beforetoggle":Se=$c}var Ue=(i&4)!==0,yt=!Ue&&(t==="scroll"||t==="scrollend"),ce=Ue?ve!==null?ve+"Capture":null:ve;Ue=[];for(var ae=me,pe;ae!==null;){var we=ae;if(pe=we.stateNode,we=we.tag,we!==5&&we!==26&&we!==27||pe===null||ce===null||(we=Ts(ae,ce),we!=null&&Ue.push(Rl(ae,we,pe))),yt)break;ae=ae.return}0<Ue.length&&(ve=new Se(ve,ke,null,a,be),Ee.push({event:ve,listeners:Ue}))}}if((i&7)===0){e:{if(ve=t==="mouseover"||t==="pointerover",Se=t==="mouseout"||t==="pointerout",ve&&a!==Fa&&(ke=a.relatedTarget||a.fromElement)&&(Kn(ke)||ke[Mi]))break e;if((Se||ve)&&(ve=be.window===be?be:(ve=be.ownerDocument)?ve.defaultView||ve.parentWindow:window,Se?(ke=a.relatedTarget||a.toElement,Se=me,ke=ke?Kn(ke):null,ke!==null&&(yt=u(ke),Ue=ke.tag,ke!==yt||Ue!==5&&Ue!==27&&Ue!==6)&&(ke=null)):(Se=null,ke=me),Se!==ke)){if(Ue=zc,we="onMouseLeave",ce="onMouseEnter",ae="mouse",(t==="pointerout"||t==="pointerover")&&(Ue=Yc,we="onPointerLeave",ce="onPointerEnter",ae="pointer"),yt=Se==null?ve:As(Se),pe=ke==null?ve:As(ke),ve=new Ue(we,ae+"leave",Se,a,be),ve.target=yt,ve.relatedTarget=pe,we=null,Kn(be)===me&&(Ue=new Ue(ce,ae+"enter",ke,a,be),Ue.target=pe,Ue.relatedTarget=yt,we=Ue),yt=we,Se&&ke)t:{for(Ue=nT,ce=Se,ae=ke,pe=0,we=ce;we;we=Ue(we))pe++;we=0;for(var Pe=ae;Pe;Pe=Ue(Pe))we++;for(;0<pe-we;)ce=Ue(ce),pe--;for(;0<we-pe;)ae=Ue(ae),we--;for(;pe--;){if(ce===ae||ae!==null&&ce===ae.alternate){Ue=ce;break t}ce=Ue(ce),ae=Ue(ae)}Ue=null}else Ue=null;Se!==null&&Zy(Ee,ve,Se,Ue,!1),ke!==null&&yt!==null&&Zy(Ee,yt,ke,Ue,!0)}}e:{if(ve=me?As(me):window,Se=ve.nodeName&&ve.nodeName.toLowerCase(),Se==="select"||Se==="input"&&ve.type==="file")var at=ru;else if(eu(ve))if(nu)at=pf;else{at=hf;var Be=df}else Se=ve.nodeName,!Se||Se.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?me&&Ua(me.elementType)&&(at=ru):at=ff;if(at&&(at=at(t,me))){tu(Ee,at,a,be);break e}Be&&Be(t,ve,me),t==="focusout"&&me&&ve.type==="number"&&me.memoizedProps.value!=null&&Co(ve,"number",ve.value)}switch(Be=me?As(me):window,t){case"focusin":(eu(Be)||Be.contentEditable==="true")&&(Ii=Be,rl=me,Ps=null);break;case"focusout":Ps=rl=Ii=null;break;case"mousedown":nl=!0;break;case"contextmenu":case"mouseup":case"dragend":nl=!1,du(Ee,a,be);break;case"selectionchange":if(gf)break;case"keydown":case"keyup":du(Ee,a,be)}var ze;if(Mo)e:{switch(t){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else Ni?Za(t,a)&&(tt="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(tt="onCompositionStart");tt&&($a&&a.locale!=="ko"&&(Ni||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Ni&&(ze=qc()):(An=be,Ga="value"in An?An.value:An.textContent,Ni=!0)),Be=Qu(me,tt),0<Be.length&&(tt=new Do(tt,t,null,a,be),Ee.push({event:tt,listeners:Be}),ze?tt.data=ze:(ze=Xc(a),ze!==null&&(tt.data=ze)))),(ze=Zc?af(t,a):lf(t,a))&&(tt=Qu(me,"onBeforeInput"),0<tt.length&&(Be=new Do("onBeforeInput","beforeinput",null,a,be),Ee.push({event:Be,listeners:tt}),Be.data=ze)),XA(Ee,t,me,a,be)}$y(Ee,i)})}function Rl(t,i,a){return{instance:t,listener:i,currentTarget:a}}function Qu(t,i){for(var a=i+"Capture",d=[];t!==null;){var C=t,x=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||x===null||(C=Ts(t,a),C!=null&&d.unshift(Rl(t,C,x)),C=Ts(t,i),C!=null&&d.push(Rl(t,C,x))),t.tag===3)return d;t=t.return}return[]}function nT(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Zy(t,i,a,d,C){for(var x=i._reactName,O=[];a!==null&&a!==d;){var V=a,re=V.alternate,me=V.stateNode;if(V=V.tag,re!==null&&re===d)break;V!==5&&V!==26&&V!==27||me===null||(re=me,C?(me=Ts(a,x),me!=null&&O.unshift(Rl(a,me,re))):C||(me=Ts(a,x),me!=null&&O.push(Rl(a,me,re)))),a=a.return}O.length!==0&&t.push({event:i,listeners:O})}var iT=/\r\n?/g,sT=/\u0000|\uFFFD/g;function Xy(t){return(typeof t=="string"?t:""+t).replace(iT,`
50
+ `).replace(sT,"")}function e0(t,i){return i=Xy(i),Xy(t)===i}function _t(t,i,a,d,C,x){switch(a){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||$n(t,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&$n(t,""+d);break;case"className":go(t,"class",d);break;case"tabIndex":go(t,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":go(t,a,d);break;case"style":Vc(t,d,x);break;case"data":if(i!=="object"){go(t,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||a!=="href")){t.removeAttribute(a);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(a);break}d=wo(""+d),t.setAttribute(a,d);break;case"action":case"formAction":if(typeof d=="function"){t.setAttribute(a,"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 x=="function"&&(a==="formAction"?(i!=="input"&&_t(t,i,"name",C.name,C,null),_t(t,i,"formEncType",C.formEncType,C,null),_t(t,i,"formMethod",C.formMethod,C,null),_t(t,i,"formTarget",C.formTarget,C,null)):(_t(t,i,"encType",C.encType,C,null),_t(t,i,"method",C.method,C,null),_t(t,i,"target",C.target,C,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(a);break}d=wo(""+d),t.setAttribute(a,d);break;case"onClick":d!=null&&(t.onclick=hn);break;case"onScroll":d!=null&&Xe("scroll",t);break;case"onScrollEnd":d!=null&&Xe("scrollend",t);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(a=d.__html,a!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":t.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){t.removeAttribute("xlink:href");break}a=wo(""+d),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(a,""+d):t.removeAttribute(a);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":d&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":d===!0?t.setAttribute(a,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(a,d):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?t.setAttribute(a,d):t.removeAttribute(a);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?t.removeAttribute(a):t.setAttribute(a,d);break;case"popover":Xe("beforetoggle",t),Xe("toggle",t),mo(t,"popover",d);break;case"xlinkActuate":jt(t,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":jt(t,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":jt(t,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":jt(t,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":jt(t,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":jt(t,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":jt(t,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":jt(t,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":jt(t,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":mo(t,"is",d);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Vh.get(a)||a,mo(t,a,d))}}function Ip(t,i,a,d,C,x){switch(a){case"style":Vc(t,d,x);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(a=d.__html,a!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof d=="string"?$n(t,d):(typeof d=="number"||typeof d=="bigint")&&$n(t,""+d);break;case"onScroll":d!=null&&Xe("scroll",t);break;case"onScrollEnd":d!=null&&Xe("scrollend",t);break;case"onClick":d!=null&&(t.onclick=hn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(C=a.endsWith("Capture"),i=a.slice(2,C?a.length-7:void 0),x=t[lr]||null,x=x!=null?x[a]:null,typeof x=="function"&&t.removeEventListener(i,x,C),typeof d=="function")){typeof x!="function"&&x!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(i,d,C);break e}a in t?t[a]=d:d===!0?t.setAttribute(a,""):mo(t,a,d)}}}function or(t,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",t),Xe("load",t);var d=!1,C=!1,x;for(x in a)if(a.hasOwnProperty(x)){var O=a[x];if(O!=null)switch(x){case"src":d=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:_t(t,i,x,O,a,null)}}C&&_t(t,i,"srcSet",a.srcSet,a,null),d&&_t(t,i,"src",a.src,a,null);return;case"input":Xe("invalid",t);var V=x=O=C=null,re=null,me=null;for(d in a)if(a.hasOwnProperty(d)){var be=a[d];if(be!=null)switch(d){case"name":C=be;break;case"type":O=be;break;case"checked":re=be;break;case"defaultChecked":me=be;break;case"value":x=be;break;case"defaultValue":V=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(s(137,i));break;default:_t(t,i,d,be,a,null)}}Fc(t,x,V,re,me,O,C,!1);return;case"select":Xe("invalid",t),d=O=x=null;for(C in a)if(a.hasOwnProperty(C)&&(V=a[C],V!=null))switch(C){case"value":x=V;break;case"defaultValue":O=V;break;case"multiple":d=V;default:_t(t,i,C,V,a,null)}i=x,a=O,t.multiple=!!d,i!=null?Er(t,!!d,i,!1):a!=null&&Er(t,!!d,a,!0);return;case"textarea":Xe("invalid",t),x=C=d=null;for(O in a)if(a.hasOwnProperty(O)&&(V=a[O],V!=null))switch(O){case"value":d=V;break;case"defaultValue":C=V;break;case"children":x=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(s(91));break;default:_t(t,i,O,V,a,null)}Br(t,d,C,x);return;case"option":for(re in a)if(a.hasOwnProperty(re)&&(d=a[re],d!=null))switch(re){case"selected":t.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:_t(t,i,re,d,a,null)}return;case"dialog":Xe("beforetoggle",t),Xe("toggle",t),Xe("cancel",t),Xe("close",t);break;case"iframe":case"object":Xe("load",t);break;case"video":case"audio":for(d=0;d<Tl.length;d++)Xe(Tl[d],t);break;case"image":Xe("error",t),Xe("load",t);break;case"details":Xe("toggle",t);break;case"embed":case"source":case"link":Xe("error",t),Xe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(me in a)if(a.hasOwnProperty(me)&&(d=a[me],d!=null))switch(me){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:_t(t,i,me,d,a,null)}return;default:if(Ua(i)){for(be in a)a.hasOwnProperty(be)&&(d=a[be],d!==void 0&&Ip(t,i,be,d,a,void 0));return}}for(V in a)a.hasOwnProperty(V)&&(d=a[V],d!=null&&_t(t,i,V,d,a,null))}function oT(t,i,a,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,x=null,O=null,V=null,re=null,me=null,be=null;for(Se in a){var Ee=a[Se];if(a.hasOwnProperty(Se)&&Ee!=null)switch(Se){case"checked":break;case"value":break;case"defaultValue":re=Ee;default:d.hasOwnProperty(Se)||_t(t,i,Se,null,d,Ee)}}for(var ve in d){var Se=d[ve];if(Ee=a[ve],d.hasOwnProperty(ve)&&(Se!=null||Ee!=null))switch(ve){case"type":x=Se;break;case"name":C=Se;break;case"checked":me=Se;break;case"defaultChecked":be=Se;break;case"value":O=Se;break;case"defaultValue":V=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(s(137,i));break;default:Se!==Ee&&_t(t,i,ve,Se,d,Ee)}}So(t,O,V,re,me,be,x,C);return;case"select":Se=O=V=ve=null;for(x in a)if(re=a[x],a.hasOwnProperty(x)&&re!=null)switch(x){case"value":break;case"multiple":Se=re;default:d.hasOwnProperty(x)||_t(t,i,x,null,d,re)}for(C in d)if(x=d[C],re=a[C],d.hasOwnProperty(C)&&(x!=null||re!=null))switch(C){case"value":ve=x;break;case"defaultValue":V=x;break;case"multiple":O=x;default:x!==re&&_t(t,i,C,x,d,re)}i=V,a=O,d=Se,ve!=null?Er(t,!!a,ve,!1):!!d!=!!a&&(i!=null?Er(t,!!a,i,!0):Er(t,!!a,a?[]:"",!1));return;case"textarea":Se=ve=null;for(V in a)if(C=a[V],a.hasOwnProperty(V)&&C!=null&&!d.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:_t(t,i,V,null,d,C)}for(O in d)if(C=d[O],x=a[O],d.hasOwnProperty(O)&&(C!=null||x!=null))switch(O){case"value":ve=C;break;case"defaultValue":Se=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:C!==x&&_t(t,i,O,C,d,x)}bo(t,ve,Se);return;case"option":for(var ke in a)if(ve=a[ke],a.hasOwnProperty(ke)&&ve!=null&&!d.hasOwnProperty(ke))switch(ke){case"selected":t.selected=!1;break;default:_t(t,i,ke,null,d,ve)}for(re in d)if(ve=d[re],Se=a[re],d.hasOwnProperty(re)&&ve!==Se&&(ve!=null||Se!=null))switch(re){case"selected":t.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:_t(t,i,re,ve,d,Se)}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 Ue in a)ve=a[Ue],a.hasOwnProperty(Ue)&&ve!=null&&!d.hasOwnProperty(Ue)&&_t(t,i,Ue,null,d,ve);for(me in d)if(ve=d[me],Se=a[me],d.hasOwnProperty(me)&&ve!==Se&&(ve!=null||Se!=null))switch(me){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(s(137,i));break;default:_t(t,i,me,ve,d,Se)}return;default:if(Ua(i)){for(var yt in a)ve=a[yt],a.hasOwnProperty(yt)&&ve!==void 0&&!d.hasOwnProperty(yt)&&Ip(t,i,yt,void 0,d,ve);for(be in d)ve=d[be],Se=a[be],!d.hasOwnProperty(be)||ve===Se||ve===void 0&&Se===void 0||Ip(t,i,be,ve,d,Se);return}}for(var ce in a)ve=a[ce],a.hasOwnProperty(ce)&&ve!=null&&!d.hasOwnProperty(ce)&&_t(t,i,ce,null,d,ve);for(Ee in d)ve=d[Ee],Se=a[Ee],!d.hasOwnProperty(Ee)||ve===Se||ve==null&&Se==null||_t(t,i,Ee,ve,d,Se)}function t0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aT(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,a=performance.getEntriesByType("resource"),d=0;d<a.length;d++){var C=a[d],x=C.transferSize,O=C.initiatorType,V=C.duration;if(x&&V&&t0(O)){for(O=0,V=C.responseEnd,d+=1;d<a.length;d++){var re=a[d],me=re.startTime;if(me>V)break;var be=re.transferSize,Ee=re.initiatorType;be&&t0(Ee)&&(re=re.responseEnd,O+=be*(re<V?1:(V-me)/(re-me)))}if(--d,i+=8*(x+O)/(C.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Pp=null,jp=null;function $u(t){return t.nodeType===9?t:t.ownerDocument}function r0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function n0(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Up(t,i){return t==="textarea"||t==="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 Fp=null;function lT(){var t=window.event;return t&&t.type==="popstate"?t===Fp?!1:(Fp=t,!0):(Fp=null,!1)}var i0=typeof setTimeout=="function"?setTimeout:void 0,cT=typeof clearTimeout=="function"?clearTimeout:void 0,s0=typeof Promise=="function"?Promise:void 0,uT=typeof queueMicrotask=="function"?queueMicrotask:typeof s0<"u"?function(t){return s0.resolve(null).then(t).catch(dT)}:i0;function dT(t){setTimeout(function(){throw t})}function ts(t){return t==="head"}function o0(t,i){var a=i,d=0;do{var C=a.nextSibling;if(t.removeChild(a),C&&C.nodeType===8)if(a=C.data,a==="/$"||a==="/&"){if(d===0){t.removeChild(C),ra(i);return}d--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")d++;else if(a==="html")Dl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Dl(a);for(var x=a.firstChild;x;){var O=x.nextSibling,V=x.nodeName;x[xs]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&x.rel.toLowerCase()==="stylesheet"||a.removeChild(x),x=O}}else a==="body"&&Dl(t.ownerDocument.body);a=C}while(a);ra(i)}function a0(t,i){var a=t;t=0;do{var d=a.nextSibling;if(a.nodeType===1?i?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(i?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),d&&d.nodeType===8)if(a=d.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=d}while(a)}function Hp(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Hp(a),Ba(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function hT(t,i,a,d){for(;t.nodeType===1;){var C=a;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(d){if(!t[xs])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==C.rel||t.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||t.getAttribute("title")!==(C.title==null?null:C.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(C.src==null?null:C.src)||t.getAttribute("type")!==(C.type==null?null:C.type)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var x=C.name==null?null:""+C.name;if(C.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=en(t.nextSibling),t===null)break}return null}function fT(t,i,a){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=en(t.nextSibling),t===null))return null;return t}function l0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=en(t.nextSibling),t===null))return null;return t}function Vp(t){return t.data==="$?"||t.data==="$~"}function qp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function pT(t,i){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||a.readyState!=="loading")i();else{var d=function(){i(),a.removeEventListener("DOMContentLoaded",d)};a.addEventListener("DOMContentLoaded",d),t._reactRetry=d}}function en(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var Gp=null;function c0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(i===0)return en(t.nextSibling);i--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||i++}t=t.nextSibling}return null}function u0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(i===0)return t;i--}else a!=="/$"&&a!=="/&"||i++}t=t.previousSibling}return null}function d0(t,i,a){switch(i=$u(a),t){case"html":if(t=i.documentElement,!t)throw Error(s(452));return t;case"head":if(t=i.head,!t)throw Error(s(453));return t;case"body":if(t=i.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Dl(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ba(t)}var tn=new Map,h0=new Set;function Ju(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var mi=ie.d;ie.d={f:mT,r:gT,D:vT,C:_T,L:yT,m:ST,X:bT,S:CT,M:wT};function mT(){var t=mi.f(),i=Vu();return t||i}function gT(t){var i=ki(t);i!==null&&i.tag===5&&i.type==="form"?D_(i):mi.r(t)}var Xo=typeof document>"u"?null:document;function f0(t,i,a){var d=Xo;if(d&&typeof i=="string"&&i){var C=wr(i);C='link[rel="'+t+'"][href="'+C+'"]',typeof a=="string"&&(C+='[crossorigin="'+a+'"]'),h0.has(C)||(h0.add(C),t={rel:t,crossOrigin:a,href:i},d.querySelector(C)===null&&(i=d.createElement("link"),or(i,"link",t),Lt(i),d.head.appendChild(i)))}}function vT(t){mi.D(t),f0("dns-prefetch",t,null)}function _T(t,i){mi.C(t,i),f0("preconnect",t,i)}function yT(t,i,a){mi.L(t,i,a);var d=Xo;if(d&&t&&i){var C='link[rel="preload"][as="'+wr(i)+'"]';i==="image"&&a&&a.imageSrcSet?(C+='[imagesrcset="'+wr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(C+='[imagesizes="'+wr(a.imageSizes)+'"]')):C+='[href="'+wr(t)+'"]';var x=C;switch(i){case"style":x=ea(t);break;case"script":x=ta(t)}tn.has(x)||(t=p({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:t,as:i},a),tn.set(x,t),d.querySelector(C)!==null||i==="style"&&d.querySelector(Ml(x))||i==="script"&&d.querySelector(kl(x))||(i=d.createElement("link"),or(i,"link",t),Lt(i),d.head.appendChild(i)))}}function ST(t,i){mi.m(t,i);var a=Xo;if(a&&t){var d=i&&typeof i.as=="string"?i.as:"script",C='link[rel="modulepreload"][as="'+wr(d)+'"][href="'+wr(t)+'"]',x=C;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=ta(t)}if(!tn.has(x)&&(t=p({rel:"modulepreload",href:t},i),tn.set(x,t),a.querySelector(C)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(kl(x)))return}d=a.createElement("link"),or(d,"link",t),Lt(d),a.head.appendChild(d)}}}function CT(t,i,a){mi.S(t,i,a);var d=Xo;if(d&&t){var C=Li(d).hoistableStyles,x=ea(t);i=i||"default";var O=C.get(x);if(!O){var V={loading:0,preload:null};if(O=d.querySelector(Ml(x)))V.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":i},a),(a=tn.get(x))&&zp(t,a);var re=O=d.createElement("link");Lt(re),or(re,"link",t),re._p=new Promise(function(me,be){re.onload=me,re.onerror=be}),re.addEventListener("load",function(){V.loading|=1}),re.addEventListener("error",function(){V.loading|=2}),V.loading|=4,Zu(O,i,d)}O={type:"stylesheet",instance:O,count:1,state:V},C.set(x,O)}}}function bT(t,i){mi.X(t,i);var a=Xo;if(a&&t){var d=Li(a).hoistableScripts,C=ta(t),x=d.get(C);x||(x=a.querySelector(kl(C)),x||(t=p({src:t,async:!0},i),(i=tn.get(C))&&Yp(t,i),x=a.createElement("script"),Lt(x),or(x,"link",t),a.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(C,x))}}function wT(t,i){mi.M(t,i);var a=Xo;if(a&&t){var d=Li(a).hoistableScripts,C=ta(t),x=d.get(C);x||(x=a.querySelector(kl(C)),x||(t=p({src:t,async:!0,type:"module"},i),(i=tn.get(C))&&Yp(t,i),x=a.createElement("script"),Lt(x),or(x,"link",t),a.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(C,x))}}function p0(t,i,a,d){var C=(C=fe.current)?Ju(C):null;if(!C)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=ea(a.href),a=Li(C).hoistableStyles,d=a.get(i),d||(d={type:"style",instance:null,count:0,state:null},a.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=ea(a.href);var x=Li(C).hoistableStyles,O=x.get(t);if(O||(C=C.ownerDocument||C,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,O),(x=C.querySelector(Ml(t)))&&!x._p&&(O.instance=x,O.state.loading=5),tn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},tn.set(t,a),x||ET(C,t,a,O.state))),i&&d===null)throw Error(s(528,""));return O}if(i&&d!==null)throw Error(s(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ta(a),a=Li(C).hoistableScripts,d=a.get(i),d||(d={type:"script",instance:null,count:0,state:null},a.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function ea(t){return'href="'+wr(t)+'"'}function Ml(t){return'link[rel="stylesheet"]['+t+"]"}function m0(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function ET(t,i,a,d){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=t.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),or(i,"link",a),Lt(i),t.head.appendChild(i))}function ta(t){return'[src="'+wr(t)+'"]'}function kl(t){return"script[async]"+t}function g0(t,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var d=t.querySelector('style[data-href~="'+wr(a.href)+'"]');if(d)return i.instance=d,Lt(d),d;var C=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return d=(t.ownerDocument||t).createElement("style"),Lt(d),or(d,"style",C),Zu(d,a.precedence,t),i.instance=d;case"stylesheet":C=ea(a.href);var x=t.querySelector(Ml(C));if(x)return i.state.loading|=4,i.instance=x,Lt(x),x;d=m0(a),(C=tn.get(C))&&zp(d,C),x=(t.ownerDocument||t).createElement("link"),Lt(x);var O=x;return O._p=new Promise(function(V,re){O.onload=V,O.onerror=re}),or(x,"link",d),i.state.loading|=4,Zu(x,a.precedence,t),i.instance=x;case"script":return x=ta(a.src),(C=t.querySelector(kl(x)))?(i.instance=C,Lt(C),C):(d=a,(C=tn.get(x))&&(d=p({},a),Yp(d,C)),t=t.ownerDocument||t,C=t.createElement("script"),Lt(C),or(C,"link",d),t.head.appendChild(C),i.instance=C);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,Zu(d,a.precedence,t));return i.instance}function Zu(t,i,a){for(var d=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=d.length?d[d.length-1]:null,x=C,O=0;O<d.length;O++){var V=d[O];if(V.dataset.precedence===i)x=V;else if(x!==C)break}x?x.parentNode.insertBefore(t,x.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(t,i.firstChild))}function zp(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Yp(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Xu=null;function v0(t,i,a){if(Xu===null){var d=new Map,C=Xu=new Map;C.set(a,d)}else C=Xu,d=C.get(a),d||(d=new Map,C.set(a,d));if(d.has(t))return d;for(d.set(t,null),a=a.getElementsByTagName(t),C=0;C<a.length;C++){var x=a[C];if(!(x[xs]||x[Kt]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var O=x.getAttribute(i)||"";O=t+O;var V=d.get(O);V?V.push(x):d.set(O,[x])}}return d}function _0(t,i,a){t=t.ownerDocument||t,t.head.insertBefore(a,i==="title"?t.querySelector("head > title"):null)}function xT(t,i,a){if(a===1||i.itemProp!=null)return!1;switch(t){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;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!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 y0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function AT(t,i,a,d){if(a.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var C=ea(d.href),x=i.querySelector(Ml(C));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=ed.bind(t),i.then(t,t)),a.state.loading|=4,a.instance=x,Lt(x);return}x=i.ownerDocument||i,d=m0(d),(C=tn.get(C))&&zp(d,C),x=x.createElement("link"),Lt(x);var O=x;O._p=new Promise(function(V,re){O.onload=V,O.onerror=re}),or(x,"link",d),a.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=ed.bind(t),i.addEventListener("load",a),i.addEventListener("error",a))}}var Wp=0;function TT(t,i){return t.stylesheets&&t.count===0&&rd(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var d=setTimeout(function(){if(t.stylesheets&&rd(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+i);0<t.imgBytes&&Wp===0&&(Wp=62500*aT());var C=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&rd(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>Wp?50:800)+i);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(d),clearTimeout(C)}}:null}function ed(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rd(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var td=null;function rd(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,td=new Map,i.forEach(RT,t),td=null,ed.call(t))}function RT(t,i){if(!(i.state.loading&4)){var a=td.get(t);if(a)var d=a.get(null);else{a=new Map,td.set(t,a);for(var C=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<C.length;x++){var O=C[x];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(a.set(O.dataset.precedence,O),d=O)}d&&a.set(null,d)}C=i.instance,O=C.getAttribute("data-precedence"),x=a.get(O)||d,x===d&&a.set(null,C),a.set(O,C),this.count++,d=ed.bind(this),C.addEventListener("load",d),C.addEventListener("error",d),x?x.parentNode.insertBefore(C,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(C,t.firstChild)),i.state.loading|=4}}var Ll={$$typeof:y,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function DT(t,i,a,d,C,x,O,V,re){this.tag=1,this.containerInfo=t,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=ws(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ws(0),this.hiddenUpdates=ws(null),this.identifierPrefix=d,this.onUncaughtError=C,this.onCaughtError=x,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function S0(t,i,a,d,C,x,O,V,re,me,be,Ee){return t=new DT(t,i,a,O,re,me,be,Ee,V),i=1,x===!0&&(i|=24),x=ur(3,null,null,i),t.current=x,x.stateNode=t,i=Af(),i.refCount++,t.pooledCache=i,i.refCount++,x.memoizedState={element:d,isDehydrated:a,cache:i},Mf(x),t}function C0(t){return t?(t=ji,t):ji}function b0(t,i,a,d,C,x){C=C0(C),d.context===null?d.context=C:d.pendingContext=C,d=Gi(i),d.payload={element:a},x=x===void 0?null:x,x!==null&&(d.callback=x),a=zi(t,d,i),a!==null&&(Mr(a,t,i),ul(a,t,i))}function w0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<i?a:i}}function Kp(t,i){w0(t,i),(t=t.alternate)&&w0(t,i)}function E0(t){if(t.tag===13||t.tag===31){var i=Ot(t,67108864);i!==null&&Mr(i,t,67108864),Kp(t,67108864)}}function x0(t){if(t.tag===13||t.tag===31){var i=Fr();i=Di(i);var a=Ot(t,i);a!==null&&Mr(a,t,i),Kp(t,i)}}var nd=!0;function MT(t,i,a,d){var C=Y.T;Y.T=null;var x=ie.p;try{ie.p=2,Qp(t,i,a,d)}finally{ie.p=x,Y.T=C}}function kT(t,i,a,d){var C=Y.T;Y.T=null;var x=ie.p;try{ie.p=8,Qp(t,i,a,d)}finally{ie.p=x,Y.T=C}}function Qp(t,i,a,d){if(nd){var C=$p(d);if(C===null)Np(t,i,d,id,a),T0(t,d);else if(OT(C,t,i,a,d))d.stopPropagation();else if(T0(t,d),i&4&&-1<LT.indexOf(t)){for(;C!==null;){var x=ki(C);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var O=Wn(x.pendingLanes);if(O!==0){var V=x;for(V.pendingLanes|=2,V.entangledLanes|=2;O;){var re=1<<31-er(O);V.entanglements[1]|=re,O&=~re}kn(x),(dt&6)===0&&(Fu=kt()+500,Al(0))}}break;case 31:case 13:V=Ot(x,2),V!==null&&Mr(V,x,2),Vu(),Kp(x,2)}if(x=$p(d),x===null&&Np(t,i,d,id,a),x===C)break;C=x}C!==null&&d.stopPropagation()}else Np(t,i,d,null,a)}}function $p(t){return t=Ha(t),Jp(t)}var id=null;function Jp(t){if(id=null,t=Kn(t),t!==null){var i=u(t);if(i===null)t=null;else{var a=i.tag;if(a===13){if(t=f(i),t!==null)return t;t=null}else if(a===31){if(t=l(i),t!==null)return t;t=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return id=t,null}function A0(t){switch(t){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(ar()){case Yr:return 2;case bn:return 8;case pr:case un:return 32;case mr:return 268435456;default:return 32}default:return 32}}var Zp=!1,rs=null,ns=null,is=null,Ol=new Map,Bl=new Map,ss=[],LT="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 T0(t,i){switch(t){case"focusin":case"focusout":rs=null;break;case"dragenter":case"dragleave":ns=null;break;case"mouseover":case"mouseout":is=null;break;case"pointerover":case"pointerout":Ol.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bl.delete(i.pointerId)}}function Nl(t,i,a,d,C,x){return t===null||t.nativeEvent!==x?(t={blockedOn:i,domEventName:a,eventSystemFlags:d,nativeEvent:x,targetContainers:[C]},i!==null&&(i=ki(i),i!==null&&E0(i)),t):(t.eventSystemFlags|=d,i=t.targetContainers,C!==null&&i.indexOf(C)===-1&&i.push(C),t)}function OT(t,i,a,d,C){switch(i){case"focusin":return rs=Nl(rs,t,i,a,d,C),!0;case"dragenter":return ns=Nl(ns,t,i,a,d,C),!0;case"mouseover":return is=Nl(is,t,i,a,d,C),!0;case"pointerover":var x=C.pointerId;return Ol.set(x,Nl(Ol.get(x)||null,t,i,a,d,C)),!0;case"gotpointercapture":return x=C.pointerId,Bl.set(x,Nl(Bl.get(x)||null,t,i,a,d,C)),!0}return!1}function R0(t){var i=Kn(t.target);if(i!==null){var a=u(i);if(a!==null){if(i=a.tag,i===13){if(i=f(a),i!==null){t.blockedOn=i,Ma(t.priority,function(){x0(a)});return}}else if(i===31){if(i=l(a),i!==null){t.blockedOn=i,Ma(t.priority,function(){x0(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function sd(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var a=$p(t.nativeEvent);if(a===null){a=t.nativeEvent;var d=new a.constructor(a.type,a);Fa=d,a.target.dispatchEvent(d),Fa=null}else return i=ki(a),i!==null&&E0(i),t.blockedOn=a,!1;i.shift()}return!0}function D0(t,i,a){sd(t)&&a.delete(i)}function BT(){Zp=!1,rs!==null&&sd(rs)&&(rs=null),ns!==null&&sd(ns)&&(ns=null),is!==null&&sd(is)&&(is=null),Ol.forEach(D0),Bl.forEach(D0)}function od(t,i){t.blockedOn===i&&(t.blockedOn=null,Zp||(Zp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,BT)))}var ad=null;function M0(t){ad!==t&&(ad=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ad===t&&(ad=null);for(var i=0;i<t.length;i+=3){var a=t[i],d=t[i+1],C=t[i+2];if(typeof d!="function"){if(Jp(d||a)===null)continue;break}var x=ki(a);x!==null&&(t.splice(i,3),i-=3,$f(x,{pending:!0,data:C,method:a.method,action:d},d,C))}}))}function ra(t){function i(re){return od(re,t)}rs!==null&&od(rs,t),ns!==null&&od(ns,t),is!==null&&od(is,t),Ol.forEach(i),Bl.forEach(i);for(var a=0;a<ss.length;a++){var d=ss[a];d.blockedOn===t&&(d.blockedOn=null)}for(;0<ss.length&&(a=ss[0],a.blockedOn===null);)R0(a),a.blockedOn===null&&ss.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(d=0;d<a.length;d+=3){var C=a[d],x=a[d+1],O=C[lr]||null;if(typeof x=="function")O||M0(a);else if(O){var V=null;if(x&&x.hasAttribute("formAction")){if(C=x,O=x[lr]||null)V=O.formAction;else if(Jp(C)!==null)continue}else V=O.action;typeof V=="function"?a[d+1]=V:(a.splice(d,3),d-=3),M0(a)}}}function k0(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(O){return C=O})},focusReset:"manual",scroll:"manual"})}function i(){C!==null&&(C(),C=null),d||setTimeout(a,20)}function a(){if(!d&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,C=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(a,100),function(){d=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),C!==null&&(C(),C=null)}}}function Xp(t){this._internalRoot=t}ld.prototype.render=Xp.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(s(409));var a=i.current,d=Fr();b0(a,d,t,i,null,null)},ld.prototype.unmount=Xp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;b0(t.current,2,null,t,null,null),Vu(),i[Mi]=null}};function ld(t){this._internalRoot=t}ld.prototype.unstable_scheduleHydration=function(t){if(t){var i=Da();t={blockedOn:null,target:t,priority:i};for(var a=0;a<ss.length&&i!==0&&i<ss[a].priority;a++);ss.splice(a,0,t),a===0&&R0(t)}};var L0=r.version;if(L0!=="19.2.1")throw Error(s(527,L0,"19.2.1"));ie.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=h(i),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var NT={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cd.isDisabled&&cd.supportsFiber)try{gr=cd.inject(NT),Xt=cd}catch{}}return Pl.createRoot=function(t,i){if(!o(t))throw Error(s(299));var a=!1,d="",C=U_,x=F_,O=H_;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(C=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError)),i=S0(t,1,!1,null,null,a,d,null,C,x,O,k0),t[Mi]=i.current,Bp(t),new Xp(i)},Pl.hydrateRoot=function(t,i,a){if(!o(t))throw Error(s(299));var d=!1,C="",x=U_,O=F_,V=H_,re=null;return a!=null&&(a.unstable_strictMode===!0&&(d=!0),a.identifierPrefix!==void 0&&(C=a.identifierPrefix),a.onUncaughtError!==void 0&&(x=a.onUncaughtError),a.onCaughtError!==void 0&&(O=a.onCaughtError),a.onRecoverableError!==void 0&&(V=a.onRecoverableError),a.formState!==void 0&&(re=a.formState)),i=S0(t,1,!0,i,a??null,d,C,re,x,O,V,k0),i.context=C0(null),a=i.current,d=Fr(),d=Di(d),C=Gi(d),C.callback=null,zi(a,C,d),a=d,i.current.lanes=a,Ti(i,a),kn(i),t[Mi]=i.current,Bp(t),new ld(i)},Pl.version="19.2.1",Pl}var V0;function YT(){if(V0)return rm.exports;V0=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(r){console.error(r)}}return e(),rm.exports=zT(),rm.exports}var WT=YT();/**
51
+ * react-router v7.11.0
52
+ *
53
+ * Copyright (c) Remix Software Inc.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE.md file in the root directory of this source tree.
57
+ *
58
+ * @license MIT
59
+ */var q0="popstate";function KT(e={}){function r(s,o){let{pathname:u,search:f,hash:l}=s.location;return Vm("",{pathname:u,search:f,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(s,o){return typeof o=="string"?o:Ql(o)}return $T(r,n,null,e)}function Dt(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function ln(e,r){if(!e){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function QT(){return Math.random().toString(36).substring(2,10)}function G0(e,r){return{usr:e.state,key:e.key,idx:r}}function Vm(e,r,n=null,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof r=="string"?_a(r):r,state:n,key:r&&r.key||s||QT()}}function Ql({pathname:e="/",search:r="",hash:n=""}){return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function _a(e){let r={};if(e){let n=e.indexOf("#");n>=0&&(r.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(r.search=e.substring(s),e=e.substring(0,s)),e&&(r.pathname=e)}return r}function $T(e,r,n,s={}){let{window:o=document.defaultView,v5Compat:u=!1}=s,f=o.history,l="POP",c=null,h=m();h==null&&(h=0,f.replaceState({...f.state,idx:h},""));function m(){return(f.state||{idx:null}).idx}function p(){l="POP";let v=m(),S=v==null?null:v-h;h=v,c&&c({action:l,location:w.location,delta:S})}function _(v,S){l="PUSH";let g=Vm(w.location,v,S);h=m()+1;let y=G0(g,h),T=w.createHref(g);try{f.pushState(y,"",T)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;o.location.assign(T)}u&&c&&c({action:l,location:w.location,delta:1})}function E(v,S){l="REPLACE";let g=Vm(w.location,v,S);h=m();let y=G0(g,h),T=w.createHref(g);f.replaceState(y,"",T),u&&c&&c({action:l,location:w.location,delta:0})}function A(v){return JT(v)}let w={get action(){return l},get location(){return e(o,f)},listen(v){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(q0,p),c=v,()=>{o.removeEventListener(q0,p),c=null}},createHref(v){return r(o,v)},createURL:A,encodeLocation(v){let S=A(v);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:_,replace:E,go(v){return f.go(v)}};return w}function JT(e,r=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Dt(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Ql(e);return s=s.replace(/ $/,"%20"),!r&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function RC(e,r,n="/"){return ZT(e,r,n,!1)}function ZT(e,r,n,s){let o=typeof r=="string"?_a(r):r,u=wi(o.pathname||"/",n);if(u==null)return null;let f=DC(e);XT(f);let l=null;for(let c=0;l==null&&c<f.length;++c){let h=uR(u);l=lR(f[c],h,s)}return l}function DC(e,r=[],n=[],s="",o=!1){let u=(f,l,c=o,h)=>{let m={relativePath:h===void 0?f.path||"":h,caseSensitive:f.caseSensitive===!0,childrenIndex:l,route:f};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(s)&&c)return;Dt(m.relativePath.startsWith(s),`Absolute route path "${m.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(s.length)}let p=Ci([s,m.relativePath]),_=n.concat(m);f.children&&f.children.length>0&&(Dt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),DC(f.children,r,_,p,c)),!(f.path==null&&!f.index)&&r.push({path:p,score:oR(p,f.index),routesMeta:_})};return e.forEach((f,l)=>{var c;if(f.path===""||!((c=f.path)!=null&&c.includes("?")))u(f,l);else for(let h of MC(f.path))u(f,l,!0,h)}),r}function MC(e){let r=e.split("/");if(r.length===0)return[];let[n,...s]=r,o=n.endsWith("?"),u=n.replace(/\?$/,"");if(s.length===0)return o?[u,""]:[u];let f=MC(s.join("/")),l=[];return l.push(...f.map(c=>c===""?u:[u,c].join("/"))),o&&l.push(...f),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function XT(e){e.sort((r,n)=>r.score!==n.score?n.score-r.score:aR(r.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var eR=/^:[\w-]+$/,tR=3,rR=2,nR=1,iR=10,sR=-2,z0=e=>e==="*";function oR(e,r){let n=e.split("/"),s=n.length;return n.some(z0)&&(s+=sR),r&&(s+=rR),n.filter(o=>!z0(o)).reduce((o,u)=>o+(eR.test(u)?tR:u===""?nR:iR),s)}function aR(e,r){return e.length===r.length&&e.slice(0,-1).every((s,o)=>s===r[o])?e[e.length-1]-r[r.length-1]:0}function lR(e,r,n=!1){let{routesMeta:s}=e,o={},u="/",f=[];for(let l=0;l<s.length;++l){let c=s[l],h=l===s.length-1,m=u==="/"?r:r.slice(u.length)||"/",p=Vd({path:c.relativePath,caseSensitive:c.caseSensitive,end:h},m),_=c.route;if(!p&&h&&n&&!s[s.length-1].route.index&&(p=Vd({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},m)),!p)return null;Object.assign(o,p.params),f.push({params:o,pathname:Ci([u,p.pathname]),pathnameBase:pR(Ci([u,p.pathnameBase])),route:_}),p.pathnameBase!=="/"&&(u=Ci([u,p.pathnameBase]))}return f}function Vd(e,r){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=cR(e.path,e.caseSensitive,e.end),o=r.match(n);if(!o)return null;let u=o[0],f=u.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:s.reduce((h,{paramName:m,isOptional:p},_)=>{if(m==="*"){let A=l[_]||"";f=u.slice(0,u.length-A.length).replace(/(.)\/+$/,"$1")}const E=l[_];return p&&!E?h[m]=void 0:h[m]=(E||"").replace(/%2F/g,"/"),h},{}),pathname:u,pathnameBase:f,pattern:e}}function cR(e,r=!1,n=!0){ln(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,r?void 0:"i"),s]}function uR(e){try{return e.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return ln(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),e}}function wi(e,r){if(r==="/")return e;if(!e.toLowerCase().startsWith(r.toLowerCase()))return null;let n=r.endsWith("/")?r.length-1:r.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var kC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dR=e=>kC.test(e);function hR(e,r="/"){let{pathname:n,search:s="",hash:o=""}=typeof e=="string"?_a(e):e,u;if(n)if(dR(n))u=n;else{if(n.includes("//")){let f=n;n=n.replace(/\/\/+/g,"/"),ln(!1,`Pathnames cannot have embedded double slashes - normalizing ${f} -> ${n}`)}n.startsWith("/")?u=Y0(n.substring(1),"/"):u=Y0(n,r)}else u=r;return{pathname:u,search:mR(s),hash:gR(o)}}function Y0(e,r){let n=r.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function om(e,r,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${r}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function fR(e){return e.filter((r,n)=>n===0||r.route.path&&r.route.path.length>0)}function kg(e){let r=fR(e);return r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase)}function Lg(e,r,n,s=!1){let o;typeof e=="string"?o=_a(e):(o={...e},Dt(!o.pathname||!o.pathname.includes("?"),om("?","pathname","search",o)),Dt(!o.pathname||!o.pathname.includes("#"),om("#","pathname","hash",o)),Dt(!o.search||!o.search.includes("#"),om("#","search","hash",o)));let u=e===""||o.pathname==="",f=u?"/":o.pathname,l;if(f==null)l=n;else{let p=r.length-1;if(!s&&f.startsWith("..")){let _=f.split("/");for(;_[0]==="..";)_.shift(),p-=1;o.pathname=_.join("/")}l=p>=0?r[p]:"/"}let c=hR(o,l),h=f&&f!=="/"&&f.endsWith("/"),m=(u||f===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(h||m)&&(c.pathname+="/"),c}var Ci=e=>e.join("/").replace(/\/\/+/g,"/"),pR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),mR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,vR=class{constructor(e,r,n,s=!1){this.status=e,this.statusText=r||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function _R(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function yR(e){return e.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var LC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function OC(e,r){let n=e;if(typeof n!="string"||!kC.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,o=!1;if(LC)try{let u=new URL(window.location.href),f=n.startsWith("//")?new URL(u.protocol+n):new URL(n),l=wi(f.pathname,r);f.origin===u.origin&&l!=null?n=l+f.search+f.hash:o=!0}catch{ln(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var BC=["POST","PUT","PATCH","DELETE"];new Set(BC);var SR=["GET",...BC];new Set(SR);var ya=R.createContext(null);ya.displayName="DataRouter";var dh=R.createContext(null);dh.displayName="DataRouterState";var CR=R.createContext(!1),NC=R.createContext({isTransitioning:!1});NC.displayName="ViewTransition";var bR=R.createContext(new Map);bR.displayName="Fetchers";var wR=R.createContext(null);wR.displayName="Await";var zr=R.createContext(null);zr.displayName="Navigation";var pc=R.createContext(null);pc.displayName="Location";var cn=R.createContext({outlet:null,matches:[],isDataRoute:!1});cn.displayName="Route";var Og=R.createContext(null);Og.displayName="RouteError";var IC="REACT_ROUTER_ERROR",ER="REDIRECT",xR="ROUTE_ERROR_RESPONSE";function AR(e){if(e.startsWith(`${IC}:${ER}:{`))try{let r=JSON.parse(e.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function TR(e){if(e.startsWith(`${IC}:${xR}:{`))try{let r=JSON.parse(e.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new vR(r.status,r.statusText,r.data)}catch{}}function RR(e,{relative:r}={}){Dt(Sa(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=R.useContext(zr),{hash:o,pathname:u,search:f}=gc(e,{relative:r}),l=u;return n!=="/"&&(l=u==="/"?n:Ci([n,u])),s.createHref({pathname:l,search:f,hash:o})}function Sa(){return R.useContext(pc)!=null}function Vn(){return Dt(Sa(),"useLocation() may be used only in the context of a <Router> component."),R.useContext(pc).location}var PC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function jC(e){R.useContext(zr).static||R.useLayoutEffect(e)}function mc(){let{isDataRoute:e}=R.useContext(cn);return e?qR():DR()}function DR(){Dt(Sa(),"useNavigate() may be used only in the context of a <Router> component.");let e=R.useContext(ya),{basename:r,navigator:n}=R.useContext(zr),{matches:s}=R.useContext(cn),{pathname:o}=Vn(),u=JSON.stringify(kg(s)),f=R.useRef(!1);return jC(()=>{f.current=!0}),R.useCallback((c,h={})=>{if(ln(f.current,PC),!f.current)return;if(typeof c=="number"){n.go(c);return}let m=Lg(c,JSON.parse(u),o,h.relative==="path");e==null&&r!=="/"&&(m.pathname=m.pathname==="/"?r:Ci([r,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[r,n,u,o,e])}var MR=R.createContext(null);function kR(e){let r=R.useContext(cn).outlet;return R.useMemo(()=>r&&R.createElement(MR.Provider,{value:e},r),[r,e])}function UC(){let{matches:e}=R.useContext(cn),r=e[e.length-1];return r?r.params:{}}function gc(e,{relative:r}={}){let{matches:n}=R.useContext(cn),{pathname:s}=Vn(),o=JSON.stringify(kg(n));return R.useMemo(()=>Lg(e,JSON.parse(o),s,r==="path"),[e,o,s,r])}function LR(e,r){return FC(e,r)}function FC(e,r,n,s,o){var g;Dt(Sa(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=R.useContext(zr),{matches:f}=R.useContext(cn),l=f[f.length-1],c=l?l.params:{},h=l?l.pathname:"/",m=l?l.pathnameBase:"/",p=l&&l.route;{let y=p&&p.path||"";VC(h,!p||y.endsWith("*")||y.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${y}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${y}"> to <Route path="${y==="/"?"*":`${y}/*`}">.`)}let _=Vn(),E;if(r){let y=typeof r=="string"?_a(r):r;Dt(m==="/"||((g=y.pathname)==null?void 0:g.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${y.pathname}" was given in the \`location\` prop.`),E=y}else E=_;let A=E.pathname||"/",w=A;if(m!=="/"){let y=m.replace(/^\//,"").split("/");w="/"+A.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=RC(e,{pathname:w});ln(p||v!=null,`No routes matched location "${E.pathname}${E.search}${E.hash}" `),ln(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${E.pathname}${E.search}${E.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=PR(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Ci([m,u.encodeLocation?u.encodeLocation(y.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?m:Ci([m,u.encodeLocation?u.encodeLocation(y.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),f,n,s,o);return r&&S?R.createElement(pc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...E},navigationType:"POP"}},S):S}function OR(){let e=VR(),r=_R(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},f=null;return console.error("Error handled by React Router default ErrorBoundary:",e),f=R.createElement(R.Fragment,null,R.createElement("p",null,"💿 Hey developer 👋"),R.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",R.createElement("code",{style:u},"ErrorBoundary")," or"," ",R.createElement("code",{style:u},"errorElement")," prop on your route.")),R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},r),n?R.createElement("pre",{style:o},n):null,f)}var BR=R.createElement(OR,null),HC=class extends R.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){this.props.onError?this.props.onError(e,r):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=TR(e.digest);n&&(e=n)}let r=e!==void 0?R.createElement(cn.Provider,{value:this.props.routeContext},R.createElement(Og.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?R.createElement(NR,{error:e},r):r}};HC.contextType=CR;var am=new WeakMap;function NR({children:e,error:r}){let{basename:n}=R.useContext(zr);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let s=AR(r.digest);if(s){let o=am.get(r);if(o)throw o;let u=OC(s.location,n);if(LC&&!am.get(r))if(u.isExternal||s.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:s.replace}));throw am.set(r,f),f}return R.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function IR({routeContext:e,match:r,children:n}){let s=R.useContext(ya);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),R.createElement(cn.Provider,{value:e},n)}function PR(e,r=[],n=null,s=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(r.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let u=e,f=n==null?void 0:n.errors;if(f!=null){let m=u.findIndex(p=>p.route.id&&(f==null?void 0:f[p.route.id])!==void 0);Dt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),u=u.slice(0,Math.min(u.length,m+1))}let l=!1,c=-1;if(n)for(let m=0;m<u.length;m++){let p=u[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=m),p.route.id){let{loaderData:_,errors:E}=n,A=p.route.loader&&!_.hasOwnProperty(p.route.id)&&(!E||E[p.route.id]===void 0);if(p.route.lazy||A){l=!0,c>=0?u=u.slice(0,c+1):u=[u[0]];break}}}let h=n&&s?(m,p)=>{var _,E;s(m,{location:n.location,params:((E=(_=n.matches)==null?void 0:_[0])==null?void 0:E.params)??{},unstable_pattern:yR(n.matches),errorInfo:p})}:void 0;return u.reduceRight((m,p,_)=>{let E,A=!1,w=null,v=null;n&&(E=f&&p.route.id?f[p.route.id]:void 0,w=p.route.errorElement||BR,l&&(c<0&&_===0?(VC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,v=null):c===_&&(A=!0,v=p.route.hydrateFallbackElement||null)));let S=r.concat(u.slice(0,_+1)),g=()=>{let y;return E?y=w:A?y=v:p.route.Component?y=R.createElement(p.route.Component,null):p.route.element?y=p.route.element:y=m,R.createElement(IR,{match:p,routeContext:{outlet:m,matches:S,isDataRoute:n!=null},children:y})};return n&&(p.route.ErrorBoundary||p.route.errorElement||_===0)?R.createElement(HC,{location:n.location,revalidation:n.revalidation,component:w,error:E,children:g(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:h}):g()},null)}function Bg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jR(e){let r=R.useContext(ya);return Dt(r,Bg(e)),r}function UR(e){let r=R.useContext(dh);return Dt(r,Bg(e)),r}function FR(e){let r=R.useContext(cn);return Dt(r,Bg(e)),r}function Ng(e){let r=FR(e),n=r.matches[r.matches.length-1];return Dt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function HR(){return Ng("useRouteId")}function VR(){var s;let e=R.useContext(Og),r=UR("useRouteError"),n=Ng("useRouteError");return e!==void 0?e:(s=r.errors)==null?void 0:s[n]}function qR(){let{router:e}=jR("useNavigate"),r=Ng("useNavigate"),n=R.useRef(!1);return jC(()=>{n.current=!0}),R.useCallback(async(o,u={})=>{ln(n.current,PC),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:r,...u}))},[e,r])}var W0={};function VC(e,r,n){!r&&!W0[e]&&(W0[e]=!0,ln(!1,n))}R.memo(GR);function GR({routes:e,future:r,state:n,onError:s}){return FC(e,void 0,n,s,r)}function xd({to:e,replace:r,state:n,relative:s}){Dt(Sa(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=R.useContext(zr);ln(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=R.useContext(cn),{pathname:f}=Vn(),l=mc(),c=Lg(e,kg(u),f,s==="path"),h=JSON.stringify(c);return R.useEffect(()=>{l(JSON.parse(h),{replace:r,state:n,relative:s})},[l,h,s,r,n]),null}function zR(e){return kR(e.context)}function Ln(e){Dt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function YR({basename:e="/",children:r=null,location:n,navigationType:s="POP",navigator:o,static:u=!1,unstable_useTransitions:f}){Dt(!Sa(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=R.useMemo(()=>({basename:l,navigator:o,static:u,unstable_useTransitions:f,future:{}}),[l,o,u,f]);typeof n=="string"&&(n=_a(n));let{pathname:h="/",search:m="",hash:p="",state:_=null,key:E="default"}=n,A=R.useMemo(()=>{let w=wi(h,l);return w==null?null:{location:{pathname:w,search:m,hash:p,state:_,key:E},navigationType:s}},[l,h,m,p,_,E,s]);return ln(A!=null,`<Router basename="${l}"> is not able to match the URL "${h}${m}${p}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:R.createElement(zr.Provider,{value:c},R.createElement(pc.Provider,{children:r,value:A}))}function WR({children:e,location:r}){return LR(qm(e),r)}function qm(e,r=[]){let n=[];return R.Children.forEach(e,(s,o)=>{if(!R.isValidElement(s))return;let u=[...r,o];if(s.type===R.Fragment){n.push.apply(n,qm(s.props.children,u));return}Dt(s.type===Ln,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Dt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let f={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(f.children=qm(s.props.children,u)),n.push(f)}),n}var Ad="get",Td="application/x-www-form-urlencoded";function hh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function KR(e){return hh(e)&&e.tagName.toLowerCase()==="button"}function QR(e){return hh(e)&&e.tagName.toLowerCase()==="form"}function $R(e){return hh(e)&&e.tagName.toLowerCase()==="input"}function JR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ZR(e,r){return e.button===0&&(!r||r==="_self")&&!JR(e)}var ud=null;function XR(){if(ud===null)try{new FormData(document.createElement("form"),0),ud=!1}catch{ud=!0}return ud}var eD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lm(e){return e!=null&&!eD.has(e)?(ln(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Td}"`),null):e}function tD(e,r){let n,s,o,u,f;if(QR(e)){let l=e.getAttribute("action");s=l?wi(l,r):null,n=e.getAttribute("method")||Ad,o=lm(e.getAttribute("enctype"))||Td,u=new FormData(e)}else if(KR(e)||$R(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(s=c?wi(c,r):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Ad,o=lm(e.getAttribute("formenctype"))||lm(l.getAttribute("enctype"))||Td,u=new FormData(l,e),!XR()){let{name:h,type:m,value:p}=e;if(m==="image"){let _=h?`${h}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else h&&u.append(h,p)}}else{if(hh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ad,s=null,o=Td,f=e}return u&&o==="text/plain"&&(f=u,u=void 0),{action:s,method:n.toLowerCase(),encType:o,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ig(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function rD(e,r,n){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return s.pathname==="/"?s.pathname=`_root.${n}`:r&&wi(s.pathname,r)==="/"?s.pathname=`${r.replace(/\/$/,"")}/_root.${n}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${n}`,s}async function nD(e,r){if(e.id in r)return r[e.id];try{let n=await import(e.module);return r[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function iD(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function sD(e,r,n){let s=await Promise.all(e.map(async o=>{let u=r.routes[o.route.id];if(u){let f=await nD(u,n);return f.links?f.links():[]}return[]}));return cD(s.flat(1).filter(iD).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function K0(e,r,n,s,o,u){let f=(c,h)=>n[h]?c.route.id!==n[h].route.id:!0,l=(c,h)=>{var m;return n[h].pathname!==c.pathname||((m=n[h].route.path)==null?void 0:m.endsWith("*"))&&n[h].params["*"]!==c.params["*"]};return u==="assets"?r.filter((c,h)=>f(c,h)||l(c,h)):u==="data"?r.filter((c,h)=>{var p;let m=s.routes[c.route.id];if(!m||!m.hasLoader)return!1;if(f(c,h)||l(c,h))return!0;if(c.route.shouldRevalidate){let _=c.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function oD(e,r,{includeHydrateFallback:n}={}){return aD(e.map(s=>{let o=r.routes[s.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function aD(e){return[...new Set(e)]}function lD(e){let r={},n=Object.keys(e).sort();for(let s of n)r[s]=e[s];return r}function cD(e,r){let n=new Set;return new Set(r),e.reduce((s,o)=>{let u=JSON.stringify(lD(o));return n.has(u)||(n.add(u),s.push({key:u,link:o})),s},[])}function qC(){let e=R.useContext(ya);return Ig(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function uD(){let e=R.useContext(dh);return Ig(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Pg=R.createContext(void 0);Pg.displayName="FrameworkContext";function GC(){let e=R.useContext(Pg);return Ig(e,"You must render this element inside a <HydratedRouter> element"),e}function dD(e,r){let n=R.useContext(Pg),[s,o]=R.useState(!1),[u,f]=R.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:h,onMouseLeave:m,onTouchStart:p}=r,_=R.useRef(null);R.useEffect(()=>{if(e==="render"&&f(!0),e==="viewport"){let w=S=>{S.forEach(g=>{f(g.isIntersecting)})},v=new IntersectionObserver(w,{threshold:.5});return _.current&&v.observe(_.current),()=>{v.disconnect()}}},[e]),R.useEffect(()=>{if(s){let w=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(w)}}},[s]);let E=()=>{o(!0)},A=()=>{o(!1),f(!1)};return n?e!=="intent"?[u,_,{}]:[u,_,{onFocus:jl(l,E),onBlur:jl(c,A),onMouseEnter:jl(h,E),onMouseLeave:jl(m,A),onTouchStart:jl(p,E)}]:[!1,_,{}]}function jl(e,r){return n=>{e&&e(n),n.defaultPrevented||r(n)}}function hD({page:e,...r}){let{router:n}=qC(),s=R.useMemo(()=>RC(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?R.createElement(pD,{page:e,matches:s,...r}):null}function fD(e){let{manifest:r,routeModules:n}=GC(),[s,o]=R.useState([]);return R.useEffect(()=>{let u=!1;return sD(e,r,n).then(f=>{u||o(f)}),()=>{u=!0}},[e,r,n]),s}function pD({page:e,matches:r,...n}){let s=Vn(),{manifest:o,routeModules:u}=GC(),{basename:f}=qC(),{loaderData:l,matches:c}=uD(),h=R.useMemo(()=>K0(e,r,c,o,s,"data"),[e,r,c,o,s]),m=R.useMemo(()=>K0(e,r,c,o,s,"assets"),[e,r,c,o,s]),p=R.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let A=new Set,w=!1;if(r.forEach(S=>{var y;let g=o.routes[S.route.id];!g||!g.hasLoader||(!h.some(T=>T.route.id===S.route.id)&&S.route.id in l&&((y=u[S.route.id])!=null&&y.shouldRevalidate)||g.hasClientLoader?w=!0:A.add(S.route.id))}),A.size===0)return[];let v=rD(e,f,"data");return w&&A.size>0&&v.searchParams.set("_routes",r.filter(S=>A.has(S.route.id)).map(S=>S.route.id).join(",")),[v.pathname+v.search]},[f,l,s,o,h,r,e,u]),_=R.useMemo(()=>oD(m,o),[m,o]),E=fD(m);return R.createElement(R.Fragment,null,p.map(A=>R.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...n})),_.map(A=>R.createElement("link",{key:A,rel:"modulepreload",href:A,...n})),E.map(({key:A,link:w})=>R.createElement("link",{key:A,nonce:n.nonce,...w})))}function mD(...e){return r=>{e.forEach(n=>{typeof n=="function"?n(r):n!=null&&(n.current=r)})}}var gD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{gD&&(window.__reactRouterVersion="7.11.0")}catch{}function vD({basename:e,children:r,unstable_useTransitions:n,window:s}){let o=R.useRef();o.current==null&&(o.current=KT({window:s,v5Compat:!0}));let u=o.current,[f,l]=R.useState({action:u.action,location:u.location}),c=R.useCallback(h=>{n===!1?l(h):R.startTransition(()=>l(h))},[n]);return R.useLayoutEffect(()=>u.listen(c),[u,c]),R.createElement(YR,{basename:e,children:r,location:f.location,navigationType:f.action,navigator:u,unstable_useTransitions:n})}var zC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,YC=R.forwardRef(function({onClick:r,discover:n="render",prefetch:s="none",relative:o,reloadDocument:u,replace:f,state:l,target:c,to:h,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:_,...E},A){let{basename:w,unstable_useTransitions:v}=R.useContext(zr),S=typeof h=="string"&&zC.test(h),g=OC(h,w);h=g.to;let y=RR(h,{relative:o}),[T,M,k]=dD(s,E),L=CD(h,{replace:f,state:l,target:c,preventScrollReset:m,relative:o,viewTransition:p,unstable_defaultShouldRevalidate:_,unstable_useTransitions:v});function D(K){r&&r(K),K.defaultPrevented||L(K)}let j=R.createElement("a",{...E,...k,href:g.absoluteURL||y,onClick:g.isExternal||u?r:D,ref:mD(A,M),target:c,"data-discover":!S&&n==="render"?"true":void 0});return T&&!S?R.createElement(R.Fragment,null,j,R.createElement(hD,{page:y})):j});YC.displayName="Link";var _D=R.forwardRef(function({"aria-current":r="page",caseSensitive:n=!1,className:s="",end:o=!1,style:u,to:f,viewTransition:l,children:c,...h},m){let p=gc(f,{relative:h.relative}),_=Vn(),E=R.useContext(dh),{navigator:A,basename:w}=R.useContext(zr),v=E!=null&&AD(p)&&l===!0,S=A.encodeLocation?A.encodeLocation(p).pathname:p.pathname,g=_.pathname,y=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(g=g.toLowerCase(),y=y?y.toLowerCase():null,S=S.toLowerCase()),y&&w&&(y=wi(y,w)||y);const T=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let M=g===S||!o&&g.startsWith(S)&&g.charAt(T)==="/",k=y!=null&&(y===S||!o&&y.startsWith(S)&&y.charAt(S.length)==="/"),L={isActive:M,isPending:k,isTransitioning:v},D=M?r:void 0,j;typeof s=="function"?j=s(L):j=[s,M?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let K=typeof u=="function"?u(L):u;return R.createElement(YC,{...h,"aria-current":D,className:j,ref:m,style:K,to:f,viewTransition:l},typeof c=="function"?c(L):c)});_D.displayName="NavLink";var yD=R.forwardRef(({discover:e="render",fetcherKey:r,navigate:n,reloadDocument:s,replace:o,state:u,method:f=Ad,action:l,onSubmit:c,relative:h,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:_,...E},A)=>{let{unstable_useTransitions:w}=R.useContext(zr),v=ED(),S=xD(l,{relative:h}),g=f.toLowerCase()==="get"?"get":"post",y=typeof l=="string"&&zC.test(l),T=M=>{if(c&&c(M),M.defaultPrevented)return;M.preventDefault();let k=M.nativeEvent.submitter,L=(k==null?void 0:k.getAttribute("formmethod"))||f,D=()=>v(k||M.currentTarget,{fetcherKey:r,method:L,navigate:n,replace:o,state:u,relative:h,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:_});w&&n!==!1?R.startTransition(()=>D()):D()};return R.createElement("form",{ref:A,method:g,action:S,onSubmit:s?c:T,...E,"data-discover":!y&&e==="render"?"true":void 0})});yD.displayName="Form";function SD(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WC(e){let r=R.useContext(ya);return Dt(r,SD(e)),r}function CD(e,{target:r,replace:n,state:s,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:l,unstable_useTransitions:c}={}){let h=mc(),m=Vn(),p=gc(e,{relative:u});return R.useCallback(_=>{if(ZR(_,r)){_.preventDefault();let E=n!==void 0?n:Ql(m)===Ql(p),A=()=>h(e,{replace:E,state:s,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:l});c?R.startTransition(()=>A()):A()}},[m,h,p,n,s,r,e,o,u,f,l,c])}var bD=0,wD=()=>`__${String(++bD)}__`;function ED(){let{router:e}=WC("useSubmit"),{basename:r}=R.useContext(zr),n=HR(),s=e.fetch,o=e.navigate;return R.useCallback(async(u,f={})=>{let{action:l,method:c,encType:h,formData:m,body:p}=tD(u,r);if(f.navigate===!1){let _=f.fetcherKey||wD();await s(_,n,f.action||l,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:m,body:p,formMethod:f.method||c,formEncType:f.encType||h,flushSync:f.flushSync})}else await o(f.action||l,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:m,body:p,formMethod:f.method||c,formEncType:f.encType||h,replace:f.replace,state:f.state,fromRouteId:n,flushSync:f.flushSync,viewTransition:f.viewTransition})},[s,o,r,n])}function xD(e,{relative:r}={}){let{basename:n}=R.useContext(zr),s=R.useContext(cn);Dt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),u={...gc(e||".",{relative:r})},f=Vn();if(e==null){u.search=f.search;let l=new URLSearchParams(u.search),c=l.getAll("index");if(c.some(m=>m==="")){l.delete("index"),c.filter(p=>p).forEach(p=>l.append("index",p));let m=l.toString();u.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(u.pathname=u.pathname==="/"?n:Ci([n,u.pathname])),Ql(u)}function AD(e,{relative:r}={}){let n=R.useContext(NC);Dt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=WC("useViewTransitionState"),o=gc(e,{relative:r});if(!n.isTransitioning)return!1;let u=wi(n.currentLocation.pathname,s)||n.currentLocation.pathname,f=wi(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Vd(o.pathname,f)!=null||Vd(o.pathname,u)!=null}var vc=TC();const TD=Rg(vc),Q0=e=>{let r;const n=new Set,s=(h,m)=>{const p=typeof h=="function"?h(r):h;if(!Object.is(p,r)){const _=r;r=m??(typeof p!="object"||p===null)?p:Object.assign({},r,p),n.forEach(E=>E(r,_))}},o=()=>r,l={setState:s,getState:o,getInitialState:()=>c,subscribe:h=>(n.add(h),()=>n.delete(h))},c=r=e(s,o,l);return l},RD=(e=>e?Q0(e):Q0),DD=e=>e;function MD(e,r=DD){const n=nn.useSyncExternalStore(e.subscribe,nn.useCallback(()=>r(e.getState()),[e,r]),nn.useCallback(()=>r(e.getInitialState()),[e,r]));return nn.useDebugValue(n),n}const $0=e=>{const r=RD(e),n=s=>MD(r,s);return Object.assign(n,r),n},jg=(e=>e?$0(e):$0),J0={isAuthenticated:!1,credentials:null,connectionState:"disconnected",workstationOnline:!1,workstationInfo:null,tunnelInfo:null,sessions:[],selectedSessionId:null,availableAgents:[],workspaces:[]},Ge=jg(e=>({...J0,setAuthenticated:r=>e({isAuthenticated:r}),setCredentials:r=>e({credentials:r}),setConnectionState:r=>e({connectionState:r}),setWorkstationOnline:r=>e({workstationOnline:r}),setWorkstationInfo:r=>e({workstationInfo:r}),setTunnelInfo:r=>e({tunnelInfo:r}),setSessions:r=>e({sessions:r}),addSession:r=>e(n=>n.sessions.some(s=>s.id===r.id)?n:{sessions:[...n.sessions,r]}),removeSession:r=>e(n=>({sessions:n.sessions.filter(s=>s.id!==r),selectedSessionId:n.selectedSessionId===r?null:n.selectedSessionId})),updateSession:(r,n)=>e(s=>({sessions:s.sessions.map(o=>o.id===r?{...o,...n}:o)})),selectSession:r=>e({selectedSessionId:r}),setAvailableAgents:r=>e({availableAgents:r}),setWorkspaces:r=>e({workspaces:r}),reset:()=>e(J0)}));function Z0(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function _c(...e){return r=>{let n=!1;const s=e.map(o=>{const u=Z0(o,r);return!n&&typeof u=="function"&&(n=!0),u});if(n)return()=>{for(let o=0;o<s.length;o++){const u=s[o];typeof u=="function"?u():Z0(e[o],null)}}}}function st(...e){return R.useCallback(_c(...e),e)}var kD=Symbol.for("react.lazy"),qd=Mg[" use ".trim().toString()];function LD(e){return typeof e=="object"&&e!==null&&"then"in e}function KC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===kD&&"_payload"in e&&LD(e._payload)}function QC(e){const r=BD(e),n=R.forwardRef((s,o)=>{let{children:u,...f}=s;KC(u)&&typeof qd=="function"&&(u=qd(u._payload));const l=R.Children.toArray(u),c=l.find(ID);if(c){const h=c.props.children,m=l.map(p=>p===c?R.Children.count(h)>1?R.Children.only(null):R.isValidElement(h)?h.props.children:null:p);return b.jsx(r,{...f,ref:o,children:R.isValidElement(h)?R.cloneElement(h,void 0,m):null})}return b.jsx(r,{...f,ref:o,children:u})});return n.displayName=`${e}.Slot`,n}var OD=QC("Slot");function BD(e){const r=R.forwardRef((n,s)=>{let{children:o,...u}=n;if(KC(o)&&typeof qd=="function"&&(o=qd(o._payload)),R.isValidElement(o)){const f=jD(o),l=PD(u,o.props);return o.type!==R.Fragment&&(l.ref=s?_c(s,f):f),R.cloneElement(o,l)}return R.Children.count(o)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var ND=Symbol("radix.slottable");function ID(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ND}function PD(e,r){const n={...r};for(const s in r){const o=e[s],u=r[s];/^on[A-Z]/.test(s)?o&&u?n[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...u}:s==="className"&&(n[s]=[o,u].filter(Boolean).join(" "))}return{...e,...n}}function jD(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=r&&"isReactWarning"in r&&r.isReactWarning;return n?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=r&&"isReactWarning"in r&&r.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $C(e){var r,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(r=0;r<o;r++)e[r]&&(n=$C(e[r]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function JC(){for(var e,r,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(r=$C(e))&&(s&&(s+=" "),s+=r);return s}const X0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eS=JC,Ug=(e,r)=>n=>{var s;if((r==null?void 0:r.variants)==null)return eS(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:u}=r,f=Object.keys(o).map(h=>{const m=n==null?void 0:n[h],p=u==null?void 0:u[h];if(m===null)return null;const _=X0(m)||X0(p);return o[h][_]}),l=n&&Object.entries(n).reduce((h,m)=>{let[p,_]=m;return _===void 0||(h[p]=_),h},{}),c=r==null||(s=r.compoundVariants)===null||s===void 0?void 0:s.reduce((h,m)=>{let{class:p,className:_,...E}=m;return Object.entries(E).every(A=>{let[w,v]=A;return Array.isArray(v)?v.includes({...u,...l}[w]):{...u,...l}[w]===v})?[...h,p,_]:h},[]);return eS(e,f,c,n==null?void 0:n.class,n==null?void 0:n.className)},Fg="-",UD=e=>{const r=HD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:f=>{const l=f.split(Fg);return l[0]===""&&l.length!==1&&l.shift(),ZC(l,r)||FD(f)},getConflictingClassGroupIds:(f,l)=>{const c=n[f]||[];return l&&s[f]?[...c,...s[f]]:c}}},ZC=(e,r)=>{var f;if(e.length===0)return r.classGroupId;const n=e[0],s=r.nextPart.get(n),o=s?ZC(e.slice(1),s):void 0;if(o)return o;if(r.validators.length===0)return;const u=e.join(Fg);return(f=r.validators.find(({validator:l})=>l(u)))==null?void 0:f.classGroupId},tS=/^\[(.+)\]$/,FD=e=>{if(tS.test(e)){const r=tS.exec(e)[1],n=r==null?void 0:r.substring(0,r.indexOf(":"));if(n)return"arbitrary.."+n}},HD=e=>{const{theme:r,prefix:n}=e,s={nextPart:new Map,validators:[]};return qD(Object.entries(e.classGroups),n).forEach(([u,f])=>{Gm(f,s,u,r)}),s},Gm=(e,r,n,s)=>{e.forEach(o=>{if(typeof o=="string"){const u=o===""?r:rS(r,o);u.classGroupId=n;return}if(typeof o=="function"){if(VD(o)){Gm(o(s),r,n,s);return}r.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([u,f])=>{Gm(f,rS(r,u),n,s)})})},rS=(e,r)=>{let n=e;return r.split(Fg).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},VD=e=>e.isThemeGetter,qD=(e,r)=>r?e.map(([n,s])=>{const o=s.map(u=>typeof u=="string"?r+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([f,l])=>[r+f,l])):u);return[n,o]}):e,GD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,n=new Map,s=new Map;const o=(u,f)=>{n.set(u,f),r++,r>e&&(r=0,s=n,n=new Map)};return{get(u){let f=n.get(u);if(f!==void 0)return f;if((f=s.get(u))!==void 0)return o(u,f),f},set(u,f){n.has(u)?n.set(u,f):o(u,f)}}},XC="!",zD=e=>{const{separator:r,experimentalParseClassName:n}=e,s=r.length===1,o=r[0],u=r.length,f=l=>{const c=[];let h=0,m=0,p;for(let v=0;v<l.length;v++){let S=l[v];if(h===0){if(S===o&&(s||l.slice(v,v+u)===r)){c.push(l.slice(m,v)),m=v+u;continue}if(S==="/"){p=v;continue}}S==="["?h++:S==="]"&&h--}const _=c.length===0?l:l.substring(m),E=_.startsWith(XC),A=E?_.substring(1):_,w=p&&p>m?p-m:void 0;return{modifiers:c,hasImportantModifier:E,baseClassName:A,maybePostfixModifierPosition:w}};return n?l=>n({className:l,parseClassName:f}):f},YD=e=>{if(e.length<=1)return e;const r=[];let n=[];return e.forEach(s=>{s[0]==="["?(r.push(...n.sort(),s),n=[]):n.push(s)}),r.push(...n.sort()),r},WD=e=>({cache:GD(e.cacheSize),parseClassName:zD(e),...UD(e)}),KD=/\s+/,QD=(e,r)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o}=r,u=[],f=e.trim().split(KD);let l="";for(let c=f.length-1;c>=0;c-=1){const h=f[c],{modifiers:m,hasImportantModifier:p,baseClassName:_,maybePostfixModifierPosition:E}=n(h);let A=!!E,w=s(A?_.substring(0,E):_);if(!w){if(!A){l=h+(l.length>0?" "+l:l);continue}if(w=s(_),!w){l=h+(l.length>0?" "+l:l);continue}A=!1}const v=YD(m).join(":"),S=p?v+XC:v,g=S+w;if(u.includes(g))continue;u.push(g);const y=o(w,A);for(let T=0;T<y.length;++T){const M=y[T];u.push(S+M)}l=h+(l.length>0?" "+l:l)}return l};function $D(){let e=0,r,n,s="";for(;e<arguments.length;)(r=arguments[e++])&&(n=eb(r))&&(s&&(s+=" "),s+=n);return s}const eb=e=>{if(typeof e=="string")return e;let r,n="";for(let s=0;s<e.length;s++)e[s]&&(r=eb(e[s]))&&(n&&(n+=" "),n+=r);return n};function JD(e,...r){let n,s,o,u=f;function f(c){const h=r.reduce((m,p)=>p(m),e());return n=WD(h),s=n.cache.get,o=n.cache.set,u=l,l(c)}function l(c){const h=s(c);if(h)return h;const m=QD(c,n);return o(c,m),m}return function(){return u($D.apply(null,arguments))}}const xt=e=>{const r=n=>n[e]||[];return r.isThemeGetter=!0,r},tb=/^\[(?:([a-z-]+):)?(.+)\]$/i,ZD=/^\d+\/\d+$/,XD=new Set(["px","full","screen"]),e2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t2=/\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$/,r2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,n2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,i2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gi=e=>la(e)||XD.has(e)||ZD.test(e),as=e=>Ca(e,"length",h2),la=e=>!!e&&!Number.isNaN(Number(e)),cm=e=>Ca(e,"number",la),Ul=e=>!!e&&Number.isInteger(Number(e)),s2=e=>e.endsWith("%")&&la(e.slice(0,-1)),Ye=e=>tb.test(e),ls=e=>e2.test(e),o2=new Set(["length","size","percentage"]),a2=e=>Ca(e,o2,rb),l2=e=>Ca(e,"position",rb),c2=new Set(["image","url"]),u2=e=>Ca(e,c2,p2),d2=e=>Ca(e,"",f2),Fl=()=>!0,Ca=(e,r,n)=>{const s=tb.exec(e);return s?s[1]?typeof r=="string"?s[1]===r:r.has(s[1]):n(s[2]):!1},h2=e=>t2.test(e)&&!r2.test(e),rb=()=>!1,f2=e=>n2.test(e),p2=e=>i2.test(e),m2=()=>{const e=xt("colors"),r=xt("spacing"),n=xt("blur"),s=xt("brightness"),o=xt("borderColor"),u=xt("borderRadius"),f=xt("borderSpacing"),l=xt("borderWidth"),c=xt("contrast"),h=xt("grayscale"),m=xt("hueRotate"),p=xt("invert"),_=xt("gap"),E=xt("gradientColorStops"),A=xt("gradientColorStopPositions"),w=xt("inset"),v=xt("margin"),S=xt("opacity"),g=xt("padding"),y=xt("saturate"),T=xt("scale"),M=xt("sepia"),k=xt("skew"),L=xt("space"),D=xt("translate"),j=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",Ye,r],H=()=>[Ye,r],U=()=>["",gi,as],$=()=>["auto",la,Ye],te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",Ye],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[la,Ye];return{cacheSize:500,separator:":",theme:{colors:[Fl],spacing:[gi,as],blur:["none","",ls,Ye],brightness:P(),borderColor:[e],borderRadius:["none","","full",ls,Ye],borderSpacing:H(),borderWidth:U(),contrast:P(),grayscale:I(),hueRotate:P(),invert:I(),gap:H(),gradientColorStops:[e],gradientColorStopPositions:[s2,as],inset:Q(),margin:Q(),opacity:P(),padding:H(),saturate:P(),scale:P(),sepia:I(),skew:P(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[ls]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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"],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:[...te(),Ye]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ul,Ye]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Ul,Ye]}],"grid-cols":[{"grid-cols":[Fl]}],"col-start-end":[{col:["auto",{span:["full",Ul,Ye]},Ye]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Fl]}],"row-start-end":[{row:["auto",{span:[Ul,Ye]},Ye]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[_]}],"gap-x":[{"gap-x":[_]}],"gap-y":[{"gap-y":[_]}],"justify-content":[{justify:["normal",...ee()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ee(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ee(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,r]}],"min-w":[{"min-w":[Ye,r,"min","max","fit"]}],"max-w":[{"max-w":[Ye,r,"none","full","min","max","fit","prose",{screen:[ls]},ls]}],h:[{h:[Ye,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,r,"auto","min","max","fit"]}],"font-size":[{text:["base",ls,as]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",cm]}],"font-family":[{font:[Fl]}],"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:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",la,cm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gi,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",gi,as]}],"underline-offset":[{"underline-offset":["auto",gi,Ye]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...te(),l2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",a2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},u2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[A]}],"gradient-via-pos":[{via:[A]}],"gradient-to-pos":[{to:[A]}],"gradient-from":[{from:[E]}],"gradient-via":[{via:[E]}],"gradient-to":[{to:[E]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:Y()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[gi,Ye]}],"outline-w":[{outline:[gi,as]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[gi,as]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ls,d2]}],"shadow-color":[{shadow:[Fl]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...ie(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ie()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ls,Ye]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[y]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ye]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Ul,Ye]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[gi,as,cm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},g2=JD(m2);function Te(...e){return g2(JC(e))}function um(e){if(!e||typeof e!="object")return null;const r=e;if(typeof r.tunnel_id!="string"||typeof r.url!="string"||typeof r.key!="string")return null;const n=r.tunnel_id.trim(),s=r.url.trim(),o=r.key.trim();if(!n||!s||!o||!/^[a-zA-Z0-9-_]+$/.test(n))return null;let u=s;try{const f=new URL(s);if(f.protocol==="http:")u="ws:"+s.slice(5);else if(f.protocol==="https:")u="wss:"+s.slice(6);else if(f.protocol!=="ws:"&&f.protocol!=="wss:")return null}catch{return null}return o.length<1?null:{tunnelId:n,url:u,key:o}}function v2(e){if(!e||typeof e!="string")return null;const r=e.trim();if(!r)return null;try{if(r.startsWith("{")){const o=JSON.parse(r);return um(o)}const n="tiflis://connect?data=",s=r.toLowerCase();if(s.startsWith(n)){const o=s.indexOf("data=");if(o===-1)return null;let u=r.slice(o+5).trim();try{u=decodeURIComponent(u)}catch{}if(!u||!/^[A-Za-z0-9+/=_-]+$/.test(u))return null;const f=u.replace(/-/g,"+").replace(/_/g,"/"),l=JSON.parse(atob(f));return um(l)}try{const o=new URL(r);if(o.protocol==="tiflis:"){const u=o.searchParams.get("data");if(u&&/^[A-Za-z0-9+/=]+$/.test(u)){const f=JSON.parse(atob(u));return um(f)}}}catch{}return null}catch{return null}}const Hg=Ug("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ct=R.forwardRef(({className:e,variant:r,size:n,asChild:s=!1,...o},u)=>{const f=s?OD:"button";return b.jsx(f,{className:Te(Hg({variant:r,size:n,className:e})),ref:u,...o})});ct.displayName="Button";const nb=R.forwardRef(({className:e,type:r,...n},s)=>b.jsx("input",{type:r,className:Te("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...n}));nb.displayName="Input";const hs=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("rounded-lg border bg-card text-card-foreground shadow-sm",e),...r}));hs.displayName="Card";const fs=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...r}));fs.displayName="CardHeader";const ps=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("text-2xl font-semibold leading-none tracking-tight",e),...r}));ps.displayName="CardTitle";const Xs=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("text-sm text-muted-foreground",e),...r}));Xs.displayName="CardDescription";const ms=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...r}));ms.displayName="CardContent";const _2=R.forwardRef(({className:e,...r},n)=>b.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...r}));_2.displayName="CardFooter";var ib=e=>{throw TypeError(e)},sb=(e,r,n)=>r.has(e)||ib("Cannot "+n),y2=(e,r,n)=>(sb(e,r,"read from private field"),n?n.call(e):r.get(e)),S2=(e,r,n)=>r.has(e)?ib("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,n),C2=(e,r,n,s)=>(sb(e,r,"write to private field"),r.set(e,n),n);const fh=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],ph=fh.map(([e])=>e),b2=ph.filter((e,r)=>fh[r][1]==="L"),w2=ph.filter((e,r)=>fh[r][1]==="M");function zm(e){switch(e){case"Linear-Codes":return b2.reduce((r,n)=>r|zm(n),0);case"Matrix-Codes":return w2.reduce((r,n)=>r|zm(n),0);case"Any":return(1<<fh.length)-1;case"None":return 0;default:return 1<<ph.indexOf(e)}}function E2(e){if(e===0)return"None";const r=31-Math.clz32(e);return ph[r]}function x2(e){return e.reduce((r,n)=>r|zm(n),0)}const A2=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function T2(e){return A2.indexOf(e)}const nS=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function R2(e){return e==="UnicodeBig"?nS.indexOf("UTF16BE"):nS.indexOf(e)}const D2=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function M2(e){return D2[e]}const k2=["Ignore","Read","Require"];function L2(e){return k2.indexOf(e)}const O2=["Plain","ECI","HRI","Hex","Escaped"];function B2(e){return O2.indexOf(e)}const Gd={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function iS(e){return{...e,formats:x2(e.formats),binarizer:T2(e.binarizer),eanAddOnSymbol:L2(e.eanAddOnSymbol),textMode:B2(e.textMode),characterSet:R2(e.characterSet)}}function N2(e){return{...e,format:E2(e.format),contentType:M2(e.contentType),eccLevel:e.ecLevel}}const I2={locateFile:(e,r)=>{const n=e.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.4/dist/${n[1]}/${e}`:r+e}},dm=new WeakMap;function P2(e,r){return Object.is(e,r)||Object.keys(e).length===Object.keys(r).length&&Object.keys(e).every(n=>Object.hasOwn(r,n)&&e[n]===r[n])}function ob(e,{overrides:r,equalityFn:n=P2,fireImmediately:s=!1}={}){var o;const[u,f]=(o=dm.get(e))!=null?o:[I2],l=r??u;let c;if(s){if(f&&(c=n(u,l)))return f;const h=e({...l});return dm.set(e,[l,h]),h}(c??n(u,l))||dm.set(e,[l])}async function j2(e,r,n=Gd){const s={...Gd,...n},o=await ob(e,{fireImmediately:!0});let u,f;if("width"in r&&"height"in r&&"data"in r){const{data:c,data:{byteLength:h},width:m,height:p}=r;f=o._malloc(h),o.HEAPU8.set(c,f),u=o.readBarcodesFromPixmap(f,m,p,iS(s))}else{let c,h;if("buffer"in r)[c,h]=[r.byteLength,r];else if("byteLength"in r)[c,h]=[r.byteLength,new Uint8Array(r)];else if("size"in r)[c,h]=[r.size,new Uint8Array(await r.arrayBuffer())];else throw new TypeError("Invalid input type");f=o._malloc(c),o.HEAPU8.set(h,f),u=o.readBarcodesFromImage(f,c,iS(s))}o._free(f);const l=[];for(let c=0;c<u.size();++c)l.push(N2(u.get(c)));return l}({...Gd,formats:[...Gd.formats]});async function ab(e={}){var r,n,s,o=e,u=!!globalThis.window,f=typeof Bun<"u",l=!!globalThis.WorkerGlobalScope;!((n=globalThis.process)===null||n===void 0||(n=n.versions)===null||n===void 0)&&n.node&&((s=globalThis.process)===null||s===void 0?void 0:s.type)!="renderer";var c="./this.program",h,m="";function p(B){return o.locateFile?o.locateFile(B,m):m+B}var _,E;if(u||l||f){try{m=new URL(".",h).href}catch{}l&&(E=B=>{var N=new XMLHttpRequest;return N.open("GET",B,!1),N.responseType="arraybuffer",N.send(null),new Uint8Array(N.response)}),_=async B=>{var N=await fetch(B,{credentials:"same-origin"});if(N.ok)return N.arrayBuffer();throw new Error(N.status+" : "+N.url)}}var A=console.log.bind(console),w=console.error.bind(console),v,S=!1,g,y,T,M,k,L,D,j,K,Q,H=!1;function U(){var B=Os.buffer;T=new Int8Array(B),k=new Int16Array(B),o.HEAPU8=M=new Uint8Array(B),L=new Uint16Array(B),D=new Int32Array(B),j=new Uint32Array(B),K=new Float32Array(B),Q=new Float64Array(B)}function $(){if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)oe(o.preRun.shift());fe(ue)}function te(){H=!0,ei.xa()}function Y(){if(o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;)F(o.postRun.shift());fe(W)}function ie(B){var N,q;(N=o.onAbort)===null||N===void 0||N.call(o,B),B="Aborted("+B+")",w(B),S=!0,B+=". Build with -sASSERTIONS for more info.";var Z=new WebAssembly.RuntimeError(B);throw(q=y)===null||q===void 0||q(Z),Z}var ee;function I(){return p("zxing_reader.wasm")}function z(B){if(B==ee&&v)return new Uint8Array(v);if(E)return E(B);throw"both async and sync fetching of the wasm failed"}async function P(B){if(!v)try{var N=await _(B);return new Uint8Array(N)}catch{}return z(B)}async function G(B,N){try{var q=await P(B),Z=await WebAssembly.instantiate(q,N);return Z}catch(se){w(`failed to asynchronously prepare wasm: ${se}`),ie(se)}}async function ne(B,N,q){if(!B&&WebAssembly.instantiateStreaming)try{var Z=fetch(N,{credentials:"same-origin"}),se=await WebAssembly.instantiateStreaming(Z,q);return se}catch(le){w(`wasm streaming compile failed: ${le}`),w("falling back to ArrayBuffer instantiation")}return G(N,q)}function X(){var B={a:Ni};return B}async function Ce(){function B(le,ge){return ei=le.exports,Xc(ei),U(),ei}function N(le){return B(le.instance)}var q=X();if(o.instantiateWasm)return new Promise((le,ge)=>{o.instantiateWasm(q,(ye,xe)=>{le(B(ye))})});ee!=null||(ee=I());var Z=await ne(v,ee,q),se=N(Z);return se}var fe=B=>{for(;B.length>0;)B.shift()(o)},W=[],F=B=>W.push(B),ue=[],oe=B=>ue.push(B),de=B=>$c(B),he=()=>Jc(),De=[],Ie=0,Fe=B=>{var N=new Mt(B);return N.get_caught()||(N.set_caught(!0),Ie--),N.set_rethrown(!1),De.push(N),Bi(B),Kc(B)},je=0,Oe=()=>{Ke(0,0);var B=De.pop();Mo(B.excPtr),je=0};class Mt{constructor(N){this.excPtr=N,this.ptr=N-24}set_type(N){j[this.ptr+4>>2]=N}get_type(){return j[this.ptr+4>>2]}set_destructor(N){j[this.ptr+8>>2]=N}get_destructor(){return j[this.ptr+8>>2]}set_caught(N){N=N?1:0,T[this.ptr+12]=N}get_caught(){return T[this.ptr+12]!=0}set_rethrown(N){N=N?1:0,T[this.ptr+13]=N}get_rethrown(){return T[this.ptr+13]!=0}init(N,q){this.set_adjusted_ptr(0),this.set_type(N),this.set_destructor(q)}set_adjusted_ptr(N){j[this.ptr+16>>2]=N}get_adjusted_ptr(){return j[this.ptr+16>>2]}}var At=B=>Qc(B),Ht=B=>{var N=je;if(!N)return At(0),0;var q=new Mt(N);q.set_adjusted_ptr(N);var Z=q.get_type();if(!Z)return At(0),N;for(var se of B){if(se===0||se===Z)break;var le=q.ptr+16;if(Zc(se,Z,le))return At(se),N}return At(Z),N},Tt=()=>Ht([]),Cn=B=>Ht([B]),Zt=(B,N)=>Ht([B,N]),kt=()=>{var B=De.pop();B||ie("no exception to throw");var N=B.excPtr;throw B.get_rethrown()||(De.push(B),B.set_rethrown(!0),B.set_caught(!1),Ie++),je=N,je},ar=(B,N,q)=>{var Z=new Mt(B);throw Z.init(N,q),je=B,Ie++,je},Yr=()=>Ie,bn=B=>{throw je||(je=B),je},pr=()=>ie(""),un={},mr=B=>{for(;B.length;){var N=B.pop(),q=B.pop();q(N)}};function Or(B){return this.fromWireType(j[B>>2])}var ot={},gr={},Xt={},wn=class extends Error{constructor(B){super(B),this.name="InternalError"}},er=B=>{throw new wn(B)},Yn=(B,N,q)=>{B.forEach(ye=>Xt[ye]=N);function Z(ye){var xe=q(ye);xe.length!==B.length&&er("Mismatched type converter count");for(var Re=0;Re<B.length;++Re)vr(B[Re],xe[Re])}var se=new Array(N.length),le=[],ge=0;{const ye=N;for(let xe=0;xe<ye.length;++xe){const Re=ye[xe];gr.hasOwnProperty(Re)?se[xe]=gr[Re]:(le.push(Re),ot.hasOwnProperty(Re)||(ot[Re]=[]),ot[Re].push(()=>{se[xe]=gr[Re],++ge,ge===le.length&&Z(se)}))}}le.length===0&&Z(se)},Ph=B=>{var N=un[B];delete un[B];var q=N.rawConstructor,Z=N.rawDestructor,se=N.fields,le=se.map(ge=>ge.getterReturnType).concat(se.map(ge=>ge.setterArgumentType));Yn([B],le,ge=>{var ye={};{const xe=se;for(let Re=0;Re<xe.length;++Re){const Me=xe[Re],Ne=ge[Re],it=Me.getter,Qe=Me.getterContext,gt=ge[Re+se.length],Ct=Me.setter,ft=Me.setterContext;ye[Me.fieldName]={read:ut=>Ne.fromWireType(it(Qe,ut)),write:(ut,pn)=>{var Ot=[];Ct(ft,ut,gt.toWireType(Ot,pn)),mr(Ot)},optional:Ne.optional}}}return[{name:N.name,fromWireType:xe=>{var Re={};for(var Me in ye)Re[Me]=ye[Me].read(xe);return Z(xe),Re},toWireType:(xe,Re)=>{for(var Me in ye)if(!(Me in Re)&&!ye[Me].optional)throw new TypeError(`Missing field: "${Me}"`);var Ne=q();for(Me in ye)ye[Me].write(Ne,Re[Me]);return xe!==null&&xe.push(Z,Ne),Ne},readValueFromPointer:Or,destructorFunction:Z}]})},jh=(B,N,q,Z,se)=>{},Vt=B=>{for(var N="";;){var q=M[B++];if(!q)return N;N+=String.fromCharCode(q)}},En=class extends Error{constructor(B){super(B),this.name="BindingError"}},rt=B=>{throw new En(B)};function Wn(B,N){let q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var Z=N.name;if(B||rt(`type "${Z}" must have a positive integer typeid pointer`),gr.hasOwnProperty(B)){if(q.ignoreDuplicateRegistrations)return;rt(`Cannot register type '${Z}' twice`)}if(gr[B]=N,delete Xt[B],ot.hasOwnProperty(B)){var se=ot[B];delete ot[B],se.forEach(le=>le())}}function vr(B,N){let q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Wn(B,N,q)}var bs=(B,N,q,Z)=>{N=Vt(N),vr(B,{name:N,fromWireType:function(se){return!!se},toWireType:function(se,le){return le?q:Z},readValueFromPointer:function(se){return this.fromWireType(M[se])},destructorFunction:null})},Uh=B=>({count:B.count,deleteScheduled:B.deleteScheduled,preservePointerOnDelete:B.preservePointerOnDelete,ptr:B.ptr,ptrType:B.ptrType,smartPtr:B.smartPtr,smartPtrType:B.smartPtrType}),po=B=>{function N(q){return q.$$.ptrType.registeredClass.name}rt(N(B)+" instance already deleted")},ws=!1,Ti=B=>{},Fh=B=>{B.smartPtr?B.smartPtrType.rawDestructor(B.smartPtr):B.ptrType.registeredClass.rawDestructor(B.ptr)},Ra=B=>{B.count.value-=1;var N=B.count.value===0;N&&Fh(B)},Ri=B=>globalThis.FinalizationRegistry?(ws=new FinalizationRegistry(N=>{Ra(N.$$)}),Ri=N=>{var q=N.$$,Z=!!q.smartPtr;if(Z){var se={$$:q};ws.register(N,se,N)}return N},Ti=N=>ws.unregister(N),Ri(B)):(Ri=N=>N,B),Nc=()=>{let B=Di.prototype;Object.assign(B,{isAliasOf(q){if(!(this instanceof Di)||!(q instanceof Di))return!1;var Z=this.$$.ptrType.registeredClass,se=this.$$.ptr;q.$$=q.$$;for(var le=q.$$.ptrType.registeredClass,ge=q.$$.ptr;Z.baseClass;)se=Z.upcast(se),Z=Z.baseClass;for(;le.baseClass;)ge=le.upcast(ge),le=le.baseClass;return Z===le&&se===ge},clone(){if(this.$$.ptr||po(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var q=Ri(Object.create(Object.getPrototypeOf(this),{$$:{value:Uh(this.$$)}}));return q.$$.count.value+=1,q.$$.deleteScheduled=!1,q},delete(){this.$$.ptr||po(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&rt("Object already scheduled for deletion"),Ti(this),Ra(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||po(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&rt("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const N=Symbol.dispose;N&&(B[N]=B.delete)};function Di(){}var Es=(B,N)=>Object.defineProperty(N,"name",{value:B}),Da={},Ma=(B,N,q)=>{if(B[N].overloadTable===void 0){var Z=B[N];B[N]=function(){for(var se=arguments.length,le=new Array(se),ge=0;ge<se;ge++)le[ge]=arguments[ge];return B[N].overloadTable.hasOwnProperty(le.length)||rt(`Function '${q}' called with an invalid number of arguments (${le.length}) - expects one of (${B[N].overloadTable})!`),B[N].overloadTable[le.length].apply(this,le)},B[N].overloadTable=[],B[N].overloadTable[Z.argCount]=Z}},dn=(B,N,q)=>{o.hasOwnProperty(B)?((q===void 0||o[B].overloadTable!==void 0&&o[B].overloadTable[q]!==void 0)&&rt(`Cannot register public name '${B}' twice`),Ma(o,B,B),o[B].overloadTable.hasOwnProperty(q)&&rt(`Cannot register multiple overloads of a function with the same number of arguments (${q})!`),o[B].overloadTable[q]=N):(o[B]=N,o[B].argCount=q)},Kt=48,lr=57,Mi=B=>{B=B.replace(/[^a-zA-Z0-9_]/g,"$");var N=B.charCodeAt(0);return N>=Kt&&N<=lr?`_${B}`:B};function ka(B,N,q,Z,se,le,ge,ye){this.name=B,this.constructor=N,this.instancePrototype=q,this.rawDestructor=Z,this.baseClass=se,this.getActualType=le,this.upcast=ge,this.downcast=ye,this.pureVirtualFunctions=[]}var La=(B,N,q)=>{for(;N!==q;)N.upcast||rt(`Expected null or instance of ${q.name}, got an instance of ${N.name}`),B=N.upcast(B),N=N.baseClass;return B},Oa=B=>{if(B===null)return"null";var N=typeof B;return N==="object"||N==="array"||N==="function"?B.toString():""+B};function Ic(B,N){if(N===null)return this.isReference&&rt(`null is not a valid ${this.name}`),0;N.$$||rt(`Cannot pass "${Oa(N)}" as a ${this.name}`),N.$$.ptr||rt(`Cannot pass deleted object as a pointer of type ${this.name}`);var q=N.$$.ptrType.registeredClass,Z=La(N.$$.ptr,q,this.registeredClass);return Z}function xs(B,N){var q;if(N===null)return this.isReference&&rt(`null is not a valid ${this.name}`),this.isSmartPointer?(q=this.rawConstructor(),B!==null&&B.push(this.rawDestructor,q),q):0;(!N||!N.$$)&&rt(`Cannot pass "${Oa(N)}" as a ${this.name}`),N.$$.ptr||rt(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&N.$$.ptrType.isConst&&rt(`Cannot convert argument of type ${N.$$.smartPtrType?N.$$.smartPtrType.name:N.$$.ptrType.name} to parameter type ${this.name}`);var Z=N.$$.ptrType.registeredClass;if(q=La(N.$$.ptr,Z,this.registeredClass),this.isSmartPointer)switch(N.$$.smartPtr===void 0&&rt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:N.$$.smartPtrType===this?q=N.$$.smartPtr:rt(`Cannot convert argument of type ${N.$$.smartPtrType?N.$$.smartPtrType.name:N.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:q=N.$$.smartPtr;break;case 2:if(N.$$.smartPtrType===this)q=N.$$.smartPtr;else{var se=N.clone();q=this.rawShare(q,Br.toHandle(()=>se.delete())),B!==null&&B.push(this.rawDestructor,q)}break;default:rt("Unsupporting sharing policy")}return q}function Ba(B,N){if(N===null)return this.isReference&&rt(`null is not a valid ${this.name}`),0;N.$$||rt(`Cannot pass "${Oa(N)}" as a ${this.name}`),N.$$.ptr||rt(`Cannot pass deleted object as a pointer of type ${this.name}`),N.$$.ptrType.isConst&&rt(`Cannot convert argument of type ${N.$$.ptrType.name} to parameter type ${this.name}`);var q=N.$$.ptrType.registeredClass,Z=La(N.$$.ptr,q,this.registeredClass);return Z}var Kn=(B,N,q)=>{if(N===q)return B;if(q.baseClass===void 0)return null;var Z=Kn(B,N,q.baseClass);return Z===null?null:q.downcast(Z)},ki={},As=(B,N)=>{for(N===void 0&&rt("ptr should not be undefined");B.baseClass;)N=B.upcast(N),B=B.baseClass;return N},Li=(B,N)=>(N=As(B,N),ki[N]),Lt=(B,N)=>{(!N.ptrType||!N.ptr)&&er("makeClassHandle requires ptr and ptrType");var q=!!N.smartPtrType,Z=!!N.smartPtr;return q!==Z&&er("Both smartPtrType and smartPtr must be specified"),N.count={value:1},Ri(Object.create(B,{$$:{value:N,writable:!0}}))};function Pc(B){var N=this.getPointee(B);if(!N)return this.destructor(B),null;var q=Li(this.registeredClass,N);if(q!==void 0){if(q.$$.count.value===0)return q.$$.ptr=N,q.$$.smartPtr=B,q.clone();var Z=q.clone();return this.destructor(B),Z}function se(){return this.isSmartPointer?Lt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:N,smartPtrType:this,smartPtr:B}):Lt(this.registeredClass.instancePrototype,{ptrType:this,ptr:B})}var le=this.registeredClass.getActualType(N),ge=Da[le];if(!ge)return se.call(this);var ye;this.isConst?ye=ge.constPointerType:ye=ge.pointerType;var xe=Kn(N,this.registeredClass,ye.registeredClass);return xe===null?se.call(this):this.isSmartPointer?Lt(ye.registeredClass.instancePrototype,{ptrType:ye,ptr:xe,smartPtrType:this,smartPtr:B}):Lt(ye.registeredClass.instancePrototype,{ptrType:ye,ptr:xe})}var jc=()=>{Object.assign(Wr.prototype,{getPointee(B){return this.rawGetPointee&&(B=this.rawGetPointee(B)),B},destructor(B){var N;(N=this.rawDestructor)===null||N===void 0||N.call(this,B)},readValueFromPointer:Or,fromWireType:Pc})};function Wr(B,N,q,Z,se,le,ge,ye,xe,Re,Me){this.name=B,this.registeredClass=N,this.isReference=q,this.isConst=Z,this.isSmartPointer=se,this.pointeeType=le,this.sharingPolicy=ge,this.rawGetPointee=ye,this.rawConstructor=xe,this.rawShare=Re,this.rawDestructor=Me,!se&&N.baseClass===void 0?Z?(this.toWireType=Ic,this.destructorFunction=null):(this.toWireType=Ba,this.destructorFunction=null):this.toWireType=xs}var Qn=(B,N,q)=>{o.hasOwnProperty(B)||er("Replacing nonexistent public symbol"),o[B].overloadTable!==void 0&&q!==void 0?o[B].overloadTable[q]=N:(o[B]=N,o[B].argCount=q)},xn={},Uc=(B,N,q)=>{B=B.replace(/p/g,"i");var Z=xn[B];return Z(N,...q)},Na=[],Je=B=>{var N=Na[B];return N||(Na[B]=N=Za.get(B)),N},mo=function(B,N){let q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(B.includes("j"))return Uc(B,N,q);var Z=Je(N),se=Z(...q);return se},go=function(B,N){let q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var Z=arguments.length,se=new Array(Z),le=0;le<Z;le++)se[le]=arguments[le];return mo(B,N,se,q)}},jt=function(B,N){B=Vt(B);function q(){if(B.includes("j"))return go(B,N);var se=Je(N);return se}var Z=q();return typeof Z!="function"&&rt(`unknown function pointer with signature ${B}: ${N}`),Z};class br extends Error{}var Ia=B=>{var N=Wc(B),q=Vt(N);return Tn(N),q},vo=(B,N)=>{var q=[],Z={};function se(le){if(!Z[le]&&!gr[le]){if(Xt[le]){Xt[le].forEach(se);return}q.push(le),Z[le]=!0}}throw N.forEach(se),new br(`${B}: `+q.map(Ia).join([", "]))},Pa=(B,N,q,Z,se,le,ge,ye,xe,Re,Me,Ne,it)=>{Me=Vt(Me),le=jt(se,le),ye&&(ye=jt(ge,ye)),Re&&(Re=jt(xe,Re)),it=jt(Ne,it);var Qe=Mi(Me);dn(Qe,function(){vo(`Cannot construct ${Me} due to unbound types`,[Z])}),Yn([B,N,q],Z?[Z]:[],gt=>{gt=gt[0];var Ct,ft;Z?(Ct=gt.registeredClass,ft=Ct.instancePrototype):ft=Di.prototype;var ut=Es(Me,function(){if(Object.getPrototypeOf(this)!==pn)throw new En(`Use 'new' to construct ${Me}`);if(Ot.constructor_body===void 0)throw new En(`${Me} has no accessible constructor`);for(var Lo=arguments.length,xr=new Array(Lo),js=0;js<Lo;js++)xr[js]=arguments[js];var Us=Ot.constructor_body[xr.length];if(Us===void 0)throw new En(`Tried to invoke ctor of ${Me} with invalid number of parameters (${xr.length}) - expected (${Object.keys(Ot.constructor_body).toString()}) parameters instead!`);return Us.apply(this,xr)}),pn=Object.create(ft,{constructor:{value:ut}});ut.prototype=pn;var Ot=new ka(Me,ut,pn,it,Ct,le,ye,Re);if(Ot.baseClass){var Kr,ti;(ti=(Kr=Ot.baseClass).__derivedClasses)!==null&&ti!==void 0||(Kr.__derivedClasses=[]),Ot.baseClass.__derivedClasses.push(Ot)}var ji=new Wr(Me,Ot,!0,!1,!1),hu=new Wr(Me+"*",Ot,!1,!1,!1),ur=new Wr(Me+" const*",Ot,!1,!0,!1);return Da[B]={pointerType:hu,constPointerType:ur},Qn(Qe,ut),[ji,hu,ur]})},_o=(B,N)=>{for(var q=[],Z=0;Z<B;Z++)q.push(j[N+Z*4>>2]);return q};function yo(B){for(var N=1;N<B.length;++N)if(B[N]!==null&&B[N].destructorFunction===void 0)return!0;return!1}function ja(B,N,q,Z,se,le){var ge=N.length;ge<2&&rt("argTypes array size mismatch! Must at least get return value and 'this' types!");var ye=N[1]!==null&&q!==null,xe=yo(N),Re=!N[0].isVoid,Me=ge-2,Ne=new Array(Me),it=[],Qe=[],gt=function(){Qe.length=0;var Ct;it.length=ye?2:1,it[0]=se,ye&&(Ct=N[1].toWireType(Qe,this),it[1]=Ct);for(var ft=0;ft<Me;++ft)Ne[ft]=N[ft+2].toWireType(Qe,ft<0||arguments.length<=ft?void 0:arguments[ft]),it.push(Ne[ft]);var ut=Z(...it);function pn(Ot){if(xe)mr(Qe);else for(var Kr=ye?1:2;Kr<N.length;Kr++){var ti=Kr===1?Ct:Ne[Kr-2];N[Kr].destructorFunction!==null&&N[Kr].destructorFunction(ti)}if(Re)return N[0].fromWireType(Ot)}return pn(ut)};return Es(B,gt)}var wr=(B,N,q,Z,se,le)=>{var ge=_o(N,q);se=jt(Z,se),Yn([],[B],ye=>{ye=ye[0];var xe=`constructor ${ye.name}`;if(ye.registeredClass.constructor_body===void 0&&(ye.registeredClass.constructor_body=[]),ye.registeredClass.constructor_body[N-1]!==void 0)throw new En(`Cannot register multiple constructors with identical number of parameters (${N-1}) for class '${ye.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return ye.registeredClass.constructor_body[N-1]=()=>{vo(`Cannot construct ${ye.name} due to unbound types`,ge)},Yn([],ge,Re=>(Re.splice(1,0,null),ye.registeredClass.constructor_body[N-1]=ja(xe,Re,null,se,le),[])),[]})},So=B=>{B=B.trim();const N=B.indexOf("(");return N===-1?B:B.slice(0,N)},Fc=(B,N,q,Z,se,le,ge,ye,xe,Re)=>{var Me=_o(q,Z);N=Vt(N),N=So(N),le=jt(se,le),Yn([],[B],Ne=>{Ne=Ne[0];var it=`${Ne.name}.${N}`;N.startsWith("@@")&&(N=Symbol[N.substring(2)]),ye&&Ne.registeredClass.pureVirtualFunctions.push(N);function Qe(){vo(`Cannot call ${it} due to unbound types`,Me)}var gt=Ne.registeredClass.instancePrototype,Ct=gt[N];return Ct===void 0||Ct.overloadTable===void 0&&Ct.className!==Ne.name&&Ct.argCount===q-2?(Qe.argCount=q-2,Qe.className=Ne.name,gt[N]=Qe):(Ma(gt,N,it),gt[N].overloadTable[q-2]=Qe),Yn([],Me,ft=>{var ut=ja(it,ft,Ne,le,ge);return gt[N].overloadTable===void 0?(ut.argCount=q-2,gt[N]=ut):gt[N].overloadTable[q-2]=ut,[]}),[]})},Co=[],Er=[0,1,,1,null,1,!0,1,!1,1],bo=B=>{B>9&&--Er[B+1]===0&&(Er[B]=void 0,Co.push(B))},Br={toValue:B=>(B||rt(`Cannot use deleted val. handle = ${B}`),Er[B]),toHandle:B=>{switch(B){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const N=Co.pop()||Er.length;return Er[N]=B,Er[N+1]=1,N}}}},$n={name:"emscripten::val",fromWireType:B=>{var N=Br.toValue(B);return bo(B),N},toWireType:(B,N)=>Br.toHandle(N),readValueFromPointer:Or,destructorFunction:null},Hh=B=>vr(B,$n),Hc=(B,N)=>{switch(N){case 4:return function(q){return this.fromWireType(K[q>>2])};case 8:return function(q){return this.fromWireType(Q[q>>3])};default:throw new TypeError(`invalid float width (${N}): ${B}`)}},Vc=(B,N,q)=>{N=Vt(N),vr(B,{name:N,fromWireType:Z=>Z,toWireType:(Z,se)=>se,readValueFromPointer:Hc(N,q),destructorFunction:null})},Ua=(B,N,q,Z,se,le,ge,ye)=>{var xe=_o(N,q);B=Vt(B),B=So(B),se=jt(Z,se),dn(B,function(){vo(`Cannot call ${B} due to unbound types`,xe)},N-1),Yn([],xe,Re=>{var Me=[Re[0],null].concat(Re.slice(1));return Qn(B,ja(B,Me,null,se,le),N-1),[]})},Vh=(B,N,q)=>{switch(N){case 1:return q?Z=>T[Z]:Z=>M[Z];case 2:return q?Z=>k[Z>>1]:Z=>L[Z>>1];case 4:return q?Z=>D[Z>>2]:Z=>j[Z>>2];default:throw new TypeError(`invalid integer width (${N}): ${B}`)}},qh=(B,N,q,Z,se)=>{N=Vt(N);const le=Z===0;let ge=xe=>xe;if(le){var ye=32-8*q;ge=xe=>xe<<ye>>>ye,se=ge(se)}vr(B,{name:N,fromWireType:ge,toWireType:(xe,Re)=>Re,readValueFromPointer:Vh(N,q,Z!==0),destructorFunction:null})},wo=(B,N,q)=>{var Z=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],se=Z[N];function le(ge){var ye=j[ge>>2],xe=j[ge+4>>2];return new se(T.buffer,xe,ye)}q=Vt(q),vr(B,{name:q,fromWireType:le,readValueFromPointer:le},{ignoreDuplicateRegistrations:!0})},hn=Object.assign({optional:!0},$n),Fa=(B,N)=>{vr(B,hn)},Ha=(B,N,q,Z)=>{if(!(Z>0))return 0;for(var se=q,le=q+Z-1,ge=0;ge<B.length;++ge){var ye=B.codePointAt(ge);if(ye<=127){if(q>=le)break;N[q++]=ye}else if(ye<=2047){if(q+1>=le)break;N[q++]=192|ye>>6,N[q++]=128|ye&63}else if(ye<=65535){if(q+2>=le)break;N[q++]=224|ye>>12,N[q++]=128|ye>>6&63,N[q++]=128|ye&63}else{if(q+3>=le)break;N[q++]=240|ye>>18,N[q++]=128|ye>>12&63,N[q++]=128|ye>>6&63,N[q++]=128|ye&63,ge++}}return N[q]=0,q-se},Nr=(B,N,q)=>Ha(B,M,N,q),Jn=B=>{for(var N=0,q=0;q<B.length;++q){var Z=B.charCodeAt(q);Z<=127?N++:Z<=2047?N+=2:Z>=55296&&Z<=57343?(N+=4,++q):N+=3}return N},Va=globalThis.TextDecoder&&new TextDecoder,Eo=(B,N,q,Z)=>{var se=N+q;if(Z)return se;for(;B[N]&&!(N>=se);)++N;return N},qa=function(B){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=arguments.length>2?arguments[2]:void 0,Z=arguments.length>3?arguments[3]:void 0;var se=Eo(B,N,q,Z);if(se-N>16&&B.buffer&&Va)return Va.decode(B.subarray(N,se));for(var le="";N<se;){var ge=B[N++];if(!(ge&128)){le+=String.fromCharCode(ge);continue}var ye=B[N++]&63;if((ge&224)==192){le+=String.fromCharCode((ge&31)<<6|ye);continue}var xe=B[N++]&63;if((ge&240)==224?ge=(ge&15)<<12|ye<<6|xe:ge=(ge&7)<<18|ye<<12|xe<<6|B[N++]&63,ge<65536)le+=String.fromCharCode(ge);else{var Re=ge-65536;le+=String.fromCharCode(55296|Re>>10,56320|Re&1023)}}return le},Ts=(B,N,q)=>B?qa(M,B,N,q):"",fn=(B,N)=>{N=Vt(N),vr(B,{name:N,fromWireType(q){var Z=j[q>>2],se=q+4,le;return le=Ts(se,Z,!0),Tn(q),le},toWireType(q,Z){Z instanceof ArrayBuffer&&(Z=new Uint8Array(Z));var se,le=typeof Z=="string";le||ArrayBuffer.isView(Z)&&Z.BYTES_PER_ELEMENT==1||rt("Cannot pass non-string to std::string"),le?se=Jn(Z):se=Z.length;var ge=Qa(4+se+1),ye=ge+4;return j[ge>>2]=se,le?Nr(Z,ye,se+1):M.set(Z,ye),q!==null&&q.push(Tn,ge),ge},readValueFromPointer:Or,destructorFunction(q){Tn(q)}})},xo=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,Rs=(B,N,q)=>{var Z=B>>1,se=Eo(L,Z,N/2,q);if(se-Z>16&&xo)return xo.decode(L.subarray(Z,se));for(var le="",ge=Z;ge<se;++ge){var ye=L[ge];le+=String.fromCharCode(ye)}return le},An=(B,N,q)=>{if(q!=null||(q=2147483647),q<2)return 0;q-=2;for(var Z=N,se=q<B.length*2?q/2:B.length,le=0;le<se;++le){var ge=B.charCodeAt(le);k[N>>1]=ge,N+=2}return k[N>>1]=0,N-Z},Ga=B=>B.length*2,Ao=(B,N,q)=>{for(var Z="",se=B>>2,le=0;!(le>=N/4);le++){var ge=j[se+le];if(!ge&&!q)break;Z+=String.fromCodePoint(ge)}return Z},qc=(B,N,q)=>{if(q!=null||(q=2147483647),q<4)return 0;for(var Z=N,se=Z+q-4,le=0;le<B.length;++le){var ge=B.codePointAt(le);if(ge>65535&&le++,D[N>>2]=ge,N+=4,N+4>se)break}return D[N>>2]=0,N-Z},To=B=>{for(var N=0,q=0;q<B.length;++q){var Z=B.codePointAt(q);Z>65535&&q++,N+=4}return N},Ro=(B,N,q)=>{q=Vt(q);var Z,se,le;N===2?(Z=Rs,se=An,le=Ga):(Z=Ao,se=qc,le=To),vr(B,{name:q,fromWireType:ge=>{var ye=j[ge>>2],xe=Z(ge+4,ye*N,!0);return Tn(ge),xe},toWireType:(ge,ye)=>{typeof ye!="string"&&rt(`Cannot pass non-string to C++ string type ${q}`);var xe=le(ye),Re=Qa(4+xe+N);return j[Re>>2]=xe/N,se(ye,Re+4,xe+N),ge!==null&&ge.push(Tn,Re),Re},readValueFromPointer:Or,destructorFunction(ge){Tn(ge)}})},Gc=(B,N,q,Z,se,le)=>{un[B]={name:Vt(N),rawConstructor:jt(q,Z),rawDestructor:jt(se,le),fields:[]}},cr=(B,N,q,Z,se,le,ge,ye,xe,Re)=>{un[B].fields.push({fieldName:Vt(N),getterReturnType:q,getter:jt(Z,se),getterContext:le,setterArgumentType:ge,setter:jt(ye,xe),setterContext:Re})},Zn=(B,N)=>{N=Vt(N),vr(B,{isVoid:!0,name:N,fromWireType:()=>{},toWireType:(q,Z)=>{}})},Oi=[],Ds=B=>{var N=Oi.length;return Oi.push(B),N},Gh=(B,N)=>{var q=gr[B];return q===void 0&&rt(`${N} has unknown type ${Ia(B)}`),q},za=(B,N)=>{for(var q=new Array(B),Z=0;Z<B;++Z)q[Z]=Gh(j[N+Z*4>>2],`parameter ${Z}`);return q},Ya=(B,N,q)=>{var Z=[],se=B(Z,q);return Z.length&&(j[N>>2]=Br.toHandle(Z)),se},Ms={},ks=B=>{var N=Ms[B];return N===void 0?Vt(B):N},zc=(B,N,q)=>{var Z=8,[se,...le]=za(B,N),ge=se.toWireType.bind(se),ye=le.map(Ne=>Ne.readValueFromPointer.bind(Ne));B--;var xe=new Array(B),Re=(Ne,it,Qe,gt)=>{for(var Ct=0,ft=0;ft<B;++ft)xe[ft]=ye[ft](gt+Ct),Ct+=Z;var ut;switch(q){case 0:ut=Br.toValue(Ne).apply(null,xe);break;case 2:ut=Reflect.construct(Br.toValue(Ne),xe);break;case 3:ut=xe[0];break;case 1:ut=Br.toValue(Ne)[ks(it)](...xe);break}return Ya(ge,Qe,ut)},Me=`methodCaller<(${le.map(Ne=>Ne.name)}) => ${se.name}>`;return Ds(Es(Me,Re))},zh=B=>B?(B=ks(B),Br.toHandle(globalThis[B])):Br.toHandle(globalThis),Yh=B=>{B>9&&(Er[B+1]+=1)},Wh=(B,N,q,Z,se)=>Oi[B](N,q,Z,se),Wa=B=>{var N=Br.toValue(B);mr(N),bo(B)},Kh=(B,N,q,Z)=>{var se=new Date().getFullYear(),le=new Date(se,0,1),ge=new Date(se,6,1),ye=le.getTimezoneOffset(),xe=ge.getTimezoneOffset(),Re=Math.max(ye,xe);j[B>>2]=Re*60,D[N>>2]=+(ye!=xe);var Me=Qe=>{var gt=Qe>=0?"-":"+",Ct=Math.abs(Qe),ft=String(Math.floor(Ct/60)).padStart(2,"0"),ut=String(Ct%60).padStart(2,"0");return`UTC${gt}${ft}${ut}`},Ne=Me(ye),it=Me(xe);xe<ye?(Nr(Ne,q,17),Nr(it,Z,17)):(Nr(Ne,Z,17),Nr(it,q,17))},Qh=()=>2147483648,$h=(B,N)=>Math.ceil(B/N)*N,Jh=B=>{var N=Os.buffer.byteLength,q=(B-N+65535)/65536|0;try{return Os.grow(q),U(),1}catch{}},Zh=B=>{var N=M.length;B>>>=0;var q=Qh();if(B>q)return!1;for(var Z=1;Z<=4;Z*=2){var se=N*(1+.2/Z);se=Math.min(se,B+100663296);var le=Math.min(q,$h(Math.max(B,se),65536)),ge=Jh(le);if(ge)return!0}return!1},Do={},Xh=()=>c||"./this.program",Ls=()=>{if(!Ls.strings){var B=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",N={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:B,_:Xh()};for(var q in Do)Do[q]===void 0?delete N[q]:N[q]=Do[q];var Z=[];for(var q in N)Z.push(`${q}=${N[q]}`);Ls.strings=Z}return Ls.strings},ef=(B,N)=>{var q=0,Z=0;for(var se of Ls()){var le=N+q;j[B+Z>>2]=le,q+=Nr(se,le,1/0)+1,Z+=4}return 0},tf=(B,N)=>{var q=Ls();j[B>>2]=q.length;var Z=0;for(var se of q)Z+=Jn(se)+1;return j[N>>2]=Z,0},Ka=B=>52;function rf(B,N,q,Z,se){return 70}var nf=[null,[],[]],sf=(B,N)=>{var q=nf[B];N===0||N===10?((B===1?A:w)(qa(q)),q.length=0):q.push(N)},Yc=(B,N,q,Z)=>{for(var se=0,le=0;le<q;le++){var ge=j[N>>2],ye=j[N+4>>2];N+=8;for(var xe=0;xe<ye;xe++)sf(B,M[ge+xe]);se+=ye}return j[Z>>2]=se,0},of=B=>B;if(Nc(),jc(),o.noExitRuntime&&o.noExitRuntime,o.print&&(A=o.print),o.printErr&&(w=o.printErr),o.wasmBinary&&(v=o.wasmBinary),o.arguments&&o.arguments,o.thisProgram&&(c=o.thisProgram),o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.shift()();var Wc,Tn,Qa,Kc,Ke,Qc,$c,Jc,Mo,Bi,Zc,$a,Ja,Os,Za;function Xc(B){Wc=B.ya,Tn=o._free=B.za,Qa=o._malloc=B.Ba,Kc=B.Ca,Ke=B.Da,Qc=B.Ea,$c=B.Fa,Jc=B.Ga,Mo=B.Ha,Bi=B.Ia,Zc=B.Ja,xn.viijii=B.Ka,$a=xn.iiijj=B.La,xn.jiji=B.Ma,Ja=xn.jiiii=B.Na,xn.iiiiij=B.Oa,xn.iiiiijj=B.Pa,xn.iiiiiijj=B.Qa,Os=B.wa,Za=B.Aa}var Ni={s:Fe,w:Oe,a:Tt,j:Cn,m:Zt,Q:kt,p:ar,U:Yr,d:bn,ca:pr,ta:Ph,ba:jh,oa:bs,ra:Pa,qa:wr,H:Fc,ma:Hh,X:Vc,Y:Ua,x:qh,t:wo,sa:Fa,na:fn,R:Ro,I:Gc,ua:cr,pa:Zn,N:zc,va:bo,D:zh,S:Yh,M:Wh,ia:Wa,da:Kh,ga:Zh,ea:ef,fa:tf,ha:Ka,$:rf,V:Yc,K:Is,C:cu,Z:Ns,T:Ps,r:ff,b:tu,E:_r,ka:tl,c:uf,ja:gf,h:Bs,i:nu,q:su,P:mf,v:df,F:hf,L:pf,z:uu,J:nl,aa:du,_:Xn,f:ko,l:af,e:eu,g:cf,O:rl,k:lf,la:au,o:ou,B:Xa,u:lu,W:iu,A:Ii,n:ru,G:el,y:of};function af(B,N){var q=he();try{Je(B)(N)}catch(Z){if(de(q),Z!==Z+0)throw Z;Ke(1,0)}}function lf(B,N,q,Z,se){var le=he();try{Je(B)(N,q,Z,se)}catch(ge){if(de(le),ge!==ge+0)throw ge;Ke(1,0)}}function cf(B,N,q,Z){var se=he();try{Je(B)(N,q,Z)}catch(le){if(de(se),le!==le+0)throw le;Ke(1,0)}}function eu(B,N,q){var Z=he();try{Je(B)(N,q)}catch(se){if(de(Z),se!==se+0)throw se;Ke(1,0)}}function tu(B,N){var q=he();try{return Je(B)(N)}catch(Z){if(de(q),Z!==Z+0)throw Z;Ke(1,0)}}function Bs(B,N,q,Z){var se=he();try{return Je(B)(N,q,Z)}catch(le){if(de(se),le!==le+0)throw le;Ke(1,0)}}function Ns(B,N,q,Z,se,le){var ge=he();try{return Je(B)(N,q,Z,se,le)}catch(ye){if(de(ge),ye!==ye+0)throw ye;Ke(1,0)}}function uf(B,N,q){var Z=he();try{return Je(B)(N,q)}catch(se){if(de(Z),se!==se+0)throw se;Ke(1,0)}}function ko(B){var N=he();try{Je(B)()}catch(q){if(de(N),q!==q+0)throw q;Ke(1,0)}}function ru(B,N,q,Z,se,le,ge,ye,xe,Re,Me){var Ne=he();try{Je(B)(N,q,Z,se,le,ge,ye,xe,Re,Me)}catch(it){if(de(Ne),it!==it+0)throw it;Ke(1,0)}}function nu(B,N,q,Z,se){var le=he();try{return Je(B)(N,q,Z,se)}catch(ge){if(de(le),ge!==ge+0)throw ge;Ke(1,0)}}function Xa(B,N,q,Z,se,le,ge){var ye=he();try{Je(B)(N,q,Z,se,le,ge)}catch(xe){if(de(ye),xe!==xe+0)throw xe;Ke(1,0)}}function el(B,N,q,Z,se,le,ge,ye,xe,Re,Me,Ne,it,Qe,gt,Ct){var ft=he();try{Je(B)(N,q,Z,se,le,ge,ye,xe,Re,Me,Ne,it,Qe,gt,Ct)}catch(ut){if(de(ft),ut!==ut+0)throw ut;Ke(1,0)}}function iu(B,N,q,Z,se,le,ge,ye,xe){var Re=he();try{Je(B)(N,q,Z,se,le,ge,ye,xe)}catch(Me){if(de(Re),Me!==Me+0)throw Me;Ke(1,0)}}function su(B,N,q,Z,se,le){var ge=he();try{return Je(B)(N,q,Z,se,le)}catch(ye){if(de(ge),ye!==ye+0)throw ye;Ke(1,0)}}function ou(B,N,q,Z,se,le){var ge=he();try{Je(B)(N,q,Z,se,le)}catch(ye){if(de(ge),ye!==ye+0)throw ye;Ke(1,0)}}function df(B,N,q,Z,se,le,ge){var ye=he();try{return Je(B)(N,q,Z,se,le,ge)}catch(xe){if(de(ye),xe!==xe+0)throw xe;Ke(1,0)}}function hf(B,N,q,Z,se,le,ge,ye){var xe=he();try{return Je(B)(N,q,Z,se,le,ge,ye)}catch(Re){if(de(xe),Re!==Re+0)throw Re;Ke(1,0)}}function ff(B){var N=he();try{return Je(B)()}catch(q){if(de(N),q!==q+0)throw q;Ke(1,0)}}function pf(B,N,q,Z,se,le,ge,ye,xe){var Re=he();try{return Je(B)(N,q,Z,se,le,ge,ye,xe)}catch(Me){if(de(Re),Me!==Me+0)throw Me;Ke(1,0)}}function mf(B,N,q,Z,se,le,ge){var ye=he();try{return Je(B)(N,q,Z,se,le,ge)}catch(xe){if(de(ye),xe!==xe+0)throw xe;Ke(1,0)}}function _r(B,N,q,Z){var se=he();try{return Je(B)(N,q,Z)}catch(le){if(de(se),le!==le+0)throw le;Ke(1,0)}}function Is(B,N,q,Z){var se=he();try{return Je(B)(N,q,Z)}catch(le){if(de(se),le!==le+0)throw le;Ke(1,0)}}function au(B,N,q,Z,se,le,ge,ye){var xe=he();try{Je(B)(N,q,Z,se,le,ge,ye)}catch(Re){if(de(xe),Re!==Re+0)throw Re;Ke(1,0)}}function lu(B,N,q,Z,se,le,ge,ye){var xe=he();try{Je(B)(N,q,Z,se,le,ge,ye)}catch(Re){if(de(xe),Re!==Re+0)throw Re;Ke(1,0)}}function cu(B,N,q,Z,se,le){var ge=he();try{return Je(B)(N,q,Z,se,le)}catch(ye){if(de(ge),ye!==ye+0)throw ye;Ke(1,0)}}function uu(B,N,q,Z,se,le,ge,ye,xe,Re){var Me=he();try{return Je(B)(N,q,Z,se,le,ge,ye,xe,Re)}catch(Ne){if(de(Me),Ne!==Ne+0)throw Ne;Ke(1,0)}}function tl(B,N,q){var Z=he();try{return Je(B)(N,q)}catch(se){if(de(Z),se!==se+0)throw se;Ke(1,0)}}function gf(B,N,q,Z,se){var le=he();try{return Je(B)(N,q,Z,se)}catch(ge){if(de(le),ge!==ge+0)throw ge;Ke(1,0)}}function Ii(B,N,q,Z,se,le,ge,ye,xe,Re){var Me=he();try{Je(B)(N,q,Z,se,le,ge,ye,xe,Re)}catch(Ne){if(de(Me),Ne!==Ne+0)throw Ne;Ke(1,0)}}function rl(B,N,q,Z,se,le,ge){var ye=he();try{Je(B)(N,q,Z,se,le,ge)}catch(xe){if(de(ye),xe!==xe+0)throw xe;Ke(1,0)}}function Ps(B,N,q,Z){var se=he();try{return Je(B)(N,q,Z)}catch(le){if(de(se),le!==le+0)throw le;Ke(1,0)}}function nl(B,N,q,Z,se,le,ge,ye,xe,Re,Me,Ne){var it=he();try{return Je(B)(N,q,Z,se,le,ge,ye,xe,Re,Me,Ne)}catch(Qe){if(de(it),Qe!==Qe+0)throw Qe;Ke(1,0)}}function du(B,N,q,Z,se,le,ge){var ye=he();try{return $a(B,N,q,Z,se,le,ge)}catch(xe){if(de(ye),xe!==xe+0)throw xe;Ke(1,0)}}function Xn(B,N,q,Z,se){var le=he();try{return Ja(B,N,q,Z,se)}catch(ge){if(de(le),ge!==ge+0)throw ge;Ke(1,0)}}function Pi(){$();function B(){var N,q;o.calledRun=!0,!S&&(te(),(N=g)===null||N===void 0||N(o),(q=o.onRuntimeInitialized)===null||q===void 0||q.call(o),Y())}o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),B()},1)):B()}var ei;return ei=await Ce(),Pi(),H?r=o:r=new Promise((B,N)=>{g=B,y=N}),r}function U2(e){return ob(ab,e)}async function F2(e,r){return j2(ab,e,r)}const lb=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],H2=[...lb,["unknown"]].map(e=>e[0]),Ym=new Map(lb);function V2(e){for(const[r,n]of Ym)if(e===n)return r;return"unknown"}function q2(e){if(cb(e))return{width:e.naturalWidth,height:e.naturalHeight};if(ub(e))return{width:e.width.baseVal.value,height:e.height.baseVal.value};if(db(e))return{width:e.videoWidth,height:e.videoHeight};if(fb(e))return{width:e.width,height:e.height};if(mb(e))return{width:e.displayWidth,height:e.displayHeight};if(hb(e))return{width:e.width,height:e.height};if(pb(e))return{width:e.width,height:e.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function cb(e){var r,n;try{return e instanceof((n=(r=e==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.HTMLImageElement)}catch{return!1}}function ub(e){var r,n;try{return e instanceof((n=(r=e==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.SVGImageElement)}catch{return!1}}function db(e){var r,n;try{return e instanceof((n=(r=e==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.HTMLVideoElement)}catch{return!1}}function hb(e){var r,n;try{return e instanceof((n=(r=e==null?void 0:e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:n.HTMLCanvasElement)}catch{return!1}}function fb(e){try{return e instanceof ImageBitmap||Object.prototype.toString.call(e)==="[object ImageBitmap]"}catch{return!1}}function pb(e){try{return e instanceof OffscreenCanvas||Object.prototype.toString.call(e)==="[object OffscreenCanvas]"}catch{return!1}}function mb(e){try{return e instanceof VideoFrame||Object.prototype.toString.call(e)==="[object VideoFrame]"}catch{return!1}}function G2(e){try{return e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]"}catch{return!1}}function z2(e){try{return e instanceof ImageData||Object.prototype.toString.call(e)==="[object ImageData]"}catch{return!1}}function Y2(e,r){try{const n=new OffscreenCanvas(e,r);if(n.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{const n=document.createElement("canvas");return n.width=e,n.height=r,n}}async function gb(e){if(cb(e)&&!await $2(e))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ub(e)&&!await J2(e))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(mb(e)&&Z2(e))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(db(e)&&(e.readyState===0||e.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fb(e)&&eM(e))throw new DOMException("The image source is detached.","InvalidStateError");const{width:r,height:n}=q2(e);if(r===0||n===0)return null;const s=Y2(r,n).getContext("2d");s.drawImage(e,0,0);try{return s.getImageData(0,0,r,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function W2(e){let r;try{r=await createImageBitmap(e)}catch{try{if(globalThis.Image){r=new Image;let n="";try{n=URL.createObjectURL(e),r.src=n,await r.decode()}finally{URL.revokeObjectURL(n)}}else return e}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await gb(r)}function K2(e){const{width:r,height:n}=e;if(r===0||n===0)return null;const s=e.getContext("2d");try{return s.getImageData(0,0,r,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Q2(e){if(G2(e))return await W2(e);if(z2(e)){if(X2(e))throw new DOMException("The image data has been detached.","InvalidStateError");return e}return hb(e)||pb(e)?K2(e):await gb(e)}async function $2(e){try{return await e.decode(),!0}catch{return!1}}async function J2(e){var r;try{return await((r=e.decode)==null?void 0:r.call(e)),!0}catch{return!1}}function Z2(e){return e.format===null}function X2(e){return e.data.buffer.byteLength===0}function eM(e){return e.width===0&&e.height===0}function sS(e,r){return tM(e)?new DOMException(`${r}: ${e.message}`,e.name):rM(e)?new e.constructor(`${r}: ${e.message}`):new Error(`${r}: ${e}`)}function tM(e){return e instanceof DOMException||Object.prototype.toString.call(e)==="[object DOMException]"}function rM(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}var Rd;class Wm{constructor(r={}){S2(this,Rd);var n;try{const s=(n=r==null?void 0:r.formats)==null?void 0:n.filter(o=>o!=="unknown");if((s==null?void 0:s.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const o of s??[])if(!Ym.has(o))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${o}' is not a valid enum value of type BarcodeFormat.`);C2(this,Rd,s??[]),U2({fireImmediately:!0}).catch(()=>{})}catch(s){throw sS(s,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return H2.filter(r=>r!=="unknown")}async detect(r){try{const n=await Q2(r);if(n===null)return[];let s;const o={tryCode39ExtendedMode:!1,textMode:"Plain",formats:y2(this,Rd).map(u=>Ym.get(u))};try{s=await F2(n,o)}catch(u){throw console.error(u),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return s.map(u=>{const{topLeft:{x:f,y:l},topRight:{x:c,y:h},bottomLeft:{x:m,y:p},bottomRight:{x:_,y:E}}=u.position,A=Math.min(f,c,m,_),w=Math.min(l,h,p,E),v=Math.max(f,c,m,_),S=Math.max(l,h,p,E);return{boundingBox:new DOMRectReadOnly(A,w,v-A,S-w),rawValue:u.text,format:V2(u.format),cornerPoints:[{x:f,y:l},{x:c,y:h},{x:_,y:E},{x:m,y:p}]}})}catch(n){throw sS(n,"Failed to execute 'detect' on 'BarcodeDetector'")}}}Rd=new WeakMap;globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=Wm);let vb=!0,_b=!0;function ql(e,r,n){const s=e.match(r);return s&&s.length>=n&&parseFloat(s[n],10)}function lo(e,r,n){if(!e.RTCPeerConnection)return;const s=e.RTCPeerConnection.prototype,o=s.addEventListener;s.addEventListener=function(f,l){if(f!==r)return o.apply(this,arguments);const c=h=>{const m=n(h);m&&(l.handleEvent?l.handleEvent(m):l(m))};return this._eventMap=this._eventMap||{},this._eventMap[r]||(this._eventMap[r]=new Map),this._eventMap[r].set(l,c),o.apply(this,[f,c])};const u=s.removeEventListener;s.removeEventListener=function(f,l){if(f!==r||!this._eventMap||!this._eventMap[r])return u.apply(this,arguments);if(!this._eventMap[r].has(l))return u.apply(this,arguments);const c=this._eventMap[r].get(l);return this._eventMap[r].delete(l),this._eventMap[r].size===0&&delete this._eventMap[r],Object.keys(this._eventMap).length===0&&delete this._eventMap,u.apply(this,[f,c])},Object.defineProperty(s,"on"+r,{get(){return this["_on"+r]},set(f){this["_on"+r]&&(this.removeEventListener(r,this["_on"+r]),delete this["_on"+r]),f&&this.addEventListener(r,this["_on"+r]=f)},enumerable:!0,configurable:!0})}function nM(e){return typeof e!="boolean"?new Error("Argument type: "+typeof e+". Please use a boolean."):(vb=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function iM(e){return typeof e!="boolean"?new Error("Argument type: "+typeof e+". Please use a boolean."):(_b=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function yb(){if(typeof window=="object"){if(vb)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Vg(e,r){_b&&console.warn(e+" is deprecated, please use "+r+" instead.")}function sM(e){const r={browser:null,version:null};if(typeof e>"u"||!e.navigator||!e.navigator.userAgent)return r.browser="Not a browser.",r;const{navigator:n}=e;if(n.userAgentData&&n.userAgentData.brands){const s=n.userAgentData.brands.find(o=>o.brand==="Chromium");if(s)return{browser:"chrome",version:parseInt(s.version,10)}}if(n.mozGetUserMedia)r.browser="firefox",r.version=parseInt(ql(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||e.isSecureContext===!1&&e.webkitRTCPeerConnection)r.browser="chrome",r.version=parseInt(ql(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2));else if(e.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))r.browser="safari",r.version=parseInt(ql(n.userAgent,/AppleWebKit\/(\d+)\./,1)),r.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype,r._safariVersion=ql(n.userAgent,/Version\/(\d+(\.?\d+))/,1);else return r.browser="Not a supported browser.",r;return r}function oS(e){return Object.prototype.toString.call(e)==="[object Object]"}function Sb(e){return oS(e)?Object.keys(e).reduce(function(r,n){const s=oS(e[n]),o=s?Sb(e[n]):e[n],u=s&&!Object.keys(o).length;return o===void 0||u?r:Object.assign(r,{[n]:o})},{}):e}function Km(e,r,n){!r||n.has(r.id)||(n.set(r.id,r),Object.keys(r).forEach(s=>{s.endsWith("Id")?Km(e,e.get(r[s]),n):s.endsWith("Ids")&&r[s].forEach(o=>{Km(e,e.get(o),n)})}))}function aS(e,r,n){const s=n?"outbound-rtp":"inbound-rtp",o=new Map;if(r===null)return o;const u=[];return e.forEach(f=>{f.type==="track"&&f.trackIdentifier===r.id&&u.push(f)}),u.forEach(f=>{e.forEach(l=>{l.type===s&&l.trackId===f.id&&Km(e,l,o)})}),o}const lS=yb;function Cb(e,r){const n=e&&e.navigator;if(!n.mediaDevices)return;const s=function(l){if(typeof l!="object"||l.mandatory||l.optional)return l;const c={};return Object.keys(l).forEach(h=>{if(h==="require"||h==="advanced"||h==="mediaSource")return;const m=typeof l[h]=="object"?l[h]:{ideal:l[h]};m.exact!==void 0&&typeof m.exact=="number"&&(m.min=m.max=m.exact);const p=function(_,E){return _?_+E.charAt(0).toUpperCase()+E.slice(1):E==="deviceId"?"sourceId":E};if(m.ideal!==void 0){c.optional=c.optional||[];let _={};typeof m.ideal=="number"?(_[p("min",h)]=m.ideal,c.optional.push(_),_={},_[p("max",h)]=m.ideal,c.optional.push(_)):(_[p("",h)]=m.ideal,c.optional.push(_))}m.exact!==void 0&&typeof m.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[p("",h)]=m.exact):["min","max"].forEach(_=>{m[_]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[p(_,h)]=m[_])})}),l.advanced&&(c.optional=(c.optional||[]).concat(l.advanced)),c},o=function(l,c){if(r.version>=61)return c(l);if(l=JSON.parse(JSON.stringify(l)),l&&typeof l.audio=="object"){const h=function(m,p,_){p in m&&!(_ in m)&&(m[_]=m[p],delete m[p])};l=JSON.parse(JSON.stringify(l)),h(l.audio,"autoGainControl","googAutoGainControl"),h(l.audio,"noiseSuppression","googNoiseSuppression"),l.audio=s(l.audio)}if(l&&typeof l.video=="object"){let h=l.video.facingMode;h=h&&(typeof h=="object"?h:{ideal:h});const m=r.version<66;if(h&&(h.exact==="user"||h.exact==="environment"||h.ideal==="user"||h.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!m)){delete l.video.facingMode;let p;if(h.exact==="environment"||h.ideal==="environment"?p=["back","rear"]:(h.exact==="user"||h.ideal==="user")&&(p=["front"]),p)return n.mediaDevices.enumerateDevices().then(_=>{_=_.filter(A=>A.kind==="videoinput");let E=_.find(A=>p.some(w=>A.label.toLowerCase().includes(w)));return!E&&_.length&&p.includes("back")&&(E=_[_.length-1]),E&&(l.video.deviceId=h.exact?{exact:E.deviceId}:{ideal:E.deviceId}),l.video=s(l.video),lS("chrome: "+JSON.stringify(l)),c(l)})}l.video=s(l.video)}return lS("chrome: "+JSON.stringify(l)),c(l)},u=function(l){return r.version>=64?l:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[l.name]||l.name,message:l.message,constraint:l.constraint||l.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},f=function(l,c,h){o(l,m=>{n.webkitGetUserMedia(m,c,p=>{h&&h(u(p))})})};if(n.getUserMedia=f.bind(n),n.mediaDevices.getUserMedia){const l=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(c){return o(c,h=>l(h).then(m=>{if(h.audio&&!m.getAudioTracks().length||h.video&&!m.getVideoTracks().length)throw m.getTracks().forEach(p=>{p.stop()}),new DOMException("","NotFoundError");return m},m=>Promise.reject(u(m))))}}}function bb(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function wb(e){if(typeof e=="object"&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=s=>{s.stream.addEventListener("addtrack",o=>{let u;e.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(l=>l.track&&l.track.id===o.track.id):u={track:o.track};const f=new Event("track");f.track=o.track,f.receiver=u,f.transceiver={receiver:u},f.streams=[s.stream],this.dispatchEvent(f)}),s.stream.getTracks().forEach(o=>{let u;e.RTCPeerConnection.prototype.getReceivers?u=this.getReceivers().find(l=>l.track&&l.track.id===o.id):u={track:o};const f=new Event("track");f.track=o,f.receiver=u,f.transceiver={receiver:u},f.streams=[s.stream],this.dispatchEvent(f)})},this.addEventListener("addstream",this._ontrackpoly)),r.apply(this,arguments)}}else lo(e,"track",r=>(r.transceiver||Object.defineProperty(r,"transceiver",{value:{receiver:r.receiver}}),r))}function Eb(e){if(typeof e=="object"&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const r=function(o,u){return{track:u,get dtmf(){return this._dtmf===void 0&&(u.kind==="audio"?this._dtmf=o.createDTMFSender(u):this._dtmf=null),this._dtmf},_pc:o}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const o=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(l,c){let h=o.apply(this,arguments);return h||(h=r(this,l),this._senders.push(h)),h};const u=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(l){u.apply(this,arguments);const c=this._senders.indexOf(l);c!==-1&&this._senders.splice(c,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(u){this._senders=this._senders||[],n.apply(this,[u]),u.getTracks().forEach(f=>{this._senders.push(r(this,f))})};const s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(u){this._senders=this._senders||[],s.apply(this,[u]),u.getTracks().forEach(f=>{const l=this._senders.find(c=>c.track===f);l&&this._senders.splice(this._senders.indexOf(l),1)})}}else if(typeof e=="object"&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const r=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const s=r.apply(this,[]);return s.forEach(o=>o._pc=this),s},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function xb(e){if(!(typeof e=="object"&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const n=e.RTCPeerConnection.prototype.getSenders;n&&(e.RTCPeerConnection.prototype.getSenders=function(){const u=n.apply(this,[]);return u.forEach(f=>f._pc=this),u});const s=e.RTCPeerConnection.prototype.addTrack;s&&(e.RTCPeerConnection.prototype.addTrack=function(){const u=s.apply(this,arguments);return u._pc=this,u}),e.RTCRtpSender.prototype.getStats=function(){const u=this;return this._pc.getStats().then(f=>aS(f,u.track,!0))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const n=e.RTCPeerConnection.prototype.getReceivers;n&&(e.RTCPeerConnection.prototype.getReceivers=function(){const o=n.apply(this,[]);return o.forEach(u=>u._pc=this),o}),lo(e,"track",s=>(s.receiver._pc=s.srcElement,s)),e.RTCRtpReceiver.prototype.getStats=function(){const o=this;return this._pc.getStats().then(u=>aS(u,o.track,!1))}}if(!("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype))return;const r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const s=arguments[0];let o,u,f;return this.getSenders().forEach(l=>{l.track===s&&(o?f=!0:o=l)}),this.getReceivers().forEach(l=>(l.track===s&&(u?f=!0:u=l),l.track===s)),f||o&&u?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):o?o.getStats():u?u.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return r.apply(this,arguments)}}function Ab(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(f=>this._shimmedLocalStreams[f][0])};const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(f,l){if(!l)return r.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const c=r.apply(this,arguments);return this._shimmedLocalStreams[l.id]?this._shimmedLocalStreams[l.id].indexOf(c)===-1&&this._shimmedLocalStreams[l.id].push(c):this._shimmedLocalStreams[l.id]=[l,c],c};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(f){this._shimmedLocalStreams=this._shimmedLocalStreams||{},f.getTracks().forEach(h=>{if(this.getSenders().find(p=>p.track===h))throw new DOMException("Track already exists.","InvalidAccessError")});const l=this.getSenders();n.apply(this,arguments);const c=this.getSenders().filter(h=>l.indexOf(h)===-1);this._shimmedLocalStreams[f.id]=[f].concat(c)};const s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(f){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[f.id],s.apply(this,arguments)};const o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(f){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},f&&Object.keys(this._shimmedLocalStreams).forEach(l=>{const c=this._shimmedLocalStreams[l].indexOf(f);c!==-1&&this._shimmedLocalStreams[l].splice(c,1),this._shimmedLocalStreams[l].length===1&&delete this._shimmedLocalStreams[l]}),o.apply(this,arguments)}}function Tb(e,r){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&r.version>=65)return Ab(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const m=n.apply(this);return this._reverseStreams=this._reverseStreams||{},m.map(p=>this._reverseStreams[p.id])};const s=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(m){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},m.getTracks().forEach(p=>{if(this.getSenders().find(E=>E.track===p))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[m.id]){const p=new e.MediaStream(m.getTracks());this._streams[m.id]=p,this._reverseStreams[p.id]=m,m=p}s.apply(this,[m])};const o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(m){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.apply(this,[this._streams[m.id]||m]),delete this._reverseStreams[this._streams[m.id]?this._streams[m.id].id:m.id],delete this._streams[m.id]},e.RTCPeerConnection.prototype.addTrack=function(m,p){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const _=[].slice.call(arguments,1);if(_.length!==1||!_[0].getTracks().find(w=>w===m))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(w=>w.track===m))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const A=this._streams[p.id];if(A)A.addTrack(m),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const w=new e.MediaStream([m]);this._streams[p.id]=w,this._reverseStreams[w.id]=p,this.addStream(w)}return this.getSenders().find(w=>w.track===m)};function u(h,m){let p=m.sdp;return Object.keys(h._reverseStreams||[]).forEach(_=>{const E=h._reverseStreams[_],A=h._streams[E.id];p=p.replace(new RegExp(A.id,"g"),E.id)}),new RTCSessionDescription({type:m.type,sdp:p})}function f(h,m){let p=m.sdp;return Object.keys(h._reverseStreams||[]).forEach(_=>{const E=h._reverseStreams[_],A=h._streams[E.id];p=p.replace(new RegExp(E.id,"g"),A.id)}),new RTCSessionDescription({type:m.type,sdp:p})}["createOffer","createAnswer"].forEach(function(h){const m=e.RTCPeerConnection.prototype[h],p={[h](){const _=arguments;return arguments.length&&typeof arguments[0]=="function"?m.apply(this,[A=>{const w=u(this,A);_[0].apply(null,[w])},A=>{_[1]&&_[1].apply(null,A)},arguments[2]]):m.apply(this,arguments).then(A=>u(this,A))}};e.RTCPeerConnection.prototype[h]=p[h]});const l=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?l.apply(this,arguments):(arguments[0]=f(this,arguments[0]),l.apply(this,arguments))};const c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const h=c.get.apply(this);return h.type===""?h:u(this,h)}}),e.RTCPeerConnection.prototype.removeTrack=function(m){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!m._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(m._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let _;Object.keys(this._streams).forEach(E=>{this._streams[E].getTracks().find(w=>m.track===w)&&(_=this._streams[E])}),_&&(_.getTracks().length===1?this.removeStream(this._reverseStreams[_.id]):_.removeTrack(m.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Qm(e,r){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&r.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const s=e.RTCPeerConnection.prototype[n],o={[n](){return arguments[0]=new(n==="addIceCandidate"?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),s.apply(this,arguments)}};e.RTCPeerConnection.prototype[n]=o[n]})}function Rb(e,r){lo(e,"negotiationneeded",n=>{const s=n.target;if(!((r.version<72||s.getConfiguration&&s.getConfiguration().sdpSemantics==="plan-b")&&s.signalingState!=="stable"))return n})}const cS=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:Rb,shimAddTrackRemoveTrack:Tb,shimAddTrackRemoveTrackWithNative:Ab,shimGetSendersWithDtmf:Eb,shimGetUserMedia:Cb,shimMediaStream:bb,shimOnTrack:wb,shimPeerConnection:Qm,shimSenderReceiverGetStats:xb},Symbol.toStringTag,{value:"Module"}));function Db(e,r){const n=e&&e.navigator,s=e&&e.MediaStreamTrack;if(n.getUserMedia=function(o,u,f){Vg("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(o).then(u,f)},!(r.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const o=function(f,l,c){l in f&&!(c in f)&&(f[c]=f[l],delete f[l])},u=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(f){return typeof f=="object"&&typeof f.audio=="object"&&(f=JSON.parse(JSON.stringify(f)),o(f.audio,"autoGainControl","mozAutoGainControl"),o(f.audio,"noiseSuppression","mozNoiseSuppression")),u(f)},s&&s.prototype.getSettings){const f=s.prototype.getSettings;s.prototype.getSettings=function(){const l=f.apply(this,arguments);return o(l,"mozAutoGainControl","autoGainControl"),o(l,"mozNoiseSuppression","noiseSuppression"),l}}if(s&&s.prototype.applyConstraints){const f=s.prototype.applyConstraints;s.prototype.applyConstraints=function(l){return this.kind==="audio"&&typeof l=="object"&&(l=JSON.parse(JSON.stringify(l)),o(l,"autoGainControl","mozAutoGainControl"),o(l,"noiseSuppression","mozNoiseSuppression")),f.apply(this,[l])}}}}function oM(e,r){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(s){if(!(s&&s.video)){const o=new DOMException("getDisplayMedia without video constraints is undefined");return o.name="NotFoundError",o.code=8,Promise.reject(o)}return s.video===!0?s.video={mediaSource:r}:s.video.mediaSource=r,e.navigator.mediaDevices.getUserMedia(s)})}function Mb(e){typeof e=="object"&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function $m(e,r){if(typeof e!="object"||!(e.RTCPeerConnection||e.mozRTCPeerConnection))return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),r.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(o){const u=e.RTCPeerConnection.prototype[o],f={[o](){return arguments[0]=new(o==="addIceCandidate"?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),u.apply(this,arguments)}};e.RTCPeerConnection.prototype[o]=f[o]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},s=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[u,f,l]=arguments;return s.apply(this,[u||null]).then(c=>{if(r.version<53&&!f)try{c.forEach(h=>{h.type=n[h.type]||h.type})}catch(h){if(h.name!=="TypeError")throw h;c.forEach((m,p)=>{c.set(p,Object.assign({},m,{type:n[m.type]||m.type}))})}return c}).then(f,l)}}function kb(e){if(!(typeof e=="object"&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const r=e.RTCPeerConnection.prototype.getSenders;r&&(e.RTCPeerConnection.prototype.getSenders=function(){const o=r.apply(this,[]);return o.forEach(u=>u._pc=this),o});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const o=n.apply(this,arguments);return o._pc=this,o}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function Lb(e){if(!(typeof e=="object"&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const r=e.RTCPeerConnection.prototype.getReceivers;r&&(e.RTCPeerConnection.prototype.getReceivers=function(){const s=r.apply(this,[]);return s.forEach(o=>o._pc=this),s}),lo(e,"track",n=>(n.receiver._pc=n.srcElement,n)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Ob(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(n){Vg("removeStream","removeTrack"),this.getSenders().forEach(s=>{s.track&&n.getTracks().includes(s.track)&&this.removeTrack(s)})})}function Bb(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function Nb(e){if(!(typeof e=="object"&&e.RTCPeerConnection))return;const r=e.RTCPeerConnection.prototype.addTransceiver;r&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let s=arguments[1]&&arguments[1].sendEncodings;s===void 0&&(s=[]),s=[...s];const o=s.length>0;o&&s.forEach(f=>{if("rid"in f&&!/^[a-z0-9]{0,16}$/i.test(f.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in f&&!(parseFloat(f.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in f&&!(parseFloat(f.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const u=r.apply(this,arguments);if(o){const{sender:f}=u,l=f.getParameters();(!("encodings"in l)||l.encodings.length===1&&Object.keys(l.encodings[0]).length===0)&&(l.encodings=s,f.sendEncodings=s,this.setParametersPromises.push(f.setParameters(l).then(()=>{delete f.sendEncodings}).catch(()=>{delete f.sendEncodings})))}return u})}function Ib(e){if(!(typeof e=="object"&&e.RTCRtpSender))return;const r=e.RTCRtpSender.prototype.getParameters;r&&(e.RTCRtpSender.prototype.getParameters=function(){const s=r.apply(this,arguments);return"encodings"in s||(s.encodings=[].concat(this.sendEncodings||[{}])),s})}function Pb(e){if(!(typeof e=="object"&&e.RTCPeerConnection))return;const r=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>r.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):r.apply(this,arguments)}}function jb(e){if(!(typeof e=="object"&&e.RTCPeerConnection))return;const r=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>r.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):r.apply(this,arguments)}}const uS=Object.freeze(Object.defineProperty({__proto__:null,shimAddTransceiver:Nb,shimCreateAnswer:jb,shimCreateOffer:Pb,shimGetDisplayMedia:oM,shimGetParameters:Ib,shimGetUserMedia:Db,shimOnTrack:Mb,shimPeerConnection:$m,shimRTCDataChannel:Bb,shimReceiverGetStats:Lb,shimRemoveStream:Ob,shimSenderGetStats:kb},Symbol.toStringTag,{value:"Module"}));function Ub(e){if(!(typeof e!="object"||!e.RTCPeerConnection)){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(s){this._localStreams||(this._localStreams=[]),this._localStreams.includes(s)||this._localStreams.push(s),s.getAudioTracks().forEach(o=>r.call(this,o,s)),s.getVideoTracks().forEach(o=>r.call(this,o,s))},e.RTCPeerConnection.prototype.addTrack=function(s,...o){return o&&o.forEach(u=>{this._localStreams?this._localStreams.includes(u)||this._localStreams.push(u):this._localStreams=[u]}),r.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const s=this._localStreams.indexOf(n);if(s===-1)return;this._localStreams.splice(s,1);const o=n.getTracks();this.getSenders().forEach(u=>{o.includes(u.track)&&this.removeTrack(u)})})}}function Fb(e){if(!(typeof e!="object"||!e.RTCPeerConnection)&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=s=>{s.streams.forEach(o=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(o))return;this._remoteStreams.push(o);const u=new Event("addstream");u.stream=o,this.dispatchEvent(u)})})}});const r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const s=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(o){o.streams.forEach(u=>{if(s._remoteStreams||(s._remoteStreams=[]),s._remoteStreams.indexOf(u)>=0)return;s._remoteStreams.push(u);const f=new Event("addstream");f.stream=u,s.dispatchEvent(f)})}),r.apply(s,arguments)}}}function Hb(e){if(typeof e!="object"||!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,n=r.createOffer,s=r.createAnswer,o=r.setLocalDescription,u=r.setRemoteDescription,f=r.addIceCandidate;r.createOffer=function(h,m){const p=arguments.length>=2?arguments[2]:arguments[0],_=n.apply(this,[p]);return m?(_.then(h,m),Promise.resolve()):_},r.createAnswer=function(h,m){const p=arguments.length>=2?arguments[2]:arguments[0],_=s.apply(this,[p]);return m?(_.then(h,m),Promise.resolve()):_};let l=function(c,h,m){const p=o.apply(this,[c]);return m?(p.then(h,m),Promise.resolve()):p};r.setLocalDescription=l,l=function(c,h,m){const p=u.apply(this,[c]);return m?(p.then(h,m),Promise.resolve()):p},r.setRemoteDescription=l,l=function(c,h,m){const p=f.apply(this,[c]);return m?(p.then(h,m),Promise.resolve()):p},r.addIceCandidate=l}function Vb(e){const r=e&&e.navigator;if(r.mediaDevices&&r.mediaDevices.getUserMedia){const n=r.mediaDevices,s=n.getUserMedia.bind(n);r.mediaDevices.getUserMedia=o=>s(qb(o))}!r.getUserMedia&&r.mediaDevices&&r.mediaDevices.getUserMedia&&(r.getUserMedia=(function(s,o,u){r.mediaDevices.getUserMedia(s).then(o,u)}).bind(r))}function qb(e){return e&&e.video!==void 0?Object.assign({},e,{video:Sb(e.video)}):e}function Gb(e){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection;e.RTCPeerConnection=function(s,o){if(s&&s.iceServers){const u=[];for(let f=0;f<s.iceServers.length;f++){let l=s.iceServers[f];l.urls===void 0&&l.url?(Vg("RTCIceServer.url","RTCIceServer.urls"),l=JSON.parse(JSON.stringify(l)),l.urls=l.url,delete l.url,u.push(l)):u.push(s.iceServers[f])}s.iceServers=u}return new r(s,o)},e.RTCPeerConnection.prototype=r.prototype,"generateCertificate"in r&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get(){return r.generateCertificate}})}function zb(e){typeof e=="object"&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Yb(e){const r=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(s){if(s){typeof s.offerToReceiveAudio<"u"&&(s.offerToReceiveAudio=!!s.offerToReceiveAudio);const o=this.getTransceivers().find(f=>f.receiver.track.kind==="audio");s.offerToReceiveAudio===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):s.offerToReceiveAudio===!0&&!o&&this.addTransceiver("audio",{direction:"recvonly"}),typeof s.offerToReceiveVideo<"u"&&(s.offerToReceiveVideo=!!s.offerToReceiveVideo);const u=this.getTransceivers().find(f=>f.receiver.track.kind==="video");s.offerToReceiveVideo===!1&&u?u.direction==="sendrecv"?u.setDirection?u.setDirection("sendonly"):u.direction="sendonly":u.direction==="recvonly"&&(u.setDirection?u.setDirection("inactive"):u.direction="inactive"):s.offerToReceiveVideo===!0&&!u&&this.addTransceiver("video",{direction:"recvonly"})}return r.apply(this,arguments)}}function Wb(e){typeof e!="object"||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}const dS=Object.freeze(Object.defineProperty({__proto__:null,shimAudioContext:Wb,shimCallbacksAPI:Hb,shimConstraints:qb,shimCreateOfferLegacy:Yb,shimGetUserMedia:Vb,shimLocalStreamsAPI:Ub,shimRTCIceServerUrls:Gb,shimRemoteStreamsAPI:Fb,shimTrackEventTransceiver:zb},Symbol.toStringTag,{value:"Module"}));var hm={exports:{}},hS;function aM(){return hS||(hS=1,(function(e){const r={};r.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},r.localCName=r.generateIdentifier(),r.splitLines=function(n){return n.trim().split(`
62
+ `).map(s=>s.trim())},r.splitSections=function(n){return n.split(`
63
+ m=`).map((o,u)=>(u>0?"m="+o:o).trim()+`\r
64
+ `)},r.getDescription=function(n){const s=r.splitSections(n);return s&&s[0]},r.getMediaSections=function(n){const s=r.splitSections(n);return s.shift(),s},r.matchPrefix=function(n,s){return r.splitLines(n).filter(o=>o.indexOf(s)===0)},r.parseCandidate=function(n){let s;n.indexOf("a=candidate:")===0?s=n.substring(12).split(" "):s=n.substring(10).split(" ");const o={foundation:s[0],component:{1:"rtp",2:"rtcp"}[s[1]]||s[1],protocol:s[2].toLowerCase(),priority:parseInt(s[3],10),ip:s[4],address:s[4],port:parseInt(s[5],10),type:s[7]};for(let u=8;u<s.length;u+=2)switch(s[u]){case"raddr":o.relatedAddress=s[u+1];break;case"rport":o.relatedPort=parseInt(s[u+1],10);break;case"tcptype":o.tcpType=s[u+1];break;case"ufrag":o.ufrag=s[u+1],o.usernameFragment=s[u+1];break;default:o[s[u]]===void 0&&(o[s[u]]=s[u+1]);break}return o},r.writeCandidate=function(n){const s=[];s.push(n.foundation);const o=n.component;o==="rtp"?s.push(1):o==="rtcp"?s.push(2):s.push(o),s.push(n.protocol.toUpperCase()),s.push(n.priority),s.push(n.address||n.ip),s.push(n.port);const u=n.type;return s.push("typ"),s.push(u),u!=="host"&&n.relatedAddress&&n.relatedPort&&(s.push("raddr"),s.push(n.relatedAddress),s.push("rport"),s.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(s.push("tcptype"),s.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(s.push("ufrag"),s.push(n.usernameFragment||n.ufrag)),"candidate:"+s.join(" ")},r.parseIceOptions=function(n){return n.substring(14).split(" ")},r.parseRtpMap=function(n){let s=n.substring(9).split(" ");const o={payloadType:parseInt(s.shift(),10)};return s=s[0].split("/"),o.name=s[0],o.clockRate=parseInt(s[1],10),o.channels=s.length===3?parseInt(s[2],10):1,o.numChannels=o.channels,o},r.writeRtpMap=function(n){let s=n.payloadType;n.preferredPayloadType!==void 0&&(s=n.preferredPayloadType);const o=n.channels||n.numChannels||1;return"a=rtpmap:"+s+" "+n.name+"/"+n.clockRate+(o!==1?"/"+o:"")+`\r
65
+ `},r.parseExtmap=function(n){const s=n.substring(9).split(" ");return{id:parseInt(s[0],10),direction:s[0].indexOf("/")>0?s[0].split("/")[1]:"sendrecv",uri:s[1],attributes:s.slice(2).join(" ")}},r.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+`\r
66
+ `},r.parseFmtp=function(n){const s={};let o;const u=n.substring(n.indexOf(" ")+1).split(";");for(let f=0;f<u.length;f++)o=u[f].trim().split("="),s[o[0].trim()]=o[1];return s},r.writeFmtp=function(n){let s="",o=n.payloadType;if(n.preferredPayloadType!==void 0&&(o=n.preferredPayloadType),n.parameters&&Object.keys(n.parameters).length){const u=[];Object.keys(n.parameters).forEach(f=>{n.parameters[f]!==void 0?u.push(f+"="+n.parameters[f]):u.push(f)}),s+="a=fmtp:"+o+" "+u.join(";")+`\r
67
+ `}return s},r.parseRtcpFb=function(n){const s=n.substring(n.indexOf(" ")+1).split(" ");return{type:s.shift(),parameter:s.join(" ")}},r.writeRtcpFb=function(n){let s="",o=n.payloadType;return n.preferredPayloadType!==void 0&&(o=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(u=>{s+="a=rtcp-fb:"+o+" "+u.type+(u.parameter&&u.parameter.length?" "+u.parameter:"")+`\r
68
+ `}),s},r.parseSsrcMedia=function(n){const s=n.indexOf(" "),o={ssrc:parseInt(n.substring(7,s),10)},u=n.indexOf(":",s);return u>-1?(o.attribute=n.substring(s+1,u),o.value=n.substring(u+1)):o.attribute=n.substring(s+1),o},r.parseSsrcGroup=function(n){const s=n.substring(13).split(" ");return{semantics:s.shift(),ssrcs:s.map(o=>parseInt(o,10))}},r.getMid=function(n){const s=r.matchPrefix(n,"a=mid:")[0];if(s)return s.substring(6)},r.parseFingerprint=function(n){const s=n.substring(14).split(" ");return{algorithm:s[0].toLowerCase(),value:s[1].toUpperCase()}},r.getDtlsParameters=function(n,s){return{role:"auto",fingerprints:r.matchPrefix(n+s,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(n,s){let o="a=setup:"+s+`\r
69
+ `;return n.fingerprints.forEach(u=>{o+="a=fingerprint:"+u.algorithm+" "+u.value+`\r
70
+ `}),o},r.parseCryptoLine=function(n){const s=n.substring(9).split(" ");return{tag:parseInt(s[0],10),cryptoSuite:s[1],keyParams:s[2],sessionParams:s.slice(3)}},r.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?r.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+`\r
71
+ `},r.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const s=n.substring(7).split("|");return{keyMethod:"inline",keySalt:s[0],lifeTime:s[1],mkiValue:s[2]?s[2].split(":")[0]:void 0,mkiLength:s[2]?s[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},r.getCryptoParameters=function(n,s){return r.matchPrefix(n+s,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(n,s){const o=r.matchPrefix(n+s,"a=ice-ufrag:")[0],u=r.matchPrefix(n+s,"a=ice-pwd:")[0];return o&&u?{usernameFragment:o.substring(12),password:u.substring(10)}:null},r.writeIceParameters=function(n){let s="a=ice-ufrag:"+n.usernameFragment+`\r
72
+ a=ice-pwd:`+n.password+`\r
73
+ `;return n.iceLite&&(s+=`a=ice-lite\r
74
+ `),s},r.parseRtpParameters=function(n){const s={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},u=r.splitLines(n)[0].split(" ");s.profile=u[2];for(let l=3;l<u.length;l++){const c=u[l],h=r.matchPrefix(n,"a=rtpmap:"+c+" ")[0];if(h){const m=r.parseRtpMap(h),p=r.matchPrefix(n,"a=fmtp:"+c+" ");switch(m.parameters=p.length?r.parseFmtp(p[0]):{},m.rtcpFeedback=r.matchPrefix(n,"a=rtcp-fb:"+c+" ").map(r.parseRtcpFb),s.codecs.push(m),m.name.toUpperCase()){case"RED":case"ULPFEC":s.fecMechanisms.push(m.name.toUpperCase());break}}}r.matchPrefix(n,"a=extmap:").forEach(l=>{s.headerExtensions.push(r.parseExtmap(l))});const f=r.matchPrefix(n,"a=rtcp-fb:* ").map(r.parseRtcpFb);return s.codecs.forEach(l=>{f.forEach(c=>{l.rtcpFeedback.find(m=>m.type===c.type&&m.parameter===c.parameter)||l.rtcpFeedback.push(c)})}),s},r.writeRtpDescription=function(n,s){let o="";o+="m="+n+" ",o+=s.codecs.length>0?"9":"0",o+=" "+(s.profile||"UDP/TLS/RTP/SAVPF")+" ",o+=s.codecs.map(f=>f.preferredPayloadType!==void 0?f.preferredPayloadType:f.payloadType).join(" ")+`\r
75
+ `,o+=`c=IN IP4 0.0.0.0\r
76
+ `,o+=`a=rtcp:9 IN IP4 0.0.0.0\r
77
+ `,s.codecs.forEach(f=>{o+=r.writeRtpMap(f),o+=r.writeFmtp(f),o+=r.writeRtcpFb(f)});let u=0;return s.codecs.forEach(f=>{f.maxptime>u&&(u=f.maxptime)}),u>0&&(o+="a=maxptime:"+u+`\r
78
+ `),s.headerExtensions&&s.headerExtensions.forEach(f=>{o+=r.writeExtmap(f)}),o},r.parseRtpEncodingParameters=function(n){const s=[],o=r.parseRtpParameters(n),u=o.fecMechanisms.indexOf("RED")!==-1,f=o.fecMechanisms.indexOf("ULPFEC")!==-1,l=r.matchPrefix(n,"a=ssrc:").map(_=>r.parseSsrcMedia(_)).filter(_=>_.attribute==="cname"),c=l.length>0&&l[0].ssrc;let h;const m=r.matchPrefix(n,"a=ssrc-group:FID").map(_=>_.substring(17).split(" ").map(A=>parseInt(A,10)));m.length>0&&m[0].length>1&&m[0][0]===c&&(h=m[0][1]),o.codecs.forEach(_=>{if(_.name.toUpperCase()==="RTX"&&_.parameters.apt){let E={ssrc:c,codecPayloadType:parseInt(_.parameters.apt,10)};c&&h&&(E.rtx={ssrc:h}),s.push(E),u&&(E=JSON.parse(JSON.stringify(E)),E.fec={ssrc:c,mechanism:f?"red+ulpfec":"red"},s.push(E))}}),s.length===0&&c&&s.push({ssrc:c});let p=r.matchPrefix(n,"b=");return p.length&&(p[0].indexOf("b=TIAS:")===0?p=parseInt(p[0].substring(7),10):p[0].indexOf("b=AS:")===0?p=parseInt(p[0].substring(5),10)*1e3*.95-2e3*8:p=void 0,s.forEach(_=>{_.maxBitrate=p})),s},r.parseRtcpParameters=function(n){const s={},o=r.matchPrefix(n,"a=ssrc:").map(l=>r.parseSsrcMedia(l)).filter(l=>l.attribute==="cname")[0];o&&(s.cname=o.value,s.ssrc=o.ssrc);const u=r.matchPrefix(n,"a=rtcp-rsize");s.reducedSize=u.length>0,s.compound=u.length===0;const f=r.matchPrefix(n,"a=rtcp-mux");return s.mux=f.length>0,s},r.writeRtcpParameters=function(n){let s="";return n.reducedSize&&(s+=`a=rtcp-rsize\r
79
+ `),n.mux&&(s+=`a=rtcp-mux\r
80
+ `),n.ssrc!==void 0&&n.cname&&(s+="a=ssrc:"+n.ssrc+" cname:"+n.cname+`\r
81
+ `),s},r.parseMsid=function(n){let s;const o=r.matchPrefix(n,"a=msid:");if(o.length===1)return s=o[0].substring(7).split(" "),{stream:s[0],track:s[1]};const u=r.matchPrefix(n,"a=ssrc:").map(f=>r.parseSsrcMedia(f)).filter(f=>f.attribute==="msid");if(u.length>0)return s=u[0].value.split(" "),{stream:s[0],track:s[1]}},r.parseSctpDescription=function(n){const s=r.parseMLine(n),o=r.matchPrefix(n,"a=max-message-size:");let u;o.length>0&&(u=parseInt(o[0].substring(19),10)),isNaN(u)&&(u=65536);const f=r.matchPrefix(n,"a=sctp-port:");if(f.length>0)return{port:parseInt(f[0].substring(12),10),protocol:s.fmt,maxMessageSize:u};const l=r.matchPrefix(n,"a=sctpmap:");if(l.length>0){const c=l[0].substring(10).split(" ");return{port:parseInt(c[0],10),protocol:c[1],maxMessageSize:u}}},r.writeSctpDescription=function(n,s){let o=[];return n.protocol!=="DTLS/SCTP"?o=["m="+n.kind+" 9 "+n.protocol+" "+s.protocol+`\r
82
+ `,`c=IN IP4 0.0.0.0\r
83
+ `,"a=sctp-port:"+s.port+`\r
84
+ `]:o=["m="+n.kind+" 9 "+n.protocol+" "+s.port+`\r
85
+ `,`c=IN IP4 0.0.0.0\r
86
+ `,"a=sctpmap:"+s.port+" "+s.protocol+` 65535\r
87
+ `],s.maxMessageSize!==void 0&&o.push("a=max-message-size:"+s.maxMessageSize+`\r
88
+ `),o.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,22)},r.writeSessionBoilerplate=function(n,s,o){let u;const f=s!==void 0?s:2;return n?u=n:u=r.generateSessionId(),`v=0\r
89
+ o=`+(o||"thisisadapterortc")+" "+u+" "+f+` IN IP4 127.0.0.1\r
90
+ s=-\r
91
+ t=0 0\r
92
+ `},r.getDirection=function(n,s){const o=r.splitLines(n);for(let u=0;u<o.length;u++)switch(o[u]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return o[u].substring(2)}return s?r.getDirection(s):"sendrecv"},r.getKind=function(n){return r.splitLines(n)[0].split(" ")[0].substring(2)},r.isRejected=function(n){return n.split(" ",2)[1]==="0"},r.parseMLine=function(n){const o=r.splitLines(n)[0].substring(2).split(" ");return{kind:o[0],port:parseInt(o[1],10),protocol:o[2],fmt:o.slice(3).join(" ")}},r.parseOLine=function(n){const o=r.matchPrefix(n,"o=")[0].substring(2).split(" ");return{username:o[0],sessionId:o[1],sessionVersion:parseInt(o[2],10),netType:o[3],addressType:o[4],address:o[5]}},r.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;const s=r.splitLines(n);for(let o=0;o<s.length;o++)if(s[o].length<2||s[o].charAt(1)!=="=")return!1;return!0},e.exports=r})(hm)),hm.exports}var Kb=aM();const ca=Rg(Kb),lM=AC({__proto__:null,default:ca},[Kb]);function Dd(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const r=e.RTCIceCandidate;e.RTCIceCandidate=function(s){if(typeof s=="object"&&s.candidate&&s.candidate.indexOf("a=")===0&&(s=JSON.parse(JSON.stringify(s)),s.candidate=s.candidate.substring(2)),s.candidate&&s.candidate.length){const o=new r(s),u=ca.parseCandidate(s.candidate);for(const f in u)f in o||Object.defineProperty(o,f,{value:u[f]});return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new r(s)},e.RTCIceCandidate.prototype=r.prototype,lo(e,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new e.RTCIceCandidate(n.candidate),writable:"false"}),n))}function Jm(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||lo(e,"icecandidate",r=>{if(r.candidate){const n=ca.parseCandidate(r.candidate.candidate);n.type==="relay"&&(r.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return r})}function Md(e,r){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(l){if(!l||!l.sdp)return!1;const c=ca.splitSections(l.sdp);return c.shift(),c.some(h=>{const m=ca.parseMLine(h);return m&&m.kind==="application"&&m.protocol.indexOf("SCTP")!==-1})},s=function(l){const c=l.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(c===null||c.length<2)return-1;const h=parseInt(c[1],10);return h!==h?-1:h},o=function(l){let c=65536;return r.browser==="firefox"&&(r.version<57?l===-1?c=16384:c=2147483637:r.version<60?c=r.version===57?65535:65536:c=2147483637),c},u=function(l,c){let h=65536;r.browser==="firefox"&&r.version===57&&(h=65535);const m=ca.matchPrefix(l.sdp,"a=max-message-size:");return m.length>0?h=parseInt(m[0].substring(19),10):r.browser==="firefox"&&c!==-1&&(h=2147483637),h},f=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,r.browser==="chrome"&&r.version>=76){const{sdpSemantics:c}=this.getConfiguration();c==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const c=s(arguments[0]),h=o(c),m=u(arguments[0],c);let p;h===0&&m===0?p=Number.POSITIVE_INFINITY:h===0||m===0?p=Math.max(h,m):p=Math.min(h,m);const _={};Object.defineProperty(_,"maxMessageSize",{get(){return p}}),this._sctp=_}return f.apply(this,arguments)}}function kd(e){if(!(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype))return;function r(s,o){const u=s.send;s.send=function(){const l=arguments[0],c=l.length||l.size||l.byteLength;if(s.readyState==="open"&&o.sctp&&c>o.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+o.sctp.maxMessageSize+" bytes)");return u.apply(s,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const o=n.apply(this,arguments);return r(o,this),o},lo(e,"datachannel",s=>(r(s.channel,s.target),s))}function Zm(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const r=e.RTCPeerConnection.prototype;Object.defineProperty(r,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(r,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const s=r[n];r[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=o=>{const u=o.target;if(u._lastConnectionState!==u.connectionState){u._lastConnectionState=u.connectionState;const f=new Event("connectionstatechange",o);u.dispatchEvent(f)}return o},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),s.apply(this,arguments)}})}function Xm(e,r){if(!e.RTCPeerConnection||r.browser==="chrome"&&r.version>=71||r.browser==="safari"&&r._safariVersion>=13.1)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(o){if(o&&o.sdp&&o.sdp.indexOf(`
93
+ a=extmap-allow-mixed`)!==-1){const u=o.sdp.split(`
94
+ `).filter(f=>f.trim()!=="a=extmap-allow-mixed").join(`
95
+ `);e.RTCSessionDescription&&o instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:o.type,sdp:u}):o.sdp=u}return n.apply(this,arguments)}}function Ld(e,r){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;const n=e.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(r.browser==="chrome"&&r.version<78||r.browser==="firefox"&&r.version<68||r.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Od(e,r){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;const n=e.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(e.RTCPeerConnection.prototype.setLocalDescription=function(){let o=arguments[0]||{};if(typeof o!="object"||o.type&&o.sdp)return n.apply(this,arguments);if(o={type:o.type,sdp:o.sdp},!o.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":o.type="offer";break;default:o.type="answer";break}return o.sdp||o.type!=="offer"&&o.type!=="answer"?n.apply(this,[o]):(o.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(f=>n.apply(this,[f]))})}const cM=Object.freeze(Object.defineProperty({__proto__:null,removeExtmapAllowMixed:Xm,shimAddIceCandidateNullOrEmpty:Ld,shimConnectionState:Zm,shimMaxMessageSize:Md,shimParameterlessSetLocalDescription:Od,shimRTCIceCandidate:Dd,shimRTCIceCandidateRelayProtocol:Jm,shimSendThrowTypeError:kd},Symbol.toStringTag,{value:"Module"}));function uM({window:e}={},r={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=yb,s=sM(e),o={browserDetails:s,commonShim:cM,extractVersion:ql,disableLog:nM,disableWarnings:iM,sdp:lM};switch(s.browser){case"chrome":if(!cS||!Qm||!r.shimChrome)return n("Chrome shim is not included in this adapter release."),o;if(s.version===null)return n("Chrome shim can not determine version, not shimming."),o;n("adapter.js shimming chrome."),o.browserShim=cS,Ld(e,s),Od(e),Cb(e,s),bb(e),Qm(e,s),wb(e),Tb(e,s),Eb(e),xb(e),Rb(e,s),Dd(e),Jm(e),Zm(e),Md(e,s),kd(e),Xm(e,s);break;case"firefox":if(!uS||!$m||!r.shimFirefox)return n("Firefox shim is not included in this adapter release."),o;n("adapter.js shimming firefox."),o.browserShim=uS,Ld(e,s),Od(e),Db(e,s),$m(e,s),Mb(e),Ob(e),kb(e),Lb(e),Bb(e),Nb(e),Ib(e),Pb(e),jb(e),Dd(e),Zm(e),Md(e,s),kd(e);break;case"safari":if(!dS||!r.shimSafari)return n("Safari shim is not included in this adapter release."),o;n("adapter.js shimming safari."),o.browserShim=dS,Ld(e,s),Od(e),Gb(e),Yb(e),Hb(e),Ub(e),Fb(e),zb(e),Vb(e),Wb(e),Dd(e),Jm(e),Md(e,s),kd(e),Xm(e,s);break;default:n("Unsupported browser!");break}return o}uM({window:typeof window>"u"?void 0:window});const dM={finder:!0,torch:!0,tracker:void 0,onOff:!1,zoom:!1},hM={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},fM={width:"100%",height:"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",aspectRatio:"1/1"},pM={width:"100%",height:"100%",objectFit:"cover",overflow:"hidden"};var Gl=e=>e instanceof Date,Qb=e=>e==null;const $b=e=>typeof e=="object";var fS=e=>!Qb(e)&&!Array.isArray(e)&&$b(e)&&!Gl(e),pS=e=>Qb(e)||!$b(e);function Jb(e,r){if(pS(e)||pS(r))return e===r;if(Gl(e)&&Gl(r))return e.getTime()===r.getTime();const n=e,s=r,o=Object.keys(n),u=Object.keys(s);if(o.length!==u.length)return!1;for(const f of o){const l=n[f];if(!u.includes(f))return!1;if(f!=="ref"){const c=s[f];if(Gl(l)&&Gl(c)||fS(l)&&fS(c)||Array.isArray(l)&&Array.isArray(c)?!Jb(l,c):l!==c)return!1}}return!0}function mM(e){const{onClick:r,disabled:n,className:s}=e,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...e.style};return b.jsxs("svg",{onClick:n?void 0:r,className:s,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Camera Off"}),b.jsx("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"})]})}function gM(e){const{onClick:r,disabled:n,className:s}=e,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...e.style};return b.jsxs("svg",{onClick:n?void 0:r,className:s,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Camera On"}),b.jsx("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),b.jsx("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"})]})}function vM(e){const{scanning:r,startScanning:n,stopScanning:s}=e,[o,u]=R.useState(!1);function f(){u(!0),r?s():n(),setTimeout(()=>u(!1),1e3)}return b.jsx("div",{style:{bottom:85,right:8,position:"absolute",zIndex:2,cursor:o?"default":"pointer"},children:b.jsx(r?mM:gM,{disabled:o,onClick:f})})}function _M(e){const{onClick:r,className:n,style:s}=e;return b.jsxs("svg",{onClick:r,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:s,xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Torch Off"}),b.jsx("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"})]})}function yM(e){const{onClick:r,className:n,style:s}=e;return b.jsxs("svg",{onClick:r,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:s,xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Torch On"}),b.jsx("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"})]})}function SM(e){const{status:r,scanning:n,torchToggle:s}=e;function o(u){s(u)}return n&&s?b.jsx("div",{style:{bottom:35,right:8,position:"absolute",zIndex:2,cursor:"pointer"},children:r?b.jsx(_M,{onClick:()=>o(!1)}):b.jsx(yM,{onClick:()=>o(!0)})}):null}function CM(e){const{onClick:r,className:n,disabled:s=!1}=e,o={cursor:s?"default":"pointer",stroke:s?"grey":"yellow",fill:s?"grey":"yellow",...e.style};return b.jsxs("svg",{onClick:s?void 0:r,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Zoom In"}),b.jsx("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"})]})}function bM(e){const{onClick:r,className:n,disabled:s=!1}=e,o={cursor:s?"default":"pointer",stroke:s?"grey":"yellow",fill:s?"grey":"yellow",...e.style};return b.jsxs("svg",{onClick:s?void 0:r,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("title",{children:"Zoom Out"}),b.jsx("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"})]})}function wM(e){const{scanning:r,capabilities:n,onZoom:s,value:o}=e;if(!r||!s)return null;const u=(n.max-n.min)/3;return b.jsxs(R.Fragment,{children:[b.jsx("div",{style:{bottom:130,right:8,position:"absolute",zIndex:2,cursor:"pointer"},children:b.jsx(bM,{disabled:o<=n.min,onClick:function(){s(Math.max(o-u,n.min))}})}),b.jsx("div",{style:{bottom:180,right:8,position:"absolute",zIndex:2,cursor:"pointer"},children:b.jsx(CM,{disabled:o>=n.max,onClick:function(){s(Math.min(o+u,n.max))}})})]})}const cs={fullContainer:{width:"100%",height:"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},innerContainer:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},overlay:{position:"absolute",top:0,right:0,bottom:0,left:0,pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},borderBox:{position:"relative",width:"70%",aspectRatio:"1 / 1",border:"2px dashed rgba(239, 68, 68, 0.4)",borderRadius:"0.5rem"},cornerTopLeft:{position:"absolute",width:"15%",height:"15%",border:"4px solid #ef4444",top:0,left:0,borderBottomColor:"transparent",borderRightColor:"transparent",borderTopLeftRadius:"0.5rem"},cornerTopRight:{position:"absolute",width:"15%",height:"15%",border:"4px solid #ef4444",top:0,right:0,borderBottomColor:"transparent",borderLeftColor:"transparent",borderTopRightRadius:"0.5rem"},cornerBottomLeft:{position:"absolute",width:"15%",height:"15%",border:"4px solid #ef4444",bottom:0,left:0,borderTopColor:"transparent",borderRightColor:"transparent",borderBottomLeftRadius:"0.5rem"},cornerBottomRight:{position:"absolute",width:"15%",height:"15%",border:"4px solid #ef4444",bottom:0,right:0,borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomRightRadius:"0.5rem"}};function EM(e){const{scanning:r,capabilities:n,onOff:s,torch:o,zoom:u,startScanning:f,stopScanning:l}=e;return b.jsx("div",{style:cs.fullContainer,children:b.jsxs("div",{style:cs.innerContainer,children:[b.jsx("div",{style:cs.overlay,children:b.jsxs("div",{style:cs.borderBox,children:[b.jsx("div",{style:cs.cornerTopLeft}),b.jsx("div",{style:cs.cornerTopRight}),b.jsx("div",{style:cs.cornerBottomLeft}),b.jsx("div",{style:cs.cornerBottomRight})]})}),s&&b.jsx(vM,{scanning:r,startScanning:f,stopScanning:l}),o&&n.torch&&b.jsx(SM,{scanning:r,status:o.status,torchToggle:o.toggle}),u&&n.zoom&&b.jsx(wM,{scanning:r,capabilities:n.zoom,value:u.value,onZoom:u.onChange})]})})}function dd(e){if(e===null)throw new Error("Canvas should always be defined when component is mounted.");const r=e.getContext("2d");if(r===null)throw new Error("Canvas 2D context should be non-null");r.clearRect(0,0,e.width,e.height)}function xM(e){const{onScan:r,constraints:n,formats:s=["any"],paused:o=!1,components:u,children:f,styles:l,classNames:c,allowMultiple:h,scanDelay:m,onError:p,sound:_}=e,E=R.useRef(null),A=R.useRef(null),w=R.useRef(null),v=R.useMemo(()=>({...hM,...n}),[n]),S=R.useMemo(()=>({...dM,...u}),[u]),[g,y]=R.useState(!1),[T,M]=R.useState(!0),[k,L]=R.useState(v),D=(function(){const ee=R.useRef(Promise.resolve({type:"stop",data:{}})),I=R.useRef(null),z=R.useRef(null),[P,G]=R.useState({}),[ne,X]=R.useState({}),Ce=R.useCallback(async(oe,de)=>{var Ie,Fe;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((Ie=navigator==null?void 0:navigator.mediaDevices)==null?void 0:Ie.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");const he=await navigator.mediaDevices.getUserMedia({audio:!1,video:de});oe.srcObject!==void 0?oe.srcObject=he:oe.mozSrcObject!==void 0?oe.mozSrcObject=he:window.URL.createObjectURL?oe.src=window.URL.createObjectURL(he):window.webkitURL?oe.src=window.webkitURL.createObjectURL(he):oe.src=he.id,await Promise.race([oe.play(),new Promise(je=>setTimeout(je,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(je=>setTimeout(je,500));const[De]=he.getVideoTracks();return X(De.getSettings()),G(((Fe=De==null?void 0:De.getCapabilities)==null?void 0:Fe.call(De))??{}),I.current=he,z.current=De,{type:"start",data:{videoEl:oe,stream:he,constraints:de}}},[]),fe=R.useCallback(async(oe,de)=>{oe.src="",oe.srcObject=null,oe.load();for(const he of de.getTracks())de.removeTrack(he),he.stop();return I.current=null,z.current=null,X({}),{type:"stop",data:{}}},[]),W=R.useCallback(async(oe,{constraints:de,restart:he=!1})=>{let De=null;ee.current=ee.current.then(Fe=>{if(Fe.type==="start"){const{data:{videoEl:je,stream:Oe,constraints:Mt}}=Fe;return he||oe!==je||de!==Mt?fe(je,Oe).then(()=>Ce(oe,de)):Fe}return Ce(oe,de)}).catch(Fe=>(De=Fe,{type:"stop",data:{}}));const Ie=await ee.current;if(De)throw De;if(Ie.type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[Ce,fe]),F=R.useCallback(async()=>{if(ee.current=ee.current.then(oe=>{if(oe.type==="stop")return oe;const{data:{videoEl:de,stream:he}}=oe;return fe(de,he)}),(await ee.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[fe]),ue=R.useCallback(async oe=>{var he;const de=z.current;if(!de)throw new Error("No active video track found.");{(he=oe.advanced)!=null&&he[0].zoom&&de.getCapabilities().torch&&await de.applyConstraints({advanced:[{torch:!1}]}),await de.applyConstraints(oe);const De=de.getCapabilities(),Ie=de.getSettings();G(De),X(Ie)}},[]);return R.useEffect(()=>()=>{(async()=>await F())()},[F]),{capabilities:P,settings:ne,startCamera:W,stopCamera:F,updateConstraints:ue}})(),j=R.useRef(D),K=R.useRef(p),Q=R.useRef(S.tracker);R.useEffect(()=>{j.current=D},[D]),R.useEffect(()=>{K.current=p},[p]),R.useEffect(()=>{Q.current=S.tracker},[S.tracker]);const H=R.useCallback(ee=>{(function(I,z,P,G){const ne=P;if(ne==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const X=z;if(X==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(I.length===0||G===void 0)dd(ne);else{const Ce=X.offsetWidth,fe=X.offsetHeight,W=X.videoWidth,F=X.videoHeight,ue=Math.max(Ce/W,fe/F),oe=W*ue,de=F*ue,he=oe/W,De=de/F,Ie=(Ce-oe)/2,Fe=(fe-de)/2,je=({x:Ht,y:Tt})=>({x:Math.floor(Ht*he),y:Math.floor(Tt*De)}),Oe=({x:Ht,y:Tt})=>({x:Math.floor(Ht+Ie),y:Math.floor(Tt+Fe)}),Mt=I.map(Ht=>{const{boundingBox:Tt,cornerPoints:Cn}=Ht,{x:Zt,y:kt}=Oe(je({x:Tt.x,y:Tt.y})),{x:ar,y:Yr}=je({x:Tt.width,y:Tt.height});return{...Ht,cornerPoints:Cn.map(bn=>Oe(je(bn))),boundingBox:DOMRectReadOnly.fromRect({x:Zt,y:kt,width:ar,height:Yr})}});ne.width=X.offsetWidth,ne.height=X.offsetHeight;const At=ne.getContext("2d");if(At===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");G(Mt,At)}})(ee,E.current,w.current,Q.current)},[]),{startScanning:U,stopScanning:$}=(function(ee){const{videoElementRef:I,onScan:z,onFound:P,retryDelay:G=100,scanDelay:ne=0,formats:X=[],allowMultiple:Ce=!1,sound:fe=!0}=ee,W=R.useRef(new Wm({formats:X})),F=R.useRef(null),ue=R.useRef(null);R.useEffect(()=>{W.current=new Wm({formats:X})},[X]),R.useEffect(()=>{typeof window<"u"&&fe&&(F.current=new Audio(typeof fe=="string"?fe:"data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/7z7rPPWHN556p6fP8MMMP///PPP/7+GHK9PT6p7f/unldP2np7YeHjweiYA4GLNAgAiI7u57n5//oc5/yfk6znOcPhwOBwggHCMpA4HA4KEyHOc5znO+hPIc5//+fqJh8XQPh90JU5xQinOf//87/zvP+ggAYuhCKHxdA+Hxd0EA4KKHA4ciB3kOXfXB/gmf8p/B96lAMKAgAADU+BujARHgwdisgHMfAUHAiceBg4ASBgZBiBIBH4ZaHOJsLhf8R+HYEciIgYSwj/+Bi7EqBh+AcBn5P6Bh4TuBmrAMBiZH7gaLEWgew//PkZFMlyek60MpYAShzqqZhm6gCUWeEUWAewEWYGN4X4GDEPwGE8S4GDoOIGAYKgIQOkz//gGARAUB+CwGxTwMAACAEgyAwdAlAxKhzAxXiZ///AxcEwAwJjDAziCAAwQgdAwRgdAsJQDAmAcGzYDwAhZIAKAcIQB4GT9TQMJ9/4Gi1Fv/AcAYUqKBAwGgNAwVBAAwGhwAwdBlAxFg1AwlgzAwNBuAkJQDBgEEDEqGECgChFgBgL//CIswYYH//+HKCpk4K0C9AaKKCAOBeMcR4X9C44BwABCgGAsGYCgTwHAcAwXAiAwSAQV///CJP9lwMBQAwAAAWGo5lVLCcaeneVhJAVGai3//ioaUEf//gaTAYGCj8BnEwfrIqDcsIQb/vmhU/8fAs0G8YGGwKST8Igj4GCATipksVzY8p//90FWJwh45AkX//4fCF9wMEgkL3uQc+gbGJ8t4MBAMBP/hEXf9FRuWBcAfIFjYzQdoLCBwh7IWVlxaX/w8oMCP/+EQT5poGB1Ir90DhiV6af/jFYBpT2BgoQyyt2M0ToBdEaZyzt8nTo3xdNDCTSd//o6F06CjooxRr4jVF/0bOKD6OMUNDRxiMUVFR0FFQPhGXRjDpr4MAEA4wIQUhYOIw//PkZE4nrg08sOx4ACQ0CopD2aAAlwTTBxQeMcwd8w8gZTAgABXwGABOkzpI0wAQAExnWfP4x8ZjKunWdZ1o1Qe6lFGKCNULORQCELAAPnRUf/GIx/0FHGfo3SdZ0qP2cukXKLlRtBKFgAQwCkwJgFRYBEEATmDsLSY2QiQYCEnEra+UZo6F1aKMRr6GhoaP/+j//ov+i+hjLqBgMkYoqChoo1GqCjoY06TpRqjjLOYzRRmMuizmgdKhdF8kjTAAAPMCwGswzglgwAJfzqxmioKH/////////////+ijLOAwFmN0f/////////Q///8ZjP/9DGYyFwIDBeB3MA4AlBWidKM5spykAUAQOCakK+udGqN8VDYjTRuN//0bVX//6Kio4xQFv//nf//kKOoAEIB6SY6hcxenp85///4/DEPf/84Xvl4vF4dwtxfEJgCYQHMSgKCROp4+fn////L4tQf0unz89OecLxeL0ul09y6enzp4dIhKAQFA5hKfLu1nU7/Wr71rRKJUBQSUVt////l08GUPVWgAAYAeNKsxbQNAAhQx3/oKGMM6dZ1Yy6sajMbfKio7lNcv0sScZ47lNcw32ekVFMP9fp/f+mklI6at6u/dBMQuW6y+C5BcgwAA//PkZEomGg1HYGe0riWsCqbEwiY0BJFJMxrCcxGgQ2VK8xxCF1wsABgQBBgQBAYAFCkYCgALkK4fJ00E5ctJN1Uxy5au3XoGcM4dSN0EYZwzhW0WCh1PZwzhnFFQxtnbO2d0Kt6CdXbruggkTEX5Rs4TEQUVsdVXaCcuWXIBQUGmwmgoAGcJiM4dSioHQdBnEY+hjcbov//jcb/43G43G/jCRibfxugdBnDqULO2duvQumztncbo4xGKKNxugooxGIxQULoOgFgUMTA/jbrxiMDmETL+eLhcPThzOeeOZfL5fIcBYuXD/OHv8t//LJFxjxQYHHKDGFkZMtlmKM0RgQfbVtxFIHbQBDRuzRguEI1c9XZ/rWmrZfVU3Oc/9utNNygRQkCoHlAYstNN6DJ1IINpoINppv+WG/+g2mmnUmmmpBAoJIJhnwB5xkymn606Df/t000xhU03UXC5Ol8uFyXy+Xy/l8v5w4cLk4XAvwAYUvl/QL5fTdlKZkEEEEGumaKaX00zIOemf6CH///ywI3LKpiQ2Ef4xYWMSDyI0XwzikpL0ajVHZ3j9DGIjeuXcNfjn96/S/TUz/X/vX////5K/r+v7Jn+LlAoGZOIQIwMKBQM/yppKYURmhGZkR2b//PkZE0mHg1HEG8wyiD7mlwAyDU8nJHi5htakZmZGNiRcpkJhBmUmZYQcM1VDEEBggNDV/ASEZRYKFZIhkXKLlKmk7IVTKmZNJ5KhiqVUqpX+k7+qlVKyV/ZIqZDFDWTJlFyi5TJpKhiXKBQyZzIS5JhBoayV/AQWVpGWkcYTV5O/rIVSv8/0nkr+v6/vyR/X9f1/ZN8kf5/n99/n+f5/lTKmf9/mRP8yFUqpWSv4yJUqpX9kj/MmZNJ5K/z/P9J5P/v6yFUz/CEoywgUMqZkz/FssECIsVq0aPRrRRatFFFykQZJ2Ukl///5KjmksOaA7ALROJLDnEsLbq3GTMVrwb/0dGzmM0DlfBlHQOmrdR0MYi92TX6b/cmDHLclyUVYO/4O8sFTKFTKFf8yhUyhUyhXzKlDKlCsr/+ZUoVlSsr/+ZQqZUoZUoceMfcoZUoZUoVlfOPGcmDHKcpynKg9yXJcr3JclyXJclyYO+DXJclyfgxFZVb3KcqD/g2MxzsY72L9LubPR0dCyf5K5NNd+Tv9GXRdV0XJclyfcl/n+k8kf6SX/iVynvXf///4Mg/1OkxguYzmM5jMcLHMxwwGhgNCwXMLAcwMXTLi1MD7w7tmTdBvMmE0xQFzCwHMDAd//PkZGMpigkmAGOUvCfTgcgAuC+ITswMFzC4oMLhYMByn0xvU+p9Tr0xUxf/0xv///1PBYDhgNTFTFTGTGTGTGTGTGTGTGC4GTFMDAcLAdMVMVMULAcMBpgYDhcDGFwsYXFBikLGFwMGA4MBxgcDKfTEMUoAx2BisD+mKp5Tv1OkxkxkxkxkxkxkxkxlO0xVPJi/6nv////U7CwHTFTFTGTGTGTGU+p71PpjJipihYDpipi/6n1Ov//C4GC4GTGTGTGTFU8WBSZdLhWB//yKlotyLZFiLf8tyyRUipFSKkVGRBZQMiWC3yx//wxUGKsSvDFQGHUAL3QMsHDFIYpCYy2Bmagy6BjLgy6Bh3od58DCLAizBgRb+EQiyEQiwGBFuDAi3/////20QqSBJf/qcumv/////wMZdGXAYMu1gYy6MuBEZdBgy4BjLgy6BjLgy6BjLgy6BjLQy6DBlz2cJDLgRGXAMZdGXAYMuhMZcCIy6sJGaoGMuppwNRl3WBjLgy63wiEWAwIt/+EQi0IhFsDCLAi0GBFkGBFgMJCqaqYAgAYIhBBvwf7kwcqRq7V3IctacvlN6NxqgooxRRuNRiijEZjMGRuMvz9FGozQ+1X2qe1T1S//+VhaWAtKwtML//PkZEIkbgcaAHc1xCJrjeAAtfuUAtLAWf///mWePH95ZFgsyssvM88+jzO6K+z7OM48sH+WDiweZx5YOK+zxWLGJWsa6xadAv02fTZLSpsFpvLSga0tMgWgUgWmwgUmyWl8tMgWWmLSoFJsoFlpSwsmyBg4HhEdgwHAYPBwGDgeBg8HwMHg4DB4PBgOAwcOwMHLwDn5lAwcDgiDgYDwMHA/4MB3//+EQeDAdwiDwYLPhEWQYLODBYERZBgt8Ii34GLBaB5pfAZ0FvEAQ/UfwxULlx+IXx+8f5CELH8fxKhAIDFoHBEDRc3////gwHgaRXgMHYMB2EU/gwZ/gYbw3gY3QbgYNgbgYiAbgwN3/+EQbBEG4MBuDAbAwG4RBtAwbg2////+B9B6F//////////hEdD//////////8DRahEQGCInMNg3LBElgNjDciCwG/lgNiwGxWG///mG4bf/+WA3Kw3KyIMNw2Kw3MNg3MNg3MNiIMiQ2OK0xMiA3KyJLAEZgRARmBEDEYFwBBgEgEeomowol5YAJKwCDAIAJ8sAE+gGBgCJYAQUZ/13LubMu5dyiYOAhKwEFGf9AOoz/g4CFAIol/lgAjysAgsAElYBP////lgJksBM//lgRUxF//PkZGApggsIAHt2wiNLoggAqCz8RFSwIqYioipkjEjHCCSN/+WJg5iYOYmPK5krmTmZk5mZ8sTJYmf8yJiNiIisi/ywRmRkZkZGZGRmRERkREZERGRERkREZERGxEf///hETIMEyBiZEyBiZEzwiJgDEwU4DV2gQGFOBgmP8GAiAwRAiBgIgYCIGAi/4MBHAwRgjAwRgjwMEQIgMcgY8DBGCMDBGCMDEyJn///+BiYQIBlObj4eYLIwsjAOBGFkYBoEQ84eULIw88LIA88PKHnw8sPKFkeHlANAiAaFUDAiMYPIHmDzBZBhZB///8GBOA1sH/Awni7AwnhPCITwYE/CKzBgt8Ig8GA4Ig6EQdww4Yb+F1sIgtwYCwGAsAwWAsBgLAYCwDBYCwDBaHUDF+VEDKgC2BgtBaDAWgYLQW////gYLAWQMFgLAMFoLcGAt////4RMABmBSj4NgwMOGHBsHhdcLrwbB4XXC6+F14YcLrww4Ng8MOGHBsHww4Ng8AUC4AoMQMC4fgw3wutV4QIsAgFYIBWCCVgHeVgHeWABCwAIVgH+YBwB5aRAstKgV6Ba1oMg9avtUVN/qdLWciD/cqD3Jg6DFPuTB/////lYAn//mC8C+YLwL5gvgvGC//PkZFEpLgMKYXt2xB5LogAArbdc+C8VgvlYL/mC8C+YLwL5YBfMNgNkwXixDWoHPMc4VUxVA2TBeDZPYXzXl815fK14sLxYXvK1//NeXzXl815fMtdDLSw3UsMtLCstMtLDLSwsFhWWlgt//8sFhW6f/////+WF7zXl8sL5ry+Vrxry+WF/wMLwX4MC+EQv/AwvBfAxsjYAyqpKA0lpLAwvBfBgXv///4RA2DANAYGgNgYGgNgYGwN+EQvf/BgXwYF//8DC+F4Dd6NgGBf4AgFwbB0MMF1wuuDYMBsGwusDYOBsHA2Dvg2DQuuDYOhdcMMF14YYDGYDEGwfhhgbB0MN///4RBaEQWgZByoYRWYMFvwiDsGwaF1gbB34GDwdC64XW/w1aKxDVgatir4YcLrQbBwNg7////////////+ESfgZPyff/////////4MFmBvvMAERZ8CC5adNj02E2S0qbCBSBZaYtN///oFlpU2QMXIFAYuQK9AtAo7IxLTpsIFJs/5aZRxQawaxGfIg9CsrI+PUqkWdOHp7ODsOl6cOHZ4dsulfLI9/8BAAgMBACsBLACVgBjoAWAE5OTM6WDAR0zodMdHCsJLASWAjzCQgsBJhASWAjysI8wkJMICU//PkZFkeqgcaYDd1th6DogAAqCuIxQwtDA5MdMULgyY6YqnXqdep5TpMdMVRNRL/UT9AN6jCiSjKAZRNRhAMomgFQDfCIJwYCQiCAiCMGAkGAgDBJUA3eVAMEgj////8SrDFIYqh5g8kPMHkDzB5OFkYeYPJ+HlDzB5+AYVQDibCyIPLLEZIsjIliWS0WywWyyWuWCyWJaLZbLJYDHgLAItFvy3///4eYPKBlQTh5QYEODBb//hhoNg7/C62DYPFUKwKsVgNWBq8VkVcVkVUVYrH//hGff/8Iz8GT7//////wiX4ML3gwvgwvf4ML3gZeqoHVGyBl4vgZfL2F1oNg4Lrg2DcLrg2DQw0Lrhh8Lr4YcMNBsGhdcGBcMOGGAFGAGMQsF1guuGG4XXV/4uQXOLmF1kL/8lCXkuSk4O8/FzHzuP0hIucf/CIFAMCgFPgYFAKAwCgGBQCgGHYO4GBVM4GgQI4RCMEQKQOtQjUI1CNcI14MqDKwDIAGQDzh5wsjDyw8uHmDzYeUPN+DEYRRhFEIowYgDQgIhWDApgwKAwKQYFAYFQMKkYDOxHAzsRgMKBUGBX/h5v+Hm4ecPNh5A8wBwjhZHhZAHlDzBZAFkAeQPKHnCyILIAsih5QsgDz//PkZLQgIgsMAFp1xCGLogAAA2rkB5w8oeYLIQ8kPMHkCyGHnAMKoGmAgFkUPMHmDYAtfHPHNkr/JYl8c8lCWHPHMkqSo5onMAkBDnfJX//8IgDBgBhEdAaxSQMHUGAEIgAV4risCcipBOMVRVBO////hEvAxsAwvf////8MPDDww4XWC64XXDDww4YcMPC6wYb/wYGgiGwMplMDYhTCIaCIaBga/////8GA+EQdgYPB4MB4GDwdhEH8Ig8Ig8GA6EQcEQf8DBxlBjoAweDuFwgCQXiL//iLiKCKCL4XCiKRFwEgoRT4iqpMQU1FMy4xMDCqqqqqqqr////xuDd8fv/DVwrArEIg6EQdhEHAYPBwMB+ERYBi0WAwWAZ0FoGLYOB+JfgZ0FoGdBaDBYbn+WHm9xW7/Nzzc83PLDzc8reWlA7S0oHamx//6BflpU2C0qbBaf/8yk/ysn+VkMhTKQrKVk8yE8rIVkKyYsAn/5WC+YICmCApWCGTkxtKMcVWlgFMEBTBAX////0C0C0C/////////LTFpvTZLTlpv/0Ci0xaYtOgWmymyWkAxcWmTZTYTY8tMmygUWmLTIFpsFpv9NnywLmLCx2RgWmQKTZ98UjnzZ1/++D4M6/////3//PkZOgjIg8IAFcbxCaTogAAoCuIzfJ8vfJ8Wcs5fBnD5//++L5f////////6nCKv//+o0o0FUYwqDNGCwgUMKC0VVGkVv//4Yf8LrxVCriqDVoasDVuKsNWw1bisBqwVkVkVX//gy/4YYMMGGhhgwwNg4LrhdcLrAYWGAA0zBsH4Ng3C6/////4MAoGBQIDAKBgUCAwCgYEAsDAoEAwKBAYBYMAoGBQIBgUCYGBQIBgUCwiBAYBYMAoRAgRAoGBBMBooCAYFAkIgTEUxFv/EWxFxFhFoi0LhQuFiLCL/EWqTEFNRTMuMTAwqqqq//////8TWJriV/hERAwRgYiEYGIhGBmIRgYiEYMEQMEcDMSiA1GYwMR+UDMTkA7KIgMRGIGGM0SIrRGjRlhEV4jxov8rR/5YRFhEdQSViCsR5iRJWIKxPlgQYgSViSsR5WJMQJLC78IiKERF4REeERGEREERHwMRGOBmIRhERhERAwRAYiEQGIhGBmIRAajkgG5TEEREDBHwYIwYI4REXCIV/4MCmDArgwKAYUO/gYVCkGBUGBTgYUCsGBUIhUDCoUCIVBgVBgVBgUhEKQMKhUDCoUBgVAwoFAYFcGBQDI6oA5+qQiFAMjBUGBXCyEPIFkOH//PkZPMj6gr6AFdVwifkBdwAoC2Ilh5/8PPh5Qsih5IeUA0TAZrE8PP////wMRiIIqID8piAxEIwMxCMDEQjCIj//BiIDRo8Iogii/4MKwYVhEoESkDEiIGJEgYlfBgmDBIMEAYgSBiBIREAwSERH/8I7wPfuCO4I7v/8GBvAw3Bv/////gwN34RBuBg2BuBg2BuBg2BuEQbhEG+EQbAwG4MBtwiDaDAbhEGwMBuDAbAwG4GDYG8DBsDcDBuNwDRWDcIg2AwbA34RBv///CINvCINgMRIN/////wiG4DDeG+TEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq/zB4OLAP8rBxWDisHlYOKxb5WLTFgsMWiw18LDOnjPxZoxadDOgsLAtLAbKymVhsrDZWG/LAb8w2GywGysNlgNFgNGFwuBQuWnTZLToFFpisLJsFp0Cy0voFAQLFZkMCAQwIBCsC/5WBCwBCwBCwBCsCeVgUwIBCwBDEwEMCAQrAhgUClgCFgTlgCGJgJ5gQTGJwKWAKYFApgQTGBQL5kY0HMjQYnAhWJvKwIWAIVgQrApYAhWBPBgECIEBgE/8IgXhECQiBAMCkcDEwEwMCAQGAQIhoIhsGBsIhvgwN//PkZN4irgr2AAOVqiUThegAnCtMgwNwiG/8IhuDA1hENhENgYbKYHb2IBhoNhENAwN////8IhsDKZS////8IhuBhspgc0KQRDWEQ3///CNf4GAIMDAwgAwAAwhAwAwYAIgwiHBgAMAYGAAGHv///CIBqBqESDEIgRYGoGHBiDEIgGoGgMAYgxgwgxCIETwYFYMCoMCuDApBgU8DCoU//gY3G//wYFOBhUKBEKQYFfBgV8IhSEQoBkYK8IhT/wMKhXBgUCIU4RCoRCvgYVCsDCp3A1SqAYFAiFP////gY3G1TEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVgwCAwCBEC///////8IgUIgWEQIBgUCAwTQMCAQDAoEhECAYFIwGaRMBotWAasdwH/KqBmhFgaKI4GRgKVpjCBTCBPMJHNMFMIFKwnlgJ5hUxhUwGWlpAMuMuWLTFpvQKQLQKLTIFJsoFIFFZb/8woQwoT///MIF8rC+WAphAphAppgpYClgsmwBC6bHoFFpUCi0wGXFguWCwFLgUsgX6BZaVNj0Ci03//+EQKEQKEQLCIFAxMBcDAgFAwIBQYBODAKBgUCAYEAuDAKBgUCAYFAgRAngwCgwCwiBIRAmE//PkZN4iogj2AFdVxiUrhewAhOkwQIBgQ0gbOI4GRhOBiYCgYEAv////CIFAyMBQYBf///CIF8IgUDAgFBgEAwIRwMCCcDEwFAwIBf///CIEQGMDGEXCKBpCIDCEQDCAsYInDFQMMAuYSoTQMVfBlf//+DKfBgAiGDAQMIMIgCIQYADAEGAgwP////8ItgNu2/8DAAAiABgHhECBgQGEQARA8GAeEQIMABECEQIMAwYBBgCDAARA4GAAgYACDAARAwiAgwDhED4RABEBCIGBgDoH2dgZwCBgAP//BhX/+DCiTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqF1ww////////hdeGGDDBhwjeF102E2fTYAowMLjE0zTDfyyMYjEDJTwMLSwFi0/gQLoFIFpsegWmyBQsWlQL9ApNgtIWn8tMgX6BaBX+WmQL9Nn02f9NktIgUgWmwWl9Avy06bCBSbJaUtImyWkQKLTIFgYWoFFpAKFwMLzZgwAwvLTIFlpU2fQLQK///4Yf4YaF1sLrg2DAuuDYNDDQw4NgwLrhh4XXC64Ng3C60MNwbB4XWC64YcMODYPCJYDlMQBlwRLg2DOF1v/////PkZM0eKgz0AE+UuCnLFfAAk3Fsg2DAYX/ww//4YaGGDDhdbDDACFwMuXA2DADlygusDYOBsGhhv//wNU/CKQusF1oXX+F1wuuGGC6wXWDDBdbC6wXXhHv//4AHIFgC0BZAA4Ba4FkADwFsC3AtQAOcC0BYAtgAcAA9+BYAsgW4FvgWOABwC1oq+it4RT0VVG0VFGkVywo1/RWU4U59TlFb1GvRX////QK9Nj/9AtNn02fTY9NhNlAr/QK//TYTZLSJsIFemx///oF/5aZNj02U2C0yBaBfoFAS6bKBfoFVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQiA8GAO/4RAf//////wYA4GAO+EQHAwB4GDoB4GA4HQRB0BhlDIBpEAcBgPDIBgPAeDAHIFAYuLTpspsJsFpi0haRApAtAstIYKClgF/ysF/ysE/ysF//LAJ6plTlYC1ZUypmqtWVK1VqyplSFgBaqqcwAAVIqcrEBAAKmMBERCQhwD5iICIQEyABMAABBVGXF4gIA4DLAAWAEQgLVSsBaq1ZUv+YKClgELAJ////5YBP//LAL5WC+Vgn+WAX/LT+gW//PkZMIhLgrsAFt1yiD7FiB6A9qwmwViybCbCbCBSBabCBSBabPpsegWmwWn9ApApApNgCGBmEwWlLSpsf////hEHgYOB3////4GDkiBxMHhEdgYOB4GDwcBg4HW23gooFYHd/+BnAz8O8Vv//FaBm4rBWh38es2zbAtD1m2PVBqBrBqBrAF7AF3/5el84MkuHTgyy+dL0dRnEajMIyOn8RsZ5HGG/kbIpHIkYUiD0y2WctlZaWSwrKx6FZbxnL54ul04eLhw9Ol84dl86cOHT3Ipb5Z8qKpVx6/j0EkLctVTEFNRTMuMTAwgWQLQAHgLf/////4Fn+EQESEcIgInCIRW9TkrCzH0YIjjWtI+YeCD0woLCBQwsKRWUaRVCBZFZRtRtFRTlTlThRtAr0C0C//02E2fTZQK/0Ck2f9TlFRTlTlFT/9TlFVFRFb/9ThThynIQbWkAREue5S11rKdlkDEVABh61ExYPU+tOD4MQgcn4iwigivxFRFoXDcRQLhoiwioXCeAkFBcNiL8RURQBIKEVEWiLBcKIqIpEXC4QReIoIpCIKAQMxFAFAsIuIr/4YYLr//ww4XWBgwC64XX/hhgw3hhwuv8MNhhguvhdcAUYgaYTAAoWDDg2DQbBg//PkZPYe6gzuADd1uDKsBhBAe89cYYdGjtDT2hDmlD2leaOv9oX0OX/0NNLplNf8ewakNWGrTfTRpphNJtfaeh7T1/tStdtTpqN532lpX/1/kmQ5eaf2hoaV9paGleJAvd0rer2pWu1ar2vk56vVrV5Hj1Nop+/lfv5Zpkem5kX/2vtata2rq783nbvtbW6VjW6a2rq13+rO6VysV58K7tbp0ru6Vrtqa1a67tr6sau1ulYrnfa2v927Vrt21NSuN5X927/D4diAQANh4gEIfxB+IQG/D/4gDw/iGIRD+HRATEFNRTMuMTAwqqqqqqqqqqqqqqqqqiIEK/ititFX///8VcVuK38VsVhXBOQTpq/qm8QCAcBmIxgdfFZCHECpxFBFAuFEUC4cLhsRTEVEUDVoDQD+KrFYirFX+KwKoVgVUVUVeKwGrhWRWBViqFYDV4rMViKyGroauBg/A0YThVgNAEVQqw1fisis4quKxxWYrAatxWIqoqg1dFYxVxWIrAavAaAArIrAqoqhWYrIqvxWMVYrARCADhcKoVYavDVgqhV4qorIrHFWKuKxFViscVUVYasAaAfFY/4YcMNhdfwuuGGC64YfDDA2DwusANygbBwAxhAECwNg8MOF1hD4//PkZOkc4g7yBjd1sDNkDhgqYwtcYoUyiQ0NCkxQ0NCQkSIbGKIyRGEo5mUaNEhGKEHMmaGhI0UokORvMmZmZSZSiMZQkRnKKZkzRoSNCQpQ0NEZoaNFJkhh3KOUJEhIcoSJCQkIzlDlEjMDMyMpQ0JCQzNCRGaNCRISEZoZihoaIwlEHKNGiMzFEjRmSIwlHMyZmcyiGyMxRyhIkIxRSZokSEYGBkiRojAPESNGjQxvKHMmMoSKTJCQkIwlFKLDYWGhoZhYWAAUGBsAwsMDYUAcK4XDPhQVwwLAH/DfgHC6TEFNRaqqBgjwYI//wYI/8GCL///+DBFhERgwRcIiPAzGYgMRKIDcskBgjAxEIwYI4GiRwNEjhFH4MRwYjA0aOEUf8Io/BiLgxGEUYRRQij/BiKDEYMR+DBGBiMRQiIgYIwiIwYIgiIgMRGIDUSjhEReEREBiIRAwR/wYI/8IiP4MEcGCIIiOERH8GCIIiMIiIIiODBHBgjBgjwiIoREcIiOEREDBFCKiAxHJcIiMGCMGCLwYI8IiPhERgwRAwRAYjEUIiIGCP/AxGIgiIsGCL//4REYMEXhERBERhExhExAzyAZiEWDBGERGeKsVsVRVFcVwTnFcVxVgnYqipFUV//PkZPkcfgzeAFaVxDgUBgAgatvIYrgnYqgnQJyK4riqK4rwTsVor4rQAjABAgnQritFSKoqQTsE5C1haxfF7F4XQtULSFqC1i4LwWkXIWkXRdF+LwqAnME4iqCdwToVuK+HAERWAkAlgJB0OB3Doc8OYc8VCsVgIB3DuHAERUAkAkHMOBwOAIisO4dwEAEAEg6AkAl4CeHA4AkKhXioBIOiv8OB3F+LgWkXxeF8XouxcF0XBeF8XBdF8XhdAdouC8AEsXYWsXOKsVBU/FaKmK/FTxXFbFUVPiv/8VfxXitVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAXX/8MN/wwwYf//DDBh4Yf/+DYODDfCIFAwKBQiaANFgUDAgFAwIBcADwFuBY/At8C1wLfgAdAtwLGBawLcC3AsgWeBYwLX4XW8LrBhgiFgMlhYLrhh4XWhdb8MOGGhdcMP4YaF1gw8LrwuvhhoYYLrYXWDDBdcGwfC60MN/ww8GwZ4XXC64GZQsF1wbBnDD4XXg2DcLrBdaDYPhhgusF1uGGC64YfhhoNg0LrQwwYcMNC62F1/g2DYXW4XXC6+GH8DTIW4YeB/wR/wjwR+DP/y06bJaRAtAtAtAs//PkZNwY2grqBFW1xDhTRegABLBstL6BRaVAstN5aYtN/psIFf5aQtIgWgUWk8tImyWkQL9Avy0qbKbKbJaf02f/0CkCy05adAsC3K7+mx5aVAv0C/TZ8tOmymwB2pspsFpPLSlpy0qbCBSBXlpk2E2E2C0paUtP6Bfpslp0CkCy0ibJaZAosWQLLTJsemwgUmz6BZaYtOgUWmLTpsJsoFJslpPLT+mwmz//6Bfpsf6BSBSbCBXoFeWk9NhNhAr0Cy0/+WnTZ8tJ/oFf6bP+myWn//8tMmz/lpf//////8sPTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBgJwiCYMBP//gwE//////wiCAMEgkIggIqIDKpUCIIgwE8IzA4j+EYhGAZMIyDJA5gGRhGcIyDIhEQiIGAgwIRDwiAGAAwYMHBghGAZMGRCMhGYRgGRA5gIyDIwZPBk/wZIRmEY/gyOBxIMgIzCMgcTgwRBgjwYJBgngwTwYJhEQBiBGERMIrwOouAxAgGCQYIhERhEQDBGDBAREgwTCIgGCQYJgwSDBHwiI4MEAwSBiRHCIkGCYGJEQiI/Bgn4REYREeBiBIH6XhERhETwogoy04mpZibFmJuWYmx8n//PkZN4ZrgrkAFZUyDcjofgAA9qc0HafZ8HwNrjaG3xtjaDtJwTo+D55Ow7fxNRNSyLPlqJsAr/lmA/FmWYm5acTQVgTkVQTnBOQTgVxVBOBVFWK4J3FUE7gBABOwToVQTsVhUFcVRXBOhUBORWiuKkVYrCqK+KoqgnQrAnEV+K8E7FQE5xWBOQToVQTsVRW8V4qRUFYVgTsVhXioKgrCqKwqAnYqCtBOhUioK+CcisK8VRUFSKnirFQVBVFcE6FcVoJwKoqCrFXFUE7gnAqiuCcQTsE7xU8VP8VYrgnYrCuTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqn3/l/J/8vHL5f/BhwCETgGpIDOATgEIOFoDcHzgEIDgC+pG7eve1S/6tat7rXupDXSStWoIpGS4TSMQNIySMwpIyAaRkkZ8GJGdBtbwYkZ63tCKRkoIpGWDEjLCKRmEkjOvsEUjJOsIpGa6bOrgxIzsEkjIGJGYUkZVKCKRmqoDkgEjMJJGSYMSMAikZJ3qhp0dq9ru3X1I36FujPbXuxwKbr//waABfg0AC6DUDUDXBqBoAmQawJiGrhqDUGoN//PkZL8USgKcAAblrroTgfQAbhtQAag1QawaYNIAuQa12Lv9si7F2NnXa2Vsi7i/DZl2tlL9l+vL8tlUTUTUTUYQDIBlGUAyifqJKJqJ+p5Mf/U7TETEU7CxkxVO1PKdqeU8u4vq2ddnrsbM2Zs/tl9s67V2NlbIu5sgaA1Q14ExAmAaA0BrDVDXhpgTPDQGuBMA0gTKGgCYgTHDQGrDUGgNcNQaw1hoAmcNIaRIAtALVEgC1gteI8FpBaBIAtcRwkAWgFpBaILVBaIkAWgRwjhIiPEeDXwa/4NUGr+DRwaKBgX/8IhP//wiF8GBMGBP/wYEhEKEQmEQuDAoGFTAwLgwLhG/4MvCM8GSDJCNwZQOXg2DwbB8MPDDhhuGGBsHhh8Lrf4MCQYFCIUGJgiE8GBQMIFhELDDhdaGHhdYGwaGGDDhhuDYMBsHg2D8MMGHBsH8GwYDYMhEKEQgMCeDAsIhAiFBgQIhAYFhEKDAkGBMIhYGEC4GFCBELgYUKDAuEQsGBQMKEwiEBgUGBcIhQYFwYFAwgWDAoRC8GBAYE4RCgwKEQvhEJgYUIBhQkIhAiECIUGBIMC4RCgwJCIUGBAiFgaYLwiEA5cGXCNhGBGwZAw4Ng0MPBkqNqcoqorlh//PkZP8cygrkAFI0wjo7lfAAjhq4SnPor//psoFemygWmwWm/0C0Ci05adApNn/TZQLU5RU9FRFVFdTn1OFG1Gywv/UbUa9Ff0VoFgCwBbAtQLUCzAtgAchHAN8ImAbgBvwDd4RwjQDeAN8I0ImEQEQAbwRgiQjBHhHAN0A3vgG6Ab/CIhEgG5AN6EQESAbmEYI4RABvYRoRABuYRgDehEQiAiIRABvcA3QiQDfwjwDfCICPCJCJCJ4RwiYRwjBEwDehEYRgDfCNCOEQEQEcI+BagAd4FrAscCxAswLfwLAFgC1wLNVMQU1FMy4xMDBVVVVVVVVVBlBkwO3wZAZMIz//////+DJwO0IwI0DsA7cGUI34Rn4RgMuEZgywZQjAZP/hGAcmDKEYDIB28GQGQGXhGgcgRoMgRoHYBywZAZYMmBygyQYFCIUDChQYE4MCgaYJ/gwKEQsGBAiEBgXAwgQLrhdcGwcGHBsGA2Dgw4YYGwZC6/hdYMMF14YcLrYYcMPDDhdYGweF1oYb4MCwYEwYEgwJBgTCIQGBIRC/BgQDCBcIhAMKFhEKDAsGBQYFAwgTgwKDAoMCQiEgwIBhAnCIUGBQiFwiEBicIhAiFhEIgIoBooGieDPA+4GeDPCP//PkZOobXgrkAEY0jjazieQgBKKIBGgyBGhGhGgyAdoMmEaDIB2gyhGwZYMsI0GSDIEaDKB2QOWEaDKB2hGgygcoHYBygdkDtgygcngyAyhG4MgMgRgRmDJCNBkA7QjAZIRoRoMuByhGgyAyAyhGwZYHKByAcgMgRoHIEbCNCNA7fCNA7AZAO0GSEYEaDLA7cDthGgyAyAyQjAOwGUIyDKEYEaEYEYEaEbA5AZQZAZAZIMgRkGXBlBkCMgyAyQZYMngcmEb8GUGQIyDIBywZAZOEZhGBGwO2EbwjcI3hGYMqTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqquDqz8GMDQIvBj///+DGDEGAMAifBj8IuEThFCIEQGPCLwiQYBFCKESDCETBhhGAZGEZ4MjgcSEY4GoRQigxCIEQGPCKBiBrgxwiBEwMIRAY4MQNMIkImDEGIRYMIRYRAYhFBjwYwNQYgwBgBh4GAMQiwYgxA0gahFBgBjgYBFhFhFCKEWBgEWEUGEIgMQYQMYRAMQigxhFBh4GkIgRIRYRAY4RIMQYgYhFA18IoMQYQihFhEgwhFCIDEGIRQieBiEUIoRQYhEwYDAFwGrBog0waAaQawacGsGiDQp9MZMVT3piJjJjK//PkZOYZBgjoaUJQ0DprofQgbhq0dep71PqeU69TpMdMVT6n1OlPKdJjpiKdFZkxlPKdJiJj+mKp/0xFPBoAmYaw0BpwJhDSBMQ1BqAmIEzDSGgNXDRDRhp+GsNMNAEyAmYagJkBMA1BpDXAmECZhoDXhqAmYawJjgTICZBrDSGsNAExDVDQGqGgNHDWBMIaQ0BrAmcCYgTHAmIEzDWGgNYaOBMw0BqDSBMYaA04aA1hqwJhw0ATKGqBM8NYEz4aQJkGoNMNIag1+GsCY+BMQJlDVw0cCYfDXw1ho4aQ0gTCTEFNRTMuMTAwqqoD37wjuhHf/////hGf////hHf/gycEZwRn4MnYMncIzsGTwOdOA507A507hGeEZ8GTuDJ4Rn4HPn4Mn4RnhGcDJwM3YM3gzdBm6DNwR3QjvA927Bm//Bm7Bm/Bm8GbgZvBm4GboR3gzeEd+DN8GbvBm6EZ+Bzp4Mn4HOnBGfA588IzsDnTgZPCM8Iz+EZ/CM4DnTgOdPBk8Iz4RJwGTidBi7AycTgiT4RJ8GE6ESdhEngZPJwGTieDCcESfwYToMJ3AycTwiTsDJ5OhEnwibwYb+ETdwibwibvCJuwYb/4RN/Btf/jYGyNv8bHLUtSzE0/LQBW//PkZPQcHgjQAFKVrjfDmgAge1eMLITcshNy1LX8si0LUTQtCyLQTUteWQmvLItSz4mgmnTJops0umEymDSPsnR9HwfB8k7Pvn0fAvwtcLXF/F+L4vQtQWuFoC0BaReF7AeBfwtcXBdF4XheFwXAtAui9C1haRdi6LwvirgnUE6FcVBVisKgrCvioK+KoqiqAhh3AQFXhwVYrFYCWHMOioVAI4dFWHPDgCAdDgdDmHcBIBEO+HRWAiKsBMO4dFQCAdATw6HBWHBWAgHBUHMOf/gICsOCoV4qw7+KxWHA6KhVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVC11Fz1+NP+/Xkqpr9OfuhQ6lZNWf+XsZc/si+KNoOj/Ntai9j7IISgZAklTqQhjToNTeQoreRdaSDODWvYAVFaWWkQmVuZPP8bRUzq896vc+XS6mm5gnnW7JLnV4z9N5XnW4k86x+uyHyxnWkmdborzraff2SvOtvljOtjd/5XRW8MivOsry/K3gUzrFPS1eFTOttTsul1+lLGdbV3c53h51mdbK7xPOr1SpnWlM63kedZnV4XPK86onnW7myrnWTmRTOqascoabXd/L+yuzS95dv1efjhl92ntYyTuIb6wuWRZFmWRa//PkZOcb/gqMACDf1LTLofggA9qc/gKRZiblqWYm3E24moSQnR9BJj6JwfBaFqWZZFoWvLUshNPxNuWn6bTZHgozRTSaNAY5oGjFQVgTkE6FUVorioK8VBXBO8VRUioAhxVioK4qAnIrYrCqKsVRVBORXBORVFcVcVwTgVBUBORUisK4rCoKwrxXFYE4FYVATjFcVhX4rcVBVFQV4rxVFSKwqCpFcV+K8VhXFYV4qivFUE4FaCdivBORUBOfBOgToE6FUVYqisKgqCtxWFbFQVxXisKgqRU4qioKuKwqCvxVBkH/4Mgf4Rg4RgfgxZBizhFYEVuDFvhFbBi3CKyEVsGLf/4MgAxaDFoGsWYMWgaxYBrFngxaDFnCKwIrAYswNas+DFgRWYGtWYMWBFZgxbgaxbgxZCKwGLIRWgxZCK2EVmDFmDFgMW4GtW8IrAYtBi3Bi0GLAYsCK0IrQit4MWeEVgRW+DFsI9cDW9AYtgxZhFaBrVgMWgxaDFvCKwIrIGtWhFaBrFuEVvBi3hFZA1i0IrYMWYMWAxaEVkGLAisCKzBizCK0DWrIRg+EYIRgQjABkHwODABkDhGDwODBgyAEYIRoRvww4YcKILYKILfhRg5htjY4OQbQ2hNAH8su//PkZP8cRgjWAFAUYjwDofQAi9pcJry1E1LUsuWvE2E0LQTcB+E2LMTctQFEEcWnFYVwTkAI4rRWFYE6BOhWwToBBAQgnIrisETANwIiAb/COEQEbgG+EcA38A3wjhGCMEeEaEeKoJwK4J2KoARBVBOIJ1FWKoJ0CcCuCdRWFcV4rioK4rAnYJ2K0V8VYr8E4xWFUVBVFQE6FXBORWFSKorxVFcVwToE5wTvBOoqwToVIJziuKwJxAQgnUVBUgnAqQCaCdxWirFaKwrRWFcE7FfFeK4rgnIrAnYrCoKoqgnAqCrip4qgnCr/////8Iu8BjvP4Ry5/8Izggc4Zw4RnD/hGcP8GThBk4eDJwgycIMnDwjOD4MnBA3eu9hF3kGO8gx3vBjvAN3jvMGO8CLvAY72DHeAbvXe+DHehF3kGO8gbvHeBF3oG713gG713vgx3oMd5BjvAi7wGO9A3eu8BjvMDd470Iu9wN3jvQY7wGO9wN3jvIRd4Bu9d6Bu9d6DHeAbvHewi7yEXecGO9BjvQN3rvIG7zykGO9A3eO9CLvYMd6EXegx3gG7x3kDd470Dd472DHewY7yDHeAKomwmhZFkAof8tCy4m5aCbcTUswFYsy0/LQTX9NBqBgJgYaY//PkZPcaTdCuAFgWlkI0DfQAe9r8Jxz6CShr8++JsArgjxNBNC0LQsyyLMsgRxallyyLIsi0LUTUtS0AVwFPia8si0LMTXiacsxNizLMTYTcsi1LMsy0E2LUsuJqJvxNyy/E1LMteWgm4mpZlkJuWRZFmWnLQTfgncVATkVcVQTsVIqQToVxWFeK4rwTmATCsCcAnQJyKoriqKwrxWiqKoqwToVRWBORWBOBVFSKgq4qAnAqAnArRVgnIJ3FYVQAgCriqK4qYqivBOsVoJwKgJ3FYVBWFfBOIqCoCcivipxUFSCd4qRV4rCvFaCc/BOhW8VxWFUVhX4r1eX/+DHgaYMOEX/CJgwwYQY8GODH/wYf4RAiQiAxCKBj4GAMYRQiwYcGEGMIoMfhECIBgEXAwCJhEA1BjhF+BhCIDEGARYGoRAYgxCLwYeESEUGMDEIoGAMAiAwBiBrCJ8GMGGEWEUGIRYMAYAxCKBiBgBqDDA1wiBEBiDAIsGIMANANMIoMAYhEBh4GMGMGARfAxBj8GAMANYRAYBFAwCIBhgYhEwNQMYGIRAMAiwNYRQi4RQYwYgahEBiBqBgESEUIqa6Z6bTBpGkmUwmkwaZpJlNCkifmkaaaBymgm0wmRPxSDTTa//PkZOYYTgboZUAQIkCEFgAAe898YTZpJtMJhNilphNdMJhMGgmemDSNJNmkaX6aNJN9MJhMc0E2mzSNJMpg0umU2mDS5oJlNJtNJnpg0DSTBoml0wmzTE8TRpGgm00mkzzRNNMJg0jQTSb/NFNdNGl02KTzRTfTPTSbTKZNLphNJpNmgmUymkwaaaTKZ/TSYTBoJr/ifptMpr9MJlNptMpg0kymumEwmf+mEwmOmkymTT5ppv80eaHTCYTHTSaNBNJtN80/0yaBoJo0k2aPTPNA0OaSaTJoplMJv9MgBAB4MBUGwbwVwUBkFAYDAU4NBoMBqhAELk//h/y1/vz6/6zMnEglwqnIsVSHBzAMMIqXiLgxS8ucoLCKl7VwipeupwYpeAxS8Z22hSl4U+qE1L2goKUva1GUJqXqwkpeAxS81IQpS8smBqXql6E1LyEVLxdEJqXoSUvAmpeJhFS8rpH3CKl6EVLxPWFKXgDUvVL1LCal4kuDFL2EVLxFlPClLyEVL2FKXhdwYpeswGpeqXkGKXqLAxS8wYpeqWk8KUvATUvQYpehJS9Bil6yoUpegipeZT2x1vN5NR2X3KrRuXjFmaS0AUCyE1BHflmWZacTYsvy05ZgAIs+WQCqJoWZ//PkZOwZ+gaYBgbm6EQMAfQAe9r8ZCbiaFkWv5ZibialoArlryyDtCSnyfR8hrE7PpNmiaIxDTGKafTJalqJoJoWQm4mnLUtSzE1LUsxNyy4mpZlqJpy14mgD8WpagKvLIEcJuWnLItBNhNhNxNgH8tSyLMTflmA/iaCaFqJqWf4mxZFmCdCvFWKwqivgnQJzFfwToAIwqgnOKgqCoK4J2KwqisKwJwKwqCqKgJwK4rYqirgnIJ2K8VhVwTmKorYrioK4JwKwrRWFQE5FUE6BOwTgV4qYqiuCdAnYqAnMVBVFUVATkVBVirioKoqCviuK8VwTjxWFfivFUVxXBOcVuKvFaKoqiuCdeEW3Bjb/gxvhFvCLYGN8GNwi3CLf8DbtuEW//CM7+DG+EW+DG8DbNgi3CLfA2zYItwY3gbZuDG8GT/Bk+DJ+DJ/hGdCM+EZwMnQZP8GT8GToRngc6dBk4IzwZOBk8GTvhGdBk+DG8Dbt8DbtgY2CLbBjYGNwi2A2zYDbN4RbhFtA2zcDbNwNu3CLaEW4RbeEW2DG8DbNwY3BjYDbNgY3A2zYItwi3CLbgbdvA27YGN/CLaDG4RbgxsDG4Rb8ItsI7oR3cGb00m0wmTT6aTZoJgUpMc0kwaa//PkZNcYqeLUAAAUHjw8DgQAe88cYTXTXNBpXiQdfLVpLJoaCSJs0TQNAbRpJpDWleaGlDmlfQ9fQ7tBZoa0IeOw3Ccq44TcHgrufDVzQNA0Om0wmDTNE0EymkymumU2mU0aSY6ZE8NFMmiaaYNDptMGn+aJpdNptNps0OmU0J50wNtMGmmEz/zQTJpppNplMJlM9M8FAYCoKAAApgqDIMACwAQbBsAMGQAQaCkGg0GgyCkGeCgNABwAAUgrwA+CoAQNAeHCAOAeAyIQHBwgDg4QYDAGgMEEOEAeA0Q4DxAHh0PEMGYMBsFQYDPgoDMGQV4NBqryAZfhGfwjMDl4Rv/wjcGT/4R/CPBH//hH4H3gzv4M7A+/gzoR4GdBnAf+DPBnwj4M7BnwivA1QIpCKcIpgaqDFgaqBogMWBqgGqgxQinA0XBi8IqEUCKBFcD7/CPwj0I+DPA/8GfBnQZ8I+EeCPwZ4R6EfhGcI0GSDIDJCNCMBkgdsIwGQDkBk4HIEZgy4RoHZwZQjcDtCMgcoRgRoRgHKDJBl4RgHIDKDIEYEaEZgyYMoRsIwGQGQIwGUGUI3A5AZMI2EaDLBlwjQZQjAjAZQoqIqqN+pypx/qNIqoqqNKNKcqchwGrCAPqN//PkZOsaCgjiBUZRnkhEBfAgw9tw+iu1RUqp2qNUNalOVG1GkV/U58sLU48sLLCiwFU4hAYA+qQQgasVhVIYQNWKwmAKpvasNoHIDm4OQHIDlGwNgbH4D+JuWQm4mhZFoJsWgm4I4TcbA2xtA5ODnGyNoHJ+NgHKDl/LMBXLUtS04mvLQteAqCaCbFoWQmha8bQ2Acg2ht8bI2RsjaGyNrjYGwNvjbByja/GxFYE4ipBOIrwTiK4J2KuK8BAK4rAnAJwKkE4FYE7FUVgEIqgIRVBO4qRXFQVBVBOMVwCcE5itBOoqAnQqCpBOIrxVBOoJ0KwJxgnQrCuKsVBXioCcCqCdAnYJyKsVYqipBOgjwiAj/8InhH4RMIkIioAC4RiJCMRP////CNk//Blkv4M6F8I9C/8GWT/8I2SwjZOEbJQZZIGWShGyYMsnwj0P///CPQ/hGyQRsn8I2SCNkgOyVkoMsnhGyQMslCNkoMsl4MsnhGyXCNk4MsmEbJ/wZZP8I2SA7JWTgyyQMiKDIieEYiAcRIihGIkIxFwZEUIxEA4iREgcRYihGIoHESIkDiJEUIxFwjEQIxEwZEWDIihGIoRiKEYiHcYJRIr9kzDmO5cIaApXE/NA0TTTKZGym/0//PkZMQWjdCsAwAWCsQ8Cfwoe89cyaXTKZACgKxsmybQFQCyPQPUbRtA9x6QAoegHKmRtClpk0RSkwaCYE/GyaaZ6ZFJTaaTCbTabTBomgmk2mxS0x0waSaTI2gcgOcT0T5MiedM9M9NCfCeGgNhMJlNJoT1MdNJhMjaNPptNGkmhtpnmgmv+KQmRSE0aaY6ZTKZTRoJg0U0aBopg0emU1/xPzTTaa5o80DRTZoJs0TRNEUhMikJs0P0x0wmkwmUymkwaKb5pppNJg0OaInhpGgmeaSbTBp9N/ptNJo0DTNAbOCkGAwGABgA4NgwAAAMAPBgAQKAyDAZgoCkFINAABWAEDAUBTAABgMBTgqACDcGAAQYDAUqLUlVt///+Bj4MIRcGH/hE//hEwY/wi8GPBj8GH8IgRcIv4RYMQi+DAIsIsIn8GHCLCJCJ/BhBgBpgwwifhFhEhF/gwCIDAGIMIMAMQYBFhFBgDH4GAMQiQNAYAwwYBECIAMIAMAAiHBgAMIAiAIg4MABgABhADAhEAGAARCBhCEQhEIMABh6EQAwIMABgCEQwMAQYD4MDCIcGACIQiHwYGDAhEOEQ4MAENB8hJD7PsnXJ0fZ98+D6LItQR3PgnZHmgPYYRopk0xj//PkZMkU/gLsKkITrkL0CfzIetvgJtNdNGkmkwCPLITf8s+WpaFmApAjgFUsyz49jSTCaGMmkyaRZlkJsWpaiagKBZlmWomh8c+CdcnROj4Pk+Akh9E6DsJ0fJ8c+OTs+idk4J2Tg+j7Pr8nB9nwfAa59k7598+D74Sk+eEkFQdDmKsOhwBEVYCeAiAmAiHcBEV4CYCIWmCHF6FqC0haRcF4XYvxfF2LwvC+FqC0xcC0C/FwLSFoF0XBfi7C0xei8LwvcLQLoWoXheC0BaIWoXBdiNiMY6cZ8RkZxnjqOojAz4zx0HUdBGozjoMw6iMjpxdi+L4uC5F/xd/haIui/bZ/+DGBp4RYMQYgw8Ivgw/CJ4RfBh/hECKBgEUGODH8InhFwY4GoMcIgRIMcInCIBrBhCIESESBp+DEGARfhEA1gxBjBj4RAYQYgxgYwiYRcIgMAiAwBjCJgYAawYYRQMQMAYhFgagYhEA0AxA1A1CJBhBgEXwMQNAihFhFAxwYAwgaYMPCJA1hEBiBrwYQiwYwiBFwYhFgxgawihFCLA0gYAwCKESBoBpCJ4MIRcGOEVB9ALR8BJj7/PonB9HyEoJwfZ9E4Dt5OeTnlqJtxNAH7nwfHPonJ8E759E6PoJI//PkZOAWKgjoZUAQYka0Ffgge9VcfZOCdE7J0To+Cc8JWTo+D7J0EqPoO0+T5PsJSfJ9n0TkJUfJOeTknPPo+z6J2Ts+ycE759/k7Pg+z5J2TonBOeTkJUTg+T5DtJ0Tvk5Pjk5DXPg+idH2HYfR9E6PgnR9k5JyfZ9cnR9cNYJSfROidE6Ps+Cdn0fB8E6DtPs+CdHwfH5OAlR8nyfB98+SdE4J0ff5OidH2TknfPkJMfYSg+Cd8+D6PsnP/JwTk++fYSQO0+D5J0fZ8HwTjn2AWDgdAL8ApALQCkO8GACwMgyAVBiAVhzwY4BeDIMgFMOh0ArDgc4BeAV4cgFsOhz/wP225HGw7wCsO4M8AqHP/+DEGQ7/8OgzgFoM4Bf4MhwO4BT4cDmHcGfDnw78GcVhUFTFXFeKoqYJ3isKuKkVgTsVoqCsKwrCoKsVQTqKorYWoXhfxeF/xdi58XOL4WmLnFYVQToE4FXiuK0VwTnFQVRVFcVhU4JzFfDgdhzBnDuHfALgyDAMQZBgGQCgBUAoDAMh3BkAsDMGcGAYgxBn+HAC0ArwCwMAS5adAry0yBSBfoFBVaKqKwVUVrRXUa9FUOEqVUjV3ySPLkvkzlNlNn02E2S06pvVKWACECpW//PkZN8VDgj+zymq5krb1ewAxJvkqe1XysDVFSqlVIo2o0ispyFVoqKNIrKcqNKcKcFhSjaKiKyKhYWiv6nCnCKijajSnPorKNKcKcqcIrqNoqKNqcKNoqKNKNqNKcIqKN//orf6BSbKbKBSBXlp0CvQKTYTZ/0C/LTxFxFoigioigCLC4cRYRWItEXC4cRcI0IoFwwXCiKwjQXC8LhRFcRcRQRSFwoikRcLhxFRFguHiKRF8E7FYVhVBOgCYVRUACKKgqgE0E6ACJFYVoJ0CcgnQrAnMVwTgE6ioKoRwDdhHhG4RARgDcCMEaEYIiAbwRIRuESEcIwRwiYRwjQjBEgWoFuBa4FngWkIQQigwhEwigx/CL/4RfCKEQGP/wYiEUwYHwYGDAwYAGA4RCEQBEGB0rCNcGU4RrBlcIsGGDCESBiEWDCBhCIEWBiDAGHCKEUGEGEGMIgMAiwigxCIDADQGIRfCIEQDXgYYRfBgBoESEXwY/CJCKEQIsGIRODEGIRQYgw8IgRYMMGAGGDEDGDAIoMcDQIkGMGGBrgwCKDAIsIkDUDWDGDDA1hE4RQMQYgwBhhFBhBh4MAMYRMIoRAiAxBjhF4mhZFpxNBNy0LQTUTXhKglR9FqWpaAP5Zi//PkZNYXkgTkGEJwlkXcDfQAe9r8bCa/k5JwTriacsizBHE6CSH1w7efHLPgjuJqWnLITYTX8tRNAH/ialqJuJuWZaFkCO4m5aE7J2TonB8E559nyEnJyfB8FmJrxNxNhNS1E3LT8sxNC0E0LTlqJuWQm3E15ZiaFqWRZiaCagP5aCblkKoqCsCdioKoqwToE6FcVwAhRWBOIrCpFbgnEVRVFUVIJ2K4rAnIqioKgrcV4riuK0E4FcVQTsVxUBOoJ3FUE7itFYE7FYVRXFUVwTkVoqAnYJxBO4rReF4XYWsLWLoui4LwuC9AdsLQL0LQA9C8Lgvi6LguBahfFwXAtIvQQ4vCqKwrxX/8E5xXit4JwKzBnwj+DF+F1guvBiQYkDRIR8I/gz8Gd4R/wYsGLBi8I8DPBneDPBnwZ/8I8DP8I8B/0Gd+DPA+8I/+Ef+DOgzvwj4R/hHoM+Ee4M4D74M+Ef/A/7gfcDPBn4R7BnfCPgz4M7Bngf8DPwjwR6B/3CPwj0Gfgz+EfBnhH8GfwioRQGIBqgRUDVAYoGiBFcIoBqoMWEUA1UDRYRUIqEUA1WBooGiAaqBogRUGJwigM8I/gz+DOCPwj/Bnwj3BnBHgZ4M4I+DOhHhNCz5aiaCb//PkZM0YugrgAAASBEUEBfQAe9rclmWompZ8shNyzLMsy1LMBUAfhNxNicBJCcE5J0JpyyLMTcBVLXloCO5aCagKACiAqflqWYmvE3E3BHlmArFnxNRNC1LUBS5aFoWhZFmWR8k5CTnxz4PonZ8E5Pg+j4LUshNQH4TYtSzLMshNBNhNSyAViyE0FQE4FYVoJ0CcRUgnYqisKoJxFWAhiuKgrCtFUE7FQE5iqKgqRVFWKorwTsVxVFYE7FTFTBOxVgnAqRXBOPisK4BOK0VoriuK0E5BOxUivFcE5FYE5FQVBXFQE6FQVBVFYVxWioCcCoLovi4LoWiL0LSL+LouBaIvBahdi6LoWgEMFoC1hacXxdC14uipiqKn8VPFbiqKsVb//Bm/+EXgx4RdhFb///hE1/8GLP//CKwIrQjoGa/wPewZqEdYM1wZqDNAetgzWEd8GagzYM2DN4M1wjoI7Bm+DNhHcD3rA9awZuEdwZvCOwjsGaA964M1A978I7hHQR0DNge98I6hHYR1wZrBmwPWgPWwZsI7wjqB63COvgzQR3BmwZsGaget8D3rCOgZoGa4R1gzYM0EdwZsI6CO+DN4R1wZsD3oGaBmwjqEdAzXCO/4R0DNAzYR0WgI8TQT//PkZL4XFgTcAE6Tekf8EfQAe9t8YTXiagKwCsJuWXLMTUtC1LMTT8TYTUJP+fAdomomoD8JuWoCgWoI7iaFkJqJqfZ8hrk4CSE5Pk+Cdk5PgnBOT7JwTg+uWZaiaCbcsgFAsy0LPlmJsWYmom5ZFmWpaibiaAjy15ZFkWQm5Zll+JsJqJvy1E0CThJz65OQlJ8H2TknZOT759k6J3z4PgTQTcsy0LITflmWfLUsiyLITYTcTT8syzLQsi0LMEcWZa8tSyE1LTibibFqWYI/8shNCyE1LQsy1LUTUBTLLloWXLUsiyLUtBN+JqJvy1E05Z8TcsxNeWn/LTnxydHwfZ9n1ydk4PsnHJyfR9E4JwTgnB8k4588nB9cnR8c+D7PjxV4q4r8VsVgTgE4/itFShX/xV4rirxVFWKoq4qfxX8E6xVxUBOYrCtwTvwTj/xV8E5/irBOsVuKwqRXFTFQVorCrFf/xWioKwrCtioCcxUFUVAToE4FUVxWFQVhUBO4rgnUVIJyKkVgToE4ipFUVoq4qisKsE64qCoCdxUFUVxXFUE78VxWFQV4qiuKgqiuK4CCK2KoqirBOATsE4FWK4qxVFUVhVFYE4gnIriuCcQTiK4rCoCdCtirBORUiqK2//PkZLAWsgzuADQNNkZj/fjIe9r8K/FXFUVwSE5aiaAKgmhaFpxNQkp8n3z5PsJOGsffLQsyyE1LItS1E1Af+CPLMTUTfibFmJoWQmxanzydHwTsnASknBaCalqWom5ZcsxNyc8nASsnHDt59BrhJgkpOicBKg7D7JyfZ8E5Pk+Cd8EeWXE0LQsiyLQtSyLIsi0LUTYsy0E3LITQshNiyLUsiy4I78shNy0LMVcE6ipgnArRVgncE4wTsVIrCqCcCtBOYrwTgE7iuKwqCoKwrcE7BOQTqKgqiqFpBEC1gPYD3F0X4WoLTF0Xxei6FqC0BaAtQWgXxdwtWFqC0haBW/FQVRUBOBUFcE6ioCcAnEVRX4rYrxWFUVBViuLsXgtAuC6FoBDBaYvi7F8XxexdF8XhcFyI//gx//CJBhgxhEwY/+EXwYgx8ImDH8GPhE8GPhEwigwhFwNQNQNfhE+DGDAGHCIBrhEhEBh4RQMAY/gYBFBhhEAxCIDCEUDEDHBiEUIoRQY+DCBp4McGEIgGgMcGIGMGIGIGgRQYgxCKBiBjBgDGESDADWBgEUDEIuDADWBpBiEUDEDDgYgwBgDEDQDUGIGgRAYQYAxCKBhCKEThEBgBiEUGIRQMQiQiwNAY//PkZKwWNgjoZUAQREakFfQAe9t8YMfwi4GBaFoJsWpaFlyyBHctCzE25ZiaFoAocsy1E24Sk+idk6LMTYTYTQsyyLUtCyLQTUswFYJMGuTg+CdHwErPotAFAsuJtxNCz4m4mvBHiafloWZZ8YppBqzTNI0jTNBMpg0jTTZZFqWfE3Af/xNf+WomhZ8suWZZCb8tC1LQtS14m/LQtBNhNOfR8hKCc8nHJ2EqCUE5CSHxydk6Pg+D7Ps+Sdk6LUTQTcTcTctSz4mwmha8TXlmJvyy5ZiaFl+WpZFoWZa8TQshNCz4mhalmJsWfLQsuWRactBNRNC1E1LLlly0E2PgJWfR8h2H2fJOSdnx+fXPs+T5PgNbnzz6Po+T7JwTk+z4PonROglJ84qCvxXxUirFX4q4qeCd1f8InCI/4R/CP//4RMI/CMEYI4RAR8I8IjCJ4REI/gG8ESEfCOERCP4R/+EaERCPCNCNCI4BvQjYRMHINobIOfjZBzDZG3xtja42gcw2PwcvG2Nng5+NgbY2wcn42htDYGwNrjYGwNsbX42vxscbI2gc3Bzg5Qcg2uNvjaGwNgbI2+Dl4OUbI2Qc42RsjbBy//g5eAboR4RwjQDeCP+EcI8IwBuwjwjBEBEA//PkZKoZMgrqADXt9EV8FfQAe9scG+EThEBGCMESESEbhEQjwjwjwjBHCIwiQDcCNCI/hHE0/LQBSLITf/lqWoSvk7LT8BWLMtRNAk58E7Po+CyLQTcsyyLUsi0Afi1LUTUTUtBNS05aFkWpZHzwkoSgnB9HwfQSsTYsizLQtRNRNgFf/8NcJWEmAWCdn0To+T4CUHyGtxNiyLT/lmJqJqJqWgmpZFqJsWgmwmwmwmv5ZiaibiactBNv/yyLTiaFkWZagKgCmJqWQmgmom3E0LTibAKfE0LLiuKgrYqipBO4JzFUE5BORXBOhVioKwqRWBOYJyKkE6BOIrYqCqCcxVxVFUV8E4FSCdcVgAgCuKkLTBDC6CHi+LwuRfha4uC+FpF8XQtAWgB2wtAWoXBchaBfwtQWnFSCdxVxXFUVhUFYV4rgnOK3wTiKir//1eDCsf//7/+wOYd///ei/f6lmiqGXpyOlCSRm+yP3UtDhFIzqBhwCFHAGFHABYGcAnAAMOAAYcAAw4BYKOAIROANgicAQYcABE4AAzgE4B+1wmcAwYcAK+sDOADgFLCJwAlWBnABwABnABwDWraETgEDOADgDBiRkgoJpGaP+64RSMoRSMGBiRkkwMSMlq7AxIy4//PkZJUYEgieBFw3fkL8FgAied8AROAAicA8DOATgAGHAAROAFwM4BOAGBhwADDgAGHANQUcAgicAYROAfgw4AIkbPNNNpo0TSNBNJgUs0l7lomEwmRSOaRp80zQFK4nvTInnTEGgwGwAwYmOmkyaInppJpMJg0k1+KUaaaTCb42U0mBsGiaSaNNNpo0OaKZNE0jTTSY5oGmaZpJrphM9MGkmDQTCZBzpg0OKR+mBtdMJobfTSbTfG2KSaBpGgaZomiaBomn02mOmkwmjSNPpjmmaKZNA0zSNFNCeClJkT40DTTCY5oJk0kyaJpdMppMdMdN80TR6ZTXTfNJNmimumem+aKZTKaTaaTRops0kwaZppk0+aSa6ZTKYTfTfTPTHTKa5omgmEyaJo9NmkaRp/pnmmaf6aNNMplMplMdMpv8TxMJlNplNJn9MdM1OM6hWa/EjiRiRiO/xIcSP+GgCZQ1+GvDRDV//4aP///4I8EwTwTBLwS/4AHgnBHBHgiwR4JgAgS4IwAYPA8ADg+AAAAFwfB4L4WADC2AGAGFwsFwuD2FgAcAPC+F/B8L4X/B7B4L4WwuD+AGDwXACAAC2D2AEFgfCwAAAAXB8LhcLeDwXCwPYPA+ACACD+AH4XwA//PkZJMVIgb2ejVLxkBMEgTIe898vwv4X/ACB/C4WwtgBg/gA4PA9gBeFhLRTXTRomkmP0yJ6J+mPy0NA0OvibNDQmfzTNNMjaFKNATxMiemiaRoGkmE2mkwmTRTHNBMGiaCZTSZTZomh0PaV9fX2hoX14kzSmOaCY5pJr80U0aPTfNFMps0jSNJMmiaSaTKb6aTKYNLphMpg0eaJoGkJ8aBoppMppMJg00xzTTabNFNJpNJpNpnpg0DT6bTRoppoJMWrSh/690NQ5paV5D2le/LND2hoQxDF/rzR1/r/aWhfaWleQxfXmheaevNDS0tLQ0ryGoch/X15D+vLy+0oc0ry/19DUOXuvIc0oav9oXkNX1/r3X18QCGHQGQHB8PiAPAaHgPDsBgcH+Hqv//+DJ0GNuEW4MbQY2wZO4Rn///4R34R3Qjv//8Gbv//8GbgZuwZvCO4GbsD37+Ed3A586DJ4Rn8DnToRn8GTsGT8GToRn4HOngyf4HOnBGeDJ0IzgjOCM8DnTwjOgydwOdP4RnYMncDbtwY2A27cItgNs3CLeDGwMbwY3CLaEWwRbQi3A27eDG0GN4G2bBFvA2zcItgY3A27YGN4G2bAxtA58/gc6eDJwHOnAyfCM7A588//PkZLMYngTSAFAUhEYcDfggw9V8DnzwOdOBk8IzuEZ4MnAyfgychsy7F3oE13Nl9sy7myrsL6qqOU5anCqkHqNDI3KVUTEU8GNU7U6gxyHKchyVV/Xa2Zspfds3rubK2VsjZmztk9djZi/TZV2NnXYu0vsm0yaBoDZNEbA2k0aKZNjmwbH/Nvm2bRtGyBVArD1G0bQPUevg9h6/+PRzZNkCrzZNgesegesermyPQPXzbHpNvm0PQPUPSbJs82TaHqAtj082h6DaNn8eo2DbHrHpNjj1m1zYHqNo2jYNnmwbPNgek2ja5sj0D1m0bJs80xtJlMdMCeps0U0meaaa6b5p/mmmU3zRTfNFN/pgHPzQNPmkaaaTXTKbTRoJk0zS6b/NBNdNJlNGj02aH6Z4IgAEEYJ4I+CMEQJcEUEXBOpHDX/w1Q0Q1Q1cNWGvw0Q0/hp/AmIaA0cCYhow0w1/w0hoDRhpw1w1BrgTLDXw1BrhrDQGgNQEzAmOGuGiGgNfgTHDQGoCZw1w0BrDWBMIEzDVDTDUGgNfAFwGjBrg1A1YNcGsAXAaQaABcBqg1g1QagaINYaoEyw1Bow1YaA1hoDSBMw1gTICYQJkGrDQGoNGGmGsNcNQawJkGuBM4aIa//PkZKAYngTsATQNQkKMFgDifh7AYagJkGsCZ+GkNWGiGsNAaYaOGgCYgTENQaw0Yaw1Q1Q0/hqw1BkAfmkaCb6ZTCY6bNBNLwmqGA5fzSTCb/lgwXOmMmMmTQ5pmkmUwmkymfzRTaZFJ6aNM002NrppMpg0kwKQmE2m0yKUaKaE95o9MJj9N9NJk0UymOaSaE/TabNNNmmmk2mU2aHTKZTCaNDjaTJoGimkyNvpk0TRTHTf6bTRopg001+mU0aXNBMjYNA0k2mjR5pfps0U100mUz0ym02mDRTHTaaTRpplMc0kz0ySA000mDSTKbNI002mzQTHTaYTf//NA0zQTBodNJk0UyKSaaZNJMprmkaP5oGmKUmEymUyaCbTHNBMJlN80DRNBMmkm/00mUwaZpprplNpvmiaJo80+aSa//TaY/6ZaH//wY4ReEX4RIMfwiAxBh/BhCJ/+ESDDwYcIn+EQIoMAiQYAw8IsGIGGETBj4MP4MQiAxhEAwAxAxBjBiEUIgMIMcDCDAGIMcGMDEGGBgEUDTwNfAx4MAiwiQYgwBgEUIgMIRAiQYhFwYAwBhA1CKDEIoGoGgMQi4MeDADGEQIkIgGMDCDAIoMAiQiAYwYYMQNQigwCJBiDEGAR//PkZJwV+gzoZUAQRkZsCfQAe9tcQYgx8GEGIMQiwMAY4MANAMcIoMSyE1E1/LMTUtCz5OD5PkJJz5Pk+uA/FqWRaib8TUTUTQtC05alqWYm4momgI8TYsxNCzE3LUtQFEsgFM+z6J0fB8nz+TsNcnB9BK+Tk+g7CdhJT6LTiaFqWYI7lqWoCvy05ZlnxNy0/LUshNBNvwR4moCj+Wv5ZlkJqWpalkCOE1E1LQsiyLITUBULLlqWZZlmJsWhZcsi1/4CiWpalkJqJuWvLXlkJsJpyy4mwm5ZlmJuWXLUTQteWgmgmwCsJoWfE3LMsiyLP8TTlkJuAolqJryzE1LTibCbloJuWhZFoWYmxZ8TcXIvxeC0i+FrF0B2i4L8LSL4uBaIDyCHF8XRfF6FqgiwtIuYWoXIrYqAncVvxVip8VIqCvUxPqtFbFf/4q/8V/8V/iririr8VATjxXipxWgnYq+KwqfFTFQVoq+KsVBW8VhUisKuK0VRXivFYE4FTBOhVFcVRV4riuCdCuCdCtwTiCcCqCcgnYqxWFcVIJwKsVxWisK8VxVgnArYqRWFeK0V4qgnQrgnYrfBOoqAnAq4J0CciqKviuK3BOoJyKsE4FUVoqisK2KwrAnArgBAFSK4//PkZJ0VagjyJgGtbkOkFfwAbh4AqRViuK4J0KgrCrFUVxVjOEeDQgjlcT4T40xtjaNI0uaI2QciGNJIl4kJZtCGIaSckIm6GL3TQ2zRTY2UwmjSNE0fxS02aY2BsJs0/+mzSE8TQpHTKZTaaG0aQpApZp/mmm+aHTfTCZGwNgUk0E0aRp/ilJlNJgT5MmkJ9zQNA0TQTH6ZG2mk0mk0mk3zQTKY/G3zQTHTabTBpGgmU0aKaTJpJpNJtMphNjYTfNE0emkymE2mEyaCbNBNfmkaJpdNJnpg0k0mDTTCbTaZTBp80k2aCbTfNE00yaCb6bTZoplMmmaKZTKaTJpmiaHTXNJNdMDbTab6Y6Z6ZNNMJhMJhN9NJrmim02m0ymU300aPTSa6Y//5pJpNdN/9NppxWxU4Jx/xWxU/xU4qcV/ipiuKwqxWFbioK/8VIqivFTwTkVgTkVor4JxFXxX8VcVxUFQE4FaCcwTvBOIqwToVuKwqCtFUVYqxXxWFeK0E7FQVYrwTnwTsV4rCqCcfFaCcRVFQE5gnAr4JyK4r4Jz4J0Koqip4rCvisKoJ3xWBOME7iuKgriuKgrAnAqgnArxXiqCcgnYJzFQVQTmAEIVYrwToAIYrwTiKkVQTkE5//PkZK4XGgzsADQNAkIcCfwAe898FXFTFYVxXxUFQVkzzS5oilg5TTTY2kyaJpJtNGgJ8aKaTQ2k2aCaNI0eaSYNJM/tKHEiQxfJG09MmgaSYTRppg0TRNNMJlMptMCfppNprmiaA2jQNLmmaRppk0jRFLNP9NJhMGmaQpZpJhNCkGkmE0J+mxSk0m0x02mjRTKbTCZ42EwaQpJpptNprmgaRpmim00J4mzSNM0kymkyKWmE0muaKYGwNjmgafTPNE0U0mUwJ7+mem01+J8mhSk2mjRTSb6aTCbNBM9MpjpjppMpk0E2mE2mE2mjSTfTaZ6YNFMcT1MpnprptNmim0wmE100aSaTRo9MGjzTTHTaaTfTSaNLpoFMAAFYNBQGwAvwAYM4NgqqkjaAN3d3d3etERNK5CZ/3Ctf8AaiAc/u7vaIn/+8XPv//+GDKv8W1/+AC8K4Yw+94xe940jgceOBwOcRaxGwH4EuNIjBfxazB8HhkwVjIAII/vDkjG/wAcJPeF5e98hNgSYLWMFvhZ73pX06aoehpmh01hMJtM9K3TKY9E10x+memvlIpZM9MUTCbShbUrtM+n5ophNZuXK+0wmemumMCemkmvc0Uwm/lJJlLe5oJZI0SyW6R0mE//PkZLcXlgrzECFvrEmMEfgAfh7k2aORpbTYUo9SBNsekGYNVKgqg6hrUXK4Q42DOwPWbILEzBSumEgkWJPU8S72G5wUuGDwguEKa1Q0UykS3Bn7FJNgg5qoEgpsGabBtGabZt7NrKCNgLYes1idmabBtm2bZsBRm0PQbF9mwPSPUBbMwzB6QojYM42ePTzbMwzR6TaNs1eBVNv81yDUJ2QYhJtD0m0PVe+x6T2M8HsbFwsh6B6D7HpugT2uZhO6HqZhmE7ISZhhkFNcghtmybBnnsD1Ho49ZtG2bZs5PVBc2EEepCaEHNjj1EJHq5smabZtmwbNEEPR+bJse9z2PY2T1SN0rdNJq6yXI06COvNJj9MGmkkGmUj7pI0TToNGlEsNEnCW10ymi5FtNFKpvps0kz0uW3aaTF00mTSzdNJu0KFYz1KjaGAhyoQCFGM//zFARgIUZ/oZpdCttay6M5drW1joSj6Ekk1b7J7R7aoQNlPrWBKLTTzOsGT5yYxLrtHTy2iUxEkES0HIBVD066VjGj31odPkkSjJtbWs6OIjKmlXHR9K5MTv5pdZolE10kk2lly74TFx5KTXeTGLrS6ExiucvJSSDUdXZm3NLn1rtYBCUEoRj77WOhCPc+g5//PkZJ8XPgzoAABMTrz8BfQyY9ONGxJULutaa1TE5LHxWEo+XecmMa3p0kqBCR6qOFaFUGpNJIIjqVi0ylBqJIkiSJIkmJj605EkSRJPetWAyVacmodBUVhGfrAZPF0AUrgRLNiqDU4VHo8h6HRObJJNdqlRBMFT0qdNE0WZhmay2tCuOY6oieWieianCnVSbzjd7SGhrLi6eUSeLcZTWqdML5PM50uOGJms9VqtYU6hrgrm4V0frUzTvYsiegR2FOkqUxSKdVCpmRCSkIAUZ4VPhqEKgFDU2VhUiIhUaIg0RAkTBYEjYBUbBMuCJgLAkCUBUinABgBE3/9EQqFRM0s0qzktk9ZFqqFC6RULE11JVDkd8Y1vVFOx9oUIpZ8Vnq5klkxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"))},[fe]);const oe=R.useCallback(de=>async he=>{if(I.current!==null&&I.current.readyState>1){const{lastScan:De,contentBefore:Ie,lastScanHadContent:Fe}=de;if(he-De<G)ue.current=window.requestAnimationFrame(oe(de));else{const je=await W.current.detect(I.current),Oe=je.some(Tt=>!Ie.includes(Tt.rawValue)),Mt=je.length>0;let At=de.lastOnScan;(Oe||Ce&&Mt&&he-At>=ne)&&(fe&&F.current&&F.current.paused&&F.current.play().catch(Tt=>console.error("Error playing the sound",Tt)),At=he,z(je)),Mt&&P(je),!Mt&&Fe&&P(je);const Ht={lastScan:he,lastOnScan:At,lastScanHadContent:Mt,contentBefore:Oe?je.map(Tt=>Tt.rawValue):Ie};ue.current=window.requestAnimationFrame(oe(Ht))}}},[I.current,z,P,G,Ce,ne,fe]);return{startScanning:R.useCallback(()=>{const de=performance.now(),he={lastScan:de,lastOnScan:de,contentBefore:[],lastScanHadContent:!1};ue.current=window.requestAnimationFrame(oe(he))},[oe]),stopScanning:R.useCallback(()=>{ue.current!==null&&(window.cancelAnimationFrame(ue.current),ue.current=null)},[])}})({videoElementRef:E,onScan:r,onFound:H,formats:s,retryDelay:S.tracker===void 0?500:10,scanDelay:m,allowMultiple:h,sound:_});R.useEffect(()=>(y(!0),()=>{y(!1)}),[]),R.useEffect(()=>{g&&($(),U())},[g,U,$]),R.useEffect(()=>{if(!Jb(v,k)){const ee=v;n!=null&&n.deviceId&&delete ee.facingMode,L(ee)}},[n,v,k]);const te=R.useMemo(()=>({constraints:k,shouldStream:g&&!o}),[k,g,o]),Y=R.useCallback(async()=>{var P;const ee=E.current;if(ee==null)throw new Error("Video should be defined when component is mounted.");const I=A.current;if(I==null)throw new Error("Canvas should be defined when component is mounted.");const z=I.getContext("2d");if(z==null)throw new Error("Canvas should be defined when component is mounted.");if(te.shouldStream){await j.current.stopCamera(),M(!1);try{await j.current.startCamera(ee,te),ee?M(!0):await j.current.stopCamera()}catch(G){(P=K.current)==null||P.call(K,G),console.error("error",G)}}else I.width=ee.videoWidth,I.height=ee.videoHeight,z.drawImage(ee,0,0,ee.videoWidth,ee.videoHeight),await j.current.stopCamera(),M(!1)},[te]);R.useEffect(()=>{(async()=>await Y())()},[Y]);const ie=R.useMemo(()=>te.shouldStream&&T,[te.shouldStream,T]);return R.useEffect(()=>{if(ie){if(A.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(dd(A.current),w.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(dd(w.current),E.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");U()}},[ie,U]),b.jsxs("div",{style:{...fM,...l==null?void 0:l.container},className:c==null?void 0:c.container,children:[b.jsx("video",{ref:E,style:{...pM,...l==null?void 0:l.video,visibility:o?"hidden":"visible"},className:c==null?void 0:c.video,autoPlay:!0,muted:!0,playsInline:!0}),b.jsx("canvas",{ref:A,style:{display:o?"block":"none",position:"absolute",width:"100%",height:"100%"}}),b.jsx("canvas",{ref:w,style:{position:"absolute",width:"100%",height:"100%"}}),b.jsxs("div",{style:{position:"absolute",width:"100%",height:"100%"},children:[S.finder&&b.jsx(EM,{scanning:T,capabilities:D.capabilities,onOff:S.onOff,zoom:S.zoom&&D.settings.zoom?{value:D.settings.zoom,onChange:async ee=>{const I={...k,advanced:[{zoom:ee}]};await D.updateConstraints(I)}}:void 0,torch:S.torch?{status:D.settings.torch??!1,toggle:async ee=>{const I={...k,advanced:[{torch:ee}]};await D.updateConstraints(I)}}:void 0,startScanning:async()=>await Y(),stopScanning:async()=>{await D.stopCamera(),dd(w.current),M(!1)}}),f]})]})}/**
96
+ * @license lucide-react v0.469.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const AM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zb=(...e)=>e.filter((r,n,s)=>!!r&&r.trim()!==""&&s.indexOf(r)===n).join(" ").trim();/**
101
+ * @license lucide-react v0.469.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */var TM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
106
+ * @license lucide-react v0.469.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const RM=R.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:o="",children:u,iconNode:f,...l},c)=>R.createElement("svg",{ref:c,...TM,width:r,height:r,stroke:e,strokeWidth:s?Number(n)*24/Number(r):n,className:Zb("lucide",o),...l},[...f.map(([h,m])=>R.createElement(h,m)),...Array.isArray(u)?u:[u]]));/**
111
+ * @license lucide-react v0.469.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const Ve=(e,r)=>{const n=R.forwardRef(({className:s,...o},u)=>R.createElement(RM,{ref:u,iconNode:r,className:Zb(`lucide-${AM(e)}`,s),...o}));return n.displayName=`${e}`,n};/**
116
+ * @license lucide-react v0.469.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const DM=Ve("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
121
+ * @license lucide-react v0.469.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const MM=Ve("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
126
+ * @license lucide-react v0.469.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const kM=Ve("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
131
+ * @license lucide-react v0.469.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const LM=Ve("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
136
+ * @license lucide-react v0.469.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const OM=Ve("CameraOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16",key:"qmtpty"}],["path",{d:"M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5",key:"1ufyfc"}],["path",{d:"M14.121 15.121A3 3 0 1 1 9.88 10.88",key:"11zox6"}]]);/**
141
+ * @license lucide-react v0.469.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const BM=Ve("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
146
+ * @license lucide-react v0.469.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const Xb=Ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
151
+ * @license lucide-react v0.469.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const mh=Ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
156
+ * @license lucide-react v0.469.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const NM=Ve("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
161
+ * @license lucide-react v0.469.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const IM=Ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
166
+ * @license lucide-react v0.469.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const qg=Ve("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
171
+ * @license lucide-react v0.469.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const gh=Ve("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
176
+ * @license lucide-react v0.469.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const e1=Ve("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
181
+ * @license lucide-react v0.469.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const PM=Ve("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
186
+ * @license lucide-react v0.469.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const jM=Ve("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
191
+ * @license lucide-react v0.469.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const mS=Ve("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
196
+ * @license lucide-react v0.469.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const hd=Ve("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);/**
201
+ * @license lucide-react v0.469.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const t1=Ve("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
206
+ * @license lucide-react v0.469.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const UM=Ve("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
211
+ * @license lucide-react v0.469.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const FM=Ve("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
216
+ * @license lucide-react v0.469.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const yc=Ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
221
+ * @license lucide-react v0.469.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const HM=Ve("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
226
+ * @license lucide-react v0.469.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const r1=Ve("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
231
+ * @license lucide-react v0.469.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const VM=Ve("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
236
+ * @license lucide-react v0.469.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const qM=Ve("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
241
+ * @license lucide-react v0.469.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const GM=Ve("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
246
+ * @license lucide-react v0.469.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const zM=Ve("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
251
+ * @license lucide-react v0.469.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const n1=Ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
256
+ * @license lucide-react v0.469.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const YM=Ve("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
261
+ * @license lucide-react v0.469.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const Gg=Ve("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
266
+ * @license lucide-react v0.469.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const WM=Ve("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
271
+ * @license lucide-react v0.469.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const KM=Ve("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
276
+ * @license lucide-react v0.469.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const eg=Ve("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
281
+ * @license lucide-react v0.469.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const i1=Ve("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
286
+ * @license lucide-react v0.469.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const gS=Ve("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
291
+ * @license lucide-react v0.469.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const QM=Ve("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
296
+ * @license lucide-react v0.469.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const $l=Ve("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
301
+ * @license lucide-react v0.469.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const zg=Ve("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
306
+ * @license lucide-react v0.469.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const $M=Ve("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
311
+ * @license lucide-react v0.469.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const JM=Ve("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
316
+ * @license lucide-react v0.469.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const s1=Ve("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
321
+ * @license lucide-react v0.469.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const o1=Ve("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
326
+ * @license lucide-react v0.469.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const Yg=Ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Hl(e){return(...r)=>{}}const Vr={log:Hl(),info:Hl(),warn:Hl(),error:Hl(),debug:Hl()},on={audio:(...e)=>Vr.log("🔊",...e),voice:(...e)=>Vr.log("🎤",...e),ws:(...e)=>Vr.log("🔌",...e),message:(...e)=>Vr.log("💬",...e),session:(...e)=>Vr.log("📋",...e),auth:(...e)=>Vr.log("🔐",...e)};function ZM({onScan:e,onBack:r}){const[n,s]=R.useState(null),[o,u]=R.useState(null),f=R.useCallback(c=>{if(c.length>0){const h=c[0];h!=null&&h.rawValue&&e(h.rawValue)}},[e]),l=R.useCallback(c=>{c instanceof Error?c.name==="NotAllowedError"?(u(!1),s("Camera access denied. Please allow camera access in your browser settings.")):c.name==="NotFoundError"?s("No camera found on this device."):s(c.message):s("Failed to access camera")},[]);return b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"aspect-square bg-muted rounded-lg overflow-hidden relative",children:[o===!1?b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center p-4 text-center",children:[b.jsx(OM,{className:"w-12 h-12 text-muted-foreground mb-4"}),b.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}):n?b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center p-4 text-center",children:[b.jsx(BM,{className:"w-12 h-12 text-muted-foreground mb-4"}),b.jsx("p",{className:"text-sm text-destructive",children:n})]}):b.jsx(xM,{onScan:f,onError:l,constraints:{facingMode:"environment"},styles:{container:{width:"100%",height:"100%"},video:{width:"100%",height:"100%",objectFit:"cover"}},components:{finder:!0}}),!n&&o!==!1&&b.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[b.jsx("div",{className:"absolute inset-8 border-2 border-primary rounded-lg opacity-50"}),b.jsxs("div",{className:"absolute inset-8 animate-pulse",children:[b.jsx("div",{className:"absolute top-0 left-0 w-8 h-8 border-t-4 border-l-4 border-primary rounded-tl-lg"}),b.jsx("div",{className:"absolute top-0 right-0 w-8 h-8 border-t-4 border-r-4 border-primary rounded-tr-lg"}),b.jsx("div",{className:"absolute bottom-0 left-0 w-8 h-8 border-b-4 border-l-4 border-primary rounded-bl-lg"}),b.jsx("div",{className:"absolute bottom-0 right-0 w-8 h-8 border-b-4 border-r-4 border-primary rounded-br-lg"})]})]})]}),b.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Point your camera at the QR code shown in your workstation terminal"}),b.jsxs(ct,{variant:"outline",className:"w-full",onClick:r,children:[b.jsx(MM,{className:"w-4 h-4"}),"Back to Magic Link"]})]})}const vS={supervisorMessages:[],agentMessages:{},supervisorIsLoading:!1,agentIsLoading:{},historyPaginationState:{},supervisorStreamingMessageId:null,agentStreamingMessageIds:{},pendingMessageAcks:new Set},ht=jg(e=>({...vS,addSupervisorMessage:r=>e(n=>n.supervisorMessages.some(s=>s.id===r.id)?(console.debug("[ChatStore] Skipping duplicate supervisor message:",r.id),n):{supervisorMessages:[...n.supervisorMessages,r]}),updateSupervisorMessage:(r,n)=>e(s=>({supervisorMessages:s.supervisorMessages.map(o=>o.id===r?{...o,...n}:o)})),updateSupervisorStreamingBlocks:(r,n)=>e(s=>({supervisorMessages:s.supervisorMessages.map(o=>o.id===r?{...o,contentBlocks:n}:o)})),setSupervisorIsLoading:r=>e({supervisorIsLoading:r}),setSupervisorStreamingMessageId:r=>e({supervisorStreamingMessageId:r}),clearSupervisorMessages:()=>e({supervisorMessages:[]}),addAgentMessage:(r,n)=>e(s=>{const o=s.agentMessages[r]??[];return o.some(u=>u.id===n.id)?(console.debug("[ChatStore] Skipping duplicate agent message:",n.id,"session:",r),s):{agentMessages:{...s.agentMessages,[r]:[...o,n]}}}),updateAgentMessage:(r,n,s)=>e(o=>({agentMessages:{...o.agentMessages,[r]:(o.agentMessages[r]??[]).map(u=>u.id===n?{...u,...s}:u)}})),updateAgentStreamingBlocks:(r,n,s)=>e(o=>({agentMessages:{...o.agentMessages,[r]:(o.agentMessages[r]??[]).map(u=>u.id===n?{...u,contentBlocks:s}:u)}})),setAgentIsLoading:(r,n)=>e(s=>({agentIsLoading:{...s.agentIsLoading,[r]:n}})),setAgentStreamingMessageId:(r,n)=>e(s=>({agentStreamingMessageIds:{...s.agentStreamingMessageIds,[r]:n??""}})),clearAgentMessages:r=>e(n=>({agentMessages:{...n.agentMessages,[r]:[]}})),setMessageSendStatus:(r,n)=>e(s=>{if(s.supervisorMessages.find(f=>f.id===r))return{supervisorMessages:s.supervisorMessages.map(f=>f.id===r?{...f,sendStatus:n}:f)};const u={...s.agentMessages};for(const f in u){const l=u[f];if(l&&l.findIndex(h=>h.id===r)!==-1)return u[f]=l.map(h=>h.id===r?{...h,sendStatus:n}:h),{agentMessages:u}}return{}}),addPendingAck:r=>e(n=>({pendingMessageAcks:new Set([...n.pendingMessageAcks,r])})),removePendingAck:r=>e(n=>{const s=new Set(n.pendingMessageAcks);return s.delete(r),{pendingMessageAcks:s}}),setHistoryPaginationState:(r,n)=>e(s=>({historyPaginationState:{...s.historyPaginationState,[r]:n}})),prependSupervisorMessages:r=>e(n=>{const s=new Set(n.supervisorMessages.map(u=>u.id)),o=r.filter(u=>!s.has(u.id));return o.length<r.length&&console.debug("[ChatStore] Filtered",r.length-o.length,"duplicate supervisor messages during prepend"),{supervisorMessages:[...o,...n.supervisorMessages]}}),prependAgentMessages:(r,n)=>e(s=>{const o=s.agentMessages[r]??[],u=new Set(o.map(l=>l.id)),f=n.filter(l=>!u.has(l.id));return f.length<n.length&&console.debug("[ChatStore] Filtered",n.length-f.length,"duplicate agent messages during prepend for session:",r),{agentMessages:{...s.agentMessages,[r]:[...f,...o]}}}),reset:()=>e(vS)})),XM=5e3,ek=1e4,tk=1e4,rk=5e3,nk=500,ik=5e3,uh=class uh{constructor(){_e(this,"ws",null);_e(this,"credentials",null);_e(this,"callbacks",null);_e(this,"pingInterval",null);_e(this,"heartbeatInterval",null);_e(this,"pongTimeout",null);_e(this,"heartbeatTimeout",null);_e(this,"reconnectTimeout",null);_e(this,"reconnectAttempts",0);_e(this,"isConnecting",!1);_e(this,"isAuthenticated",!1);_e(this,"intentionalDisconnect",!1);_e(this,"pendingRequests",new Map)}init(r){this.callbacks=r}async connect(r){var n,s,o;if(!(this.isConnecting||((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN)){this.credentials=r,this.intentionalDisconnect=!1,this.isConnecting=!0,(s=this.callbacks)==null||s.onConnectionStateChange("connecting");try{await this.establishConnection()}catch(u){throw this.isConnecting=!1,(o=this.callbacks)==null||o.onConnectionStateChange("error"),u}}}disconnect(){var r;this.intentionalDisconnect=!0,this.cleanup(),(r=this.callbacks)==null||r.onConnectionStateChange("disconnected")}async sendRequest(r){return new Promise((n,s)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN){s(new Error("WebSocket not connected"));return}this.pendingRequests.size>=uh.MAX_PENDING_REQUESTS&&this.cleanupStaleRequests();const o=setTimeout(()=>{this.pendingRequests.delete(r.id),s(new Error("Request timeout"))},3e4);this.pendingRequests.set(r.id,{resolve:u=>{clearTimeout(o),n(u)},reject:u=>{clearTimeout(o),s(u)},timestamp:Date.now()}),this.send(r)})}send(r){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(r))}isConnected(){var r;return((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.isAuthenticated}reconnect(){this.credentials&&!this.isConnecting&&(this.intentionalDisconnect=!1,this.reconnectAttempts=0,this.cleanup(),this.connect(this.credentials).catch(r=>{}))}getReconnectAttempts(){return this.reconnectAttempts}async establishConnection(){return new Promise((r,n)=>{if(!this.credentials){n(new Error("No credentials"));return}try{this.ws=new WebSocket(this.credentials.tunnelUrl)}catch(o){n(o);return}const s=setTimeout(()=>{var o;(o=this.ws)==null||o.close(),n(new Error("Connection timeout"))},3e4);this.ws.onopen=()=>{var o;clearTimeout(s),(o=this.callbacks)==null||o.onConnectionStateChange("connected"),this.sendConnectMessage()},this.ws.onclose=o=>{clearTimeout(s),this.handleClose(o),this.isAuthenticated||n(new Error("Connection closed before authentication"))},this.ws.onerror=o=>{var u;clearTimeout(s),(u=this.callbacks)==null||u.onConnectionStateChange("error")},this.ws.onmessage=o=>{try{const u=JSON.parse(o.data);this.handleMessage(u,r,n)}catch{}}})}sendConnectMessage(){var n;if(!this.credentials)return;const r={type:"connect",payload:{tunnel_id:this.credentials.tunnelId,auth_key:this.credentials.authKey,device_id:this.credentials.deviceId,reconnect:this.reconnectAttempts>0}};this.send(r),(n=this.callbacks)==null||n.onConnectionStateChange("authenticating")}sendAuthMessage(){if(!this.credentials)return;const r={type:"auth",payload:{auth_key:this.credentials.authKey,device_id:this.credentials.deviceId}};this.send(r)}handleMessage(r,n,s){var o,u,f,l,c,h;if(r.id&&this.pendingRequests.has(r.id)){const m=this.pendingRequests.get(r.id);if(this.pendingRequests.delete(r.id),r.type==="error"){const p=r.payload;m==null||m.reject(new Error(`${p.code}: ${p.message}`))}else m==null||m.resolve(r);return}switch(r.type){case"connected":this.sendAuthMessage();break;case"auth.success":this.isConnecting=!1,this.isAuthenticated=!0,this.reconnectAttempts=0,(o=this.callbacks)==null||o.onConnectionStateChange("authenticated"),this.startHeartbeat(),this.requestSync(),(u=this.callbacks)==null||u.onMessage(r),n==null||n();break;case"auth.error":{this.isConnecting=!1,(f=this.callbacks)==null||f.onConnectionStateChange("error");const m=r.payload;s==null||s(new Error(`Auth failed: ${m.message}`));break}case"pong":this.handlePong();break;case"heartbeat.ack":this.handleHeartbeatAck();break;case"connection.workstation_online":(l=this.callbacks)==null||l.onWorkstationOnline();break;case"connection.workstation_offline":(c=this.callbacks)==null||c.onWorkstationOffline();break;default:(h=this.callbacks)==null||h.onMessage(r)}}startHeartbeat(){this.stopHeartbeat(),this.pingInterval=setInterval(()=>{this.sendPing()},XM),this.heartbeatInterval=setInterval(()=>{this.sendHeartbeat()},tk),this.sendHeartbeat()}stopHeartbeat(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null),this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null),this.pongTimeout&&(clearTimeout(this.pongTimeout),this.pongTimeout=null),this.heartbeatTimeout&&(clearTimeout(this.heartbeatTimeout),this.heartbeatTimeout=null)}sendPing(){this.send({type:"ping",timestamp:Date.now()}),this.pongTimeout=setTimeout(()=>{var r;(r=this.callbacks)==null||r.onConnectionStateChange("degraded")},ek)}handlePong(){this.pongTimeout&&(clearTimeout(this.pongTimeout),this.pongTimeout=null)}sendHeartbeat(){const r={type:"heartbeat",id:crypto.randomUUID(),timestamp:Date.now()};this.send(r),this.heartbeatTimeout=setTimeout(()=>{var n;(n=this.callbacks)==null||n.onConnectionStateChange("degraded")},rk)}handleHeartbeatAck(){var r;this.heartbeatTimeout&&(clearTimeout(this.heartbeatTimeout),this.heartbeatTimeout=null),(r=this.callbacks)==null||r.onConnectionStateChange("verified")}requestSync(){const r={type:"sync",id:crypto.randomUUID(),lightweight:this.reconnectAttempts>0};this.send(r)}handleClose(r){var n,s;if(this.cleanup(),this.intentionalDisconnect){(n=this.callbacks)==null||n.onConnectionStateChange("disconnected");return}on.ws("WebSocket closed:",r.code,r.reason),(s=this.callbacks)==null||s.onConnectionStateChange("disconnected"),this.scheduleReconnect()}scheduleReconnect(){if(this.intentionalDisconnect||!this.credentials)return;const r=Math.min(nk*Math.pow(2,this.reconnectAttempts),ik);this.reconnectAttempts++,on.ws(`Reconnecting in ${r}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.credentials&&!this.intentionalDisconnect&&this.connect(this.credentials).catch(n=>{})},r)}cleanupStaleRequests(){const r=Date.now(),n=6e4;for(const[s,o]of this.pendingRequests)r-o.timestamp>n&&(o.reject(new Error("Request expired")),this.pendingRequests.delete(s))}cleanup(){this.stopHeartbeat(),this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.onopen=null,this.ws.onclose=null,this.ws.onerror=null,this.ws.onmessage=null,(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)&&this.ws.close(1e3,"Client disconnect"),this.ws=null),this.isConnecting=!1,this.isAuthenticated=!1;for(const[r,n]of this.pendingRequests)n.reject(new Error("Connection closed")),this.pendingRequests.delete(r)}};_e(uh,"MAX_PENDING_REQUESTS",100);let tg=uh;const Bt=new tg;function sk(e,r){let n;try{n=e()}catch{return}return{getItem:o=>{var u;const f=c=>c===null?null:JSON.parse(c,void 0),l=(u=n.getItem(o))!=null?u:null;return l instanceof Promise?l.then(f):f(l)},setItem:(o,u)=>n.setItem(o,JSON.stringify(u,void 0)),removeItem:o=>n.removeItem(o)}}const rg=e=>r=>{try{const n=e(r);return n instanceof Promise?n:{then(s){return rg(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return rg(s)(n)}}}},ok=(e,r)=>(n,s,o)=>{let u={storage:sk(()=>localStorage),partialize:w=>w,version:0,merge:(w,v)=>({...v,...w}),...r},f=!1;const l=new Set,c=new Set;let h=u.storage;if(!h)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),n(...w)},s,o);const m=()=>{const w=u.partialize({...s()});return h.setItem(u.name,{state:w,version:u.version})},p=o.setState;o.setState=(w,v)=>(p(w,v),m());const _=e((...w)=>(n(...w),m()),s,o);o.getInitialState=()=>_;let E;const A=()=>{var w,v;if(!h)return;f=!1,l.forEach(g=>{var y;return g((y=s())!=null?y:_)});const S=((v=u.onRehydrateStorage)==null?void 0:v.call(u,(w=s())!=null?w:_))||void 0;return rg(h.getItem.bind(h))(u.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==u.version){if(u.migrate){const y=u.migrate(g.state,g.version);return y instanceof Promise?y.then(T=>[!0,T]):[!0,y]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,g.state];return[!1,void 0]}).then(g=>{var y;const[T,M]=g;if(E=u.merge(M,(y=s())!=null?y:_),n(E,!0),T)return m()}).then(()=>{S==null||S(E,void 0),E=s(),f=!0,c.forEach(g=>g(E))}).catch(g=>{S==null||S(void 0,g)})};return o.persist={setOptions:w=>{u={...u,...w},w.storage&&(h=w.storage)},clearStorage:()=>{h==null||h.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>A(),hasHydrated:()=>f,onHydrate:w=>(l.add(w),()=>{l.delete(w)}),onFinishHydration:w=>(c.add(w),()=>{c.delete(w)})},u.skipHydration||A(),E||_},ak=ok,a1=200,l1=480,lk=320,ck=64,_S={ttsEnabled:!0,sttLanguage:"en",sidebarCollapsed:!1,sidebarWidth:lk},Pn=jg()(ak(e=>({..._S,setTtsEnabled:r=>e({ttsEnabled:r}),setSttLanguage:r=>e({sttLanguage:r}),setSidebarCollapsed:r=>e({sidebarCollapsed:r}),setSidebarWidth:r=>e({sidebarWidth:Math.max(a1,Math.min(l1,r))}),toggleSidebar:()=>e(r=>({sidebarCollapsed:!r.sidebarCollapsed})),reset:()=>e(_S)}),{name:"tiflis-settings"})),uk="audio/wav";class dk{constructor(){_e(this,"audioCache",new Map);_e(this,"currentMessageId",null);_e(this,"isCurrentlyLoading",!1);_e(this,"CACHE_DURATION_MS",900*1e3);_e(this,"MAX_CACHE_SIZE",50);_e(this,"sharedAudio");_e(this,"audioContext",null);_e(this,"isUnlocked",!1);_e(this,"pendingAutoPlay",null);_e(this,"listeners",new Set);_e(this,"animationFrameId",null);this.sharedAudio=new Audio,this.sharedAudio.preload="auto",this.setupSharedAudioListeners(),this.setupAudioUnlock()}setupSharedAudioListeners(){this.sharedAudio.addEventListener("play",()=>{this.startProgressTracking(),this.notifyListeners()}),this.sharedAudio.addEventListener("pause",()=>{this.stopProgressTracking(),this.notifyListeners()}),this.sharedAudio.addEventListener("ended",()=>{this.stopProgressTracking(),this.sharedAudio.currentTime=0,this.notifyListeners()}),this.sharedAudio.addEventListener("loadedmetadata",()=>{this.isCurrentlyLoading=!1,this.notifyListeners()}),this.sharedAudio.addEventListener("canplay",()=>{this.isCurrentlyLoading=!1,this.notifyListeners()}),this.sharedAudio.addEventListener("error",()=>{this.isCurrentlyLoading=!1,this.notifyListeners("Failed to load audio")})}subscribe(r){return this.listeners.add(r),r(this.getState()),()=>{this.listeners.delete(r)}}getState(){return{messageId:this.currentMessageId,isPlaying:!this.sharedAudio.paused,isLoading:this.isCurrentlyLoading,currentTime:this.sharedAudio.currentTime,duration:isNaN(this.sharedAudio.duration)?0:this.sharedAudio.duration,error:null}}notifyListeners(r){const n={...this.getState(),error:r??null};this.listeners.forEach(s=>s(n))}startProgressTracking(){if(this.animationFrameId!==null)return;const r=()=>{this.notifyListeners(),this.sharedAudio.paused?this.animationFrameId=null:this.animationFrameId=requestAnimationFrame(r)};this.animationFrameId=requestAnimationFrame(r)}stopProgressTracking(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}getAudioContext(){return this.audioContext||(this.audioContext=new(window.AudioContext||window.webkitAudioContext)),this.audioContext}setupAudioUnlock(){const r=async()=>{if(!this.isUnlocked)try{const n=this.getAudioContext();n.state==="suspended"&&await n.resume(),this.sharedAudio.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA",this.sharedAudio.volume=.01;try{await this.sharedAudio.play(),this.sharedAudio.pause(),this.sharedAudio.currentTime=0,this.sharedAudio.volume=1}catch{}if(this.isUnlocked=!0,Vr.log("Audio unlocked via user interaction"),this.pendingAutoPlay){const{base64Audio:s,messageId:o}=this.pendingAutoPlay;this.pendingAutoPlay=null,setTimeout(()=>{this.playAudio(s,o,!0)},50)}document.removeEventListener("touchstart",r),document.removeEventListener("touchend",r),document.removeEventListener("click",r),document.removeEventListener("keydown",r)}catch{}};document.addEventListener("touchstart",r,{once:!1,passive:!0}),document.addEventListener("touchend",r,{once:!1,passive:!0}),document.addEventListener("click",r,{once:!1,passive:!0}),document.addEventListener("keydown",r,{once:!1,passive:!0})}isAudioUnlocked(){return this.isUnlocked}async unlockIfNeeded(){if(!this.isUnlocked)try{const r=this.getAudioContext();if(r.state==="suspended"&&await r.resume(),this.sharedAudio.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA",this.sharedAudio.volume=.01,await this.sharedAudio.play(),this.sharedAudio.pause(),this.sharedAudio.currentTime=0,this.sharedAudio.volume=1,this.isUnlocked=!0,Vr.log("Audio manually unlocked"),this.pendingAutoPlay){const{base64Audio:n,messageId:s}=this.pendingAutoPlay;this.pendingAutoPlay=null,this.playAudio(n,s,!0)}}catch{this.isUnlocked=!0}}isMobileDevice(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)}playAudio(r,n,s){if(Vr.log(`playAudio: messageId=${n}, autoPlay=${s}, isUnlocked=${this.isUnlocked}, isMobile=${this.isMobileDevice()}`),this.cacheAudio(r,n),s&&!this.isUnlocked&&this.isMobileDevice()){this.pendingAutoPlay={base64Audio:r,messageId:n};return}this.stop(),this.currentMessageId=n,this.isCurrentlyLoading=!0,this.notifyListeners(),this.sharedAudio.src=`data:${uk};base64,${r}`,s?this.sharedAudio.play().then(()=>{this.isUnlocked=!0}).catch(o=>{o.name==="NotAllowedError"?this.isMobileDevice()&&(this.pendingAutoPlay={base64Audio:r,messageId:n}):Vr.warn("Play failed:",o.name,o.message),this.isCurrentlyLoading=!1,this.notifyListeners()}):this.sharedAudio.load()}cacheAudio(r,n){if(this.audioCache.has(n))return;this.audioCache.size>=this.MAX_CACHE_SIZE&&this.evictLRU();const s=Date.now();this.audioCache.set(n,{base64:r,expiresAt:s+this.CACHE_DURATION_MS,accessedAt:s}),this.cleanupCache()}playByMessageId(r){const n=this.audioCache.get(r);return n&&Date.now()<n.expiresAt?(n.accessedAt=Date.now(),this.playAudio(n.base64,r,!0),!0):!1}togglePlay(){this.sharedAudio.paused?this.sharedAudio.play().catch(r=>{}):this.sharedAudio.pause()}seek(r){this.sharedAudio.duration&&(this.sharedAudio.currentTime=r*this.sharedAudio.duration,this.notifyListeners())}seekToTime(r){this.sharedAudio.currentTime=r,this.notifyListeners()}resetToStart(){this.sharedAudio.currentTime=0,this.notifyListeners()}getAudioBase64(r){const n=this.audioCache.get(r);return n&&Date.now()<n.expiresAt?n.base64:null}getAudio(r){return this.currentMessageId===r?this.sharedAudio:this.hasAudio(r)?this.sharedAudio:null}hasAudio(r){const n=this.audioCache.get(r);return n!==void 0&&Date.now()<n.expiresAt}registerAudio(r,n){n&&(this.currentMessageId=n),this.notifyListeners()}unregisterAudio(r){}stop(){this.stopProgressTracking(),this.sharedAudio.pause(),this.sharedAudio.currentTime=0,this.currentMessageId=null,this.isCurrentlyLoading=!1,this.notifyListeners()}stopAll(){this.stop()}isPlaying(){return!this.sharedAudio.paused}getCurrentMessageId(){return this.currentMessageId}cleanupCache(){const r=Date.now();for(const[n,s]of this.audioCache.entries())r>=s.expiresAt&&this.audioCache.delete(n)}evictLRU(){let r=null,n=1/0;for(const[s,o]of this.audioCache.entries())o.accessedAt<n&&(n=o.accessedAt,r=s);r&&this.audioCache.delete(r)}}const Nt=new dk;function _i(e){const r=e.filter(n=>n.block_type==="voice_output"||n.block_type==="voice_input");return r.length>0&&on.audio("parseContentBlocks - voice blocks from server:",r),e.map(n=>({id:n.id,blockType:n.block_type,content:n.content,metadata:n.metadata?{language:n.metadata.language,toolName:n.metadata.tool_name,toolUseId:n.metadata.tool_use_id,toolInput:n.metadata.tool_input,toolOutput:n.metadata.tool_output,toolStatus:n.metadata.tool_status,audioUrl:n.metadata.audio_url,audioBase64:n.metadata.audio_base64,messageId:n.metadata.message_id,duration:n.metadata.duration,hasAudio:n.metadata.has_audio,errorCode:n.metadata.error_code}:void 0}))}function hk(e){const r=e;switch(r.type){case"auth.success":fk(r);break;case"sync.state":pk(r);break;case"history.response":mk(r);break;case"session.created":gk(r);break;case"session.terminated":_k(r);break;case"session.subscribed":vk(r);break;case"supervisor.output":yk(r);break;case"supervisor.user_message":Sk(r);break;case"supervisor.context_cleared":Ck();break;case"session.output":bk(r);break;case"session.user_message":wk(r);break;case"message.ack":Ek(r);break;case"supervisor.voice_output":xk(r);break;case"session.voice_output":Ak(r);break;case"supervisor.transcription":Tk(r);break;case"session.transcription":Rk(r);break;case"response":break;case"error":Vr.error("Server error:",r.payload);break;default:Vr.log("Unhandled message type:",r.type)}}function fk(e){Ge.getState().setWorkstationInfo({name:e.payload.workstation_name??"Unknown",version:e.payload.workstation_version??"",protocolVersion:e.payload.protocol_version??"",workspacesRoot:e.payload.workspaces_root??""})}function pk(e){const r=Ge.getState(),n=ht.getState(),s=e.payload.sessions.map(o=>({id:o.session_id,type:o.session_type,status:o.status,agentName:o.agent_name,workspace:o.workspace,project:o.project,worktree:o.worktree,workingDir:o.working_dir,createdAt:new Date}));if(r.setSessions(s),e.payload.availableAgents){const o=e.payload.availableAgents.map(u=>({name:u.name,baseType:u.base_type,displayName:u.name.charAt(0).toUpperCase()+u.name.slice(1),description:u.description,isAlias:u.is_alias}));r.setAvailableAgents(o)}if(e.payload.workspaces){const o=e.payload.workspaces.map(u=>({name:u.name,projects:u.projects.map(f=>({name:f.name,isGitRepo:f.is_git_repo,defaultBranch:f.default_branch}))}));r.setWorkspaces(o)}n.setHistoryPaginationState("supervisor",{oldestSequence:void 0,hasMore:!0,isLoading:!0}),Bt.send({type:"history.request",id:crypto.randomUUID(),payload:{session_id:null,limit:50}})}function mk(e){const r=ht.getState(),{session_id:n,history:s,has_more:o,oldest_sequence:u,is_executing:f,current_streaming_blocks:l,streaming_message_id:c}=e.payload;Vr.log("history.response received:",{session_id:n,historyCount:(s==null?void 0:s.length)??0,has_more:o,oldest_sequence:u,streaming_message_id:c});const h=n??"supervisor";if(r.setHistoryPaginationState(h,{oldestSequence:u,hasMore:o,isLoading:!1}),s.length===0)return;const p=[...s].sort((_,E)=>_.sequence-E.sequence).map(_=>({id:_.message_id??crypto.randomUUID(),sessionId:h,role:_.role,contentBlocks:_.content_blocks?_i(_.content_blocks):[{id:crypto.randomUUID(),blockType:"text",content:_.content}],isStreaming:!1,createdAt:new Date(_.createdAt)}));if(n===null){if(r.prependSupervisorMessages(p),f&&r.setSupervisorIsLoading(!0),l&&l.length>0){const _=c??crypto.randomUUID();if(r.supervisorStreamingMessageId===_)r.updateSupervisorStreamingBlocks(_,_i(l));else if(!r.supervisorMessages.some(A=>A.id===_)){const A={id:_,sessionId:"supervisor",role:"assistant",contentBlocks:_i(l),isStreaming:!0,createdAt:new Date};r.addSupervisorMessage(A),r.setSupervisorStreamingMessageId(_),r.setSupervisorIsLoading(!0)}}}else if(r.prependAgentMessages(n,p),f&&r.setAgentIsLoading(n,!0),l&&l.length>0){const _=c??crypto.randomUUID();if(r.agentStreamingMessageIds[n]===_)r.updateAgentStreamingBlocks(n,_,_i(l));else if(!(r.agentMessages[n]??[]).some(w=>w.id===_)){const w={id:_,sessionId:n,role:"assistant",contentBlocks:_i(l),isStreaming:!0,createdAt:new Date};r.addAgentMessage(n,w),r.setAgentStreamingMessageId(n,_),r.setAgentIsLoading(n,!0)}}}function gk(e){const r=Ge.getState(),n={id:e.session_id,type:e.payload.session_type,status:"active",agentName:e.payload.agent_name,workspace:e.payload.workspace,project:e.payload.project,worktree:e.payload.worktree,workingDir:e.payload.working_dir,createdAt:new Date,terminalConfig:e.payload.terminal_config?{cols:80,rows:24,bufferSize:e.payload.terminal_config.buffer_size}:void 0};r.addSession(n)}function vk(e){const r=ht.getState(),n=e.session_id,o=Ge.getState().sessions.find(u=>u.id===n);if((o==null?void 0:o.type)!=="terminal"&&(e.is_executing&&r.setAgentIsLoading(n,!0),r.setHistoryPaginationState(n,{oldestSequence:void 0,hasMore:!0,isLoading:!0}),Bt.send({type:"history.request",id:crypto.randomUUID(),payload:{session_id:n,limit:50}}),e.current_streaming_blocks&&e.current_streaming_blocks.length>0)){const u=e.streaming_message_id??crypto.randomUUID();if(r.agentStreamingMessageIds[n]===u)r.updateAgentStreamingBlocks(n,u,_i(e.current_streaming_blocks));else if(!(r.agentMessages[n]??[]).some(c=>c.id===u)){const c={id:u,sessionId:n,role:"assistant",contentBlocks:_i(e.current_streaming_blocks),isStreaming:!0,createdAt:new Date};r.addAgentMessage(n,c),r.setAgentStreamingMessageId(n,u),r.setAgentIsLoading(n,!0)}}}function _k(e){Ge.getState().removeSession(e.session_id)}function yk(e){const r=ht.getState(),n=r.supervisorStreamingMessageId,s=e.streaming_message_id,o=_i(e.payload.content_blocks),u=o.length>0&&o.some(f=>f.content||f.blockType==="tool"||f.blockType==="voice_output");if(s&&n&&n!==s&&r.supervisorMessages.some(f=>f.id===s)){u&&r.updateSupervisorStreamingBlocks(s,o),e.payload.is_complete&&(r.updateSupervisorMessage(s,{isStreaming:!1}),r.setSupervisorStreamingMessageId(null),r.setSupervisorIsLoading(!1));return}if(n)u&&r.updateSupervisorStreamingBlocks(n,o),e.payload.is_complete&&(r.updateSupervisorMessage(n,{isStreaming:!1}),r.setSupervisorStreamingMessageId(null),r.setSupervisorIsLoading(!1));else{if(!u&&e.payload.is_complete)return;const f=s??crypto.randomUUID();if(r.supervisorMessages.some(c=>c.id===f)){u&&r.updateSupervisorStreamingBlocks(f,o),e.payload.is_complete?(r.updateSupervisorMessage(f,{isStreaming:!1}),r.setSupervisorStreamingMessageId(null),r.setSupervisorIsLoading(!1)):(r.setSupervisorStreamingMessageId(f),r.setSupervisorIsLoading(!0));return}const l={id:f,sessionId:"supervisor",role:"assistant",contentBlocks:o,isStreaming:!e.payload.is_complete,createdAt:new Date(e.payload.timestamp)};r.addSupervisorMessage(l),e.payload.is_complete||(r.setSupervisorStreamingMessageId(l.id),r.setSupervisorIsLoading(!0))}}function Sk(e){const r=ht.getState(),s=Ge.getState().credentials;if(s&&e.payload.from_device_id===s.deviceId)return;const o={id:crypto.randomUUID(),sessionId:"supervisor",role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"text",content:e.payload.content}],isStreaming:!1,createdAt:new Date(e.payload.timestamp),fromDeviceId:e.payload.from_device_id};r.addSupervisorMessage(o)}function Ck(){ht.getState().clearSupervisorMessages()}function bk(e){const r=ht.getState(),n=e.session_id;if(e.payload.content_type==="terminal"){window.dispatchEvent(new CustomEvent("terminal-output",{detail:{sessionId:n,data:e.payload.content}}));return}const s=r.agentStreamingMessageIds[n],o=e.streaming_message_id,u=e.payload.content_blocks?_i(e.payload.content_blocks):[{id:crypto.randomUUID(),blockType:"text",content:e.payload.content}],f=u.length>0&&u.some(l=>l.content||l.blockType==="tool"||l.blockType==="voice_output");if(o&&s&&s!==o&&(r.agentMessages[n]??[]).some(c=>c.id===o)){f&&r.updateAgentStreamingBlocks(n,o,u),e.payload.is_complete&&(r.updateAgentMessage(n,o,{isStreaming:!1}),r.setAgentStreamingMessageId(n,null),r.setAgentIsLoading(n,!1));return}if(s)f&&r.updateAgentStreamingBlocks(n,s,u),e.payload.is_complete&&(r.updateAgentMessage(n,s,{isStreaming:!1}),r.setAgentStreamingMessageId(n,null),r.setAgentIsLoading(n,!1));else{if(!f&&e.payload.is_complete)return;const l=o??crypto.randomUUID();if((r.agentMessages[n]??[]).some(m=>m.id===l)){f&&r.updateAgentStreamingBlocks(n,l,u),e.payload.is_complete?(r.updateAgentMessage(n,l,{isStreaming:!1}),r.setAgentStreamingMessageId(n,null),r.setAgentIsLoading(n,!1)):(r.setAgentStreamingMessageId(n,l),r.setAgentIsLoading(n,!0));return}const h={id:l,sessionId:n,role:"assistant",contentBlocks:u,isStreaming:!e.payload.is_complete,createdAt:new Date(e.payload.timestamp)};r.addAgentMessage(n,h),e.payload.is_complete||(r.setAgentStreamingMessageId(n,h.id),r.setAgentIsLoading(n,!0))}}function wk(e){const r=ht.getState(),s=Ge.getState().credentials;if(s&&e.payload.from_device_id===s.deviceId)return;const o={id:crypto.randomUUID(),sessionId:e.session_id,role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"text",content:e.payload.content}],isStreaming:!1,createdAt:new Date,fromDeviceId:e.payload.from_device_id};r.addAgentMessage(e.session_id,o)}function Ek(e){const r=ht.getState();r.pendingMessageAcks.has(e.payload.message_id)&&(r.removePendingAck(e.payload.message_id),r.setMessageSendStatus(e.payload.message_id,"sent"))}function xk(e){on.audio("Received supervisor.voice_output:",e);const r=Ge.getState(),n=Pn.getState(),s=ht.getState(),o=r.credentials,{message_id:u,audio_base64:f,from_device_id:l,duration:c}=e.payload,h=n.ttsEnabled,m=l!==void 0&&l===(o==null?void 0:o.deviceId),p=h&&m;on.audio(`TTS: from=${l??"nil"} me=${o==null?void 0:o.deviceId} match=${m} ttsEnabled=${h} autoPlay=${p}`),Nt.playAudio(f,u,p);const _=s.supervisorMessages;let E=-1;for(let A=_.length-1;A>=0;A--){const w=_[A];if(w&&w.role==="assistant"){E=A;break}}if(E!==-1){const A=_[E];if(A){const w={id:crypto.randomUUID(),blockType:"voice_output",content:"",metadata:{messageId:u,audioBase64:f,duration:c,hasAudio:!0}};s.updateSupervisorMessage(A.id,{contentBlocks:[...A.contentBlocks,w]})}}}function Ak(e){on.audio("Received session.voice_output:",e);const r=Ge.getState(),n=Pn.getState(),s=ht.getState(),o=r.credentials,u=e.session_id,{message_id:f,audio_base64:l,from_device_id:c,duration:h}=e.payload,m=n.ttsEnabled,p=c!==void 0&&c===(o==null?void 0:o.deviceId),_=m&&p;on.audio(`TTS(agent): from=${c??"nil"} me=${o==null?void 0:o.deviceId} match=${p} autoPlay=${_}`),Nt.playAudio(l,f,_);const E=s.agentMessages[u]??[];let A=-1;for(let w=E.length-1;w>=0;w--){const v=E[w];if(v&&v.role==="assistant"){A=w;break}}if(A!==-1){const w=E[A];if(w){const v={id:crypto.randomUUID(),blockType:"voice_output",content:"",metadata:{messageId:f,audioBase64:l,duration:h,hasAudio:!0}};s.updateAgentMessage(u,w.id,{contentBlocks:[...w.contentBlocks,v]})}}}function Tk(e){const r=ht.getState(),s=Ge.getState().credentials,{message_id:o,transcription:u,from_device_id:f}=e.payload,l=r.supervisorMessages;let c=!1;for(const h of l)if(h.id===o||h.contentBlocks.some(m=>{var p;return((p=m.metadata)==null?void 0:p.messageId)===o})){const m=h.contentBlocks.map(p=>p.blockType==="voice_input"?{...p,content:u}:p);r.updateSupervisorMessage(h.id,{contentBlocks:m}),c=!0;break}if(!c&&f&&f!==(s==null?void 0:s.deviceId)&&u){const h={id:o,sessionId:"supervisor",role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"voice_input",content:u,metadata:{messageId:o}}],isStreaming:!1,createdAt:new Date,fromDeviceId:f};r.addSupervisorMessage(h)}}function Rk(e){const r=ht.getState(),s=Ge.getState().credentials,o=e.session_id,{message_id:u,transcription:f,from_device_id:l}=e.payload,c=r.agentMessages[o]??[];let h=!1;for(const m of c)if(m.id===u||m.contentBlocks.some(p=>{var _;return((_=p.metadata)==null?void 0:_.messageId)===u})){const p=m.contentBlocks.map(_=>_.blockType==="voice_input"?{..._,content:f}:_);r.updateAgentMessage(o,m.id,{contentBlocks:p}),h=!0;break}if(!h&&l&&l!==(s==null?void 0:s.deviceId)&&f){const m={id:u,sessionId:o,role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"voice_input",content:f,metadata:{messageId:u}}],isStreaming:!1,createdAt:new Date,fromDeviceId:l};r.addAgentMessage(o,m)}}const fd="tiflis_credentials",fm="tiflis_device_id",yS="tiflis_encryption_key",pm="tiflis_security",us="keys";class Dk{constructor(){_e(this,"encryptionKey",null)}getDeviceId(){let r=localStorage.getItem(fm);return r||(r=crypto.randomUUID(),localStorage.setItem(fm,r)),r}async storeCredentials(r){const n=await this.getOrCreateEncryptionKey(),{encrypted:s,iv:o}=await this.encrypt(n,r.authKey),u={tunnelId:r.tunnelId,tunnelUrl:r.tunnelUrl,encryptedAuthKey:s,iv:o};localStorage.setItem(fd,JSON.stringify(u))}async getCredentials(){const r=localStorage.getItem(fd);if(!r)return null;try{const n=JSON.parse(r),s=await this.getOrCreateEncryptionKey(),o=await this.decrypt(s,n.encryptedAuthKey,n.iv);return{tunnelId:n.tunnelId,tunnelUrl:n.tunnelUrl,authKey:o,deviceId:this.getDeviceId()}}catch{return null}}hasCredentials(){return localStorage.getItem(fd)!==null}async forgetAll(){localStorage.removeItem(fd),localStorage.removeItem(fm);try{await this.deleteEncryptionKey()}catch{}this.encryptionKey=null}async getOrCreateEncryptionKey(){if(this.encryptionKey)return this.encryptionKey;const r=await this.loadKeyFromDB();if(r)return this.encryptionKey=r,r;const n=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!1,["encrypt","decrypt"]);return await this.saveKeyToDB(n),this.encryptionKey=n,n}async encrypt(r,n){const s=new TextEncoder,o=crypto.getRandomValues(new Uint8Array(12)),u=await crypto.subtle.encrypt({name:"AES-GCM",iv:o},r,s.encode(n));return{encrypted:this.bufferToBase64(new Uint8Array(u)),iv:this.bufferToBase64(o)}}async decrypt(r,n,s){const o=new TextDecoder,u=this.base64ToBuffer(s),f=this.base64ToBuffer(n),l=await crypto.subtle.decrypt({name:"AES-GCM",iv:u.buffer},r,f.buffer);return o.decode(l)}loadKeyFromDB(){return new Promise((r,n)=>{const s=indexedDB.open(pm,1);s.onerror=()=>n(s.error),s.onupgradeneeded=()=>{const o=s.result;o.objectStoreNames.contains(us)||o.createObjectStore(us)},s.onsuccess=()=>{const o=s.result;try{const l=o.transaction(us,"readonly").objectStore(us).get(yS);l.onerror=()=>{o.close(),n(l.error)},l.onsuccess=()=>{o.close(),r(l.result??null)}}catch(u){o.close(),n(u)}}})}saveKeyToDB(r){return new Promise((n,s)=>{const o=indexedDB.open(pm,1);o.onerror=()=>s(o.error),o.onupgradeneeded=()=>{const u=o.result;u.objectStoreNames.contains(us)||u.createObjectStore(us)},o.onsuccess=()=>{const u=o.result;try{const f=u.transaction(us,"readwrite");f.objectStore(us).put(r,yS),f.oncomplete=()=>{u.close(),n()},f.onerror=()=>{u.close(),s(f.error)}}catch(f){u.close(),s(f)}}})}deleteEncryptionKey(){return new Promise((r,n)=>{const s=indexedDB.deleteDatabase(pm);s.onblocked=()=>{r()},s.onerror=()=>n(s.error),s.onsuccess=()=>r()})}bufferToBase64(r){let n="";for(let s=0;s<r.byteLength;s++)n+=String.fromCharCode(r[s]);return btoa(n)}base64ToBuffer(r){const n=atob(r),s=new Uint8Array(n.length);for(let o=0;o<n.length;o++)s[o]=n.charCodeAt(o);return s}}const pd=new Dk;function co(){const e=R.useRef(!1),r=R.useRef(new Map),n=Ge(U=>U.setConnectionState),s=Ge(U=>U.setWorkstationOnline),o=Ge(U=>U.setAuthenticated),u=Ge(U=>U.setCredentials),f=Ge(U=>U.credentials),l=Ge(U=>U.connectionState),c=ht(U=>U.addSupervisorMessage),h=ht(U=>U.setSupervisorIsLoading),m=ht(U=>U.addPendingAck),p=ht(U=>U.setMessageSendStatus);R.useEffect(()=>{if(e.current)return;e.current=!0,Bt.init({onConnectionStateChange:$=>{n($),$==="authenticated"||$==="verified"?s(!0):($==="disconnected"||$==="error")&&s(!1)},onMessage:hk,onWorkstationOnline:()=>s(!0),onWorkstationOffline:()=>s(!1)}),(async()=>{const $=await pd.getCredentials();if($){u($),o(!0);try{await Bt.connect($)}catch{}}})();const U=r.current;return()=>{U.forEach($=>{clearTimeout($)}),U.clear()}},[n,s,o,u]);const _=R.useCallback(async U=>{const $=pd.getDeviceId(),te={...U,deviceId:$};await pd.storeCredentials(U),u(te);try{await Bt.connect(te),o(!0)}catch(Y){throw o(!1),Y}},[u,o]),E=R.useCallback(()=>{Bt.disconnect(),o(!1)},[o]),A=R.useCallback(async()=>{Bt.disconnect(),await pd.forgetAll(),Ge.getState().reset(),ht.getState().reset()},[]),w=R.useCallback(async U=>{const $=crypto.randomUUID();c({id:$,sessionId:"supervisor",role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"text",content:U}],isStreaming:!1,createdAt:new Date,sendStatus:"pending",fromDeviceId:f==null?void 0:f.deviceId}),m($),h(!0);const te={type:"supervisor.command",id:$,payload:{command:U}};Bt.send(te);const Y=setTimeout(()=>{r.current.delete($);const ie=ht.getState();ie.pendingMessageAcks.has($)&&(ie.removePendingAck($),p($,"failed"))},5e3);r.current.set($,Y)},[f,l]),v=R.useCallback(async(U,$)=>{const te=crypto.randomUUID(),Y=ht.getState();Y.addAgentMessage(U,{id:te,sessionId:U,role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"text",content:$}],isStreaming:!1,createdAt:new Date,sendStatus:"pending",fromDeviceId:f==null?void 0:f.deviceId}),Y.addPendingAck(te),Y.setAgentIsLoading(U,!0);const ie={type:"session.execute",id:te,session_id:U,payload:{content:$}};Bt.send(ie);const ee=setTimeout(()=>{r.current.delete(te);const I=ht.getState();I.pendingMessageAcks.has(te)&&(I.removePendingAck(te),I.setMessageSendStatus(te,"failed"))},5e3);r.current.set(te,ee)},[f]),S=R.useCallback(async(U,$,te,Y,ie)=>{const ee={type:"supervisor.create_session",id:crypto.randomUUID(),payload:{session_type:U,agent_name:ie,workspace:$,project:te,worktree:Y}};return Bt.sendRequest(ee)},[]),g=R.useCallback(U=>{const $={type:"session.subscribe",session_id:U};Bt.send($)},[]),y=R.useCallback((U,$)=>{const te={type:"session.input",session_id:U,payload:{data:$}};Bt.send(te)},[]),T=R.useCallback((U,$,te)=>{const Y={type:"session.resize",session_id:U,payload:{cols:$,rows:te}};Bt.send(Y)},[]),M=R.useCallback(()=>{Bt.send({type:"supervisor.cancel",id:crypto.randomUUID()}),h(!1)},[h]),k=R.useCallback(U=>{Bt.send({type:"session.cancel",id:crypto.randomUUID(),session_id:U}),ht.getState().setAgentIsLoading(U,!1)},[]),L=R.useCallback(async(U,$)=>{if(!f||l!=="verified"&&l!=="authenticated")return;const te=crypto.randomUUID();on.voice(`Sending supervisor voice command: format=${$}, audioSize=${U.length}, messageId=${te}`),c({id:te,sessionId:"supervisor",role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"voice_input",content:"",metadata:{audioBase64:U,messageId:te}}],isStreaming:!1,createdAt:new Date,sendStatus:"pending",fromDeviceId:f==null?void 0:f.deviceId});const Y=crypto.randomUUID();c({id:Y,sessionId:"supervisor",role:"assistant",contentBlocks:[],isStreaming:!0,createdAt:new Date}),ht.getState().setSupervisorStreamingMessageId(Y),m(te),h(!0);const ee={type:"supervisor.command",id:te,payload:{audio:U,audio_format:$,message_id:te}};on.voice("WebSocket sending supervisor voice:",ee),Bt.send(ee);const I=setTimeout(()=>{r.current.delete(te);const z=ht.getState();z.pendingMessageAcks.has(te)&&(z.removePendingAck(te),p(te,"failed"))},1e4);r.current.set(te,I)},[f,l,c,m,h,p]),D=R.useCallback(async(U,$,te)=>{if(!f||l!=="verified"&&l!=="authenticated")return;const Y=crypto.randomUUID(),ie=ht.getState();on.voice(`Sending agent voice command: sessionId=${U}, format=${te}, audioSize=${$.length}, messageId=${Y}`),ie.addAgentMessage(U,{id:Y,sessionId:U,role:"user",contentBlocks:[{id:crypto.randomUUID(),blockType:"voice_input",content:"",metadata:{audioBase64:$,messageId:Y}}],isStreaming:!1,createdAt:new Date,sendStatus:"pending",fromDeviceId:f==null?void 0:f.deviceId});const ee=crypto.randomUUID();ie.addAgentMessage(U,{id:ee,sessionId:U,role:"assistant",contentBlocks:[],isStreaming:!0,createdAt:new Date}),ie.setAgentStreamingMessageId(U,ee),ie.addPendingAck(Y),ie.setAgentIsLoading(U,!0);const I={type:"session.execute",id:Y,session_id:U,payload:{audio:$,audio_format:te,message_id:Y}};Bt.send(I);const z=setTimeout(()=>{r.current.delete(Y);const P=ht.getState();P.pendingMessageAcks.has(Y)&&(P.removePendingAck(Y),P.setMessageSendStatus(Y,"failed"))},1e4);r.current.set(Y,z)},[f,l]),j=R.useCallback(()=>{Bt.send({type:"supervisor.clear_context",id:crypto.randomUUID()}),ht.getState().clearSupervisorMessages()},[]),K=R.useCallback(()=>{const U={type:"sync",id:crypto.randomUUID()};Bt.send(U)},[]),Q=R.useCallback((U,$,te=20)=>{const Y={type:"history.request",id:crypto.randomUUID(),payload:{session_id:U,before_sequence:$,limit:te}};Bt.send(Y)},[]),H=R.useCallback(U=>{Bt.send({type:"supervisor.terminate_session",id:crypto.randomUUID(),payload:{session_id:U}})},[]);return{connect:_,disconnect:E,disconnectAndForget:A,sendSupervisorCommand:w,sendAgentCommand:v,sendSupervisorVoiceCommand:L,sendAgentVoiceCommand:D,createSession:S,subscribeToSession:g,sendTerminalInput:y,resizeTerminal:T,cancelSupervisor:M,cancelAgent:k,clearSupervisorContext:j,terminateSession:H,requestSync:K,requestHistory:Q,isConnected:Bt.isConnected}}const c1="(prefers-color-scheme: dark)",Mk="ui-theme",u1=R.createContext(void 0);function mm(){return typeof window>"u"||window.matchMedia(c1).matches?"dark":"light"}function kk({children:e,defaultTheme:r="system",storageKey:n=Mk}){const[s,o]=R.useState(()=>localStorage.getItem(n)||r),[u,f]=R.useState(()=>s==="system"?mm():s);R.useEffect(()=>{const c=window.document.documentElement;c.classList.remove("light","dark");const h=s==="system"?mm():s;c.classList.add(h),f(h)},[s]),R.useEffect(()=>{const c=window.matchMedia(c1),h=()=>{if(s==="system"){const m=window.document.documentElement,p=mm();m.classList.remove("light","dark"),m.classList.add(p),f(p)}};return c.addEventListener("change",h),()=>c.removeEventListener("change",h)},[s]);const l=c=>{localStorage.setItem(n,c),o(c)};return b.jsx(u1.Provider,{value:{theme:s,setTheme:l,resolvedTheme:u},children:e})}function Wg(){const e=R.useContext(u1);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function d1(e){return b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",...e,children:[b.jsx("defs",{children:b.jsxs("linearGradient",{id:"tiflis-accent",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[b.jsx("stop",{offset:"0%",stopColor:"#2E5AA6"}),b.jsx("stop",{offset:"100%",stopColor:"#6F4ABF"})]})}),b.jsx("rect",{width:"64",height:"64",rx:"12",fill:"#111"}),b.jsx("path",{d:"M 14 20 L 10 26 L 10 42 L 14 48",fill:"none",stroke:"#2E5AA6",strokeWidth:"2.6",strokeLinecap:"round"}),b.jsx("path",{d:"M 50 20 L 54 26 L 54 42 L 50 48",fill:"none",stroke:"#6F4ABF",strokeWidth:"2.6",strokeLinecap:"round"}),b.jsx("text",{x:"14",y:"46",fontFamily:"monospace",fontSize:"23",fill:"url(#tiflis-accent)",children:"›"}),b.jsx("text",{x:"32",y:"47",textAnchor:"middle",fontFamily:"system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif",fontSize:"47",fontWeight:"500",fill:"#fff",children:"t"})]})}function Jl(e){return b.jsx(d1,{...e})}function Sc({className:e,...r}){return b.jsx("img",{src:"/icons/claude-logo.png",alt:"Claude Code",className:e,...r})}function Cc({className:e,...r}){const{resolvedTheme:n}=Wg(),s=n==="dark"?"/icons/opencode-logo-dark.png":"/icons/opencode-logo-light.png";return b.jsx("img",{src:s,alt:"OpenCode",className:e,...r})}function bc({className:e,...r}){return b.jsx("img",{src:"/icons/cursor-logo.png",alt:"Cursor",className:e,...r})}function Zl(e){return b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[b.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),b.jsx("path",{d:"M7 9l3 3-3 3"}),b.jsx("path",{d:"M13 15h4"})]})}function gs(e){return b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[b.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),b.jsx("circle",{cx:"12",cy:"10",r:"3"}),b.jsx("path",{d:"M7 20v-1a5 5 0 0 1 10 0v1"})]})}function Lk(){const[e,r]=R.useState(""),[n,s]=R.useState(!1),[o,u]=R.useState(null),[f,l]=R.useState(!1),{connect:c}=co(),h=R.useCallback(async _=>{u(null);const E=_??e.trim(),A=v2(E);if(!A){u("Invalid magic link format");return}s(!0);try{await c({tunnelId:A.tunnelId,tunnelUrl:A.url,authKey:A.key})}catch(w){u(w instanceof Error?w.message:"Connection failed"),s(!1)}},[c,e]),m=R.useCallback(_=>{l(!1),r(_),h(_)},[h]),p=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),h())};return b.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 bg-background",children:b.jsxs(hs,{className:"w-full max-w-md",children:[b.jsxs(fs,{className:"text-center",children:[b.jsx("div",{className:"mx-auto mb-4 w-16 h-16 rounded-lg overflow-hidden",children:b.jsx(d1,{className:"w-16 h-16"})}),b.jsx(ps,{className:"text-2xl",children:"Tiflis Code"}),b.jsx(Xs,{children:"Connect to your workstation to control AI agents remotely"})]}),b.jsx(ms,{className:"space-y-4",children:f?b.jsx(ZM,{onScan:m,onBack:()=>l(!1)}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"space-y-2",children:[b.jsx(nb,{placeholder:"Paste magic link here...",value:e,onChange:_=>r(_.target.value),onKeyDown:p,disabled:n}),o&&b.jsx("p",{className:"text-sm text-destructive",children:o})]}),b.jsx(ct,{className:"w-full",onClick:()=>h(),disabled:!e.trim()||n,children:n?b.jsxs(b.Fragment,{children:[b.jsx(yc,{className:"animate-spin"}),"Connecting..."]}):b.jsxs(b.Fragment,{children:[b.jsx(FM,{}),"Connect"]})}),b.jsxs("div",{className:"relative",children:[b.jsx("div",{className:"absolute inset-0 flex items-center",children:b.jsx("span",{className:"w-full border-t"})}),b.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:b.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or"})})]}),b.jsxs(ct,{variant:"outline",className:"w-full",onClick:()=>l(!0),disabled:n,children:[b.jsx(YM,{}),"Scan QR Code"]})]})})]})})}function Le(e,r,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return r==null?void 0:r(o)}}function Ok(e,r){const n=R.createContext(r),s=u=>{const{children:f,...l}=u,c=R.useMemo(()=>l,Object.values(l));return b.jsx(n.Provider,{value:c,children:f})};s.displayName=e+"Provider";function o(u){const f=R.useContext(n);if(f)return f;if(r!==void 0)return r;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[s,o]}function qn(e,r=[]){let n=[];function s(u,f){const l=R.createContext(f),c=n.length;n=[...n,f];const h=p=>{var S;const{scope:_,children:E,...A}=p,w=((S=_==null?void 0:_[e])==null?void 0:S[c])||l,v=R.useMemo(()=>A,Object.values(A));return b.jsx(w.Provider,{value:v,children:E})};h.displayName=u+"Provider";function m(p,_){var w;const E=((w=_==null?void 0:_[e])==null?void 0:w[c])||l,A=R.useContext(E);if(A)return A;if(f!==void 0)return f;throw new Error(`\`${p}\` must be used within \`${u}\``)}return[h,m]}const o=()=>{const u=n.map(f=>R.createContext(f));return function(l){const c=(l==null?void 0:l[e])||u;return R.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[s,Bk(o,...r)]}function Bk(...e){const r=e[0];if(e.length===1)return r;const n=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const f=s.reduce((l,{useScope:c,scopeName:h})=>{const p=c(u)[`__scope${h}`];return{...l,...p}},{});return R.useMemo(()=>({[`__scope${r.scopeName}`]:f}),[f])}};return n.scopeName=r.scopeName,n}var fr=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},Nk=Mg[" useId ".trim().toString()]||(()=>{}),Ik=0;function jn(e){const[r,n]=R.useState(Nk());return fr(()=>{n(s=>s??String(Ik++))},[e]),r?`radix-${r}`:""}var Pk=Mg[" useInsertionEffect ".trim().toString()]||fr;function ro({prop:e,defaultProp:r,onChange:n=()=>{},caller:s}){const[o,u,f]=jk({defaultProp:r,onChange:n}),l=e!==void 0,c=l?e:o;{const m=R.useRef(e!==void 0);R.useEffect(()=>{const p=m.current;p!==l&&console.warn(`${s} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=l},[l,s])}const h=R.useCallback(m=>{var p;if(l){const _=Uk(m)?m(e):m;_!==e&&((p=f.current)==null||p.call(f,_))}else u(m)},[l,e,u,f]);return[c,h]}function jk({defaultProp:e,onChange:r}){const[n,s]=R.useState(e),o=R.useRef(n),u=R.useRef(r);return Pk(()=>{u.current=r},[r]),R.useEffect(()=>{var f;o.current!==n&&((f=u.current)==null||f.call(u,n),o.current=n)},[n,o]),[n,s,u]}function Uk(e){return typeof e=="function"}function no(e){const r=Fk(e),n=R.forwardRef((s,o)=>{const{children:u,...f}=s,l=R.Children.toArray(u),c=l.find(Vk);if(c){const h=c.props.children,m=l.map(p=>p===c?R.Children.count(h)>1?R.Children.only(null):R.isValidElement(h)?h.props.children:null:p);return b.jsx(r,{...f,ref:o,children:R.isValidElement(h)?R.cloneElement(h,void 0,m):null})}return b.jsx(r,{...f,ref:o,children:u})});return n.displayName=`${e}.Slot`,n}function Fk(e){const r=R.forwardRef((n,s)=>{const{children:o,...u}=n;if(R.isValidElement(o)){const f=Gk(o),l=qk(u,o.props);return o.type!==R.Fragment&&(l.ref=s?_c(s,f):f),R.cloneElement(o,l)}return R.Children.count(o)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var h1=Symbol("radix.slottable");function Hk(e){const r=({children:n})=>b.jsx(b.Fragment,{children:n});return r.displayName=`${e}.Slottable`,r.__radixId=h1,r}function Vk(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===h1}function qk(e,r){const n={...r};for(const s in r){const o=e[s],u=r[s];/^on[A-Z]/.test(s)?o&&u?n[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...u}:s==="className"&&(n[s]=[o,u].filter(Boolean).join(" "))}return{...e,...n}}function Gk(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=r&&"isReactWarning"in r&&r.isReactWarning;return n?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=r&&"isReactWarning"in r&&r.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$e=zk.reduce((e,r)=>{const n=no(`Primitive.${r}`),s=R.forwardRef((o,u)=>{const{asChild:f,...l}=o,c=f?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${r}`,{...e,[r]:s}},{});function f1(e,r){e&&vc.flushSync(()=>e.dispatchEvent(r))}function Fn(e){const r=R.useRef(e);return R.useEffect(()=>{r.current=e}),R.useMemo(()=>(...n)=>{var s;return(s=r.current)==null?void 0:s.call(r,...n)},[])}function Yk(e,r=globalThis==null?void 0:globalThis.document){const n=Fn(e);R.useEffect(()=>{const s=o=>{o.key==="Escape"&&n(o)};return r.addEventListener("keydown",s,{capture:!0}),()=>r.removeEventListener("keydown",s,{capture:!0})},[n,r])}var Wk="DismissableLayer",ng="dismissableLayer.update",Kk="dismissableLayer.pointerDownOutside",Qk="dismissableLayer.focusOutside",SS,p1=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wc=R.forwardRef((e,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:f,onDismiss:l,...c}=e,h=R.useContext(p1),[m,p]=R.useState(null),_=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=R.useState({}),A=st(r,L=>p(L)),w=Array.from(h.layers),[v]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(v),g=m?w.indexOf(m):-1,y=h.layersWithOutsidePointerEventsDisabled.size>0,T=g>=S,M=Zk(L=>{const D=L.target,j=[...h.branches].some(K=>K.contains(D));!T||j||(o==null||o(L),f==null||f(L),L.defaultPrevented||l==null||l())},_),k=Xk(L=>{const D=L.target;[...h.branches].some(K=>K.contains(D))||(u==null||u(L),f==null||f(L),L.defaultPrevented||l==null||l())},_);return Yk(L=>{g===h.layers.size-1&&(s==null||s(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},_),R.useEffect(()=>{if(m)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(SS=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(m)),h.layers.add(m),CS(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=SS)}},[m,_,n,h]),R.useEffect(()=>()=>{m&&(h.layers.delete(m),h.layersWithOutsidePointerEventsDisabled.delete(m),CS())},[m,h]),R.useEffect(()=>{const L=()=>E({});return document.addEventListener(ng,L),()=>document.removeEventListener(ng,L)},[]),b.jsx($e.div,{...c,ref:A,style:{pointerEvents:y?T?"auto":"none":void 0,...e.style},onFocusCapture:Le(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Le(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Le(e.onPointerDownCapture,M.onPointerDownCapture)})});wc.displayName=Wk;var $k="DismissableLayerBranch",Jk=R.forwardRef((e,r)=>{const n=R.useContext(p1),s=R.useRef(null),o=st(r,s);return R.useEffect(()=>{const u=s.current;if(u)return n.branches.add(u),()=>{n.branches.delete(u)}},[n.branches]),b.jsx($e.div,{...e,ref:o})});Jk.displayName=$k;function Zk(e,r=globalThis==null?void 0:globalThis.document){const n=Fn(e),s=R.useRef(!1),o=R.useRef(()=>{});return R.useEffect(()=>{const u=l=>{if(l.target&&!s.current){let c=function(){m1(Kk,n,h,{discrete:!0})};const h={originalEvent:l};l.pointerType==="touch"?(r.removeEventListener("click",o.current),o.current=c,r.addEventListener("click",o.current,{once:!0})):c()}else r.removeEventListener("click",o.current);s.current=!1},f=window.setTimeout(()=>{r.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(f),r.removeEventListener("pointerdown",u),r.removeEventListener("click",o.current)}},[r,n]),{onPointerDownCapture:()=>s.current=!0}}function Xk(e,r=globalThis==null?void 0:globalThis.document){const n=Fn(e),s=R.useRef(!1);return R.useEffect(()=>{const o=u=>{u.target&&!s.current&&m1(Qk,n,{originalEvent:u},{discrete:!1})};return r.addEventListener("focusin",o),()=>r.removeEventListener("focusin",o)},[r,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function CS(){const e=new CustomEvent(ng);document.dispatchEvent(e)}function m1(e,r,n,{discrete:s}){const o=n.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});r&&o.addEventListener(e,r,{once:!0}),s?f1(o,u):o.dispatchEvent(u)}var gm="focusScope.autoFocusOnMount",vm="focusScope.autoFocusOnUnmount",bS={bubbles:!1,cancelable:!0},eL="FocusScope",Ec=R.forwardRef((e,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...f}=e,[l,c]=R.useState(null),h=Fn(o),m=Fn(u),p=R.useRef(null),_=st(r,w=>c(w)),E=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(s){let w=function(y){if(E.paused||!l)return;const T=y.target;l.contains(T)?p.current=T:ds(p.current,{select:!0})},v=function(y){if(E.paused||!l)return;const T=y.relatedTarget;T!==null&&(l.contains(T)||ds(p.current,{select:!0}))},S=function(y){if(document.activeElement===document.body)for(const M of y)M.removedNodes.length>0&&ds(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",v);const g=new MutationObserver(S);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",v),g.disconnect()}}},[s,l,E.paused]),R.useEffect(()=>{if(l){ES.add(E);const w=document.activeElement;if(!l.contains(w)){const S=new CustomEvent(gm,bS);l.addEventListener(gm,h),l.dispatchEvent(S),S.defaultPrevented||(tL(oL(g1(l)),{select:!0}),document.activeElement===w&&ds(l))}return()=>{l.removeEventListener(gm,h),setTimeout(()=>{const S=new CustomEvent(vm,bS);l.addEventListener(vm,m),l.dispatchEvent(S),S.defaultPrevented||ds(w??document.body,{select:!0}),l.removeEventListener(vm,m),ES.remove(E)},0)}}},[l,h,m,E]);const A=R.useCallback(w=>{if(!n&&!s||E.paused)return;const v=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(v&&S){const g=w.currentTarget,[y,T]=rL(g);y&&T?!w.shiftKey&&S===T?(w.preventDefault(),n&&ds(y,{select:!0})):w.shiftKey&&S===y&&(w.preventDefault(),n&&ds(T,{select:!0})):S===g&&w.preventDefault()}},[n,s,E.paused]);return b.jsx($e.div,{tabIndex:-1,...f,ref:_,onKeyDown:A})});Ec.displayName=eL;function tL(e,{select:r=!1}={}){const n=document.activeElement;for(const s of e)if(ds(s,{select:r}),document.activeElement!==n)return}function rL(e){const r=g1(e),n=wS(r,e),s=wS(r.reverse(),e);return[n,s]}function g1(e){const r=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)r.push(n.currentNode);return r}function wS(e,r){for(const n of e)if(!nL(n,{upTo:r}))return n}function nL(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function iL(e){return e instanceof HTMLInputElement&&"select"in e}function ds(e,{select:r=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&iL(e)&&r&&e.select()}}var ES=sL();function sL(){let e=[];return{add(r){const n=e[0];r!==n&&(n==null||n.pause()),e=xS(e,r),e.unshift(r)},remove(r){var n;e=xS(e,r),(n=e[0])==null||n.resume()}}}function xS(e,r){const n=[...e],s=n.indexOf(r);return s!==-1&&n.splice(s,1),n}function oL(e){return e.filter(r=>r.tagName!=="A")}var aL="Portal",xc=R.forwardRef((e,r)=>{var l;const{container:n,...s}=e,[o,u]=R.useState(!1);fr(()=>u(!0),[]);const f=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return f?TD.createPortal(b.jsx($e.div,{...s,ref:r}),f):null});xc.displayName=aL;function lL(e,r){return R.useReducer((n,s)=>r[n][s]??n,e)}var Gn=e=>{const{present:r,children:n}=e,s=cL(r),o=typeof n=="function"?n({present:s.isPresent}):R.Children.only(n),u=st(s.ref,uL(o));return typeof n=="function"||s.isPresent?R.cloneElement(o,{ref:u}):null};Gn.displayName="Presence";function cL(e){const[r,n]=R.useState(),s=R.useRef(null),o=R.useRef(e),u=R.useRef("none"),f=e?"mounted":"unmounted",[l,c]=lL(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const h=md(s.current);u.current=l==="mounted"?h:"none"},[l]),fr(()=>{const h=s.current,m=o.current;if(m!==e){const _=u.current,E=md(h);e?c("MOUNT"):E==="none"||(h==null?void 0:h.display)==="none"?c("UNMOUNT"):c(m&&_!==E?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),fr(()=>{if(r){let h;const m=r.ownerDocument.defaultView??window,p=E=>{const w=md(s.current).includes(CSS.escape(E.animationName));if(E.target===r&&w&&(c("ANIMATION_END"),!o.current)){const v=r.style.animationFillMode;r.style.animationFillMode="forwards",h=m.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=v)})}},_=E=>{E.target===r&&(u.current=md(s.current))};return r.addEventListener("animationstart",_),r.addEventListener("animationcancel",p),r.addEventListener("animationend",p),()=>{m.clearTimeout(h),r.removeEventListener("animationstart",_),r.removeEventListener("animationcancel",p),r.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[r,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:R.useCallback(h=>{s.current=h?getComputedStyle(h):null,n(h)},[])}}function md(e){return(e==null?void 0:e.animationName)||"none"}function uL(e){var s,o;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=r&&"isReactWarning"in r&&r.isReactWarning;return n?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=r&&"isReactWarning"in r&&r.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _m=0;function vh(){R.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??AS()),document.body.insertAdjacentElement("beforeend",e[1]??AS()),_m++,()=>{_m===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),_m--}},[])}function AS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Nn=function(){return Nn=Object.assign||function(r){for(var n,s=1,o=arguments.length;s<o;s++){n=arguments[s];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},Nn.apply(this,arguments)};function v1(e,r){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)r.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(n[s[o]]=e[s[o]]);return n}function dL(e,r,n){if(n||arguments.length===2)for(var s=0,o=r.length,u;s<o;s++)(u||!(s in r))&&(u||(u=Array.prototype.slice.call(r,0,s)),u[s]=r[s]);return e.concat(u||Array.prototype.slice.call(r))}var Bd="right-scroll-bar-position",Nd="width-before-scroll-bar",hL="with-scroll-bars-hidden",fL="--removed-body-scroll-bar-size";function ym(e,r){return typeof e=="function"?e(r):e&&(e.current=r),e}function pL(e,r){var n=R.useState(function(){return{value:e,callback:r,facade:{get current(){return n.value},set current(s){var o=n.value;o!==s&&(n.value=s,n.callback(s,o))}}}})[0];return n.callback=r,n.facade}var mL=typeof window<"u"?R.useLayoutEffect:R.useEffect,TS=new WeakMap;function gL(e,r){var n=pL(null,function(s){return e.forEach(function(o){return ym(o,s)})});return mL(function(){var s=TS.get(n);if(s){var o=new Set(s),u=new Set(e),f=n.current;o.forEach(function(l){u.has(l)||ym(l,null)}),u.forEach(function(l){o.has(l)||ym(l,f)})}TS.set(n,e)},[e]),n}function vL(e){return e}function _L(e,r){r===void 0&&(r=vL);var n=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(u){var f=r(u,s);return n.push(f),function(){n=n.filter(function(l){return l!==f})}},assignSyncMedium:function(u){for(s=!0;n.length;){var f=n;n=[],f.forEach(u)}n={push:function(l){return u(l)},filter:function(){return n}}},assignMedium:function(u){s=!0;var f=[];if(n.length){var l=n;n=[],l.forEach(u),f=n}var c=function(){var m=f;f=[],m.forEach(u)},h=function(){return Promise.resolve().then(c)};h(),n={push:function(m){f.push(m),h()},filter:function(m){return f=f.filter(m),n}}}};return o}function yL(e){e===void 0&&(e={});var r=_L(null);return r.options=Nn({async:!0,ssr:!1},e),r}var _1=function(e){var r=e.sideCar,n=v1(e,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=r.read();if(!s)throw new Error("Sidecar medium not found");return R.createElement(s,Nn({},n))};_1.isSideCarExport=!0;function SL(e,r){return e.useMedium(r),_1}var y1=yL(),Sm=function(){},_h=R.forwardRef(function(e,r){var n=R.useRef(null),s=R.useState({onScrollCapture:Sm,onWheelCapture:Sm,onTouchMoveCapture:Sm}),o=s[0],u=s[1],f=e.forwardProps,l=e.children,c=e.className,h=e.removeScrollBar,m=e.enabled,p=e.shards,_=e.sideCar,E=e.noRelative,A=e.noIsolation,w=e.inert,v=e.allowPinchZoom,S=e.as,g=S===void 0?"div":S,y=e.gapMode,T=v1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=_,k=gL([n,r]),L=Nn(Nn({},T),o);return R.createElement(R.Fragment,null,m&&R.createElement(M,{sideCar:y1,removeScrollBar:h,shards:p,noRelative:E,noIsolation:A,inert:w,setCallbacks:u,allowPinchZoom:!!v,lockRef:n,gapMode:y}),f?R.cloneElement(R.Children.only(l),Nn(Nn({},L),{ref:k})):R.createElement(g,Nn({},L,{className:c,ref:k}),l))});_h.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_h.classNames={fullWidth:Nd,zeroRight:Bd};var CL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function bL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var r=CL();return r&&e.setAttribute("nonce",r),e}function wL(e,r){e.styleSheet?e.styleSheet.cssText=r:e.appendChild(document.createTextNode(r))}function EL(e){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(e)}var xL=function(){var e=0,r=null;return{add:function(n){e==0&&(r=bL())&&(wL(r,n),EL(r)),e++},remove:function(){e--,!e&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},AL=function(){var e=xL();return function(r,n){R.useEffect(function(){return e.add(r),function(){e.remove()}},[r&&n])}},S1=function(){var e=AL(),r=function(n){var s=n.styles,o=n.dynamic;return e(s,o),null};return r},TL={left:0,top:0,right:0,gap:0},Cm=function(e){return parseInt(e||"",10)||0},RL=function(e){var r=window.getComputedStyle(document.body),n=r[e==="padding"?"paddingLeft":"marginLeft"],s=r[e==="padding"?"paddingTop":"marginTop"],o=r[e==="padding"?"paddingRight":"marginRight"];return[Cm(n),Cm(s),Cm(o)]},DL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return TL;var r=RL(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,s-n+r[2]-r[0])}},ML=S1(),ua="data-scroll-locked",kL=function(e,r,n,s){var o=e.left,u=e.top,f=e.right,l=e.gap;return n===void 0&&(n="margin"),`
331
+ .`.concat(hL,` {
332
+ overflow: hidden `).concat(s,`;
333
+ padding-right: `).concat(l,"px ").concat(s,`;
334
+ }
335
+ body[`).concat(ua,`] {
336
+ overflow: hidden `).concat(s,`;
337
+ overscroll-behavior: contain;
338
+ `).concat([r&&"position: relative ".concat(s,";"),n==="margin"&&`
339
+ padding-left: `.concat(o,`px;
340
+ padding-top: `).concat(u,`px;
341
+ padding-right: `).concat(f,`px;
342
+ margin-left:0;
343
+ margin-top:0;
344
+ margin-right: `).concat(l,"px ").concat(s,`;
345
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
346
+ }
347
+
348
+ .`).concat(Bd,` {
349
+ right: `).concat(l,"px ").concat(s,`;
350
+ }
351
+
352
+ .`).concat(Nd,` {
353
+ margin-right: `).concat(l,"px ").concat(s,`;
354
+ }
355
+
356
+ .`).concat(Bd," .").concat(Bd,` {
357
+ right: 0 `).concat(s,`;
358
+ }
359
+
360
+ .`).concat(Nd," .").concat(Nd,` {
361
+ margin-right: 0 `).concat(s,`;
362
+ }
363
+
364
+ body[`).concat(ua,`] {
365
+ `).concat(fL,": ").concat(l,`px;
366
+ }
367
+ `)},RS=function(){var e=parseInt(document.body.getAttribute(ua)||"0",10);return isFinite(e)?e:0},LL=function(){R.useEffect(function(){return document.body.setAttribute(ua,(RS()+1).toString()),function(){var e=RS()-1;e<=0?document.body.removeAttribute(ua):document.body.setAttribute(ua,e.toString())}},[])},OL=function(e){var r=e.noRelative,n=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;LL();var u=R.useMemo(function(){return DL(o)},[o]);return R.createElement(ML,{styles:kL(u,!r,o,n?"":"!important")})},ig=!1;if(typeof window<"u")try{var gd=Object.defineProperty({},"passive",{get:function(){return ig=!0,!0}});window.addEventListener("test",gd,gd),window.removeEventListener("test",gd,gd)}catch{ig=!1}var na=ig?{passive:!1}:!1,BL=function(e){return e.tagName==="TEXTAREA"},C1=function(e,r){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[r]!=="hidden"&&!(n.overflowY===n.overflowX&&!BL(e)&&n[r]==="visible")},NL=function(e){return C1(e,"overflowY")},IL=function(e){return C1(e,"overflowX")},DS=function(e,r){var n=r.ownerDocument,s=r;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=b1(e,s);if(o){var u=w1(e,s),f=u[1],l=u[2];if(f>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},PL=function(e){var r=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[r,n,s]},jL=function(e){var r=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[r,n,s]},b1=function(e,r){return e==="v"?NL(r):IL(r)},w1=function(e,r){return e==="v"?PL(r):jL(r)},UL=function(e,r){return e==="h"&&r==="rtl"?-1:1},FL=function(e,r,n,s,o){var u=UL(e,window.getComputedStyle(r).direction),f=u*s,l=n.target,c=r.contains(l),h=!1,m=f>0,p=0,_=0;do{if(!l)break;var E=w1(e,l),A=E[0],w=E[1],v=E[2],S=w-v-u*A;(A||S)&&b1(e,l)&&(p+=S,_+=A);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&l!==document.body||c&&(r.contains(l)||r===l));return(m&&Math.abs(p)<1||!m&&Math.abs(_)<1)&&(h=!0),h},vd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MS=function(e){return[e.deltaX,e.deltaY]},kS=function(e){return e&&"current"in e?e.current:e},HL=function(e,r){return e[0]===r[0]&&e[1]===r[1]},VL=function(e){return`
368
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
369
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
370
+ `)},qL=0,ia=[];function GL(e){var r=R.useRef([]),n=R.useRef([0,0]),s=R.useRef(),o=R.useState(qL++)[0],u=R.useState(S1)[0],f=R.useRef(e);R.useEffect(function(){f.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=dL([e.lockRef.current],(e.shards||[]).map(kS),!0).filter(Boolean);return w.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=R.useCallback(function(w,v){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!f.current.allowPinchZoom;var S=vd(w),g=n.current,y="deltaX"in w?w.deltaX:g[0]-S[0],T="deltaY"in w?w.deltaY:g[1]-S[1],M,k=w.target,L=Math.abs(y)>Math.abs(T)?"h":"v";if("touches"in w&&L==="h"&&k.type==="range")return!1;var D=window.getSelection(),j=D&&D.anchorNode,K=j?j===k||j.contains(k):!1;if(K)return!1;var Q=DS(L,k);if(!Q)return!0;if(Q?M=L:(M=L==="v"?"h":"v",Q=DS(L,k)),!Q)return!1;if(!s.current&&"changedTouches"in w&&(y||T)&&(s.current=M),!M)return!0;var H=s.current||M;return FL(H,v,w,H==="h"?y:T)},[]),c=R.useCallback(function(w){var v=w;if(!(!ia.length||ia[ia.length-1]!==u)){var S="deltaY"in v?MS(v):vd(v),g=r.current.filter(function(M){return M.name===v.type&&(M.target===v.target||v.target===M.shadowParent)&&HL(M.delta,S)})[0];if(g&&g.should){v.cancelable&&v.preventDefault();return}if(!g){var y=(f.current.shards||[]).map(kS).filter(Boolean).filter(function(M){return M.contains(v.target)}),T=y.length>0?l(v,y[0]):!f.current.noIsolation;T&&v.cancelable&&v.preventDefault()}}},[]),h=R.useCallback(function(w,v,S,g){var y={name:w,delta:v,target:S,should:g,shadowParent:zL(S)};r.current.push(y),setTimeout(function(){r.current=r.current.filter(function(T){return T!==y})},1)},[]),m=R.useCallback(function(w){n.current=vd(w),s.current=void 0},[]),p=R.useCallback(function(w){h(w.type,MS(w),w.target,l(w,e.lockRef.current))},[]),_=R.useCallback(function(w){h(w.type,vd(w),w.target,l(w,e.lockRef.current))},[]);R.useEffect(function(){return ia.push(u),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:_}),document.addEventListener("wheel",c,na),document.addEventListener("touchmove",c,na),document.addEventListener("touchstart",m,na),function(){ia=ia.filter(function(w){return w!==u}),document.removeEventListener("wheel",c,na),document.removeEventListener("touchmove",c,na),document.removeEventListener("touchstart",m,na)}},[]);var E=e.removeScrollBar,A=e.inert;return R.createElement(R.Fragment,null,A?R.createElement(u,{styles:VL(o)}):null,E?R.createElement(OL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zL(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const YL=SL(y1,GL);var Ac=R.forwardRef(function(e,r){return R.createElement(_h,Nn({},e,{ref:r,sideCar:YL}))});Ac.classNames=_h.classNames;var WL=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},sa=new WeakMap,_d=new WeakMap,yd={},bm=0,E1=function(e){return e&&(e.host||E1(e.parentNode))},KL=function(e,r){return r.map(function(n){if(e.contains(n))return n;var s=E1(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},QL=function(e,r,n,s){var o=KL(r,Array.isArray(e)?e:[e]);yd[n]||(yd[n]=new WeakMap);var u=yd[n],f=[],l=new Set,c=new Set(o),h=function(p){!p||l.has(p)||(l.add(p),h(p.parentNode))};o.forEach(h);var m=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(_){if(l.has(_))m(_);else try{var E=_.getAttribute(s),A=E!==null&&E!=="false",w=(sa.get(_)||0)+1,v=(u.get(_)||0)+1;sa.set(_,w),u.set(_,v),f.push(_),w===1&&A&&_d.set(_,!0),v===1&&_.setAttribute(n,"true"),A||_.setAttribute(s,"true")}catch(S){console.error("aria-hidden: cannot operate on ",_,S)}})};return m(r),l.clear(),bm++,function(){f.forEach(function(p){var _=sa.get(p)-1,E=u.get(p)-1;sa.set(p,_),u.set(p,E),_||(_d.has(p)||p.removeAttribute(s),_d.delete(p)),E||p.removeAttribute(n)}),bm--,bm||(sa=new WeakMap,sa=new WeakMap,_d=new WeakMap,yd={})}},yh=function(e,r,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=WL(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),QL(s,o,n,"aria-hidden")):function(){return null}},Sh="Dialog",[x1,A1]=qn(Sh),[$L,Sn]=x1(Sh),T1=e=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:o,onOpenChange:u,modal:f=!0}=e,l=R.useRef(null),c=R.useRef(null),[h,m]=ro({prop:s,defaultProp:o??!1,onChange:u,caller:Sh});return b.jsx($L,{scope:r,triggerRef:l,contentRef:c,contentId:jn(),titleId:jn(),descriptionId:jn(),open:h,onOpenChange:m,onOpenToggle:R.useCallback(()=>m(p=>!p),[m]),modal:f,children:n})};T1.displayName=Sh;var R1="DialogTrigger",D1=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn(R1,n),u=st(r,o.triggerRef);return b.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$g(o.open),...s,ref:u,onClick:Le(e.onClick,o.onOpenToggle)})});D1.displayName=R1;var Kg="DialogPortal",[JL,M1]=x1(Kg,{forceMount:void 0}),k1=e=>{const{__scopeDialog:r,forceMount:n,children:s,container:o}=e,u=Sn(Kg,r);return b.jsx(JL,{scope:r,forceMount:n,children:R.Children.map(s,f=>b.jsx(Gn,{present:n||u.open,children:b.jsx(xc,{asChild:!0,container:o,children:f})}))})};k1.displayName=Kg;var zd="DialogOverlay",L1=R.forwardRef((e,r)=>{const n=M1(zd,e.__scopeDialog),{forceMount:s=n.forceMount,...o}=e,u=Sn(zd,e.__scopeDialog);return u.modal?b.jsx(Gn,{present:s||u.open,children:b.jsx(XL,{...o,ref:r})}):null});L1.displayName=zd;var ZL=no("DialogOverlay.RemoveScroll"),XL=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn(zd,n);return b.jsx(Ac,{as:ZL,allowPinchZoom:!0,shards:[o.contentRef],children:b.jsx($e.div,{"data-state":$g(o.open),...s,ref:r,style:{pointerEvents:"auto",...s.style}})})}),io="DialogContent",O1=R.forwardRef((e,r)=>{const n=M1(io,e.__scopeDialog),{forceMount:s=n.forceMount,...o}=e,u=Sn(io,e.__scopeDialog);return b.jsx(Gn,{present:s||u.open,children:u.modal?b.jsx(eO,{...o,ref:r}):b.jsx(tO,{...o,ref:r})})});O1.displayName=io;var eO=R.forwardRef((e,r)=>{const n=Sn(io,e.__scopeDialog),s=R.useRef(null),o=st(r,n.contentRef,s);return R.useEffect(()=>{const u=s.current;if(u)return yh(u)},[]),b.jsx(B1,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=n.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,u=>{const f=u.detail.originalEvent,l=f.button===0&&f.ctrlKey===!0;(f.button===2||l)&&u.preventDefault()}),onFocusOutside:Le(e.onFocusOutside,u=>u.preventDefault())})}),tO=R.forwardRef((e,r)=>{const n=Sn(io,e.__scopeDialog),s=R.useRef(!1),o=R.useRef(!1);return b.jsx(B1,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,l;(f=e.onCloseAutoFocus)==null||f.call(e,u),u.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),u.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:u=>{var c,h;(c=e.onInteractOutside)==null||c.call(e,u),u.defaultPrevented||(s.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const f=u.target;((h=n.triggerRef.current)==null?void 0:h.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),B1=R.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:u,...f}=e,l=Sn(io,n),c=R.useRef(null),h=st(r,c);return vh(),b.jsxs(b.Fragment,{children:[b.jsx(Ec,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:u,children:b.jsx(wc,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":$g(l.open),...f,ref:h,onDismiss:()=>l.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(nO,{titleId:l.titleId}),b.jsx(sO,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Qg="DialogTitle",N1=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn(Qg,n);return b.jsx($e.h2,{id:o.titleId,...s,ref:r})});N1.displayName=Qg;var I1="DialogDescription",P1=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn(I1,n);return b.jsx($e.p,{id:o.descriptionId,...s,ref:r})});P1.displayName=I1;var j1="DialogClose",U1=R.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,o=Sn(j1,n);return b.jsx($e.button,{type:"button",...s,ref:r,onClick:Le(e.onClick,()=>o.onOpenChange(!1))})});U1.displayName=j1;function $g(e){return e?"open":"closed"}var F1="DialogTitleWarning",[rO,H1]=Ok(F1,{contentName:io,titleName:Qg,docsSlug:"dialog"}),nO=({titleId:e})=>{const r=H1(F1),n=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
371
+
372
+ If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
373
+
374
+ For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return R.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},iO="DialogDescriptionWarning",sO=({contentRef:e,descriptionId:r})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${H1(iO).contentName}}.`;return R.useEffect(()=>{var u;const o=(u=e.current)==null?void 0:u.getAttribute("aria-describedby");r&&o&&(document.getElementById(r)||console.warn(s))},[s,e,r]),null},V1=T1,q1=D1,G1=k1,Jg=L1,Zg=O1,Xg=N1,ev=P1,tv=U1;const oO=V1,aO=q1,lO=G1,z1=R.forwardRef(({className:e,...r},n)=>b.jsx(Jg,{ref:n,className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));z1.displayName=Jg.displayName;const Y1=R.forwardRef(({className:e,children:r,...n},s)=>b.jsxs(lO,{children:[b.jsx(z1,{}),b.jsxs(Zg,{ref:s,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[r,b.jsxs(tv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b.jsx(Yg,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Y1.displayName=Zg.displayName;const W1=({className:e,...r})=>b.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});W1.displayName="DialogHeader";const K1=({className:e,...r})=>b.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});K1.displayName="DialogFooter";const Q1=R.forwardRef(({className:e,...r},n)=>b.jsx(Xg,{ref:n,className:Te("text-lg font-semibold leading-none tracking-tight",e),...r}));Q1.displayName=Xg.displayName;const $1=R.forwardRef(({className:e,...r},n)=>b.jsx(ev,{ref:n,className:Te("text-sm text-muted-foreground",e),...r}));$1.displayName=ev.displayName;function LS(e,[r,n]){return Math.min(n,Math.max(r,e))}function rv(e){const r=e+"CollectionProvider",[n,s]=qn(r),[o,u]=n(r,{collectionRef:{current:null},itemMap:new Map}),f=w=>{const{scope:v,children:S}=w,g=nn.useRef(null),y=nn.useRef(new Map).current;return b.jsx(o,{scope:v,itemMap:y,collectionRef:g,children:S})};f.displayName=r;const l=e+"CollectionSlot",c=no(l),h=nn.forwardRef((w,v)=>{const{scope:S,children:g}=w,y=u(l,S),T=st(v,y.collectionRef);return b.jsx(c,{ref:T,children:g})});h.displayName=l;const m=e+"CollectionItemSlot",p="data-radix-collection-item",_=no(m),E=nn.forwardRef((w,v)=>{const{scope:S,children:g,...y}=w,T=nn.useRef(null),M=st(v,T),k=u(m,S);return nn.useEffect(()=>(k.itemMap.set(T,{ref:T,...y}),()=>void k.itemMap.delete(T))),b.jsx(_,{[p]:"",ref:M,children:g})});E.displayName=m;function A(w){const v=u(e+"CollectionConsumer",w);return nn.useCallback(()=>{const g=v.collectionRef.current;if(!g)return[];const y=Array.from(g.querySelectorAll(`[${p}]`));return Array.from(v.itemMap.values()).sort((k,L)=>y.indexOf(k.ref.current)-y.indexOf(L.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:f,Slot:h,ItemSlot:E},A,s]}var cO=R.createContext(void 0);function nv(e){const r=R.useContext(cO);return e||r||"ltr"}const uO=["top","right","bottom","left"],vs=Math.min,qr=Math.max,Yd=Math.round,Sd=Math.floor,Un=e=>({x:e,y:e}),dO={left:"right",right:"left",bottom:"top",top:"bottom"},hO={start:"end",end:"start"};function sg(e,r,n){return qr(e,vs(r,n))}function Ei(e,r){return typeof e=="function"?e(r):e}function xi(e){return e.split("-")[0]}function ba(e){return e.split("-")[1]}function iv(e){return e==="x"?"y":"x"}function sv(e){return e==="y"?"height":"width"}const fO=new Set(["top","bottom"]);function In(e){return fO.has(xi(e))?"y":"x"}function ov(e){return iv(In(e))}function pO(e,r,n){n===void 0&&(n=!1);const s=ba(e),o=ov(e),u=sv(o);let f=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return r.reference[u]>r.floating[u]&&(f=Wd(f)),[f,Wd(f)]}function mO(e){const r=Wd(e);return[og(e),r,og(r)]}function og(e){return e.replace(/start|end/g,r=>hO[r])}const OS=["left","right"],BS=["right","left"],gO=["top","bottom"],vO=["bottom","top"];function _O(e,r,n){switch(e){case"top":case"bottom":return n?r?BS:OS:r?OS:BS;case"left":case"right":return r?gO:vO;default:return[]}}function yO(e,r,n,s){const o=ba(e);let u=_O(xi(e),n==="start",s);return o&&(u=u.map(f=>f+"-"+o),r&&(u=u.concat(u.map(og)))),u}function Wd(e){return e.replace(/left|right|bottom|top/g,r=>dO[r])}function SO(e){return{top:0,right:0,bottom:0,left:0,...e}}function J1(e){return typeof e!="number"?SO(e):{top:e,right:e,bottom:e,left:e}}function Kd(e){const{x:r,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:r,right:r+s,bottom:n+o,x:r,y:n}}function NS(e,r,n){let{reference:s,floating:o}=e;const u=In(r),f=ov(r),l=sv(f),c=xi(r),h=u==="y",m=s.x+s.width/2-o.width/2,p=s.y+s.height/2-o.height/2,_=s[l]/2-o[l]/2;let E;switch(c){case"top":E={x:m,y:s.y-o.height};break;case"bottom":E={x:m,y:s.y+s.height};break;case"right":E={x:s.x+s.width,y:p};break;case"left":E={x:s.x-o.width,y:p};break;default:E={x:s.x,y:s.y}}switch(ba(r)){case"start":E[f]-=_*(n&&h?-1:1);break;case"end":E[f]+=_*(n&&h?-1:1);break}return E}const CO=async(e,r,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:f}=n,l=u.filter(Boolean),c=await(f.isRTL==null?void 0:f.isRTL(r));let h=await f.getElementRects({reference:e,floating:r,strategy:o}),{x:m,y:p}=NS(h,s,c),_=s,E={},A=0;for(let w=0;w<l.length;w++){const{name:v,fn:S}=l[w],{x:g,y,data:T,reset:M}=await S({x:m,y:p,initialPlacement:s,placement:_,strategy:o,middlewareData:E,rects:h,platform:f,elements:{reference:e,floating:r}});m=g??m,p=y??p,E={...E,[v]:{...E[v],...T}},M&&A<=50&&(A++,typeof M=="object"&&(M.placement&&(_=M.placement),M.rects&&(h=M.rects===!0?await f.getElementRects({reference:e,floating:r,strategy:o}):M.rects),{x:m,y:p}=NS(h,_,c)),w=-1)}return{x:m,y:p,placement:_,strategy:o,middlewareData:E}};async function Xl(e,r){var n;r===void 0&&(r={});const{x:s,y:o,platform:u,rects:f,elements:l,strategy:c}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:_=!1,padding:E=0}=Ei(r,e),A=J1(E),v=l[_?p==="floating"?"reference":"floating":p],S=Kd(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(v)))==null||n?v:v.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(l.floating)),boundary:h,rootBoundary:m,strategy:c})),g=p==="floating"?{x:s,y:o,width:f.floating.width,height:f.floating.height}:f.reference,y=await(u.getOffsetParent==null?void 0:u.getOffsetParent(l.floating)),T=await(u.isElement==null?void 0:u.isElement(y))?await(u.getScale==null?void 0:u.getScale(y))||{x:1,y:1}:{x:1,y:1},M=Kd(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:c}):g);return{top:(S.top-M.top+A.top)/T.y,bottom:(M.bottom-S.bottom+A.bottom)/T.y,left:(S.left-M.left+A.left)/T.x,right:(M.right-S.right+A.right)/T.x}}const bO=e=>({name:"arrow",options:e,async fn(r){const{x:n,y:s,placement:o,rects:u,platform:f,elements:l,middlewareData:c}=r,{element:h,padding:m=0}=Ei(e,r)||{};if(h==null)return{};const p=J1(m),_={x:n,y:s},E=ov(o),A=sv(E),w=await f.getDimensions(h),v=E==="y",S=v?"top":"left",g=v?"bottom":"right",y=v?"clientHeight":"clientWidth",T=u.reference[A]+u.reference[E]-_[E]-u.floating[A],M=_[E]-u.reference[E],k=await(f.getOffsetParent==null?void 0:f.getOffsetParent(h));let L=k?k[y]:0;(!L||!await(f.isElement==null?void 0:f.isElement(k)))&&(L=l.floating[y]||u.floating[A]);const D=T/2-M/2,j=L/2-w[A]/2-1,K=vs(p[S],j),Q=vs(p[g],j),H=K,U=L-w[A]-Q,$=L/2-w[A]/2+D,te=sg(H,$,U),Y=!c.arrow&&ba(o)!=null&&$!==te&&u.reference[A]/2-($<H?K:Q)-w[A]/2<0,ie=Y?$<H?$-H:$-U:0;return{[E]:_[E]+ie,data:{[E]:te,centerOffset:$-te-ie,...Y&&{alignmentOffset:ie}},reset:Y}}}),wO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(r){var n,s;const{placement:o,middlewareData:u,rects:f,initialPlacement:l,platform:c,elements:h}=r,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:_,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:w=!0,...v}=Ei(e,r);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const S=xi(o),g=In(l),y=xi(l)===l,T=await(c.isRTL==null?void 0:c.isRTL(h.floating)),M=_||(y||!w?[Wd(l)]:mO(l)),k=A!=="none";!_&&k&&M.push(...yO(l,w,A,T));const L=[l,...M],D=await Xl(r,v),j=[];let K=((s=u.flip)==null?void 0:s.overflows)||[];if(m&&j.push(D[S]),p){const $=pO(o,f,T);j.push(D[$[0]],D[$[1]])}if(K=[...K,{placement:o,overflows:j}],!j.every($=>$<=0)){var Q,H;const $=(((Q=u.flip)==null?void 0:Q.index)||0)+1,te=L[$];if(te&&(!(p==="alignment"?g!==In(te):!1)||K.every(ee=>In(ee.placement)===g?ee.overflows[0]>0:!0)))return{data:{index:$,overflows:K},reset:{placement:te}};let Y=(H=K.filter(ie=>ie.overflows[0]<=0).sort((ie,ee)=>ie.overflows[1]-ee.overflows[1])[0])==null?void 0:H.placement;if(!Y)switch(E){case"bestFit":{var U;const ie=(U=K.filter(ee=>{if(k){const I=In(ee.placement);return I===g||I==="y"}return!0}).map(ee=>[ee.placement,ee.overflows.filter(I=>I>0).reduce((I,z)=>I+z,0)]).sort((ee,I)=>ee[1]-I[1])[0])==null?void 0:U[0];ie&&(Y=ie);break}case"initialPlacement":Y=l;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};function IS(e,r){return{top:e.top-r.height,right:e.right-r.width,bottom:e.bottom-r.height,left:e.left-r.width}}function PS(e){return uO.some(r=>e[r]>=0)}const EO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(r){const{rects:n}=r,{strategy:s="referenceHidden",...o}=Ei(e,r);switch(s){case"referenceHidden":{const u=await Xl(r,{...o,elementContext:"reference"}),f=IS(u,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:PS(f)}}}case"escaped":{const u=await Xl(r,{...o,altBoundary:!0}),f=IS(u,n.floating);return{data:{escapedOffsets:f,escaped:PS(f)}}}default:return{}}}}},Z1=new Set(["left","top"]);async function xO(e,r){const{placement:n,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),f=xi(n),l=ba(n),c=In(n)==="y",h=Z1.has(f)?-1:1,m=u&&c?-1:1,p=Ei(r,e);let{mainAxis:_,crossAxis:E,alignmentAxis:A}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof A=="number"&&(E=l==="end"?A*-1:A),c?{x:E*m,y:_*h}:{x:_*h,y:E*m}}const AO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(r){var n,s;const{x:o,y:u,placement:f,middlewareData:l}=r,c=await xO(r,e);return f===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:u+c.y,data:{...c,placement:f}}}}},TO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(r){const{x:n,y:s,placement:o}=r,{mainAxis:u=!0,crossAxis:f=!1,limiter:l={fn:v=>{let{x:S,y:g}=v;return{x:S,y:g}}},...c}=Ei(e,r),h={x:n,y:s},m=await Xl(r,c),p=In(xi(o)),_=iv(p);let E=h[_],A=h[p];if(u){const v=_==="y"?"top":"left",S=_==="y"?"bottom":"right",g=E+m[v],y=E-m[S];E=sg(g,E,y)}if(f){const v=p==="y"?"top":"left",S=p==="y"?"bottom":"right",g=A+m[v],y=A-m[S];A=sg(g,A,y)}const w=l.fn({...r,[_]:E,[p]:A});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[_]:u,[p]:f}}}}}},RO=function(e){return e===void 0&&(e={}),{options:e,fn(r){const{x:n,y:s,placement:o,rects:u,middlewareData:f}=r,{offset:l=0,mainAxis:c=!0,crossAxis:h=!0}=Ei(e,r),m={x:n,y:s},p=In(o),_=iv(p);let E=m[_],A=m[p];const w=Ei(l,r),v=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const y=_==="y"?"height":"width",T=u.reference[_]-u.floating[y]+v.mainAxis,M=u.reference[_]+u.reference[y]-v.mainAxis;E<T?E=T:E>M&&(E=M)}if(h){var S,g;const y=_==="y"?"width":"height",T=Z1.has(xi(o)),M=u.reference[p]-u.floating[y]+(T&&((S=f.offset)==null?void 0:S[p])||0)+(T?0:v.crossAxis),k=u.reference[p]+u.reference[y]+(T?0:((g=f.offset)==null?void 0:g[p])||0)-(T?v.crossAxis:0);A<M?A=M:A>k&&(A=k)}return{[_]:E,[p]:A}}}},DO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(r){var n,s;const{placement:o,rects:u,platform:f,elements:l}=r,{apply:c=()=>{},...h}=Ei(e,r),m=await Xl(r,h),p=xi(o),_=ba(o),E=In(o)==="y",{width:A,height:w}=u.floating;let v,S;p==="top"||p==="bottom"?(v=p,S=_===(await(f.isRTL==null?void 0:f.isRTL(l.floating))?"start":"end")?"left":"right"):(S=p,v=_==="end"?"top":"bottom");const g=w-m.top-m.bottom,y=A-m.left-m.right,T=vs(w-m[v],g),M=vs(A-m[S],y),k=!r.middlewareData.shift;let L=T,D=M;if((n=r.middlewareData.shift)!=null&&n.enabled.x&&(D=y),(s=r.middlewareData.shift)!=null&&s.enabled.y&&(L=g),k&&!_){const K=qr(m.left,0),Q=qr(m.right,0),H=qr(m.top,0),U=qr(m.bottom,0);E?D=A-2*(K!==0||Q!==0?K+Q:qr(m.left,m.right)):L=w-2*(H!==0||U!==0?H+U:qr(m.top,m.bottom))}await c({...r,availableWidth:D,availableHeight:L});const j=await f.getDimensions(l.floating);return A!==j.width||w!==j.height?{reset:{rects:!0}}:{}}}};function Ch(){return typeof window<"u"}function wa(e){return X1(e)?(e.nodeName||"").toLowerCase():"#document"}function Gr(e){var r;return(e==null||(r=e.ownerDocument)==null?void 0:r.defaultView)||window}function zn(e){var r;return(r=(X1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:r.documentElement}function X1(e){return Ch()?e instanceof Node||e instanceof Gr(e).Node:!1}function _n(e){return Ch()?e instanceof Element||e instanceof Gr(e).Element:!1}function Hn(e){return Ch()?e instanceof HTMLElement||e instanceof Gr(e).HTMLElement:!1}function jS(e){return!Ch()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Gr(e).ShadowRoot}const MO=new Set(["inline","contents"]);function Tc(e){const{overflow:r,overflowX:n,overflowY:s,display:o}=yn(e);return/auto|scroll|overlay|hidden|clip/.test(r+s+n)&&!MO.has(o)}const kO=new Set(["table","td","th"]);function LO(e){return kO.has(wa(e))}const OO=[":popover-open",":modal"];function bh(e){return OO.some(r=>{try{return e.matches(r)}catch{return!1}})}const BO=["transform","translate","scale","rotate","perspective"],NO=["transform","translate","scale","rotate","perspective","filter"],IO=["paint","layout","strict","content"];function av(e){const r=lv(),n=_n(e)?yn(e):e;return BO.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!r&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!r&&(n.filter?n.filter!=="none":!1)||NO.some(s=>(n.willChange||"").includes(s))||IO.some(s=>(n.contain||"").includes(s))}function PO(e){let r=_s(e);for(;Hn(r)&&!ma(r);){if(av(r))return r;if(bh(r))return null;r=_s(r)}return null}function lv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const jO=new Set(["html","body","#document"]);function ma(e){return jO.has(wa(e))}function yn(e){return Gr(e).getComputedStyle(e)}function wh(e){return _n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _s(e){if(wa(e)==="html")return e;const r=e.assignedSlot||e.parentNode||jS(e)&&e.host||zn(e);return jS(r)?r.host:r}function ew(e){const r=_s(e);return ma(r)?e.ownerDocument?e.ownerDocument.body:e.body:Hn(r)&&Tc(r)?r:ew(r)}function ec(e,r,n){var s;r===void 0&&(r=[]),n===void 0&&(n=!0);const o=ew(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),f=Gr(o);if(u){const l=ag(f);return r.concat(f,f.visualViewport||[],Tc(o)?o:[],l&&n?ec(l):[])}return r.concat(o,ec(o,[],n))}function ag(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tw(e){const r=yn(e);let n=parseFloat(r.width)||0,s=parseFloat(r.height)||0;const o=Hn(e),u=o?e.offsetWidth:n,f=o?e.offsetHeight:s,l=Yd(n)!==u||Yd(s)!==f;return l&&(n=u,s=f),{width:n,height:s,$:l}}function cv(e){return _n(e)?e:e.contextElement}function da(e){const r=cv(e);if(!Hn(r))return Un(1);const n=r.getBoundingClientRect(),{width:s,height:o,$:u}=tw(r);let f=(u?Yd(n.width):n.width)/s,l=(u?Yd(n.height):n.height)/o;return(!f||!Number.isFinite(f))&&(f=1),(!l||!Number.isFinite(l))&&(l=1),{x:f,y:l}}const UO=Un(0);function rw(e){const r=Gr(e);return!lv()||!r.visualViewport?UO:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function FO(e,r,n){return r===void 0&&(r=!1),!n||r&&n!==Gr(e)?!1:r}function so(e,r,n,s){r===void 0&&(r=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),u=cv(e);let f=Un(1);r&&(s?_n(s)&&(f=da(s)):f=da(e));const l=FO(u,n,s)?rw(u):Un(0);let c=(o.left+l.x)/f.x,h=(o.top+l.y)/f.y,m=o.width/f.x,p=o.height/f.y;if(u){const _=Gr(u),E=s&&_n(s)?Gr(s):s;let A=_,w=ag(A);for(;w&&s&&E!==A;){const v=da(w),S=w.getBoundingClientRect(),g=yn(w),y=S.left+(w.clientLeft+parseFloat(g.paddingLeft))*v.x,T=S.top+(w.clientTop+parseFloat(g.paddingTop))*v.y;c*=v.x,h*=v.y,m*=v.x,p*=v.y,c+=y,h+=T,A=Gr(w),w=ag(A)}}return Kd({width:m,height:p,x:c,y:h})}function Eh(e,r){const n=wh(e).scrollLeft;return r?r.left+n:so(zn(e)).left+n}function nw(e,r){const n=e.getBoundingClientRect(),s=n.left+r.scrollLeft-Eh(e,n),o=n.top+r.scrollTop;return{x:s,y:o}}function HO(e){let{elements:r,rect:n,offsetParent:s,strategy:o}=e;const u=o==="fixed",f=zn(s),l=r?bh(r.floating):!1;if(s===f||l&&u)return n;let c={scrollLeft:0,scrollTop:0},h=Un(1);const m=Un(0),p=Hn(s);if((p||!p&&!u)&&((wa(s)!=="body"||Tc(f))&&(c=wh(s)),Hn(s))){const E=so(s);h=da(s),m.x=E.x+s.clientLeft,m.y=E.y+s.clientTop}const _=f&&!p&&!u?nw(f,c):Un(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-c.scrollLeft*h.x+m.x+_.x,y:n.y*h.y-c.scrollTop*h.y+m.y+_.y}}function VO(e){return Array.from(e.getClientRects())}function qO(e){const r=zn(e),n=wh(e),s=e.ownerDocument.body,o=qr(r.scrollWidth,r.clientWidth,s.scrollWidth,s.clientWidth),u=qr(r.scrollHeight,r.clientHeight,s.scrollHeight,s.clientHeight);let f=-n.scrollLeft+Eh(e);const l=-n.scrollTop;return yn(s).direction==="rtl"&&(f+=qr(r.clientWidth,s.clientWidth)-o),{width:o,height:u,x:f,y:l}}const US=25;function GO(e,r){const n=Gr(e),s=zn(e),o=n.visualViewport;let u=s.clientWidth,f=s.clientHeight,l=0,c=0;if(o){u=o.width,f=o.height;const m=lv();(!m||m&&r==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const h=Eh(s);if(h<=0){const m=s.ownerDocument,p=m.body,_=getComputedStyle(p),E=m.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,A=Math.abs(s.clientWidth-p.clientWidth-E);A<=US&&(u-=A)}else h<=US&&(u+=h);return{width:u,height:f,x:l,y:c}}const zO=new Set(["absolute","fixed"]);function YO(e,r){const n=so(e,!0,r==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,u=Hn(e)?da(e):Un(1),f=e.clientWidth*u.x,l=e.clientHeight*u.y,c=o*u.x,h=s*u.y;return{width:f,height:l,x:c,y:h}}function FS(e,r,n){let s;if(r==="viewport")s=GO(e,n);else if(r==="document")s=qO(zn(e));else if(_n(r))s=YO(r,n);else{const o=rw(e);s={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return Kd(s)}function iw(e,r){const n=_s(e);return n===r||!_n(n)||ma(n)?!1:yn(n).position==="fixed"||iw(n,r)}function WO(e,r){const n=r.get(e);if(n)return n;let s=ec(e,[],!1).filter(l=>_n(l)&&wa(l)!=="body"),o=null;const u=yn(e).position==="fixed";let f=u?_s(e):e;for(;_n(f)&&!ma(f);){const l=yn(f),c=av(f);!c&&l.position==="fixed"&&(o=null),(u?!c&&!o:!c&&l.position==="static"&&!!o&&zO.has(o.position)||Tc(f)&&!c&&iw(e,f))?s=s.filter(m=>m!==f):o=l,f=_s(f)}return r.set(e,s),s}function KO(e){let{element:r,boundary:n,rootBoundary:s,strategy:o}=e;const f=[...n==="clippingAncestors"?bh(r)?[]:WO(r,this._c):[].concat(n),s],l=f[0],c=f.reduce((h,m)=>{const p=FS(r,m,o);return h.top=qr(p.top,h.top),h.right=vs(p.right,h.right),h.bottom=vs(p.bottom,h.bottom),h.left=qr(p.left,h.left),h},FS(r,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function QO(e){const{width:r,height:n}=tw(e);return{width:r,height:n}}function $O(e,r,n){const s=Hn(r),o=zn(r),u=n==="fixed",f=so(e,!0,u,r);let l={scrollLeft:0,scrollTop:0};const c=Un(0);function h(){c.x=Eh(o)}if(s||!s&&!u)if((wa(r)!=="body"||Tc(o))&&(l=wh(r)),s){const E=so(r,!0,u,r);c.x=E.x+r.clientLeft,c.y=E.y+r.clientTop}else o&&h();u&&!s&&o&&h();const m=o&&!s&&!u?nw(o,l):Un(0),p=f.left+l.scrollLeft-c.x-m.x,_=f.top+l.scrollTop-c.y-m.y;return{x:p,y:_,width:f.width,height:f.height}}function wm(e){return yn(e).position==="static"}function HS(e,r){if(!Hn(e)||yn(e).position==="fixed")return null;if(r)return r(e);let n=e.offsetParent;return zn(e)===n&&(n=n.ownerDocument.body),n}function sw(e,r){const n=Gr(e);if(bh(e))return n;if(!Hn(e)){let o=_s(e);for(;o&&!ma(o);){if(_n(o)&&!wm(o))return o;o=_s(o)}return n}let s=HS(e,r);for(;s&&LO(s)&&wm(s);)s=HS(s,r);return s&&ma(s)&&wm(s)&&!av(s)?n:s||PO(e)||n}const JO=async function(e){const r=this.getOffsetParent||sw,n=this.getDimensions,s=await n(e.floating);return{reference:$O(e.reference,await r(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function ZO(e){return yn(e).direction==="rtl"}const XO={convertOffsetParentRelativeRectToViewportRelativeRect:HO,getDocumentElement:zn,getClippingRect:KO,getOffsetParent:sw,getElementRects:JO,getClientRects:VO,getDimensions:QO,getScale:da,isElement:_n,isRTL:ZO};function ow(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height}function eB(e,r){let n=null,s;const o=zn(e);function u(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function f(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),u();const h=e.getBoundingClientRect(),{left:m,top:p,width:_,height:E}=h;if(l||r(),!_||!E)return;const A=Sd(p),w=Sd(o.clientWidth-(m+_)),v=Sd(o.clientHeight-(p+E)),S=Sd(m),y={rootMargin:-A+"px "+-w+"px "+-v+"px "+-S+"px",threshold:qr(0,vs(1,c))||1};let T=!0;function M(k){const L=k[0].intersectionRatio;if(L!==c){if(!T)return f();L?f(!1,L):s=setTimeout(()=>{f(!1,1e-7)},1e3)}L===1&&!ow(h,e.getBoundingClientRect())&&f(),T=!1}try{n=new IntersectionObserver(M,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(M,y)}n.observe(e)}return f(!0),u}function tB(e,r,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,h=cv(e),m=o||u?[...h?ec(h):[],...ec(r)]:[];m.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),u&&S.addEventListener("resize",n)});const p=h&&l?eB(h,n):null;let _=-1,E=null;f&&(E=new ResizeObserver(S=>{let[g]=S;g&&g.target===h&&E&&(E.unobserve(r),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var y;(y=E)==null||y.observe(r)})),n()}),h&&!c&&E.observe(h),E.observe(r));let A,w=c?so(e):null;c&&v();function v(){const S=so(e);w&&!ow(w,S)&&n(),w=S,A=requestAnimationFrame(v)}return n(),()=>{var S;m.forEach(g=>{o&&g.removeEventListener("scroll",n),u&&g.removeEventListener("resize",n)}),p==null||p(),(S=E)==null||S.disconnect(),E=null,c&&cancelAnimationFrame(A)}}const rB=AO,nB=TO,iB=wO,sB=DO,oB=EO,VS=bO,aB=RO,lB=(e,r,n)=>{const s=new Map,o={platform:XO,...n},u={...o.platform,_c:s};return CO(e,r,{...o,platform:u})};var cB=typeof document<"u",uB=function(){},Id=cB?R.useLayoutEffect:uB;function Qd(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e=="function"&&e.toString()===r.toString())return!0;let n,s,o;if(e&&r&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==r.length)return!1;for(s=n;s--!==0;)if(!Qd(e[s],r[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!Qd(e[u],r[u]))return!1}return!0}return e!==e&&r!==r}function aw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qS(e,r){const n=aw(e);return Math.round(r*n)/n}function Em(e){const r=R.useRef(e);return Id(()=>{r.current=e}),r}function dB(e){e===void 0&&(e={});const{placement:r="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:f}={},transform:l=!0,whileElementsMounted:c,open:h}=e,[m,p]=R.useState({x:0,y:0,strategy:n,placement:r,middlewareData:{},isPositioned:!1}),[_,E]=R.useState(s);Qd(_,s)||E(s);const[A,w]=R.useState(null),[v,S]=R.useState(null),g=R.useCallback(ee=>{ee!==k.current&&(k.current=ee,w(ee))},[]),y=R.useCallback(ee=>{ee!==L.current&&(L.current=ee,S(ee))},[]),T=u||A,M=f||v,k=R.useRef(null),L=R.useRef(null),D=R.useRef(m),j=c!=null,K=Em(c),Q=Em(o),H=Em(h),U=R.useCallback(()=>{if(!k.current||!L.current)return;const ee={placement:r,strategy:n,middleware:_};Q.current&&(ee.platform=Q.current),lB(k.current,L.current,ee).then(I=>{const z={...I,isPositioned:H.current!==!1};$.current&&!Qd(D.current,z)&&(D.current=z,vc.flushSync(()=>{p(z)}))})},[_,r,n,Q,H]);Id(()=>{h===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,p(ee=>({...ee,isPositioned:!1})))},[h]);const $=R.useRef(!1);Id(()=>($.current=!0,()=>{$.current=!1}),[]),Id(()=>{if(T&&(k.current=T),M&&(L.current=M),T&&M){if(K.current)return K.current(T,M,U);U()}},[T,M,U,K,j]);const te=R.useMemo(()=>({reference:k,floating:L,setReference:g,setFloating:y}),[g,y]),Y=R.useMemo(()=>({reference:T,floating:M}),[T,M]),ie=R.useMemo(()=>{const ee={position:n,left:0,top:0};if(!Y.floating)return ee;const I=qS(Y.floating,m.x),z=qS(Y.floating,m.y);return l?{...ee,transform:"translate("+I+"px, "+z+"px)",...aw(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:z}},[n,l,Y.floating,m.x,m.y]);return R.useMemo(()=>({...m,update:U,refs:te,elements:Y,floatingStyles:ie}),[m,U,te,Y,ie])}const hB=e=>{function r(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:o}=typeof e=="function"?e(n):e;return s&&r(s)?s.current!=null?VS({element:s.current,padding:o}).fn(n):{}:s?VS({element:s,padding:o}).fn(n):{}}}},fB=(e,r)=>({...rB(e),options:[e,r]}),pB=(e,r)=>({...nB(e),options:[e,r]}),mB=(e,r)=>({...aB(e),options:[e,r]}),gB=(e,r)=>({...iB(e),options:[e,r]}),vB=(e,r)=>({...sB(e),options:[e,r]}),_B=(e,r)=>({...oB(e),options:[e,r]}),yB=(e,r)=>({...hB(e),options:[e,r]});var SB="Arrow",lw=R.forwardRef((e,r)=>{const{children:n,width:s=10,height:o=5,...u}=e;return b.jsx($e.svg,{...u,ref:r,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});lw.displayName=SB;var CB=lw;function cw(e){const[r,n]=R.useState(void 0);return fr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const u=o[0];let f,l;if("borderBoxSize"in u){const c=u.borderBoxSize,h=Array.isArray(c)?c[0]:c;f=h.inlineSize,l=h.blockSize}else f=e.offsetWidth,l=e.offsetHeight;n({width:f,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),r}var uv="Popper",[uw,Ea]=qn(uv),[bB,dw]=uw(uv),hw=e=>{const{__scopePopper:r,children:n}=e,[s,o]=R.useState(null);return b.jsx(bB,{scope:r,anchor:s,onAnchorChange:o,children:n})};hw.displayName=uv;var fw="PopperAnchor",pw=R.forwardRef((e,r)=>{const{__scopePopper:n,virtualRef:s,...o}=e,u=dw(fw,n),f=R.useRef(null),l=st(r,f),c=R.useRef(null);return R.useEffect(()=>{const h=c.current;c.current=(s==null?void 0:s.current)||f.current,h!==c.current&&u.onAnchorChange(c.current)}),s?null:b.jsx($e.div,{...o,ref:l})});pw.displayName=fw;var dv="PopperContent",[wB,EB]=uw(dv),mw=R.forwardRef((e,r)=>{var W,F,ue,oe,de,he;const{__scopePopper:n,side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:f=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:h=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:_=!1,updatePositionStrategy:E="optimized",onPlaced:A,...w}=e,v=dw(dv,n),[S,g]=R.useState(null),y=st(r,De=>g(De)),[T,M]=R.useState(null),k=cw(T),L=(k==null?void 0:k.width)??0,D=(k==null?void 0:k.height)??0,j=s+(u!=="center"?"-"+u:""),K=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},Q=Array.isArray(h)?h:[h],H=Q.length>0,U={padding:K,boundary:Q.filter(AB),altBoundary:H},{refs:$,floatingStyles:te,placement:Y,isPositioned:ie,middlewareData:ee}=dB({strategy:"fixed",placement:j,whileElementsMounted:(...De)=>tB(...De,{animationFrame:E==="always"}),elements:{reference:v.anchor},middleware:[fB({mainAxis:o+D,alignmentAxis:f}),c&&pB({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?mB():void 0,...U}),c&&gB({...U}),vB({...U,apply:({elements:De,rects:Ie,availableWidth:Fe,availableHeight:je})=>{const{width:Oe,height:Mt}=Ie.reference,At=De.floating.style;At.setProperty("--radix-popper-available-width",`${Fe}px`),At.setProperty("--radix-popper-available-height",`${je}px`),At.setProperty("--radix-popper-anchor-width",`${Oe}px`),At.setProperty("--radix-popper-anchor-height",`${Mt}px`)}}),T&&yB({element:T,padding:l}),TB({arrowWidth:L,arrowHeight:D}),_&&_B({strategy:"referenceHidden",...U})]}),[I,z]=_w(Y),P=Fn(A);fr(()=>{ie&&(P==null||P())},[ie,P]);const G=(W=ee.arrow)==null?void 0:W.x,ne=(F=ee.arrow)==null?void 0:F.y,X=((ue=ee.arrow)==null?void 0:ue.centerOffset)!==0,[Ce,fe]=R.useState();return fr(()=>{S&&fe(window.getComputedStyle(S).zIndex)},[S]),b.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:ie?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ce,"--radix-popper-transform-origin":[(oe=ee.transformOrigin)==null?void 0:oe.x,(de=ee.transformOrigin)==null?void 0:de.y].join(" "),...((he=ee.hide)==null?void 0:he.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(wB,{scope:n,placedSide:I,onArrowChange:M,arrowX:G,arrowY:ne,shouldHideArrow:X,children:b.jsx($e.div,{"data-side":I,"data-align":z,...w,ref:y,style:{...w.style,animation:ie?void 0:"none"}})})})});mw.displayName=dv;var gw="PopperArrow",xB={top:"bottom",right:"left",bottom:"top",left:"right"},vw=R.forwardRef(function(r,n){const{__scopePopper:s,...o}=r,u=EB(gw,s),f=xB[u.placedSide];return b.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:b.jsx(CB,{...o,ref:n,style:{...o.style,display:"block"}})})});vw.displayName=gw;function AB(e){return e!==null}var TB=e=>({name:"transformOrigin",options:e,fn(r){var v,S,g;const{placement:n,rects:s,middlewareData:o}=r,f=((v=o.arrow)==null?void 0:v.centerOffset)!==0,l=f?0:e.arrowWidth,c=f?0:e.arrowHeight,[h,m]=_w(n),p={start:"0%",center:"50%",end:"100%"}[m],_=(((S=o.arrow)==null?void 0:S.x)??0)+l/2,E=(((g=o.arrow)==null?void 0:g.y)??0)+c/2;let A="",w="";return h==="bottom"?(A=f?p:`${_}px`,w=`${-c}px`):h==="top"?(A=f?p:`${_}px`,w=`${s.floating.height+c}px`):h==="right"?(A=`${-c}px`,w=f?p:`${E}px`):h==="left"&&(A=`${s.floating.width+c}px`,w=f?p:`${E}px`),{data:{x:A,y:w}}}});function _w(e){const[r,n="center"]=e.split("-");return[r,n]}var hv=hw,xh=pw,fv=mw,pv=vw;function yw(e){const r=R.useRef({value:e,previous:e});return R.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}var Sw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),RB="VisuallyHidden",DB=R.forwardRef((e,r)=>b.jsx($e.span,{...e,ref:r,style:{...Sw,...e.style}}));DB.displayName=RB;var MB=[" ","Enter","ArrowUp","ArrowDown"],kB=[" ","Enter"],oo="Select",[Ah,Th,LB]=rv(oo),[xa]=qn(oo,[LB,Ea]),Rh=Ea(),[OB,ys]=xa(oo),[BB,NB]=xa(oo),Cw=e=>{const{__scopeSelect:r,children:n,open:s,defaultOpen:o,onOpenChange:u,value:f,defaultValue:l,onValueChange:c,dir:h,name:m,autoComplete:p,disabled:_,required:E,form:A}=e,w=Rh(r),[v,S]=R.useState(null),[g,y]=R.useState(null),[T,M]=R.useState(!1),k=nv(h),[L,D]=ro({prop:s,defaultProp:o??!1,onChange:u,caller:oo}),[j,K]=ro({prop:f,defaultProp:l,onChange:c,caller:oo}),Q=R.useRef(null),H=v?A||!!v.closest("form"):!0,[U,$]=R.useState(new Set),te=Array.from(U).map(Y=>Y.props.value).join(";");return b.jsx(hv,{...w,children:b.jsxs(OB,{required:E,scope:r,trigger:v,onTriggerChange:S,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:T,onValueNodeHasChildrenChange:M,contentId:jn(),value:j,onValueChange:K,open:L,onOpenChange:D,dir:k,triggerPointerDownPosRef:Q,disabled:_,children:[b.jsx(Ah.Provider,{scope:r,children:b.jsx(BB,{scope:e.__scopeSelect,onNativeOptionAdd:R.useCallback(Y=>{$(ie=>new Set(ie).add(Y))},[]),onNativeOptionRemove:R.useCallback(Y=>{$(ie=>{const ee=new Set(ie);return ee.delete(Y),ee})},[]),children:n})}),H?b.jsxs(zw,{"aria-hidden":!0,required:E,tabIndex:-1,name:m,autoComplete:p,value:j,onChange:Y=>K(Y.target.value),disabled:_,form:A,children:[j===void 0?b.jsx("option",{value:""}):null,Array.from(U)]},te):null]})})};Cw.displayName=oo;var bw="SelectTrigger",ww=R.forwardRef((e,r)=>{const{__scopeSelect:n,disabled:s=!1,...o}=e,u=Rh(n),f=ys(bw,n),l=f.disabled||s,c=st(r,f.onTriggerChange),h=Th(n),m=R.useRef("touch"),[p,_,E]=Ww(w=>{const v=h().filter(y=>!y.disabled),S=v.find(y=>y.value===f.value),g=Kw(v,w,S);g!==void 0&&f.onValueChange(g.value)}),A=w=>{l||(f.onOpenChange(!0),E()),w&&(f.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return b.jsx(xh,{asChild:!0,...u,children:b.jsx($e.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Yw(f.value)?"":void 0,...o,ref:c,onClick:Le(o.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&A(w)}),onPointerDown:Le(o.onPointerDown,w=>{m.current=w.pointerType;const v=w.target;v.hasPointerCapture(w.pointerId)&&v.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(A(w),w.preventDefault())}),onKeyDown:Le(o.onKeyDown,w=>{const v=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&_(w.key),!(v&&w.key===" ")&&MB.includes(w.key)&&(A(),w.preventDefault())})})})});ww.displayName=bw;var Ew="SelectValue",xw=R.forwardRef((e,r)=>{const{__scopeSelect:n,className:s,style:o,children:u,placeholder:f="",...l}=e,c=ys(Ew,n),{onValueNodeHasChildrenChange:h}=c,m=u!==void 0,p=st(r,c.onValueNodeChange);return fr(()=>{h(m)},[h,m]),b.jsx($e.span,{...l,ref:p,style:{pointerEvents:"none"},children:Yw(c.value)?b.jsx(b.Fragment,{children:f}):u})});xw.displayName=Ew;var IB="SelectIcon",Aw=R.forwardRef((e,r)=>{const{__scopeSelect:n,children:s,...o}=e;return b.jsx($e.span,{"aria-hidden":!0,...o,ref:r,children:s||"▼"})});Aw.displayName=IB;var PB="SelectPortal",Tw=e=>b.jsx(xc,{asChild:!0,...e});Tw.displayName=PB;var ao="SelectContent",Rw=R.forwardRef((e,r)=>{const n=ys(ao,e.__scopeSelect),[s,o]=R.useState();if(fr(()=>{o(new DocumentFragment)},[]),!n.open){const u=s;return u?vc.createPortal(b.jsx(Dw,{scope:e.__scopeSelect,children:b.jsx(Ah.Slot,{scope:e.__scopeSelect,children:b.jsx("div",{children:e.children})})}),u):null}return b.jsx(Mw,{...e,ref:r})});Rw.displayName=ao;var vn=10,[Dw,Ss]=xa(ao),jB="SelectContentImpl",UB=no("SelectContent.RemoveScroll"),Mw=R.forwardRef((e,r)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:u,onPointerDownOutside:f,side:l,sideOffset:c,align:h,alignOffset:m,arrowPadding:p,collisionBoundary:_,collisionPadding:E,sticky:A,hideWhenDetached:w,avoidCollisions:v,...S}=e,g=ys(ao,n),[y,T]=R.useState(null),[M,k]=R.useState(null),L=st(r,W=>T(W)),[D,j]=R.useState(null),[K,Q]=R.useState(null),H=Th(n),[U,$]=R.useState(!1),te=R.useRef(!1);R.useEffect(()=>{if(y)return yh(y)},[y]),vh();const Y=R.useCallback(W=>{const[F,...ue]=H().map(he=>he.ref.current),[oe]=ue.slice(-1),de=document.activeElement;for(const he of W)if(he===de||(he==null||he.scrollIntoView({block:"nearest"}),he===F&&M&&(M.scrollTop=0),he===oe&&M&&(M.scrollTop=M.scrollHeight),he==null||he.focus(),document.activeElement!==de))return},[H,M]),ie=R.useCallback(()=>Y([D,y]),[Y,D,y]);R.useEffect(()=>{U&&ie()},[U,ie]);const{onOpenChange:ee,triggerPointerDownPosRef:I}=g;R.useEffect(()=>{if(y){let W={x:0,y:0};const F=oe=>{var de,he;W={x:Math.abs(Math.round(oe.pageX)-(((de=I.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((he=I.current)==null?void 0:he.y)??0))}},ue=oe=>{W.x<=10&&W.y<=10?oe.preventDefault():y.contains(oe.target)||ee(!1),document.removeEventListener("pointermove",F),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",F),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",F),document.removeEventListener("pointerup",ue,{capture:!0})}}},[y,ee,I]),R.useEffect(()=>{const W=()=>ee(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[ee]);const[z,P]=Ww(W=>{const F=H().filter(de=>!de.disabled),ue=F.find(de=>de.ref.current===document.activeElement),oe=Kw(F,W,ue);oe&&setTimeout(()=>oe.ref.current.focus())}),G=R.useCallback((W,F,ue)=>{const oe=!te.current&&!ue;(g.value!==void 0&&g.value===F||oe)&&(j(W),oe&&(te.current=!0))},[g.value]),ne=R.useCallback(()=>y==null?void 0:y.focus(),[y]),X=R.useCallback((W,F,ue)=>{const oe=!te.current&&!ue;(g.value!==void 0&&g.value===F||oe)&&Q(W)},[g.value]),Ce=s==="popper"?lg:kw,fe=Ce===lg?{side:l,sideOffset:c,align:h,alignOffset:m,arrowPadding:p,collisionBoundary:_,collisionPadding:E,sticky:A,hideWhenDetached:w,avoidCollisions:v}:{};return b.jsx(Dw,{scope:n,content:y,viewport:M,onViewportChange:k,itemRefCallback:G,selectedItem:D,onItemLeave:ne,itemTextRefCallback:X,focusSelectedItem:ie,selectedItemText:K,position:s,isPositioned:U,searchRef:z,children:b.jsx(Ac,{as:UB,allowPinchZoom:!0,children:b.jsx(Ec,{asChild:!0,trapped:g.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:Le(o,W=>{var F;(F=g.trigger)==null||F.focus({preventScroll:!0}),W.preventDefault()}),children:b.jsx(wc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:b.jsx(Ce,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:W=>W.preventDefault(),...S,...fe,onPlaced:()=>$(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Le(S.onKeyDown,W=>{const F=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!F&&W.key.length===1&&P(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let oe=H().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(W.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const de=W.target,he=oe.indexOf(de);oe=oe.slice(he+1)}setTimeout(()=>Y(oe)),W.preventDefault()}})})})})})})});Mw.displayName=jB;var FB="SelectItemAlignedPosition",kw=R.forwardRef((e,r)=>{const{__scopeSelect:n,onPlaced:s,...o}=e,u=ys(ao,n),f=Ss(ao,n),[l,c]=R.useState(null),[h,m]=R.useState(null),p=st(r,L=>m(L)),_=Th(n),E=R.useRef(!1),A=R.useRef(!0),{viewport:w,selectedItem:v,selectedItemText:S,focusSelectedItem:g}=f,y=R.useCallback(()=>{if(u.trigger&&u.valueNode&&l&&h&&w&&v&&S){const L=u.trigger.getBoundingClientRect(),D=h.getBoundingClientRect(),j=u.valueNode.getBoundingClientRect(),K=S.getBoundingClientRect();if(u.dir!=="rtl"){const de=K.left-D.left,he=j.left-de,De=L.left-he,Ie=L.width+De,Fe=Math.max(Ie,D.width),je=window.innerWidth-vn,Oe=LS(he,[vn,Math.max(vn,je-Fe)]);l.style.minWidth=Ie+"px",l.style.left=Oe+"px"}else{const de=D.right-K.right,he=window.innerWidth-j.right-de,De=window.innerWidth-L.right-he,Ie=L.width+De,Fe=Math.max(Ie,D.width),je=window.innerWidth-vn,Oe=LS(he,[vn,Math.max(vn,je-Fe)]);l.style.minWidth=Ie+"px",l.style.right=Oe+"px"}const Q=_(),H=window.innerHeight-vn*2,U=w.scrollHeight,$=window.getComputedStyle(h),te=parseInt($.borderTopWidth,10),Y=parseInt($.paddingTop,10),ie=parseInt($.borderBottomWidth,10),ee=parseInt($.paddingBottom,10),I=te+Y+U+ee+ie,z=Math.min(v.offsetHeight*5,I),P=window.getComputedStyle(w),G=parseInt(P.paddingTop,10),ne=parseInt(P.paddingBottom,10),X=L.top+L.height/2-vn,Ce=H-X,fe=v.offsetHeight/2,W=v.offsetTop+fe,F=te+Y+W,ue=I-F;if(F<=X){const de=Q.length>0&&v===Q[Q.length-1].ref.current;l.style.bottom="0px";const he=h.clientHeight-w.offsetTop-w.offsetHeight,De=Math.max(Ce,fe+(de?ne:0)+he+ie),Ie=F+De;l.style.height=Ie+"px"}else{const de=Q.length>0&&v===Q[0].ref.current;l.style.top="0px";const De=Math.max(X,te+w.offsetTop+(de?G:0)+fe)+ue;l.style.height=De+"px",w.scrollTop=F-X+w.offsetTop}l.style.margin=`${vn}px 0`,l.style.minHeight=z+"px",l.style.maxHeight=H+"px",s==null||s(),requestAnimationFrame(()=>E.current=!0)}},[_,u.trigger,u.valueNode,l,h,w,v,S,u.dir,s]);fr(()=>y(),[y]);const[T,M]=R.useState();fr(()=>{h&&M(window.getComputedStyle(h).zIndex)},[h]);const k=R.useCallback(L=>{L&&A.current===!0&&(y(),g==null||g(),A.current=!1)},[y,g]);return b.jsx(VB,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:E,onScrollButtonChange:k,children:b.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:b.jsx($e.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});kw.displayName=FB;var HB="SelectPopperPosition",lg=R.forwardRef((e,r)=>{const{__scopeSelect:n,align:s="start",collisionPadding:o=vn,...u}=e,f=Rh(n);return b.jsx(fv,{...f,...u,ref:r,align:s,collisionPadding:o,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});lg.displayName=HB;var[VB,mv]=xa(ao,{}),cg="SelectViewport",Lw=R.forwardRef((e,r)=>{const{__scopeSelect:n,nonce:s,...o}=e,u=Ss(cg,n),f=mv(cg,n),l=st(r,u.onViewportChange),c=R.useRef(0);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),b.jsx(Ah.Slot,{scope:n,children:b.jsx($e.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Le(o.onScroll,h=>{const m=h.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:_}=f;if(_!=null&&_.current&&p){const E=Math.abs(c.current-m.scrollTop);if(E>0){const A=window.innerHeight-vn*2,w=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),S=Math.max(w,v);if(S<A){const g=S+E,y=Math.min(A,g),T=g-y;p.style.height=y+"px",p.style.bottom==="0px"&&(m.scrollTop=T>0?T:0,p.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});Lw.displayName=cg;var Ow="SelectGroup",[qB,GB]=xa(Ow),zB=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e,o=jn();return b.jsx(qB,{scope:n,id:o,children:b.jsx($e.div,{role:"group","aria-labelledby":o,...s,ref:r})})});zB.displayName=Ow;var Bw="SelectLabel",Nw=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e,o=GB(Bw,n);return b.jsx($e.div,{id:o.id,...s,ref:r})});Nw.displayName=Bw;var $d="SelectItem",[YB,Iw]=xa($d),Pw=R.forwardRef((e,r)=>{const{__scopeSelect:n,value:s,disabled:o=!1,textValue:u,...f}=e,l=ys($d,n),c=Ss($d,n),h=l.value===s,[m,p]=R.useState(u??""),[_,E]=R.useState(!1),A=st(r,g=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,g,s,o)}),w=jn(),v=R.useRef("touch"),S=()=>{o||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return b.jsx(YB,{scope:n,value:s,disabled:o,textId:w,isSelected:h,onItemTextChange:R.useCallback(g=>{p(y=>y||((g==null?void 0:g.textContent)??"").trim())},[]),children:b.jsx(Ah.ItemSlot,{scope:n,value:s,disabled:o,textValue:m,children:b.jsx($e.div,{role:"option","aria-labelledby":w,"data-highlighted":_?"":void 0,"aria-selected":h&&_,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...f,ref:A,onFocus:Le(f.onFocus,()=>E(!0)),onBlur:Le(f.onBlur,()=>E(!1)),onClick:Le(f.onClick,()=>{v.current!=="mouse"&&S()}),onPointerUp:Le(f.onPointerUp,()=>{v.current==="mouse"&&S()}),onPointerDown:Le(f.onPointerDown,g=>{v.current=g.pointerType}),onPointerMove:Le(f.onPointerMove,g=>{var y;v.current=g.pointerType,o?(y=c.onItemLeave)==null||y.call(c):v.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Le(f.onPointerLeave,g=>{var y;g.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:Le(f.onKeyDown,g=>{var T;((T=c.searchRef)==null?void 0:T.current)!==""&&g.key===" "||(kB.includes(g.key)&&S(),g.key===" "&&g.preventDefault())})})})})});Pw.displayName=$d;var zl="SelectItemText",jw=R.forwardRef((e,r)=>{const{__scopeSelect:n,className:s,style:o,...u}=e,f=ys(zl,n),l=Ss(zl,n),c=Iw(zl,n),h=NB(zl,n),[m,p]=R.useState(null),_=st(r,S=>p(S),c.onItemTextChange,S=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,S,c.value,c.disabled)}),E=m==null?void 0:m.textContent,A=R.useMemo(()=>b.jsx("option",{value:c.value,disabled:c.disabled,children:E},c.value),[c.disabled,c.value,E]),{onNativeOptionAdd:w,onNativeOptionRemove:v}=h;return fr(()=>(w(A),()=>v(A)),[w,v,A]),b.jsxs(b.Fragment,{children:[b.jsx($e.span,{id:c.textId,...u,ref:_}),c.isSelected&&f.valueNode&&!f.valueNodeHasChildren?vc.createPortal(u.children,f.valueNode):null]})});jw.displayName=zl;var Uw="SelectItemIndicator",Fw=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e;return Iw(Uw,n).isSelected?b.jsx($e.span,{"aria-hidden":!0,...s,ref:r}):null});Fw.displayName=Uw;var ug="SelectScrollUpButton",Hw=R.forwardRef((e,r)=>{const n=Ss(ug,e.__scopeSelect),s=mv(ug,e.__scopeSelect),[o,u]=R.useState(!1),f=st(r,s.onScrollButtonChange);return fr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=c.scrollTop>0;u(h)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?b.jsx(qw,{...e,ref:f,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Hw.displayName=ug;var dg="SelectScrollDownButton",Vw=R.forwardRef((e,r)=>{const n=Ss(dg,e.__scopeSelect),s=mv(dg,e.__scopeSelect),[o,u]=R.useState(!1),f=st(r,s.onScrollButtonChange);return fr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<h;u(m)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?b.jsx(qw,{...e,ref:f,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Vw.displayName=dg;var qw=R.forwardRef((e,r)=>{const{__scopeSelect:n,onAutoScroll:s,...o}=e,u=Ss("SelectScrollButton",n),f=R.useRef(null),l=Th(n),c=R.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return R.useEffect(()=>()=>c(),[c]),fr(()=>{var m;const h=l().find(p=>p.ref.current===document.activeElement);(m=h==null?void 0:h.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),b.jsx($e.div,{"aria-hidden":!0,...o,ref:r,style:{flexShrink:0,...o.style},onPointerDown:Le(o.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(s,50))}),onPointerMove:Le(o.onPointerMove,()=>{var h;(h=u.onItemLeave)==null||h.call(u),f.current===null&&(f.current=window.setInterval(s,50))}),onPointerLeave:Le(o.onPointerLeave,()=>{c()})})}),WB="SelectSeparator",Gw=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e;return b.jsx($e.div,{"aria-hidden":!0,...s,ref:r})});Gw.displayName=WB;var hg="SelectArrow",KB=R.forwardRef((e,r)=>{const{__scopeSelect:n,...s}=e,o=Rh(n),u=ys(hg,n),f=Ss(hg,n);return u.open&&f.position==="popper"?b.jsx(pv,{...o,...s,ref:r}):null});KB.displayName=hg;var QB="SelectBubbleInput",zw=R.forwardRef(({__scopeSelect:e,value:r,...n},s)=>{const o=R.useRef(null),u=st(s,o),f=yw(r);return R.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(f!==r&&m){const p=new Event("change",{bubbles:!0});m.call(l,r),l.dispatchEvent(p)}},[f,r]),b.jsx($e.select,{...n,style:{...Sw,...n.style},ref:u,defaultValue:r})});zw.displayName=QB;function Yw(e){return e===""||e===void 0}function Ww(e){const r=Fn(e),n=R.useRef(""),s=R.useRef(0),o=R.useCallback(f=>{const l=n.current+f;r(l),(function c(h){n.current=h,window.clearTimeout(s.current),h!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(l)},[r]),u=R.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,o,u]}function Kw(e,r,n){const o=r.length>1&&Array.from(r).every(h=>h===r[0])?r[0]:r,u=n?e.indexOf(n):-1;let f=$B(e,Math.max(u,0));o.length===1&&(f=f.filter(h=>h!==n));const c=f.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function $B(e,r){return e.map((n,s)=>e[(r+s)%e.length])}var JB=Cw,Qw=ww,ZB=xw,XB=Aw,e4=Tw,$w=Rw,t4=Lw,Jw=Nw,Zw=Pw,r4=jw,n4=Fw,Xw=Hw,eE=Vw,tE=Gw;const xm=JB,Am=ZB,Pd=R.forwardRef(({className:e,children:r,...n},s)=>b.jsxs(Qw,{ref:s,className:Te("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[r,b.jsx(XB,{asChild:!0,children:b.jsx(mh,{className:"h-4 w-4 opacity-50"})})]}));Pd.displayName=Qw.displayName;const rE=R.forwardRef(({className:e,...r},n)=>b.jsx(Xw,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...r,children:b.jsx(qg,{className:"h-4 w-4"})}));rE.displayName=Xw.displayName;const nE=R.forwardRef(({className:e,...r},n)=>b.jsx(eE,{ref:n,className:Te("flex cursor-default items-center justify-center py-1",e),...r,children:b.jsx(mh,{className:"h-4 w-4"})}));nE.displayName=eE.displayName;const jd=R.forwardRef(({className:e,children:r,position:n="popper",...s},o)=>b.jsx(e4,{children:b.jsxs($w,{ref:o,className:Te("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[b.jsx(rE,{}),b.jsx(t4,{className:Te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),b.jsx(nE,{})]})}));jd.displayName=$w.displayName;const i4=R.forwardRef(({className:e,...r},n)=>b.jsx(Jw,{ref:n,className:Te("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));i4.displayName=Jw.displayName;const oa=R.forwardRef(({className:e,children:r,...n},s)=>b.jsxs(Zw,{ref:s,className:Te("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(n4,{children:b.jsx(Xb,{className:"h-4 w-4"})})}),b.jsx(r4,{children:r})]}));oa.displayName=Zw.displayName;const s4=R.forwardRef(({className:e,...r},n)=>b.jsx(tE,{ref:n,className:Te("-mx-1 my-1 h-px bg-muted",e),...r}));s4.displayName=tE.displayName;var o4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],a4=o4.reduce((e,r)=>{const n=QC(`Primitive.${r}`),s=R.forwardRef((o,u)=>{const{asChild:f,...l}=o,c=f?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${r}`,{...e,[r]:s}},{}),l4="Label",iE=R.forwardRef((e,r)=>b.jsx(a4.label,{...e,ref:r,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));iE.displayName=l4;var sE=iE;const c4=Ug("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),aa=R.forwardRef(({className:e,...r},n)=>b.jsx(sE,{ref:n,className:Te(c4(),e),...r}));aa.displayName=sE.displayName;const u4=[{name:"claude",baseType:"claude",displayName:"Claude",isAlias:!1},{name:"cursor",baseType:"cursor",displayName:"Cursor",isAlias:!1},{name:"opencode",baseType:"opencode",displayName:"OpenCode",isAlias:!1}];function oE({children:e}){var K,Q;const[r,n]=R.useState(!1),[s,o]=R.useState(!1),[u,f]=R.useState(null),[l,c]=R.useState("claude"),[h,m]=R.useState(""),[p,_]=R.useState(""),[E,A]=R.useState(!1),{createSession:w,subscribeToSession:v,requestSync:S}=co(),g=Ge(H=>H.selectSession),y=Ge(H=>H.availableAgents),T=Ge(H=>H.workspaces),M=mc(),k=R.useMemo(()=>y.length>0?y:u4,[y]),L=R.useMemo(()=>{const H=T.find(U=>U.name===h);return(H==null?void 0:H.projects)??[]},[T,h]);R.useEffect(()=>{r&&S()},[r,S]),R.useEffect(()=>{_("")},[h]),R.useEffect(()=>{var H;k.length>0&&!k.find(U=>U.name===l)&&c(((H=k[0])==null?void 0:H.name)??"claude")},[k,l]);const D=R.useCallback(async()=>{var H;if(!E&&(!h||!p)){f("Workspace and project are required for agent sessions");return}f(null),o(!0);try{const U=k.find(I=>I.name===l),$=E?"terminal":(U==null?void 0:U.baseType)??"claude",ee=(await w($,E?h||"home":h,E?p||"default":p,void 0,E?void 0:l)).payload.session_id;v(ee),g(ee),M(E?`/terminal/${ee}`:`/chat/${ee}`),n(!1),m(""),_(""),c(((H=k[0])==null?void 0:H.name)??"claude"),A(!1)}catch(U){f(U instanceof Error?U.message:"Failed to create session")}finally{o(!1)}},[w,v,g,M,l,h,p,E,k]),j=H=>{switch(H){case"claude":return b.jsx(Sc,{className:"w-4 h-4"});case"cursor":return b.jsx(bc,{className:"w-4 h-4"});case"opencode":return b.jsx(Cc,{className:"w-4 h-4"});case"terminal":return b.jsx(Zl,{className:"w-4 h-4"});default:return b.jsx(gs,{className:"w-4 h-4"})}};return b.jsxs(oO,{open:r,onOpenChange:n,children:[b.jsx(aO,{asChild:!0,children:e}),b.jsxs(Y1,{className:"sm:max-w-[425px]",children:[b.jsxs(W1,{children:[b.jsx(Q1,{children:"Create New Session"}),b.jsx($1,{children:"Start a new agent or terminal session"})]}),b.jsxs("div",{className:"grid gap-4 py-4",children:[b.jsxs("div",{className:"grid gap-2",children:[b.jsx(aa,{children:"Session Type"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsxs(ct,{type:"button",variant:E?"outline":"default",className:"flex-1",onClick:()=>A(!1),children:[b.jsx(gs,{className:"w-4 h-4 mr-2"}),"Agent"]}),b.jsxs(ct,{type:"button",variant:E?"default":"outline",className:"flex-1",onClick:()=>A(!0),children:[b.jsx(Zl,{className:"w-4 h-4 mr-2"}),"Terminal"]})]})]}),!E&&b.jsxs("div",{className:"grid gap-2",children:[b.jsx(aa,{htmlFor:"agent",children:"Agent"}),b.jsxs(xm,{value:l,onValueChange:c,children:[b.jsx(Pd,{id:"agent",children:b.jsx(Am,{placeholder:"Select agent"})}),b.jsx(jd,{children:k.map(H=>b.jsx(oa,{value:H.name,children:b.jsxs("div",{className:"flex items-center gap-2",children:[j(H.baseType),b.jsx("span",{children:H.displayName}),H.isAlias&&b.jsx("span",{className:"text-xs text-muted-foreground",children:"(alias)"})]})},H.name))})]}),((K=y.find(H=>H.name===l))==null?void 0:K.description)&&b.jsx("p",{className:"text-xs text-muted-foreground",children:(Q=y.find(H=>H.name===l))==null?void 0:Q.description})]}),!E&&b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"grid gap-2",children:[b.jsx(aa,{htmlFor:"workspace",children:"Workspace"}),b.jsxs(xm,{value:h,onValueChange:m,children:[b.jsx(Pd,{id:"workspace",children:b.jsx(Am,{placeholder:"Select workspace"})}),b.jsx(jd,{children:T.length>0?T.map(H=>b.jsx(oa,{value:H.name,children:H.name},H.name)):b.jsx(oa,{value:"_empty",disabled:!0,children:"No workspaces available"})})]})]}),b.jsxs("div",{className:"grid gap-2",children:[b.jsx(aa,{htmlFor:"project",children:"Project"}),b.jsxs(xm,{value:p,onValueChange:_,disabled:!h,children:[b.jsx(Pd,{id:"project",children:b.jsx(Am,{placeholder:h?"Select project":"Select workspace first"})}),b.jsx(jd,{children:L.length>0?L.map(H=>b.jsx(oa,{value:H.name,children:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{children:H.name}),H.isGitRepo&&b.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",H.defaultBranch??"git",")"]})]})},H.name)):b.jsx(oa,{value:"_empty",disabled:!0,children:h?"No projects in workspace":"Select workspace first"})})]})]})]}),u&&b.jsx("p",{className:"text-sm text-destructive",children:u})]}),b.jsxs(K1,{children:[b.jsx(ct,{variant:"outline",onClick:()=>n(!1),disabled:s,children:"Cancel"}),b.jsx(ct,{onClick:D,disabled:s||!E&&(!h||!p),children:s?b.jsxs(b.Fragment,{children:[b.jsx(yc,{className:"w-4 h-4 animate-spin"}),"Creating..."]}):"Create Session"})]})]})]})}var aE="AlertDialog",[d4]=qn(aE,[A1]),Ai=A1(),lE=e=>{const{__scopeAlertDialog:r,...n}=e,s=Ai(r);return b.jsx(V1,{...s,...n,modal:!0})};lE.displayName=aE;var h4="AlertDialogTrigger",cE=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ai(n);return b.jsx(q1,{...o,...s,ref:r})});cE.displayName=h4;var f4="AlertDialogPortal",uE=e=>{const{__scopeAlertDialog:r,...n}=e,s=Ai(r);return b.jsx(G1,{...s,...n})};uE.displayName=f4;var p4="AlertDialogOverlay",dE=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ai(n);return b.jsx(Jg,{...o,...s,ref:r})});dE.displayName=p4;var ha="AlertDialogContent",[m4,g4]=d4(ha),v4=Hk("AlertDialogContent"),hE=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:s,...o}=e,u=Ai(n),f=R.useRef(null),l=st(r,f),c=R.useRef(null);return b.jsx(rO,{contentName:ha,titleName:fE,docsSlug:"alert-dialog",children:b.jsx(m4,{scope:n,cancelRef:c,children:b.jsxs(Zg,{role:"alertdialog",...u,...o,ref:l,onOpenAutoFocus:Le(o.onOpenAutoFocus,h=>{var m;h.preventDefault(),(m=c.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[b.jsx(v4,{children:s}),b.jsx(y4,{contentRef:f})]})})})});hE.displayName=ha;var fE="AlertDialogTitle",pE=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ai(n);return b.jsx(Xg,{...o,...s,ref:r})});pE.displayName=fE;var mE="AlertDialogDescription",gE=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ai(n);return b.jsx(ev,{...o,...s,ref:r})});gE.displayName=mE;var _4="AlertDialogAction",vE=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,o=Ai(n);return b.jsx(tv,{...o,...s,ref:r})});vE.displayName=_4;var _E="AlertDialogCancel",yE=R.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:o}=g4(_E,n),u=Ai(n),f=st(r,o);return b.jsx(tv,{...u,...s,ref:f})});yE.displayName=_E;var y4=({contentRef:e})=>{const r=`\`${ha}\` requires a description for the component to be accessible for screen reader users.
375
+
376
+ You can add a description to the \`${ha}\` by passing a \`${mE}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
377
+
378
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ha}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
379
+
380
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return R.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(r)},[r,e]),null},S4=lE,C4=cE,b4=uE,SE=dE,CE=hE,bE=vE,wE=yE,EE=pE,xE=gE;const Jd=S4,w4=C4,E4=b4,AE=R.forwardRef(({className:e,...r},n)=>b.jsx(SE,{className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));AE.displayName=SE.displayName;const tc=R.forwardRef(({className:e,...r},n)=>b.jsxs(E4,{children:[b.jsx(AE,{}),b.jsx(CE,{ref:n,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r})]}));tc.displayName=CE.displayName;const rc=({className:e,...r})=>b.jsx("div",{className:Te("flex flex-col space-y-2 text-center sm:text-left",e),...r});rc.displayName="AlertDialogHeader";const nc=({className:e,...r})=>b.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});nc.displayName="AlertDialogFooter";const ic=R.forwardRef(({className:e,...r},n)=>b.jsx(EE,{ref:n,className:Te("text-lg font-semibold",e),...r}));ic.displayName=EE.displayName;const sc=R.forwardRef(({className:e,...r},n)=>b.jsx(xE,{ref:n,className:Te("text-sm text-muted-foreground",e),...r}));sc.displayName=xE.displayName;const oc=R.forwardRef(({className:e,...r},n)=>b.jsx(bE,{ref:n,className:Te(Hg(),e),...r}));oc.displayName=bE.displayName;const ac=R.forwardRef(({className:e,...r},n)=>b.jsx(wE,{ref:n,className:Te(Hg({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));ac.displayName=wE.displayName;const x4=Ug("pointer-events-auto relative flex w-full items-center justify-between gap-4 overflow-hidden rounded-lg border p-4 shadow-lg transition-all data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full",{variants:{variant:{default:"border bg-background text-foreground",success:"border-green-500/50 bg-green-50 text-green-900 dark:bg-green-950 dark:text-green-100",error:"border-destructive/50 bg-destructive/10 text-destructive dark:bg-destructive/20",warning:"border-yellow-500/50 bg-yellow-50 text-yellow-900 dark:bg-yellow-950 dark:text-yellow-100",info:"border-blue-500/50 bg-blue-50 text-blue-900 dark:bg-blue-950 dark:text-blue-100"}},defaultVariants:{variant:"default"}}),A4={default:null,success:e1,error:gh,warning:zg,info:t1};function T4({id:e,title:r,description:n,variant:s="default",action:o,onDismiss:u}){const f=A4[s];return b.jsxs("div",{className:Te(x4({variant:s})),role:"alert","aria-live":"polite","data-state":"open",children:[b.jsxs("div",{className:"flex items-start gap-3",children:[f&&b.jsx(f,{className:"mt-0.5 h-5 w-5 flex-shrink-0","aria-hidden":"true"}),b.jsxs("div",{className:"flex-1 space-y-1",children:[r&&b.jsx("p",{className:"text-sm font-semibold",children:r}),n&&b.jsx("p",{className:"text-sm opacity-90",children:n})]})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[o&&b.jsx("button",{onClick:o.onClick,className:"text-sm font-medium underline-offset-4 hover:underline",children:o.label}),b.jsx("button",{onClick:()=>u(e),className:"rounded-md p-1 opacity-70 hover:opacity-100","aria-label":"Dismiss notification",children:b.jsx(Yg,{className:"h-4 w-4"})})]})]})}function R4({toasts:e,onDismiss:r}){return e.length===0?null:b.jsx("div",{className:"fixed bottom-0 right-0 z-50 flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-auto sm:right-4 sm:top-4 sm:max-w-[420px] sm:flex-col",role:"region","aria-label":"Notifications",children:e.map(n=>b.jsx(T4,{...n,onDismiss:r},n.id))})}class D4{constructor(){_e(this,"toasts",[]);_e(this,"listeners",new Set)}subscribe(r){return this.listeners.add(r),r(this.toasts),()=>this.listeners.delete(r)}notify(){this.listeners.forEach(r=>r([...this.toasts]))}show(r){const n=crypto.randomUUID(),s={...r,id:n};this.toasts=[...this.toasts,s],this.notify();const o=r.duration??5e3;return o>0&&setTimeout(()=>this.dismiss(n),o),n}dismiss(r){this.toasts=this.toasts.filter(n=>n.id!==r),this.notify()}dismissAll(){this.toasts=[],this.notify()}success(r,n){return this.show({title:r,description:n,variant:"success"})}error(r,n){return this.show({title:r,description:n,variant:"error",duration:8e3})}warning(r,n){return this.show({title:r,description:n,variant:"warning"})}info(r,n){return this.show({title:r,description:n,variant:"info"})}}const vi=new D4;function M4(){const[e,r]=R.useState([]);return R.useEffect(()=>vi.subscribe(r),[]),e}const kr={show:e=>vi.show(e),success:(e,r)=>vi.success(e,r),error:(e,r)=>vi.error(e,r),warning:(e,r)=>vi.warning(e,r),info:(e,r)=>vi.info(e,r),dismiss:e=>vi.dismiss(e),dismissAll:()=>vi.dismissAll()};function GS({status:e}){const r={active:{className:"bg-green-500",label:"Active"},busy:{className:"bg-blue-500 animate-pulse",label:"Processing"},idle:{className:"bg-yellow-500",label:"Idle"}},n=r[e]||r.idle;return b.jsx("span",{className:Te("w-2 h-2 rounded-full shrink-0",n.className),title:n.label,"aria-label":`Status: ${n.label}`})}function k4(){const e=mc(),r=Vn(),n=Ge(U=>U.sessions),s=Ge(U=>U.selectedSessionId),o=Ge(U=>U.selectSession),u=Ge(U=>U.removeSession),f=Ge(U=>U.workstationInfo),l=Pn(U=>U.sidebarCollapsed),c=Pn(U=>U.toggleSidebar),{terminateSession:h}=co(),[m,p]=R.useState(null),_=(f==null?void 0:f.workspacesRoot)??"",E=R.useCallback((U,$)=>{$.stopPropagation(),p(U)},[]),A=R.useCallback(()=>{m&&(h(m.id),u(m.id),s===m.id&&e("/chat"),kr.success("Session Terminated",`${K(m.type)} session has been closed.`),p(null))},[m,h,u,s,e]),w=!s&&r.pathname==="/chat",v=r.pathname==="/settings",S=U=>s===U&&r.pathname===`/chat/${U}`,g=()=>"/chat",y=U=>`/chat/${U}`,T=n.filter(U=>U.type!=="terminal"),M=n.filter(U=>U.type==="terminal"),k=()=>{o(null),e(g())},L=U=>{o(U.id),U.type==="terminal"?e(`/terminal/${U.id}`):e(y(U.id))},D=()=>{e("/settings")},j=U=>{switch(U.type){case"terminal":return b.jsx(Zl,{className:"w-4 h-4"});case"claude":return b.jsx(Sc,{className:"w-4 h-4"});case"cursor":return b.jsx(bc,{className:"w-4 h-4"});case"opencode":return b.jsx(Cc,{className:"w-4 h-4"});default:return b.jsx(gs,{className:"w-4 h-4"})}},K=U=>{switch(U){case"claude":return"Claude Code";case"cursor":return"Cursor";case"opencode":return"OpenCode";case"terminal":return"Terminal";case"supervisor":return"Supervisor";default:return U.charAt(0).toUpperCase()+U.slice(1)}},Q=U=>{const $=K(U.type);return U.agentName&&U.agentName!==U.type?`${$} (${U.agentName})`:$},H=U=>{const $=U.workspace&&U.workspace!=="home",te=U.project&&U.project!=="default";if($&&te)return U.worktree?`${U.workspace}/${U.project}--${U.worktree}`:`${U.workspace}/${U.project}`;if(!U.workingDir)return!$&&!te?"~":null;if(!_)return U.workingDir;if(U.workingDir.startsWith(_)){let Y=U.workingDir.slice(_.length);return Y.startsWith("/")&&(Y=Y.slice(1)),Y||"~"}return U.workingDir};return b.jsxs("aside",{className:"flex flex-col h-full","aria-label":"Session navigation",children:[b.jsx("div",{className:"p-4 border-b space-y-2",children:b.jsxs("div",{className:"flex items-center justify-between",children:[!l&&b.jsx("h1",{className:"font-semibold text-lg",children:"Tiflis Code"}),b.jsx(ct,{variant:"ghost",size:"icon",onClick:c,className:Te(l&&"mx-auto"),"aria-label":l?"Expand sidebar":"Collapse sidebar","aria-expanded":!l,children:l?b.jsx(IM,{className:"w-4 h-4","aria-hidden":"true"}):b.jsx(NM,{className:"w-4 h-4","aria-hidden":"true"})})]})}),b.jsxs("nav",{className:"flex-1 overflow-auto p-2 space-y-1","aria-label":"Sessions",children:[b.jsxs(ct,{variant:w?"secondary":"ghost",className:Te("w-full justify-start",l&&"justify-center px-2"),onClick:k,"aria-current":w?"page":void 0,"aria-label":l?"Supervisor":void 0,children:[b.jsx(Jl,{className:"w-4 h-4","aria-hidden":"true"}),!l&&b.jsx("span",{className:"ml-2",children:"Supervisor"})]}),T.length>0&&b.jsxs("section",{className:"pt-4","aria-label":"Agent sessions",children:[!l&&b.jsx("h2",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase",children:"Agent Sessions"}),b.jsx("ul",{role:"list",className:"space-y-1",children:T.map(U=>{const $=H(U),te=Q(U);return b.jsxs("li",{className:"group relative",children:[b.jsxs(ct,{variant:S(U.id)?"secondary":"ghost",className:Te("w-full justify-start h-auto py-2 pr-8",l&&"justify-center px-2 pr-2"),onClick:()=>L(U),"aria-current":S(U.id)?"page":void 0,"aria-label":l?`${te}${$?` - ${$}`:""}`:void 0,children:[b.jsxs("div",{className:"relative shrink-0",children:[b.jsx("span",{"aria-hidden":"true",children:j(U)}),b.jsx("span",{className:"absolute -bottom-0.5 -right-0.5",children:b.jsx(GS,{status:U.status})})]}),!l&&b.jsxs("div",{className:"ml-2 flex flex-col items-start min-w-0 flex-1",children:[b.jsx("span",{className:"truncate text-sm font-medium",children:te}),$&&b.jsx("span",{className:"truncate text-xs text-muted-foreground",children:$})]})]}),!l&&b.jsx("button",{type:"button",onClick:Y=>E(U,Y),className:Te("absolute right-1 top-1/2 -translate-y-1/2","p-1.5 rounded-md","opacity-0 group-hover:opacity-100 focus:opacity-100","text-muted-foreground hover:text-destructive hover:bg-destructive/10","transition-opacity"),"aria-label":`Delete ${te} session`,children:b.jsx($l,{className:"w-3.5 h-3.5"})})]},U.id)})})]}),M.length>0&&b.jsxs("section",{className:"pt-4","aria-label":"Terminal sessions",children:[!l&&b.jsx("h2",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase",children:"Terminals"}),b.jsx("ul",{role:"list",className:"space-y-1",children:M.map(U=>{const $=H(U);return b.jsxs("li",{className:"group relative",children:[b.jsxs(ct,{variant:S(U.id)?"secondary":"ghost",className:Te("w-full justify-start h-auto py-2 pr-8",l&&"justify-center px-2 pr-2"),onClick:()=>L(U),"aria-current":S(U.id)?"page":void 0,"aria-label":l?`Terminal${$?` - ${$}`:""}`:void 0,children:[b.jsxs("div",{className:"relative shrink-0",children:[b.jsx("span",{"aria-hidden":"true",children:j(U)}),b.jsx("span",{className:"absolute -bottom-0.5 -right-0.5",children:b.jsx(GS,{status:U.status})})]}),!l&&b.jsxs("div",{className:"ml-2 flex flex-col items-start min-w-0 flex-1",children:[b.jsx("span",{className:"truncate text-sm font-medium",children:"Terminal"}),$&&b.jsx("span",{className:"truncate text-xs text-muted-foreground",children:$})]})]}),!l&&b.jsx("button",{type:"button",onClick:te=>E(U,te),className:Te("absolute right-1 top-1/2 -translate-y-1/2","p-1.5 rounded-md","opacity-0 group-hover:opacity-100 focus:opacity-100","text-muted-foreground hover:text-destructive hover:bg-destructive/10","transition-opacity"),"aria-label":"Delete terminal session",children:b.jsx($l,{className:"w-3.5 h-3.5"})})]},U.id)})})]}),b.jsx("div",{className:"pt-4",children:b.jsx(oE,{children:b.jsxs(ct,{variant:"outline",className:Te("w-full justify-start",l&&"justify-center px-2"),"aria-label":l?"Create new session":void 0,children:[b.jsx(n1,{className:"w-4 h-4","aria-hidden":"true"}),!l&&b.jsx("span",{className:"ml-2",children:"New Session"})]})})})]}),b.jsx("div",{className:"p-2 border-t",children:b.jsxs(ct,{variant:v?"secondary":"ghost",className:Te("w-full justify-start",l&&"justify-center px-2"),onClick:D,"aria-current":v?"page":void 0,"aria-label":l?"Settings":void 0,children:[b.jsx(eg,{className:"w-4 h-4","aria-hidden":"true"}),!l&&b.jsx("span",{className:"ml-2",children:"Settings"})]})}),b.jsx(Jd,{open:!!m,onOpenChange:U=>!U&&p(null),children:b.jsxs(tc,{children:[b.jsxs(rc,{children:[b.jsx(ic,{children:"Terminate Session?"}),b.jsxs(sc,{children:["This will end the ",m?K(m.type):""," session",(m==null?void 0:m.project)&&` for ${m.project}`,". You will need to create a new session to continue."]})]}),b.jsxs(nc,{children:[b.jsx(ac,{children:"Cancel"}),b.jsx(oc,{onClick:A,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Terminate"})]})]})})]})}var Dh="Popover",[TE]=qn(Dh,[Ea]),Rc=Ea(),[L4,Cs]=TE(Dh),RE=e=>{const{__scopePopover:r,children:n,open:s,defaultOpen:o,onOpenChange:u,modal:f=!1}=e,l=Rc(r),c=R.useRef(null),[h,m]=R.useState(!1),[p,_]=ro({prop:s,defaultProp:o??!1,onChange:u,caller:Dh});return b.jsx(hv,{...l,children:b.jsx(L4,{scope:r,contentId:jn(),triggerRef:c,open:p,onOpenChange:_,onOpenToggle:R.useCallback(()=>_(E=>!E),[_]),hasCustomAnchor:h,onCustomAnchorAdd:R.useCallback(()=>m(!0),[]),onCustomAnchorRemove:R.useCallback(()=>m(!1),[]),modal:f,children:n})})};RE.displayName=Dh;var DE="PopoverAnchor",O4=R.forwardRef((e,r)=>{const{__scopePopover:n,...s}=e,o=Cs(DE,n),u=Rc(n),{onCustomAnchorAdd:f,onCustomAnchorRemove:l}=o;return R.useEffect(()=>(f(),()=>l()),[f,l]),b.jsx(xh,{...u,...s,ref:r})});O4.displayName=DE;var ME="PopoverTrigger",kE=R.forwardRef((e,r)=>{const{__scopePopover:n,...s}=e,o=Cs(ME,n),u=Rc(n),f=st(r,o.triggerRef),l=b.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":IE(o.open),...s,ref:f,onClick:Le(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:b.jsx(xh,{asChild:!0,...u,children:l})});kE.displayName=ME;var gv="PopoverPortal",[B4,N4]=TE(gv,{forceMount:void 0}),LE=e=>{const{__scopePopover:r,forceMount:n,children:s,container:o}=e,u=Cs(gv,r);return b.jsx(B4,{scope:r,forceMount:n,children:b.jsx(Gn,{present:n||u.open,children:b.jsx(xc,{asChild:!0,container:o,children:s})})})};LE.displayName=gv;var ga="PopoverContent",OE=R.forwardRef((e,r)=>{const n=N4(ga,e.__scopePopover),{forceMount:s=n.forceMount,...o}=e,u=Cs(ga,e.__scopePopover);return b.jsx(Gn,{present:s||u.open,children:u.modal?b.jsx(P4,{...o,ref:r}):b.jsx(j4,{...o,ref:r})})});OE.displayName=ga;var I4=no("PopoverContent.RemoveScroll"),P4=R.forwardRef((e,r)=>{const n=Cs(ga,e.__scopePopover),s=R.useRef(null),o=st(r,s),u=R.useRef(!1);return R.useEffect(()=>{const f=s.current;if(f)return yh(f)},[]),b.jsx(Ac,{as:I4,allowPinchZoom:!0,children:b.jsx(BE,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Le(e.onCloseAutoFocus,f=>{var l;f.preventDefault(),u.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Le(e.onPointerDownOutside,f=>{const l=f.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,h=l.button===2||c;u.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Le(e.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1})})})}),j4=R.forwardRef((e,r)=>{const n=Cs(ga,e.__scopePopover),s=R.useRef(!1),o=R.useRef(!1);return b.jsx(BE,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,l;(f=e.onCloseAutoFocus)==null||f.call(e,u),u.defaultPrevented||(s.current||(l=n.triggerRef.current)==null||l.focus(),u.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:u=>{var c,h;(c=e.onInteractOutside)==null||c.call(e,u),u.defaultPrevented||(s.current=!0,u.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const f=u.target;((h=n.triggerRef.current)==null?void 0:h.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.current&&u.preventDefault()}})}),BE=R.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:h,onInteractOutside:m,...p}=e,_=Cs(ga,n),E=Rc(n);return vh(),b.jsx(Ec,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:u,children:b.jsx(wc,{asChild:!0,disableOutsidePointerEvents:f,onInteractOutside:m,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:h,onDismiss:()=>_.onOpenChange(!1),children:b.jsx(fv,{"data-state":IE(_.open),role:"dialog",id:_.contentId,...E,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),NE="PopoverClose",U4=R.forwardRef((e,r)=>{const{__scopePopover:n,...s}=e,o=Cs(NE,n);return b.jsx($e.button,{type:"button",...s,ref:r,onClick:Le(e.onClick,()=>o.onOpenChange(!1))})});U4.displayName=NE;var F4="PopoverArrow",H4=R.forwardRef((e,r)=>{const{__scopePopover:n,...s}=e,o=Rc(n);return b.jsx(pv,{...o,...s,ref:r})});H4.displayName=F4;function IE(e){return e?"open":"closed"}var V4=RE,q4=kE,G4=LE,PE=OE;const zS=V4,YS=q4,fg=R.forwardRef(({className:e,align:r="center",sideOffset:n=4,...s},o)=>b.jsx(G4,{children:b.jsx(PE,{ref:o,align:r,sideOffset:n,className:Te("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=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",e),...s})}));fg.displayName=PE.displayName;var Tm="rovingFocusGroup.onEntryFocus",z4={bubbles:!1,cancelable:!0},Dc="RovingFocusGroup",[pg,jE,Y4]=rv(Dc),[W4,UE]=qn(Dc,[Y4]),[K4,Q4]=W4(Dc),FE=R.forwardRef((e,r)=>b.jsx(pg.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(pg.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx($4,{...e,ref:r})})}));FE.displayName=Dc;var $4=R.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:o=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...p}=e,_=R.useRef(null),E=st(r,_),A=nv(u),[w,v]=ro({prop:f,defaultProp:l??null,onChange:c,caller:Dc}),[S,g]=R.useState(!1),y=Fn(h),T=jE(n),M=R.useRef(!1),[k,L]=R.useState(0);return R.useEffect(()=>{const D=_.current;if(D)return D.addEventListener(Tm,y),()=>D.removeEventListener(Tm,y)},[y]),b.jsx(K4,{scope:n,orientation:s,dir:A,loop:o,currentTabStopId:w,onItemFocus:R.useCallback(D=>v(D),[v]),onItemShiftTab:R.useCallback(()=>g(!0),[]),onFocusableItemAdd:R.useCallback(()=>L(D=>D+1),[]),onFocusableItemRemove:R.useCallback(()=>L(D=>D-1),[]),children:b.jsx($e.div,{tabIndex:S||k===0?-1:0,"data-orientation":s,...p,ref:E,style:{outline:"none",...e.style},onMouseDown:Le(e.onMouseDown,()=>{M.current=!0}),onFocus:Le(e.onFocus,D=>{const j=!M.current;if(D.target===D.currentTarget&&j&&!S){const K=new CustomEvent(Tm,z4);if(D.currentTarget.dispatchEvent(K),!K.defaultPrevented){const Q=T().filter(Y=>Y.focusable),H=Q.find(Y=>Y.active),U=Q.find(Y=>Y.id===w),te=[H,U,...Q].filter(Boolean).map(Y=>Y.ref.current);qE(te,m)}}M.current=!1}),onBlur:Le(e.onBlur,()=>g(!1))})})}),HE="RovingFocusGroupItem",VE=R.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:o=!1,tabStopId:u,children:f,...l}=e,c=jn(),h=u||c,m=Q4(HE,n),p=m.currentTabStopId===h,_=jE(n),{onFocusableItemAdd:E,onFocusableItemRemove:A,currentTabStopId:w}=m;return R.useEffect(()=>{if(s)return E(),()=>A()},[s,E,A]),b.jsx(pg.ItemSlot,{scope:n,id:h,focusable:s,active:o,children:b.jsx($e.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...l,ref:r,onMouseDown:Le(e.onMouseDown,v=>{s?m.onItemFocus(h):v.preventDefault()}),onFocus:Le(e.onFocus,()=>m.onItemFocus(h)),onKeyDown:Le(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){m.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const S=X4(v,m.orientation,m.dir);if(S!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=_().filter(T=>T.focusable).map(T=>T.ref.current);if(S==="last")y.reverse();else if(S==="prev"||S==="next"){S==="prev"&&y.reverse();const T=y.indexOf(v.currentTarget);y=m.loop?eN(y,T+1):y.slice(T+1)}setTimeout(()=>qE(y))}}),children:typeof f=="function"?f({isCurrentTabStop:p,hasTabStop:w!=null}):f})})});VE.displayName=HE;var J4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Z4(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function X4(e,r,n){const s=Z4(e.key,n);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return J4[s]}function qE(e,r=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:r}),document.activeElement!==n))return}function eN(e,r){return e.map((n,s)=>e[(r+s)%e.length])}var tN=FE,rN=VE,mg=["Enter"," "],nN=["ArrowDown","PageUp","Home"],GE=["ArrowUp","PageDown","End"],iN=[...nN,...GE],sN={ltr:[...mg,"ArrowRight"],rtl:[...mg,"ArrowLeft"]},oN={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Mc="Menu",[lc,aN,lN]=rv(Mc),[uo,zE]=qn(Mc,[lN,Ea,UE]),Mh=Ea(),YE=UE(),[cN,ho]=uo(Mc),[uN,kc]=uo(Mc),WE=e=>{const{__scopeMenu:r,open:n=!1,children:s,dir:o,onOpenChange:u,modal:f=!0}=e,l=Mh(r),[c,h]=R.useState(null),m=R.useRef(!1),p=Fn(u),_=nv(o);return R.useEffect(()=>{const E=()=>{m.current=!0,document.addEventListener("pointerdown",A,{capture:!0,once:!0}),document.addEventListener("pointermove",A,{capture:!0,once:!0})},A=()=>m.current=!1;return document.addEventListener("keydown",E,{capture:!0}),()=>{document.removeEventListener("keydown",E,{capture:!0}),document.removeEventListener("pointerdown",A,{capture:!0}),document.removeEventListener("pointermove",A,{capture:!0})}},[]),b.jsx(hv,{...l,children:b.jsx(cN,{scope:r,open:n,onOpenChange:p,content:c,onContentChange:h,children:b.jsx(uN,{scope:r,onClose:R.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:_,modal:f,children:s})})})};WE.displayName=Mc;var dN="MenuAnchor",vv=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e,o=Mh(n);return b.jsx(xh,{...o,...s,ref:r})});vv.displayName=dN;var _v="MenuPortal",[hN,KE]=uo(_v,{forceMount:void 0}),QE=e=>{const{__scopeMenu:r,forceMount:n,children:s,container:o}=e,u=ho(_v,r);return b.jsx(hN,{scope:r,forceMount:n,children:b.jsx(Gn,{present:n||u.open,children:b.jsx(xc,{asChild:!0,container:o,children:s})})})};QE.displayName=_v;var an="MenuContent",[fN,yv]=uo(an),$E=R.forwardRef((e,r)=>{const n=KE(an,e.__scopeMenu),{forceMount:s=n.forceMount,...o}=e,u=ho(an,e.__scopeMenu),f=kc(an,e.__scopeMenu);return b.jsx(lc.Provider,{scope:e.__scopeMenu,children:b.jsx(Gn,{present:s||u.open,children:b.jsx(lc.Slot,{scope:e.__scopeMenu,children:f.modal?b.jsx(pN,{...o,ref:r}):b.jsx(mN,{...o,ref:r})})})})}),pN=R.forwardRef((e,r)=>{const n=ho(an,e.__scopeMenu),s=R.useRef(null),o=st(r,s);return R.useEffect(()=>{const u=s.current;if(u)return yh(u)},[]),b.jsx(Sv,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Le(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mN=R.forwardRef((e,r)=>{const n=ho(an,e.__scopeMenu);return b.jsx(Sv,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),gN=no("MenuContent.ScrollLock"),Sv=R.forwardRef((e,r)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:f,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:_,onDismiss:E,disableOutsideScroll:A,...w}=e,v=ho(an,n),S=kc(an,n),g=Mh(n),y=YE(n),T=aN(n),[M,k]=R.useState(null),L=R.useRef(null),D=st(r,L,v.onContentChange),j=R.useRef(0),K=R.useRef(""),Q=R.useRef(0),H=R.useRef(null),U=R.useRef("right"),$=R.useRef(0),te=A?Ac:R.Fragment,Y=A?{as:gN,allowPinchZoom:!0}:void 0,ie=I=>{var W,F;const z=K.current+I,P=T().filter(ue=>!ue.disabled),G=document.activeElement,ne=(W=P.find(ue=>ue.ref.current===G))==null?void 0:W.textValue,X=P.map(ue=>ue.textValue),Ce=RN(X,z,ne),fe=(F=P.find(ue=>ue.textValue===Ce))==null?void 0:F.ref.current;(function ue(oe){K.current=oe,window.clearTimeout(j.current),oe!==""&&(j.current=window.setTimeout(()=>ue(""),1e3))})(z),fe&&setTimeout(()=>fe.focus())};R.useEffect(()=>()=>window.clearTimeout(j.current),[]),vh();const ee=R.useCallback(I=>{var P,G;return U.current===((P=H.current)==null?void 0:P.side)&&MN(I,(G=H.current)==null?void 0:G.area)},[]);return b.jsx(fN,{scope:n,searchRef:K,onItemEnter:R.useCallback(I=>{ee(I)&&I.preventDefault()},[ee]),onItemLeave:R.useCallback(I=>{var z;ee(I)||((z=L.current)==null||z.focus(),k(null))},[ee]),onTriggerLeave:R.useCallback(I=>{ee(I)&&I.preventDefault()},[ee]),pointerGraceTimerRef:Q,onPointerGraceIntentChange:R.useCallback(I=>{H.current=I},[]),children:b.jsx(te,{...Y,children:b.jsx(Ec,{asChild:!0,trapped:o,onMountAutoFocus:Le(u,I=>{var z;I.preventDefault(),(z=L.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:b.jsx(wc,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:_,onDismiss:E,children:b.jsx(tN,{asChild:!0,...y,dir:S.dir,orientation:"vertical",loop:s,currentTabStopId:M,onCurrentTabStopIdChange:k,onEntryFocus:Le(c,I=>{S.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:b.jsx(fv,{role:"menu","aria-orientation":"vertical","data-state":hx(v.open),"data-radix-menu-content":"",dir:S.dir,...g,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:Le(w.onKeyDown,I=>{const P=I.target.closest("[data-radix-menu-content]")===I.currentTarget,G=I.ctrlKey||I.altKey||I.metaKey,ne=I.key.length===1;P&&(I.key==="Tab"&&I.preventDefault(),!G&&ne&&ie(I.key));const X=L.current;if(I.target!==X||!iN.includes(I.key))return;I.preventDefault();const fe=T().filter(W=>!W.disabled).map(W=>W.ref.current);GE.includes(I.key)&&fe.reverse(),AN(fe)}),onBlur:Le(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(j.current),K.current="")}),onPointerMove:Le(e.onPointerMove,cc(I=>{const z=I.target,P=$.current!==I.clientX;if(I.currentTarget.contains(z)&&P){const G=I.clientX>$.current?"right":"left";U.current=G,$.current=I.clientX}}))})})})})})})});$E.displayName=an;var vN="MenuGroup",Cv=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return b.jsx($e.div,{role:"group",...s,ref:r})});Cv.displayName=vN;var _N="MenuLabel",JE=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return b.jsx($e.div,{...s,ref:r})});JE.displayName=_N;var Zd="MenuItem",WS="menu.itemSelect",kh=R.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:s,...o}=e,u=R.useRef(null),f=kc(Zd,e.__scopeMenu),l=yv(Zd,e.__scopeMenu),c=st(r,u),h=R.useRef(!1),m=()=>{const p=u.current;if(!n&&p){const _=new CustomEvent(WS,{bubbles:!0,cancelable:!0});p.addEventListener(WS,E=>s==null?void 0:s(E),{once:!0}),f1(p,_),_.defaultPrevented?h.current=!1:f.onClose()}};return b.jsx(ZE,{...o,ref:c,disabled:n,onClick:Le(e.onClick,m),onPointerDown:p=>{var _;(_=e.onPointerDown)==null||_.call(e,p),h.current=!0},onPointerUp:Le(e.onPointerUp,p=>{var _;h.current||(_=p.currentTarget)==null||_.click()}),onKeyDown:Le(e.onKeyDown,p=>{const _=l.searchRef.current!=="";n||_&&p.key===" "||mg.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});kh.displayName=Zd;var ZE=R.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:s=!1,textValue:o,...u}=e,f=yv(Zd,n),l=YE(n),c=R.useRef(null),h=st(r,c),[m,p]=R.useState(!1),[_,E]=R.useState("");return R.useEffect(()=>{const A=c.current;A&&E((A.textContent??"").trim())},[u.children]),b.jsx(lc.ItemSlot,{scope:n,disabled:s,textValue:o??_,children:b.jsx(rN,{asChild:!0,...l,focusable:!s,children:b.jsx($e.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...u,ref:h,onPointerMove:Le(e.onPointerMove,cc(A=>{s?f.onItemLeave(A):(f.onItemEnter(A),A.defaultPrevented||A.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Le(e.onPointerLeave,cc(A=>f.onItemLeave(A))),onFocus:Le(e.onFocus,()=>p(!0)),onBlur:Le(e.onBlur,()=>p(!1))})})})}),yN="MenuCheckboxItem",XE=R.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:s,...o}=e;return b.jsx(ix,{scope:e.__scopeMenu,checked:n,children:b.jsx(kh,{role:"menuitemcheckbox","aria-checked":Xd(n)?"mixed":n,...o,ref:r,"data-state":wv(n),onSelect:Le(o.onSelect,()=>s==null?void 0:s(Xd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});XE.displayName=yN;var ex="MenuRadioGroup",[SN,CN]=uo(ex,{value:void 0,onValueChange:()=>{}}),tx=R.forwardRef((e,r)=>{const{value:n,onValueChange:s,...o}=e,u=Fn(s);return b.jsx(SN,{scope:e.__scopeMenu,value:n,onValueChange:u,children:b.jsx(Cv,{...o,ref:r})})});tx.displayName=ex;var rx="MenuRadioItem",nx=R.forwardRef((e,r)=>{const{value:n,...s}=e,o=CN(rx,e.__scopeMenu),u=n===o.value;return b.jsx(ix,{scope:e.__scopeMenu,checked:u,children:b.jsx(kh,{role:"menuitemradio","aria-checked":u,...s,ref:r,"data-state":wv(u),onSelect:Le(s.onSelect,()=>{var f;return(f=o.onValueChange)==null?void 0:f.call(o,n)},{checkForDefaultPrevented:!1})})})});nx.displayName=rx;var bv="MenuItemIndicator",[ix,bN]=uo(bv,{checked:!1}),sx=R.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:s,...o}=e,u=bN(bv,n);return b.jsx(Gn,{present:s||Xd(u.checked)||u.checked===!0,children:b.jsx($e.span,{...o,ref:r,"data-state":wv(u.checked)})})});sx.displayName=bv;var wN="MenuSeparator",ox=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return b.jsx($e.div,{role:"separator","aria-orientation":"horizontal",...s,ref:r})});ox.displayName=wN;var EN="MenuArrow",ax=R.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e,o=Mh(n);return b.jsx(pv,{...o,...s,ref:r})});ax.displayName=EN;var xN="MenuSub",[wj,lx]=uo(xN),Yl="MenuSubTrigger",cx=R.forwardRef((e,r)=>{const n=ho(Yl,e.__scopeMenu),s=kc(Yl,e.__scopeMenu),o=lx(Yl,e.__scopeMenu),u=yv(Yl,e.__scopeMenu),f=R.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=u,h={__scopeMenu:e.__scopeMenu},m=R.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);return R.useEffect(()=>m,[m]),R.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),c(null)}},[l,c]),b.jsx(vv,{asChild:!0,...h,children:b.jsx(ZE,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":hx(n.open),...e,ref:_c(r,o.onTriggerChange),onClick:p=>{var _;(_=e.onClick)==null||_.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Le(e.onPointerMove,cc(p=>{u.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!f.current&&(u.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Le(e.onPointerLeave,cc(p=>{var E,A;m();const _=(E=n.content)==null?void 0:E.getBoundingClientRect();if(_){const w=(A=n.content)==null?void 0:A.dataset.side,v=w==="right",S=v?-5:5,g=_[v?"left":"right"],y=_[v?"right":"left"];u.onPointerGraceIntentChange({area:[{x:p.clientX+S,y:p.clientY},{x:g,y:_.top},{x:y,y:_.top},{x:y,y:_.bottom},{x:g,y:_.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(p),p.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:Le(e.onKeyDown,p=>{var E;const _=u.searchRef.current!=="";e.disabled||_&&p.key===" "||sN[s.dir].includes(p.key)&&(n.onOpenChange(!0),(E=n.content)==null||E.focus(),p.preventDefault())})})})});cx.displayName=Yl;var ux="MenuSubContent",dx=R.forwardRef((e,r)=>{const n=KE(an,e.__scopeMenu),{forceMount:s=n.forceMount,...o}=e,u=ho(an,e.__scopeMenu),f=kc(an,e.__scopeMenu),l=lx(ux,e.__scopeMenu),c=R.useRef(null),h=st(r,c);return b.jsx(lc.Provider,{scope:e.__scopeMenu,children:b.jsx(Gn,{present:s||u.open,children:b.jsx(lc.Slot,{scope:e.__scopeMenu,children:b.jsx(Sv,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:h,align:"start",side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;f.isUsingKeyboardRef.current&&((p=c.current)==null||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Le(e.onFocusOutside,m=>{m.target!==l.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Le(e.onEscapeKeyDown,m=>{f.onClose(),m.preventDefault()}),onKeyDown:Le(e.onKeyDown,m=>{var E;const p=m.currentTarget.contains(m.target),_=oN[f.dir].includes(m.key);p&&_&&(u.onOpenChange(!1),(E=l.trigger)==null||E.focus(),m.preventDefault())})})})})})});dx.displayName=ux;function hx(e){return e?"open":"closed"}function Xd(e){return e==="indeterminate"}function wv(e){return Xd(e)?"indeterminate":e?"checked":"unchecked"}function AN(e){const r=document.activeElement;for(const n of e)if(n===r||(n.focus(),document.activeElement!==r))return}function TN(e,r){return e.map((n,s)=>e[(r+s)%e.length])}function RN(e,r,n){const o=r.length>1&&Array.from(r).every(h=>h===r[0])?r[0]:r,u=n?e.indexOf(n):-1;let f=TN(e,Math.max(u,0));o.length===1&&(f=f.filter(h=>h!==n));const c=f.find(h=>h.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function DN(e,r){const{x:n,y:s}=e;let o=!1;for(let u=0,f=r.length-1;u<r.length;f=u++){const l=r[u],c=r[f],h=l.x,m=l.y,p=c.x,_=c.y;m>s!=_>s&&n<(p-h)*(s-m)/(_-m)+h&&(o=!o)}return o}function MN(e,r){if(!r)return!1;const n={x:e.clientX,y:e.clientY};return DN(n,r)}function cc(e){return r=>r.pointerType==="mouse"?e(r):void 0}var kN=WE,LN=vv,ON=QE,BN=$E,NN=Cv,IN=JE,PN=kh,jN=XE,UN=tx,FN=nx,HN=sx,VN=ox,qN=ax,GN=cx,zN=dx,Lh="DropdownMenu",[YN]=qn(Lh,[zE]),Cr=zE(),[WN,fx]=YN(Lh),px=e=>{const{__scopeDropdownMenu:r,children:n,dir:s,open:o,defaultOpen:u,onOpenChange:f,modal:l=!0}=e,c=Cr(r),h=R.useRef(null),[m,p]=ro({prop:o,defaultProp:u??!1,onChange:f,caller:Lh});return b.jsx(WN,{scope:r,triggerId:jn(),triggerRef:h,contentId:jn(),open:m,onOpenChange:p,onOpenToggle:R.useCallback(()=>p(_=>!_),[p]),modal:l,children:b.jsx(kN,{...c,open:m,onOpenChange:p,dir:s,modal:l,children:n})})};px.displayName=Lh;var mx="DropdownMenuTrigger",gx=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...o}=e,u=fx(mx,n),f=Cr(n);return b.jsx(LN,{asChild:!0,...f,children:b.jsx($e.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...o,ref:_c(r,u.triggerRef),onPointerDown:Le(e.onPointerDown,l=>{!s&&l.button===0&&l.ctrlKey===!1&&(u.onOpenToggle(),u.open||l.preventDefault())}),onKeyDown:Le(e.onKeyDown,l=>{s||(["Enter"," "].includes(l.key)&&u.onOpenToggle(),l.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});gx.displayName=mx;var KN="DropdownMenuPortal",vx=e=>{const{__scopeDropdownMenu:r,...n}=e,s=Cr(r);return b.jsx(ON,{...s,...n})};vx.displayName=KN;var _x="DropdownMenuContent",yx=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=fx(_x,n),u=Cr(n),f=R.useRef(!1);return b.jsx(BN,{id:o.contentId,"aria-labelledby":o.triggerId,...u,...s,ref:r,onCloseAutoFocus:Le(e.onCloseAutoFocus,l=>{var c;f.current||(c=o.triggerRef.current)==null||c.focus(),f.current=!1,l.preventDefault()}),onInteractOutside:Le(e.onInteractOutside,l=>{const c=l.detail.originalEvent,h=c.button===0&&c.ctrlKey===!0,m=c.button===2||h;(!o.modal||m)&&(f.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yx.displayName=_x;var QN="DropdownMenuGroup",$N=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(NN,{...o,...s,ref:r})});$N.displayName=QN;var JN="DropdownMenuLabel",ZN=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(IN,{...o,...s,ref:r})});ZN.displayName=JN;var XN="DropdownMenuItem",Sx=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(PN,{...o,...s,ref:r})});Sx.displayName=XN;var eI="DropdownMenuCheckboxItem",tI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(jN,{...o,...s,ref:r})});tI.displayName=eI;var rI="DropdownMenuRadioGroup",nI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(UN,{...o,...s,ref:r})});nI.displayName=rI;var iI="DropdownMenuRadioItem",sI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(FN,{...o,...s,ref:r})});sI.displayName=iI;var oI="DropdownMenuItemIndicator",aI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(HN,{...o,...s,ref:r})});aI.displayName=oI;var lI="DropdownMenuSeparator",Cx=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(VN,{...o,...s,ref:r})});Cx.displayName=lI;var cI="DropdownMenuArrow",uI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(qN,{...o,...s,ref:r})});uI.displayName=cI;var dI="DropdownMenuSubTrigger",hI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(GN,{...o,...s,ref:r})});hI.displayName=dI;var fI="DropdownMenuSubContent",pI=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,o=Cr(n);return b.jsx(zN,{...o,...s,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pI.displayName=fI;var mI=px,gI=gx,vI=vx,bx=yx,wx=Sx,Ex=Cx;const KS=mI,QS=gI,gg=R.forwardRef(({className:e,sideOffset:r=4,...n},s)=>b.jsx(vI,{children:b.jsx(bx,{ref:s,sideOffset:r,className:Te("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=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",e),...n})}));gg.displayName=bx.displayName;const Zs=R.forwardRef(({className:e,inset:r,...n},s)=>b.jsx(wx,{ref:s,className:Te("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none","transition-colors focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&>svg]:size-4 [&>svg]:shrink-0",r&&"pl-8",e),...n}));Zs.displayName=wx.displayName;const _I=R.forwardRef(({className:e,...r},n)=>b.jsx(Ex,{ref:n,className:Te("-mx-1 my-1 h-px bg-muted",e),...r}));_I.displayName=Ex.displayName;function $S({status:e}){const r={active:{className:"bg-green-500",label:"Active"},busy:{className:"bg-blue-500 animate-pulse",label:"Processing"},idle:{className:"bg-yellow-500",label:"Idle"}},n=r[e]||r.idle;return b.jsx("span",{className:Te("w-2 h-2 rounded-full shrink-0",n.className),title:n.label,"aria-label":`Status: ${n.label}`})}function yI(){const[e,r]=R.useState(!1),[n,s]=R.useState(!1),[o,u]=R.useState(!1),f=mc(),l=Vn(),c=Ge(X=>X.sessions),h=Ge(X=>X.selectedSessionId),m=Ge(X=>X.selectSession),p=Ge(X=>X.removeSession),_=Ge(X=>X.workstationInfo),E=Ge(X=>X.connectionState),A=Ge(X=>X.workstationOnline),{clearSupervisorContext:w,terminateSession:v}=co(),S=(_==null?void 0:_.workspacesRoot)??"",g=!h&&l.pathname==="/chat",y=l.pathname==="/settings",T=c.filter(X=>X.type!=="terminal"),M=c.filter(X=>X.type==="terminal"),k=(X,Ce)=>{m(Ce!==void 0?Ce:null),f(X),r(!1)},L=()=>"/chat",D=X=>`/chat/${X}`,j=X=>{switch(X.type){case"terminal":return b.jsx(Zl,{className:"w-4 h-4"});case"claude":return b.jsx(Sc,{className:"w-4 h-4"});case"cursor":return b.jsx(bc,{className:"w-4 h-4"});case"opencode":return b.jsx(Cc,{className:"w-4 h-4"});default:return b.jsx(gs,{className:"w-4 h-4"})}},K=X=>{switch(X){case"claude":return"Claude Code";case"cursor":return"Cursor";case"opencode":return"OpenCode";case"terminal":return"Terminal";case"supervisor":return"Supervisor";default:return X.charAt(0).toUpperCase()+X.slice(1)}},Q=X=>{const Ce=K(X.type);return X.agentName&&X.agentName!==X.type?`${Ce} (${X.agentName})`:Ce},H=X=>{const Ce=X.workspace&&X.workspace!=="home",fe=X.project&&X.project!=="default";if(Ce&&fe)return X.worktree?`${X.workspace}/${X.project}--${X.worktree}`:`${X.workspace}/${X.project}`;if(!X.workingDir)return!Ce&&!fe?"~":null;if(!S)return X.workingDir;if(X.workingDir.startsWith(S)){let W=X.workingDir.slice(S.length);return W.startsWith("/")&&(W=W.slice(1)),W||"~"}return X.workingDir},U=()=>h?c.find(X=>X.id===h):null,$=()=>{if(y)return"Settings";const X=U();return X?X.type==="terminal"?"Terminal":Q(X):"Supervisor"},te=()=>{if(y)return null;const X=U();return X?H(X):null},Y=()=>{w(),kr.success("Context Cleared","Supervisor conversation has been reset."),s(!1)},ie=()=>{h&&(v(h),p(h),f("/chat"),kr.success("Session Terminated","The session has been closed."),u(!1))},ee=()=>{h&&(window.dispatchEvent(new CustomEvent("terminal-clear",{detail:{sessionId:h}})),kr.success("Terminal Cleared","Terminal output has been cleared."))},I=U(),z=(I==null?void 0:I.type)==="terminal",P=()=>{if(y)return b.jsx(eg,{className:"w-4 h-4"});const X=U();return X?j(X):b.jsx(Jl,{className:"w-4 h-4"})},ne=E==="verified"&&A?{icon:null,color:"bg-green-500",label:"Connected",isCircle:!0}:E==="verified"&&!A?{icon:zg,color:"text-orange-500",label:"Workstation offline"}:E==="error"||E==="disconnected"?{icon:s1,color:"text-destructive",label:"Disconnected"}:E==="connecting"||E==="authenticating"||E==="authenticated"?{icon:yc,color:"text-yellow-500",label:"Connecting...",spin:!0}:{icon:o1,color:"text-muted-foreground",label:E};return b.jsxs(b.Fragment,{children:[b.jsxs("header",{className:"md:hidden flex items-center gap-3 p-4 border-b bg-card",children:[b.jsx(ct,{variant:"ghost",size:"icon",onClick:()=>r(!0),children:b.jsx(HM,{className:"w-5 h-5"})}),b.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[P(),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("h1",{className:"font-semibold truncate text-sm",children:$()}),te()&&b.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te()})]})]}),b.jsxs(zS,{children:[b.jsx(YS,{asChild:!0,children:b.jsx(ct,{variant:"ghost",size:"icon",className:"relative shrink-0",children:ne.isCircle?b.jsx("span",{className:Te("w-2.5 h-2.5 rounded-full",ne.color)}):ne.icon?b.jsx(ne.icon,{className:Te("w-4 h-4",ne.color,ne.spin&&"animate-spin")}):null})}),b.jsxs(fg,{align:"end",className:"w-56",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[ne.isCircle?b.jsx("span",{className:Te("w-2.5 h-2.5 rounded-full",ne.color)}):ne.icon?b.jsx(ne.icon,{className:Te("w-4 h-4",ne.color,ne.spin&&"animate-spin")}):null,b.jsx("span",{className:"text-sm font-medium",children:ne.label})]}),_&&b.jsxs("div",{className:"mt-2 pt-2 border-t text-xs text-muted-foreground space-y-1",children:[b.jsxs("p",{children:["Workstation: ",_.name]}),b.jsxs("p",{children:["Version: ",_.version]})]})]})]}),(g||h)&&!y&&b.jsxs(KS,{children:[b.jsx(QS,{asChild:!0,children:b.jsx(ct,{variant:"ghost",size:"icon",className:"shrink-0",children:b.jsx(mS,{className:"w-5 h-5"})})}),b.jsxs(gg,{align:"end",children:[g&&b.jsxs(Zs,{onClick:()=>s(!0),className:"text-destructive focus:text-destructive",children:[b.jsx(hd,{className:"w-4 h-4"}),"Clear Context"]}),z&&b.jsxs(Zs,{onClick:ee,children:[b.jsx(hd,{className:"w-4 h-4"}),"Clear Terminal"]}),h&&b.jsxs(Zs,{onClick:()=>u(!0),className:"text-destructive focus:text-destructive",children:[b.jsx($l,{className:"w-4 h-4"}),"Terminate Session"]})]})]})]}),b.jsxs("header",{className:"hidden md:flex items-center gap-3 p-4 pl-6 border-b bg-card",children:[b.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[P(),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("h1",{className:"font-semibold truncate text-sm",children:$()}),te()&&b.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te()})]})]}),b.jsxs(zS,{children:[b.jsx(YS,{asChild:!0,children:b.jsx(ct,{variant:"ghost",size:"icon",className:"relative shrink-0",children:ne.isCircle?b.jsx("span",{className:Te("w-2.5 h-2.5 rounded-full",ne.color)}):ne.icon?b.jsx(ne.icon,{className:Te("w-4 h-4",ne.color,ne.spin&&"animate-spin")}):null})}),b.jsxs(fg,{align:"end",className:"w-56",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[ne.isCircle?b.jsx("span",{className:Te("w-2.5 h-2.5 rounded-full",ne.color)}):ne.icon?b.jsx(ne.icon,{className:Te("w-4 h-4",ne.color,ne.spin&&"animate-spin")}):null,b.jsx("span",{className:"text-sm font-medium",children:ne.label})]}),_&&b.jsxs("div",{className:"mt-2 pt-2 border-t text-xs text-muted-foreground space-y-1",children:[b.jsxs("p",{children:["Workstation: ",_.name]}),b.jsxs("p",{children:["Version: ",_.version]})]})]})]}),(g||h)&&!y&&b.jsxs(KS,{children:[b.jsx(QS,{asChild:!0,children:b.jsx(ct,{variant:"ghost",size:"icon",className:"shrink-0",children:b.jsx(mS,{className:"w-5 h-5"})})}),b.jsxs(gg,{align:"end",children:[g&&b.jsxs(Zs,{onClick:()=>s(!0),className:"text-destructive focus:text-destructive",children:[b.jsx(hd,{className:"w-4 h-4"}),"Clear Context"]}),z&&b.jsxs(Zs,{onClick:ee,children:[b.jsx(hd,{className:"w-4 h-4"}),"Clear Terminal"]}),h&&b.jsxs(Zs,{onClick:()=>u(!0),className:"text-destructive focus:text-destructive",children:[b.jsx($l,{className:"w-4 h-4"}),"Terminate Session"]})]})]})]}),b.jsx(Jd,{open:n,onOpenChange:s,children:b.jsxs(tc,{children:[b.jsxs(rc,{children:[b.jsx(ic,{children:"Clear Conversation?"}),b.jsx(sc,{children:"This will clear the entire conversation history with the Supervisor. This action cannot be undone."})]}),b.jsxs(nc,{children:[b.jsx(ac,{children:"Cancel"}),b.jsx(oc,{onClick:Y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Clear Context"})]})]})}),b.jsx(Jd,{open:o,onOpenChange:u,children:b.jsxs(tc,{children:[b.jsxs(rc,{children:[b.jsx(ic,{children:"Terminate Session?"}),b.jsx(sc,{children:"This will end the current session and close the connection to the agent. You will need to create a new session to continue."})]}),b.jsxs(nc,{children:[b.jsx(ac,{children:"Cancel"}),b.jsx(oc,{onClick:ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Terminate"})]})]})}),e&&b.jsx("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>r(!1)}),b.jsx("div",{className:Te("md:hidden fixed inset-y-0 left-0 w-full bg-card z-50 transform transition-transform duration-300",e?"translate-x-0":"-translate-x-full"),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[b.jsx("h1",{className:"font-semibold text-lg",children:"Tiflis Code"}),b.jsx(ct,{variant:"ghost",size:"icon",onClick:()=>r(!1),children:b.jsx(Yg,{className:"w-5 h-5"})})]}),b.jsxs("nav",{className:"flex-1 overflow-auto p-2 space-y-1","aria-label":"Sessions",children:[b.jsxs(ct,{variant:g?"secondary":"ghost",className:"w-full justify-start",onClick:()=>k(L()),"aria-current":g?"page":void 0,children:[b.jsx(Jl,{className:"w-4 h-4","aria-hidden":"true"}),b.jsx("span",{className:"ml-2",children:"Supervisor"})]}),T.length>0&&b.jsxs("section",{className:"pt-4","aria-label":"Agent sessions",children:[b.jsx("h2",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase",children:"Agent Sessions"}),b.jsx("ul",{role:"list",className:"space-y-1",children:T.map(X=>{const Ce=H(X),fe=Q(X);return b.jsx("li",{children:b.jsxs(ct,{variant:h===X.id?"secondary":"ghost",className:"w-full justify-start h-auto py-2",onClick:()=>k(D(X.id),X.id),"aria-current":h===X.id?"page":void 0,children:[b.jsxs("div",{className:"relative shrink-0",children:[b.jsx("span",{"aria-hidden":"true",children:j(X)}),b.jsx("span",{className:"absolute -bottom-0.5 -right-0.5",children:b.jsx($S,{status:X.status})})]}),b.jsxs("div",{className:"ml-2 flex flex-col items-start min-w-0 flex-1",children:[b.jsx("span",{className:"truncate text-sm font-medium flex items-center",children:fe}),Ce&&b.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Ce})]})]})},X.id)})})]}),M.length>0&&b.jsxs("section",{className:"pt-4","aria-label":"Terminal sessions",children:[b.jsx("h2",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase",children:"Terminals"}),b.jsx("ul",{role:"list",className:"space-y-1",children:M.map(X=>{const Ce=H(X);return b.jsx("li",{children:b.jsxs(ct,{variant:h===X.id?"secondary":"ghost",className:"w-full justify-start h-auto py-2",onClick:()=>k(`/terminal/${X.id}`,X.id),"aria-current":h===X.id?"page":void 0,children:[b.jsxs("div",{className:"relative shrink-0",children:[b.jsx("span",{"aria-hidden":"true",children:j(X)}),b.jsx("span",{className:"absolute -bottom-0.5 -right-0.5",children:b.jsx($S,{status:X.status})})]}),b.jsxs("div",{className:"ml-2 flex flex-col items-start min-w-0 flex-1",children:[b.jsx("span",{className:"truncate text-sm font-medium",children:"Terminal"}),Ce&&b.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Ce})]})]})},X.id)})})]}),b.jsx("div",{className:"pt-4",children:b.jsx(oE,{children:b.jsxs(ct,{variant:"outline",className:"w-full justify-start",children:[b.jsx(n1,{className:"w-4 h-4","aria-hidden":"true"}),b.jsx("span",{className:"ml-2",children:"New Session"})]})})})]}),b.jsx("div",{className:"p-2 border-t",children:b.jsxs(ct,{variant:y?"secondary":"ghost",className:"w-full justify-start",onClick:()=>k("/settings"),children:[b.jsx(eg,{className:"w-4 h-4"}),b.jsx("span",{className:"ml-2",children:"Settings"})]})})]})})]})}function SI(){const e=Pn(h=>h.sidebarCollapsed),r=Pn(h=>h.sidebarWidth),n=Pn(h=>h.setSidebarWidth),[s,o]=R.useState(!1),u=R.useRef(!1),f=R.useRef(null),l=R.useCallback(h=>{if(e)return;h.preventDefault(),o(!0),u.current=!0;const m=_=>{if(!u.current)return;const E=_.clientX;E>=a1&&E<=l1&&n(E)},p=()=>{o(!1),u.current=!1,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",p),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",m),document.addEventListener("mouseup",p),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[e,n]),c=e?ck:r;return b.jsxs("div",{className:"flex h-[var(--app-height)] overflow-hidden bg-background",children:[b.jsxs("aside",{ref:f,style:{width:c},className:Te("hidden md:flex flex-col border-r bg-card relative",!e&&"transition-none",e&&"transition-all duration-300"),children:[b.jsx(k4,{}),!e&&b.jsx("div",{className:Te("absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-primary/20 transition-colors",s&&"bg-primary/30"),onMouseDown:l})]}),b.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[b.jsx(yI,{}),b.jsx("main",{className:"flex-1 overflow-hidden",children:b.jsx(zR,{})})]})]})}function xx({audioUrl:e,audioBase64:r,messageId:n,className:s,onPlayStart:o,onPlayEnd:u}){const[f,l]=R.useState(!1),[c,h]=R.useState(!1),[m,p]=R.useState(0),[_,E]=R.useState(0),[A,w]=R.useState(!1),[v,S]=R.useState(null),[g,y]=R.useState(!1),[T,M]=R.useState(null),[k,L]=R.useState(!1),D=R.useRef(null),j=R.useRef(!1),K=R.useRef(!1),Q=R.useRef(!1),H=!!(r||e),U=n?Nt.hasAudio(n):!1,$=!!n&&!H&&!U&&!A,te=T!==null?T:_,Y=m>0?te/m*100:0;R.useEffect(()=>Nt.subscribe(W=>{W.messageId===n?(l(W.isPlaying),h(W.isLoading),E(W.currentTime),W.duration>0&&(p(W.duration),w(!0)),W.error&&S(W.error),W.isPlaying&&!Q.current?o==null||o():!W.isPlaying&&Q.current&&W.currentTime===0&&(u==null||u()),Q.current=W.isPlaying):Q.current&&W.messageId!==n&&(l(!1),Q.current=!1)}),[n,o,u]),R.useEffect(()=>{if(!K.current)if(n&&Nt.hasAudio(n)){const fe=Nt.getAudio(n);if(fe){if(fe.duration&&!isNaN(fe.duration))p(fe.duration);else{const W=()=>{isNaN(fe.duration)||p(fe.duration),fe.removeEventListener("loadedmetadata",W)};fe.addEventListener("loadedmetadata",W)}w(!0),K.current=!0}}else r&&n&&(Nt.playAudio(r,n,!1),w(!0),K.current=!0)},[r,n]);const ie=R.useCallback(async()=>{if(!n||k)return;L(!0),h(!0),S(null),on.audio(`Requesting audio for messageId: ${n}`);const fe=async(W=1)=>{try{const F={type:"audio.request",id:crypto.randomUUID(),payload:{message_id:n}},ue=await Bt.sendRequest(F);if(ue.payload.error){if(ue.payload.error==="Audio not found"&&W<3)return await new Promise(de=>setTimeout(de,1e3)),fe(W+1);ue.payload.error==="Audio not found"?S("Audio unavailable - TTS may be disabled"):S(ue.payload.error),h(!1),L(!1);return}const oe=ue.payload.audio||ue.payload.audio_base64;if(oe)Nt.playAudio(oe,n,!0),w(!0),K.current=!0;else{if(W<3)return await new Promise(de=>setTimeout(de,1e3)),fe(W+1);S("Audio not available")}}catch(F){const ue=F instanceof Error?F.message:"Failed to load audio";if(W<3)return await new Promise(oe=>setTimeout(oe,1e3)),fe(W+1);S(ue)}};await fe(),h(!1),L(!1)},[n,k]),ee=R.useCallback(()=>{if(!A&&$){ie();return}if(n&&Nt.getCurrentMessageId()!==n){Nt.hasAudio(n)?Nt.playByMessageId(n):r&&Nt.playAudio(r,n,!0);return}Nt.togglePlay()},[A,$,ie,n,r]),I=R.useCallback(()=>{n&&Nt.getCurrentMessageId()===n&&(Nt.resetToStart(),"vibrate"in navigator&&navigator.vibrate(10))},[n]),z=R.useCallback(fe=>{if(isNaN(fe)||!isFinite(fe))return"0:00";const W=Math.floor(fe/60),F=Math.floor(fe%60);return`${W}:${F.toString().padStart(2,"0")}`},[]),P=R.useCallback(fe=>{var oe,de;if(!D.current||!m)return null;const W=D.current.getBoundingClientRect(),F="touches"in fe?((oe=fe.touches[0])==null?void 0:oe.clientX)??((de=fe.changedTouches[0])==null?void 0:de.clientX)??0:fe.clientX;return Math.max(0,Math.min(1,(F-W.left)/W.width))*m},[m]),G=R.useCallback(fe=>{if(!m||c)return;fe.preventDefault(),fe.stopPropagation(),j.current=f,f&&n&&Nt.getCurrentMessageId()===n&&Nt.togglePlay(),y(!0);const W=P(fe);W!==null&&(M(W),"vibrate"in navigator&&navigator.vibrate(5))},[m,c,f,n,P]);R.useEffect(()=>{if(!g)return;const fe=F=>{F.preventDefault();const ue=P(F);ue!==null&&M(ue)},W=F=>{const ue=P(F);ue!==null&&n&&(Nt.seekToTime(ue),E(ue),j.current&&Nt.togglePlay()),M(null),y(!1),"vibrate"in navigator&&navigator.vibrate(10)};return document.addEventListener("mousemove",fe,{passive:!1}),document.addEventListener("mouseup",W),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",W),()=>{document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",W)}},[g,P,n]);const ne=R.useCallback(fe=>{if(fe.key===" "||fe.key==="Spacebar"){fe.preventDefault(),ee();return}if(fe.key==="r"||fe.key==="R"){fe.preventDefault(),I();return}if(!m||c)return;const W=m*.05;let F=_;switch(fe.key){case"ArrowLeft":F=Math.max(0,_-W);break;case"ArrowRight":F=Math.min(m,_+W);break;case"Home":F=0;break;case"End":F=m;break;default:return}fe.preventDefault(),n&&(Nt.seekToTime(F),E(F))},[_,m,c,ee,I,n]);if(!H&&!U&&!$&&!v&&!A)return null;if(v)return b.jsxs("div",{className:Te("flex items-center gap-3 py-2 text-destructive",s),role:"alert",children:[b.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-full shrink-0 bg-destructive/10",children:b.jsx(gh,{className:"w-5 h-5","aria-hidden":"true"})}),b.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[b.jsx("span",{className:"text-sm",children:v}),$&&b.jsxs("button",{type:"button",onClick:()=>{S(null),ie()},className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors","aria-label":"Retry loading audio",children:[b.jsx(Gg,{className:"w-3 h-3","aria-hidden":"true"}),"Retry"]})]})]});const X=c||k,Ce=f&&n&&Nt.getCurrentMessageId()===n;return b.jsxs("div",{className:Te("flex items-center gap-3 p-3 rounded-2xl bg-muted select-none",s),role:"group","aria-label":"Audio player",tabIndex:0,onKeyDown:ne,children:[b.jsx("button",{type:"button",onClick:ee,disabled:X,className:Te("flex items-center justify-center w-10 h-10 rounded-full shrink-0 transition-all active:scale-95",X&&"opacity-70 cursor-wait","bg-primary text-primary-foreground"),"aria-label":X?"Loading audio":Ce?"Pause audio":"Play audio","aria-busy":X,children:X?b.jsx(yc,{className:"w-5 h-5 animate-spin","aria-hidden":"true"}):Ce?b.jsx(GM,{className:"w-5 h-5",fill:"currentColor","aria-hidden":"true"}):b.jsx(zM,{className:"w-5 h-5 ml-0.5",fill:"currentColor","aria-hidden":"true"})}),b.jsxs("div",{className:"flex-1 flex flex-col gap-1.5 min-w-0",children:[b.jsxs("div",{ref:D,className:Te("relative h-1.5 rounded-full bg-secondary-foreground/20 touch-none overflow-hidden",A&&!X&&"cursor-pointer",g&&"cursor-grabbing"),role:"slider",tabIndex:-1,"aria-valuenow":Math.round(Y),"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Audio progress: ${z(te)} of ${z(m)}`,onMouseDown:G,onTouchStart:G,children:[b.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-primary",style:{width:`${Y}%`}}),g&&T!==null&&b.jsx("div",{className:"absolute -top-8 transform -translate-x-1/2 px-2 py-1 bg-popover border rounded shadow-lg text-xs font-medium tabular-nums pointer-events-none z-10",style:{left:`${Y}%`},children:z(T)})]}),b.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[b.jsx("span",{className:"tabular-nums",children:X?"...":z(te)}),b.jsx("span",{className:"tabular-nums",children:z(m)})]})]}),A&&_>0&&b.jsx("button",{type:"button",onClick:I,className:"p-2 text-muted-foreground hover:text-foreground transition-colors rounded-full hover:bg-muted-foreground/10 active:scale-95","aria-label":"Reset to start",children:b.jsx(WM,{className:"w-4 h-4","aria-hidden":"true"})})]})}const CI="modulepreload",bI=function(e){return"/"+e},JS={},J=function(r,n,s){let o=Promise.resolve();if(n&&n.length>0){let f=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=f(n.map(h=>{if(h=bI(h),h in JS)return;JS[h]=!0;const m=h.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const _=document.createElement("link");if(_.rel=m?"stylesheet":CI,m||(_.as="script"),_.crossOrigin="",_.href=h,c&&_.setAttribute("nonce",c),document.head.appendChild(_),m)return new Promise((E,A)=>{_.addEventListener("load",E),_.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function u(f){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=f,window.dispatchEvent(l),!l.defaultPrevented)throw f}return o.then(f=>{for(const l of f||[])l.status==="rejected"&&u(l.reason);return r().catch(u)})},Ax=[{id:"abap",name:"ABAP",import:()=>J(()=>import("./abap-DsBKuouk.js"),[])},{id:"actionscript-3",name:"ActionScript",import:()=>J(()=>import("./actionscript-3-D_z4Izcz.js"),[])},{id:"ada",name:"Ada",import:()=>J(()=>import("./ada-727ZlQH0.js"),[])},{id:"angular-html",name:"Angular HTML",import:()=>J(()=>import("./angular-html-LfdN0zeE.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]))},{id:"angular-ts",name:"Angular TypeScript",import:()=>J(()=>import("./angular-ts-CKsD7JZE.js"),__vite__mapDeps([4,0,1,2,3,5]))},{id:"apache",name:"Apache Conf",import:()=>J(()=>import("./apache-Dn00JSTd.js"),[])},{id:"apex",name:"Apex",import:()=>J(()=>import("./apex-COJ4H7py.js"),[])},{id:"apl",name:"APL",import:()=>J(()=>import("./apl-BBq3IX1j.js"),__vite__mapDeps([6,1,2,3,7,8,9]))},{id:"applescript",name:"AppleScript",import:()=>J(()=>import("./applescript-Bu5BbsvL.js"),[])},{id:"ara",name:"Ara",import:()=>J(()=>import("./ara-7O62HKoU.js"),[])},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>J(()=>import("./asciidoc-BPT9niGB.js"),[])},{id:"asm",name:"Assembly",import:()=>J(()=>import("./asm-Dhn9LcZ4.js"),[])},{id:"astro",name:"Astro",import:()=>J(()=>import("./astro-CqkE3fuf.js"),__vite__mapDeps([10,9,2,11,3,12]))},{id:"awk",name:"AWK",import:()=>J(()=>import("./awk-eg146-Ew.js"),[])},{id:"ballerina",name:"Ballerina",import:()=>J(()=>import("./ballerina-Du268qiB.js"),[])},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>J(()=>import("./bat-fje9CFhw.js"),[])},{id:"beancount",name:"Beancount",import:()=>J(()=>import("./beancount-BwXTMy5W.js"),[])},{id:"berry",name:"Berry",aliases:["be"],import:()=>J(()=>import("./berry-3xVqZejG.js"),[])},{id:"bibtex",name:"BibTeX",import:()=>J(()=>import("./bibtex-xW4inM5L.js"),[])},{id:"bicep",name:"Bicep",import:()=>J(()=>import("./bicep-DHo0CJ0O.js"),[])},{id:"blade",name:"Blade",import:()=>J(()=>import("./blade-a8OxSdnT.js"),__vite__mapDeps([13,1,2,3,7,8,14,9]))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>J(()=>import("./bsl-Dgyn0ogV.js"),__vite__mapDeps([15,16]))},{id:"c",name:"C",import:()=>J(()=>import("./c-C3t2pwGQ.js"),[])},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>J(()=>import("./cadence-DNquZEk8.js"),[])},{id:"cairo",name:"Cairo",import:()=>J(()=>import("./cairo--RitsXJZ.js"),__vite__mapDeps([17,18]))},{id:"clarity",name:"Clarity",import:()=>J(()=>import("./clarity-BHOwM8T6.js"),[])},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>J(()=>import("./clojure-DxSadP1t.js"),[])},{id:"cmake",name:"CMake",import:()=>J(()=>import("./cmake-DbXoA79R.js"),[])},{id:"cobol",name:"COBOL",import:()=>J(()=>import("./cobol-PTqiYgYu.js"),__vite__mapDeps([19,1,2,3,8]))},{id:"codeowners",name:"CODEOWNERS",import:()=>J(()=>import("./codeowners-Bp6g37R7.js"),[])},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>J(()=>import("./codeql-sacFqUAJ.js"),[])},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>J(()=>import("./coffee-dyiR41kL.js"),__vite__mapDeps([20,2]))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>J(()=>import("./common-lisp-C7gG9l05.js"),[])},{id:"coq",name:"Coq",import:()=>J(()=>import("./coq-Dsg_Bt_b.js"),[])},{id:"cpp",name:"C++",aliases:["c++"],import:()=>J(()=>import("./cpp-BksuvNSY.js"),__vite__mapDeps([21,22,23,24,14]))},{id:"crystal",name:"Crystal",import:()=>J(()=>import("./crystal-DtDmRg-F.js"),__vite__mapDeps([25,1,2,3,14,24,26]))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>J(()=>import("./csharp-D9R-vmeu.js"),[])},{id:"css",name:"CSS",import:()=>J(()=>import("./css-BPhBrDlE.js"),[])},{id:"csv",name:"CSV",import:()=>J(()=>import("./csv-B0qRVHPH.js"),[])},{id:"cue",name:"CUE",import:()=>J(()=>import("./cue-DtFQj3wx.js"),[])},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>J(()=>import("./cypher-m2LEI-9-.js"),[])},{id:"d",name:"D",import:()=>J(()=>import("./d-BoXegm-a.js"),[])},{id:"dart",name:"Dart",import:()=>J(()=>import("./dart-B9wLZaAG.js"),[])},{id:"dax",name:"DAX",import:()=>J(()=>import("./dax-ClGRhx96.js"),[])},{id:"desktop",name:"Desktop",import:()=>J(()=>import("./desktop-DEIpsLCJ.js"),[])},{id:"diff",name:"Diff",import:()=>J(()=>import("./diff-BgYniUM_.js"),[])},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>J(()=>import("./docker-COcR7UxN.js"),[])},{id:"dotenv",name:"dotEnv",import:()=>J(()=>import("./dotenv-BjQB5zDj.js"),[])},{id:"dream-maker",name:"Dream Maker",import:()=>J(()=>import("./dream-maker-C-nORZOA.js"),[])},{id:"edge",name:"Edge",import:()=>J(()=>import("./edge-D5gP-w-T.js"),__vite__mapDeps([27,11,1,2,3,28]))},{id:"elixir",name:"Elixir",import:()=>J(()=>import("./elixir-CLiX3zqd.js"),__vite__mapDeps([29,1,2,3]))},{id:"elm",name:"Elm",import:()=>J(()=>import("./elm-CmHSxxaM.js"),__vite__mapDeps([30,23,24]))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>J(()=>import("./emacs-lisp-BX77sIaO.js"),[])},{id:"erb",name:"ERB",import:()=>J(()=>import("./erb-BYTLMnw6.js"),__vite__mapDeps([31,1,2,3,32,33,7,8,14,34,11,35,36,21,22,23,24,26,37,38]))},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>J(()=>import("./erlang-B-DoSBHF.js"),[])},{id:"fennel",name:"Fennel",import:()=>J(()=>import("./fennel-bCA53EVm.js"),[])},{id:"fish",name:"Fish",import:()=>J(()=>import("./fish-w-ucz2PV.js"),[])},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>J(()=>import("./fluent-Dayu4EKP.js"),[])},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>J(()=>import("./fortran-fixed-form-TqA4NnZg.js"),__vite__mapDeps([39,40]))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>J(()=>import("./fortran-free-form-DKXYxT9g.js"),[])},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>J(()=>import("./fsharp-XplgxFYe.js"),__vite__mapDeps([41,42]))},{id:"gdresource",name:"GDResource",import:()=>J(()=>import("./gdresource-BHYsBjWJ.js"),__vite__mapDeps([43,44,45]))},{id:"gdscript",name:"GDScript",import:()=>J(()=>import("./gdscript-DfxzS6Rs.js"),[])},{id:"gdshader",name:"GDShader",import:()=>J(()=>import("./gdshader-SKMF96pI.js"),[])},{id:"genie",name:"Genie",import:()=>J(()=>import("./genie-ajMbGru0.js"),[])},{id:"gherkin",name:"Gherkin",import:()=>J(()=>import("./gherkin--30QC5Em.js"),[])},{id:"git-commit",name:"Git Commit Message",import:()=>J(()=>import("./git-commit-i4q6IMui.js"),__vite__mapDeps([46,47]))},{id:"git-rebase",name:"Git Rebase Message",import:()=>J(()=>import("./git-rebase-B-v9cOL2.js"),__vite__mapDeps([48,26]))},{id:"gleam",name:"Gleam",import:()=>J(()=>import("./gleam-B430Bg39.js"),[])},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>J(()=>import("./glimmer-js-D-cwc0-E.js"),__vite__mapDeps([49,2,11,3,1]))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>J(()=>import("./glimmer-ts-pgjy16dm.js"),__vite__mapDeps([50,11,3,2,1]))},{id:"glsl",name:"GLSL",import:()=>J(()=>import("./glsl-DBO2IWDn.js"),__vite__mapDeps([23,24]))},{id:"gnuplot",name:"Gnuplot",import:()=>J(()=>import("./gnuplot-CM8KxXT1.js"),[])},{id:"go",name:"Go",import:()=>J(()=>import("./go-B1SYOhNW.js"),[])},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>J(()=>import("./graphql-cDcHW_If.js"),__vite__mapDeps([34,2,11,35,36]))},{id:"groovy",name:"Groovy",import:()=>J(()=>import("./groovy-DkBy-JyN.js"),[])},{id:"hack",name:"Hack",import:()=>J(()=>import("./hack-D1yCygmZ.js"),__vite__mapDeps([51,1,2,3,14]))},{id:"haml",name:"Ruby Haml",import:()=>J(()=>import("./haml-B2EZWmdv.js"),__vite__mapDeps([33,2,3]))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>J(()=>import("./handlebars-BQGss363.js"),__vite__mapDeps([52,1,2,3,38]))},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>J(()=>import("./haskell-BILxekzW.js"),[])},{id:"haxe",name:"Haxe",import:()=>J(()=>import("./haxe-C5wWYbrZ.js"),[])},{id:"hcl",name:"HashiCorp HCL",import:()=>J(()=>import("./hcl-HzYwdGDm.js"),[])},{id:"hjson",name:"Hjson",import:()=>J(()=>import("./hjson-T-Tgc4AT.js"),[])},{id:"hlsl",name:"HLSL",import:()=>J(()=>import("./hlsl-ifBTmRxC.js"),[])},{id:"html",name:"HTML",import:()=>J(()=>import("./html-C2L_23MC.js"),__vite__mapDeps([1,2,3]))},{id:"html-derivative",name:"HTML (Derivative)",import:()=>J(()=>import("./html-derivative-CSfWNPLT.js"),__vite__mapDeps([28,1,2,3]))},{id:"http",name:"HTTP",import:()=>J(()=>import("./http-FRrOvY1W.js"),__vite__mapDeps([53,26,9,7,8,34,2,11,35,36]))},{id:"hxml",name:"HXML",import:()=>J(()=>import("./hxml-TIA70rKU.js"),__vite__mapDeps([54,55]))},{id:"hy",name:"Hy",import:()=>J(()=>import("./hy-BMj5Y0dO.js"),[])},{id:"imba",name:"Imba",import:()=>J(()=>import("./imba-bv_oIlVt.js"),__vite__mapDeps([56,11]))},{id:"ini",name:"INI",aliases:["properties"],import:()=>J(()=>import("./ini-BjABl1g7.js"),[])},{id:"java",name:"Java",import:()=>J(()=>import("./java-xI-RfyKK.js"),[])},{id:"javascript",name:"JavaScript",aliases:["js"],import:()=>J(()=>import("./javascript-ySlJ1b_l.js"),[])},{id:"jinja",name:"Jinja",import:()=>J(()=>import("./jinja-DGy0s7-h.js"),__vite__mapDeps([57,1,2,3]))},{id:"jison",name:"Jison",import:()=>J(()=>import("./jison-BqZprYcd.js"),__vite__mapDeps([58,2]))},{id:"json",name:"JSON",import:()=>J(()=>import("./json-BQoSv7ci.js"),[])},{id:"json5",name:"JSON5",import:()=>J(()=>import("./json5-w8dY5SsB.js"),[])},{id:"jsonc",name:"JSON with Comments",import:()=>J(()=>import("./jsonc-TU54ms6u.js"),[])},{id:"jsonl",name:"JSON Lines",import:()=>J(()=>import("./jsonl-DREVFZK8.js"),[])},{id:"jsonnet",name:"Jsonnet",import:()=>J(()=>import("./jsonnet-BfivnA6A.js"),[])},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>J(()=>import("./jssm-P4WzXJd0.js"),[])},{id:"jsx",name:"JSX",import:()=>J(()=>import("./jsx-BAng5TT0.js"),[])},{id:"julia",name:"Julia",aliases:["jl"],import:()=>J(()=>import("./julia-BBuGR-5E.js"),__vite__mapDeps([59,21,22,23,24,14,18,2,60]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>J(()=>import("./kotlin-B5lbUyaz.js"),[])},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>J(()=>import("./kusto-mebxcVVE.js"),[])},{id:"latex",name:"LaTeX",import:()=>J(()=>import("./latex-C-cWTeAZ.js"),__vite__mapDeps([61,62,60]))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>J(()=>import("./lean-XBlWyCtg.js"),[])},{id:"less",name:"Less",import:()=>J(()=>import("./less-BfCpw3nA.js"),[])},{id:"liquid",name:"Liquid",import:()=>J(()=>import("./liquid-D3W5UaiH.js"),__vite__mapDeps([63,1,2,3,9]))},{id:"log",name:"Log file",import:()=>J(()=>import("./log-Cc5clBb7.js"),[])},{id:"logo",name:"Logo",import:()=>J(()=>import("./logo-IuBKFhSY.js"),[])},{id:"lua",name:"Lua",import:()=>J(()=>import("./lua-CvWAzNxB.js"),__vite__mapDeps([37,24]))},{id:"luau",name:"Luau",import:()=>J(()=>import("./luau-Du5NY7AG.js"),[])},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>J(()=>import("./make-Bvotw-X0.js"),[])},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>J(()=>import("./markdown-UIAJJxZW.js"),[])},{id:"marko",name:"Marko",import:()=>J(()=>import("./marko-z0MBrx5-.js"),__vite__mapDeps([64,3,65,5,2]))},{id:"matlab",name:"MATLAB",import:()=>J(()=>import("./matlab-D9-PGadD.js"),[])},{id:"mdc",name:"MDC",import:()=>J(()=>import("./mdc-DB_EDNY_.js"),__vite__mapDeps([66,42,38,28,1,2,3]))},{id:"mdx",name:"MDX",import:()=>J(()=>import("./mdx-sdHcTMYB.js"),[])},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>J(()=>import("./mermaid-Ci6OQyBP.js"),[])},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>J(()=>import("./mipsasm-BC5c_5Pe.js"),[])},{id:"mojo",name:"Mojo",import:()=>J(()=>import("./mojo-Tz6hzZYG.js"),[])},{id:"move",name:"Move",import:()=>J(()=>import("./move-DB_GagMm.js"),[])},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>J(()=>import("./narrat-DLbgOhZU.js"),[])},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>J(()=>import("./nextflow-B0XVJmRM.js"),[])},{id:"nginx",name:"Nginx",import:()=>J(()=>import("./nginx-D_VnBJ67.js"),__vite__mapDeps([67,37,24]))},{id:"nim",name:"Nim",import:()=>J(()=>import("./nim-ZlGxZxc3.js"),__vite__mapDeps([68,24,1,2,3,7,8,23,42]))},{id:"nix",name:"Nix",import:()=>J(()=>import("./nix-shcSOmrb.js"),[])},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>J(()=>import("./nushell-D4Tzg5kh.js"),[])},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>J(()=>import("./objective-c-Deuh7S70.js"),[])},{id:"objective-cpp",name:"Objective-C++",import:()=>J(()=>import("./objective-cpp-BUEGK8hf.js"),[])},{id:"ocaml",name:"OCaml",import:()=>J(()=>import("./ocaml-BNioltXt.js"),[])},{id:"pascal",name:"Pascal",import:()=>J(()=>import("./pascal-JqZropPD.js"),[])},{id:"perl",name:"Perl",import:()=>J(()=>import("./perl-CHQXSrWU.js"),__vite__mapDeps([69,1,2,3,7,8,14]))},{id:"php",name:"PHP",import:()=>J(()=>import("./php-B5ebYQev.js"),__vite__mapDeps([70,1,2,3,7,8,14,9]))},{id:"plsql",name:"PL/SQL",import:()=>J(()=>import("./plsql-LKU2TuZ1.js"),[])},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>J(()=>import("./po-BFLt1xDp.js"),[])},{id:"polar",name:"Polar",import:()=>J(()=>import("./polar-DKykz6zU.js"),[])},{id:"postcss",name:"PostCSS",import:()=>J(()=>import("./postcss-B3ZDOciz.js"),[])},{id:"powerquery",name:"PowerQuery",import:()=>J(()=>import("./powerquery-CSHBycmS.js"),[])},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>J(()=>import("./powershell-BIEUsx6d.js"),[])},{id:"prisma",name:"Prisma",import:()=>J(()=>import("./prisma-B48N-Iqd.js"),[])},{id:"prolog",name:"Prolog",import:()=>J(()=>import("./prolog-BY-TUvya.js"),[])},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>J(()=>import("./proto-zocC4JxJ.js"),[])},{id:"pug",name:"Pug",aliases:["jade"],import:()=>J(()=>import("./pug-CM9l7STV.js"),__vite__mapDeps([71,2,3,1]))},{id:"puppet",name:"Puppet",import:()=>J(()=>import("./puppet-Cza_XSSt.js"),[])},{id:"purescript",name:"PureScript",import:()=>J(()=>import("./purescript-Bg-kzb6g.js"),[])},{id:"python",name:"Python",aliases:["py"],import:()=>J(()=>import("./python-DhUJRlN_.js"),[])},{id:"qml",name:"QML",import:()=>J(()=>import("./qml-D8XfuvdV.js"),__vite__mapDeps([72,2]))},{id:"qmldir",name:"QML Directory",import:()=>J(()=>import("./qmldir-C8lEn-DE.js"),[])},{id:"qss",name:"Qt Style Sheets",import:()=>J(()=>import("./qss-DhMKtDLN.js"),[])},{id:"r",name:"R",import:()=>J(()=>import("./r-CwjWoCRV.js"),[])},{id:"racket",name:"Racket",import:()=>J(()=>import("./racket-CzouJOBO.js"),[])},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>J(()=>import("./raku-B1bQXN8T.js"),[])},{id:"razor",name:"ASP.NET Razor",import:()=>J(()=>import("./razor-CNLDkMZG.js"),__vite__mapDeps([73,1,2,3,74]))},{id:"reg",name:"Windows Registry Script",import:()=>J(()=>import("./reg-5LuOXUq_.js"),[])},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>J(()=>import("./regexp-DWJ3fJO_.js"),[])},{id:"rel",name:"Rel",import:()=>J(()=>import("./rel-DJlmqQ1C.js"),[])},{id:"riscv",name:"RISC-V",import:()=>J(()=>import("./riscv-QhoSD0DR.js"),[])},{id:"rst",name:"reStructuredText",import:()=>J(()=>import("./rst-4NLicBqY.js"),__vite__mapDeps([75,28,1,2,3,21,22,23,24,14,18,26,38,76,32,33,7,8,34,11,35,36,37]))},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>J(()=>import("./ruby-DeZ3UC14.js"),__vite__mapDeps([32,1,2,3,33,7,8,14,34,11,35,36,21,22,23,24,26,37,38]))},{id:"rust",name:"Rust",aliases:["rs"],import:()=>J(()=>import("./rust-Be6lgOlo.js"),[])},{id:"sas",name:"SAS",import:()=>J(()=>import("./sas-BmTFh92c.js"),__vite__mapDeps([77,14]))},{id:"sass",name:"Sass",import:()=>J(()=>import("./sass-BJ4Li9vH.js"),[])},{id:"scala",name:"Scala",import:()=>J(()=>import("./scala-DQVVAn-B.js"),[])},{id:"scheme",name:"Scheme",import:()=>J(()=>import("./scheme-BJGe-b2p.js"),[])},{id:"scss",name:"SCSS",import:()=>J(()=>import("./scss-C31hgJw-.js"),__vite__mapDeps([5,3]))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>J(()=>import("./sdbl-BLhTXw86.js"),[])},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>J(()=>import("./shaderlab-B7qAK45m.js"),__vite__mapDeps([78,79]))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>J(()=>import("./shellscript-atvbtKCR.js"),[])},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>J(()=>import("./shellsession-C_rIy8kc.js"),__vite__mapDeps([80,26]))},{id:"smalltalk",name:"Smalltalk",import:()=>J(()=>import("./smalltalk-DkLiglaE.js"),[])},{id:"solidity",name:"Solidity",import:()=>J(()=>import("./solidity-C1w2a3ep.js"),[])},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>J(()=>import("./soy-C-lX7w71.js"),__vite__mapDeps([81,1,2,3]))},{id:"sparql",name:"SPARQL",import:()=>J(()=>import("./sparql-bYkjHRlG.js"),__vite__mapDeps([82,83]))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>J(()=>import("./splunk-Cf8iN4DR.js"),[])},{id:"sql",name:"SQL",import:()=>J(()=>import("./sql-COK4E0Yg.js"),[])},{id:"ssh-config",name:"SSH Config",import:()=>J(()=>import("./ssh-config-BknIz3MU.js"),[])},{id:"stata",name:"Stata",import:()=>J(()=>import("./stata-DorPZHa4.js"),__vite__mapDeps([84,14]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>J(()=>import("./stylus-BeQkCIfX.js"),[])},{id:"svelte",name:"Svelte",import:()=>J(()=>import("./svelte-MSaWC3Je.js"),__vite__mapDeps([85,2,11,3,12]))},{id:"swift",name:"Swift",import:()=>J(()=>import("./swift-BSxZ-RaX.js"),[])},{id:"system-verilog",name:"SystemVerilog",import:()=>J(()=>import("./system-verilog-C7L56vO4.js"),[])},{id:"systemd",name:"Systemd Units",import:()=>J(()=>import("./systemd-CUnW07Te.js"),[])},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>J(()=>import("./talonscript-C1XDQQGZ.js"),[])},{id:"tasl",name:"Tasl",import:()=>J(()=>import("./tasl-CQjiPCtT.js"),[])},{id:"tcl",name:"Tcl",import:()=>J(()=>import("./tcl-DQ1-QYvQ.js"),[])},{id:"templ",name:"Templ",import:()=>J(()=>import("./templ-dwX3ZSMB.js"),__vite__mapDeps([86,87,2,3]))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>J(()=>import("./terraform-BbSNqyBO.js"),[])},{id:"tex",name:"TeX",import:()=>J(()=>import("./tex-rYs2v40G.js"),__vite__mapDeps([62,60]))},{id:"toml",name:"TOML",import:()=>J(()=>import("./toml-CB2ApiWb.js"),[])},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>J(()=>import("./ts-tags-CipyTH0X.js"),__vite__mapDeps([88,11,3,2,23,24,1,14,7,8]))},{id:"tsv",name:"TSV",import:()=>J(()=>import("./tsv-B_m7g4N7.js"),[])},{id:"tsx",name:"TSX",import:()=>J(()=>import("./tsx-B6W0miNI.js"),[])},{id:"turtle",name:"Turtle",import:()=>J(()=>import("./turtle-BMR_PYu6.js"),[])},{id:"twig",name:"Twig",import:()=>J(()=>import("./twig-NC5TFiHP.js"),__vite__mapDeps([89,3,2,5,70,1,7,8,14,9,18,32,33,34,11,35,36,21,22,23,24,26,37,38]))},{id:"typescript",name:"TypeScript",aliases:["ts"],import:()=>J(()=>import("./typescript-Dj6nwHGl.js"),[])},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>J(()=>import("./typespec-BpWG_bgh.js"),[])},{id:"typst",name:"Typst",aliases:["typ"],import:()=>J(()=>import("./typst-BVUVsWT6.js"),[])},{id:"v",name:"V",import:()=>J(()=>import("./v-CAQ2eGtk.js"),[])},{id:"vala",name:"Vala",import:()=>J(()=>import("./vala-BFOHcciG.js"),[])},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>J(()=>import("./vb-CdO5JTpU.js"),[])},{id:"verilog",name:"Verilog",import:()=>J(()=>import("./verilog-CJaU5se_.js"),[])},{id:"vhdl",name:"VHDL",import:()=>J(()=>import("./vhdl-DYoNaHQp.js"),[])},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>J(()=>import("./viml-m4uW47V2.js"),[])},{id:"vue",name:"Vue",import:()=>J(()=>import("./vue-BuYVFjOK.js"),__vite__mapDeps([90,1,2,3,11,9,28]))},{id:"vue-html",name:"Vue HTML",import:()=>J(()=>import("./vue-html-xdeiXROB.js"),__vite__mapDeps([91,90,1,2,3,11,9,28]))},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>J(()=>import("./vyper-nyqBNV6O.js"),[])},{id:"wasm",name:"WebAssembly",import:()=>J(()=>import("./wasm-C6j12Q_x.js"),[])},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>J(()=>import("./wenyan-7A4Fjokl.js"),[])},{id:"wgsl",name:"WGSL",import:()=>J(()=>import("./wgsl-CB0Krxn9.js"),[])},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>J(()=>import("./wikitext-DCE3LsBG.js"),[])},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>J(()=>import("./wolfram-C3FkfJm5.js"),[])},{id:"xml",name:"XML",import:()=>J(()=>import("./xml-e3z08dGr.js"),__vite__mapDeps([7,8]))},{id:"xsl",name:"XSL",import:()=>J(()=>import("./xsl-Dd0NUgwM.js"),__vite__mapDeps([92,7,8]))},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>J(()=>import("./yaml-CVw76BM1.js"),[])},{id:"zenscript",name:"ZenScript",import:()=>J(()=>import("./zenscript-HnGAYVZD.js"),[])},{id:"zig",name:"Zig",import:()=>J(()=>import("./zig-BVz_zdnA.js"),[])}],wI=Object.fromEntries(Ax.map(e=>[e.id,e.import])),EI=Object.fromEntries(Ax.flatMap(e=>{var r;return((r=e.aliases)==null?void 0:r.map(n=>[n,e.import]))||[]})),xI={...wI,...EI},AI=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>J(()=>import("./andromeeda-C3khCPGq.js"),[])},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>J(()=>import("./aurora-x-D-2ljcwZ.js"),[])},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>J(()=>import("./ayu-dark-Cv9koXgw.js"),[])},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>J(()=>import("./catppuccin-frappe-CD_QflpE.js"),[])},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>J(()=>import("./catppuccin-latte-DRW-0cLl.js"),[])},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>J(()=>import("./catppuccin-macchiato-C-_shW-Y.js"),[])},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>J(()=>import("./catppuccin-mocha-LGGdnPYs.js"),[])},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>J(()=>import("./dark-plus-C3mMm8J8.js"),[])},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>J(()=>import("./dracula-BzJJZx-M.js"),[])},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>J(()=>import("./dracula-soft-BXkSAIEj.js"),[])},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>J(()=>import("./everforest-dark-BgDCqdQA.js"),[])},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>J(()=>import("./everforest-light-C8M2exoo.js"),[])},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>J(()=>import("./github-dark-DHJKELXO.js"),[])},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>J(()=>import("./github-dark-default-Cuk6v7N8.js"),[])},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>J(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[])},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>J(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[])},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>J(()=>import("./github-light-DAi9KRSo.js"),[])},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>J(()=>import("./github-light-default-D7oLnXFd.js"),[])},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>J(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[])},{id:"houston",displayName:"Houston",type:"dark",import:()=>J(()=>import("./houston-DnULxvSX.js"),[])},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>J(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[])},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>J(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[])},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>J(()=>import("./kanagawa-wave-DWedfzmr.js"),[])},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>J(()=>import("./laserwave-DUszq2jm.js"),[])},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>J(()=>import("./light-plus-B7mTdjB0.js"),[])},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>J(()=>import("./material-theme-D5KoaKCx.js"),[])},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>J(()=>import("./material-theme-darker-BfHTSMKl.js"),[])},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>J(()=>import("./material-theme-lighter-B0m2ddpp.js"),[])},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>J(()=>import("./material-theme-ocean-CyktbL80.js"),[])},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>J(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[])},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>J(()=>import("./min-dark-CafNBF8u.js"),[])},{id:"min-light",displayName:"Min Light",type:"light",import:()=>J(()=>import("./min-light-CTRr51gU.js"),[])},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>J(()=>import("./monokai-D4h5O-jR.js"),[])},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>J(()=>import("./night-owl-C39BiMTA.js"),[])},{id:"nord",displayName:"Nord",type:"dark",import:()=>J(()=>import("./nord-Ddv68eIx.js"),[])},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>J(()=>import("./one-dark-pro-GBQ2dnAY.js"),[])},{id:"one-light",displayName:"One Light",type:"light",import:()=>J(()=>import("./one-light-PoHY5YXO.js"),[])},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>J(()=>import("./plastic-3e1v2bzS.js"),[])},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>J(()=>import("./poimandres-CS3Unz2-.js"),[])},{id:"red",displayName:"Red",type:"dark",import:()=>J(()=>import("./red-bN70gL4F.js"),[])},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>J(()=>import("./rose-pine-CmCqftbK.js"),[])},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>J(()=>import("./rose-pine-dawn-Ds-gbosJ.js"),[])},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>J(()=>import("./rose-pine-moon-CjDtw9vr.js"),[])},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>J(()=>import("./slack-dark-BthQWCQV.js"),[])},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>J(()=>import("./slack-ochin-DqwNpetd.js"),[])},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>J(()=>import("./snazzy-light-Bw305WKR.js"),[])},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>J(()=>import("./solarized-dark-DXbdFlpD.js"),[])},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>J(()=>import("./solarized-light-L9t79GZl.js"),[])},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>J(()=>import("./synthwave-84-CbfX1IO0.js"),[])},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>J(()=>import("./tokyo-night-DBQeEorK.js"),[])},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>J(()=>import("./vesper-BEBZ7ncR.js"),[])},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>J(()=>import("./vitesse-black-Bkuqu6BP.js"),[])},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>J(()=>import("./vitesse-dark-D0r3Knsf.js"),[])},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>J(()=>import("./vitesse-light-CVO1_9PV.js"),[])}],TI=Object.fromEntries(AI.map(e=>[e.id,e.import]));let bi=class extends Error{constructor(r){super(r),this.name="ShikiError"}},Ev=class extends Error{constructor(r){super(r),this.name="ShikiError"}};function RI(){return 2147483648}function DI(){return typeof performance<"u"?performance.now():Date.now()}const MI=(e,r)=>e+(r-e%r)%r;async function kI(e){let r,n;const s={};function o(E){n=E,s.HEAPU8=new Uint8Array(E),s.HEAPU32=new Uint32Array(E)}function u(E,A,w){s.HEAPU8.copyWithin(E,A,A+w)}function f(E){try{return r.grow(E-n.byteLength+65535>>>16),o(r.buffer),1}catch{}}function l(E){const A=s.HEAPU8.length;E=E>>>0;const w=RI();if(E>w)return!1;for(let v=1;v<=4;v*=2){let S=A*(1+.2/v);S=Math.min(S,E+100663296);const g=Math.min(w,MI(Math.max(E,S),65536));if(f(g))return!0}return!1}const c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(E,A,w=1024){const v=A+w;let S=A;for(;E[S]&&!(S>=v);)++S;if(S-A>16&&E.buffer&&c)return c.decode(E.subarray(A,S));let g="";for(;A<S;){let y=E[A++];if(!(y&128)){g+=String.fromCharCode(y);continue}const T=E[A++]&63;if((y&224)===192){g+=String.fromCharCode((y&31)<<6|T);continue}const M=E[A++]&63;if((y&240)===224?y=(y&15)<<12|T<<6|M:y=(y&7)<<18|T<<12|M<<6|E[A++]&63,y<65536)g+=String.fromCharCode(y);else{const k=y-65536;g+=String.fromCharCode(55296|k>>10,56320|k&1023)}}return g}function m(E,A){return E?h(s.HEAPU8,E,A):""}const p={emscripten_get_now:DI,emscripten_memcpy_big:u,emscripten_resize_heap:l,fd_write:()=>0};async function _(){const A=await e({env:p,wasi_snapshot_preview1:p});r=A.memory,o(r.buffer),Object.assign(s,A),s.UTF8ToString=m}return await _(),s}var LI=Object.defineProperty,OI=(e,r,n)=>r in e?LI(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,$t=(e,r,n)=>(OI(e,typeof r!="symbol"?r+"":r,n),n);let rr=null;function BI(e){throw new Ev(e.UTF8ToString(e.getLastOnigError()))}class Oh{constructor(r){$t(this,"utf16Length"),$t(this,"utf8Length"),$t(this,"utf16Value"),$t(this,"utf8Value"),$t(this,"utf16OffsetToUtf8"),$t(this,"utf8OffsetToUtf16");const n=r.length,s=Oh._utf8ByteLength(r),o=s!==n,u=o?new Uint32Array(n+1):null;o&&(u[n]=s);const f=o?new Uint32Array(s+1):null;o&&(f[s]=n);const l=new Uint8Array(s);let c=0;for(let h=0;h<n;h++){const m=r.charCodeAt(h);let p=m,_=!1;if(m>=55296&&m<=56319&&h+1<n){const E=r.charCodeAt(h+1);E>=56320&&E<=57343&&(p=(m-55296<<10)+65536|E-56320,_=!0)}o&&(u[h]=c,_&&(u[h+1]=c),p<=127?f[c+0]=h:p<=2047?(f[c+0]=h,f[c+1]=h):p<=65535?(f[c+0]=h,f[c+1]=h,f[c+2]=h):(f[c+0]=h,f[c+1]=h,f[c+2]=h,f[c+3]=h)),p<=127?l[c++]=p:p<=2047?(l[c++]=192|(p&1984)>>>6,l[c++]=128|(p&63)>>>0):p<=65535?(l[c++]=224|(p&61440)>>>12,l[c++]=128|(p&4032)>>>6,l[c++]=128|(p&63)>>>0):(l[c++]=240|(p&1835008)>>>18,l[c++]=128|(p&258048)>>>12,l[c++]=128|(p&4032)>>>6,l[c++]=128|(p&63)>>>0),_&&h++}this.utf16Length=n,this.utf8Length=s,this.utf16Value=r,this.utf8Value=l,this.utf16OffsetToUtf8=u,this.utf8OffsetToUtf16=f}static _utf8ByteLength(r){let n=0;for(let s=0,o=r.length;s<o;s++){const u=r.charCodeAt(s);let f=u,l=!1;if(u>=55296&&u<=56319&&s+1<o){const c=r.charCodeAt(s+1);c>=56320&&c<=57343&&(f=(u-55296<<10)+65536|c-56320,l=!0)}f<=127?n+=1:f<=2047?n+=2:f<=65535?n+=3:n+=4,l&&s++}return n}createString(r){const n=r.omalloc(this.utf8Length);return r.HEAPU8.set(this.utf8Value,n),n}}const On=class{constructor(e){if($t(this,"id",++On.LAST_ID),$t(this,"_onigBinding"),$t(this,"content"),$t(this,"utf16Length"),$t(this,"utf8Length"),$t(this,"utf16OffsetToUtf8"),$t(this,"utf8OffsetToUtf16"),$t(this,"ptr"),!rr)throw new Ev("Must invoke loadWasm first.");this._onigBinding=rr,this.content=e;const r=new Oh(e);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!On._sharedPtrInUse?(On._sharedPtr||(On._sharedPtr=rr.omalloc(1e4)),On._sharedPtrInUse=!0,rr.HEAPU8.set(r.utf8Value,On._sharedPtr),this.ptr=On._sharedPtr):this.ptr=r.createString(rr)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===On._sharedPtr?On._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};let Lc=On;$t(Lc,"LAST_ID",0);$t(Lc,"_sharedPtr",0);$t(Lc,"_sharedPtrInUse",!1);class NI{constructor(r){if($t(this,"_onigBinding"),$t(this,"_ptr"),!rr)throw new Ev("Must invoke loadWasm first.");const n=[],s=[];for(let l=0,c=r.length;l<c;l++){const h=new Oh(r[l]);n[l]=h.createString(rr),s[l]=h.utf8Length}const o=rr.omalloc(4*r.length);rr.HEAPU32.set(n,o/4);const u=rr.omalloc(4*r.length);rr.HEAPU32.set(s,u/4);const f=rr.createOnigScanner(o,u,r.length);for(let l=0,c=r.length;l<c;l++)rr.ofree(n[l]);rr.ofree(u),rr.ofree(o),f===0&&BI(rr),this._onigBinding=rr,this._ptr=f}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(r,n,s){let o=0;if(typeof s=="number"&&(o=s),typeof r=="string"){r=new Lc(r);const u=this._findNextMatchSync(r,n,!1,o);return r.dispose(),u}return this._findNextMatchSync(r,n,!1,o)}_findNextMatchSync(r,n,s,o){const u=this._onigBinding,f=u.findNextOnigScannerMatch(this._ptr,r.id,r.ptr,r.utf8Length,r.convertUtf16OffsetToUtf8(n),o);if(f===0)return null;const l=u.HEAPU32;let c=f/4;const h=l[c++],m=l[c++],p=[];for(let _=0;_<m;_++){const E=r.convertUtf8OffsetToUtf16(l[c++]),A=r.convertUtf8OffsetToUtf16(l[c++]);p[_]={start:E,end:A,length:A-E}}return{index:h,captureIndices:p}}}function II(e){return typeof e.instantiator=="function"}function PI(e){return typeof e.default=="function"}function jI(e){return typeof e.data<"u"}function UI(e){return typeof Response<"u"&&e instanceof Response}function FI(e){var r;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((r=Buffer.isBuffer)==null?void 0:r.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Cd;function HI(e){if(Cd)return Cd;async function r(){rr=await kI(async n=>{let s=e;return s=await s,typeof s=="function"&&(s=await s(n)),typeof s=="function"&&(s=await s(n)),II(s)?s=await s.instantiator(n):PI(s)?s=await s.default(n):(jI(s)&&(s=s.data),UI(s)?typeof WebAssembly.instantiateStreaming=="function"?s=await VI(s)(n):s=await qI(s)(n):FI(s)?s=await Rm(s)(n):s instanceof WebAssembly.Module?s=await Rm(s)(n):"default"in s&&s.default instanceof WebAssembly.Module&&(s=await Rm(s.default)(n))),"instance"in s&&(s=s.instance),"exports"in s&&(s=s.exports),s})}return Cd=r(),Cd}function Rm(e){return r=>WebAssembly.instantiate(e,r)}function VI(e){return r=>WebAssembly.instantiateStreaming(e,r)}function qI(e){return async r=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,r)}}let GI;function zI(){return GI}async function Tx(e){return e&&await HI(e),{createScanner(r){return new NI(r.map(n=>typeof n=="string"?n:n.source))},createString(r){return new Lc(r)}}}function YI(e){return xv(e)}function xv(e){return Array.isArray(e)?WI(e):e instanceof RegExp?e:typeof e=="object"?KI(e):e}function WI(e){let r=[];for(let n=0,s=e.length;n<s;n++)r[n]=xv(e[n]);return r}function KI(e){let r={};for(let n in e)r[n]=xv(e[n]);return r}function Rx(e,...r){return r.forEach(n=>{for(let s in n)e[s]=n[s]}),e}function Dx(e){const r=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return r===0?e:~r===e.length-1?Dx(e.substring(0,e.length-1)):e.substr(~r+1)}var Dm=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,bd=class{static hasCaptures(e){return e===null?!1:(Dm.lastIndex=0,Dm.test(e))}static replaceCaptures(e,r,n){return e.replace(Dm,(s,o,u,f)=>{let l=n[parseInt(o||u,10)];if(l){let c=r.substring(l.start,l.end);for(;c[0]===".";)c=c.substring(1);switch(f){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function Mx(e,r){return e<r?-1:e>r?1:0}function kx(e,r){if(e===null&&r===null)return 0;if(!e)return-1;if(!r)return 1;let n=e.length,s=r.length;if(n===s){for(let o=0;o<n;o++){let u=Mx(e[o],r[o]);if(u!==0)return u}return 0}return n-s}function ZS(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 Lx(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ox=class{constructor(e){_e(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const r=this.fn(e);return this.cache.set(e,r),r}},eh=class{constructor(e,r,n){_e(this,"_cachedMatchRoot",new Ox(e=>this._root.match(e)));this._colorMap=e,this._defaults=r,this._root=n}static createFromRawTheme(e,r){return this.createFromParsedTheme(JI(e),r)}static createFromParsedTheme(e,r){return XI(e,r)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const r=e.scopeName,s=this._cachedMatchRoot.get(r).find(o=>QI(e.parent,o.parentScopes));return s?new Bx(s.fontStyle,s.foreground,s.background):null}},Mm=class Ud{constructor(r,n){this.parent=r,this.scopeName=n}static push(r,n){for(const s of n)r=new Ud(r,s);return r}static from(...r){let n=null;for(let s=0;s<r.length;s++)n=new Ud(n,r[s]);return n}push(r){return new Ud(this,r)}getSegments(){let r=this;const n=[];for(;r;)n.push(r.scopeName),r=r.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(r){return this===r?!0:this.parent===null?!1:this.parent.extends(r)}getExtensionIfDefined(r){const n=[];let s=this;for(;s&&s!==r;)n.push(s.scopeName),s=s.parent;return s===r?n.reverse():void 0}};function QI(e,r){if(r.length===0)return!0;for(let n=0;n<r.length;n++){let s=r[n],o=!1;if(s===">"){if(n===r.length-1)return!1;s=r[++n],o=!0}for(;e&&!$I(e.scopeName,s);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function $I(e,r){return r===e||e.startsWith(r)&&e[r.length]==="."}var Bx=class{constructor(e,r,n){this.fontStyle=e,this.foregroundId=r,this.backgroundId=n}};function JI(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let r=e.settings,n=[],s=0;for(let o=0,u=r.length;o<u;o++){let f=r[o];if(!f.settings)continue;let l;if(typeof f.scope=="string"){let p=f.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),l=p.split(",")}else Array.isArray(f.scope)?l=f.scope:l=[""];let c=-1;if(typeof f.settings.fontStyle=="string"){c=0;let p=f.settings.fontStyle.split(" ");for(let _=0,E=p.length;_<E;_++)switch(p[_]){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 h=null;typeof f.settings.foreground=="string"&&ZS(f.settings.foreground)&&(h=f.settings.foreground);let m=null;typeof f.settings.background=="string"&&ZS(f.settings.background)&&(m=f.settings.background);for(let p=0,_=l.length;p<_;p++){let A=l[p].trim().split(" "),w=A[A.length-1],v=null;A.length>1&&(v=A.slice(0,A.length-1),v.reverse()),n[s++]=new ZI(w,v,o,c,h,m)}}return n}var ZI=class{constructor(e,r,n,s,o,u){this.scope=e,this.parentScopes=r,this.index=n,this.fontStyle=s,this.foreground=o,this.background=u}},Si=(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))(Si||{});function XI(e,r){e.sort((c,h)=>{let m=Mx(c.scope,h.scope);return m!==0||(m=kx(c.parentScopes,h.parentScopes),m!==0)?m:c.index-h.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 e5(r),f=new Bx(n,u.getId(s),u.getId(o)),l=new r5(new vg(0,null,-1,0,0),[]);for(let c=0,h=e.length;c<h;c++){let m=e[c];l.insert(0,m.scope,m.parentScopes,m.fontStyle,u.getId(m.foreground),u.getId(m.background))}return new eh(u,f,l)}var e5=class{constructor(e){_e(this,"_isFrozen");_e(this,"_lastColorId");_e(this,"_id2color");_e(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let r=0,n=e.length;r<n;r++)this._color2id[e[r]]=r,this._id2color[r]=e[r]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let r=this._color2id[e];if(r)return r;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return r=++this._lastColorId,this._color2id[e]=r,this._id2color[r]=e,r}getColorMap(){return this._id2color.slice(0)}},t5=Object.freeze([]),vg=class Nx{constructor(r,n,s,o,u){_e(this,"scopeDepth");_e(this,"parentScopes");_e(this,"fontStyle");_e(this,"foreground");_e(this,"background");this.scopeDepth=r,this.parentScopes=n||t5,this.fontStyle=s,this.foreground=o,this.background=u}clone(){return new Nx(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(r){let n=[];for(let s=0,o=r.length;s<o;s++)n[s]=r[s].clone();return n}acceptOverwrite(r,n,s,o){this.scopeDepth>r?console.log("how did this happen?"):this.scopeDepth=r,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),o!==0&&(this.background=o)}},r5=class _g{constructor(r,n=[],s={}){_e(this,"_rulesWithParentScopes");this._mainRule=r,this._children=s,this._rulesWithParentScopes=n}static _cmpBySpecificity(r,n){if(r.scopeDepth!==n.scopeDepth)return n.scopeDepth-r.scopeDepth;let s=0,o=0;for(;r.parentScopes[s]===">"&&s++,n.parentScopes[o]===">"&&o++,!(s>=r.parentScopes.length||o>=n.parentScopes.length);){const u=n.parentScopes[o].length-r.parentScopes[s].length;if(u!==0)return u;s++,o++}return n.parentScopes.length-r.parentScopes.length}match(r){if(r!==""){let s=r.indexOf("."),o,u;if(s===-1?(o=r,u=""):(o=r.substring(0,s),u=r.substring(s+1)),this._children.hasOwnProperty(o))return this._children[o].match(u)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(_g._cmpBySpecificity),n}insert(r,n,s,o,u,f){if(n===""){this._doInsertHere(r,s,o,u,f);return}let l=n.indexOf("."),c,h;l===-1?(c=n,h=""):(c=n.substring(0,l),h=n.substring(l+1));let m;this._children.hasOwnProperty(c)?m=this._children[c]:(m=new _g(this._mainRule.clone(),vg.cloneArr(this._rulesWithParentScopes)),this._children[c]=m),m.insert(r+1,h,s,o,u,f)}_doInsertHere(r,n,s,o,u){if(n===null){this._mainRule.acceptOverwrite(r,s,o,u);return}for(let f=0,l=this._rulesWithParentScopes.length;f<l;f++){let c=this._rulesWithParentScopes[f];if(kx(c.parentScopes,n)===0){c.acceptOverwrite(r,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 vg(r,n,s,o,u))}},va=class rn{static toBinaryStr(r){return r.toString(2).padStart(32,"0")}static print(r){const n=rn.getLanguageId(r),s=rn.getTokenType(r),o=rn.getFontStyle(r),u=rn.getForeground(r),f=rn.getBackground(r);console.log({languageId:n,tokenType:s,fontStyle:o,foreground:u,background:f})}static getLanguageId(r){return(r&255)>>>0}static getTokenType(r){return(r&768)>>>8}static containsBalancedBrackets(r){return(r&1024)!==0}static getFontStyle(r){return(r&30720)>>>11}static getForeground(r){return(r&16744448)>>>15}static getBackground(r){return(r&4278190080)>>>24}static set(r,n,s,o,u,f,l){let c=rn.getLanguageId(r),h=rn.getTokenType(r),m=rn.containsBalancedBrackets(r)?1:0,p=rn.getFontStyle(r),_=rn.getForeground(r),E=rn.getBackground(r);return n!==0&&(c=n),s!==8&&(h=s),o!==null&&(m=o?1:0),u!==-1&&(p=u),f!==0&&(_=f),l!==0&&(E=l),(c<<0|h<<8|m<<10|p<<11|_<<15|E<<24)>>>0}};function th(e,r){const n=[],s=n5(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 h=f();if(n.push({matcher:h,priority:c}),o!==",")break;o=s.next()}return n;function u(){if(o==="-"){o=s.next();const c=u();return h=>!!c&&!c(h)}if(o==="("){o=s.next();const c=l();return o===")"&&(o=s.next()),c}if(XS(o)){const c=[];do c.push(o),o=s.next();while(XS(o));return h=>r(c,h)}return null}function f(){const c=[];let h=u();for(;h;)c.push(h),h=u();return m=>c.every(p=>p(m))}function l(){const c=[];let h=f();for(;h&&(c.push(h),o==="|"||o===",");){do o=s.next();while(o==="|"||o===",");h=f()}return m=>c.some(p=>p(m))}}function XS(e){return!!e&&!!e.match(/[\w\.:]+/)}function n5(e){let r=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=r.exec(e);return{next:()=>{if(!n)return null;const s=n[0];return n=r.exec(e),s}}}function Ix(e){typeof e.dispose=="function"&&e.dispose()}var uc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},i5=class{constructor(e,r){this.scopeName=e,this.ruleName=r}toKey(){return`${this.scopeName}#${this.ruleName}`}},s5=class{constructor(){_e(this,"_references",[]);_e(this,"_seenReferenceKeys",new Set);_e(this,"visitedRule",new Set)}get references(){return this._references}add(e){const r=e.toKey();this._seenReferenceKeys.has(r)||(this._seenReferenceKeys.add(r),this._references.push(e))}},o5=class{constructor(e,r){_e(this,"seenFullScopeRequests",new Set);_e(this,"seenPartialScopeRequests",new Set);_e(this,"Q");this.repo=e,this.initialScopeName=r,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new uc(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const r=new s5;for(const n of e)a5(n,this.initialScopeName,this.repo,r);for(const n of r.references)if(n instanceof uc){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 a5(e,r,n,s){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===r)throw new Error(`No grammar provided for <${r}>`);return}const u=n.lookup(r);e instanceof uc?Fd({baseGrammar:u,selfGrammar:o},s):yg(e.ruleName,{baseGrammar:u,selfGrammar:o,repository:o.repository},s);const f=n.injections(e.scopeName);if(f)for(const l of f)s.add(new uc(l))}function yg(e,r,n){if(r.repository&&r.repository[e]){const s=r.repository[e];rh([s],r,n)}}function Fd(e,r){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&rh(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},r),e.selfGrammar.injections&&rh(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},r)}function rh(e,r,n){for(const s of e){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const o=s.repository?Rx({},r.repository,s.repository):r.repository;Array.isArray(s.patterns)&&rh(s.patterns,{...r,repository:o},n);const u=s.include;if(!u)continue;const f=Px(u);switch(f.kind){case 0:Fd({...r,selfGrammar:r.baseGrammar},n);break;case 1:Fd(r,n);break;case 2:yg(f.ruleName,{...r,repository:o},n);break;case 3:case 4:const l=f.scopeName===r.selfGrammar.scopeName?r.selfGrammar:f.scopeName===r.baseGrammar.scopeName?r.baseGrammar:void 0;if(l){const c={baseGrammar:r.baseGrammar,selfGrammar:l,repository:o};f.kind===4?yg(f.ruleName,c,n):Fd(c,n)}else f.kind===4?n.add(new i5(f.scopeName,f.ruleName)):n.add(new uc(f.scopeName));break}}}var l5=class{constructor(){_e(this,"kind",0)}},c5=class{constructor(){_e(this,"kind",1)}},u5=class{constructor(e){_e(this,"kind",2);this.ruleName=e}},d5=class{constructor(e){_e(this,"kind",3);this.scopeName=e}},h5=class{constructor(e,r){_e(this,"kind",4);this.scopeName=e,this.ruleName=r}};function Px(e){if(e==="$base")return new l5;if(e==="$self")return new c5;const r=e.indexOf("#");if(r===-1)return new d5(e);if(r===0)return new u5(e.substring(1));{const n=e.substring(0,r),s=e.substring(r+1);return new h5(n,s)}}var f5=/\\(\d+)/,eC=/\\(\d+)/g,p5=-1,jx=-2;var Oc=class{constructor(e,r,n,s){_e(this,"$location");_e(this,"id");_e(this,"_nameIsCapturing");_e(this,"_name");_e(this,"_contentNameIsCapturing");_e(this,"_contentName");this.$location=e,this.id=r,this._name=n||null,this._nameIsCapturing=bd.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=bd.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Dx(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,r){return!this._nameIsCapturing||this._name===null||e===null||r===null?this._name:bd.replaceCaptures(this._name,e,r)}getContentName(e,r){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:bd.replaceCaptures(this._contentName,e,r)}},m5=class extends Oc{constructor(r,n,s,o,u){super(r,n,s,o);_e(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=u}dispose(){}collectPatterns(r,n){throw new Error("Not supported!")}compile(r,n){throw new Error("Not supported!")}compileAG(r,n,s,o){throw new Error("Not supported!")}},g5=class extends Oc{constructor(r,n,s,o,u){super(r,n,s,null);_e(this,"_match");_e(this,"captures");_e(this,"_cachedCompiledPatterns");this._match=new dc(o,this.id),this.captures=u,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(r,n){n.push(this._match)}compile(r,n){return this._getCachedCompiledPatterns(r).compile(r)}compileAG(r,n,s,o){return this._getCachedCompiledPatterns(r).compileAG(r,s,o)}_getCachedCompiledPatterns(r){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new hc,this.collectPatterns(r,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tC=class extends Oc{constructor(r,n,s,o,u){super(r,n,s,o);_e(this,"hasMissingPatterns");_e(this,"patterns");_e(this,"_cachedCompiledPatterns");this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(r,n){for(const s of this.patterns)r.getRule(s).collectPatterns(r,n)}compile(r,n){return this._getCachedCompiledPatterns(r).compile(r)}compileAG(r,n,s,o){return this._getCachedCompiledPatterns(r).compileAG(r,s,o)}_getCachedCompiledPatterns(r){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new hc,this.collectPatterns(r,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Sg=class extends Oc{constructor(r,n,s,o,u,f,l,c,h,m){super(r,n,s,o);_e(this,"_begin");_e(this,"beginCaptures");_e(this,"_end");_e(this,"endHasBackReferences");_e(this,"endCaptures");_e(this,"applyEndPatternLast");_e(this,"hasMissingPatterns");_e(this,"patterns");_e(this,"_cachedCompiledPatterns");this._begin=new dc(u,this.id),this.beginCaptures=f,this._end=new dc(l||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=h||!1,this.patterns=m.patterns,this.hasMissingPatterns=m.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(r,n){return this._end.resolveBackReferences(r,n)}collectPatterns(r,n){n.push(this._begin)}compile(r,n){return this._getCachedCompiledPatterns(r,n).compile(r)}compileAG(r,n,s,o){return this._getCachedCompiledPatterns(r,n).compileAG(r,s,o)}_getCachedCompiledPatterns(r,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new hc;for(const s of this.patterns)r.getRule(s).collectPatterns(r,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,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},nh=class extends Oc{constructor(r,n,s,o,u,f,l,c,h){super(r,n,s,o);_e(this,"_begin");_e(this,"beginCaptures");_e(this,"whileCaptures");_e(this,"_while");_e(this,"whileHasBackReferences");_e(this,"hasMissingPatterns");_e(this,"patterns");_e(this,"_cachedCompiledPatterns");_e(this,"_cachedCompiledWhilePatterns");this._begin=new dc(u,this.id),this.beginCaptures=f,this.whileCaptures=c,this._while=new dc(l,jx),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=h.patterns,this.hasMissingPatterns=h.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(r,n){return this._while.resolveBackReferences(r,n)}collectPatterns(r,n){n.push(this._begin)}compile(r,n){return this._getCachedCompiledPatterns(r).compile(r)}compileAG(r,n,s,o){return this._getCachedCompiledPatterns(r).compileAG(r,s,o)}_getCachedCompiledPatterns(r){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new hc;for(const n of this.patterns)r.getRule(n).collectPatterns(r,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(r,n){return this._getCachedCompiledWhilePatterns(r,n).compile(r)}compileWhileAG(r,n,s,o){return this._getCachedCompiledWhilePatterns(r,n).compileAG(r,s,o)}_getCachedCompiledWhilePatterns(r,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new hc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},Ux=class hr{static createCaptureRule(r,n,s,o,u){return r.registerRule(f=>new m5(n,f,s,o,u))}static getCompiledRuleId(r,n,s){return r.id||n.registerRule(o=>{if(r.id=o,r.match)return new g5(r.$vscodeTextmateLocation,r.id,r.name,r.match,hr._compileCaptures(r.captures,n,s));if(typeof r.begin>"u"){r.repository&&(s=Rx({},s,r.repository));let u=r.patterns;return typeof u>"u"&&r.include&&(u=[{include:r.include}]),new tC(r.$vscodeTextmateLocation,r.id,r.name,r.contentName,hr._compilePatterns(u,n,s))}return r.while?new nh(r.$vscodeTextmateLocation,r.id,r.name,r.contentName,r.begin,hr._compileCaptures(r.beginCaptures||r.captures,n,s),r.while,hr._compileCaptures(r.whileCaptures||r.captures,n,s),hr._compilePatterns(r.patterns,n,s)):new Sg(r.$vscodeTextmateLocation,r.id,r.name,r.contentName,r.begin,hr._compileCaptures(r.beginCaptures||r.captures,n,s),r.end,hr._compileCaptures(r.endCaptures||r.captures,n,s),r.applyEndPatternLast,hr._compilePatterns(r.patterns,n,s))}),r.id}static _compileCaptures(r,n,s){let o=[];if(r){let u=0;for(const f in r){if(f==="$vscodeTextmateLocation")continue;const l=parseInt(f,10);l>u&&(u=l)}for(let f=0;f<=u;f++)o[f]=null;for(const f in r){if(f==="$vscodeTextmateLocation")continue;const l=parseInt(f,10);let c=0;r[f].patterns&&(c=hr.getCompiledRuleId(r[f],n,s)),o[l]=hr.createCaptureRule(n,r[f].$vscodeTextmateLocation,r[f].name,r[f].contentName,c)}}return o}static _compilePatterns(r,n,s){let o=[];if(r)for(let u=0,f=r.length;u<f;u++){const l=r[u];let c=-1;if(l.include){const h=Px(l.include);switch(h.kind){case 0:case 1:c=hr.getCompiledRuleId(s[l.include],n,s);break;case 2:let m=s[h.ruleName];m&&(c=hr.getCompiledRuleId(m,n,s));break;case 3:case 4:const p=h.scopeName,_=h.kind===4?h.ruleName:null,E=n.getExternalGrammar(p,s);if(E)if(_){let A=E.repository[_];A&&(c=hr.getCompiledRuleId(A,n,E.repository))}else c=hr.getCompiledRuleId(E.repository.$self,n,E.repository);break}}else c=hr.getCompiledRuleId(l,n,s);if(c!==-1){const h=n.getRule(c);let m=!1;if((h instanceof tC||h instanceof Sg||h instanceof nh)&&h.hasMissingPatterns&&h.patterns.length===0&&(m=!0),m)continue;o.push(c)}}return{patterns:o,hasMissingPatterns:(r?r.length:0)!==o.length}}},dc=class Fx{constructor(r,n){_e(this,"source");_e(this,"ruleId");_e(this,"hasAnchor");_e(this,"hasBackReferences");_e(this,"_anchorCache");if(r&&typeof r=="string"){const s=r.length;let o=0,u=[],f=!1;for(let l=0;l<s;l++)if(r.charAt(l)==="\\"&&l+1<s){const h=r.charAt(l+1);h==="z"?(u.push(r.substring(o,l)),u.push("$(?!\\n)(?<!\\n)"),o=l+2):(h==="A"||h==="G")&&(f=!0),l++}this.hasAnchor=f,o===0?this.source=r:(u.push(r.substring(o,s)),this.source=u.join(""))}else this.hasAnchor=!1,this.source=r;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=f5.test(this.source):this.hasBackReferences=!1}clone(){return new Fx(this.source,this.ruleId)}setSource(r){this.source!==r&&(this.source=r,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(r,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=>r.substring(o.start,o.end));return eC.lastIndex=0,this.source.replace(eC,(o,u)=>Lx(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 r=[],n=[],s=[],o=[],u,f,l,c;for(u=0,f=this.source.length;u<f;u++)l=this.source.charAt(u),r[u]=l,n[u]=l,s[u]=l,o[u]=l,l==="\\"&&u+1<f&&(c=this.source.charAt(u+1),c==="A"?(r[u+1]="￿",n[u+1]="￿",s[u+1]="A",o[u+1]="A"):c==="G"?(r[u+1]="￿",n[u+1]="G",s[u+1]="￿",o[u+1]="G"):(r[u+1]=c,n[u+1]=c,s[u+1]=c,o[u+1]=c),u++);return{A0_G0:r.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:o.join("")}}resolveAnchors(r,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:r?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},hc=class{constructor(){_e(this,"_items");_e(this,"_hasAnchors");_e(this,"_cached");_e(this,"_anchorCache");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,r){this._items[e].source!==r&&(this._disposeCaches(),this._items[e].setSource(r))}compile(e){if(!this._cached){let r=this._items.map(n=>n.source);this._cached=new rC(e,r,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,r,n){return this._hasAnchors?r?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,r,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,r,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,r,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,r,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,r,n){let s=this._items.map(o=>o.resolveAnchors(r,n));return new rC(e,s,this._items.map(o=>o.ruleId))}},rC=class{constructor(e,r,n){_e(this,"scanner");this.regExps=r,this.rules=n,this.scanner=e.createOnigScanner(r)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let r=0,n=this.rules.length;r<n;r++)e.push(" - "+this.rules[r]+": "+this.regExps[r]);return e.join(`
381
+ `)}findNextMatchSync(e,r,n){const s=this.scanner.findNextMatchSync(e,r,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},km=class{constructor(e,r){this.languageId=e,this.tokenType=r}},yi,v5=(yi=class{constructor(r,n){_e(this,"_defaultAttributes");_e(this,"_embeddedLanguagesMatcher");_e(this,"_getBasicScopeAttributes",new Ox(r=>{const n=this._scopeToLanguage(r),s=this._toStandardTokenType(r);return new km(n,s)}));this._defaultAttributes=new km(r,8),this._embeddedLanguagesMatcher=new _5(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(r){return r===null?yi._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(r)}_scopeToLanguage(r){return this._embeddedLanguagesMatcher.match(r)||0}_toStandardTokenType(r){const n=r.match(yi.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!")}},_e(yi,"_NULL_SCOPE_METADATA",new km(0,0)),_e(yi,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),yi),_5=class{constructor(e){_e(this,"values");_e(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const r=e.map(([n,s])=>Lx(n));r.sort(),r.reverse(),this.scopesRegExp=new RegExp(`^((${r.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const r=e.match(this.scopesRegExp);if(r)return this.values.get(r[1])}},nC=class{constructor(e,r){this.stack=e,this.stoppedEarly=r}};function Hx(e,r,n,s,o,u,f,l){const c=r.content.length;let h=!1,m=-1;if(f){const E=y5(e,r,n,s,o,u);o=E.stack,s=E.linePos,n=E.isFirstLine,m=E.anchorPosition}const p=Date.now();for(;!h;){if(l!==0&&Date.now()-p>l)return new nC(o,!0);_()}return new nC(o,!1);function _(){const E=S5(e,r,n,s,o,m);if(!E){u.produce(o,c),h=!0;return}const A=E.captureIndices,w=E.matchedRuleId,v=A&&A.length>0?A[0].end>s:!1;if(w===p5){const S=o.getRule(e);u.produce(o,A[0].start),o=o.withContentNameScopesList(o.nameScopesList),Wl(e,r,n,o,u,S.endCaptures,A),u.produce(o,A[0].end);const g=o;if(o=o.parent,m=g.getAnchorPos(),!v&&g.getEnterPos()===s){o=g,u.produce(o,c),h=!0;return}}else{const S=e.getRule(w);u.produce(o,A[0].start);const g=o,y=S.getName(r.content,A),T=o.contentNameScopesList.pushAttributed(y,e);if(o=o.push(w,s,m,A[0].end===c,null,T,T),S instanceof Sg){const M=S;Wl(e,r,n,o,u,M.beginCaptures,A),u.produce(o,A[0].end),m=A[0].end;const k=M.getContentName(r.content,A),L=T.pushAttributed(k,e);if(o=o.withContentNameScopesList(L),M.endHasBackReferences&&(o=o.withEndRule(M.getEndWithResolvedBackReferences(r.content,A))),!v&&g.hasSameRuleAs(o)){o=o.pop(),u.produce(o,c),h=!0;return}}else if(S instanceof nh){const M=S;Wl(e,r,n,o,u,M.beginCaptures,A),u.produce(o,A[0].end),m=A[0].end;const k=M.getContentName(r.content,A),L=T.pushAttributed(k,e);if(o=o.withContentNameScopesList(L),M.whileHasBackReferences&&(o=o.withEndRule(M.getWhileWithResolvedBackReferences(r.content,A))),!v&&g.hasSameRuleAs(o)){o=o.pop(),u.produce(o,c),h=!0;return}}else if(Wl(e,r,n,o,u,S.captures,A),u.produce(o,A[0].end),o=o.pop(),!v){o=o.safePop(),u.produce(o,c),h=!0;return}}A[0].end>s&&(s=A[0].end,n=!1)}}function y5(e,r,n,s,o,u){let f=o.beginRuleCapturedEOL?0:-1;const l=[];for(let c=o;c;c=c.pop()){const h=c.getRule(e);h instanceof nh&&l.push({rule:h,stack:c})}for(let c=l.pop();c;c=l.pop()){const{ruleScanner:h,findOptions:m}=w5(c.rule,e,c.stack.endRule,n,s===f),p=h.findNextMatchSync(r,s,m);if(p){if(p.ruleId!==jx){o=c.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(u.produce(c.stack,p.captureIndices[0].start),Wl(e,r,n,c.stack,u,c.rule.whileCaptures,p.captureIndices),u.produce(c.stack,p.captureIndices[0].end),f=p.captureIndices[0].end,p.captureIndices[0].end>s&&(s=p.captureIndices[0].end,n=!1))}else{o=c.stack.pop();break}}return{stack:o,linePos:s,anchorPosition:f,isFirstLine:n}}function S5(e,r,n,s,o,u){const f=C5(e,r,n,s,o,u),l=e.getInjections();if(l.length===0)return f;const c=b5(l,e,r,n,s,o,u);if(!c)return f;if(!f)return c;const h=f.captureIndices[0].start,m=c.captureIndices[0].start;return m<h||c.priorityMatch&&m===h?c:f}function C5(e,r,n,s,o,u){const f=o.getRule(e),{ruleScanner:l,findOptions:c}=Vx(f,e,o.endRule,n,s===u),h=l.findNextMatchSync(r,s,c);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function b5(e,r,n,s,o,u,f){let l=Number.MAX_VALUE,c=null,h,m=0;const p=u.contentNameScopesList.getScopeNames();for(let _=0,E=e.length;_<E;_++){const A=e[_];if(!A.matcher(p))continue;const w=r.getRule(A.ruleId),{ruleScanner:v,findOptions:S}=Vx(w,r,null,s,o===f),g=v.findNextMatchSync(n,o,S);if(!g)continue;const y=g.captureIndices[0].start;if(!(y>=l)&&(l=y,c=g.captureIndices,h=g.ruleId,m=A.priority,l===o))break}return c?{priorityMatch:m===-1,captureIndices:c,matchedRuleId:h}:null}function Vx(e,r,n,s,o){return{ruleScanner:e.compileAG(r,n,s,o),findOptions:0}}function w5(e,r,n,s,o){return{ruleScanner:e.compileWhileAG(r,n,s,o),findOptions:0}}function Wl(e,r,n,s,o,u,f){if(u.length===0)return;const l=r.content,c=Math.min(u.length,f.length),h=[],m=f[0].end;for(let p=0;p<c;p++){const _=u[p];if(_===null)continue;const E=f[p];if(E.length===0)continue;if(E.start>m)break;for(;h.length>0&&h[h.length-1].endPos<=E.start;)o.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?o.produceFromScopes(h[h.length-1].scopes,E.start):o.produce(s,E.start),_.retokenizeCapturedWithRuleId){const w=_.getName(l,f),v=s.contentNameScopesList.pushAttributed(w,e),S=_.getContentName(l,f),g=v.pushAttributed(S,e),y=s.push(_.retokenizeCapturedWithRuleId,E.start,-1,!1,null,v,g),T=e.createOnigString(l.substring(0,E.end));Hx(e,T,n&&E.start===0,E.start,y,o,!1,0),Ix(T);continue}const A=_.getName(l,f);if(A!==null){const v=(h.length>0?h[h.length-1].scopes:s.contentNameScopesList).pushAttributed(A,e);h.push(new E5(v,E.end))}}for(;h.length>0;)o.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var E5=class{constructor(e,r){_e(this,"scopes");_e(this,"endPos");this.scopes=e,this.endPos=r}};function x5(e,r,n,s,o,u,f,l){return new T5(e,r,n,s,o,u,f,l)}function iC(e,r,n,s,o){const u=th(r,ih),f=Ux.getCompiledRuleId(n,s,o.repository);for(const l of u)e.push({debugSelector:r,matcher:l.matcher,ruleId:f,grammar:o,priority:l.priority})}function ih(e,r){if(r.length<e.length)return!1;let n=0;return e.every(s=>{for(let o=n;o<r.length;o++)if(A5(r[o],s))return n=o+1,!0;return!1})}function A5(e,r){if(!e)return!1;if(e===r)return!0;const n=r.length;return e.length>n&&e.substr(0,n)===r&&e[n]==="."}var T5=class{constructor(e,r,n,s,o,u,f,l){_e(this,"_rootId");_e(this,"_lastRuleId");_e(this,"_ruleId2desc");_e(this,"_includedGrammars");_e(this,"_grammarRepository");_e(this,"_grammar");_e(this,"_injections");_e(this,"_basicScopeAttributesProvider");_e(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=u,this._onigLib=l,this._basicScopeAttributesProvider=new v5(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=f,this._grammar=sC(r,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const c of Object.keys(o)){const h=th(c,ih);for(const m of h)this._tokenTypeMatchers.push({matcher:m.matcher,type:o[c]})}}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)},r=[],n=this._rootScopeName,s=e.lookup(n);if(s){const o=s.injections;if(o)for(let f in o)iC(r,f,o[f],this,s);const u=this._grammarRepository.injections(n);u&&u.forEach(f=>{const l=this.getExternalGrammar(f);if(l){const c=l.injectionSelector;c&&iC(r,c,l,this,l)}})}return r.sort((o,u)=>o.priority-u.priority),r}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const r=++this._lastRuleId,n=e(r);return this._ruleId2desc[r]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,r){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=sC(n,r&&r.$base),this._includedGrammars[e]}}tokenizeLine(e,r,n=0){const s=this._tokenize(e,r,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(e,r,n=0){const s=this._tokenize(e,r,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(e,r,n,s){this._rootId===-1&&(this._rootId=Ux.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!r||r===Cg.NULL){o=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),m=this.themeProvider.getDefaults(),p=va.set(0,h.languageId,h.tokenType,null,m.fontStyle,m.foregroundId,m.backgroundId),_=this.getRule(this._rootId).getName(null,null);let E;_?E=Kl.createRootAndLookUpScopeName(_,p,this):E=Kl.createRoot("unknown",p),r=new Cg(null,this._rootId,-1,-1,!1,null,E,E)}else o=!1,r.reset();e=e+`
382
+ `;const u=this.createOnigString(e),f=u.content.length,l=new D5(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Hx(this,u,o,0,r,l,!0,s);return Ix(u),{lineLength:f,lineTokens:l,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function sC(e,r){return e=YI(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=r||e.repository.$self,e}var Kl=class Bn{constructor(r,n,s){this.parent=r,this.scopePath=n,this.tokenAttributes=s}static fromExtension(r,n){let s=r,o=(r==null?void 0:r.scopePath)??null;for(const u of n)o=Mm.push(o,u.scopeNames),s=new Bn(s,o,u.encodedTokenAttributes);return s}static createRoot(r,n){return new Bn(null,new Mm(null,r),n)}static createRootAndLookUpScopeName(r,n,s){const o=s.getMetadataForScope(r),u=new Mm(null,r),f=s.themeProvider.themeMatch(u),l=Bn.mergeAttributes(n,o,f);return new Bn(null,u,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(r){return Bn.equals(this,r)}static equals(r,n){do{if(r===n||!r&&!n)return!0;if(!r||!n||r.scopeName!==n.scopeName||r.tokenAttributes!==n.tokenAttributes)return!1;r=r.parent,n=n.parent}while(!0)}static mergeAttributes(r,n,s){let o=-1,u=0,f=0;return s!==null&&(o=s.fontStyle,u=s.foregroundId,f=s.backgroundId),va.set(r,n.languageId,n.tokenType,null,o,u,f)}pushAttributed(r,n){if(r===null)return this;if(r.indexOf(" ")===-1)return Bn._pushAttributed(this,r,n);const s=r.split(/ /g);let o=this;for(const u of s)o=Bn._pushAttributed(o,u,n);return o}static _pushAttributed(r,n,s){const o=s.getMetadataForScope(n),u=r.scopePath.push(n),f=s.themeProvider.themeMatch(u),l=Bn.mergeAttributes(r.tokenAttributes,o,f);return new Bn(r,u,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(r){var o;const n=[];let s=this;for(;s&&s!==r;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(((o=s.parent)==null?void 0:o.scopePath)??null)}),s=s.parent;return s===r?n.reverse():void 0}},sn,Cg=(sn=class{constructor(r,n,s,o,u,f,l,c){_e(this,"_stackElementBrand");_e(this,"_enterPos");_e(this,"_anchorPos");_e(this,"depth");this.parent=r,this.ruleId=n,this.beginRuleCapturedEOL=u,this.endRule=f,this.nameScopesList=l,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=o}equals(r){return r===null?!1:sn._equals(this,r)}static _equals(r,n){return r===n?!0:this._structuralEquals(r,n)?Kl.equals(r.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(r,n){do{if(r===n||!r&&!n)return!0;if(!r||!n||r.depth!==n.depth||r.ruleId!==n.ruleId||r.endRule!==n.endRule)return!1;r=r.parent,n=n.parent}while(!0)}clone(){return this}static _reset(r){for(;r;)r._enterPos=-1,r._anchorPos=-1,r=r.parent}reset(){sn._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(r,n,s,o,u,f,l){return new sn(this,r,n,s,o,u,f,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(r){return r.getRule(this.ruleId)}toString(){const r=[];return this._writeString(r,0),"["+r.join(",")+"]"}_writeString(r,n){var s,o;return this.parent&&(n=this.parent._writeString(r,n)),r[n++]=`(${this.ruleId}, ${(s=this.nameScopesList)==null?void 0:s.toString()}, ${(o=this.contentNameScopesList)==null?void 0:o.toString()})`,n}withContentNameScopesList(r){return this.contentNameScopesList===r?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,r)}withEndRule(r){return this.endRule===r?this:new sn(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,r,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(r){let n=this;for(;n&&n._enterPos===r._enterPos;){if(n.ruleId===r.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var r,n,s;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((r=this.parent)==null?void 0:r.nameScopesList)??null))??[],contentNameScopesList:((s=this.contentNameScopesList)==null?void 0:s.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(r,n){const s=Kl.fromExtension((r==null?void 0:r.nameScopesList)??null,n.nameScopesList);return new sn(r,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,Kl.fromExtension(s,n.contentNameScopesList))}},_e(sn,"NULL",new sn(null,0,0,0,!1,null,null,null)),sn),R5=class{constructor(e,r){_e(this,"balancedBracketScopes");_e(this,"unbalancedBracketScopes");_e(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):th(n,ih).map(s=>s.matcher)),this.unbalancedBracketScopes=r.flatMap(n=>th(n,ih).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 r of this.unbalancedBracketScopes)if(r(e))return!1;for(const r of this.balancedBracketScopes)if(r(e))return!0;return this.allowAny}},D5=class{constructor(e,r,n,s){_e(this,"_emitBinaryTokens");_e(this,"_lineText");_e(this,"_tokens");_e(this,"_binaryTokens");_e(this,"_lastTokenEndIndex");_e(this,"_tokenTypeOverrides");this.balancedBracketSelectors=s,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,r){this.produceFromScopes(e.contentNameScopesList,r)}produceFromScopes(e,r){var s;if(this._lastTokenEndIndex>=r)return;if(this._emitBinaryTokens){let o=(e==null?void 0:e.tokenAttributes)??0,u=!1;if((s=this.balancedBracketSelectors)!=null&&s.matchesAlways&&(u=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const f=(e==null?void 0:e.getScopeNames())??[];for(const l of this._tokenTypeOverrides)l.matcher(f)&&(o=va.set(o,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(u=this.balancedBracketSelectors.match(f))}if(u&&(o=va.set(o,0,8,u,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===o){this._lastTokenEndIndex=r;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(o),this._lastTokenEndIndex=r;return}const n=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:r,scopes:n}),this._lastTokenEndIndex=r}getResult(e,r){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===r-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,r),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,r){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===r-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,r),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}},M5=class{constructor(e,r){_e(this,"_grammars",new Map);_e(this,"_rawGrammars",new Map);_e(this,"_injectionGrammars",new Map);_e(this,"_theme");this._onigLib=r,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,r){this._rawGrammars.set(e.scopeName,e),r&&this._injectionGrammars.set(e.scopeName,r)}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,r,n,s,o){if(!this._grammars.has(e)){let u=this._rawGrammars.get(e);if(!u)return null;this._grammars.set(e,x5(e,u,r,n,s,o,this,this._onigLib))}return this._grammars.get(e)}},k5=class{constructor(r){_e(this,"_options");_e(this,"_syncRegistry");_e(this,"_ensureGrammarCache");this._options=r,this._syncRegistry=new M5(eh.createFromRawTheme(r.theme,r.colorMap),r.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(r,n){this._syncRegistry.setTheme(eh.createFromRawTheme(r,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(r,n,s){return this.loadGrammarWithConfiguration(r,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(r,n,s){return this._loadGrammar(r,n,s.embeddedLanguages,s.tokenTypes,new R5(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(r){return this._loadGrammar(r,0,null,null,null)}_loadGrammar(r,n,s,o,u){const f=new o5(this._syncRegistry,r);for(;f.Q.length>0;)f.Q.map(l=>this._loadSingleGrammar(l.scopeName)),f.processQueue();return this._grammarForScopeName(r,n,s,o,u)}_loadSingleGrammar(r){this._ensureGrammarCache.has(r)||(this._doLoadSingleGrammar(r),this._ensureGrammarCache.set(r,!0))}_doLoadSingleGrammar(r){const n=this._options.loadGrammar(r);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(r):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(r,n=[],s=0,o=null){return this._syncRegistry.addGrammar(r,n),this._grammarForScopeName(r.scopeName,s,o)}_grammarForScopeName(r,n=0,s=null,o=null,u=null){return this._syncRegistry.grammarForScopeName(r,n,s,o,u)}},bg=Cg.NULL;const L5=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Bc{constructor(r,n,s){this.normal=n,this.property=r,s&&(this.space=s)}}Bc.prototype.normal={};Bc.prototype.property={};Bc.prototype.space=void 0;function qx(e,r){const n={},s={};for(const o of e)Object.assign(n,o.property),Object.assign(s,o.normal);return new Bc(n,s,r)}function wg(e){return e.toLowerCase()}class Lr{constructor(r,n){this.attribute=n,this.property=r}}Lr.prototype.attribute="";Lr.prototype.booleanish=!1;Lr.prototype.boolean=!1;Lr.prototype.commaOrSpaceSeparated=!1;Lr.prototype.commaSeparated=!1;Lr.prototype.defined=!1;Lr.prototype.mustUseProperty=!1;Lr.prototype.number=!1;Lr.prototype.overloadedBoolean=!1;Lr.prototype.property="";Lr.prototype.spaceSeparated=!1;Lr.prototype.space=void 0;let O5=0;const We=fo(),Wt=fo(),Eg=fo(),Ae=fo(),bt=fo(),fa=fo(),Hr=fo();function fo(){return 2**++O5}const xg=Object.freeze(Object.defineProperty({__proto__:null,boolean:We,booleanish:Wt,commaOrSpaceSeparated:Hr,commaSeparated:fa,number:Ae,overloadedBoolean:Eg,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),Lm=Object.keys(xg);class Av extends Lr{constructor(r,n,s,o){let u=-1;if(super(r,n),oC(this,"space",o),typeof s=="number")for(;++u<Lm.length;){const f=Lm[u];oC(this,Lm[u],(s&xg[f])===xg[f])}}}Av.prototype.defined=!0;function oC(e,r,n){n&&(e[r]=n)}function Aa(e){const r={},n={};for(const[s,o]of Object.entries(e.properties)){const u=new Av(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),r[s]=u,n[wg(s)]=s,n[wg(u.attribute)]=s}return new Bc(r,n,e.space)}const Gx=Aa({properties:{ariaActiveDescendant:null,ariaAtomic:Wt,ariaAutoComplete:null,ariaBusy:Wt,ariaChecked:Wt,ariaColCount:Ae,ariaColIndex:Ae,ariaColSpan:Ae,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:Wt,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:Wt,ariaFlowTo:bt,ariaGrabbed:Wt,ariaHasPopup:null,ariaHidden:Wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:Ae,ariaLive:null,ariaModal:Wt,ariaMultiLine:Wt,ariaMultiSelectable:Wt,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:Ae,ariaPressed:Wt,ariaReadOnly:Wt,ariaRelevant:null,ariaRequired:Wt,ariaRoleDescription:bt,ariaRowCount:Ae,ariaRowIndex:Ae,ariaRowSpan:Ae,ariaSelected:Wt,ariaSetSize:Ae,ariaSort:null,ariaValueMax:Ae,ariaValueMin:Ae,ariaValueNow:Ae,ariaValueText:null,role:null},transform(e,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function zx(e,r){return r in e?e[r]:r}function Yx(e,r){return zx(e,r.toLowerCase())}const B5=Aa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fa,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:We,allowPaymentRequest:We,allowUserMedia:We,alt:null,as:null,async:We,autoCapitalize:null,autoComplete:bt,autoFocus:We,autoPlay:We,blocking:bt,capture:null,charSet:null,checked:We,cite:null,className:bt,cols:Ae,colSpan:null,content:null,contentEditable:Wt,controls:We,controlsList:bt,coords:Ae|fa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:We,defer:We,dir:null,dirName:null,disabled:We,download:Eg,draggable:Wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:We,formTarget:null,headers:bt,height:Ae,hidden:Eg,high:Ae,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inert:We,inputMode:null,integrity:null,is:null,isMap:We,itemId:null,itemProp:bt,itemRef:bt,itemScope:We,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:We,low:Ae,manifest:null,max:null,maxLength:Ae,media:null,method:null,min:null,minLength:Ae,multiple:We,muted:We,name:null,nonce:null,noModule:We,noValidate:We,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:We,optimum:Ae,pattern:null,ping:bt,placeholder:null,playsInline:We,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:We,referrerPolicy:null,rel:bt,required:We,reversed:We,rows:Ae,rowSpan:Ae,sandbox:bt,scope:null,scoped:We,seamless:We,selected:We,shadowRootClonable:We,shadowRootDelegatesFocus:We,shadowRootMode:null,shape:null,size:Ae,sizes:null,slot:null,span:Ae,spellCheck:Wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ae,step:null,style:null,tabIndex:Ae,target:null,title:null,translate:null,type:null,typeMustMatch:We,useMap:null,value:Wt,width:Ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:Ae,borderColor:null,bottomMargin:Ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:We,declare:We,event:null,face:null,frame:null,frameBorder:null,hSpace:Ae,leftMargin:Ae,link:null,longDesc:null,lowSrc:null,marginHeight:Ae,marginWidth:Ae,noResize:We,noHref:We,noShade:We,noWrap:We,object:null,profile:null,prompt:null,rev:null,rightMargin:Ae,rules:null,scheme:null,scrolling:Wt,standby:null,summary:null,text:null,topMargin:Ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:We,disableRemotePlayback:We,prefix:null,property:null,results:Ae,security:null,unselectable:null},space:"html",transform:Yx}),N5=Aa({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:Hr,accentHeight:Ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ae,amplitude:Ae,arabicForm:null,ascent:Ae,attributeName:null,attributeType:null,azimuth:Ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ae,by:null,calcMode:null,capHeight:Ae,className:bt,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:Ae,diffuseConstant:Ae,direction:null,display:null,dur:null,divisor:Ae,dominantBaseline:null,download:We,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ae,enableBackground:null,end:null,event:null,exponent:Ae,externalResourcesRequired:null,fill:null,fillOpacity:Ae,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:fa,g2:fa,glyphName:fa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ae,horizOriginX:Ae,horizOriginY:Ae,id:null,ideographic:Ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ae,k:Ae,k1:Ae,k2:Ae,k3:Ae,k4:Ae,kernelMatrix:Hr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ae,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:Ae,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:Ae,overlineThickness:Ae,paintOrder:null,panose1:null,path:null,pathLength:Ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ae,pointsAtY:Ae,pointsAtZ:Ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hr,rev:Hr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hr,requiredFeatures:Hr,requiredFonts:Hr,requiredFormats:Hr,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:Ae,specularExponent:Ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ae,strikethroughThickness:Ae,string:null,stroke:null,strokeDashArray:Hr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ae,strokeOpacity:Ae,strokeWidth:null,style:null,surfaceScale:Ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hr,tabIndex:Ae,tableValues:null,target:null,targetX:Ae,targetY:Ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ae,underlineThickness:Ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ae,values:null,vAlphabetic:Ae,vMathematical:Ae,vectorEffect:null,vHanging:Ae,vIdeographic:Ae,version:null,vertAdvY:Ae,vertOriginX:Ae,vertOriginY:Ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zx}),Wx=Aa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,r){return"xlink:"+r.slice(5).toLowerCase()}}),Kx=Aa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Yx}),Qx=Aa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,r){return"xml:"+r.slice(3).toLowerCase()}}),I5=/[A-Z]/g,aC=/-[a-z]/g,P5=/^data[-\w.:]+$/i;function j5(e,r){const n=wg(r);let s=r,o=Lr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&P5.test(r)){if(r.charAt(4)==="-"){const u=r.slice(5).replace(aC,F5);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=r.slice(4);if(!aC.test(u)){let f=u.replace(I5,U5);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}o=Av}return new o(s,r)}function U5(e){return"-"+e.toLowerCase()}function F5(e){return e.charAt(1).toUpperCase()}const H5=qx([Gx,B5,Wx,Kx,Qx],"html"),$x=qx([Gx,N5,Wx,Kx,Qx],"svg"),lC={}.hasOwnProperty;function V5(e,r){const n=r||{};function s(o,...u){let f=s.invalid;const l=s.handlers;if(o&&lC.call(o,e)){const c=String(o[e]);f=lC.call(l,c)?l[c]:s.unknown}if(f)return f.call(this,o,...u)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}const q5=/["&'<>`]/g,G5=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,z5=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Y5=/[|\\{}()[\]^$+*?.]/g,cC=new WeakMap;function W5(e,r){if(e=e.replace(r.subset?K5(r.subset):q5,s),r.subset||r.escapeOnly)return e;return e.replace(G5,n).replace(z5,s);function n(o,u,f){return r.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,f.charCodeAt(u+2),r)}function s(o,u,f){return r.format(o.charCodeAt(0),f.charCodeAt(u+1),r)}}function K5(e){let r=cC.get(e);return r||(r=Q5(e),cC.set(e,r)),r}function Q5(e){const r=[];let n=-1;for(;++n<e.length;)r.push(e[n].replace(Y5,"\\$&"));return new RegExp("(?:"+r.join("|")+")","g")}const $5=/[\dA-Fa-f]/;function J5(e,r,n){const s="&#x"+e.toString(16).toUpperCase();return n&&r&&!$5.test(String.fromCharCode(r))?s:s+";"}const Z5=/\d/;function X5(e,r,n){const s="&#"+String(e);return n&&r&&!Z5.test(String.fromCharCode(r))?s:s+";"}const eP=["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"],Om={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:"€"},tP=["cent","copy","divide","gt","lt","not","para","times"],Jx={}.hasOwnProperty,Ag={};let wd;for(wd in Om)Jx.call(Om,wd)&&(Ag[Om[wd]]=wd);const rP=/[^\dA-Za-z]/;function nP(e,r,n,s){const o=String.fromCharCode(e);if(Jx.call(Ag,o)){const u=Ag[o],f="&"+u;return n&&eP.includes(u)&&!tP.includes(u)&&(!s||r&&r!==61&&rP.test(String.fromCharCode(r)))?f:f+";"}return""}function iP(e,r,n){let s=J5(e,r,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=nP(e,r,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const u=X5(e,r,n.omitOptionalSemicolons);u.length<s.length&&(s=u)}return o&&(!n.useShortestReferences||o.length<s.length)?o:s}function pa(e,r){return W5(e,Object.assign({format:iP},r))}const sP=/^>|^->|<!--|-->|--!>|<!-$/g,oP=[">"],aP=["<",">"];function lP(e,r,n,s){return s.settings.bogusComments?"<?"+pa(e.value,Object.assign({},s.settings.characterReferences,{subset:oP}))+">":"<!--"+e.value.replace(sP,o)+"-->";function o(u){return pa(u,Object.assign({},s.settings.characterReferences,{subset:aP}))}}function cP(e,r,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}function uC(e,r){const n=String(e);if(typeof r!="string")throw new TypeError("Expected character");let s=0,o=n.indexOf(r);for(;o!==-1;)s++,o=n.indexOf(r,o+r.length);return s}function uP(e,r){const n=r||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function dP(e){return e.join(" ").trim()}const hP=/[ \t\n\f\r]/g;function Tv(e){return typeof e=="object"?e.type==="text"?dC(e.value):!1:dC(e)}function dC(e){return e.replace(hP,"")===""}const Jt=Xx(1),Zx=Xx(-1),fP=[];function Xx(e){return r;function r(n,s,o){const u=n?n.children:fP;let f=(s||0)+e,l=u[f];if(!o)for(;l&&Tv(l);)f+=e,l=u[f];return l}}const pP={}.hasOwnProperty;function eA(e){return r;function r(n,s,o){return pP.call(e,n.tagName)&&e[n.tagName](n,s,o)}}const Rv=eA({body:gP,caption:Bm,colgroup:Bm,dd:SP,dt:yP,head:Bm,html:mP,li:_P,optgroup:CP,option:bP,p:vP,rp:hC,rt:hC,tbody:EP,td:fC,tfoot:xP,th:fC,thead:wP,tr:AP});function Bm(e,r,n){const s=Jt(n,r,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Tv(s.value.charAt(0)))}function mP(e,r,n){const s=Jt(n,r);return!s||s.type!=="comment"}function gP(e,r,n){const s=Jt(n,r);return!s||s.type!=="comment"}function vP(e,r,n){const s=Jt(n,r);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 _P(e,r,n){const s=Jt(n,r);return!s||s.type==="element"&&s.tagName==="li"}function yP(e,r,n){const s=Jt(n,r);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function SP(e,r,n){const s=Jt(n,r);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function hC(e,r,n){const s=Jt(n,r);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function CP(e,r,n){const s=Jt(n,r);return!s||s.type==="element"&&s.tagName==="optgroup"}function bP(e,r,n){const s=Jt(n,r);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function wP(e,r,n){const s=Jt(n,r);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function EP(e,r,n){const s=Jt(n,r);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function xP(e,r,n){return!Jt(n,r)}function AP(e,r,n){const s=Jt(n,r);return!s||s.type==="element"&&s.tagName==="tr"}function fC(e,r,n){const s=Jt(n,r);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const TP=eA({body:MP,colgroup:kP,head:DP,html:RP,tbody:LP});function RP(e){const r=Jt(e,-1);return!r||r.type!=="comment"}function DP(e){const r=new Set;for(const s of e.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(r.has(s.tagName))return!1;r.add(s.tagName)}const n=e.children[0];return!n||n.type==="element"}function MP(e){const r=Jt(e,-1,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Tv(r.value.charAt(0)))&&!(r.type==="element"&&(r.tagName==="meta"||r.tagName==="link"||r.tagName==="script"||r.tagName==="style"||r.tagName==="template"))}function kP(e,r,n){const s=Zx(n,r),o=Jt(e,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Rv(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function LP(e,r,n){const s=Zx(n,r),o=Jt(e,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Rv(s,n.children.indexOf(s),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const Ed={name:[[`
383
+ \f\r &/=>`.split(""),`
384
+ \f\r "&'/=>\``.split("")],[`\0
385
+ \f\r "&'/<=>`.split(""),`\0
386
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
387
+ \f\r &>`.split(""),`\0
388
+ \f\r "&'<=>\``.split("")],[`\0
389
+ \f\r "&'<=>\``.split(""),`\0
390
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function OP(e,r,n,s){const o=s.schema,u=o.space==="svg"?!1:s.settings.omitOptionalTags;let f=o.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(e.tagName.toLowerCase());const l=[];let c;o.space==="html"&&e.tagName==="svg"&&(s.schema=$x);const h=BP(s,e.properties),m=s.all(o.space==="html"&&e.tagName==="template"?e.content:e);return s.schema=o,m&&(f=!1),(h||!u||!TP(e,r,n))&&(l.push("<",e.tagName,h?" "+h:""),f&&(o.space==="svg"||s.settings.closeSelfClosing)&&(c=h.charAt(h.length-1),(!s.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(m),!f&&(!u||!Rv(e,r,n))&&l.push("</"+e.tagName+">"),l.join("")}function BP(e,r){const n=[];let s=-1,o;if(r){for(o in r)if(r[o]!==null&&r[o]!==void 0){const u=NP(e,o,r[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 NP(e,r,n){const s=j5(e.schema,r),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,u=e.settings.allowDangerousCharacters?0:1;let f=e.quote,l;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=pa(s.attribute,Object.assign({},e.settings.characterReferences,{subset:Ed.name[o][u]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?uP:dP)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(l=pa(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ed.unquoted[o][u]}))),l!==n&&(e.settings.quoteSmart&&uC(n,f)>uC(n,e.alternative)&&(f=e.alternative),l=f+pa(n,Object.assign({},e.settings.characterReferences,{subset:(f==="'"?Ed.single:Ed.double)[o][u],attribute:!0}))+f),c+(l&&"="+l))}const IP=["<","&"];function tA(e,r,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:pa(e.value,Object.assign({},s.settings.characterReferences,{subset:IP}))}function PP(e,r,n,s){return s.settings.allowDangerousHtml?e.value:tA(e,r,n,s)}function jP(e,r,n,s){return s.all(e)}const UP=V5("type",{invalid:FP,unknown:HP,handlers:{comment:lP,doctype:cP,element:OP,raw:PP,root:jP,text:tA}});function FP(e){throw new Error("Expected node, not `"+e+"`")}function HP(e){const r=e;throw new Error("Cannot compile unknown node `"+r.type+"`")}const VP={},qP={},GP=[];function zP(e,r){const n=VP,s=n.quote||'"',o=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:YP,all:WP,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||L5,characterReferences:n.characterReferences||qP,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?$x:H5,quote:s,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function YP(e,r,n){return UP(e,r,n,this)}function WP(e){const r=[],n=e&&e.children||GP;let s=-1;for(;++s<n.length;)r[s]=this.one(n[s],s,e);return r.join("")}function KP(e){return Array.isArray(e)?e:[e]}function Bh(e,r=!1){var u;const n=e.split(/(\r?\n)/g);let s=0;const o=[];for(let f=0;f<n.length;f+=2){const l=r?n[f]+(n[f+1]||""):n[f];o.push([l,s]),s+=n[f].length,s+=((u=n[f+1])==null?void 0:u.length)||0}return o}function Dv(e){return!e||["plaintext","txt","text","plain"].includes(e)}function rA(e){return e==="ansi"||Dv(e)}function Mv(e){return e==="none"}function nA(e){return Mv(e)}function iA(e,r){var s;if(!r)return e;e.properties||(e.properties={}),(s=e.properties).class||(s.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(r)?r:r.split(/\s+/g);for(const o of n)o&&!e.properties.class.includes(o)&&e.properties.class.push(o);return e}function QP(e,r){let n=0;const s=[];for(const o of r)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 $P(e,r){const n=Array.from(r instanceof Set?r:new Set(r)).sort((s,o)=>s-o);return n.length?e.map(s=>s.flatMap(o=>{const u=n.filter(f=>o.offset<f&&f<o.offset+o.content.length).map(f=>f-o.offset).sort((f,l)=>f-l);return u.length?QP(o,u):o})):e}async function sA(e){return Promise.resolve(typeof e=="function"?e():e).then(r=>r.default||r)}function sh(e,r){const n=typeof e=="string"?{}:{...e.colorReplacements},s=typeof e=="string"?e:e.name;for(const[o,u]of Object.entries((r==null?void 0:r.colorReplacements)||{}))typeof u=="string"?n[o]=u:o===s&&Object.assign(n,u);return n}function eo(e,r){return e&&((r==null?void 0:r[e==null?void 0:e.toLowerCase()])||e)}function oA(e){const r={};return e.color&&(r.color=e.color),e.bgColor&&(r["background-color"]=e.bgColor),e.fontStyle&&(e.fontStyle&Si.Italic&&(r["font-style"]="italic"),e.fontStyle&Si.Bold&&(r["font-weight"]="bold"),e.fontStyle&Si.Underline&&(r["text-decoration"]="underline")),r}function JP(e){return typeof e=="string"?e:Object.entries(e).map(([r,n])=>`${r}:${n}`).join(";")}function ZP(e){const r=Bh(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:r.length-1,character:r[r.length-1].length};let u=o,f=0;for(const l of r){if(u<l.length)break;u-=l.length,f++}return{line:f,character:u}}function s(o,u){let f=0;for(let l=0;l<o;l++)f+=r[l].length;return f+=u,f}return{lines:r,indexToPos:n,posToIndex:s}}class Sr extends Error{constructor(r){super(r),this.name="ShikiError"}}const aA=new WeakMap;function Nh(e,r){aA.set(e,r)}function fc(e){return aA.get(e)}class Ta{constructor(...r){_e(this,"_stacks",{});_e(this,"lang");if(r.length===2){const[n,s]=r;this.lang=s,this._stacks=n}else{const[n,s,o]=r;this.lang=s,this._stacks={[o]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(r,n){return new Ta(Object.fromEntries(KP(n).map(s=>[s,bg])),r)}getInternalStack(r=this.theme){return this._stacks[r]}get scopes(){return pC(this._stacks[this.theme])}getScopes(r=this.theme){return pC(this._stacks[r])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.scopes}}}function pC(e){const r=[],n=new Set;function s(o){var f;if(n.has(o))return;n.add(o);const u=(f=o==null?void 0:o.nameScopesList)==null?void 0:f.scopeName;u&&r.push(u),o.parent&&s(o.parent)}return s(e),r}function XP(e,r){if(!(e instanceof Ta))throw new Sr("Invalid grammar state");return e.getInternalStack(r)}function e3(){const e=new WeakMap;function r(n){if(!e.has(n.meta)){let s=function(f){if(typeof f=="number"){if(f<0||f>n.source.length)throw new Sr(`Invalid decoration offset: ${f}. Code length: ${n.source.length}`);return{...o.indexToPos(f),offset:f}}else{const l=o.lines[f.line];if(l===void 0)throw new Sr(`Invalid decoration position ${JSON.stringify(f)}. Lines length: ${o.lines.length}`);if(f.character<0||f.character>l.length)throw new Sr(`Invalid decoration position ${JSON.stringify(f)}. Line ${f.line} length: ${l.length}`);return{...f,offset:o.posToIndex(f.line,f.character)}}};const o=ZP(n.source),u=(n.options.decorations||[]).map(f=>({...f,start:s(f.start),end:s(f.end)}));t3(u),e.set(n.meta,{decorations:u,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){var f;if(!((f=this.options.decorations)!=null&&f.length))return;const o=r(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]);return $P(n,o)},code(n){var m;if(!((m=this.options.decorations)!=null&&m.length))return;const s=r(this),o=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(o.length!==s.converter.lines.length)throw new Sr(`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,_,E,A){const w=o[p];let v="",S=-1,g=-1;if(_===0&&(S=0),E===0&&(g=0),E===Number.POSITIVE_INFINITY&&(g=w.children.length),S===-1||g===-1)for(let T=0;T<w.children.length;T++)v+=lA(w.children[T]),S===-1&&v.length===_&&(S=T+1),g===-1&&v.length===E&&(g=T+1);if(S===-1)throw new Sr(`Failed to find start index for decoration ${JSON.stringify(A.start)}`);if(g===-1)throw new Sr(`Failed to find end index for decoration ${JSON.stringify(A.end)}`);const y=w.children.slice(S,g);if(!A.alwaysWrap&&y.length===w.children.length)l(w,A,"line");else if(!A.alwaysWrap&&y.length===1&&y[0].type==="element")l(y[0],A,"token");else{const T={type:"element",tagName:"span",properties:{},children:y};l(T,A,"wrapper"),w.children.splice(S,y.length,T)}}function f(p,_){o[p]=l(o[p],_,"line")}function l(p,_,E){var v;const A=_.properties||{},w=_.transform||(S=>S);return p.tagName=_.tagName||"span",p.properties={...p.properties,...A,class:p.properties.class},(v=_.properties)!=null&&v.class&&iA(p,_.properties.class),p=w(p,E)||p,p}const c=[],h=s.decorations.sort((p,_)=>_.start.offset-p.start.offset);for(const p of h){const{start:_,end:E}=p;if(_.line===E.line)u(_.line,_.character,E.character,p);else if(_.line<E.line){u(_.line,_.character,Number.POSITIVE_INFINITY,p);for(let A=_.line+1;A<E.line;A++)c.unshift(()=>f(A,p));u(E.line,0,E.character,p)}}c.forEach(p=>p())}}}function t3(e){for(let r=0;r<e.length;r++){const n=e[r];if(n.start.offset>n.end.offset)throw new Sr(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=r+1;s<e.length;s++){const o=e[s],u=n.start.offset<o.start.offset&&o.start.offset<n.end.offset,f=n.start.offset<o.end.offset&&o.end.offset<n.end.offset,l=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||f||l||c){if(f&&f||l&&c)continue;throw new Sr(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function lA(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(lA).join(""):""}const r3=[e3()];function oh(e){return[...e.transformers||[],...r3]}var to=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Nm={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function n3(e,r){const n=e.indexOf("\x1B[",r);if(n!==-1){const s=e.indexOf("m",n);return{sequence:e.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:e.length}}function mC(e,r){let n=1;const s=e[r+n++];let o;if(s==="2"){const u=[e[r+n++],e[r+n++],e[r+n]].map(f=>Number.parseInt(f));u.length===3&&!u.some(f=>Number.isNaN(f))&&(o={type:"rgb",rgb:u})}else if(s==="5"){const u=Number.parseInt(e[r+n]);Number.isNaN(u)||(o={type:"table",index:Number(u)})}return[n,o]}function i3(e){const r=[];for(let n=0;n<e.length;n++){const s=e[n],o=Number.parseInt(s);if(!Number.isNaN(o))if(o===0)r.push({type:"resetAll"});else if(o<=9)Nm[o]&&r.push({type:"setDecoration",value:Nm[o]});else if(o<=29){const u=Nm[o-20];u&&r.push({type:"resetDecoration",value:u})}else if(o<=37)r.push({type:"setForegroundColor",value:{type:"named",name:to[o-30]}});else if(o===38){const[u,f]=mC(e,n);f&&r.push({type:"setForegroundColor",value:f}),n+=u}else if(o===39)r.push({type:"resetForegroundColor"});else if(o<=47)r.push({type:"setBackgroundColor",value:{type:"named",name:to[o-40]}});else if(o===48){const[u,f]=mC(e,n);f&&r.push({type:"setBackgroundColor",value:f}),n+=u}else o===49?r.push({type:"resetBackgroundColor"}):o>=90&&o<=97?r.push({type:"setForegroundColor",value:{type:"named",name:to[o-90+8]}}):o>=100&&o<=107&&r.push({type:"setBackgroundColor",value:{type:"named",name:to[o-100+8]}})}return r}function s3(){let e=null,r=null,n=new Set;return{parse(s){const o=[];let u=0;do{const f=n3(s,u),l=f.sequence?s.substring(u,f.startPosition):s.substring(u);if(l.length>0&&o.push({value:l,foreground:e,background:r,decorations:new Set(n)}),f.sequence){const c=i3(f.sequence);for(const h of c)h.type==="resetAll"?(e=null,r=null,n.clear()):h.type==="resetForegroundColor"?e=null:h.type==="resetBackgroundColor"?r=null:h.type==="resetDecoration"&&n.delete(h.value);for(const h of c)h.type==="setForegroundColor"?e=h.value:h.type==="setBackgroundColor"?r=h.value:h.type==="setDecoration"&&n.add(h.value)}u=f.position}while(u<s.length);return o}}}var o3={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 a3(e=o3){function r(l){return e[l]}function n(l){return`#${l.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 h=0;h<to.length;h++)s.push(r(to[h]));let l=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let m=0;m<6;m++)for(let p=0;p<6;p++)s.push(n([l[h],l[m],l[p]]));let c=8;for(let h=0;h<24;h++,c+=10)s.push(n([c,c,c]));return s}function u(l){return o()[l]}function f(l){switch(l.type){case"named":return r(l.name);case"rgb":return n(l.rgb);case"table":return u(l.index)}}return{value:f}}function l3(e,r,n){const s=sh(e,n),o=Bh(r),u=a3(Object.fromEntries(to.map(l=>{var c;return[l,(c=e.colors)==null?void 0:c[`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`]]}))),f=s3();return o.map(l=>f.parse(l[0]).map(c=>{let h,m;c.decorations.has("reverse")?(h=c.background?u.value(c.background):e.bg,m=c.foreground?u.value(c.foreground):e.fg):(h=c.foreground?u.value(c.foreground):e.fg,m=c.background?u.value(c.background):void 0),h=eo(h,s),m=eo(m,s),c.decorations.has("dim")&&(h=c3(h));let p=Si.None;return c.decorations.has("bold")&&(p|=Si.Bold),c.decorations.has("italic")&&(p|=Si.Italic),c.decorations.has("underline")&&(p|=Si.Underline),{content:c.value,offset:l[1],color:h,bgColor:m,fontStyle:p}}))}function c3(e){const r=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(r)if(r[3]){const s=Math.round(Number.parseInt(r[3],16)/2).toString(16).padStart(2,"0");return`#${r[1]}${r[2]}${s}`}else return r[2]?`#${r[1]}${r[2]}80`:`#${Array.from(r[1]).map(s=>`${s}${s}`).join("")}80`;const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function kv(e,r,n={}){const{lang:s="text",theme:o=e.getLoadedThemes()[0]}=n;if(Dv(s)||Mv(o))return Bh(r).map(c=>[{content:c[0],offset:c[1]}]);const{theme:u,colorMap:f}=e.setTheme(o);if(s==="ansi")return l3(u,r,n);const l=e.getLanguage(s);if(n.grammarState){if(n.grammarState.lang!==l.name)throw new bi(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(u.name))throw new bi(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${u.name}"`)}return d3(r,l,u,f,n)}function u3(...e){if(e.length===2)return fc(e[1]);const[r,n,s={}]=e,{lang:o="text",theme:u=r.getLoadedThemes()[0]}=s;if(Dv(o)||Mv(u))throw new bi("Plain language does not have grammar state");if(o==="ansi")throw new bi("ANSI language does not have grammar state");const{theme:f,colorMap:l}=r.setTheme(u),c=r.getLanguage(o);return new Ta(ah(n,c,f,l,s).stateStack,c.name,f.name)}function d3(e,r,n,s,o){const u=ah(e,r,n,s,o),f=new Ta(ah(e,r,n,s,o).stateStack,r.name,n.name);return Nh(u.tokens,f),u.tokens}function ah(e,r,n,s,o){const u=sh(n,o),{tokenizeMaxLineLength:f=0,tokenizeTimeLimit:l=500}=o,c=Bh(e);let h=o.grammarState?XP(o.grammarState,n.name)??bg:o.grammarContextCode!=null?ah(o.grammarContextCode,r,n,s,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:bg,m=[];const p=[];for(let _=0,E=c.length;_<E;_++){const[A,w]=c[_];if(A===""){m=[],p.push([]);continue}if(f>0&&A.length>=f){m=[],p.push([{content:A,offset:w,color:"",fontStyle:0}]);continue}let v,S,g;o.includeExplanation&&(v=r.tokenizeLine(A,h),S=v.tokens,g=0);const y=r.tokenizeLine2(A,h,l),T=y.tokens.length/2;for(let M=0;M<T;M++){const k=y.tokens[2*M],L=M+1<T?y.tokens[2*M+2]:A.length;if(k===L)continue;const D=y.tokens[2*M+1],j=eo(s[va.getForeground(D)],u),K=va.getFontStyle(D),Q={content:A.substring(k,L),offset:w+k,color:j,fontStyle:K};if(o.includeExplanation){const H=[];if(o.includeExplanation!=="scopeName")for(const $ of n.settings){let te;switch(typeof $.scope){case"string":te=$.scope.split(/,/).map(Y=>Y.trim());break;case"object":te=$.scope;break;default:continue}H.push({settings:$,selectors:te.map(Y=>Y.split(/ /))})}Q.explanation=[];let U=0;for(;k+U<L;){const $=S[g],te=A.substring($.startIndex,$.endIndex);U+=te.length,Q.explanation.push({content:te,scopes:o.includeExplanation==="scopeName"?h3($.scopes):f3(H,$.scopes)}),g+=1}}m.push(Q)}p.push(m),m=[],h=y.ruleStack}return{tokens:p,stateStack:h}}function h3(e){return e.map(r=>({scopeName:r}))}function f3(e,r){const n=[];for(let s=0,o=r.length;s<o;s++){const u=r[s];n[s]={scopeName:u,themeMatches:m3(e,u,r.slice(0,s))}}return n}function gC(e,r){return e===r||r.substring(0,e.length)===e&&r[e.length]==="."}function p3(e,r,n){if(!gC(e[e.length-1],r))return!1;let s=e.length-2,o=n.length-1;for(;s>=0&&o>=0;)gC(e[s],n[o])&&(s-=1),o-=1;return s===-1}function m3(e,r,n){const s=[];for(const{selectors:o,settings:u}of e)for(const f of o)if(p3(f,r,n)){s.push(u);break}return s}function cA(e,r,n){const s=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),o=s.map(c=>{const h=kv(e,r,{...n,theme:c.theme}),m=fc(h),p=typeof c.theme=="string"?c.theme:c.theme.name;return{tokens:h,state:m,theme:p}}),u=g3(...o.map(c=>c.tokens)),f=u[0].map((c,h)=>c.map((m,p)=>{const _={content:m.content,variants:{},offset:m.offset};return"includeExplanation"in n&&n.includeExplanation&&(_.explanation=m.explanation),u.forEach((E,A)=>{const{content:w,explanation:v,offset:S,...g}=E[h][p];_.variants[s[A].color]=g}),_})),l=o[0].state?new Ta(Object.fromEntries(o.map(c=>{var h;return[c.theme,(h=c.state)==null?void 0:h.getInternalStack(c.theme)]})),o[0].state.lang):void 0;return l&&Nh(f,l),f}function g3(...e){const r=e.map(()=>[]),n=e.length;for(let s=0;s<e[0].length;s++){const o=e.map(c=>c[s]),u=r.map(()=>[]);r.forEach((c,h)=>c.push(u[h]));const f=o.map(()=>0),l=o.map(c=>c[0]);for(;l.every(c=>c);){const c=Math.min(...l.map(h=>h.content.length));for(let h=0;h<n;h++){const m=l[h];m.content.length===c?(u[h].push(m),f[h]+=1,l[h]=o[h][f[h]]):(u[h].push({...m,content:m.content.slice(0,c)}),l[h]={...m,content:m.content.slice(c),offset:m.offset+c})}}}return r}function lh(e,r,n){let s,o,u,f,l,c;if("themes"in n){const{defaultColor:h="light",cssVariablePrefix:m="--shiki-"}=n,p=Object.entries(n.themes).filter(v=>v[1]).map(v=>({color:v[0],theme:v[1]})).sort((v,S)=>v.color===h?-1:S.color===h?1:0);if(p.length===0)throw new bi("`themes` option must not be empty");const _=cA(e,r,n);if(c=fc(_),h&&!p.find(v=>v.color===h))throw new bi(`\`themes\` option must contain the defaultColor key \`${h}\``);const E=p.map(v=>e.getTheme(v.theme)),A=p.map(v=>v.color);u=_.map(v=>v.map(S=>v3(S,A,m,h))),c&&Nh(u,c);const w=p.map(v=>sh(v.theme,n));o=p.map((v,S)=>(S===0&&h?"":`${m+v.color}:`)+(eo(E[S].fg,w[S])||"inherit")).join(";"),s=p.map((v,S)=>(S===0&&h?"":`${m+v.color}-bg:`)+(eo(E[S].bg,w[S])||"inherit")).join(";"),f=`shiki-themes ${E.map(v=>v.name).join(" ")}`,l=h?void 0:[o,s].join(";")}else if("theme"in n){const h=sh(n.theme,n);u=kv(e,r,n);const m=e.getTheme(n.theme);s=eo(m.bg,h),o=eo(m.fg,h),f=m.name,c=fc(u)}else throw new bi("Invalid options, either `theme` or `themes` must be provided");return{tokens:u,fg:o,bg:s,themeName:f,rootStyle:l,grammarState:c}}function v3(e,r,n,s){const o={content:e.content,explanation:e.explanation,offset:e.offset},u=r.map(c=>oA(e.variants[c])),f=new Set(u.flatMap(c=>Object.keys(c))),l={};return u.forEach((c,h)=>{for(const m of f){const p=c[m]||"inherit";if(h===0&&s)l[m]=p;else{const _=m==="color"?"":m==="background-color"?"-bg":`-${m}`,E=n+r[h]+(m==="color"?"":_);l[E]=p}}}),o.htmlStyle=l,o}function ch(e,r,n,s={meta:{},options:n,codeToHast:(o,u)=>ch(e,o,u),codeToTokens:(o,u)=>lh(e,o,u)}){var E,A;let o=r;for(const w of oh(n))o=((E=w.preprocess)==null?void 0:E.call(s,o,n))||o;let{tokens:u,fg:f,bg:l,themeName:c,rootStyle:h,grammarState:m}=lh(e,o,n);const{mergeWhitespaces:p=!0}=n;p===!0?u=y3(u):p==="never"&&(u=S3(u));const _={...s,get source(){return o}};for(const w of oh(n))u=((A=w.tokens)==null?void 0:A.call(_,u))||u;return _3(u,{...n,fg:f,bg:l,themeName:c,rootStyle:h},_,m)}function _3(e,r,n,s=fc(e)){var A,w,v;const o=oh(r),u=[],f={type:"root",children:[]},{structure:l="classic",tabindex:c="0"}=r;let h={type:"element",tagName:"pre",properties:{class:`shiki ${r.themeName||""}`,style:r.rootStyle||`background-color:${r.bg};color:${r.fg}`,...c!==!1&&c!=null?{tabindex:c.toString()}:{},...Object.fromEntries(Array.from(Object.entries(r.meta||{})).filter(([S])=>!S.startsWith("_")))},children:[]},m={type:"element",tagName:"code",properties:{},children:u};const p=[],_={...n,structure:l,addClassToHast:iA,get source(){return n.source},get tokens(){return e},get options(){return r},get root(){return f},get pre(){return h},get code(){return m},get lines(){return p}};if(e.forEach((S,g)=>{var M,k;g&&(l==="inline"?f.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&u.push({type:"text",value:`
391
+ `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},T=0;for(const L of S){let D={type:"element",tagName:"span",properties:{...L.htmlAttrs},children:[{type:"text",value:L.content}]};L.htmlStyle;const j=JP(L.htmlStyle||oA(L));j&&(D.properties.style=j);for(const K of o)D=((M=K==null?void 0:K.span)==null?void 0:M.call(_,D,g+1,T,y,L))||D;l==="inline"?f.children.push(D):l==="classic"&&y.children.push(D),T+=L.content.length}if(l==="classic"){for(const L of o)y=((k=L==null?void 0:L.line)==null?void 0:k.call(_,y,g+1))||y;p.push(y),u.push(y)}}),l==="classic"){for(const S of o)m=((A=S==null?void 0:S.code)==null?void 0:A.call(_,m))||m;h.children.push(m);for(const S of o)h=((w=S==null?void 0:S.pre)==null?void 0:w.call(_,h))||h;f.children.push(h)}let E=f;for(const S of o)E=((v=S==null?void 0:S.root)==null?void 0:v.call(_,E))||E;return s&&Nh(E,s),E}function y3(e){return e.map(r=>{const n=[];let s="",o=0;return r.forEach((u,f)=>{const c=!(u.fontStyle&&u.fontStyle&Si.Underline);c&&u.content.match(/^\s+$/)&&r[f+1]?(o||(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=0,s=""):n.push(u)}),n})}function S3(e){return e.map(r=>r.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,o,u,f]=s;if(!o&&!f)return n;const l=[{...n,offset:n.offset+o.length,content:u}];return o&&l.unshift({content:o,offset:n.offset}),f&&l.push({content:f,offset:n.offset+o.length+u.length}),l}))}function C3(e,r,n){var u;const s={meta:{},options:n,codeToHast:(f,l)=>ch(e,f,l),codeToTokens:(f,l)=>lh(e,f,l)};let o=zP(ch(e,r,n,s));for(const f of oh(n))o=((u=f.postprocess)==null?void 0:u.call(s,o,n))||o;return o}const vC={light:"#333333",dark:"#bbbbbb"},_C={light:"#fffffe",dark:"#1e1e1e"},yC="__shiki_resolved";function Lv(e){var l,c,h,m,p;if(e!=null&&e[yC])return e;const r={...e};r.tokenColors&&!r.settings&&(r.settings=r.tokenColors,delete r.tokenColors),r.type||(r.type="dark"),r.colorReplacements={...r.colorReplacements},r.settings||(r.settings=[]);let{bg:n,fg:s}=r;if(!n||!s){const _=r.settings?r.settings.find(E=>!E.name&&!E.scope):void 0;(l=_==null?void 0:_.settings)!=null&&l.foreground&&(s=_.settings.foreground),(c=_==null?void 0:_.settings)!=null&&c.background&&(n=_.settings.background),!s&&((h=r==null?void 0:r.colors)!=null&&h["editor.foreground"])&&(s=r.colors["editor.foreground"]),!n&&((m=r==null?void 0:r.colors)!=null&&m["editor.background"])&&(n=r.colors["editor.background"]),s||(s=r.type==="light"?vC.light:vC.dark),n||(n=r.type==="light"?_C.light:_C.dark),r.fg=s,r.bg=n}r.settings[0]&&r.settings[0].settings&&!r.settings[0].scope||r.settings.unshift({settings:{foreground:r.fg,background:r.bg}});let o=0;const u=new Map;function f(_){var A;if(u.has(_))return u.get(_);o+=1;const E=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return(A=r.colorReplacements)!=null&&A[`#${E}`]?f(_):(u.set(_,E),E)}r.settings=r.settings.map(_=>{var v,S;const E=((v=_.settings)==null?void 0:v.foreground)&&!_.settings.foreground.startsWith("#"),A=((S=_.settings)==null?void 0:S.background)&&!_.settings.background.startsWith("#");if(!E&&!A)return _;const w={..._,settings:{..._.settings}};if(E){const g=f(_.settings.foreground);r.colorReplacements[g]=_.settings.foreground,w.settings.foreground=g}if(A){const g=f(_.settings.background);r.colorReplacements[g]=_.settings.background,w.settings.background=g}return w});for(const _ of Object.keys(r.colors||{}))if((_==="editor.foreground"||_==="editor.background"||_.startsWith("terminal.ansi"))&&!((p=r.colors[_])!=null&&p.startsWith("#"))){const E=f(r.colors[_]);r.colorReplacements[E]=r.colors[_],r.colors[_]=E}return Object.defineProperty(r,yC,{enumerable:!1,writable:!1,value:!0}),r}async function uA(e){return Array.from(new Set((await Promise.all(e.filter(r=>!rA(r)).map(async r=>await sA(r).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function dA(e){return(await Promise.all(e.map(async n=>nA(n)?null:Lv(await sA(n))))).filter(n=>!!n)}class b3 extends k5{constructor(n,s,o,u={}){super(n);_e(this,"_resolvedThemes",new Map);_e(this,"_resolvedGrammars",new Map);_e(this,"_langMap",new Map);_e(this,"_langGraph",new Map);_e(this,"_textmateThemeCache",new WeakMap);_e(this,"_loadedThemesCache",null);_e(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=s,this._langs=o,this._alias=u,this._themes.map(f=>this.loadTheme(f)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const s=Lv(n);return s.name&&(this._resolvedThemes.set(s.name,s),this._loadedThemesCache=null),s}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let s=this._textmateThemeCache.get(n);s||(s=eh.createFromRawTheme(n),this._textmateThemeCache.set(n,s)),this._syncRegistry.setTheme(s)}getGrammar(n){if(this._alias[n]){const s=new Set([n]);for(;this._alias[n];){if(n=this._alias[n],s.has(n))throw new Sr(`Circular alias \`${Array.from(s).join(" -> ")} -> ${n}\``);s.add(n)}}return this._resolvedGrammars.get(n)}loadLanguage(n){var f,l,c,h;if(this.getGrammar(n.name))return;const s=new Set([...this._langMap.values()].filter(m=>{var p;return(p=m.embeddedLangsLazy)==null?void 0:p.includes(n.name)}));this._resolver.addLanguage(n);const o={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const u=this.loadGrammarWithConfiguration(n.scopeName,1,o);if(u.name=n.name,this._resolvedGrammars.set(n.name,u),n.aliases&&n.aliases.forEach(m=>{this._alias[m]=n.name}),this._loadedLanguagesCache=null,s.size)for(const m of s)this._resolvedGrammars.delete(m.name),this._loadedLanguagesCache=null,(l=(f=this._syncRegistry)==null?void 0:f._injectionGrammars)==null||l.delete(m.scopeName),(h=(c=this._syncRegistry)==null?void 0:c._grammars)==null||h.delete(m.scopeName),this.loadLanguage(this._langMap.get(m.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const u of n)this.resolveEmbeddedLanguages(u);const s=Array.from(this._langGraph.entries()),o=s.filter(([u,f])=>!f);if(o.length){const u=s.filter(([f,l])=>{var c;return l&&((c=l.embeddedLangs)==null?void 0:c.some(h=>o.map(([m])=>m).includes(h)))}).filter(f=>!o.includes(f));throw new Sr(`Missing languages ${o.map(([f])=>`\`${f}\``).join(", ")}, required by ${u.map(([f])=>`\`${f}\``).join(", ")}`)}for(const[u,f]of s)this._resolver.addLanguage(f);for(const[u,f]of s)this.loadLanguage(f)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){if(this._langMap.set(n.name,n),this._langGraph.set(n.name,n),n.embeddedLangs)for(const s of n.embeddedLangs)this._langGraph.set(s,this._langMap.get(s))}}class w3{constructor(r,n){_e(this,"_langs",new Map);_e(this,"_scopeToLang",new Map);_e(this,"_injections",new Map);_e(this,"_onigLib");this._onigLib={createOnigScanner:s=>r.createScanner(s),createOnigString:s=>r.createString(s)},n.forEach(s=>this.addLanguage(s))}get onigLib(){return this._onigLib}getLangRegistration(r){return this._langs.get(r)}loadGrammar(r){return this._scopeToLang.get(r)}addLanguage(r){this._langs.set(r.name,r),r.aliases&&r.aliases.forEach(n=>{this._langs.set(n,r)}),this._scopeToLang.set(r.scopeName,r),r.injectTo&&r.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(r.scopeName)})}getInjections(r){const n=r.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 Vl=0;function E3(e){Vl+=1,e.warnings!==!1&&Vl>=10&&Vl%10===0&&console.warn(`[Shiki] ${Vl} 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 r=!1;if(!e.engine)throw new Sr("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),s=(e.themes||[]).flat(1).map(Lv),o=new w3(e.engine,n),u=new b3(o,s,n,e.langAlias);let f;function l(g){v();const y=u.getGrammar(typeof g=="string"?g:g.name);if(!y)throw new Sr(`Language \`${g}\` not found, you may need to load it first`);return y}function c(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};v();const y=u.getTheme(g);if(!y)throw new Sr(`Theme \`${g}\` not found, you may need to load it first`);return y}function h(g){v();const y=c(g);f!==g&&(u.setTheme(y),f=g);const T=u.getColorMap();return{theme:y,colorMap:T}}function m(){return v(),u.getLoadedThemes()}function p(){return v(),u.getLoadedLanguages()}function _(...g){v(),u.loadLanguages(g.flat(1))}async function E(...g){return _(await uA(g))}function A(...g){v();for(const y of g.flat(1))u.loadTheme(y)}async function w(...g){return v(),A(await dA(g))}function v(){if(r)throw new Sr("Shiki instance has been disposed")}function S(){r||(r=!0,u.dispose(),Vl-=1)}return{setTheme:h,getTheme:c,getLanguage:l,getLoadedThemes:m,getLoadedLanguages:p,loadLanguage:E,loadLanguageSync:_,loadTheme:w,loadThemeSync:A,dispose:S,[Symbol.dispose]:S}}async function x3(e={}){e.loadWasm;const[r,n,s]=await Promise.all([dA(e.themes||[]),uA(e.langs||[]),e.engine||Tx(e.loadWasm||zI())]);return E3({...e,themes:r,langs:n,engine:s})}async function A3(e={}){const r=await x3(e);return{getLastGrammarState:(...n)=>u3(r,...n),codeToTokensBase:(n,s)=>kv(r,n,s),codeToTokensWithThemes:(n,s)=>cA(r,n,s),codeToTokens:(n,s)=>lh(r,n,s),codeToHast:(n,s)=>ch(r,n,s),codeToHtml:(n,s)=>C3(r,n,s),...r,getInternalContext:()=>r}}function T3(e,r,n){let s,o,u;{const l=e;s=l.langs,o=l.themes,u=l.engine}async function f(l){function c(E){if(typeof E=="string"){if(rA(E))return[];const A=s[E];if(!A)throw new bi(`Language \`${E}\` is not included in this bundle. You may want to load it from external source.`);return A}return E}function h(E){if(nA(E))return"none";if(typeof E=="string"){const A=o[E];if(!A)throw new bi(`Theme \`${E}\` is not included in this bundle. You may want to load it from external source.`);return A}return E}const m=(l.themes??[]).map(E=>h(E)),p=(l.langs??[]).map(E=>c(E)),_=await A3({engine:l.engine??u(),...l,themes:m,langs:p});return{..._,loadLanguage(...E){return _.loadLanguage(...E.map(c))},loadTheme(...E){return _.loadTheme(...E.map(h))}}}return f}function R3(e){let r;async function n(s={}){if(r){const o=await r;return await Promise.all([o.loadTheme(...s.themes||[]),o.loadLanguage(...s.langs||[])]),o}else return r=e({...s,themes:s.themes||[],langs:s.langs||[]}),r}return n}function D3(e){const r=R3(e);return{getSingletonHighlighter(n){return r(n)},async codeToHtml(n,s){return(await r({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)})).codeToHtml(n,s)},async codeToHast(n,s){return(await r({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)})).codeToHast(n,s)},async codeToTokens(n,s){return(await r({langs:[s.lang],themes:"theme"in s?[s.theme]:Object.values(s.themes)})).codeToTokens(n,s)},async codeToTokensBase(n,s){return(await r({langs:[s.lang],themes:[s.theme]})).codeToTokensBase(n,s)},async codeToTokensWithThemes(n,s){return(await r({langs:[s.lang],themes:Object.values(s.themes).filter(Boolean)})).codeToTokensWithThemes(n,s)},async getLastGrammarState(n,s){return(await r({langs:[s.lang],themes:[s.theme]})).getLastGrammarState(n,s)}}}const M3=T3({langs:xI,themes:TI,engine:()=>Tx(J(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{codeToHtml:k3}=D3(M3),L3=new Set(["javascript","js","typescript","ts","tsx","jsx","python","py","java","kotlin","swift","go","rust","c","cpp","c++","csharp","c#","cs","html","css","scss","sass","less","json","yaml","yml","toml","xml","bash","sh","shell","zsh","powershell","ps1","sql","graphql","markdown","md","dockerfile","ruby","php","perl","lua","r","matlab","scala","groovy","haskell","elixir","vue","svelte","astro"]);function O3(e){if(!e)return"text";const r=e.toLowerCase().trim(),s={js:"javascript",ts:"typescript",py:"python",rb:"ruby","c++":"cpp","c#":"csharp",cs:"csharp",sh:"bash",shell:"bash",zsh:"bash",yml:"yaml",md:"markdown",ps1:"powershell"}[r]||r;return L3.has(s)?s:"text"}const B3=R.memo(function({code:r,language:n}){const[s,o]=R.useState(""),[u,f]=R.useState(!1),[l,c]=R.useState(!0),h=O3(n),m=n||"code";R.useEffect(()=>{let _=!1;c(!0);async function E(){try{if(h==="text")o(`<pre class="shiki"><code>${Im(r)}</code></pre>`);else{const A=await k3(r,{lang:h,themes:{light:"github-light",dark:"github-dark"}});_||o(A)}}catch{_||o(`<pre class="shiki"><code>${Im(r)}</code></pre>`)}finally{_||c(!1)}}return E(),()=>{_=!0}},[r,h]);const p=R.useCallback(()=>{navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)},[r]);return b.jsxs("div",{className:"my-2 rounded-lg overflow-hidden border bg-zinc-50 dark:bg-zinc-900",children:[b.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-zinc-100 dark:bg-zinc-800 border-b text-xs text-zinc-500 dark:text-zinc-400",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(PM,{className:"w-3 h-3","aria-hidden":"true"}),b.jsx("span",{children:m})]}),b.jsx("button",{type:"button",className:Te("flex items-center gap-1 transition-colors",u?"text-green-500":"hover:text-zinc-700 dark:hover:text-zinc-200"),onClick:p,"aria-label":u?"Copied to clipboard":"Copy code",children:u?b.jsxs(b.Fragment,{children:[b.jsx(Xb,{className:"w-3 h-3","aria-hidden":"true"}),b.jsx("span",{children:"Copied"})]}):b.jsxs(b.Fragment,{children:[b.jsx(jM,{className:"w-3 h-3","aria-hidden":"true"}),b.jsx("span",{children:"Copy"})]})})]}),b.jsx("div",{className:Te("overflow-x-auto text-sm [&_.shiki]:!bg-transparent [&_.shiki]:p-3 [&_.shiki]:m-0","[&_pre]:!bg-transparent [&_code]:!bg-transparent",l&&"animate-pulse"),dangerouslySetInnerHTML:{__html:s||`<pre class="p-3"><code>${Im(r)}</code></pre>`}})]})});function Im(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function N3({block:e,isUserMessage:r=!1}){var n,s,o,u,f,l,c,h,m,p,_,E,A;switch(e.blockType){case"text":return b.jsx(SC,{content:e.content,isUserMessage:r});case"code":return b.jsx(B3,{code:e.content,language:(n=e.metadata)==null?void 0:n.language});case"tool":return b.jsx(I3,{toolName:(s=e.metadata)==null?void 0:s.toolName,toolInput:(o=e.metadata)==null?void 0:o.toolInput,toolOutput:(u=e.metadata)==null?void 0:u.toolOutput,toolStatus:(f=e.metadata)==null?void 0:f.toolStatus});case"thinking":return b.jsx(P3,{content:e.content});case"error":return b.jsx(j3,{content:e.content,errorCode:(l=e.metadata)==null?void 0:l.errorCode});case"status":return b.jsx(U3,{content:e.content});case"voice_input":return b.jsx(F3,{content:e.content,audioUrl:(c=e.metadata)==null?void 0:c.audioUrl,audioBase64:(h=e.metadata)==null?void 0:h.audioBase64,duration:(m=e.metadata)==null?void 0:m.duration,isUserMessage:r});case"voice_output":return b.jsx(H3,{content:e.content,audioUrl:(p=e.metadata)==null?void 0:p.audioUrl,audioBase64:(_=e.metadata)==null?void 0:_.audioBase64,messageId:(E=e.metadata)==null?void 0:E.messageId,hasAudio:(A=e.metadata)==null?void 0:A.hasAudio});default:return b.jsx(SC,{content:e.content,isUserMessage:r})}}function SC({content:e,isUserMessage:r}){const n=(u,f)=>{const l=[];let c=u,h=0;for(;c.length>0;){const m=c.match(/^`([^`]+)`/);if(m){l.push(b.jsx("code",{className:Te("px-1 py-0.5 rounded text-sm font-mono",r?"bg-primary-foreground/20":"bg-muted"),children:m[1]},`${f}-${h++}`)),c=c.slice(m[0].length);continue}const p=c.match(/^(\*\*|__)(.+?)\1/);if(p!=null&&p[2]){l.push(b.jsx("strong",{className:"font-semibold",children:n(p[2],`${f}-b${h}`)},`${f}-${h++}`)),c=c.slice(p[0].length);continue}const _=c.match(/^(\*|_)(?!\1)(.+?)\1(?!\1)/);if(_!=null&&_[2]){l.push(b.jsx("em",{className:"italic",children:n(_[2],`${f}-i${h}`)},`${f}-${h++}`)),c=c.slice(_[0].length);continue}const E=c.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(E){l.push(b.jsx("a",{href:E[2],target:"_blank",rel:"noopener noreferrer",className:Te("underline underline-offset-2 hover:opacity-80",r?"text-primary-foreground":"text-primary"),children:E[1]},`${f}-${h++}`)),c=c.slice(E[0].length);continue}const A=c.slice(1).search(/[`*_[]/);if(A===-1){l.push(b.jsx("span",{children:c},`${f}-${h++}`));break}else{const w=c.slice(0,A+1);l.push(b.jsx("span",{children:w},`${f}-${h++}`)),c=c.slice(A+1)}}return l},o=(e||"").replace(/^\n+/,"").replace(/\n+$/,"").split(`
392
+ `);return b.jsx("div",{className:"whitespace-pre-wrap break-words",children:o.map((u,f)=>b.jsx("p",{className:Te("m-0",u===""?"h-4":void 0),children:n(u,`line-${f}`)},f))})}function I3({toolName:e,toolInput:r,toolOutput:n,toolStatus:s}){const[o,u]=R.useState(!1),f=e?e.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase()):"Tool";return b.jsxs("div",{className:"my-2 rounded-lg overflow-hidden border bg-orange-500/10",children:[b.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-orange-500/5 transition-colors",onClick:()=>u(!o),children:[s==="running"&&b.jsx(yc,{className:"w-4 h-4 animate-spin text-blue-500 flex-shrink-0"}),s==="completed"&&b.jsx(e1,{className:"w-4 h-4 text-green-500 flex-shrink-0"}),s==="failed"&&b.jsx(gh,{className:"w-4 h-4 text-red-500 flex-shrink-0"}),!s&&b.jsx(QM,{className:"w-4 h-4 flex-shrink-0"}),b.jsx("span",{className:"font-medium flex-1 text-left",children:f}),o?b.jsx(qg,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}):b.jsx(mh,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"})]}),o&&b.jsxs("div",{className:"px-3 pb-3 space-y-3",children:[r&&b.jsxs("div",{children:[b.jsx("span",{className:"text-xs text-muted-foreground",children:"Input:"}),b.jsx("div",{className:"mt-1 p-2 rounded bg-muted/50 max-h-48 overflow-auto",children:b.jsx("pre",{className:"whitespace-pre-wrap text-xs font-mono",children:r})})]}),n&&b.jsxs("div",{children:[b.jsx("span",{className:"text-xs text-muted-foreground",children:"Output:"}),b.jsx("div",{className:"mt-1 p-2 rounded bg-background/50 max-h-48 overflow-auto",children:b.jsx("pre",{className:"whitespace-pre-wrap text-xs font-mono",children:n})})]})]})]})}function P3({content:e}){const[r,n]=R.useState(!1);return b.jsxs("div",{className:"my-2 rounded-lg overflow-hidden border border-dashed bg-purple-500/5",children:[b.jsxs("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:bg-purple-500/5 transition-colors",onClick:()=>n(!r),children:[b.jsx(LM,{className:"w-4 h-4 text-purple-500 flex-shrink-0"}),b.jsx("span",{className:"flex-1 text-left italic",children:"Thinking..."}),r?b.jsx(qg,{className:"w-4 h-4 flex-shrink-0"}):b.jsx(mh,{className:"w-4 h-4 flex-shrink-0"})]}),r&&b.jsx("div",{className:"px-3 pb-3 text-sm text-muted-foreground italic border-t border-dashed",children:b.jsx("pre",{className:"whitespace-pre-wrap text-xs pt-2",children:e})})]})}function j3({content:e,errorCode:r}){return b.jsxs("div",{className:"my-2 rounded-lg overflow-hidden border border-destructive/50 bg-destructive/10",children:[b.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-sm text-destructive",children:[b.jsx(gh,{className:"w-3 h-3"}),b.jsxs("span",{className:"font-medium",children:["Error",r?`: ${r}`:""]})]}),b.jsx("div",{className:"px-3 py-2 text-sm text-destructive",children:b.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}function U3({content:e}){return b.jsx("div",{className:"my-2 text-center text-sm text-muted-foreground",children:b.jsx("span",{className:"px-3 py-1 rounded-full bg-muted",children:e})})}function F3({content:e,audioUrl:r,audioBase64:n,duration:s,isUserMessage:o}){const u=!o&&!!(r||n),f=o&&!e&&s&&s>0;return b.jsxs("div",{className:"space-y-2",children:[b.jsxs("div",{className:Te("flex items-center gap-2 text-sm",o?"text-primary-foreground/70":"text-muted-foreground"),children:[b.jsx(r1,{className:"w-3 h-3"}),b.jsx("span",{children:"Voice message"}),s&&b.jsxs("span",{className:"tabular-nums",children:[Math.floor(s/60),":",(s%60).toString().padStart(2,"0")]}),f&&b.jsx("span",{className:"text-xs opacity-70",children:"Transcribing..."})]}),u&&b.jsx(xx,{audioUrl:r,audioBase64:n,className:"bg-background/50"}),e&&b.jsx("p",{className:"whitespace-pre-wrap break-words text-sm italic",children:e})]})}function H3({audioUrl:e,audioBase64:r,messageId:n,hasAudio:s}){const o=!!(e||r||n),u=o||s;return on.audio("VoiceOutputBlock render:",{audioUrl:!!e,audioBase64:!!r,messageId:n,hasAudio:s,audioAvailable:o,shouldShowAudioPlayer:u}),u?b.jsx(xx,{audioUrl:e,audioBase64:r,messageId:n,className:"bg-background/50 !p-2 mt-2"}):null}function CC({className:e}){return b.jsx("div",{className:Te("flex items-center gap-1",e),role:"status","aria-label":"Agent is typing",children:[0,1,2].map(r=>b.jsx("div",{className:"w-2 h-2 bg-muted-foreground/60 rounded-full animate-[typing-dot_1s_ease-in-out_infinite]",style:{animationDelay:`${r*.15}s`}},r))})}function V3({agentType:e}){const r="w-[18px] h-[18px]",n=()=>{switch(e){case"supervisor":return b.jsx(Jl,{className:r});case"claude":return b.jsx(Sc,{className:r});case"cursor":return b.jsx(bc,{className:r});case"opencode":return b.jsx(Cc,{className:r});case"terminal":return b.jsx(Zl,{className:Te(r,"text-foreground")});default:return b.jsx(gs,{className:Te(r,"text-foreground")})}};return b.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-muted flex items-center justify-center overflow-hidden",children:n()})}function q3({contentBlocks:e,isUser:r,isStreaming:n,showAvatar:s,isContinuation:o,sendStatus:u,isCurrentDevice:f,fromDeviceId:l,onRetry:c,agentType:h}){const m=e.length>0&&e.some(p=>p.content||p.blockType==="tool"||p.blockType==="voice_output"||p.blockType==="voice_input");return b.jsxs("div",{className:Te("flex gap-3",o?"mb-1":"mb-4",r&&"flex-row-reverse"),children:[s?r?b.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center",children:b.jsx($M,{className:"w-4 h-4"})}):b.jsx(V3,{agentType:h}):b.jsx("div",{className:"flex-shrink-0 w-8"}),b.jsxs("div",{className:Te("flex-1 max-w-[85%] md:max-w-[75%]",r&&"flex flex-col items-end"),children:[b.jsx("div",{className:Te("rounded-2xl px-4 py-3",r?"bg-primary text-primary-foreground rounded-br-sm":"bg-muted rounded-bl-sm",o&&!r&&"rounded-tl-sm"),children:n&&!m?b.jsx(CC,{}):b.jsxs(b.Fragment,{children:[e.map(p=>b.jsx(N3,{block:p,isUserMessage:r},p.id)),n&&m&&b.jsx("div",{className:"mt-2",children:b.jsx(CC,{})})]})}),u==="pending"&&b.jsx("span",{className:"text-xs text-muted-foreground mt-1",role:"status",children:"Sending..."}),u==="failed"&&b.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[b.jsx("span",{className:"text-xs text-destructive",role:"alert",children:"Failed to send"}),c&&b.jsxs(ct,{variant:"ghost",size:"sm",onClick:c,className:"h-6 px-2 text-xs","aria-label":"Retry sending message",children:[b.jsx(Gg,{className:"w-3 h-3 mr-1","aria-hidden":"true"}),"Retry"]})]}),!f&&l&&b.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"From another device"})]})]})}function G3({onRecordingComplete:e,disabled:r=!1,className:n}){const[s,o]=R.useState(!1),[u,f]=R.useState(!1),l=R.useRef(null),c=R.useRef([]),h=R.useRef(null),m=R.useRef(null),p=R.useRef(!1),_=R.useRef(0),E=R.useCallback(async()=>{if(!(s||u)){Nt.stop();try{const y=await navigator.mediaDevices.getUserMedia({audio:!0});h.current=y;let T="audio/webm;codecs=opus";MediaRecorder.isTypeSupported(T)||(T="audio/webm",MediaRecorder.isTypeSupported(T)||(T="audio/mp4",MediaRecorder.isTypeSupported(T)||(T="")));const M=new MediaRecorder(y,T?{mimeType:T}:void 0);l.current=M,c.current=[],M.ondataavailable=k=>{k.data.size>0&&c.current.push(k.data)},M.onstop=()=>{const k=M.mimeType,L=new Blob(c.current,{type:k}),D=k.includes("webm")?"webm":k.includes("mp4")?"m4a":"wav";y.getTracks().forEach(j=>j.stop()),h.current=null,L.size>0&&(f(!0),e(L,D),setTimeout(()=>f(!1),500))},M.start(100),o(!0),"vibrate"in navigator&&navigator.vibrate(10)}catch{kr.error("Microphone access denied","Please allow microphone access to record voice messages.")}}},[s,u,e]),A=R.useCallback(()=>{l.current&&l.current.state==="recording"&&l.current.stop(),o(!1),"vibrate"in navigator&&navigator.vibrate(10)},[]),w=R.useCallback(y=>{var T,M;r||u||((M=(T=y.target).setPointerCapture)==null||M.call(T,y.pointerId),Nt.unlockIfNeeded().catch(()=>{}),_.current=Date.now(),p.current=!1,!s&&(m.current=setTimeout(()=>{p.current=!0,E()},150)))},[r,u,s,E]),v=R.useCallback(y=>{var M,k;if(r)return;(k=(M=y.target).releasePointerCapture)==null||k.call(M,y.pointerId);const T=Date.now()-_.current;m.current&&(clearTimeout(m.current),m.current=null),p.current?(A(),p.current=!1):T<150&&(s?A():E())},[r,s,E,A]),S=R.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),p.current&&s&&(A(),p.current=!1)},[s,A]);R.useEffect(()=>()=>{m.current&&clearTimeout(m.current),h.current&&h.current.getTracks().forEach(y=>y.stop())},[]);const g=36;return b.jsxs("div",{className:Te("relative flex items-center justify-center gap-2 shrink-0",n),children:[s&&b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"absolute w-14 h-14 rounded-full bg-red-500/40",style:{animation:"pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}),b.jsx("span",{className:"absolute w-14 h-14 rounded-full bg-red-500/40",style:{animation:"pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite",animationDelay:"0.5s"}}),b.jsx("span",{className:"absolute w-14 h-14 rounded-full bg-red-500/40",style:{animation:"pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite",animationDelay:"1s"}})]}),b.jsx("button",{type:"button",onPointerDown:w,onPointerUp:v,onPointerLeave:S,onPointerCancel:S,disabled:r||u,className:Te("relative z-10 flex items-center justify-center rounded-full","transition-all duration-150","select-none","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s?"w-14 h-14 bg-red-500 text-white scale-100":"w-9 h-9 text-primary hover:bg-muted active:scale-95",r&&"opacity-50 cursor-not-allowed"),"aria-label":s?"Stop recording":"Record voice message",children:s?b.jsx(i1,{className:"w-5 h-5",fill:"currentColor"}):b.jsx(r1,{className:"w-5 h-5",style:{width:g*.55,height:g*.55}})})]})}function z3({onSend:e,onSendAudio:r,onCancel:n,isLoading:s=!1,placeholder:o="Message...",disabled:u=!1,showVoice:f=!0}){const[l,c]=R.useState(""),h=R.useRef(null),m=R.useCallback(()=>{const w=l.trim();!w||s||u||(e(w),c(""),h.current&&(h.current.style.height="auto"))},[l,s,u,e]),p=R.useCallback(w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),m())},[m]),_=R.useCallback(()=>{const w=h.current;if(w){w.style.height="auto";const g=24*6;w.style.height=`${Math.min(w.scrollHeight,g)}px`}},[]),E=R.useCallback((w,v)=>{r==null||r(w,v)},[r]),A=l.trim()&&!s&&!u;return b.jsx("footer",{className:"border-t bg-background/80 backdrop-blur-xl supports-[backdrop-filter]:bg-background/60 px-3 py-3",children:b.jsx("div",{className:"max-w-3xl mx-auto",children:b.jsxs("form",{onSubmit:w=>{w.preventDefault(),m()},className:"flex items-end gap-3",role:"form","aria-label":"Message input",children:[b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("label",{htmlFor:"chat-input",className:"sr-only",children:"Message input"}),b.jsx("textarea",{id:"chat-input",ref:h,value:l,onChange:w=>c(w.target.value),onKeyDown:p,onInput:_,placeholder:o,disabled:u,rows:1,"aria-label":"Type your message",className:Te("w-full resize-none rounded-[20px] bg-muted px-4 py-3","text-base leading-6","border-0 focus:outline-none focus:ring-2 focus:ring-primary/50","placeholder:text-muted-foreground/60","min-h-[48px]",u&&"opacity-50 cursor-not-allowed")})]}),f&&r&&b.jsx(G3,{onRecordingComplete:E,disabled:u||s}),s&&n?b.jsx("button",{type:"button",onClick:n,className:Te("flex items-center justify-center shrink-0","w-9 h-9 rounded-full","bg-destructive text-destructive-foreground","transition-transform active:scale-95"),"aria-label":"Stop generation",children:b.jsx(i1,{className:"w-4 h-4",fill:"currentColor","aria-hidden":"true"})}):b.jsx("button",{type:"submit",disabled:!A,className:Te("flex items-center justify-center shrink-0","w-9 h-9 rounded-full","transition-all active:scale-95",A?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground/50 cursor-not-allowed"),"aria-label":"Send message",children:b.jsx(kM,{className:"w-5 h-5",strokeWidth:2.5,"aria-hidden":"true"})})]})})})}function Pm({className:e}){return b.jsx("div",{className:Te("animate-pulse rounded-md bg-muted",e),"aria-hidden":"true"})}function Y3({isUser:e=!1}){return b.jsxs("div",{className:Te("flex gap-3 mb-4",e&&"flex-row-reverse"),children:[b.jsx(Pm,{className:"w-8 h-8 rounded-full shrink-0"}),b.jsx("div",{className:Te("flex-1 max-w-[75%]",e&&"flex flex-col items-end"),children:b.jsxs("div",{className:Te("rounded-2xl px-4 py-3 space-y-2",e?"bg-primary/20":"bg-muted"),children:[b.jsx(Pm,{className:"h-4 w-48"}),b.jsx(Pm,{className:"h-4 w-32"})]})})]})}function W3({count:e=3}){return b.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading messages",children:[Array.from({length:e}).map((r,n)=>b.jsx(Y3,{isUser:n%2===0},n)),b.jsx("span",{className:"sr-only",children:"Loading chat messages..."})]})}const K3={maxHeightUnitsPerSegment:14,minHeightUnitsToSplit:17},Tg=45;function jm(e){var r,n;switch(e.blockType){case"text":{const s=e.content.split(`
393
+ `).length,o=Math.max(1,Math.ceil(e.content.length/Tg));return Math.max(s,o)}case"code":return e.content.split(`
394
+ `).length+2;case"tool":return 3;case"thinking":return 2;case"status":return 1;case"error":return Math.max(1,Math.ceil(e.content.length/Tg))+1;case"cancel":return 2;case"voice_input":return 3;case"voice_output":return 2;case"action_buttons":return Math.max(1,((n=(r=e.metadata)==null?void 0:r.buttons)==null?void 0:n.length)??1)*2;default:return 1}}function Q3(e,r){const n=e.slice(0,r),s=Math.floor(r/2),o=n.lastIndexOf(`
395
+
396
+ `);if(o>s)return o+2;const u=[". ","! ","? ",`.
397
+ `,`!
398
+ `,`?
399
+ `];for(const h of u){const m=n.lastIndexOf(h);if(m>s)return m+h.length}const f=n.lastIndexOf(`
400
+ `);if(f>s)return f+1;const l=Math.floor(r/3),c=n.lastIndexOf(" ");return c>l?c+1:r}function $3(e,r){const n=[];let s=e;for(;s.length>r;){const o=Q3(s,r),u=s.slice(0,o).trim();u&&n.push(u),s=s.slice(o).trim()}return s&&n.push(s),n.length===0?[e]:n}function Um(e){return{id:`${e.id}-seg-0`,messageId:e.id,contentBlocks:e.contentBlocks,segmentIndex:0,totalSegments:1,isFirstSegment:!0,isLastSegment:!0,isStreaming:e.isStreaming,showAvatar:e.role==="assistant",createdAt:e.createdAt,role:e.role,sendStatus:e.sendStatus,fromDeviceId:e.fromDeviceId}}function J3(e,r=K3){if(e.role==="user")return[Um(e)];if(e.contentBlocks.reduce((l,c)=>l+jm(c),0)<r.minHeightUnitsToSplit)return[Um(e)];const s=[];let o=[],u=0;for(const l of e.contentBlocks){const c=jm(l);if(u+c>r.maxHeightUnitsPerSegment&&u>0){if(l.blockType==="text"&&c>r.maxHeightUnitsPerSegment/2){o.length>0&&(s.push(o),o=[],u=0);const h=r.maxHeightUnitsPerSegment*Tg,m=$3(l.content,h);for(let p=0;p<m.length;p++){const _=m[p];if(!_)continue;const E={id:`${l.id}-part-${p}`,blockType:"text",content:_,metadata:l.metadata};p<m.length-1?s.push([E]):(o.push(E),u=jm(E))}continue}o.length>0&&(s.push(o),o=[],u=0)}o.push(l),u+=c}if(o.length>0&&s.push(o),s.length===0)return[Um(e)];const f=s.length;return s.map((l,c)=>({id:`${e.id}-seg-${c}`,messageId:e.id,contentBlocks:l,segmentIndex:c,totalSegments:f,isFirstSegment:c===0,isLastSegment:c===f-1,isStreaming:e.isStreaming&&c===f-1,showAvatar:c===0,createdAt:e.createdAt,role:e.role,sendStatus:e.sendStatus,fromDeviceId:e.fromDeviceId}))}function Z3(e){return e.flatMap(r=>J3(r))}function bC({messages:e,isLoading:r,isSubscribing:n=!1,onSend:s,onSendAudio:o,onCancel:u,currentDeviceId:f,disabled:l=!1,emptyMessage:c="No messages yet. Start the conversation!",showVoice:h=!0,emptyIcon:m,agentType:p}){const _=R.useRef(null),[E,A]=R.useState(!1),[w,v]=R.useState(!0),S=R.useMemo(()=>Z3(e),[e]),g=R.useCallback(()=>{if(!_.current)return;const{scrollTop:T,scrollHeight:M,clientHeight:k}=_.current,D=M-T-k<100;v(D),A(!D&&e.length>0)},[e.length]);R.useEffect(()=>{_.current&&w&&(_.current.scrollTop=_.current.scrollHeight)},[S,w]),R.useEffect(()=>{const T=_.current;if(!T)return;let M=!1;const k=()=>{M||(requestAnimationFrame(()=>{g(),M=!1}),M=!0)};return T.addEventListener("scroll",k,{passive:!0}),()=>T.removeEventListener("scroll",k)},[g]);const y=R.useCallback(()=>{_.current&&_.current.scrollTo({top:_.current.scrollHeight,behavior:"smooth"})},[]);return b.jsxs("div",{className:"flex flex-col h-full",role:"main",children:[b.jsxs("div",{className:"relative flex-1",children:[b.jsx("div",{ref:_,className:"absolute inset-0 overflow-y-auto p-4",role:"log","aria-label":"Chat messages","aria-live":"polite",children:b.jsx("div",{className:"max-w-3xl mx-auto",children:n?b.jsx(W3,{count:3}):e.length===0?b.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[200px] text-center",role:"status","aria-label":c,children:[b.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mb-4","aria-hidden":"true",children:m||b.jsx(gs,{className:"w-8 h-8 text-muted-foreground"})}),b.jsx("p",{className:"text-muted-foreground",children:c})]}):S.map(T=>b.jsx(q3,{contentBlocks:T.contentBlocks,isUser:T.role==="user",isStreaming:T.isStreaming,showAvatar:T.showAvatar,isContinuation:!T.isFirstSegment,sendStatus:T.isLastSegment?T.sendStatus:void 0,isCurrentDevice:!T.fromDeviceId||T.fromDeviceId===f,fromDeviceId:T.isLastSegment?T.fromDeviceId:void 0,agentType:p},T.id))})}),b.jsx("button",{type:"button",onClick:y,className:Te("absolute bottom-4 right-4 z-10","w-10 h-10 rounded-full shadow-lg","bg-background border border-border","flex items-center justify-center","transition-all duration-200 ease-out","hover:bg-muted hover:shadow-xl","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",E?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none"),"aria-label":"Scroll to bottom","aria-hidden":!E,children:b.jsx(DM,{className:"w-5 h-5 text-muted-foreground"})})]}),b.jsx(z3,{onSend:s,onSendAudio:o,onCancel:u,isLoading:r,disabled:l,placeholder:l?"Not connected...":"Type a message...",showVoice:h})]})}function wC(){const{sessionId:e}=UC(),r=!e,n=R.useRef(new Set),s=Ge(H=>H.credentials),o=Ge(H=>H.connectionState),u=Ge(H=>H.sessions),f=ht(H=>H.supervisorMessages),l=ht(H=>H.supervisorIsLoading),c=ht(H=>H.agentMessages),h=ht(H=>H.agentIsLoading),{sendSupervisorCommand:m,cancelSupervisor:p,sendAgentCommand:_,cancelAgent:E,subscribeToSession:A,sendSupervisorVoiceCommand:w,sendAgentVoiceCommand:v}=co(),S=o==="verified"||o==="authenticated";R.useEffect(()=>{if(!e||r||!S||n.current.has(e))return;const H=u.find(U=>U.id===e);(H==null?void 0:H.type)!=="terminal"&&(n.current.add(e),A(e))},[e,r,S,u,A]);const g=e?u.find(H=>H.id===e):null,y=R.useCallback(H=>{m(H)},[m]),T=R.useCallback(H=>{e&&_(e,H)},[e,_]),M=R.useCallback(()=>{p()},[p]),k=R.useCallback(()=>{e&&E(e)},[e,E]),L=R.useCallback(async(H,U)=>{if(console.log("🎤 handleSupervisorAudio called:",{audioBlobSize:H.size,format:U,isConnected:S}),!S){console.error("❌ Not connected to WebSocket"),kr.error("Connection Error","Not connected to Tiflis. Please check your connection.");return}const $=new FileReader;$.onloadend=()=>{const te=$.result,Y=te.split(",")[1];if(console.log("🎤 Converting to base64:",{originalSize:te.length,base64Size:Y==null?void 0:Y.length}),Y)try{w(Y,U),console.log("✅ Voice command sent successfully")}catch(ie){console.error("❌ Failed to send voice command:",ie),kr.error("Voice Message Error","Failed to send voice message. Please try again.")}else console.error("❌ Failed to convert audio to base64"),kr.error("Voice Message Error","Failed to process audio. Please try recording again.")},$.onerror=te=>{console.error("❌ FileReader error:",te),kr.error("Voice Message Error","Failed to read audio file. Please try again.")},$.readAsDataURL(H)},[w,S]),D=R.useCallback(async(H,U)=>{if(console.log("🎤 handleAgentAudio called:",{sessionId:e,audioBlobSize:H.size,format:U,isConnected:S}),!e){console.error("❌ No session ID provided"),kr.error("Voice Message Error","No session active. Please select a session first.");return}if(!S){console.error("❌ Not connected to WebSocket"),kr.error("Connection Error","Not connected to Tiflis. Please check your connection.");return}const $=new FileReader;$.onloadend=()=>{const te=$.result,Y=te.split(",")[1];if(console.log("🎤 Converting to base64:",{originalSize:te.length,base64Size:Y==null?void 0:Y.length}),Y)try{v(e,Y,U),console.log("✅ Voice command sent successfully")}catch(ie){console.error("❌ Failed to send voice command:",ie),kr.error("Voice Message Error","Failed to send voice message. Please try again.")}else console.error("❌ Failed to convert audio to base64"),kr.error("Voice Message Error","Failed to process audio. Please try recording again.")},$.onerror=te=>{console.error("❌ FileReader error:",te),kr.error("Voice Message Error","Failed to read audio file. Please try again.")},$.readAsDataURL(H)},[e,v,S]),j=H=>{if(!H)return b.jsx(gs,{className:"w-8 h-8 text-muted-foreground"});switch(H.type){case"claude":return b.jsx(Sc,{className:"w-8 h-8 text-muted-foreground"});case"cursor":return b.jsx(bc,{className:"w-8 h-8 text-muted-foreground"});case"opencode":return b.jsx(Cc,{className:"w-8 h-8 text-muted-foreground"});default:return b.jsx(gs,{className:"w-8 h-8 text-muted-foreground"})}};if(r)return b.jsx(bC,{messages:f,isLoading:l,onSend:y,onSendAudio:L,onCancel:M,currentDeviceId:s==null?void 0:s.deviceId,disabled:!S,emptyMessage:"Hello! I'm your AI assistant. Ask me to create sessions, manage your workspace, or help with tasks.",emptyIcon:b.jsx(Jl,{className:"w-8 h-8 text-muted-foreground"}),agentType:"supervisor"});const K=c[e]??[],Q=h[e]??!1;return b.jsx(bC,{messages:K,isLoading:Q,onSend:T,onSendAudio:D,onCancel:k,currentDeviceId:s==null?void 0:s.deviceId,disabled:!S,emptyMessage:`Start a conversation with ${(g==null?void 0:g.agentName)??"the agent"}...`,emptyIcon:j(g??null),agentType:g==null?void 0:g.type})}var Fm={exports:{}},EC;function X3(){return EC||(EC=1,(function(e,r){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(f,l,c){var h=this&&this.__decorate||function(g,y,T,M){var k,L=arguments.length,D=L<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,y,T,M);else for(var j=g.length-1;j>=0;j--)(k=g[j])&&(D=(L<3?k(D):L>3?k(y,T,D):k(y,T))||D);return L>3&&D&&Object.defineProperty(y,T,D),D},m=this&&this.__param||function(g,y){return function(T,M){y(T,M,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const p=c(9042),_=c(9924),E=c(844),A=c(4725),w=c(2585),v=c(3656);let S=l.AccessibilityManager=class extends E.Disposable{constructor(g,y,T,M){super(),this._terminal=g,this._coreBrowserService=T,this._renderService=M,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 k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,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 _.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((k=>this._handleResize(k.rows)))),this.register(this._terminal.onRender((k=>this._refreshRows(k.start,k.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((k=>this._handleChar(k)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
401
+ `)))),this.register(this._terminal.onA11yTab((k=>this._handleTab(k)))),this.register(this._terminal.onKey((k=>this._handleKey(k.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,E.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(g){for(let y=0;y<g;y++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
402
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,y){this._liveRegionDebouncer.refresh(g,y,this._terminal.rows)}_renderRows(g,y){const T=this._terminal.buffer,M=T.lines.length.toString();for(let k=g;k<=y;k++){const L=T.lines.get(T.ydisp+k),D=[],j=(L==null?void 0:L.translateToString(!0,void 0,void 0,D))||"",K=(T.ydisp+k+1).toString(),Q=this._rowElements[k];Q&&(j.length===0?(Q.innerText=" ",this._rowColumns.set(Q,[0,1])):(Q.textContent=j,this._rowColumns.set(Q,D)),Q.setAttribute("aria-posinset",K),Q.setAttribute("aria-setsize",M))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,y){const T=g.target,M=this._rowElements[y===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==M)return;let k,L;if(y===0?(k=T,L=this._rowElements.pop(),this._rowContainer.removeChild(L)):(k=this._rowElements.shift(),L=T,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),L.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const D=this._createAccessibilityTreeNode();this._rowElements.unshift(D),this._rowContainer.insertAdjacentElement("afterbegin",D)}else{const D=this._createAccessibilityTreeNode();this._rowElements.push(D),this._rowContainer.appendChild(D)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:g.anchorNode,offset:g.anchorOffset},T={node:g.focusNode,offset:g.focusOffset};if((y.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===T.node&&y.offset>T.offset)&&([y,T]=[T,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const M=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(M)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:M,offset:((j=M.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(T.node))return;const k=({node:K,offset:Q})=>{const H=K instanceof Text?K.parentNode:K;let U=parseInt(H==null?void 0:H.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(H);if(!$)return console.warn("columns is null. Race condition?"),null;let te=Q<$.length?$[Q]:$.slice(-1)[0]+1;return te>=this._terminal.cols&&(++U,te=0),{row:U,column:te}},L=k(y),D=k(T);if(L&&D){if(L.row>D.row||L.row===D.row&&L.column>=D.column)throw new Error("invalid range");this._terminal.select(L.column,L.row,(D.row-L.row)*this._terminal.cols-L.column+D.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_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 g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=S=h([m(1,w.IInstantiationService),m(2,A.ICoreBrowserService),m(3,A.IRenderService)],S)},3614:(f,l)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function h(_,E){return E?"\x1B[200~"+_+"\x1B[201~":_}function m(_,E,A,w){_=h(_=c(_),A.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(_,!0),E.value=""}function p(_,E,A){const w=A.getBoundingClientRect(),v=_.clientX-w.left-10,S=_.clientY-w.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${v}px`,E.style.top=`${S}px`,E.style.zIndex="1000",E.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=h,l.copyHandler=function(_,E){_.clipboardData&&_.clipboardData.setData("text/plain",E.selectionText),_.preventDefault()},l.handlePasteEvent=function(_,E,A,w){_.stopPropagation(),_.clipboardData&&m(_.clipboardData.getData("text/plain"),E,A,w)},l.paste=m,l.moveTextAreaUnderMouseCursor=p,l.rightClickHandler=function(_,E,A,w,v){p(_,E,A),v&&w.rightClickSelect(_),E.value=w.selectionText,E.select()}},7239:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const h=c(1505);l.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(m,p,_){this._css.set(m,p,_)}getCss(m,p){return this._css.get(m,p)}setColor(m,p,_){this._color.set(m,p,_)}getColor(m,p){return this._color.get(m,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,h,m,p){c.addEventListener(h,m,p);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(h,m,p))}}}},3551:function(f,l,c){var h=this&&this.__decorate||function(S,g,y,T){var M,k=arguments.length,L=k<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,y):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,g,y,T);else for(var D=S.length-1;D>=0;D--)(M=S[D])&&(L=(k<3?M(L):k>3?M(g,y,L):M(g,y))||L);return k>3&&L&&Object.defineProperty(g,y,L),L},m=this&&this.__param||function(S,g){return function(y,T){g(y,T,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const p=c(3656),_=c(8460),E=c(844),A=c(2585),w=c(4725);let v=l.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(S,g,y,T,M){super(),this._element=S,this._mouseService=g,this._renderService=y,this._bufferService=T,this._linkProviderService=M,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,E.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,E.toDisposable)((()=>{var k;this._lastMouseEvent=void 0,(k=this._activeProviderReplies)==null||k.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const g=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const y=S.composedPath();for(let T=0;T<y.length;T++){const M=y[T];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,g){var T,M;this._activeProviderReplies&&g||((T=this._activeProviderReplies)==null||T.forEach((k=>{k==null||k.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let y=!1;for(const[k,L]of this._linkProviderService.linkProviders.entries())g?(M=this._activeProviderReplies)!=null&&M.get(k)&&(y=this._checkLinkProviderResult(k,S,y)):L.provideLinks(S.y,(D=>{var K,Q;if(this._isMouseOut)return;const j=D==null?void 0:D.map((H=>({link:H})));(K=this._activeProviderReplies)==null||K.set(k,j),y=this._checkLinkProviderResult(k,S,y),((Q=this._activeProviderReplies)==null?void 0:Q.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,g){const y=new Set;for(let T=0;T<g.size;T++){const M=g.get(T);if(M)for(let k=0;k<M.length;k++){const L=M[k],D=L.link.range.start.y<S?0:L.link.range.start.x,j=L.link.range.end.y>S?this._bufferService.cols:L.link.range.end.x;for(let K=D;K<=j;K++){if(y.has(K)){M.splice(k--,1);break}y.add(K)}}}}_checkLinkProviderResult(S,g,y){var k;if(!this._activeProviderReplies)return y;const T=this._activeProviderReplies.get(S);let M=!1;for(let L=0;L<S;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(M=!0);if(!M&&T){const L=T.find((D=>this._linkAtPosition(D.link,g)));L&&(y=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let L=0;L<this._activeProviderReplies.size;L++){const D=(k=this._activeProviderReplies.get(L))==null?void 0:k.find((j=>this._linkAtPosition(j.link,g)));if(D){y=!0,this._handleNewLink(D);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const g=this._positionFromMouseEvent(S,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,g){this._currentLink&&this._lastMouseEvent&&(!S||!g||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,E.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(S.link,g)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var y,T;return(T=(y=this._currentLink)==null?void 0:y.state)==null?void 0:T.decorations.pointerCursor},set:y=>{var T;(T=this._currentLink)!=null&&T.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,T;return(T=(y=this._currentLink)==null?void 0:y.state)==null?void 0:T.decorations.underline},set:y=>{var T,M,k;(T=this._currentLink)!=null&&T.state&&((k=(M=this._currentLink)==null?void 0:M.state)==null?void 0:k.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const T=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,M=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=M&&(this._clearCurrentLink(T,M),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}}))))}_linkHover(S,g,y){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(y,g.text)}_fireUnderlineEvent(S,g){const y=S.range,T=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-T-1,y.end.x,y.end.y-T-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)}_linkLeave(S,g,y){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(y,g.text)}_linkAtPosition(S,g){const y=S.range.start.y*this._bufferService.cols+S.range.start.x,T=S.range.end.y*this._bufferService.cols+S.range.end.x,M=g.y*this._bufferService.cols+g.x;return y<=M&&M<=T}_positionFromMouseEvent(S,g,y){const T=y.getCoords(S,g,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,g,y,T,M){return{x1:S,y1:g,x2:y,y2:T,cols:this._bufferService.cols,fg:M}}};l.Linkifier=v=h([m(1,w.IMouseService),m(2,w.IRenderService),m(3,A.IBufferService),m(4,w.ILinkProviderService)],v)},9042:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,l,c){var h=this&&this.__decorate||function(w,v,S,g){var y,T=arguments.length,M=T<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,v,S,g);else for(var k=w.length-1;k>=0;k--)(y=w[k])&&(M=(T<3?y(M):T>3?y(v,S,M):y(v,S))||M);return T>3&&M&&Object.defineProperty(v,S,M),M},m=this&&this.__param||function(w,v){return function(S,g){v(S,g,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const p=c(511),_=c(2585);let E=l.OscLinkProvider=class{constructor(w,v,S){this._bufferService=w,this._optionsService=v,this._oscLinkService=S}provideLinks(w,v){var j;const S=this._bufferService.buffer.lines.get(w-1);if(!S)return void v(void 0);const g=[],y=this._optionsService.rawOptions.linkHandler,T=new p.CellData,M=S.getTrimmedLength();let k=-1,L=-1,D=!1;for(let K=0;K<M;K++)if(L!==-1||S.hasContent(K)){if(S.loadCell(K,T),T.hasExtendedAttrs()&&T.extended.urlId){if(L===-1){L=K,k=T.extended.urlId;continue}D=T.extended.urlId!==k}else L!==-1&&(D=!0);if(D||L!==-1&&K===M-1){const Q=(j=this._oscLinkService.getLinkData(k))==null?void 0:j.uri;if(Q){const H={start:{x:L+1,y:w},end:{x:K+(D||K!==M-1?0:1),y:w}};let U=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const $=new URL(Q);["http:","https:"].includes($.protocol)||(U=!0)}catch{U=!0}U||g.push({text:Q,range:H,activate:($,te)=>y?y.activate($,te,H):A(0,te),hover:($,te)=>{var Y;return(Y=y==null?void 0:y.hover)==null?void 0:Y.call(y,$,te,H)},leave:($,te)=>{var Y;return(Y=y==null?void 0:y.leave)==null?void 0:Y.call(y,$,te,H)}})}D=!1,T.hasExtendedAttrs()&&T.extended.urlId?(L=K,k=T.extended.urlId):(L=-1,k=-1)}}v(g)}};function A(w,v){if(confirm(`Do you want to navigate to ${v}?
403
+
404
+ WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=E=h([m(0,_.IBufferService),m(1,_.IOptionsService),m(2,_.IOscLinkService)],E)},6193:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,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,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h: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,h):h,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),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const h=c(3614),m=c(3656),p=c(3551),_=c(9042),E=c(3730),A=c(1680),w=c(3107),v=c(5744),S=c(2950),g=c(1296),y=c(428),T=c(4269),M=c(5114),k=c(8934),L=c(3230),D=c(9312),j=c(4725),K=c(6731),Q=c(8055),H=c(8969),U=c(8460),$=c(844),te=c(6114),Y=c(8437),ie=c(2584),ee=c(7399),I=c(5941),z=c(9074),P=c(2585),G=c(5435),ne=c(4567),X=c(779);class Ce extends H.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(W={}){super(W),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(z.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(X.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((F,ue)=>this.refresh(F,ue)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((F=>this._reportWindowsOptions(F)))),this.register(this._inputHandler.onColor((F=>this._handleColorEvent(F)))),this.register((0,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((F=>this._afterResize(F.cols,F.rows)))),this.register((0,$.toDisposable)((()=>{var F,ue;this._customKeyEventHandler=void 0,(ue=(F=this.element)==null?void 0:F.parentNode)==null||ue.removeChild(this.element)})))}_handleColorEvent(W){if(this._themeService)for(const F of W){let ue,oe="";switch(F.index){case 256:ue="foreground",oe="10";break;case 257:ue="background",oe="11";break;case 258:ue="cursor",oe="12";break;default:ue="ansi",oe="4;"+F.index}switch(F.type){case 0:const de=Q.color.toColorRGB(ue==="ansi"?this._themeService.colors.ansi[F.index]:this._themeService.colors[ue]);this.coreService.triggerDataEvent(`${ie.C0.ESC}]${oe};${(0,I.toRgbString)(de)}${ie.C1_ESCAPED.ST}`);break;case 1:if(ue==="ansi")this._themeService.modifyColors((he=>he.ansi[F.index]=Q.channels.toColor(...F.color)));else{const he=ue;this._themeService.modifyColors((De=>De[he]=Q.channels.toColor(...F.color)))}break;case 2:this._themeService.restoreColor(F.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ne.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ie.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ie.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 W=this.buffer.ybase+this.buffer.y,F=this.buffer.lines.get(W);if(!F)return;const ue=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,de=F.getWidth(ue),he=this._renderService.dimensions.css.cell.width*de,De=this.buffer.y*this._renderService.dimensions.css.cell.height,Ie=ue*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ie+"px",this.textarea.style.top=De+"px",this.textarea.style.width=he+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(F=>{this.hasSelection()&&(0,h.copyHandler)(F,this._selectionService)})));const W=F=>(0,h.handlePasteEvent)(F,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,m.addDisposableDomListener)(this.element,"paste",W)),te.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(F=>{F.button===2&&(0,h.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(F=>{(0,h.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(F=>{F.button===1&&(0,h.moveTextAreaUnderMouseCursor)(F,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(W=>this._keyUp(W)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(W=>this._keyDown(W)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(W=>this._keyPress(W)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(W=>this._compositionHelper.compositionupdate(W)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(W=>this._inputEvent(W)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(W){var ue;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ue=this.element)==null?void 0:ue.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.appendChild(this.element);const F=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),F.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,m.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),F.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),te.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(M.CoreBrowserService,this.textarea,W.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(K.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(T.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(L.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(p.Linkifier,this.screenElement)),this.element.appendChild(F);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.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(D.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(ne.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,F=this.element;function ue(he){const De=W._mouseService.getMouseReportCoords(he,W.screenElement);if(!De)return!1;let Ie,Fe;switch(he.overrideType||he.type){case"mousemove":Fe=32,he.buttons===void 0?(Ie=3,he.button!==void 0&&(Ie=he.button<3?he.button:3)):Ie=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Fe=0,Ie=he.button<3?he.button:3;break;case"mousedown":Fe=1,Ie=he.button<3?he.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(he)===!1||W.viewport.getLinesScrolled(he)===0)return!1;Fe=he.deltaY<0?0:1,Ie=4;break;default:return!1}return!(Fe===void 0||Ie===void 0||Ie>4)&&W.coreMouseService.triggerMouseEvent({col:De.col,row:De.row,x:De.x,y:De.y,button:Ie,action:Fe,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:he=>(ue(he),he.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(he)),wheel:he=>(ue(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ue(he)},mousemove:he=>{he.buttons||ue(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),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&he?oe.mousemove||(F.addEventListener("mousemove",de.mousemove),oe.mousemove=de.mousemove):(F.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&he?oe.wheel||(F.addEventListener("wheel",de.wheel,{passive:!1}),oe.wheel=de.wheel):(F.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&he?oe.mouseup||(oe.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&he?oe.mousedrag||(oe.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(F,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ue(he),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(he)}))),this.register((0,m.addDisposableDomListener)(F,"wheel",(he=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const De=this.viewport.getLinesScrolled(he);if(De===0)return;const Ie=ie.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Fe="";for(let je=0;je<Math.abs(De);je++)Fe+=Ie;return this.coreService.triggerDataEvent(Fe,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(F,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(F,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(W,F){var ue;(ue=this._renderService)==null||ue.refreshRows(W,F)}updateCursorStyle(W){var F;(F=this._selectionService)!=null&&F.shouldColumnSelect(W)?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(W,F,ue=0){var oe;ue===1?(super.scrollLines(W,F,ue),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(W)}paste(W){(0,h.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const F=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),F}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,F,ue){this._selectionService.setSelection(W,F,ue)}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(){var W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,F){var ue;(ue=this._selectionService)==null||ue.selectLines(W,F)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const F=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!F&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;F||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ue=(0,ee.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),ue.type===3||ue.type===2){const oe=this.rows-1;return this.scrollLines(ue.type===2?-oe:oe),this.cancel(W,!0)}return ue.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(ue.cancel&&this.cancel(W,!0),!ue.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ue.key!==ie.C0.ETX&&ue.key!==ie.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ue.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(ue.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,F){const ue=W.isMac&&!this.options.macOptionIsMeta&&F.altKey&&!F.ctrlKey&&!F.metaKey||W.isWindows&&F.altKey&&F.ctrlKey&&!F.metaKey||W.isWindows&&F.getModifierState("AltGraph");return F.type==="keypress"?ue:ue&&(!F.keyCode||F.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||((function(F){return F.keyCode===16||F.keyCode===17||F.keyCode===18})(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let F;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)F=W.charCode;else if(W.which===null||W.which===void 0)F=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;F=W.which}return!(!F||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||(F=String.fromCharCode(F),this._onKey.fire({key:F,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(F,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const F=W.data;return this.coreService.triggerDataEvent(F,!0),this.cancel(W),!0}return!1}resize(W,F){W!==this.cols||F!==this.rows?super.resize(W,F):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,F){var ue,oe;(ue=this._charSizeService)==null||ue.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var W;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 F=1;F<this.rows;F++)this.buffer.lines.push(this.buffer.getBlankLine(Y.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var F,ue;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(F=this._selectionService)==null||F.reset(),this._decorationService.reset(),(ue=this.viewport)==null||ue.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(ie.C0.ESC+"[I"):this.coreService.triggerDataEvent(ie.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case G.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const F=this._renderService.dimensions.css.canvas.width.toFixed(0),ue=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ie.C0.ESC}[4;${ue};${F}t`);break;case G.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ie.C0.ESC}[6;${de};${oe}t`)}}cancel(W,F){if(this.options.cancelEvents||F)return W.preventDefault(),W.stopPropagation(),!1}}l.Terminal=Ce},9924:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h: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,h):h;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=p-this._lastRefreshMs,E=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),E)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,l,c){var h=this&&this.__decorate||function(S,g,y,T){var M,k=arguments.length,L=k<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,y):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,g,y,T);else for(var D=S.length-1;D>=0;D--)(M=S[D])&&(L=(k<3?M(L):k>3?M(g,y,L):M(g,y))||L);return k>3&&L&&Object.defineProperty(g,y,L),L},m=this&&this.__param||function(S,g){return function(y,T){g(y,T,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const p=c(3656),_=c(4725),E=c(8460),A=c(844),w=c(2585);let v=l.Viewport=class extends A.Disposable{constructor(S,g,y,T,M,k,L,D){super(),this._viewportElement=S,this._scrollArea=g,this._bufferService=y,this._optionsService=T,this._charSizeService=M,this._renderService=k,this._coreBrowserService=L,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 E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(D.colors),this.register(D.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.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(S){if(S)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 g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){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 g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<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(S,g){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&y<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const g=this._getPixelsScrolled(S);return g!==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+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(S,g))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let g=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(S,g){var D;let y,T="";const M=[],k=g??this._bufferService.buffer.lines.length,L=this._bufferService.buffer.lines;for(let j=S;j<k;j++){const K=L.get(j);if(!K)continue;const Q=(D=L.get(j+1))==null?void 0:D.isWrapped;if(T+=K.translateToString(!Q),!Q||j===L.length-1){const H=document.createElement("div");H.textContent=T,M.push(H),T.length>0&&(y=H),T=""}}return{bufferElements:M,cursorElement:y}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let g=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(S,g){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&g.altKey||y==="ctrl"&&g.ctrlKey||y==="shift"&&g.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const g=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(S,g))}};l.Viewport=v=h([m(2,w.IBufferService),m(3,w.IOptionsService),m(4,_.ICharSizeService),m(5,_.IRenderService),m(6,_.ICoreBrowserService),m(7,_.IThemeService)],v)},3107:function(f,l,c){var h=this&&this.__decorate||function(w,v,S,g){var y,T=arguments.length,M=T<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,v,S,g);else for(var k=w.length-1;k>=0;k--)(y=w[k])&&(M=(T<3?y(M):T>3?y(v,S,M):y(v,S))||M);return T>3&&M&&Object.defineProperty(v,S,M),M},m=this&&this.__param||function(w,v){return function(S,g){v(S,g,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const p=c(4725),_=c(844),E=c(2585);let A=l.BufferDecorationRenderer=class extends _.Disposable{constructor(w,v,S,g,y){super(),this._screenElement=w,this._bufferService=v,this._coreBrowserService=S,this._decorationService=g,this._renderService=y,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((T=>this._removeDecoration(T)))),this.register((0,_.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 w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var g;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((g=w==null?void 0:w.options)==null?void 0:g.layer)==="top"),v.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=w.options.x??0;return S&&S>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(w,v),v}_refreshStyle(w){const v=w.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let S=this._decorationElements.get(w);S||(S=this._createElement(w),w.element=S,this._decorationElements.set(w,S),this._container.appendChild(S),w.onDispose((()=>{this._decorationElements.delete(w),S.remove()}))),S.style.top=v*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(S)}}_refreshXPosition(w,v=w.element){if(!v)return;const S=w.options.x??0;(w.options.anchor||"left")==="right"?v.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var v;(v=this._decorationElements.get(w))==null||v.remove(),this._decorationElements.delete(w),w.dispose()}};l.BufferDecorationRenderer=A=h([m(1,E.IBufferService),m(2,p.ICoreBrowserService),m(3,E.IDecorationService),m(4,p.IRenderService)],A)},5871:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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 h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,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,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,m){return h>=c.startBufferLine-this._linePadding[m||"full"]&&h<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,l,c){var h=this&&this.__decorate||function(y,T,M,k){var L,D=arguments.length,j=D<3?T:k===null?k=Object.getOwnPropertyDescriptor(T,M):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,T,M,k);else for(var K=y.length-1;K>=0;K--)(L=y[K])&&(j=(D<3?L(j):D>3?L(T,M,j):L(T,M))||j);return D>3&&j&&Object.defineProperty(T,M,j),j},m=this&&this.__param||function(y,T){return function(M,k){T(M,k,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const p=c(5871),_=c(4725),E=c(844),A=c(2585),w={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let g=l.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,T,M,k,L,D,j){var Q;super(),this._viewportElement=y,this._screenElement=T,this._bufferService=M,this._decorationService=k,this._renderService=L,this._optionsService=D,this._coreBrowserService=j,this._colorZoneStore=new p.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(),(Q=this._viewportElement.parentElement)==null||Q.insertBefore(this._canvas,this._viewportElement);const K=this._canvas.getContext("2d");if(!K)throw new Error("Ctx cannot be null");this._ctx=K,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,E.toDisposable)((()=>{var H;(H=this._canvas)==null||H.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 y=Math.floor(this._canvas.width/3),T=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=T,v.right=y,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=v.left,S.right=v.left+v.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,T=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);w.left=T,w.center=T,w.right=T}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.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 T of this._decorationService.decorations)this._colorZoneStore.addDecoration(T);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const T of y)T.position!=="full"&&this._renderColorZone(T);for(const T of y)T.position==="full"&&this._renderColorZone(T);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(S[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-w[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[y.position||"full"]))}_queueRefresh(y,T){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=T||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=g=h([m(2,A.IBufferService),m(3,A.IDecorationService),m(4,_.IRenderService),m(5,A.IOptionsService),m(6,_.ICoreBrowserService)],g)},2950:function(f,l,c){var h=this&&this.__decorate||function(w,v,S,g){var y,T=arguments.length,M=T<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,v,S,g);else for(var k=w.length-1;k>=0;k--)(y=w[k])&&(M=(T<3?y(M):T>3?y(v,S,M):y(v,S))||M);return T>3&&M&&Object.defineProperty(v,S,M),M},m=this&&this.__param||function(w,v){return function(S,g){v(S,g,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const p=c(4725),_=c(2585),E=c(2584);let A=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,v,S,g,y,T){this._textarea=w,this._compositionView=v,this._bufferService=S,this._optionsService=g,this._coreService=y,this._renderService=T,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(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,S=v.replace(w,"");this._dataAlreadySent=S,v.length>w.length?this._coreService.triggerDataEvent(S,!0):v.length<w.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):v.length===w.length&&v!==w&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const T=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=g+"px",this._textarea.style.width=Math.max(T.width,1)+"px",this._textarea.style.height=Math.max(T.height,1)+"px",this._textarea.style.lineHeight=T.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=A=h([m(2,_.IBufferService),m(3,_.IOptionsService),m(4,_.ICoreService),m(5,p.IRenderService)],A)},9806:(f,l)=>{function c(h,m,p){const _=p.getBoundingClientRect(),E=h.getComputedStyle(p),A=parseInt(E.getPropertyValue("padding-left")),w=parseInt(E.getPropertyValue("padding-top"));return[m.clientX-_.left-A,m.clientY-_.top-w]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(h,m,p,_,E,A,w,v,S){if(!A)return;const g=c(h,m,p);return g?(g[0]=Math.ceil((g[0]+(S?w/2:0))/w),g[1]=Math.ceil(g[1]/v),g[0]=Math.min(Math.max(g[0],1),_+(S?1:0)),g[1]=Math.min(Math.max(g[1],1),E),g):void 0}},9504:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const h=c(2584);function m(v,S,g,y){const T=v-p(v,g),M=S-p(S,g),k=Math.abs(T-M)-(function(L,D,j){let K=0;const Q=L-p(L,j),H=D-p(D,j);for(let U=0;U<Math.abs(Q-H);U++){const $=_(L,D)==="A"?-1:1,te=j.buffer.lines.get(Q+$*U);te!=null&&te.isWrapped&&K++}return K})(v,S,g);return w(k,A(_(v,S),y))}function p(v,S){let g=0,y=S.buffer.lines.get(v),T=y==null?void 0:y.isWrapped;for(;T&&v>=0&&v<S.rows;)g++,y=S.buffer.lines.get(--v),T=y==null?void 0:y.isWrapped;return g}function _(v,S){return v>S?"A":"B"}function E(v,S,g,y,T,M){let k=v,L=S,D="";for(;k!==g||L!==y;)k+=T?1:-1,T&&k>M.cols-1?(D+=M.buffer.translateBufferLineToString(L,!1,v,k),k=0,v=0,L++):!T&&k<0&&(D+=M.buffer.translateBufferLineToString(L,!1,0,v+1),k=M.cols-1,v=k,L--);return D+M.buffer.translateBufferLineToString(L,!1,v,k)}function A(v,S){const g=S?"O":"[";return h.C0.ESC+g+v}function w(v,S){v=Math.floor(v);let g="";for(let y=0;y<v;y++)g+=S;return g}l.moveToCellSequence=function(v,S,g,y){const T=g.buffer.x,M=g.buffer.y;if(!g.buffer.hasScrollback)return(function(D,j,K,Q,H,U){return m(j,Q,H,U).length===0?"":w(E(D,j,D,j-p(j,H),!1,H).length,A("D",U))})(T,M,0,S,g,y)+m(M,S,g,y)+(function(D,j,K,Q,H,U){let $;$=m(j,Q,H,U).length>0?Q-p(Q,H):j;const te=Q,Y=(function(ie,ee,I,z,P,G){let ne;return ne=m(I,z,P,G).length>0?z-p(z,P):ee,ie<I&&ne<=z||ie>=I&&ne<z?"C":"D"})(D,j,K,Q,H,U);return w(E(D,$,K,te,Y==="C",H).length,A(Y,U))})(T,M,v,S,g,y);let k;if(M===S)return k=T>v?"D":"C",w(Math.abs(T-v),A(k,y));k=M>S?"D":"C";const L=Math.abs(M-S);return w((function(D,j){return j.cols-D})(M>S?v:T,g)+(L-1)*g.cols+1+((M>S?T:v)-1),A(k,y))}},1296:function(f,l,c){var h=this&&this.__decorate||function(U,$,te,Y){var ie,ee=arguments.length,I=ee<3?$:Y===null?Y=Object.getOwnPropertyDescriptor($,te):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(U,$,te,Y);else for(var z=U.length-1;z>=0;z--)(ie=U[z])&&(I=(ee<3?ie(I):ee>3?ie($,te,I):ie($,te))||I);return ee>3&&I&&Object.defineProperty($,te,I),I},m=this&&this.__param||function(U,$){return function(te,Y){$(te,Y,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const p=c(3787),_=c(2550),E=c(2223),A=c(6171),w=c(6052),v=c(4725),S=c(8055),g=c(8460),y=c(844),T=c(2585),M="xterm-dom-renderer-owner-",k="xterm-rows",L="xterm-fg-",D="xterm-bg-",j="xterm-focus",K="xterm-selection";let Q=1,H=l.DomRenderer=class extends y.Disposable{constructor(U,$,te,Y,ie,ee,I,z,P,G,ne,X,Ce){super(),this._terminal=U,this._document=$,this._element=te,this._screenElement=Y,this._viewportElement=ie,this._helperContainer=ee,this._linkifier2=I,this._charSizeService=P,this._optionsService=G,this._bufferService=ne,this._coreBrowserService=X,this._themeService=Ce,this._terminalClass=Q++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),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(K),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((fe=>this._injectCss(fe)))),this._injectCss(this._themeService.colors),this._rowFactory=z.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(M+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((fe=>this._handleLinkHover(fe)))),this.register(this._linkifier2.onHideLinkUnderline((fe=>this._handleLinkLeave(fe)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(M+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.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 U=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*U,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*U),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/U),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/U),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 te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,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(U){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${k} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${k} .xterm-dim { color: ${S.color.multiplyOpacity(U.foreground,.5).css};}`,$+=`${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 te=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,ie=`blink_block_${this._terminalClass}`;$+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,$+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,$+=`@keyframes ${ie} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,$+=`${this._terminalSelector} .${k}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${k}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${k}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ie} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${K} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${K} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${K} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,I]of U.ansi.entries())$+=`${this._terminalSelector} .${L}${ee} { color: ${I.css}; }${this._terminalSelector} .${L}${ee}.xterm-dim { color: ${S.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${D}${ee} { background-color: ${I.css}; }`;$+=`${this._terminalSelector} .${L}${E.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(U.background).css}; }${this._terminalSelector} .${L}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${D}${E.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const U=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${U}px`,this._rowFactory.defaultSpacing=U}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(U,$){for(let te=this._rowElements.length;te<=$;te++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,$){this._refreshRowElements(U,$),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(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,$,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,$,te),this.renderRows(0,this._bufferService.rows-1),!U||!$)return;this._selectionRenderModel.update(this._terminal,U,$,te);const Y=this._selectionRenderModel.viewportStartRow,ie=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||I<0)return;const z=this._document.createDocumentFragment();if(te){const P=U[0]>$[0];z.appendChild(this._createSelectionElement(ee,P?$[0]:U[0],P?U[0]:$[0],I-ee+1))}else{const P=Y===ee?U[0]:0,G=ee===ie?$[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(ee,P,G));const ne=I-ee-1;if(z.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,ne)),ee!==I){const X=ie===I?$[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(I,0,X))}}this._selectionContainer.appendChild(z)}_createSelectionElement(U,$,te,Y=1){const ie=this._document.createElement("div"),ee=$*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(te-$);return ee+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-ee),ie.style.height=Y*this.dimensions.css.cell.height+"px",ie.style.top=U*this.dimensions.css.cell.height+"px",ie.style.left=`${ee}px`,ie.style.width=`${I}px`,ie}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 U of this._rowElements)U.replaceChildren()}renderRows(U,$){const te=this._bufferService.buffer,Y=te.ybase+te.y,ie=Math.min(te.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=U;P<=$;P++){const G=P+te.ydisp,ne=this._rowElements[P],X=te.lines.get(G);if(!ne||!X)break;ne.replaceChildren(...this._rowFactory.createRow(X,G,G===Y,I,z,ie,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!0)}_handleLinkLeave(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!1)}_setCellUnderline(U,$,te,Y,ie,ee){te<0&&(U=0),Y<0&&($=0);const I=this._bufferService.rows-1;te=Math.max(Math.min(te,I),0),Y=Math.max(Math.min(Y,I),0),ie=Math.min(ie,this._bufferService.cols);const z=this._bufferService.buffer,P=z.ybase+z.y,G=Math.min(z.x,ie-1),ne=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,Ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let fe=te;fe<=Y;++fe){const W=fe+z.ydisp,F=this._rowElements[fe],ue=z.lines.get(W);if(!F||!ue)break;F.replaceChildren(...this._rowFactory.createRow(ue,W,W===P,X,Ce,G,ne,this.dimensions.css.cell.width,this._widthCache,ee?fe===te?U:0:-1,ee?(fe===Y?$:ie)-1:-1))}}};l.DomRenderer=H=h([m(7,T.IInstantiationService),m(8,v.ICharSizeService),m(9,T.IOptionsService),m(10,T.IBufferService),m(11,v.ICoreBrowserService),m(12,v.IThemeService)],H)},3787:function(f,l,c){var h=this&&this.__decorate||function(k,L,D,j){var K,Q=arguments.length,H=Q<3?L:j===null?j=Object.getOwnPropertyDescriptor(L,D):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(k,L,D,j);else for(var U=k.length-1;U>=0;U--)(K=k[U])&&(H=(Q<3?K(H):Q>3?K(L,D,H):K(L,D))||H);return Q>3&&H&&Object.defineProperty(L,D,H),H},m=this&&this.__param||function(k,L){return function(D,j){L(D,j,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const p=c(2223),_=c(643),E=c(511),A=c(2585),w=c(8055),v=c(4725),S=c(4269),g=c(6171),y=c(3734);let T=l.DomRendererRowFactory=class{constructor(k,L,D,j,K,Q,H){this._document=k,this._characterJoinerService=L,this._optionsService=D,this._coreBrowserService=j,this._coreService=K,this._decorationService=Q,this._themeService=H,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,L,D){this._selectionStart=k,this._selectionEnd=L,this._columnSelectMode=D}createRow(k,L,D,j,K,Q,H,U,$,te,Y){const ie=[],ee=this._characterJoinerService.getJoinedCharacters(L),I=this._themeService.colors;let z,P=k.getNoBgTrimmedLength();D&&P<Q+1&&(P=Q+1);let G=0,ne="",X=0,Ce=0,fe=0,W=!1,F=0,ue=!1,oe=0;const de=[],he=te!==-1&&Y!==-1;for(let De=0;De<P;De++){k.loadCell(De,this._workCell);let Ie=this._workCell.getWidth();if(Ie===0)continue;let Fe=!1,je=De,Oe=this._workCell;if(ee.length>0&&De===ee[0][0]){Fe=!0;const ot=ee.shift();Oe=new S.JoinedCellData(this._workCell,k.translateToString(!0,ot[0],ot[1]),ot[1]-ot[0]),je=ot[1]-1,Ie=Oe.getWidth()}const Mt=this._isCellInSelection(De,L),At=D&&De===Q,Ht=he&&De>=te&&De<=Y;let Tt=!1;this._decorationService.forEachDecorationAtCell(De,L,void 0,(ot=>{Tt=!0}));let Cn=Oe.getChars()||_.WHITESPACE_CELL_CHAR;if(Cn===" "&&(Oe.isUnderline()||Oe.isOverline())&&(Cn=" "),oe=Ie*U-$.get(Cn,Oe.isBold(),Oe.isItalic()),z){if(G&&(Mt&&ue||!Mt&&!ue&&Oe.bg===X)&&(Mt&&ue&&I.selectionForeground||Oe.fg===Ce)&&Oe.extended.ext===fe&&Ht===W&&oe===F&&!At&&!Fe&&!Tt){Oe.isInvisible()?ne+=_.WHITESPACE_CELL_CHAR:ne+=Cn,G++;continue}G&&(z.textContent=ne),z=this._document.createElement("span"),G=0,ne=""}else z=this._document.createElement("span");if(X=Oe.bg,Ce=Oe.fg,fe=Oe.extended.ext,W=Ht,F=oe,ue=Mt,Fe&&Q>=De&&Q<=je&&(Q=De),!this._coreService.isCursorHidden&&At&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)H&&de.push("xterm-cursor-blink"),de.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(K)switch(K){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(Oe.isBold()&&de.push("xterm-bold"),Oe.isItalic()&&de.push("xterm-italic"),Oe.isDim()&&de.push("xterm-dim"),ne=Oe.isInvisible()?_.WHITESPACE_CELL_CHAR:Oe.getChars()||_.WHITESPACE_CELL_CHAR,Oe.isUnderline()&&(de.push(`xterm-underline-${Oe.extended.underlineStyle}`),ne===" "&&(ne=" "),!Oe.isUnderlineColorDefault()))if(Oe.isUnderlineColorRGB())z.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Oe.getUnderlineColor()).join(",")})`;else{let ot=Oe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Oe.isBold()&&ot<8&&(ot+=8),z.style.textDecorationColor=I.ansi[ot].css}Oe.isOverline()&&(de.push("xterm-overline"),ne===" "&&(ne=" ")),Oe.isStrikethrough()&&de.push("xterm-strikethrough"),Ht&&(z.style.textDecoration="underline");let Zt=Oe.getFgColor(),kt=Oe.getFgColorMode(),ar=Oe.getBgColor(),Yr=Oe.getBgColorMode();const bn=!!Oe.isInverse();if(bn){const ot=Zt;Zt=ar,ar=ot;const gr=kt;kt=Yr,Yr=gr}let pr,un,mr,Or=!1;switch(this._decorationService.forEachDecorationAtCell(De,L,void 0,(ot=>{ot.options.layer!=="top"&&Or||(ot.backgroundColorRGB&&(Yr=50331648,ar=ot.backgroundColorRGB.rgba>>8&16777215,pr=ot.backgroundColorRGB),ot.foregroundColorRGB&&(kt=50331648,Zt=ot.foregroundColorRGB.rgba>>8&16777215,un=ot.foregroundColorRGB),Or=ot.options.layer==="top")})),!Or&&Mt&&(pr=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,ar=pr.rgba>>8&16777215,Yr=50331648,Or=!0,I.selectionForeground&&(kt=50331648,Zt=I.selectionForeground.rgba>>8&16777215,un=I.selectionForeground)),Or&&de.push("xterm-decoration-top"),Yr){case 16777216:case 33554432:mr=I.ansi[ar],de.push(`xterm-bg-${ar}`);break;case 50331648:mr=w.channels.toColor(ar>>16,ar>>8&255,255&ar),this._addStyle(z,`background-color:#${M((ar>>>0).toString(16),"0",6)}`);break;default:bn?(mr=I.foreground,de.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):mr=I.background}switch(pr||Oe.isDim()&&(pr=w.color.multiplyOpacity(mr,.5)),kt){case 16777216:case 33554432:Oe.isBold()&&Zt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Zt+=8),this._applyMinimumContrast(z,mr,I.ansi[Zt],Oe,pr,void 0)||de.push(`xterm-fg-${Zt}`);break;case 50331648:const ot=w.channels.toColor(Zt>>16&255,Zt>>8&255,255&Zt);this._applyMinimumContrast(z,mr,ot,Oe,pr,un)||this._addStyle(z,`color:#${M(Zt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(z,mr,I.foreground,Oe,pr,un)||bn&&de.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}de.length&&(z.className=de.join(" "),de.length=0),At||Fe||Tt?z.textContent=ne:G++,oe!==this.defaultSpacing&&(z.style.letterSpacing=`${oe}px`),ie.push(z),De=je}return z&&G&&(z.textContent=ne),ie}_applyMinimumContrast(k,L,D,j,K,Q){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const H=this._getContrastCache(j);let U;if(K||Q||(U=H.getColor(L.rgba,D.rgba)),U===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);U=w.color.ensureContrastRatio(K||L,Q||D,$),H.setColor((K||L).rgba,(Q||D).rgba,U??null)}return!!U&&(this._addStyle(k,`color:${U.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,L){k.setAttribute("style",`${k.getAttribute("style")||""}${L};`)}_isCellInSelection(k,L){const D=this._selectionStart,j=this._selectionEnd;return!(!D||!j)&&(this._columnSelectMode?D[0]<=j[0]?k>=D[0]&&L>=D[1]&&k<j[0]&&L<=j[1]:k<D[0]&&L>=D[1]&&k>=j[0]&&L<=j[1]:L>D[1]&&L<j[1]||D[1]===j[1]&&L===D[1]&&k>=D[0]&&k<j[0]||D[1]<j[1]&&L===j[1]&&k<j[0]||D[1]<j[1]&&L===D[1]&&k>=D[0])}};function M(k,L,D){for(;k.length<D;)k=L+k;return k}l.DomRendererRowFactory=T=h([m(1,v.ICharacterJoinerService),m(2,A.IOptionsService),m(3,v.ICoreBrowserService),m(4,A.ICoreService),m(5,A.IDecorationService),m(6,v.IThemeService)],T)},2550:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(c,h){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 m=c.createElement("span");m.classList.add("xterm-char-measure-element");const p=c.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const E=c.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[m,p,_,E],this._container.appendChild(m),this._container.appendChild(p),this._container.appendChild(_),this._container.appendChild(E),h.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,h,m,p){c===this._font&&h===this._fontSize&&m===this._weight&&p===this._weightBold||(this._font=c,this._fontSize=h,this._weight=m,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(c,h,m){let p=0;if(!h&&!m&&c.length===1&&(p=c.charCodeAt(0))<256){if(this._flat[p]!==-9999)return this._flat[p];const A=this._measure(c,0);return A>0&&(this._flat[p]=A),A}let _=c;h&&(_+="B"),m&&(_+="I");let E=this._holey.get(_);if(E===void 0){let A=0;h&&(A|=1),m&&(A|=2),E=this._measure(c,A),E>0&&this._holey.set(_,E)}return E}_measure(c,h){const m=this._measureElements[h];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,l)=>{function c(m){return 57508<=m&&m<=57558}function h(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},l.isEmoji=h,l.allowRescaling=function(m,p,_,E){return p===1&&_>Math.ceil(1.5*E)&&m!==void 0&&m>255&&!h(m)&&!c(m)&&!(function(A){return 57344<=A&&A<=63743})(m)},l.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(p){return 9472<=p&&p<=9631})(m)},l.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}}}},l.computeNextVariantOffset=function(m,p,_=0){return(m-(2*Math.round(p)-_))%(2*Math.round(p))}},6052:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.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(m,p,_,E=!1){if(this.selectionStart=p,this.selectionEnd=_,!p||!_||p[0]===_[0]&&p[1]===_[1])return void this.clear();const A=m.buffers.active.ydisp,w=p[1]-A,v=_[1]-A,S=Math.max(w,0),g=Math.min(v,m.rows-1);S>=m.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=w,this.viewportEndRow=v,this.viewportCappedStartRow=S,this.viewportCappedEndRow=g,this.startCol=p[0],this.endCol=_[0])}isCellSelected(m,p,_){return!!this.hasSelection&&(_-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?p>=this.startCol&&_>=this.viewportCappedStartRow&&p<this.endCol&&_<=this.viewportCappedEndRow:p<this.startCol&&_>=this.viewportCappedStartRow&&p>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&p>=this.startCol&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&p>=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.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,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[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(f,l,c){var h=this&&this.__decorate||function(g,y,T,M){var k,L=arguments.length,D=L<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,y,T,M);else for(var j=g.length-1;j>=0;j--)(k=g[j])&&(D=(L<3?k(D):L>3?k(y,T,D):k(y,T))||D);return L>3&&D&&Object.defineProperty(y,T,D),D},m=this&&this.__param||function(g,y){return function(T,M){y(T,M,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const p=c(2585),_=c(8460),E=c(844);let A=l.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,y,T){super(),this._optionsService=T,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new v(g,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};l.CharSizeService=A=h([m(2,p.IOptionsService)],A);class w extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,T){y!==void 0&&y>0&&T!==void 0&&T>0&&(this._result.width=y,this._result.height=T)}}class v extends w{constructor(y,T,M){super(),this._document=y,this._parentElement=T,this._optionsService=M,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 S extends w{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const T=this._ctx.measureText("W");if(!("width"in T&&"fontBoundingBoxAscent"in T&&"fontBoundingBoxDescent"in T))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(f,l,c){var h=this&&this.__decorate||function(S,g,y,T){var M,k=arguments.length,L=k<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,y):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,g,y,T);else for(var D=S.length-1;D>=0;D--)(M=S[D])&&(L=(k<3?M(L):k>3?M(g,y,L):M(g,y))||L);return k>3&&L&&Object.defineProperty(g,y,L),L},m=this&&this.__param||function(S,g){return function(y,T){g(y,T,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const p=c(3734),_=c(643),E=c(511),A=c(2585);class w extends p.AttributeData{constructor(g,y,T){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=y,this._width=T}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=w;let v=l.CharacterJoinerService=class hA{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(g){const y={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(y),y.id}deregister(g){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===g)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(g);if(!y||y.length===0)return[];const T=[],M=y.translateToString(!0);let k=0,L=0,D=0,j=y.getFg(0),K=y.getBg(0);for(let Q=0;Q<y.getTrimmedLength();Q++)if(y.loadCell(Q,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==K){if(Q-k>1){const H=this._getJoinedRanges(M,D,L,y,k);for(let U=0;U<H.length;U++)T.push(H[U])}k=Q,D=L,j=this._workCell.fg,K=this._workCell.bg}L+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const Q=this._getJoinedRanges(M,D,L,y,k);for(let H=0;H<Q.length;H++)T.push(Q[H])}return T}_getJoinedRanges(g,y,T,M,k){const L=g.substring(y,T);let D=[];try{D=this._characterJoiners[0].handler(L)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const K=this._characterJoiners[j].handler(L);for(let Q=0;Q<K.length;Q++)hA._mergeRanges(D,K[Q])}catch(K){console.error(K)}return this._stringRangesToCellRanges(D,M,k),D}_stringRangesToCellRanges(g,y,T){let M=0,k=!1,L=0,D=g[M];if(D){for(let j=T;j<this._bufferService.cols;j++){const K=y.getWidth(j),Q=y.getString(j).length||_.WHITESPACE_CELL_CHAR.length;if(K!==0){if(!k&&D[0]<=L&&(D[0]=j,k=!0),D[1]<=L){if(D[1]=j,D=g[++M],!D)break;D[0]<=L?(D[0]=j,k=!0):k=!1}L+=Q}}D&&(D[1]=this._bufferService.cols)}}static _mergeRanges(g,y){let T=!1;for(let M=0;M<g.length;M++){const k=g[M];if(T){if(y[1]<=k[0])return g[M-1][1]=y[1],g;if(y[1]<=k[1])return g[M-1][1]=Math.max(y[1],k[1]),g.splice(M,1),g;g.splice(M,1),M--}else{if(y[1]<=k[0])return g.splice(M,0,y),g;if(y[1]<=k[1])return k[0]=Math.min(y[0],k[0]),g;y[0]<k[1]&&(k[0]=Math.min(y[0],k[0]),T=!0)}}return T?g[g.length-1][1]=y[1]:g.push(y),g}};l.CharacterJoinerService=v=h([m(0,A.IBufferService)],v)},5114:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const h=c(844),m=c(8460),p=c(3656);class _ extends h.Disposable{constructor(w,v,S){super(),this._textarea=w,this._window=v,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new E(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((g=>this._screenDprMonitor.setWindow(g)))),this.register((0,m.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(w){this._window!==w&&(this._window=w,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}}l.CoreBrowserService=_;class E extends h.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,p.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.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:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const h=c(844);class m extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const E=this.linkProviders.indexOf(_);E!==-1&&this.linkProviders.splice(E,1)}}}}l.LinkProviderService=m},8934:function(f,l,c){var h=this&&this.__decorate||function(A,w,v,S){var g,y=arguments.length,T=y<3?w:S===null?S=Object.getOwnPropertyDescriptor(w,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(A,w,v,S);else for(var M=A.length-1;M>=0;M--)(g=A[M])&&(T=(y<3?g(T):y>3?g(w,v,T):g(w,v))||T);return y>3&&T&&Object.defineProperty(w,v,T),T},m=this&&this.__param||function(A,w){return function(v,S){w(v,S,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const p=c(4725),_=c(9806);let E=l.MouseService=class{constructor(A,w){this._renderService=A,this._charSizeService=w}getCoords(A,w,v,S,g){return(0,_.getCoords)(window,A,w,v,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(A,w){const v=(0,_.getCoordsRelativeToElement)(window,A,w);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};l.MouseService=E=h([m(0,p.IRenderService),m(1,p.ICharSizeService)],E)},3230:function(f,l,c){var h=this&&this.__decorate||function(g,y,T,M){var k,L=arguments.length,D=L<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,y,T,M);else for(var j=g.length-1;j>=0;j--)(k=g[j])&&(D=(L<3?k(D):L>3?k(y,T,D):k(y,T))||D);return L>3&&D&&Object.defineProperty(y,T,D),D},m=this&&this.__param||function(g,y){return function(T,M){y(T,M,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const p=c(6193),_=c(4725),E=c(8460),A=c(844),w=c(7226),v=c(2585);let S=l.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,y,T,M,k,L,D,j){super(),this._rowCount=g,this._charSizeService=M,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new A.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 E.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new E.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new E.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(((K,Q)=>this._renderRows(K,Q)),D),this.register(this._renderDebouncer),this.register(D.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(L.onResize((()=>this._fullRefresh()))),this.register(L.buffers.onBufferActivate((()=>{var K;return(K=this._renderer.value)==null?void 0:K.clear()}))),this.register(T.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(k.onDecorationRegistered((()=>this._fullRefresh()))),this.register(k.onDecorationRemoved((()=>this._fullRefresh()))),this.register(T.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(L.cols,L.rows),this._fullRefresh()}))),this.register(T.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(L.buffer.y,L.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(D.window,y),this.register(D.onWindowChange((K=>this._registerIntersectionObserver(K,y))))}_registerIntersectionObserver(g,y){if("IntersectionObserver"in g){const T=new g.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});T.observe(y),this._observerDisposable.value=(0,A.toDisposable)((()=>T.disconnect()))}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.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(g,y,T=!1){this._isPaused?this._needsFullRefresh=!0:(T||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,y,this._rowCount))}_renderRows(g,y){this._renderer.value&&(g=Math.min(g,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(g,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:y}),this._onRender.fire({start:g,end:y}),this._isNextRenderRedrawOnly=!0)}resize(g,y){this._rowCount=y,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(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,y;this._renderer.value&&((y=(g=this._renderer.value).clearTextureAtlas)==null||y.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var T;return(T=this._renderer.value)==null?void 0:T.handleResize(g,y)})):this._renderer.value.handleResize(g,y),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,y,T){var M;this._selectionState.start=g,this._selectionState.end=y,this._selectionState.columnSelectMode=T,(M=this._renderer.value)==null||M.handleSelectionChanged(g,y,T)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};l.RenderService=S=h([m(2,v.IOptionsService),m(3,_.ICharSizeService),m(4,v.IDecorationService),m(5,v.IBufferService),m(6,_.ICoreBrowserService),m(7,_.IThemeService)],S)},9312:function(f,l,c){var h=this&&this.__decorate||function(D,j,K,Q){var H,U=arguments.length,$=U<3?j:Q===null?Q=Object.getOwnPropertyDescriptor(j,K):Q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(D,j,K,Q);else for(var te=D.length-1;te>=0;te--)(H=D[te])&&($=(U<3?H($):U>3?H(j,K,$):H(j,K))||$);return U>3&&$&&Object.defineProperty(j,K,$),$},m=this&&this.__param||function(D,j){return function(K,Q){j(K,Q,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const p=c(9806),_=c(9504),E=c(456),A=c(4725),w=c(8460),v=c(844),S=c(6114),g=c(4841),y=c(511),T=c(2585),M=" ",k=new RegExp(M,"g");let L=l.SelectionService=class extends v.Disposable{constructor(D,j,K,Q,H,U,$,te,Y){super(),this._element=D,this._screenElement=j,this._linkifier=K,this._bufferService=Q,this._coreService=H,this._mouseService=U,this._optionsService=$,this._renderService=te,this._coreBrowserService=Y,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ie=>this._handleMouseMove(ie),this._mouseUpListener=ie=>this._handleMouseUp(ie),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ie=>this._handleTrim(ie))),this.register(this._bufferService.buffers.onBufferActivate((ie=>this._handleBufferActivate(ie)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.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 D=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!D||!j||D[0]===j[0]&&D[1]===j[1])}get selectionText(){const D=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!D||!j)return"";const K=this._bufferService.buffer,Q=[];if(this._activeSelectionMode===3){if(D[0]===j[0])return"";const H=D[0]<j[0]?D[0]:j[0],U=D[0]<j[0]?j[0]:D[0];for(let $=D[1];$<=j[1];$++){const te=K.translateBufferLineToString($,!0,H,U);Q.push(te)}}else{const H=D[1]===j[1]?j[0]:void 0;Q.push(K.translateBufferLineToString(D[1],!0,D[0],H));for(let U=D[1]+1;U<=j[1]-1;U++){const $=K.lines.get(U),te=K.translateBufferLineToString(U,!0);$!=null&&$.isWrapped?Q[Q.length-1]+=te:Q.push(te)}if(D[1]!==j[1]){const U=K.lines.get(j[1]),$=K.translateBufferLineToString(j[1],!0,0,j[0]);U&&U.isWrapped?Q[Q.length-1]+=$:Q.push($)}}return Q.map((H=>H.replace(k," "))).join(S.isWindows?`\r
405
+ `:`
406
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(D){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&D&&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(D){const j=this._getMouseBufferCoords(D),K=this._model.finalSelectionStart,Q=this._model.finalSelectionEnd;return!!(K&&Q&&j)&&this._areCoordsInSelection(j,K,Q)}isCellInSelection(D,j){const K=this._model.finalSelectionStart,Q=this._model.finalSelectionEnd;return!(!K||!Q)&&this._areCoordsInSelection([D,j],K,Q)}_areCoordsInSelection(D,j,K){return D[1]>j[1]&&D[1]<K[1]||j[1]===K[1]&&D[1]===j[1]&&D[0]>=j[0]&&D[0]<K[0]||j[1]<K[1]&&D[1]===K[1]&&D[0]<K[0]||j[1]<K[1]&&D[1]===j[1]&&D[0]>=j[0]}_selectWordAtCursor(D,j){var H,U;const K=(U=(H=this._linkifier.currentLink)==null?void 0:H.link)==null?void 0:U.range;if(K)return this._model.selectionStart=[K.start.x-1,K.start.y-1],this._model.selectionStartLength=(0,g.getRangeLength)(K,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const Q=this._getMouseBufferCoords(D);return!!Q&&(this._selectWordAt(Q,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(D,j){this._model.clearSelection(),D=Math.max(D,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,D],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(D){this._model.handleTrim(D)&&this.refresh()}_getMouseBufferCoords(D){const j=this._mouseService.getCoords(D,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(D){let j=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,D,this._screenElement)[1];const K=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=K?0:(j>K&&(j-=K),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(D){return S.isMac?D.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:D.shiftKey}handleMouseDown(D){if(this._mouseDownTimeStamp=D.timeStamp,(D.button!==2||!this.hasSelection)&&D.button===0){if(!this._enabled){if(!this.shouldForceSelection(D))return;D.stopPropagation()}D.preventDefault(),this._dragScrollAmount=0,this._enabled&&D.shiftKey?this._handleIncrementalClick(D):D.detail===1?this._handleSingleClick(D):D.detail===2?this._handleDoubleClick(D):D.detail===3&&this._handleTripleClick(D),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(D){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(D))}_handleSingleClick(D){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(D)?3:0,this._model.selectionStart=this._getMouseBufferCoords(D),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(D){this._selectWordAtCursor(D,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(D){const j=this._getMouseBufferCoords(D);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(D){return D.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(D){if(D.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(D),!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(D),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const K=this._bufferService.buffer;if(this._model.selectionEnd[1]<K.lines.length){const Q=K.lines.get(this._model.selectionEnd[1]);Q&&Q.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[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 D=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(D.ydisp+this._bufferService.rows,D.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=D.ydisp),this.refresh()}}_handleMouseUp(D){const j=D.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&D.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const K=this._mouseService.getCoords(D,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(K&&K[0]!==void 0&&K[1]!==void 0){const Q=(0,_.moveToCellSequence)(K[0]-1,K[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(Q,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const D=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,K=!(!D||!j||D[0]===j[0]&&D[1]===j[1]);K?D&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&D[0]===this._oldSelectionStart[0]&&D[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(D,j,K)):this._oldHasSelection&&this._fireOnSelectionChange(D,j,K)}_fireOnSelectionChange(D,j,K){this._oldSelectionStart=D,this._oldSelectionEnd=j,this._oldHasSelection=K,this._onSelectionChange.fire()}_handleBufferActivate(D){this.clearSelection(),this._trimListener.dispose(),this._trimListener=D.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(D,j){let K=j;for(let Q=0;j>=Q;Q++){const H=D.loadCell(Q,this._workCell).getChars().length;this._workCell.getWidth()===0?K--:H>1&&j!==Q&&(K+=H-1)}return K}setSelection(D,j,K){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[D,j],this._model.selectionStartLength=K,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(D){this._isClickInSelection(D)||(this._selectWordAtCursor(D,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(D,j,K=!0,Q=!0){if(D[0]>=this._bufferService.cols)return;const H=this._bufferService.buffer,U=H.lines.get(D[1]);if(!U)return;const $=H.translateBufferLineToString(D[1],!1);let te=this._convertViewportColToCharacterIndex(U,D[0]),Y=te;const ie=D[0]-te;let ee=0,I=0,z=0,P=0;if($.charAt(te)===" "){for(;te>0&&$.charAt(te-1)===" ";)te--;for(;Y<$.length&&$.charAt(Y+1)===" ";)Y++}else{let X=D[0],Ce=D[0];U.getWidth(X)===0&&(ee++,X--),U.getWidth(Ce)===2&&(I++,Ce++);const fe=U.getString(Ce).length;for(fe>1&&(P+=fe-1,Y+=fe-1);X>0&&te>0&&!this._isCharWordSeparator(U.loadCell(X-1,this._workCell));){U.loadCell(X-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,X--):W>1&&(z+=W-1,te-=W-1),te--,X--}for(;Ce<U.length&&Y+1<$.length&&!this._isCharWordSeparator(U.loadCell(Ce+1,this._workCell));){U.loadCell(Ce+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,Ce++):W>1&&(P+=W-1,Y+=W-1),Y++,Ce++}}Y++;let G=te+ie-ee+z,ne=Math.min(this._bufferService.cols,Y-te+ee+I-z-P);if(j||$.slice(te,Y).trim()!==""){if(K&&G===0&&U.getCodePoint(0)!==32){const X=H.lines.get(D[1]-1);if(X&&U.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){const Ce=this._getWordAt([this._bufferService.cols-1,D[1]-1],!1,!0,!1);if(Ce){const fe=this._bufferService.cols-Ce.start;G-=fe,ne+=fe}}}if(Q&&G+ne===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const X=H.lines.get(D[1]+1);if(X!=null&&X.isWrapped&&X.getCodePoint(0)!==32){const Ce=this._getWordAt([0,D[1]+1],!1,!1,!0);Ce&&(ne+=Ce.length)}}return{start:G,length:ne}}}_selectWordAt(D,j){const K=this._getWordAt(D,j);if(K){for(;K.start<0;)K.start+=this._bufferService.cols,D[1]--;this._model.selectionStart=[K.start,D[1]],this._model.selectionStartLength=K.length}}_selectToWordAt(D){const j=this._getWordAt(D,!0);if(j){let K=D[1];for(;j.start<0;)j.start+=this._bufferService.cols,K--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,K++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,K]}}_isCharWordSeparator(D){return D.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(D.getChars())>=0}_selectLineAt(D){const j=this._bufferService.buffer.getWrappedRangeForLine(D),K={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)(K,this._bufferService.cols)}};l.SelectionService=L=h([m(3,T.IBufferService),m(4,T.ICoreService),m(5,A.IMouseService),m(6,T.IOptionsService),m(7,A.IRenderService),m(8,A.ICoreBrowserService)],L)},4725:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const h=c(8343);l.ICharSizeService=(0,h.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),l.IMouseService=(0,h.createDecorator)("MouseService"),l.IRenderService=(0,h.createDecorator)("RenderService"),l.ISelectionService=(0,h.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,h.createDecorator)("ThemeService"),l.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,l,c){var h=this&&this.__decorate||function(L,D,j,K){var Q,H=arguments.length,U=H<3?D:K===null?K=Object.getOwnPropertyDescriptor(D,j):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(L,D,j,K);else for(var $=L.length-1;$>=0;$--)(Q=L[$])&&(U=(H<3?Q(U):H>3?Q(D,j,U):Q(D,j))||U);return H>3&&U&&Object.defineProperty(D,j,U),U},m=this&&this.__param||function(L,D){return function(j,K){D(j,K,L)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const p=c(7239),_=c(8055),E=c(8460),A=c(844),w=c(2585),v=_.css.toColor("#ffffff"),S=_.css.toColor("#000000"),g=_.css.toColor("#ffffff"),y=_.css.toColor("#000000"),T={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const L=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],D=[0,95,135,175,215,255];for(let j=0;j<216;j++){const K=D[j/36%6|0],Q=D[j/6%6|0],H=D[j%6];L.push({css:_.channels.toCss(K,Q,H),rgba:_.channels.toRgba(K,Q,H)})}for(let j=0;j<24;j++){const K=8+10*j;L.push({css:_.channels.toCss(K,K,K),rgba:_.channels.toRgba(K,K,K)})}return L})());let M=l.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(L){super(),this._optionsService=L,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new E.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:S,cursor:g,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:T,selectionBackgroundOpaque:_.color.blend(S,T),selectionInactiveBackgroundTransparent:T,selectionInactiveBackgroundOpaque:_.color.blend(S,T),ansi:l.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(L={}){const D=this._colors;if(D.foreground=k(L.foreground,v),D.background=k(L.background,S),D.cursor=k(L.cursor,g),D.cursorAccent=k(L.cursorAccent,y),D.selectionBackgroundTransparent=k(L.selectionBackground,T),D.selectionBackgroundOpaque=_.color.blend(D.background,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundTransparent=k(L.selectionInactiveBackground,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundOpaque=_.color.blend(D.background,D.selectionInactiveBackgroundTransparent),D.selectionForeground=L.selectionForeground?k(L.selectionForeground,_.NULL_COLOR):void 0,D.selectionForeground===_.NULL_COLOR&&(D.selectionForeground=void 0),_.color.isOpaque(D.selectionBackgroundTransparent)&&(D.selectionBackgroundTransparent=_.color.opacity(D.selectionBackgroundTransparent,.3)),_.color.isOpaque(D.selectionInactiveBackgroundTransparent)&&(D.selectionInactiveBackgroundTransparent=_.color.opacity(D.selectionInactiveBackgroundTransparent,.3)),D.ansi=l.DEFAULT_ANSI_COLORS.slice(),D.ansi[0]=k(L.black,l.DEFAULT_ANSI_COLORS[0]),D.ansi[1]=k(L.red,l.DEFAULT_ANSI_COLORS[1]),D.ansi[2]=k(L.green,l.DEFAULT_ANSI_COLORS[2]),D.ansi[3]=k(L.yellow,l.DEFAULT_ANSI_COLORS[3]),D.ansi[4]=k(L.blue,l.DEFAULT_ANSI_COLORS[4]),D.ansi[5]=k(L.magenta,l.DEFAULT_ANSI_COLORS[5]),D.ansi[6]=k(L.cyan,l.DEFAULT_ANSI_COLORS[6]),D.ansi[7]=k(L.white,l.DEFAULT_ANSI_COLORS[7]),D.ansi[8]=k(L.brightBlack,l.DEFAULT_ANSI_COLORS[8]),D.ansi[9]=k(L.brightRed,l.DEFAULT_ANSI_COLORS[9]),D.ansi[10]=k(L.brightGreen,l.DEFAULT_ANSI_COLORS[10]),D.ansi[11]=k(L.brightYellow,l.DEFAULT_ANSI_COLORS[11]),D.ansi[12]=k(L.brightBlue,l.DEFAULT_ANSI_COLORS[12]),D.ansi[13]=k(L.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),D.ansi[14]=k(L.brightCyan,l.DEFAULT_ANSI_COLORS[14]),D.ansi[15]=k(L.brightWhite,l.DEFAULT_ANSI_COLORS[15]),L.extendedAnsi){const j=Math.min(D.ansi.length-16,L.extendedAnsi.length);for(let K=0;K<j;K++)D.ansi[K+16]=k(L.extendedAnsi[K],l.DEFAULT_ANSI_COLORS[K+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(L){this._restoreColor(L),this._onChangeColors.fire(this.colors)}_restoreColor(L){if(L!==void 0)switch(L){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[L]=this._restoreColors.ansi[L]}else for(let D=0;D<this._restoreColors.ansi.length;++D)this._colors.ansi[D]=this._restoreColors.ansi[D]}modifyColors(L){L(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 k(L,D){if(L!==void 0)try{return _.css.toColor(L)}catch{}return D}l.ThemeService=M=h([m(0,w.IOptionsService)],M)},6349:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const h=c(8460),m=c(844);class p extends m.Disposable{constructor(E){super(),this._maxLength=E,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(E){if(this._maxLength===E)return;const A=new Array(E);for(let w=0;w<Math.min(E,this.length);w++)A[w]=this._array[this._getCyclicIndex(w)];this._array=A,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let A=this._length;A<E;A++)this._array[A]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,A){this._array[this._getCyclicIndex(E)]=A}push(E){this._array[this._getCyclicIndex(this._length)]=E,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(E,A,...w){if(A){for(let v=E;v<this._length-A;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+A)];this._length-=A,this.onDeleteEmitter.fire({index:E,amount:A})}for(let v=this._length-1;v>=E;v--)this._array[this._getCyclicIndex(v+w.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<w.length;v++)this._array[this._getCyclicIndex(E+v)]=w[v];if(w.length&&this.onInsertEmitter.fire({index:E,amount:w.length}),this._length+w.length>this._maxLength){const v=this._length+w.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=w.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,A,w){if(!(A<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let S=A-1;S>=0;S--)this.set(E+S+w,this.get(E+S));const v=E+A+w-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<A;v++)this.set(E+v+w,this.get(E+v))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}l.CircularList=p},1439:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(h,m=5){if(typeof h!="object")return h;const p=Array.isArray(h)?[]:{};for(const _ in h)p[_]=m<=1?h[_]:h[_]&&c(h[_],m-1);return p}},8055:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,h=0,m=0,p=0;var _,E,A,w,v;function S(y){const T=y.toString(16);return T.length<2?"0"+T:T}function g(y,T){return y<T?(T+.05)/(y+.05):(y+.05)/(T+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(T,M,k,L){return L!==void 0?`#${S(T)}${S(M)}${S(k)}${S(L)}`:`#${S(T)}${S(M)}${S(k)}`},y.toRgba=function(T,M,k,L=255){return(T<<24|M<<16|k<<8|L)>>>0},y.toColor=function(T,M,k,L){return{css:y.toCss(T,M,k,L),rgba:y.toRgba(T,M,k,L)}}})(_||(l.channels=_={})),(function(y){function T(M,k){return p=Math.round(255*k),[c,h,m]=v.toChannels(M.rgba),{css:_.toCss(c,h,m,p),rgba:_.toRgba(c,h,m,p)}}y.blend=function(M,k){if(p=(255&k.rgba)/255,p===1)return{css:k.css,rgba:k.rgba};const L=k.rgba>>24&255,D=k.rgba>>16&255,j=k.rgba>>8&255,K=M.rgba>>24&255,Q=M.rgba>>16&255,H=M.rgba>>8&255;return c=K+Math.round((L-K)*p),h=Q+Math.round((D-Q)*p),m=H+Math.round((j-H)*p),{css:_.toCss(c,h,m),rgba:_.toRgba(c,h,m)}},y.isOpaque=function(M){return(255&M.rgba)==255},y.ensureContrastRatio=function(M,k,L){const D=v.ensureContrastRatio(M.rgba,k.rgba,L);if(D)return _.toColor(D>>24&255,D>>16&255,D>>8&255)},y.opaque=function(M){const k=(255|M.rgba)>>>0;return[c,h,m]=v.toChannels(k),{css:_.toCss(c,h,m),rgba:k}},y.opacity=T,y.multiplyOpacity=function(M,k){return p=255&M.rgba,T(M,p*k/255)},y.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(E||(l.color=E={})),(function(y){let T,M;try{const k=document.createElement("canvas");k.width=1,k.height=1;const L=k.getContext("2d",{willReadFrequently:!0});L&&(T=L,T.globalCompositeOperation="copy",M=T.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return c=parseInt(k.slice(1,2).repeat(2),16),h=parseInt(k.slice(2,3).repeat(2),16),m=parseInt(k.slice(3,4).repeat(2),16),_.toColor(c,h,m);case 5:return c=parseInt(k.slice(1,2).repeat(2),16),h=parseInt(k.slice(2,3).repeat(2),16),m=parseInt(k.slice(3,4).repeat(2),16),p=parseInt(k.slice(4,5).repeat(2),16),_.toColor(c,h,m,p);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const L=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return c=parseInt(L[1]),h=parseInt(L[2]),m=parseInt(L[3]),p=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),_.toColor(c,h,m,p);if(!T||!M)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=M,T.fillStyle=k,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[c,h,m,p]=T.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,h,m,p),css:k}}})(A||(l.css=A={})),(function(y){function T(M,k,L){const D=M/255,j=k/255,K=L/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4))}y.relativeLuminance=function(M){return T(M>>16&255,M>>8&255,255&M)},y.relativeLuminance2=T})(w||(l.rgb=w={})),(function(y){function T(k,L,D){const j=k>>24&255,K=k>>16&255,Q=k>>8&255;let H=L>>24&255,U=L>>16&255,$=L>>8&255,te=g(w.relativeLuminance2(H,U,$),w.relativeLuminance2(j,K,Q));for(;te<D&&(H>0||U>0||$>0);)H-=Math.max(0,Math.ceil(.1*H)),U-=Math.max(0,Math.ceil(.1*U)),$-=Math.max(0,Math.ceil(.1*$)),te=g(w.relativeLuminance2(H,U,$),w.relativeLuminance2(j,K,Q));return(H<<24|U<<16|$<<8|255)>>>0}function M(k,L,D){const j=k>>24&255,K=k>>16&255,Q=k>>8&255;let H=L>>24&255,U=L>>16&255,$=L>>8&255,te=g(w.relativeLuminance2(H,U,$),w.relativeLuminance2(j,K,Q));for(;te<D&&(H<255||U<255||$<255);)H=Math.min(255,H+Math.ceil(.1*(255-H))),U=Math.min(255,U+Math.ceil(.1*(255-U))),$=Math.min(255,$+Math.ceil(.1*(255-$))),te=g(w.relativeLuminance2(H,U,$),w.relativeLuminance2(j,K,Q));return(H<<24|U<<16|$<<8|255)>>>0}y.blend=function(k,L){if(p=(255&L)/255,p===1)return L;const D=L>>24&255,j=L>>16&255,K=L>>8&255,Q=k>>24&255,H=k>>16&255,U=k>>8&255;return c=Q+Math.round((D-Q)*p),h=H+Math.round((j-H)*p),m=U+Math.round((K-U)*p),_.toRgba(c,h,m)},y.ensureContrastRatio=function(k,L,D){const j=w.relativeLuminance(k>>8),K=w.relativeLuminance(L>>8);if(g(j,K)<D){if(K<j){const U=T(k,L,D),$=g(j,w.relativeLuminance(U>>8));if($<D){const te=M(k,L,D);return $>g(j,w.relativeLuminance(te>>8))?U:te}return U}const Q=M(k,L,D),H=g(j,w.relativeLuminance(Q>>8));if(H<D){const U=T(k,L,D);return H>g(j,w.relativeLuminance(U>>8))?Q:U}return Q}},y.reduceLuminance=T,y.increaseLuminance=M,y.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(v||(l.rgba=v={})),l.toPaddedHex=S,l.contrastRatio=g},8969:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const h=c(844),m=c(2585),p=c(4348),_=c(7866),E=c(744),A=c(7302),w=c(6975),v=c(8460),S=c(1753),g=c(1480),y=c(7994),T=c(9282),M=c(5435),k=c(5981),L=c(2660);let D=!1;class j extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((Q=>{var H;(H=this._onScrollApi)==null||H.fire(Q.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(Q){for(const H in Q)this.optionsService.options[H]=Q[H]}constructor(Q){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new A.OptionsService(Q)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(E.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(L.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.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((H=>{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((H=>{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 k.WriteBuffer(((H,U)=>this._inputHandler.parse(H,U)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(Q,H){this._writeBuffer.write(Q,H)}writeSync(Q,H){this._logService.logLevel<=m.LogLevelEnum.WARN&&!D&&(this._logService.warn("writeSync is unreliable and will be removed soon."),D=!0),this._writeBuffer.writeSync(Q,H)}input(Q,H=!0){this.coreService.triggerDataEvent(Q,H)}resize(Q,H){isNaN(Q)||isNaN(H)||(Q=Math.max(Q,E.MINIMUM_COLS),H=Math.max(H,E.MINIMUM_ROWS),this._bufferService.resize(Q,H))}scroll(Q,H=!1){this._bufferService.scroll(Q,H)}scrollLines(Q,H,U){this._bufferService.scrollLines(Q,H,U)}scrollPages(Q){this.scrollLines(Q*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(Q){const H=Q-this._bufferService.buffer.ydisp;H!==0&&this.scrollLines(H)}registerEscHandler(Q,H){return this._inputHandler.registerEscHandler(Q,H)}registerDcsHandler(Q,H){return this._inputHandler.registerDcsHandler(Q,H)}registerCsiHandler(Q,H){return this._inputHandler.registerCsiHandler(Q,H)}registerOscHandler(Q,H){return this._inputHandler.registerOscHandler(Q,H)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let Q=!1;const H=this.optionsService.rawOptions.windowsPty;H&&H.buildNumber!==void 0&&H.buildNumber!==void 0?Q=H.backend==="conpty"&&H.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(Q=!0),Q?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const Q=[];Q.push(this.onLineFeed(T.updateWindowsModeWrappedState.bind(null,this._bufferService))),Q.push(this.registerCsiHandler({final:"H"},(()=>((0,T.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const H of Q)H.dispose()}))}}}l.CoreTerminal=j},8460:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.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 h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const m=[];for(let p=0;p<this._listeners.length;p++)m.push(this._listeners[p]);for(let p=0;p<m.length;p++)m[p].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(c,h){return c((m=>h.fire(m)))},l.runAndSubscribe=function(c,h){return h(void 0),c((m=>h(m)))}},5435:function(f,l,c){var h=this&&this.__decorate||function(ee,I,z,P){var G,ne=arguments.length,X=ne<3?I:P===null?P=Object.getOwnPropertyDescriptor(I,z):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(ee,I,z,P);else for(var Ce=ee.length-1;Ce>=0;Ce--)(G=ee[Ce])&&(X=(ne<3?G(X):ne>3?G(I,z,X):G(I,z))||X);return ne>3&&X&&Object.defineProperty(I,z,X),X},m=this&&this.__param||function(ee,I){return function(z,P){I(z,P,ee)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const p=c(2584),_=c(7116),E=c(2015),A=c(844),w=c(482),v=c(8437),S=c(8460),g=c(643),y=c(511),T=c(3734),M=c(2585),k=c(1480),L=c(6242),D=c(6351),j=c(5941),K={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Q=131072;function H(ee,I){if(ee>24)return I.setWinLines||!1;switch(ee){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var U;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(l.WindowsOptionsReportType=U={}));let $=0;class te extends A.Disposable{getAttrData(){return this._curAttrData}constructor(I,z,P,G,ne,X,Ce,fe,W=new E.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=z,this._coreService=P,this._logService=G,this._optionsService=ne,this._oscLinkService=X,this._coreMouseService=Ce,this._unicodeService=fe,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.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 Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((F=>this._activeBuffer=F.activeBuffer))),this._parser.setCsiHandlerFallback(((F,ue)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(F),params:ue.toArray()})})),this._parser.setEscHandlerFallback((F=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(F)})})),this._parser.setExecuteHandlerFallback((F=>{this._logService.debug("Unknown EXECUTE code: ",{code:F})})),this._parser.setOscHandlerFallback(((F,ue,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:F,action:ue,data:oe})})),this._parser.setDcsHandlerFallback(((F,ue,oe)=>{ue==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(F),action:ue,payload:oe})})),this._parser.setPrintHandler(((F,ue,oe)=>this.print(F,ue,oe))),this._parser.registerCsiHandler({final:"@"},(F=>this.insertChars(F))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(F=>this.scrollLeft(F))),this._parser.registerCsiHandler({final:"A"},(F=>this.cursorUp(F))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(F=>this.scrollRight(F))),this._parser.registerCsiHandler({final:"B"},(F=>this.cursorDown(F))),this._parser.registerCsiHandler({final:"C"},(F=>this.cursorForward(F))),this._parser.registerCsiHandler({final:"D"},(F=>this.cursorBackward(F))),this._parser.registerCsiHandler({final:"E"},(F=>this.cursorNextLine(F))),this._parser.registerCsiHandler({final:"F"},(F=>this.cursorPrecedingLine(F))),this._parser.registerCsiHandler({final:"G"},(F=>this.cursorCharAbsolute(F))),this._parser.registerCsiHandler({final:"H"},(F=>this.cursorPosition(F))),this._parser.registerCsiHandler({final:"I"},(F=>this.cursorForwardTab(F))),this._parser.registerCsiHandler({final:"J"},(F=>this.eraseInDisplay(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(F=>this.eraseInDisplay(F,!0))),this._parser.registerCsiHandler({final:"K"},(F=>this.eraseInLine(F,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(F=>this.eraseInLine(F,!0))),this._parser.registerCsiHandler({final:"L"},(F=>this.insertLines(F))),this._parser.registerCsiHandler({final:"M"},(F=>this.deleteLines(F))),this._parser.registerCsiHandler({final:"P"},(F=>this.deleteChars(F))),this._parser.registerCsiHandler({final:"S"},(F=>this.scrollUp(F))),this._parser.registerCsiHandler({final:"T"},(F=>this.scrollDown(F))),this._parser.registerCsiHandler({final:"X"},(F=>this.eraseChars(F))),this._parser.registerCsiHandler({final:"Z"},(F=>this.cursorBackwardTab(F))),this._parser.registerCsiHandler({final:"`"},(F=>this.charPosAbsolute(F))),this._parser.registerCsiHandler({final:"a"},(F=>this.hPositionRelative(F))),this._parser.registerCsiHandler({final:"b"},(F=>this.repeatPrecedingCharacter(F))),this._parser.registerCsiHandler({final:"c"},(F=>this.sendDeviceAttributesPrimary(F))),this._parser.registerCsiHandler({prefix:">",final:"c"},(F=>this.sendDeviceAttributesSecondary(F))),this._parser.registerCsiHandler({final:"d"},(F=>this.linePosAbsolute(F))),this._parser.registerCsiHandler({final:"e"},(F=>this.vPositionRelative(F))),this._parser.registerCsiHandler({final:"f"},(F=>this.hVPosition(F))),this._parser.registerCsiHandler({final:"g"},(F=>this.tabClear(F))),this._parser.registerCsiHandler({final:"h"},(F=>this.setMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(F=>this.setModePrivate(F))),this._parser.registerCsiHandler({final:"l"},(F=>this.resetMode(F))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(F=>this.resetModePrivate(F))),this._parser.registerCsiHandler({final:"m"},(F=>this.charAttributes(F))),this._parser.registerCsiHandler({final:"n"},(F=>this.deviceStatus(F))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(F=>this.deviceStatusPrivate(F))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(F=>this.softReset(F))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(F=>this.setCursorStyle(F))),this._parser.registerCsiHandler({final:"r"},(F=>this.setScrollRegion(F))),this._parser.registerCsiHandler({final:"s"},(F=>this.saveCursor(F))),this._parser.registerCsiHandler({final:"t"},(F=>this.windowOptions(F))),this._parser.registerCsiHandler({final:"u"},(F=>this.restoreCursor(F))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(F=>this.insertColumns(F))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(F=>this.deleteColumns(F))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(F=>this.selectProtected(F))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(F=>this.requestMode(F,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(F=>this.requestMode(F,!1))),this._parser.setExecuteHandler(p.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(p.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(p.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(p.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(p.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(p.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(p.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(p.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(p.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new L.OscHandler((F=>(this.setTitle(F),this.setIconName(F),!0)))),this._parser.registerOscHandler(1,new L.OscHandler((F=>this.setIconName(F)))),this._parser.registerOscHandler(2,new L.OscHandler((F=>this.setTitle(F)))),this._parser.registerOscHandler(4,new L.OscHandler((F=>this.setOrReportIndexedColor(F)))),this._parser.registerOscHandler(8,new L.OscHandler((F=>this.setHyperlink(F)))),this._parser.registerOscHandler(10,new L.OscHandler((F=>this.setOrReportFgColor(F)))),this._parser.registerOscHandler(11,new L.OscHandler((F=>this.setOrReportBgColor(F)))),this._parser.registerOscHandler(12,new L.OscHandler((F=>this.setOrReportCursorColor(F)))),this._parser.registerOscHandler(104,new L.OscHandler((F=>this.restoreIndexedColor(F)))),this._parser.registerOscHandler(110,new L.OscHandler((F=>this.restoreFgColor(F)))),this._parser.registerOscHandler(111,new L.OscHandler((F=>this.restoreBgColor(F)))),this._parser.registerOscHandler(112,new L.OscHandler((F=>this.restoreCursorColor(F)))),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 F in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:F},(()=>this.selectCharset("("+F))),this._parser.registerEscHandler({intermediates:")",final:F},(()=>this.selectCharset(")"+F))),this._parser.registerEscHandler({intermediates:"*",final:F},(()=>this.selectCharset("*"+F))),this._parser.registerEscHandler({intermediates:"+",final:F},(()=>this.selectCharset("+"+F))),this._parser.registerEscHandler({intermediates:"-",final:F},(()=>this.selectCharset("-"+F))),this._parser.registerEscHandler({intermediates:".",final:F},(()=>this.selectCharset("."+F))),this._parser.registerEscHandler({intermediates:"/",final:F},(()=>this.selectCharset("/"+F)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((F=>(this._logService.error("Parsing error: ",F),F))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new D.DcsHandler(((F,ue)=>this.requestStatusString(F,ue))))}_preserveStack(I,z,P,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=P,this._parseStack.position=G}_logSlowResolvingAsync(I){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([I,new Promise(((z,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((z=>{if(z!=="#SLOW_TIMEOUT")throw z;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,z){let P,G=this._activeBuffer.x,ne=this._activeBuffer.y,X=0;const Ce=this._parseStack.paused;if(Ce){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(P),P;G=this._parseStack.cursorStartX,ne=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>Q&&(X=this._parseStack.position+Q)}if(this._logService.logLevel<=M.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(F=>String.fromCharCode(F))).join("")}"`),typeof I=="string"?I.split("").map((F=>F.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<Q&&(this._parseBuffer=new Uint32Array(Math.min(I.length,Q))),Ce||this._dirtyRowTracker.clearRange(),I.length>Q)for(let F=X;F<I.length;F+=Q){const ue=F+Q<I.length?F+Q:I.length,oe=typeof I=="string"?this._stringDecoder.decode(I.substring(F,ue),this._parseBuffer):this._utf8Decoder.decode(I.subarray(F,ue),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(G,ne,oe,F),this._logSlowResolvingAsync(P),P}else if(!Ce){const F=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,F))return this._preserveStack(G,ne,F,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===G&&this._activeBuffer.y===ne||this._onCursorMove.fire();const fe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(fe,this._bufferService.rows-1))}print(I,z,P){let G,ne;const X=this._charsetService.charset,Ce=this._optionsService.rawOptions.screenReaderMode,fe=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,F=this._coreService.modes.insertMode,ue=this._curAttrData;let oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-z>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ue);let de=this._parser.precedingJoinState;for(let he=z;he<P;++he){if(G=I[he],G<127&&X){const je=X[String.fromCharCode(G)];je&&(G=je.charCodeAt(0))}const De=this._unicodeService.charProperties(G,de);ne=k.UnicodeService.extractWidth(De);const Ie=k.UnicodeService.extractShouldJoin(De),Fe=Ie?k.UnicodeService.extractWidth(de):0;if(de=De,Ce&&this._onA11yChar.fire((0,w.stringFromCodePoint)(G)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ne-Fe>fe){if(W){const je=oe;let Oe=this._activeBuffer.x-Fe;for(this._activeBuffer.x=Fe,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),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Fe>0&&oe instanceof v.BufferLine&&oe.copyCellsFrom(je,Oe,0,Fe,!1);Oe<fe;)je.setCellFromCodepoint(Oe++,0,1,ue)}else if(this._activeBuffer.x=fe-1,ne===2)continue}if(Ie&&this._activeBuffer.x){const je=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-je,G,ne);for(let Oe=ne-Fe;--Oe>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}else if(F&&(oe.insertCells(this._activeBuffer.x,ne-Fe,this._activeBuffer.getNullCell(ue)),oe.getWidth(fe-1)===2&&oe.setCellFromCodepoint(fe-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,ue)),oe.setCellFromCodepoint(this._activeBuffer.x++,G,ne,ue),ne>0)for(;--ne;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}this._parser.precedingJoinState=de,this._activeBuffer.x<fe&&P-z>0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,ue),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,z){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,z):this._parser.registerCsiHandler(I,(P=>!H(P.params[0],this._optionsService.rawOptions.windowOptions)||z(P)))}registerDcsHandler(I,z){return this._parser.registerDcsHandler(I,new D.DcsHandler(z))}registerEscHandler(I,z){return this._parser.registerEscHandler(I,z)}registerOscHandler(I,z){return this._parser.registerOscHandler(I,new L.OscHandler(z))}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(){var I;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&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);z.hasWidth(this._activeBuffer.x)&&!z.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,z){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+z):(this._activeBuffer.x=I,this._activeBuffer.y=z),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,z){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+z)}cursorUp(I){const z=this._activeBuffer.y-this._activeBuffer.scrollTop;return z>=0?this._moveCursor(0,-Math.min(z,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const z=this._activeBuffer.scrollBottom-this._activeBuffer.y;return z>=0?this._moveCursor(0,Math.min(z,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const z=I.params[0];return z===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:z===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=I.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=I.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const z=I.params[0];return z===1&&(this._curAttrData.bg|=536870912),z!==2&&z!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,z,P,G=!1,ne=!1){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);X.replaceCells(z,P,this._activeBuffer.getNullCell(this._eraseAttrData()),ne),G&&(X.isWrapped=!1)}_resetBufferLine(I,z=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),z),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),P.isWrapped=!1)}eraseInDisplay(I,z=!1){let P;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);P<this._bufferService.rows;P++)this._resetBufferLine(P,z);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,z),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,z);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,z);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(I,z=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,z);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,z)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let z=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ne=this._bufferService.rows-1+this._activeBuffer.ybase-G+1;for(;z--;)this._activeBuffer.lines.splice(ne-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let z=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=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;z--;)this._activeBuffer.lines.splice(P,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(I){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let z=I.params[0]||1;for(;z--;)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(I){let z=I.params[0]||1;for(;z--;)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(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);G.deleteCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);G.insertCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);G.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=I.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);G.deleteCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const z=this._parser.precedingJoinState;if(!z)return!0;const P=I.params[0]||1,G=k.UnicodeService.extractWidth(z),ne=this._activeBuffer.x-G,X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ne),Ce=new Uint32Array(X.length*P);let fe=0;for(let F=0;F<X.length;){const ue=X.codePointAt(F)||0;Ce[fe++]=ue,F+=ue>65535?2:1}let W=fe;for(let F=1;F<P;++F)Ce.copyWithin(W,0,fe),W+=fe;return this.print(Ce,0,W),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let z=0;z<I.length;z++)switch(I.params[z]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let z=0;z<I.length;z++)switch(I.params[z]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(I){for(let z=0;z<I.length;z++)switch(I.params[z]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let z=0;z<I.length;z++)switch(I.params[z]){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(),I.params[z]===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(I,z){const P=this._coreService.decPrivateModes,{activeProtocol:G,activeEncoding:ne}=this._coreMouseService,X=this._coreService,{buffers:Ce,cols:fe}=this._bufferService,{active:W,alt:F}=Ce,ue=this._optionsService.rawOptions,oe=Ie=>Ie?1:2,de=I.params[0];return he=de,De=z?de===2?4:de===4?oe(X.modes.insertMode):de===12?3:de===20?oe(ue.convertEol):0:de===1?oe(P.applicationCursorKeys):de===3?ue.windowOptions.setWinLines?fe===80?2:fe===132?1:0:0:de===6?oe(P.origin):de===7?oe(P.wraparound):de===8?3:de===9?oe(G==="X10"):de===12?oe(ue.cursorBlink):de===25?oe(!X.isCursorHidden):de===45?oe(P.reverseWraparound):de===66?oe(P.applicationKeypad):de===67?4:de===1e3?oe(G==="VT200"):de===1002?oe(G==="DRAG"):de===1003?oe(G==="ANY"):de===1004?oe(P.sendFocus):de===1005?4:de===1006?oe(ne==="SGR"):de===1015?4:de===1016?oe(ne==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?oe(W===F):de===2004?oe(P.bracketedPasteMode):0,X.triggerDataEvent(`${p.C0.ESC}[${z?"":"?"}${he};${De}$y`),!0;var he,De}_updateAttrColor(I,z,P,G,ne){return z===2?(I|=50331648,I&=-16777216,I|=T.AttributeData.fromColorRGB([P,G,ne])):z===5&&(I&=-50331904,I|=33554432|255&P),I}_extractColor(I,z,P){const G=[0,0,-1,0,0,0];let ne=0,X=0;do{if(G[X+ne]=I.params[z+X],I.hasSubParams(z+X)){const Ce=I.getSubParams(z+X);let fe=0;do G[1]===5&&(ne=1),G[X+fe+1+ne]=Ce[fe];while(++fe<Ce.length&&fe+X+1+ne<G.length);break}if(G[1]===5&&X+ne>=2||G[1]===2&&X+ne>=5)break;G[1]&&(ne=1)}while(++X+z<I.length&&X+ne<G.length);for(let Ce=2;Ce<G.length;++Ce)G[Ce]===-1&&(G[Ce]=0);switch(G[0]){case 38:P.fg=this._updateAttrColor(P.fg,G[1],G[3],G[4],G[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,G[1],G[3],G[4],G[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,G[1],G[3],G[4],G[5])}return X}_processUnderline(I,z){z.extended=z.extended.clone(),(!~I||I>5)&&(I=1),z.extended.underlineStyle=I,z.fg|=268435456,I===0&&(z.fg&=-268435457),z.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const z=I.length;let P;const G=this._curAttrData;for(let ne=0;ne<z;ne++)P=I.params[ne],P>=30&&P<=37?(G.fg&=-50331904,G.fg|=16777216|P-30):P>=40&&P<=47?(G.bg&=-50331904,G.bg|=16777216|P-40):P>=90&&P<=97?(G.fg&=-50331904,G.fg|=16777224|P-90):P>=100&&P<=107?(G.bg&=-50331904,G.bg|=16777224|P-100):P===0?this._processSGR0(G):P===1?G.fg|=134217728:P===3?G.bg|=67108864:P===4?(G.fg|=268435456,this._processUnderline(I.hasSubParams(ne)?I.getSubParams(ne)[0]:1,G)):P===5?G.fg|=536870912:P===7?G.fg|=67108864:P===8?G.fg|=1073741824:P===9?G.fg|=2147483648:P===2?G.bg|=134217728:P===21?this._processUnderline(2,G):P===22?(G.fg&=-134217729,G.bg&=-134217729):P===23?G.bg&=-67108865:P===24?(G.fg&=-268435457,this._processUnderline(0,G)):P===25?G.fg&=-536870913:P===27?G.fg&=-67108865:P===28?G.fg&=-1073741825:P===29?G.fg&=2147483647:P===39?(G.fg&=-67108864,G.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):P===49?(G.bg&=-67108864,G.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?ne+=this._extractColor(I,ne,G):P===53?G.bg|=1073741824:P===55?G.bg&=-1073741825:P===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):P===100?(G.fg&=-67108864,G.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const z=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${z};${P}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const z=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${z};${P}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.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(I){const z=I.params[0]||1;switch(z){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 P=z%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(I){const z=I.params[0]||1;let P;return(I.length<2||(P=I.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>z&&(this._activeBuffer.scrollTop=z-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(I){if(!H(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const z=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:z!==2&&this._onRequestWindowsOptionsReport.fire(U.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(U.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:z!==0&&z!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),z!==0&&z!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:z!==0&&z!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),z!==0&&z!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const z=[],P=I.split(";");for(;P.length>1;){const G=P.shift(),ne=P.shift();if(/^\d+$/.exec(G)){const X=parseInt(G);if(ie(X))if(ne==="?")z.push({type:0,index:X});else{const Ce=(0,j.parseColor)(ne);Ce&&z.push({type:1,index:X,color:Ce})}}}return z.length&&this._onColor.fire(z),!0}setHyperlink(I){const z=I.split(";");return!(z.length<2)&&(z[1]?this._createHyperlink(z[0],z[1]):!z[0]&&this._finishHyperlink())}_createHyperlink(I,z){this._getCurrentLinkId()&&this._finishHyperlink();const P=I.split(":");let G;const ne=P.findIndex((X=>X.startsWith("id=")));return ne!==-1&&(G=P[ne].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,uri:z}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,z){const P=I.split(";");for(let G=0;G<P.length&&!(z>=this._specialColors.length);++G,++z)if(P[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const ne=(0,j.parseColor)(P[G]);ne&&this._onColor.fire([{type:1,index:this._specialColors[z],color:ne}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const z=[],P=I.split(";");for(let G=0;G<P.length;++G)if(/^\d+$/.exec(P[G])){const ne=parseInt(P[G]);ie(ne)&&z.push({type:2,index:ne})}return z.length&&this._onColor.fire(z),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){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,_.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(K[I[0]],_.CHARSETS[I[1]]||_.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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new y.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let z=0;z<this._bufferService.rows;++z){const P=this._activeBuffer.ybase+this._activeBuffer.y+z,G=this._activeBuffer.lines.get(P);G&&(G.fill(I),G.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,z){const P=this._bufferService.buffer,G=this._optionsService.rawOptions;return(ne=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${ne}${p.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,z){this._dirtyRowTracker.markRangeDirty(I,z)}}l.InputHandler=te;let Y=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){ee<this.start?this.start=ee:ee>this.end&&(this.end=ee)}markRangeDirty(ee,I){ee>I&&($=ee,ee=I,I=$),ee<this.start&&(this.start=ee),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ie(ee){return 0<=ee&&ee<256}Y=h([m(0,M.IBufferService)],Y)},844:(f,l)=>{function c(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},l.toDisposable=function(h){return{dispose:h}},l.disposeArray=c,l.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,p,_){this._data[m]||(this._data[m]={}),this._data[m][p]=_}get(m,p){return this._data[m]?this._data[m][p]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(h,m,p,_,E){this._data.get(h,m)||this._data.set(h,m,new c),this._data.get(h,m).set(p,_,E)}get(h,m,p,_){var E;return(E=this._data.get(h,m))==null?void 0:E.get(p,_)}clear(){this._data.clear()}}},6114:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,h=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),l.isIpad=h==="iPad",l.isIphone=h==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),l.isLinux=h.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const m=this._getKey(h);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,m){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let m=0,p=this._array.length-1;for(;p>=m;){let _=m+p>>1;const E=this._getKey(this._array[_]);if(E>h)p=_-1;else{if(!(E<h)){for(;_>0&&this._getKey(this._array[_-1])===h;)_--;return _}m=_+1}}return m}}},7226:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const h=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(E){this._tasks.push(E),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(E){this._idleCallback=void 0;let A=0,w=0,v=E.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),w=Math.max(A,w),S=E.timeRemaining(),1.5*w>S)return v-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-A))}ms`),void this._start();v=S}this.clear()}}class p extends m{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const A=Date.now()+E;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}l.PriorityTaskQueue=p,l.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:p,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const h=c(643);l.updateWindowsModeWrappedState=function(m){const p=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),_=p==null?void 0:p.get(m.cols-1),E=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);E&&_&&(E.isWrapped=_[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&_[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new c;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}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}}l.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}get underlineVariantOffset(){const p=(3758096384&this._ext)>>29;return p<0?4294967288^p:p}set underlineVariantOffset(p){this._ext&=536870911,this._ext|=p<<29&3758096384}constructor(p=0,_=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=_}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=h},9092:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const h=c(6349),m=c(7226),p=c(3734),_=c(8437),E=c(4634),A=c(511),w=c(643),v=c(4863),S=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(g,y,T){this._hasScrollback=g,this._optionsService=y,this._bufferService=T,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,y){return new _.BufferLine(this._bufferService.cols,this.getNullCell(g),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const y=g+this._optionsService.rawOptions.scrollback;return y>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=_.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,y){const T=this.getNullCell(_.DEFAULT_ATTR_DATA);let M=0;const k=this._getCorrectBufferLength(y);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<g)for(let D=0;D<this.lines.length;D++)M+=+this.lines.get(D).resize(g,T);let L=0;if(this._rows<y)for(let D=this._rows;D<y;D++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(g,T)):this.ybase>0&&this.lines.length<=this.ybase+this.y+L+1?(this.ybase--,L++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(g,T)));else for(let D=this._rows;D>y;D--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const D=this.lines.length-k;D>0&&(this.lines.trimStart(D),this.ybase=Math.max(this.ybase-D,0),this.ydisp=Math.max(this.ydisp-D,0),this.savedY=Math.max(this.savedY-D,0)),this.lines.maxLength=k}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,y-1),L&&(this.y+=L),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(g,y),this._cols>g))for(let L=0;L<this.lines.length;L++)M+=+this.lines.get(L).resize(g,T);this._cols=g,this._rows=y,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,y){this._cols!==g&&(g>this._cols?this._reflowLarger(g,y):this._reflowSmaller(g,y))}_reflowLarger(g,y){const T=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(T.length>0){const M=(0,E.reflowLargerCreateNewLayout)(this.lines,T);(0,E.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(g,y,M.countRemoved)}}_reflowLargerAdjustViewport(g,y,T){const M=this.getNullCell(_.DEFAULT_ATTR_DATA);let k=T;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new _.BufferLine(g,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-T,0)}_reflowSmaller(g,y){const T=this.getNullCell(_.DEFAULT_ATTR_DATA),M=[];let k=0;for(let L=this.lines.length-1;L>=0;L--){let D=this.lines.get(L);if(!D||!D.isWrapped&&D.getTrimmedLength()<=g)continue;const j=[D];for(;D.isWrapped&&L>0;)D=this.lines.get(--L),j.unshift(D);const K=this.ybase+this.y;if(K>=L&&K<L+j.length)continue;const Q=j[j.length-1].getTrimmedLength(),H=(0,E.reflowSmallerGetNewLineLengths)(j,this._cols,g),U=H.length-j.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+U):Math.max(0,this.lines.length-this.lines.maxLength+U);const te=[];for(let P=0;P<U;P++){const G=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);te.push(G)}te.length>0&&(M.push({start:L+j.length+k,newLines:te}),k+=te.length),j.push(...te);let Y=H.length-1,ie=H[Y];ie===0&&(Y--,ie=H[Y]);let ee=j.length-U-1,I=Q;for(;ee>=0;){const P=Math.min(I,ie);if(j[Y]===void 0)break;if(j[Y].copyCellsFrom(j[ee],I-P,ie-P,P,!0),ie-=P,ie===0&&(Y--,ie=H[Y]),I-=P,I===0){ee--;const G=Math.max(ee,0);I=(0,E.getWrappedLineTrimmedLength)(j,G,this._cols)}}for(let P=0;P<j.length;P++)H[P]<g&&j[P].setCell(H[P],T);let z=U-$;for(;z-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+U,this.ybase+y-1)}if(M.length>0){const L=[],D=[];for(let Y=0;Y<this.lines.length;Y++)D.push(this.lines.get(Y));const j=this.lines.length;let K=j-1,Q=0,H=M[Q];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let U=0;for(let Y=Math.min(this.lines.maxLength-1,j+k-1);Y>=0;Y--)if(H&&H.start>K+U){for(let ie=H.newLines.length-1;ie>=0;ie--)this.lines.set(Y--,H.newLines[ie]);Y++,L.push({index:K+1,amount:H.newLines.length}),U+=H.newLines.length,H=M[++Q]}else this.lines.set(Y,D[K--]);let $=0;for(let Y=L.length-1;Y>=0;Y--)L[Y].index+=$,this.lines.onInsertEmitter.fire(L[Y]),$+=L[Y].amount;const te=Math.max(0,j+k-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(g,y,T=0,M){const k=this.lines.get(g);return k?k.translateToString(y,T,M):""}getWrappedRangeForLine(g){let y=g,T=g;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;T+1<this.lines.length&&this.lines.get(T+1).isWrapped;)T++;return{first:y,last:T}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===g&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const y=new v.Marker(g);return this.markers.push(y),y.register(this.lines.onTrim((T=>{y.line-=T,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((T=>{y.line>=T.index&&(y.line+=T.amount)}))),y.register(this.lines.onDelete((T=>{y.line>=T.index&&y.line<T.index+T.amount&&y.dispose(),y.line>T.index&&(y.line-=T.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const h=c(3734),m=c(511),p=c(643),_=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let E=0;class A{constructor(v,S,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=S||m.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let T=0;T<v;++T)this.setCell(T,y);this.length=v}get(v){const S=this._data[3*v+0],g=2097151&S;return[this._data[3*v+1],2097152&S?this._combined[v]:g?(0,_.stringFromCodePoint)(g):"",S>>22,2097152&S?this._combined[v].charCodeAt(this._combined[v].length-1):g]}set(v,S){this._data[3*v+1]=S[p.CHAR_DATA_ATTR_INDEX],S[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=S[1],this._data[3*v+0]=2097152|v|S[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=S[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const S=this._data[3*v+0];return 2097152&S?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&S}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const S=this._data[3*v+0];return 2097152&S?this._combined[v]:2097151&S?(0,_.stringFromCodePoint)(2097151&S):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,S){return E=3*v,S.content=this._data[E+0],S.fg=this._data[E+1],S.bg=this._data[E+2],2097152&S.content&&(S.combinedData=this._combined[v]),268435456&S.bg&&(S.extended=this._extendedAttrs[v]),S}setCell(v,S){2097152&S.content&&(this._combined[v]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[v]=S.extended),this._data[3*v+0]=S.content,this._data[3*v+1]=S.fg,this._data[3*v+2]=S.bg}setCellFromCodepoint(v,S,g,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=S|g<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,S,g){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,_.stringFromCodePoint)(S):2097151&y?(this._combined[v]=(0,_.stringFromCodePoint)(2097151&y)+(0,_.stringFromCodePoint)(S),y&=-2097152,y|=2097152):y=S|4194304,g&&(y&=-12582913,y|=g<<22),this._data[3*v+0]=y}insertCells(v,S,g){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),S<this.length-v){const y=new m.CellData;for(let T=this.length-v-S-1;T>=0;--T)this.setCell(v+S+T,this.loadCell(v+T,y));for(let T=0;T<S;++T)this.setCell(v+T,g)}else for(let y=v;y<this.length;++y)this.setCell(y,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(v,S,g){if(v%=this.length,S<this.length-v){const y=new m.CellData;for(let T=0;T<this.length-v-S;++T)this.setCell(v+T,this.loadCell(v+S+T,y));for(let T=this.length-S;T<this.length;++T)this.setCell(T,g)}else for(let y=v;y<this.length;++y)this.setCell(y,g);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,g)}replaceCells(v,S,g,y=!1){if(y)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,g),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,g);v<S&&v<this.length;)this.isProtected(v)||this.setCell(v,g),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,g),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,g);v<S&&v<this.length;)this.setCell(v++,g)}resize(v,S){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const y=new Uint32Array(g);y.set(this._data),this._data=y}for(let y=this.length;y<v;++y)this.setCell(y,S)}else{this._data=this._data.subarray(0,g);const y=Object.keys(this._combined);for(let M=0;M<y.length;M++){const k=parseInt(y[M],10);k>=v&&delete this._combined[k]}const T=Object.keys(this._extendedAttrs);for(let M=0;M<T.length;M++){const k=parseInt(T[M],10);k>=v&&delete this._extendedAttrs[k]}}return this.length=v,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,S=!1){if(S)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,v);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const S in v._combined)this._combined[S]=v._combined[S];this._extendedAttrs={};for(const S in v._extendedAttrs)this._extendedAttrs[S]=v._extendedAttrs[S];this.isWrapped=v.isWrapped}clone(){const v=new A(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const S in this._combined)v._combined[S]=this._combined[S];for(const S in this._extendedAttrs)v._extendedAttrs[S]=this._extendedAttrs[S];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,S,g,y,T){const M=v._data;if(T)for(let L=y-1;L>=0;L--){for(let D=0;D<3;D++)this._data[3*(g+L)+D]=M[3*(S+L)+D];268435456&M[3*(S+L)+2]&&(this._extendedAttrs[g+L]=v._extendedAttrs[S+L])}else for(let L=0;L<y;L++){for(let D=0;D<3;D++)this._data[3*(g+L)+D]=M[3*(S+L)+D];268435456&M[3*(S+L)+2]&&(this._extendedAttrs[g+L]=v._extendedAttrs[S+L])}const k=Object.keys(v._combined);for(let L=0;L<k.length;L++){const D=parseInt(k[L],10);D>=S&&(this._combined[D-S+g]=v._combined[D])}}translateToString(v,S,g,y){S=S??0,g=g??this.length,v&&(g=Math.min(g,this.getTrimmedLength())),y&&(y.length=0);let T="";for(;S<g;){const M=this._data[3*S+0],k=2097151&M,L=2097152&M?this._combined[S]:k?(0,_.stringFromCodePoint)(k):p.WHITESPACE_CELL_CHAR;if(T+=L,y)for(let D=0;D<L.length;++D)y.push(S);S+=M>>22||1}return y&&y.push(S),T}}l.BufferLine=A},4841:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,h){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 h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,l)=>{function c(h,m,p){if(m===h.length-1)return h[m].getTrimmedLength();const _=!h[m].hasContent(p-1)&&h[m].getWidth(p-1)===1,E=h[m+1].getWidth(0)===2;return _&&E?p-1:p}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(h,m,p,_,E){const A=[];for(let w=0;w<h.length-1;w++){let v=w,S=h.get(++v);if(!S.isWrapped)continue;const g=[h.get(w)];for(;v<h.length&&S.isWrapped;)g.push(S),S=h.get(++v);if(_>=w&&_<v){w+=g.length-1;continue}let y=0,T=c(g,y,m),M=1,k=0;for(;M<g.length;){const D=c(g,M,m),j=D-k,K=p-T,Q=Math.min(j,K);g[y].copyCellsFrom(g[M],k,T,Q,!1),T+=Q,T===p&&(y++,T=0),k+=Q,k===D&&(M++,k=0),T===0&&y!==0&&g[y-1].getWidth(p-1)===2&&(g[y].copyCellsFrom(g[y-1],p-1,T++,1,!1),g[y-1].setCell(p-1,E))}g[y].replaceCells(T,p,E);let L=0;for(let D=g.length-1;D>0&&(D>y||g[D].getTrimmedLength()===0);D--)L++;L>0&&(A.push(w+g.length-L),A.push(L)),w+=g.length-1}return A},l.reflowLargerCreateNewLayout=function(h,m){const p=[];let _=0,E=m[_],A=0;for(let w=0;w<h.length;w++)if(E===w){const v=m[++_];h.onDeleteEmitter.fire({index:w-A,amount:v}),w+=v-1,A+=v,E=m[++_]}else p.push(w);return{layout:p,countRemoved:A}},l.reflowLargerApplyNewLayout=function(h,m){const p=[];for(let _=0;_<m.length;_++)p.push(h.get(m[_]));for(let _=0;_<p.length;_++)h.set(_,p[_]);h.length=m.length},l.reflowSmallerGetNewLineLengths=function(h,m,p){const _=[],E=h.map(((S,g)=>c(h,g,m))).reduce(((S,g)=>S+g));let A=0,w=0,v=0;for(;v<E;){if(E-v<p){_.push(E-v);break}A+=p;const S=c(h,w,m);A>S&&(A-=S,w++);const g=h[w].getWidth(A-1)===2;g&&A--;const y=g?p-1:p;_.push(y),v+=y}return _},l.getWrappedLineTrimmedLength=c},5295:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const h=c(8460),m=c(844),p=c(9092);class _ extends m.Disposable{constructor(A,w){super(),this._optionsService=A,this._bufferService=w,this._onBufferActivate=this.register(new h.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 p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.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(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),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(A,w){this._normal.resize(A,w),this._alt.resize(A,w),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}l.BufferSet=_},511:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const h=c(482),m=c(643),p=c(3734);class _ extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const w=new _;return w.setFromCharData(A),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(A[m.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(A[m.CHAR_DATA_CHAR_INDEX].length===2){const v=A[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const S=A[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(v-55296)+S-56320+65536|A[m.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=A[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[m.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=A[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=_},643:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const h=c(8460),m=c(844);class p{get id(){return this._id}constructor(E){this.line=E,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(E){return this._disposables.push(E),E}}l.Marker=p,p._nextId=1},7116:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,l)=>{var c,h,m;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
407
+ `,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""})(c||(l.C0=c={})),(function(p){p.PAD="€",p.HOP="",p.BPH="‚",p.NBH="ƒ",p.IND="„",p.NEL="…",p.SSA="†",p.ESA="‡",p.HTS="ˆ",p.HTJ="‰",p.VTS="Š",p.PLD="‹",p.PLU="Œ",p.RI="",p.SS2="Ž",p.SS3="",p.DCS="",p.PU1="‘",p.PU2="’",p.STS="“",p.CCH="”",p.MW="•",p.SPA="–",p.EPA="—",p.SOS="˜",p.SGCI="™",p.SCI="š",p.CSI="›",p.ST="œ",p.OSC="",p.PM="ž",p.APC="Ÿ"})(h||(l.C1=h={})),(function(p){p.ST=`${c.ESC}\\`})(m||(l.C1_ESCAPED=m={}))},7399:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const h=c(2584),m={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:["'",'"']};l.evaluateKeyboardEvent=function(p,_,E,A){const w={type:0,cancel:!1,key:void 0},v=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?w.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?w.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?w.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(w.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:w.key=p.ctrlKey?"\b":h.C0.DEL,p.altKey&&(w.key=h.C0.ESC+w.key);break;case 9:if(p.shiftKey){w.key=h.C0.ESC+"[Z";break}w.key=h.C0.HT,w.cancel=!0;break;case 13:w.key=p.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,w.cancel=!0;break;case 27:w.key=h.C0.ESC,p.altKey&&(w.key=h.C0.ESC+h.C0.ESC),w.cancel=!0;break;case 37:if(p.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"D",w.key===h.C0.ESC+"[1;3D"&&(w.key=h.C0.ESC+(E?"b":"[1;5D"))):w.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(p.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"C",w.key===h.C0.ESC+"[1;3C"&&(w.key=h.C0.ESC+(E?"f":"[1;5C"))):w.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(p.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"A",E||w.key!==h.C0.ESC+"[1;3A"||(w.key=h.C0.ESC+"[1;5A")):w.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(p.metaKey)break;v?(w.key=h.C0.ESC+"[1;"+(v+1)+"B",E||w.key!==h.C0.ESC+"[1;3B"||(w.key=h.C0.ESC+"[1;5B")):w.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(w.key=h.C0.ESC+"[2~");break;case 46:w.key=v?h.C0.ESC+"[3;"+(v+1)+"~":h.C0.ESC+"[3~";break;case 36:w.key=v?h.C0.ESC+"[1;"+(v+1)+"H":_?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:w.key=v?h.C0.ESC+"[1;"+(v+1)+"F":_?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:p.shiftKey?w.type=2:p.ctrlKey?w.key=h.C0.ESC+"[5;"+(v+1)+"~":w.key=h.C0.ESC+"[5~";break;case 34:p.shiftKey?w.type=3:p.ctrlKey?w.key=h.C0.ESC+"[6;"+(v+1)+"~":w.key=h.C0.ESC+"[6~";break;case 112:w.key=v?h.C0.ESC+"[1;"+(v+1)+"P":h.C0.ESC+"OP";break;case 113:w.key=v?h.C0.ESC+"[1;"+(v+1)+"Q":h.C0.ESC+"OQ";break;case 114:w.key=v?h.C0.ESC+"[1;"+(v+1)+"R":h.C0.ESC+"OR";break;case 115:w.key=v?h.C0.ESC+"[1;"+(v+1)+"S":h.C0.ESC+"OS";break;case 116:w.key=v?h.C0.ESC+"[15;"+(v+1)+"~":h.C0.ESC+"[15~";break;case 117:w.key=v?h.C0.ESC+"[17;"+(v+1)+"~":h.C0.ESC+"[17~";break;case 118:w.key=v?h.C0.ESC+"[18;"+(v+1)+"~":h.C0.ESC+"[18~";break;case 119:w.key=v?h.C0.ESC+"[19;"+(v+1)+"~":h.C0.ESC+"[19~";break;case 120:w.key=v?h.C0.ESC+"[20;"+(v+1)+"~":h.C0.ESC+"[20~";break;case 121:w.key=v?h.C0.ESC+"[21;"+(v+1)+"~":h.C0.ESC+"[21~";break;case 122:w.key=v?h.C0.ESC+"[23;"+(v+1)+"~":h.C0.ESC+"[23~";break;case 123:w.key=v?h.C0.ESC+"[24;"+(v+1)+"~":h.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(E&&!A||!p.altKey||p.metaKey)!E||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?w.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(w.key=h.C0.US),p.key==="@"&&(w.key=h.C0.NUL)):p.keyCode===65&&(w.type=1);else{const S=m[p.keyCode],g=S==null?void 0:S[p.shiftKey?1:0];if(g)w.key=h.C0.ESC+g;else if(p.keyCode>=65&&p.keyCode<=90){const y=p.ctrlKey?p.keyCode-64:p.keyCode+32;let T=String.fromCharCode(y);p.shiftKey&&(T=T.toUpperCase()),w.key=h.C0.ESC+T}else if(p.keyCode===32)w.key=h.C0.ESC+(p.ctrlKey?h.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let y=p.code.slice(3,4);p.shiftKey||(y=y.toLowerCase()),w.key=h.C0.ESC+y,w.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?w.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?w.key=h.C0.NUL:p.keyCode>=51&&p.keyCode<=55?w.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?w.key=h.C0.DEL:p.keyCode===219?w.key=h.C0.ESC:p.keyCode===220?w.key=h.C0.FS:p.keyCode===221&&(w.key=h.C0.GS)}return w}},482:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,h=0,m=c.length){let p="";for(let _=h;_<m;++_){let E=c[_];E>65535?(E-=65536,p+=String.fromCharCode(55296+(E>>10))+String.fromCharCode(E%1024+56320)):p+=String.fromCharCode(E)}return p},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const m=c.length;if(!m)return 0;let p=0,_=0;if(this._interim){const E=c.charCodeAt(_++);56320<=E&&E<=57343?h[p++]=1024*(this._interim-55296)+E-56320+65536:(h[p++]=this._interim,h[p++]=E),this._interim=0}for(let E=_;E<m;++E){const A=c.charCodeAt(E);if(55296<=A&&A<=56319){if(++E>=m)return this._interim=A,p;const w=c.charCodeAt(E);56320<=w&&w<=57343?h[p++]=1024*(A-55296)+w-56320+65536:(h[p++]=A,h[p++]=w)}else A!==65279&&(h[p++]=A)}return p}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const m=c.length;if(!m)return 0;let p,_,E,A,w=0,v=0,S=0;if(this.interim[0]){let T=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let k,L=0;for(;(k=63&this.interim[++L])&&L<4;)M<<=6,M|=k;const D=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=D-L;for(;S<j;){if(S>=m)return 0;if(k=c[S++],(192&k)!=128){S--,T=!0;break}this.interim[L++]=k,M<<=6,M|=63&k}T||(D===2?M<128?S--:h[w++]=M:D===3?M<2048||M>=55296&&M<=57343||M===65279||(h[w++]=M):M<65536||M>1114111||(h[w++]=M)),this.interim.fill(0)}const g=m-4;let y=S;for(;y<m;){for(;!(!(y<g)||128&(p=c[y])||128&(_=c[y+1])||128&(E=c[y+2])||128&(A=c[y+3]));)h[w++]=p,h[w++]=_,h[w++]=E,h[w++]=A,y+=4;if(p=c[y++],p<128)h[w++]=p;else if((224&p)==192){if(y>=m)return this.interim[0]=p,w;if(_=c[y++],(192&_)!=128){y--;continue}if(v=(31&p)<<6|63&_,v<128){y--;continue}h[w++]=v}else if((240&p)==224){if(y>=m)return this.interim[0]=p,w;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=m)return this.interim[0]=p,this.interim[1]=_,w;if(E=c[y++],(192&E)!=128){y--;continue}if(v=(15&p)<<12|(63&_)<<6|63&E,v<2048||v>=55296&&v<=57343||v===65279)continue;h[w++]=v}else if((248&p)==240){if(y>=m)return this.interim[0]=p,w;if(_=c[y++],(192&_)!=128){y--;continue}if(y>=m)return this.interim[0]=p,this.interim[1]=_,w;if(E=c[y++],(192&E)!=128){y--;continue}if(y>=m)return this.interim[0]=p,this.interim[1]=_,this.interim[2]=E,w;if(A=c[y++],(192&A)!=128){y--;continue}if(v=(7&p)<<18|(63&_)<<12|(63&E)<<6|63&A,v<65536||v>1114111)continue;h[w++]=v}}return w}}},225:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const h=c(1480),m=[[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]],p=[[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 _;l.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let E=0;E<m.length;++E)_.fill(0,m[E][0],m[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?_[E]:(function(A,w){let v,S=0,g=w.length-1;if(A<w[0][0]||A>w[g][1])return!1;for(;g>=S;)if(v=S+g>>1,A>w[v][1])S=v+1;else{if(!(A<w[v][0]))return!0;g=v-1}return!1})(E,p)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,A){let w=this.wcwidth(E),v=w===0&&A!==0;if(v){const S=h.UnicodeService.extractWidth(A);S===0?v=!1:S>w&&(w=S)}return h.UnicodeService.createPropertyValue(0,w,v)}}},5981:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const h=c(8460),m=c(844);class p extends m.Disposable{constructor(E){super(),this._action=E,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(E,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(E,A){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+=E.length,this._writeBuffer.push(E),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(A)}_innerWrite(E=0,A=!0){const w=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],S=this._action(v,A);if(S){const y=T=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(w,T);return void S.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(y)}const g=this._callbacks[this._bufferOffset];if(g&&g(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-w>=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()}}l.WriteBuffer=p},5941:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.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})$/,h=/^[\da-f]+$/;function m(p,_){const E=p.toString(16),A=E.length<2?"0"+E:E;switch(_){case 4:return E[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}l.parseColor=function(p){if(!p)return;let _=p.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const E=c.exec(_);if(E){const A=E[1]?15:E[4]?255:E[7]?4095:65535;return[Math.round(parseInt(E[1]||E[4]||E[7]||E[10],16)/A*255),Math.round(parseInt(E[2]||E[5]||E[8]||E[11],16)/A*255),Math.round(parseInt(E[3]||E[6]||E[9]||E[12],16)/A*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),h.exec(_)&&[3,6,9,12].includes(_.length))){const E=_.length/3,A=[0,0,0];for(let w=0;w<3;++w){const v=parseInt(_.slice(E*w,E*w+E),16);A[w]=E===1?v<<4:E===2?v:E===3?v>>4:v>>8}return A}},l.toRgbString=function(p,_=16){const[E,A,w]=p;return`rgb:${m(E,_)}/${m(A,_)}/${m(w,_)}`}},5770:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const h=c(482),m=c(8742),p=c(5770),_=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(A,w){this._handlers[A]===void 0&&(this._handlers[A]=[]);const v=this._handlers[A];return v.push(w),{dispose:()=>{const S=v.indexOf(w);S!==-1&&v.splice(S,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(A,w){if(this.reset(),this._ident=A,this._active=this._handlers[A]||_,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(A,w,v){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(A,w,v);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,w,v))}unhook(A,w=!0){if(this._active.length){let v=!1,S=this._active.length-1,g=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,v=w,g=this._stack.fallThrough,this._stack.paused=!1),!g&&v===!1){for(;S>=0&&(v=this._active[S].unhook(A),v!==!0);S--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,v;S--}for(;S>=0;S--)if(v=this._active[S].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",A);this._active=_,this._ident=0}};const E=new m.Params;E.addParam(0),l.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=E,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():E,this._data="",this._hitLimit=!1}put(A,w,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,w,v),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let w=!1;if(this._hitLimit)w=!1;else if(A&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((v=>(this._params=E,this._data="",this._hitLimit=!1,v)));return this._params=E,this._data="",this._hitLimit=!1,w}}},2015:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const h=c(844),m=c(8742),p=c(6242),_=c(6351);class E{constructor(S){this.table=new Uint8Array(S)}setDefault(S,g){this.table.fill(S<<4|g)}add(S,g,y,T){this.table[g<<8|S]=y<<4|T}addMany(S,g,y,T){for(let M=0;M<S.length;M++)this.table[g<<8|S[M]]=y<<4|T}}l.TransitionTable=E;const A=160;l.VT500_TRANSITION_TABLE=(function(){const v=new E(4095),S=Array.apply(null,Array(256)).map(((L,D)=>D)),g=(L,D)=>S.slice(L,D),y=g(32,127),T=g(0,24);T.push(25),T.push.apply(T,g(28,32));const M=g(0,14);let k;for(k in v.setDefault(1,0),v.addMany(y,0,2,0),M)v.addMany([24,26,153,154],k,3,0),v.addMany(g(128,144),k,3,0),v.addMany(g(144,152),k,3,0),v.add(156,k,0,0),v.add(27,k,11,1),v.add(157,k,4,8),v.addMany([152,158,159],k,0,7),v.add(155,k,11,3),v.add(144,k,11,9);return v.addMany(T,0,3,0),v.addMany(T,1,3,1),v.add(127,1,0,1),v.addMany(T,8,0,8),v.addMany(T,3,3,3),v.add(127,3,0,3),v.addMany(T,4,3,4),v.add(127,4,0,4),v.addMany(T,6,3,6),v.addMany(T,5,3,5),v.add(127,5,0,5),v.addMany(T,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(g(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(T,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(g(64,127),3,7,0),v.addMany(g(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(g(48,60),4,8,4),v.addMany(g(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(g(32,64),6,0,6),v.add(127,6,0,6),v.addMany(g(64,127),6,0,0),v.addMany(g(32,48),3,9,5),v.addMany(g(32,48),5,9,5),v.addMany(g(48,64),5,0,6),v.addMany(g(64,127),5,7,0),v.addMany(g(32,48),4,9,5),v.addMany(g(32,48),1,9,2),v.addMany(g(32,48),2,9,2),v.addMany(g(48,127),2,10,0),v.addMany(g(48,80),1,10,0),v.addMany(g(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(g(96,127),1,10,0),v.add(80,1,11,9),v.addMany(T,9,0,9),v.add(127,9,0,9),v.addMany(g(28,32),9,0,9),v.addMany(g(32,48),9,9,12),v.addMany(g(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(T,11,0,11),v.addMany(g(32,128),11,0,11),v.addMany(g(28,32),11,0,11),v.addMany(T,10,0,10),v.add(127,10,0,10),v.addMany(g(28,32),10,0,10),v.addMany(g(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(g(32,48),10,9,12),v.addMany(T,12,0,12),v.add(127,12,0,12),v.addMany(g(28,32),12,0,12),v.addMany(g(32,48),12,9,12),v.addMany(g(48,64),12,0,11),v.addMany(g(64,127),12,12,13),v.addMany(g(64,127),10,12,13),v.addMany(g(64,127),9,12,13),v.addMany(T,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(A,0,2,0),v.add(A,8,5,8),v.add(A,6,0,6),v.add(A,11,0,11),v.add(A,13,13,13),v})();class w extends h.Disposable{constructor(S=l.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,y,T)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,y)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new p.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,g=[64,126]){let y=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=S.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<S.intermediates.length;++M){const k=S.intermediates.charCodeAt(M);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=k}}if(S.final.length!==1)throw new Error("final must be a single byte");const T=S.final.charCodeAt(0);if(g[0]>T||T>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return y<<=8,y|=T,y}identToString(S){const g=[];for(;S;)g.push(String.fromCharCode(255&S)),S>>=8;return g.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,g){const y=this._identifier(S,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const T=this._escHandlers[y];return T.push(g),{dispose:()=>{const M=T.indexOf(g);M!==-1&&T.splice(M,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,g){this._executeHandlers[S.charCodeAt(0)]=g}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,g){const y=this._identifier(S);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const T=this._csiHandlers[y];return T.push(g),{dispose:()=>{const M=T.indexOf(g);M!==-1&&T.splice(M,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,g){return this._dcsParser.registerHandler(this._identifier(S),g)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,g){return this._oscParser.registerHandler(S,g)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}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(S,g,y,T,M){this._parseStack.state=S,this._parseStack.handlers=g,this._parseStack.handlerPos=y,this._parseStack.transition=T,this._parseStack.chunkPos=M}parse(S,g,y){let T,M=0,k=0,L=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,L=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const D=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&j>-1){for(;j>=0&&(T=D[j](this._params),T!==!0);j--)if(T instanceof Promise)return this._parseStack.handlerPos=j,T}this._parseStack.handlers=[];break;case 4:if(y===!1&&j>-1){for(;j>=0&&(T=D[j](),T!==!0);j--)if(T instanceof Promise)return this._parseStack.handlerPos=j,T}this._parseStack.handlers=[];break;case 6:if(M=S[this._parseStack.chunkPos],T=this._dcsParser.unhook(M!==24&&M!==26,y),T)return T;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=S[this._parseStack.chunkPos],T=this._oscParser.end(M!==24&&M!==26,y),T)return T;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,L=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let D=L;D<g;++D){switch(M=S[D],k=this._transitions.table[this.currentState<<8|(M<160?M:A)],k>>4){case 2:for(let U=D+1;;++U){if(U>=g||(M=S[U])<32||M>126&&M<A){this._printHandler(S,D,U),D=U-1;break}if(++U>=g||(M=S[U])<32||M>126&&M<A){this._printHandler(S,D,U),D=U-1;break}if(++U>=g||(M=S[U])<32||M>126&&M<A){this._printHandler(S,D,U),D=U-1;break}if(++U>=g||(M=S[U])<32||M>126&&M<A){this._printHandler(S,D,U),D=U-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:D,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|M];let K=j?j.length-1:-1;for(;K>=0&&(T=j[K](this._params),T!==!0);K--)if(T instanceof Promise)return this._preserveStack(3,j,K,k,D),T;K<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++D<g&&(M=S[D])>47&&M<60);D--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const Q=this._escHandlers[this._collect<<8|M];let H=Q?Q.length-1:-1;for(;H>=0&&(T=Q[H](),T!==!0);H--)if(T instanceof Promise)return this._preserveStack(4,Q,H,k,D),T;H<0&&this._escHandlerFb(this._collect<<8|M),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|M,this._params);break;case 13:for(let U=D+1;;++U)if(U>=g||(M=S[U])===24||M===26||M===27||M>127&&M<A){this._dcsParser.put(S,D,U),D=U-1;break}break;case 14:if(T=this._dcsParser.unhook(M!==24&&M!==26),T)return this._preserveStack(6,[],0,k,D),T;M===27&&(k|=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 U=D+1;;U++)if(U>=g||(M=S[U])<32||M>127&&M<A){this._oscParser.put(S,D,U),D=U-1;break}break;case 6:if(T=this._oscParser.end(M!==24&&M!==26),T)return this._preserveStack(5,[],0,k,D),T;M===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}l.EscapeSequenceParser=w},6242:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const h=c(5770),m=c(482),p=[];l.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,E){this._handlers[_]===void 0&&(this._handlers[_]=[]);const A=this._handlers[_];return A.push(E),{dispose:()=>{const w=A.indexOf(E);w!==-1&&A.splice(w,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,E,A){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(_,E,A);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(_,E,A))}start(){this.reset(),this._state=1}put(_,E,A){if(this._state!==3){if(this._state===1)for(;E<A;){const w=_[E++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&A-E>0&&this._put(_,E,A)}}end(_,E=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,w=this._active.length-1,v=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,A=E,v=this._stack.fallThrough,this._stack.paused=!1),!v&&A===!1){for(;w>=0&&(A=this._active[w].end(_),A!==!0);w--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,A;w--}for(;w>=0;w--)if(A=this._active[w].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",_);this._active=p,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,E,A){this._hitLimit||(this._data+=(0,m.utf32ToString)(_,E,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let E=!1;if(this._hitLimit)E=!1;else if(_&&(E=this._handler(this._data),E instanceof Promise))return E.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,E}}},8742:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const c=2147483647;class h{static fromArray(p){const _=new h;if(!p.length)return _;for(let E=Array.isArray(p[0])?1:0;E<p.length;++E){const A=p[E];if(Array.isArray(A))for(let w=0;w<A.length;++w)_.addSubParam(A[w]);else _.addParam(A)}return _}constructor(p=32,_=32){if(this.maxLength=p,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new h(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let _=0;_<this.length;++_){p.push(this.params[_]);const E=this._subParamsIdx[_]>>8,A=255&this._subParamsIdx[_];A-E>0&&p.push(Array.prototype.slice.call(this._subParams,E,A))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>c?c:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>c?c:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const _=this._subParamsIdx[p]>>8,E=255&this._subParamsIdx[p];return E-_>0?this._subParams.subarray(_,E):null}getSubParamsAll(){const p={};for(let _=0;_<this.length;++_){const E=this._subParamsIdx[_]>>8,A=255&this._subParamsIdx[_];A-E>0&&(p[_]=this._subParams.slice(E,A))}return p}addDigit(p){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,A=E[_-1];E[_-1]=~A?Math.min(10*A+p,c):p}}l.Params=h},5741:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const m={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(m),h.dispose=()=>this._wrappedAddonDispose(m),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){h=m;break}if(h===-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(h,1)}}},8771:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const h=c(3785),m=c(511);l.BufferApiView=class{constructor(p,_){this._buffer=p,this.type=_}init(p){return this._buffer=p,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(p){const _=this._buffer.lines.get(p);if(_)return new h.BufferLineApiView(_)}getNullCell(){return new m.CellData}}},3785:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const h=c(511);l.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,p){if(!(m<0||m>=this._line.length))return p?(this._line.loadCell(m,p),p):this._line.loadCell(m,new h.CellData)}translateToString(m,p,_){return this._line.translateToString(m,p,_)}}},8285:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const h=c(8771),m=c(8460),p=c(844);class _ extends p.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}l.BufferNamespaceApi=_},7975:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(m=>h(m.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((m,p)=>h(m,p.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.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(f,l,c){var h=this&&this.__decorate||function(v,S,g,y){var T,M=arguments.length,k=M<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,S,g,y);else for(var L=v.length-1;L>=0;L--)(T=v[L])&&(k=(M<3?T(k):M>3?T(S,g,k):T(S,g))||k);return M>3&&k&&Object.defineProperty(S,g,k),k},m=this&&this.__param||function(v,S){return function(g,y){S(g,y,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const p=c(8460),_=c(844),E=c(5295),A=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let w=l.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(v,this))}resize(v,S){this.cols=v,this.rows=S,this.buffers.resize(v,S),this._onResize.fire({cols:v,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,S=!1){const g=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=g.getBlankLine(v,S),this._cachedBlankLine=y),y.isWrapped=S;const T=g.ybase+g.scrollTop,M=g.ybase+g.scrollBottom;if(g.scrollTop===0){const k=g.lines.isFull;M===g.lines.length-1?k?g.lines.recycle().copyFrom(y):g.lines.push(y.clone()):g.lines.splice(M+1,0,y.clone()),k?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const k=M-T+1;g.lines.shiftElements(T+1,k-1,-1),g.lines.set(M,y.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(v,S,g){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const T=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),T!==y.ydisp&&(S||this._onScroll.fire(y.ydisp))}};l.BufferService=w=h([m(0,A.IOptionsService)],w)},7994:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.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,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,l,c){var h=this&&this.__decorate||function(y,T,M,k){var L,D=arguments.length,j=D<3?T:k===null?k=Object.getOwnPropertyDescriptor(T,M):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(y,T,M,k);else for(var K=y.length-1;K>=0;K--)(L=y[K])&&(j=(D<3?L(j):D>3?L(T,M,j):L(T,M))||j);return D>3&&j&&Object.defineProperty(T,M,j),j},m=this&&this.__param||function(y,T){return function(M,k){T(M,k,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const p=c(2585),_=c(8460),E=c(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function w(y,T){let M=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(M|=64,M|=y.action):(M|=3&y.button,4&y.button&&(M|=64),8&y.button&&(M|=128),y.action===32?M|=32:y.action!==0||T||(M|=3)),M}const v=String.fromCharCode,S={DEFAULT:y=>{const T=[w(y,!1)+32,y.col+32,y.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${v(T[0])}${v(T[1])}${v(T[2])}`},SGR:y=>{const T=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${w(y,!0)};${y.col};${y.row}${T}`},SGR_PIXELS:y=>{const T=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${w(y,!0)};${y.x};${y.y}${T}`}};let g=l.CoreMouseService=class extends E.Disposable{constructor(y,T){super(),this._bufferService=y,this._coreService=T,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const M of Object.keys(A))this.addProtocol(M,A[M]);for(const M of Object.keys(S))this.addEncoding(M,S[M]);this.reset()}addProtocol(y,T){this._protocols[y]=T}addEncoding(y,T){this._encodings[y]=T}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const T=this._encodings[this._activeEncoding](y);return T&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(T):this._coreService.triggerDataEvent(T,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,T,M){if(M){if(y.x!==T.x||y.y!==T.y)return!1}else if(y.col!==T.col||y.row!==T.row)return!1;return y.button===T.button&&y.action===T.action&&y.ctrl===T.ctrl&&y.alt===T.alt&&y.shift===T.shift}};l.CoreMouseService=g=h([m(0,p.IBufferService),m(1,p.ICoreService)],g)},6975:function(f,l,c){var h=this&&this.__decorate||function(g,y,T,M){var k,L=arguments.length,D=L<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,y,T,M);else for(var j=g.length-1;j>=0;j--)(k=g[j])&&(D=(L<3?k(D):L>3?k(y,T,D):k(y,T))||D);return L>3&&D&&Object.defineProperty(y,T,D),D},m=this&&this.__param||function(g,y){return function(T,M){y(T,M,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const p=c(1439),_=c(8460),E=c(844),A=c(2585),w=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=l.CoreService=class extends E.Disposable{constructor(g,y,T){super(),this._bufferService=g,this._logService=y,this._optionsService=T,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(w),this.decPrivateModes=(0,p.clone)(v)}reset(){this.modes=(0,p.clone)(w),this.decPrivateModes=(0,p.clone)(v)}triggerDataEvent(g,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const T=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&T.ybase!==T.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,(()=>g.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,(()=>g.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(g))}};l.CoreService=S=h([m(0,A.IBufferService),m(1,A.ILogService),m(2,A.IOptionsService)],S)},9074:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const h=c(8055),m=c(8460),p=c(844),_=c(6106);let E=0,A=0;class w extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((g=>g==null?void 0:g.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)((()=>this.reset())))}registerDecoration(g){if(g.marker.isDisposed)return;const y=new v(g);if(y){const T=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),T.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,y,T){let M=0,k=0;for(const L of this._decorations.getKeyIterator(y))M=L.options.x??0,k=M+(L.options.width??1),g>=M&&g<k&&(!T||(L.options.layer??"bottom")===T)&&(yield L)}forEachDecorationAtCell(g,y,T,M){this._decorations.forEachByKey(y,(k=>{E=k.options.x??0,A=E+(k.options.width??1),g>=E&&g<A&&(!T||(k.options.layer??"bottom")===T)&&M(k)}))}}l.DecorationService=w;class v extends p.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(g){super(),this.options=g,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=g.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const h=c(2585),m=c(8343);class p{constructor(...E){this._entries=new Map;for(const[A,w]of E)this.set(A,w)}set(E,A){const w=this._entries.get(E);return this._entries.set(E,A),w}forEach(E){for(const[A,w]of this._entries.entries())E(A,w)}has(E){return this._entries.has(E)}get(E){return this._entries.get(E)}}l.ServiceCollection=p,l.InstantiationService=class{constructor(){this._services=new p,this._services.set(h.IInstantiationService,this)}setService(_,E){this._services.set(_,E)}getService(_){return this._services.get(_)}createInstance(_,...E){const A=(0,m.getServiceDependencies)(_).sort(((S,g)=>S.index-g.index)),w=[];for(const S of A){const g=this._services.get(S.id);if(!g)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${S.id}.`);w.push(g)}const v=A.length>0?A[0].index:E.length;if(E.length!==v)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${v+1} conflicts with ${E.length} static arguments`);return new _(...E,...w)}}},7866:function(f,l,c){var h=this&&this.__decorate||function(v,S,g,y){var T,M=arguments.length,k=M<3?S:y===null?y=Object.getOwnPropertyDescriptor(S,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,S,g,y);else for(var L=v.length-1;L>=0;L--)(T=v[L])&&(k=(M<3?T(k):M>3?T(S,g,k):T(S,g))||k);return M>3&&k&&Object.defineProperty(S,g,k),k},m=this&&this.__param||function(v,S){return function(g,y){S(g,y,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const p=c(844),_=c(2585),E={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let A,w=l.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let S=0;S<v.length;S++)typeof v[S]=="function"&&(v[S]=v[S]())}_log(v,S,g){this._evalLazyOptionalParams(g),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...g)}trace(v,...S){var g;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,v,S)}debug(v,...S){var g;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,v,S)}info(v,...S){var g;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,v,S)}warn(v,...S){var g;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,v,S)}error(v,...S){var g;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,v,S)}};l.LogService=w=h([m(0,_.IOptionsService)],w),l.setTraceLogger=function(v){A=v},l.traceCall=function(v,S,g){if(typeof g.value!="function")throw new Error("not supported");const y=g.value;g.value=function(...T){if(A.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,T);A.trace(`GlyphRenderer#${y.name}(${T.map((k=>JSON.stringify(k))).join(", ")})`);const M=y.apply(this,T);return A.trace(`GlyphRenderer#${y.name} return`,M),M}}},7302:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const h=c(8460),m=c(844),p=c(6114);l.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:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class E extends m.Disposable{constructor(w){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...l.DEFAULT_OPTIONS};for(const S in w)if(S in v)try{const g=w[S];v[S]=this._sanitizeAndValidateOption(S,g)}catch(g){console.error(g)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,v){return this.onOptionChange((S=>{S===w&&v(this.rawOptions[w])}))}onMultipleOptionChange(w,v){return this.onOptionChange((S=>{w.indexOf(S)!==-1&&v()}))}_setupOptions(){const w=S=>{if(!(S in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},v=(S,g)=>{if(!(S in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);g=this._sanitizeAndValidateOption(S,g),this.rawOptions[S]!==g&&(this.rawOptions[S]=g,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const g={get:w.bind(this,S),set:v.bind(this,S)};Object.defineProperty(this.options,S,g)}}_sanitizeAndValidateOption(w,v){switch(w){case"cursorStyle":if(v||(v=l.DEFAULT_OPTIONS[w]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${w}`);break;case"wordSeparator":v||(v=l.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=_.includes(v)?v:l.DEFAULT_OPTIONS[w];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${w} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${w} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}l.OptionsService=E},2660:function(f,l,c){var h=this&&this.__decorate||function(E,A,w,v){var S,g=arguments.length,y=g<3?A:v===null?v=Object.getOwnPropertyDescriptor(A,w):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(E,A,w,v);else for(var T=E.length-1;T>=0;T--)(S=E[T])&&(y=(g<3?S(y):g>3?S(A,w,y):S(A,w))||y);return g>3&&y&&Object.defineProperty(A,w,y),y},m=this&&this.__param||function(E,A){return function(w,v){A(w,v,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const p=c(2585);let _=l.OscLinkService=class{constructor(E){this._bufferService=E,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(E){const A=this._bufferService.buffer;if(E.id===void 0){const T=A.addMarker(A.ybase+A.y),M={data:E,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(M,T))),this._dataByLinkId.set(M.id,M),M.id}const w=E,v=this._getEntryIdKey(w),S=this._entriesWithId.get(v);if(S)return this.addLineToLink(S.id,A.ybase+A.y),S.id;const g=A.addMarker(A.ybase+A.y),y={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(y,g))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(E,A){const w=this._dataByLinkId.get(E);if(w&&w.lines.every((v=>v.line!==A))){const v=this._bufferService.buffer.addMarker(A);w.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(w,v)))}}getLinkData(E){var A;return(A=this._dataByLinkId.get(E))==null?void 0:A.data}_getEntryIdKey(E){return`${E.id};;${E.uri}`}_removeMarkerFromLink(E,A){const w=E.lines.indexOf(A);w!==-1&&(E.lines.splice(w,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};l.OscLinkService=_=h([m(0,p.IBufferService)],_)},8343:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",h="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(m){return m[h]||[]},l.createDecorator=function(m){if(l.serviceRegistry.has(m))return l.serviceRegistry.get(m);const p=function(_,E,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,v,S){v[c]===v?v[h].push({id:w,index:S}):(v[h]=[{id:w,index:S}],v[c]=v)})(p,_,A)};return p.toString=()=>m,l.serviceRegistry.set(m,p),p}},2585:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const h=c(8343);var m;l.IBufferService=(0,h.createDecorator)("BufferService"),l.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),l.ICoreService=(0,h.createDecorator)("CoreService"),l.ICharsetService=(0,h.createDecorator)("CharsetService"),l.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"})(m||(l.LogLevelEnum=m={})),l.ILogService=(0,h.createDecorator)("LogService"),l.IOptionsService=(0,h.createDecorator)("OptionsService"),l.IOscLinkService=(0,h.createDecorator)("OscLinkService"),l.IUnicodeService=(0,h.createDecorator)("UnicodeService"),l.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const h=c(8460),m=c(225);class p{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,A,w=!1){return(16777215&E)<<3|(3&A)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const E=new m.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let A=0,w=0;const v=E.length;for(let S=0;S<v;++S){let g=E.charCodeAt(S);if(55296<=g&&g<=56319){if(++S>=v)return A+this.wcwidth(g);const M=E.charCodeAt(S);56320<=M&&M<=57343?g=1024*(g-55296)+M-56320+65536:A+=this.wcwidth(M)}const y=this.charProperties(g,w);let T=p.extractWidth(y);p.extractShouldJoin(y)&&(T-=p.extractWidth(w)),A+=T,w=y}return A}charProperties(E,A){return this._activeProvider.charProperties(E,A)}}l.UnicodeService=p}},s={};function o(f){var l=s[f];if(l!==void 0)return l.exports;var c=s[f]={exports:{}};return n[f].call(c.exports,c,c.exports,o),c.exports}var u={};return(()=>{var f=u;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const l=o(9042),c=o(3236),h=o(844),m=o(5741),p=o(8285),_=o(7975),E=o(7090),A=["cols","rows"];class w extends h.Disposable{constructor(S){super(),this._core=this.register(new c.Terminal(S)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const g=T=>this._core.options[T],y=(T,M)=>{this._checkReadonlyOptions(T),this._core.options[T]=M};for(const T in this._core.options){const M={get:g.bind(this,T),set:y.bind(this,T)};Object.defineProperty(this._publicOptions,T,M)}}_checkReadonlyOptions(S){if(A.includes(S))throw new Error(`Option "${S}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new E.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 p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const g in S)this._publicOptions[g]=S[g]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,g=!0){this._core.input(S,g)}resize(S,g){this._verifyIntegers(S,g),this._core.resize(S,g)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,g,y){this._verifyIntegers(S,g,y),this._core.select(S,g,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,g){this._verifyIntegers(S,g),this._core.selectLines(S,g)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,g){this._core.write(S,g)}writeln(S,g){this._core.write(S),this._core.write(`\r
408
+ `,g)}paste(S){this._core.paste(S)}refresh(S,g){this._verifyIntegers(S,g),this._core.refresh(S,g)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return l}_verifyIntegers(...S){for(const g of S)if(g===1/0||isNaN(g)||g%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const g of S)if(g&&(g===1/0||isNaN(g)||g%1!=0||g<0))throw new Error("This API only accepts positive integers")}}f.Terminal=w})(),u})()))})(Fm)),Fm.exports}var ej=X3(),Hm={exports:{}},xC;function tj(){return xC||(xC=1,(function(e,r){(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 f=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),h=Math.max(0,parseInt(l.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),p=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),_=h-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(_/u.css.cell.width)),rows:Math.max(1,Math.floor(p/u.css.cell.height))}}}})(),n})()))})(Hm)),Hm.exports}var rj=tj();/**
409
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
410
+ * @license MIT
411
+ *
412
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
413
+ * @license MIT
414
+ *
415
+ * Originally forked from (with the author's permission):
416
+ * Fabrice Bellard's javascript vt100 for jslinux:
417
+ * http://bellard.org/jslinux/
418
+ * Copyright (c) 2011 Fabrice Bellard
419
+ */var nj=class{constructor(e,r,n,s={}){this._terminal=e,this._regex=r,this._handler=n,this._options=s}provideLinks(e,r){let n=sj.computeLink(e,this._regex,this._terminal,this._handler);r(this._addCallbacks(n))}_addCallbacks(e){return e.map(r=>(r.leave=this._options.leave,r.hover=(n,s)=>{if(this._options.hover){let{range:o}=r;this._options.hover(n,s,o)}},r))}};function ij(e){try{let r=new URL(e),n=r.password&&r.username?`${r.protocol}//${r.username}:${r.password}@${r.host}`:r.username?`${r.protocol}//${r.username}@${r.host}`:`${r.protocol}//${r.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var sj=class Hd{static computeLink(r,n,s,o){let u=new RegExp(n.source,(n.flags||"")+"g"),[f,l]=Hd._getWindowedLineStrings(r-1,s),c=f.join(""),h,m=[];for(;h=u.exec(c);){let p=h[0];if(!ij(p))continue;let[_,E]=Hd._mapStrIdx(s,l,0,h.index),[A,w]=Hd._mapStrIdx(s,_,E,p.length);if(_===-1||E===-1||A===-1||w===-1)continue;let v={start:{x:E+1,y:_+1},end:{x:w,y:A+1}};m.push({range:v,text:p,activate:o})}return m}static _getWindowedLineStrings(r,n){let s,o=r,u=r,f=0,l="",c=[];if(s=n.buffer.active.getLine(r)){let h=s.translateToString(!0);if(s.isWrapped&&h[0]!==" "){for(f=0;(s=n.buffer.active.getLine(--o))&&f<2048&&(l=s.translateToString(!0),f+=l.length,c.push(l),!(!s.isWrapped||l.indexOf(" ")!==-1)););c.reverse()}for(c.push(h),f=0;(s=n.buffer.active.getLine(++u))&&s.isWrapped&&f<2048&&(l=s.translateToString(!0),f+=l.length,c.push(l),l.indexOf(" ")===-1););}return[c,o]}static _mapStrIdx(r,n,s,o){let u=r.buffer.active,f=u.getNullCell(),l=s;for(;o;){let c=u.getLine(n);if(!c)return[-1,-1];for(let h=l;h<c.length;++h){c.getCell(h,f);let m=f.getChars();if(f.getWidth()&&(o-=m.length||1,h===c.length-1&&m==="")){let p=u.getLine(n+1);p&&p.isWrapped&&(p.getCell(0,f),f.getWidth()===2&&(o+=1))}if(o<0)return[n,h]}n++,l=0}return[n,l]}},oj=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function aj(e,r){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}var lj=class{constructor(e=aj,r={}){this._handler=e,this._options=r}activate(e){this._terminal=e;let r=this._options,n=r.urlRegex||oj;this._linkProvider=this._terminal.registerLinkProvider(new nj(this._terminal,n,this._handler,r))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};const cj={background:"#1a1a1a",foreground:"#d4d4d4",cursor:"#d4d4d4",cursorAccent:"#1a1a1a",selectionBackground:"#3a3a3a",black:"#1a1a1a",red:"#f44747",green:"#6a9955",yellow:"#dcdcaa",blue:"#569cd6",magenta:"#c586c0",cyan:"#4ec9b0",white:"#d4d4d4",brightBlack:"#808080",brightRed:"#f44747",brightGreen:"#6a9955",brightYellow:"#dcdcaa",brightBlue:"#569cd6",brightMagenta:"#c586c0",brightCyan:"#4ec9b0",brightWhite:"#ffffff"},uj={background:"#ffffff",foreground:"#383a42",cursor:"#383a42",cursorAccent:"#ffffff",selectionBackground:"#d7d7d7",black:"#383a42",red:"#e45649",green:"#50a14f",yellow:"#c18401",blue:"#4078f2",magenta:"#a626a4",cyan:"#0184bc",white:"#fafafa",brightBlack:"#4f525e",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"};function dj({sessionId:e}){const r=R.useRef(null),n=R.useRef(null),s=R.useRef(null),[o,u]=R.useState(!1),{sendTerminalInput:f,resizeTerminal:l,subscribeToSession:c}=co(),h=Ge(w=>w.connectionState),{resolvedTheme:m}=Wg(),p=h==="verified"||h==="authenticated",_=R.useMemo(()=>m==="dark"?cj:uj,[m]);R.useEffect(()=>{if(!r.current||n.current)return;const w=new ej.Terminal({cursorBlink:!0,cursorStyle:"block",fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:_,scrollback:1e4,convertEol:!0}),v=new rj.FitAddon,S=new lj;return w.loadAddon(v),w.loadAddon(S),w.open(r.current),v.fit(),n.current=w,s.current=v,u(!0),w.onData(g=>{p&&f(e,g)}),c(e),()=>{w.dispose(),n.current=null,s.current=null}},[e,p,f,c]);const E=R.useCallback(()=>{if(s.current&&n.current&&p){s.current.fit();const{cols:w,rows:v}=n.current;l(e,w,v)}},[e,p,l]);R.useEffect(()=>{if(!r.current||!o)return;const w=new ResizeObserver(()=>{E()});return w.observe(r.current),window.addEventListener("resize",E),E(),()=>{w.disconnect(),window.removeEventListener("resize",E)}},[E,o]),R.useEffect(()=>{n.current&&(n.current.options.theme=_)},[_]),R.useEffect(()=>{if(!n.current)return;const w=v=>{v.detail.sessionId===e&&n.current&&n.current.write(v.detail.data)};return window.addEventListener("terminal-output",w),()=>{window.removeEventListener("terminal-output",w)}},[e]),R.useEffect(()=>{const w=v=>{v.detail.sessionId===e&&n.current&&n.current.clear()};return window.addEventListener("terminal-clear",w),()=>{window.removeEventListener("terminal-clear",w)}},[e]);const A=m==="dark"?"bg-[#1a1a1a]":"bg-white";return b.jsx("div",{className:`flex flex-col h-full ${A}`,children:b.jsx("div",{ref:r,className:"flex-1 p-2"})})}function hj(){const{sessionId:e}=UC();return e?b.jsx(dj,{sessionId:e}):b.jsx(xd,{to:"/chat",replace:!0})}var Ih="Switch",[fj]=qn(Ih),[pj,mj]=fj(Ih),fA=R.forwardRef((e,r)=>{const{__scopeSwitch:n,name:s,checked:o,defaultChecked:u,required:f,disabled:l,value:c="on",onCheckedChange:h,form:m,...p}=e,[_,E]=R.useState(null),A=st(r,y=>E(y)),w=R.useRef(!1),v=_?m||!!_.closest("form"):!0,[S,g]=ro({prop:o,defaultProp:u??!1,onChange:h,caller:Ih});return b.jsxs(pj,{scope:n,checked:S,disabled:l,children:[b.jsx($e.button,{type:"button",role:"switch","aria-checked":S,"aria-required":f,"data-state":vA(S),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:A,onClick:Le(e.onClick,y=>{g(T=>!T),v&&(w.current=y.isPropagationStopped(),w.current||y.stopPropagation())})}),v&&b.jsx(gA,{control:_,bubbles:!w.current,name:s,value:c,checked:S,required:f,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});fA.displayName=Ih;var pA="SwitchThumb",mA=R.forwardRef((e,r)=>{const{__scopeSwitch:n,...s}=e,o=mj(pA,n);return b.jsx($e.span,{"data-state":vA(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:r})});mA.displayName=pA;var gj="SwitchBubbleInput",gA=R.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:s=!0,...o},u)=>{const f=R.useRef(null),l=st(f,u),c=yw(n),h=cw(r);return R.useEffect(()=>{const m=f.current;if(!m)return;const p=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==n&&E){const A=new Event("click",{bubbles:s});E.call(m,n),m.dispatchEvent(A)}},[c,n,s]),b.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});gA.displayName=gj;function vA(e){return e?"checked":"unchecked"}var _A=fA,vj=mA;const yA=R.forwardRef(({className:e,...r},n)=>b.jsx(_A,{className:Te("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:b.jsx(vj,{className:Te("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform","data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));yA.displayName=_A.displayName;function _j(){const e=Ge(v=>v.credentials),r=Ge(v=>v.workstationInfo),n=Ge(v=>v.tunnelInfo),s=Ge(v=>v.connectionState),{disconnectAndForget:o}=co(),u=Pn(v=>v.reset),f=Pn(v=>v.ttsEnabled),l=Pn(v=>v.setTtsEnabled),{theme:c,setTheme:h}=Wg(),[m,p]=R.useState(!1),_=async()=>{await o(),u(),p(!1)},E=s==="verified"||s==="authenticated",A=()=>{switch(s){case"verified":return"bg-green-500";case"authenticated":return"bg-yellow-500";case"connecting":return"bg-blue-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-gray-500"}},w=()=>{switch(s){case"verified":return"Connected to Workstation";case"authenticated":return"Connected to Tunnel";case"connecting":return"Connecting...";case"error":return"Connection Error";default:return"Disconnected"}};return b.jsx("div",{className:"h-full overflow-y-auto p-4",children:b.jsxs("div",{className:"max-w-2xl mx-auto space-y-6 pb-8",children:[b.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),b.jsxs(hs,{children:[b.jsxs(fs,{children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(gS,{className:"w-5 h-5 text-muted-foreground"}),b.jsx(ps,{children:"Appearance"})]}),b.jsx(Xs,{children:"Customize the look and feel of the application"})]}),b.jsx(ms,{children:b.jsxs("div",{className:"space-y-2",children:[b.jsx("p",{className:"text-sm text-muted-foreground",children:"Theme"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsxs(ct,{variant:"outline",className:Te("flex-1 gap-2",c==="light"&&"border-primary bg-primary/10"),onClick:()=>h("light"),children:[b.jsx(gS,{className:"w-4 h-4"}),"Light"]}),b.jsxs(ct,{variant:"outline",className:Te("flex-1 gap-2",c==="dark"&&"border-primary bg-primary/10"),onClick:()=>h("dark"),children:[b.jsx(qM,{className:"w-4 h-4"}),"Dark"]}),b.jsxs(ct,{variant:"outline",className:Te("flex-1 gap-2",c==="system"&&"border-primary bg-primary/10"),onClick:()=>h("system"),children:[b.jsx(UM,{className:"w-4 h-4"}),"System"]})]})]})})]}),b.jsxs(hs,{children:[b.jsxs(fs,{children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(JM,{className:"w-5 h-5 text-muted-foreground"}),b.jsx(ps,{children:"Voice"})]}),b.jsx(Xs,{children:"Configure text-to-speech and voice input settings"})]}),b.jsx(ms,{children:b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"space-y-0.5",children:[b.jsx(aa,{htmlFor:"tts-toggle",className:"text-sm font-medium",children:"Auto-play TTS responses"}),b.jsx("p",{className:"text-sm text-muted-foreground",children:"Automatically play audio when receiving voice responses"})]}),b.jsx(yA,{id:"tts-toggle",checked:f,onCheckedChange:l})]})})]}),b.jsxs(hs,{children:[b.jsxs(fs,{children:[b.jsxs("div",{className:"flex items-center gap-2",children:[E?b.jsx(o1,{className:"w-5 h-5 text-green-500"}):b.jsx(s1,{className:"w-5 h-5 text-muted-foreground"}),b.jsx(ps,{children:"Connection"})]}),b.jsx(Xs,{children:"Current connection status and information"})]}),b.jsxs(ms,{className:"space-y-4",children:[b.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/50",children:[b.jsx("div",{className:`w-3 h-3 rounded-full ${A()}`}),b.jsx("span",{className:"font-medium",children:w()})]}),e&&b.jsxs("div",{className:"space-y-3 text-sm",children:[b.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[b.jsx(t1,{className:"w-4 h-4"}),b.jsx("span",{children:"Connection Details"})]}),b.jsxs("div",{className:"grid gap-2 pl-6",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Tunnel ID:"}),b.jsx("span",{className:"font-mono text-xs",children:e.tunnelId})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Tunnel URL:"}),b.jsx("span",{className:"font-mono text-xs truncate max-w-[200px]",children:e.tunnelUrl})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Device ID:"}),b.jsx("span",{className:"font-mono text-xs",children:e.deviceId})]})]})]}),r&&b.jsxs("div",{className:"space-y-3 text-sm border-t pt-4",children:[b.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[b.jsx(VM,{className:"w-4 h-4"}),b.jsx("span",{children:"Workstation"})]}),b.jsxs("div",{className:"grid gap-2 pl-6",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Name:"}),b.jsx("span",{children:r.name})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Version:"}),b.jsx("span",{className:"font-mono text-xs",children:r.version})]}),r.workspacesRoot&&b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Workspaces:"}),b.jsx("span",{className:"font-mono text-xs truncate max-w-[200px]",children:r.workspacesRoot})]})]})]}),n&&b.jsxs("div",{className:"space-y-3 text-sm border-t pt-4",children:[b.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[b.jsx(KM,{className:"w-4 h-4"}),b.jsx("span",{children:"Tunnel Server"})]}),b.jsxs("div",{className:"grid gap-2 pl-6",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Version:"}),b.jsx("span",{className:"font-mono text-xs",children:n.version})]}),n.protocolVersion&&b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Protocol:"}),b.jsxs("span",{className:"font-mono text-xs",children:["v",n.protocolVersion]})]})]})]})]})]}),b.jsxs(hs,{children:[b.jsxs(fs,{children:[b.jsx(ps,{children:"About"}),b.jsx(Xs,{children:"Tiflis Code Web Client"})]}),b.jsxs(ms,{className:"space-y-2 text-sm",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Version:"}),b.jsx("span",{className:"font-mono",children:"0.1.0"})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Author:"}),b.jsx("span",{children:"Roman Barinov"})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"Repository:"}),b.jsx("a",{href:"https://github.com/tiflis-io/tiflis-code",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"tiflis-io/tiflis-code"})]}),b.jsxs("div",{className:"flex justify-between",children:[b.jsx("span",{className:"text-muted-foreground",children:"License:"}),b.jsx("span",{children:"FSL-1.1-NC"})]})]})]}),b.jsxs(hs,{children:[b.jsx(fs,{children:b.jsx(ps,{children:"Legal"})}),b.jsxs(ms,{className:"space-y-2 text-sm",children:[b.jsxs("div",{className:"flex justify-between items-center",children:[b.jsx("span",{className:"text-muted-foreground",children:"Privacy Policy"}),b.jsx("a",{href:"https://github.com/tiflis-io/tiflis-code/blob/main/PRIVACY.md",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"View"})]}),b.jsxs("div",{className:"flex justify-between items-center",children:[b.jsx("span",{className:"text-muted-foreground",children:"Terms of Service"}),b.jsx("a",{href:"https://github.com/tiflis-io/tiflis-code/blob/main/TERMS.md",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"View"})]})]})]}),b.jsxs(hs,{className:"border-destructive/50",children:[b.jsxs(fs,{children:[b.jsx(ps,{className:"text-destructive",children:"Danger Zone"}),b.jsx(Xs,{children:"Disconnect and clear all stored data"})]}),b.jsx(ms,{children:b.jsxs(Jd,{open:m,onOpenChange:p,children:[b.jsx(w4,{asChild:!0,children:b.jsxs(ct,{variant:"destructive",className:"w-full",children:[b.jsx($l,{className:"w-4 h-4"}),"Disconnect & Forget All Data"]})}),b.jsxs(tc,{children:[b.jsxs(rc,{children:[b.jsx(ic,{children:"Are you sure?"}),b.jsxs(sc,{children:["This will permanently delete all stored connection data including:",b.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[b.jsx("li",{children:"Authentication keys"}),b.jsx("li",{children:"Tunnel connection settings"}),b.jsx("li",{children:"Device ID"}),b.jsx("li",{children:"All stored preferences"})]}),b.jsx("p",{className:"mt-2 font-medium",children:"You will need to scan a QR code or paste a magic link again to reconnect."})]})]}),b.jsxs(nc,{children:[b.jsx(ac,{children:"Cancel"}),b.jsx(oc,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete All Data"})]})]})]})})]})]})})}function yj(){const e=Ge(r=>r.isAuthenticated);return b.jsx(vD,{children:b.jsx(WR,{children:e?b.jsxs(b.Fragment,{children:[b.jsxs(Ln,{element:b.jsx(SI,{}),children:[b.jsx(Ln,{path:"/",element:b.jsx(xd,{to:"/chat",replace:!0})}),b.jsx(Ln,{path:"/chat",element:b.jsx(wC,{})}),b.jsx(Ln,{path:"/chat/:sessionId",element:b.jsx(wC,{})}),b.jsx(Ln,{path:"/terminal/:sessionId",element:b.jsx(hj,{})}),b.jsx(Ln,{path:"/settings",element:b.jsx(_j,{})})]}),b.jsx(Ln,{path:"*",element:b.jsx(xd,{to:"/chat",replace:!0})})]}):b.jsxs(b.Fragment,{children:[b.jsx(Ln,{path:"/",element:b.jsx(Lk,{})}),b.jsx(Ln,{path:"*",element:b.jsx(xd,{to:"/",replace:!0})})]})})})}class Sj extends R.Component{constructor(n){super(n);_e(this,"handleReset",()=>{this.setState({hasError:!1,error:null,errorInfo:null})});_e(this,"handleReload",()=>{window.location.reload()});this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,s){this.setState({errorInfo:s})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:b.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",role:"alert","aria-live":"assertive",children:b.jsxs("div",{className:"w-full max-w-md space-y-6 text-center",children:[b.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10",children:b.jsx(zg,{className:"h-8 w-8 text-destructive","aria-hidden":"true"})}),b.jsxs("div",{className:"space-y-2",children:[b.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:"Something went wrong"}),b.jsx("p",{className:"text-muted-foreground",children:"An unexpected error occurred. Please try again or reload the page."})]}),!1,b.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-center",children:[b.jsxs(ct,{variant:"outline",onClick:this.handleReset,className:"gap-2",children:[b.jsx(Gg,{className:"h-4 w-4","aria-hidden":"true"}),"Try again"]}),b.jsx(ct,{onClick:this.handleReload,children:"Reload page"})]})]})}):this.props.children}}function Cj(){const e=M4();return b.jsx(R4,{toasts:e,onDismiss:r=>vi.dismiss(r)})}const SA=document.getElementById("root");if(!SA)throw new Error("Root element not found");WT.createRoot(SA).render(b.jsx(R.StrictMode,{children:b.jsx(Sj,{children:b.jsxs(kk,{defaultTheme:"system",children:[b.jsx(yj,{}),b.jsx(Cj,{})]})})}));
420
+ //# sourceMappingURL=index-GhltkWpx.js.map