larness 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (725) hide show
  1. package/apps/server/dist/{address-BE25lU9-.js → address-Dh8XUuOk.js} +2 -2
  2. package/apps/server/dist/{client-Co1thYbK.js → client-D64wZ3lt.js} +1 -1
  3. package/apps/server/dist/{doctor-ClvbJZvj.js → doctor-rEr7DMMb.js} +27 -1
  4. package/apps/server/dist/doctor.js +1 -1
  5. package/apps/server/dist/index.js +4737 -871
  6. package/apps/server/dist/{managed-CLFUiDbj.js → managed-nCF4mKiY.js} +105 -20
  7. package/apps/server/dist/{paths-BHryFHwq.js → paths-Dds-A0kx.js} +103 -16
  8. package/apps/server/dist/{status-idXF0pm6.js → status-toJt8Dby.js} +1 -1
  9. package/apps/server/dist/status.js +3 -3
  10. package/apps/server/dist/tui.js +6 -6
  11. package/apps/server/drizzle/0028_connection_revision.sql +4 -0
  12. package/apps/server/drizzle/0029_model_capabilities.sql +3 -0
  13. package/apps/server/drizzle/0030_connection_preset.sql +1 -0
  14. package/apps/server/drizzle/0031_session_attachments.sql +13 -0
  15. package/apps/server/drizzle/meta/0028_snapshot.json +5050 -0
  16. package/apps/server/drizzle/meta/0029_snapshot.json +5072 -0
  17. package/apps/server/drizzle/meta/0030_snapshot.json +5079 -0
  18. package/apps/server/drizzle/meta/0031_snapshot.json +5161 -0
  19. package/apps/server/drizzle/meta/_journal.json +28 -0
  20. package/apps/web/dist/assets/3d-GvfzDZ80.svg +1 -0
  21. package/apps/web/dist/assets/FileEditor-Qgvegzha.js +1 -0
  22. package/apps/web/dist/assets/FileViewer-DOkamgXq.js +1 -0
  23. package/apps/web/dist/assets/abap-zcHrj5Xb.svg +1 -0
  24. package/apps/web/dist/assets/abc-BQOYa5wK.svg +1 -0
  25. package/apps/web/dist/assets/actionscript-1utLHLAz.svg +1 -0
  26. package/apps/web/dist/assets/ada-Cy6ba0Qq.svg +1 -0
  27. package/apps/web/dist/assets/adobe-illustrator-sWEEUrcs.svg +1 -0
  28. package/apps/web/dist/assets/adobe-illustrator_light-D2DPvhMa.svg +1 -0
  29. package/apps/web/dist/assets/adobe-photoshop-C9zHvesC.svg +1 -0
  30. package/apps/web/dist/assets/adobe-photoshop_light-NN072IT9.svg +1 -0
  31. package/apps/web/dist/assets/adobe-swc-LNQHFox2.svg +1 -0
  32. package/apps/web/dist/assets/adonis-DhCi1CYk.svg +1 -0
  33. package/apps/web/dist/assets/advpl-Bp9JCc1p.svg +1 -0
  34. package/apps/web/dist/assets/advpl-include.clone-VnvrVExx.svg +1 -0
  35. package/apps/web/dist/assets/advpl-ptm.clone-CYO0PaUz.svg +1 -0
  36. package/apps/web/dist/assets/advpl-tlpp.clone-DfmYKqy_.svg +1 -0
  37. package/apps/web/dist/assets/agent-BxOtSm05.svg +1 -0
  38. package/apps/web/dist/assets/ahk2.clone-B37eSFwd.svg +1 -0
  39. package/apps/web/dist/assets/amplify-DRZRkWT8.svg +1 -0
  40. package/apps/web/dist/assets/android-CpjzHt5t.svg +1 -0
  41. package/apps/web/dist/assets/angular-DFUdV-A_.svg +1 -0
  42. package/apps/web/dist/assets/angular-component.clone-DPfQ4F6H.svg +1 -0
  43. package/apps/web/dist/assets/angular-directive.clone-mvknCQzz.svg +1 -0
  44. package/apps/web/dist/assets/angular-guard.clone-4k8JYMtP.svg +1 -0
  45. package/apps/web/dist/assets/angular-interceptor.clone-D8NJcCc2.svg +1 -0
  46. package/apps/web/dist/assets/angular-pipe.clone-Ci6wBNx-.svg +1 -0
  47. package/apps/web/dist/assets/angular-service.clone-DCol0S-k.svg +1 -0
  48. package/apps/web/dist/assets/antlr-CZ6ONsGE.svg +1 -0
  49. package/apps/web/dist/assets/apiblueprint-BiEj4kUZ.svg +1 -0
  50. package/apps/web/dist/assets/apollo-B7lxyZr2.svg +1 -0
  51. package/apps/web/dist/assets/applescript-C5GvYDyf.svg +1 -0
  52. package/apps/web/dist/assets/apps-script-Be0-6z7A.svg +1 -0
  53. package/apps/web/dist/assets/appveyor-Cs4ENZv5.svg +1 -0
  54. package/apps/web/dist/assets/appwrite-BUKExqzc.svg +1 -0
  55. package/apps/web/dist/assets/architecture-B6M6RHiH.svg +1 -0
  56. package/apps/web/dist/assets/arduino-CbQWXj_a.svg +1 -0
  57. package/apps/web/dist/assets/asciidoc-B22TwDpY.svg +1 -0
  58. package/apps/web/dist/assets/assembly-Bet93dzY.svg +1 -0
  59. package/apps/web/dist/assets/astro-BUUa0maZ.svg +1 -0
  60. package/apps/web/dist/assets/astro-config-DdwU1MRK.svg +1 -0
  61. package/apps/web/dist/assets/astyle-BRf7s52j.svg +1 -0
  62. package/apps/web/dist/assets/audio-Bywf1Co-.svg +1 -0
  63. package/apps/web/dist/assets/aurelia-tU1uCks4.svg +1 -0
  64. package/apps/web/dist/assets/authors-BdJurtAa.svg +1 -0
  65. package/apps/web/dist/assets/auto-DVjjVkxv.svg +1 -0
  66. package/apps/web/dist/assets/auto_light-D1xqv5Lr.svg +1 -0
  67. package/apps/web/dist/assets/autohotkey-ByBHDxk_.svg +1 -0
  68. package/apps/web/dist/assets/autoit-JVlbsvw0.svg +1 -0
  69. package/apps/web/dist/assets/azure-CYStDhcY.svg +1 -0
  70. package/apps/web/dist/assets/azure-pipelines-B9Fm_WoB.svg +1 -0
  71. package/apps/web/dist/assets/babel-CfbwjPI_.svg +1 -0
  72. package/apps/web/dist/assets/ballerina-WYd0LP1Y.svg +1 -0
  73. package/apps/web/dist/assets/bashly-DHSkixAO.svg +1 -0
  74. package/apps/web/dist/assets/bashly-hook-9Mv8LRrF.svg +1 -0
  75. package/apps/web/dist/assets/bashly-settings.clone-DfYFKY3x.svg +1 -0
  76. package/apps/web/dist/assets/bashly-settings_light.clone-CMEpG_2X.svg +1 -0
  77. package/apps/web/dist/assets/bashly-strings.clone-NTfg7QoB.svg +1 -0
  78. package/apps/web/dist/assets/bashly-strings_light.clone-Q97hcxOA.svg +1 -0
  79. package/apps/web/dist/assets/bazel-B1jD6CCP.svg +1 -0
  80. package/apps/web/dist/assets/bbx-H7h3lOC1.svg +1 -0
  81. package/apps/web/dist/assets/beancount-X9cePwfk.svg +1 -0
  82. package/apps/web/dist/assets/bench-js-AfVYS5Q-.svg +1 -0
  83. package/apps/web/dist/assets/bench-jsx-CYYSNEDq.svg +1 -0
  84. package/apps/web/dist/assets/bench-ts-J3RbQZA1.svg +1 -0
  85. package/apps/web/dist/assets/bibliography-Cfqz-V_v.svg +1 -0
  86. package/apps/web/dist/assets/bibtex-style-Bga8_ko3.svg +1 -0
  87. package/apps/web/dist/assets/bicep-BArUVCZd.svg +1 -0
  88. package/apps/web/dist/assets/biome-C4m9PMtY.svg +1 -0
  89. package/apps/web/dist/assets/bitbucket-DQMkNffy.svg +1 -0
  90. package/apps/web/dist/assets/bithound-vUP4w_31.svg +1 -0
  91. package/apps/web/dist/assets/blender-CUL5vLUh.svg +1 -0
  92. package/apps/web/dist/assets/blink-BI7IXV1Z.svg +1 -0
  93. package/apps/web/dist/assets/blink_light-COZodupG.svg +1 -0
  94. package/apps/web/dist/assets/blitz-Dm9VjppV.svg +1 -0
  95. package/apps/web/dist/assets/bower-LboQHWQ3.svg +1 -0
  96. package/apps/web/dist/assets/brainfuck-RilAqwD6.svg +1 -0
  97. package/apps/web/dist/assets/browserlist-CuPoqIMP.svg +1 -0
  98. package/apps/web/dist/assets/browserlist_light-BYnXyEhm.svg +1 -0
  99. package/apps/web/dist/assets/bruno-DSx1B-A_.svg +1 -0
  100. package/apps/web/dist/assets/buck-Cc_ZWrU4.svg +1 -0
  101. package/apps/web/dist/assets/bucklescript--vVE5GB7.svg +1 -0
  102. package/apps/web/dist/assets/buildkite-BK4a2dN6.svg +1 -0
  103. package/apps/web/dist/assets/bun-DsZhmzEY.svg +1 -0
  104. package/apps/web/dist/assets/bun_light-BfmVf7QK.svg +1 -0
  105. package/apps/web/dist/assets/c-DSMamfmd.svg +1 -0
  106. package/apps/web/dist/assets/c3-busjNPxF.svg +1 -0
  107. package/apps/web/dist/assets/cabal-CXQaD4_8.svg +1 -0
  108. package/apps/web/dist/assets/caddy-C-yl9ops.svg +1 -0
  109. package/apps/web/dist/assets/cadence-BnzFLh7c.svg +1 -0
  110. package/apps/web/dist/assets/cairo-BQe5JbWT.svg +1 -0
  111. package/apps/web/dist/assets/cake-CIWNoe3H.svg +1 -0
  112. package/apps/web/dist/assets/capacitor-BVrtN6NN.svg +1 -0
  113. package/apps/web/dist/assets/capnp-DOYFucQK.svg +1 -0
  114. package/apps/web/dist/assets/cbx-izdt45Dy.svg +1 -0
  115. package/apps/web/dist/assets/cds-DrciT9mt.svg +1 -0
  116. package/apps/web/dist/assets/certificate-Itcn-kkw.svg +1 -0
  117. package/apps/web/dist/assets/changelog-DQV91D4J.svg +1 -0
  118. package/apps/web/dist/assets/chess-CaTYZWGa.svg +1 -0
  119. package/apps/web/dist/assets/chess_light-c5ZDShuN.svg +1 -0
  120. package/apps/web/dist/assets/chromatic-DJlR9Ku7.svg +1 -0
  121. package/apps/web/dist/assets/chrome-C0OlHOjg.svg +1 -0
  122. package/apps/web/dist/assets/circleci-9ttw_4fs.svg +1 -0
  123. package/apps/web/dist/assets/circleci_light-DmqaKCg8.svg +1 -0
  124. package/apps/web/dist/assets/citation-o698k82_.svg +1 -0
  125. package/apps/web/dist/assets/clangd-DcGtRW6m.svg +1 -0
  126. package/apps/web/dist/assets/claude-3t_S_T_H.svg +1 -0
  127. package/apps/web/dist/assets/cline-DvmTAOWh.svg +1 -0
  128. package/apps/web/dist/assets/clojure-B26qS46w.svg +1 -0
  129. package/apps/web/dist/assets/cloudfoundry-Izs71g2t.svg +1 -0
  130. package/apps/web/dist/assets/cmake-BQaPjfyp.svg +1 -0
  131. package/apps/web/dist/assets/coala-BnxMg8iZ.svg +1 -0
  132. package/apps/web/dist/assets/cobol-BU0pDfAq.svg +1 -0
  133. package/apps/web/dist/assets/coconut-DzmjzewY.svg +1 -0
  134. package/apps/web/dist/assets/code-climate-HCb00Ja6.svg +1 -0
  135. package/apps/web/dist/assets/code-climate_light-Cs-8tGCu.svg +1 -0
  136. package/apps/web/dist/assets/codecov-Ca2J08eE.svg +1 -0
  137. package/apps/web/dist/assets/codeowners-D6jwx6Op.svg +1 -0
  138. package/apps/web/dist/assets/coderabbit-ai-h2jUCqTF.svg +1 -0
  139. package/apps/web/dist/assets/coffee-Cx6lN0Om.svg +1 -0
  140. package/apps/web/dist/assets/coldfusion-C_cwuVYt.svg +1 -0
  141. package/apps/web/dist/assets/coloredpetrinets-Bg0ddM0g.svg +1 -0
  142. package/apps/web/dist/assets/command-yx0gkfNg.svg +1 -0
  143. package/apps/web/dist/assets/commitizen-Bwv88Q2Q.svg +1 -0
  144. package/apps/web/dist/assets/commitlint-BJT3ucOp.svg +1 -0
  145. package/apps/web/dist/assets/concourse-Bt-txRgW.svg +1 -0
  146. package/apps/web/dist/assets/conduct-BkB2tjgj.svg +1 -0
  147. package/apps/web/dist/assets/console-D3K9rxA0.svg +1 -0
  148. package/apps/web/dist/assets/container.clone-C7n8A5bJ.svg +1 -0
  149. package/apps/web/dist/assets/contentlayer-CNxQL_iE.svg +1 -0
  150. package/apps/web/dist/assets/context-DC2VDLch.svg +1 -0
  151. package/apps/web/dist/assets/contributing-SBExBaCT.svg +1 -0
  152. package/apps/web/dist/assets/controller-DcERpd5w.svg +1 -0
  153. package/apps/web/dist/assets/copilot-B1KwNGRZ.svg +1 -0
  154. package/apps/web/dist/assets/copilot_light-CmeNXrTH.svg +1 -0
  155. package/apps/web/dist/assets/cpp-INM4-kSs.svg +1 -0
  156. package/apps/web/dist/assets/craco-BITlkIvR.svg +1 -0
  157. package/apps/web/dist/assets/credits-CODi5TMI.svg +1 -0
  158. package/apps/web/dist/assets/crystal-Dybl_hLt.svg +1 -0
  159. package/apps/web/dist/assets/crystal_light-DxCgyvBp.svg +1 -0
  160. package/apps/web/dist/assets/csharp-CsWYnqLf.svg +1 -0
  161. package/apps/web/dist/assets/css-BSpPuOMr.svg +1 -0
  162. package/apps/web/dist/assets/css-map-DBk294NY.svg +1 -0
  163. package/apps/web/dist/assets/{cssMode-B2gCrV51.js → cssMode-CNLukUsc.js} +1 -1
  164. package/apps/web/dist/assets/cucumber-U4p68nZM.svg +1 -0
  165. package/apps/web/dist/assets/cuda-DIAU-Jy3.svg +1 -0
  166. package/apps/web/dist/assets/cue-QgLqfqqY.svg +1 -0
  167. package/apps/web/dist/assets/cursor-B-BDgFTJ.svg +1 -0
  168. package/apps/web/dist/assets/cursor_light-DKdMqmNV.svg +1 -0
  169. package/apps/web/dist/assets/cypress-CizKTegg.svg +1 -0
  170. package/apps/web/dist/assets/d-CIX_k_QG.svg +1 -0
  171. package/apps/web/dist/assets/dart-kd3Gtzqg.svg +1 -0
  172. package/apps/web/dist/assets/dart_generated-upPvSvAz.svg +1 -0
  173. package/apps/web/dist/assets/database-Cj22jZTN.svg +1 -0
  174. package/apps/web/dist/assets/deepsource-myAQMb8d.svg +1 -0
  175. package/apps/web/dist/assets/denizenscript-Dq20OGy5.svg +1 -0
  176. package/apps/web/dist/assets/deno-Am9P1Un1.svg +1 -0
  177. package/apps/web/dist/assets/deno_light-DzGu3TJc.svg +1 -0
  178. package/apps/web/dist/assets/dependabot-H7cYtumZ.svg +1 -0
  179. package/apps/web/dist/assets/dependencies-update-6pgY4zuh.svg +1 -0
  180. package/apps/web/dist/assets/dhall-CMnKxu8w.svg +1 -0
  181. package/apps/web/dist/assets/diff-C38PglOG.svg +1 -0
  182. package/apps/web/dist/assets/dinophp-CQDCxPta.svg +1 -0
  183. package/apps/web/dist/assets/disc-KZKi35ao.svg +1 -0
  184. package/apps/web/dist/assets/django-D268AtI7.svg +1 -0
  185. package/apps/web/dist/assets/dll-BmYiFphX.svg +1 -0
  186. package/apps/web/dist/assets/docker-DmVDHlbn.svg +1 -0
  187. package/apps/web/dist/assets/doctex-installer-CPTZeVG3.svg +1 -0
  188. package/apps/web/dist/assets/document-DC-WjD_F.svg +1 -0
  189. package/apps/web/dist/assets/dotjs-DxEvU_mX.svg +1 -0
  190. package/apps/web/dist/assets/drawio-Cu5s_OgJ.svg +1 -0
  191. package/apps/web/dist/assets/drizzle-eXiHlDHl.svg +1 -0
  192. package/apps/web/dist/assets/drone-D_TtVcGJ.svg +1 -0
  193. package/apps/web/dist/assets/drone_light-imSRJubx.svg +1 -0
  194. package/apps/web/dist/assets/dtx.clone-Cf6sF7jX.svg +1 -0
  195. package/apps/web/dist/assets/duc-CUOCvpwA.svg +1 -0
  196. package/apps/web/dist/assets/dune-Rds4OSEO.svg +1 -0
  197. package/apps/web/dist/assets/edge-DH0n9HNR.svg +1 -0
  198. package/apps/web/dist/assets/{editor.api-TQGsXQVT.js → editor.api-BGAC2PgT.js} +1 -1
  199. package/apps/web/dist/assets/editorconfig-pGlPAdhs.svg +1 -0
  200. package/apps/web/dist/assets/ejs-PPg4ia-7.svg +1 -0
  201. package/apps/web/dist/assets/elixir-swoXiCa5.svg +1 -0
  202. package/apps/web/dist/assets/elm-g-RQYjU8.svg +1 -0
  203. package/apps/web/dist/assets/email-1Xost_qI.svg +1 -0
  204. package/apps/web/dist/assets/ember-C7i_u_jE.svg +1 -0
  205. package/apps/web/dist/assets/epub-DFF4Z1V9.svg +1 -0
  206. package/apps/web/dist/assets/erlang-CFKD46V5.svg +1 -0
  207. package/apps/web/dist/assets/esbuild-CzRALyPJ.svg +1 -0
  208. package/apps/web/dist/assets/eslint-DzpFfw-i.svg +1 -0
  209. package/apps/web/dist/assets/excalidraw--0i0jDmr.svg +1 -0
  210. package/apps/web/dist/assets/exe-GVF74Ms1.svg +1 -0
  211. package/apps/web/dist/assets/expo-rCfxWUHV.svg +1 -0
  212. package/apps/web/dist/assets/expo_light-CwV0t5dx.svg +1 -0
  213. package/apps/web/dist/assets/fastlane-DGsHDqZX.svg +1 -0
  214. package/apps/web/dist/assets/favicon-5k2L6pP5.svg +1 -0
  215. package/apps/web/dist/assets/figma-DHcjhqjj.svg +1 -0
  216. package/apps/web/dist/assets/file-AwgZ2m-g.svg +1 -0
  217. package/apps/web/dist/assets/firebase-Ieh3jMjN.svg +1 -0
  218. package/apps/web/dist/assets/flash-CCqQbNv3.svg +1 -0
  219. package/apps/web/dist/assets/flow-jUk71z2d.svg +1 -0
  220. package/apps/web/dist/assets/font-BRNRC2Ch.svg +1 -0
  221. package/apps/web/dist/assets/forth-BMmAQzOL.svg +1 -0
  222. package/apps/web/dist/assets/fortran-CP3ZdKVq.svg +1 -0
  223. package/apps/web/dist/assets/foxpro-Btdm5--r.svg +1 -0
  224. package/apps/web/dist/assets/freemarker-C2zKExfM.svg +1 -0
  225. package/apps/web/dist/assets/{freemarker2-Due01FLd.js → freemarker2-DmzUAvZs.js} +1 -1
  226. package/apps/web/dist/assets/fsharp-Dt-hMgUp.svg +1 -0
  227. package/apps/web/dist/assets/fusebox-4t4chN0t.svg +1 -0
  228. package/apps/web/dist/assets/gamemaker-ejiPZUyu.svg +1 -0
  229. package/apps/web/dist/assets/garden-Ct0NSbAt.svg +1 -0
  230. package/apps/web/dist/assets/gatsby-D0X_jL99.svg +1 -0
  231. package/apps/web/dist/assets/gcp-BoxSRAp-.svg +1 -0
  232. package/apps/web/dist/assets/gemfile-BBynEIXH.svg +1 -0
  233. package/apps/web/dist/assets/gemini-C_j63xZO.svg +1 -0
  234. package/apps/web/dist/assets/gemini-ai-D36EEHpv.svg +1 -0
  235. package/apps/web/dist/assets/git-83tqA80G.svg +1 -0
  236. package/apps/web/dist/assets/github-actions-workflow-yImQwRPL.svg +1 -0
  237. package/apps/web/dist/assets/github-sponsors-DwCJgaHA.svg +1 -0
  238. package/apps/web/dist/assets/gitlab-D2FKBwiq.svg +1 -0
  239. package/apps/web/dist/assets/gitpod-mtqf6Ecw.svg +1 -0
  240. package/apps/web/dist/assets/gleam-D7UD7NFY.svg +1 -0
  241. package/apps/web/dist/assets/gnuplot-aGEJkf0a.svg +1 -0
  242. package/apps/web/dist/assets/go-B7ZFxYI_.svg +1 -0
  243. package/apps/web/dist/assets/go-mod-BhkxLSQa.svg +1 -0
  244. package/apps/web/dist/assets/go_gopher-DmSScfWc.svg +1 -0
  245. package/apps/web/dist/assets/godot-CUksvswh.svg +1 -0
  246. package/apps/web/dist/assets/godot-assets-6DPGcv2N.svg +1 -0
  247. package/apps/web/dist/assets/google-D3OIi7l4.svg +1 -0
  248. package/apps/web/dist/assets/gradle-O_eVyvNV.svg +1 -0
  249. package/apps/web/dist/assets/grafana-alloy-DGp7099H.svg +1 -0
  250. package/apps/web/dist/assets/grain-BRDkpR8A.svg +1 -0
  251. package/apps/web/dist/assets/graphcool-UtN7aM38.svg +1 -0
  252. package/apps/web/dist/assets/graphql-BKt2gD_N.svg +1 -0
  253. package/apps/web/dist/assets/gridsome-DYSDoPsY.svg +1 -0
  254. package/apps/web/dist/assets/groovy-BXzGpjj1.svg +1 -0
  255. package/apps/web/dist/assets/grunt-C7Ff529N.svg +1 -0
  256. package/apps/web/dist/assets/gulp-BUcnj4ZL.svg +1 -0
  257. package/apps/web/dist/assets/h-BHMofc-S.svg +1 -0
  258. package/apps/web/dist/assets/hack-B-fBDX3-.svg +1 -0
  259. package/apps/web/dist/assets/hadolint-BLryDzgC.svg +1 -0
  260. package/apps/web/dist/assets/haml-qwcGuZOZ.svg +1 -0
  261. package/apps/web/dist/assets/handlebars-C6Xcc0pI.svg +1 -0
  262. package/apps/web/dist/assets/{handlebars-Cbmho-0R.js → handlebars-CMacXF3P.js} +1 -1
  263. package/apps/web/dist/assets/happo-D49Gsgbo.svg +1 -0
  264. package/apps/web/dist/assets/hardhat-Ih6P7lBu.svg +1 -0
  265. package/apps/web/dist/assets/harmonix-DjGjAP7t.svg +1 -0
  266. package/apps/web/dist/assets/haskell-CRLyx32i.svg +1 -0
  267. package/apps/web/dist/assets/haxe-DRvJirO-.svg +1 -0
  268. package/apps/web/dist/assets/hcl-c8lmfyJf.svg +1 -0
  269. package/apps/web/dist/assets/hcl_light-BTVhx5-w.svg +1 -0
  270. package/apps/web/dist/assets/helm-Db4yKtJs.svg +1 -0
  271. package/apps/web/dist/assets/heroku-6mfFb-7E.svg +1 -0
  272. package/apps/web/dist/assets/hex-DmlOiWGa.svg +1 -0
  273. package/apps/web/dist/assets/hip-DFonLtt3.svg +1 -0
  274. package/apps/web/dist/assets/histoire-BSU5EQCa.svg +1 -0
  275. package/apps/web/dist/assets/hjson-CFnkC9Gu.svg +1 -0
  276. package/apps/web/dist/assets/horusec-TbQZoanp.svg +1 -0
  277. package/apps/web/dist/assets/hosts-kLU--r6p.svg +1 -0
  278. package/apps/web/dist/assets/hosts_light-C64Kv9no.svg +1 -0
  279. package/apps/web/dist/assets/hpp-1fokgAwc.svg +1 -0
  280. package/apps/web/dist/assets/{html-1Ke8CI8o.js → html-BufzDub2.js} +1 -1
  281. package/apps/web/dist/assets/html-C5jflT5q.svg +1 -0
  282. package/apps/web/dist/assets/{htmlMode-KxcipU--.js → htmlMode-vSvsTicL.js} +1 -1
  283. package/apps/web/dist/assets/http-DnKvXzc1.svg +1 -0
  284. package/apps/web/dist/assets/huff-BVp7HOAO.svg +1 -0
  285. package/apps/web/dist/assets/huff_light-BhG_WTHG.svg +1 -0
  286. package/apps/web/dist/assets/hurl-CyXQlwmP.svg +1 -0
  287. package/apps/web/dist/assets/husky-k4XnpPb_.svg +1 -0
  288. package/apps/web/dist/assets/i18n-YJc8oEuZ.svg +1 -0
  289. package/apps/web/dist/assets/idris-C6pFOd_c.svg +1 -0
  290. package/apps/web/dist/assets/ifanr-cloud-d4oHE7rG.svg +1 -0
  291. package/apps/web/dist/assets/image-BvX5VAOD.svg +1 -0
  292. package/apps/web/dist/assets/imba-eU8sKYuZ.svg +1 -0
  293. package/apps/web/dist/assets/index-Pz8dIHnt.js +2 -0
  294. package/apps/web/dist/assets/installation-BVbhEX8L.svg +1 -0
  295. package/apps/web/dist/assets/instructions.clone-BjasTeTu.svg +1 -0
  296. package/apps/web/dist/assets/ionic-WTmyiwWc.svg +1 -0
  297. package/apps/web/dist/assets/istanbul-B1VcxSwO.svg +1 -0
  298. package/apps/web/dist/assets/jar-DFsnj_df.svg +1 -0
  299. package/apps/web/dist/assets/java-BoeaJ1Gf.svg +1 -0
  300. package/apps/web/dist/assets/javaclass-BcpaDqY_.svg +1 -0
  301. package/apps/web/dist/assets/{javascript-DMPkDcJu.js → javascript-CWkrvOWF.js} +1 -1
  302. package/apps/web/dist/assets/javascript-DN_vk0so.svg +1 -0
  303. package/apps/web/dist/assets/javascript-map-CFPgv8cs.svg +1 -0
  304. package/apps/web/dist/assets/jenkins-DVxqAfpp.svg +1 -0
  305. package/apps/web/dist/assets/jest-BcvUOTaR.svg +1 -0
  306. package/apps/web/dist/assets/jinja-BDgDDhqR.svg +1 -0
  307. package/apps/web/dist/assets/jinja_light-Bt4m_wZ-.svg +1 -0
  308. package/apps/web/dist/assets/jsconfig-B9QwyVdg.svg +1 -0
  309. package/apps/web/dist/assets/json-CtNz2G1q.svg +1 -0
  310. package/apps/web/dist/assets/{jsonMode-CLqudskm.js → jsonMode-D6vtcW2h.js} +1 -1
  311. package/apps/web/dist/assets/json_schema-50SzRsOA.svg +1 -0
  312. package/apps/web/dist/assets/jsr-BLZDOtFt.svg +1 -0
  313. package/apps/web/dist/assets/jsr_light-DPGIWN4w.svg +1 -0
  314. package/apps/web/dist/assets/julia-DJIRuqFZ.svg +1 -0
  315. package/apps/web/dist/assets/jupyter-CF7u6bs_.svg +1 -0
  316. package/apps/web/dist/assets/just-lzoLa4H7.svg +1 -0
  317. package/apps/web/dist/assets/karma-CKzsw2-4.svg +1 -0
  318. package/apps/web/dist/assets/kcl-DYUj_9Dm.svg +1 -0
  319. package/apps/web/dist/assets/key-COm7LFld.svg +1 -0
  320. package/apps/web/dist/assets/keystatic-rXBOaTfT.svg +1 -0
  321. package/apps/web/dist/assets/kivy-hIfJ-3zX.svg +1 -0
  322. package/apps/web/dist/assets/kl-C4nSbMcJ.svg +1 -0
  323. package/apps/web/dist/assets/knip-G-lQCcx8.svg +1 -0
  324. package/apps/web/dist/assets/kotlin-CNvEmvgH.svg +1 -0
  325. package/apps/web/dist/assets/kubernetes-CMVVqFJu.svg +1 -0
  326. package/apps/web/dist/assets/kusto-BJgG2m3a.svg +1 -0
  327. package/apps/web/dist/assets/label-CWDM-Nld.svg +1 -0
  328. package/apps/web/dist/assets/laravel-CJtnT1s-.svg +1 -0
  329. package/apps/web/dist/assets/latex-class.clone-BhHYrwLh.svg +1 -0
  330. package/apps/web/dist/assets/latex.clone-CninqgRM.svg +1 -0
  331. package/apps/web/dist/assets/latexmk-D3AyqLpT.svg +1 -0
  332. package/apps/web/dist/assets/lbx-luhlNMZV.svg +1 -0
  333. package/apps/web/dist/assets/lean-LfI6mpgn.svg +1 -0
  334. package/apps/web/dist/assets/lefthook-CqXdjHx5.svg +1 -0
  335. package/apps/web/dist/assets/lerna-DGUDz_cE.svg +1 -0
  336. package/apps/web/dist/assets/less-DgAaLSXO.svg +1 -0
  337. package/apps/web/dist/assets/liara-s-sMrdWA.svg +1 -0
  338. package/apps/web/dist/assets/lib-BSLl2hIz.svg +1 -0
  339. package/apps/web/dist/assets/license-xAqV9Xi9.svg +1 -0
  340. package/apps/web/dist/assets/lighthouse-D02dHZMM.svg +1 -0
  341. package/apps/web/dist/assets/lilypond-B3CP0Q9x.svg +1 -0
  342. package/apps/web/dist/assets/lintstaged-C51rin-y.svg +1 -0
  343. package/apps/web/dist/assets/liquid-CoCfs_Yj.svg +1 -0
  344. package/apps/web/dist/assets/{liquid-bIUiAHG1.js → liquid-D5KkJyqT.js} +1 -1
  345. package/apps/web/dist/assets/lisp-CSjgnaXF.svg +1 -0
  346. package/apps/web/dist/assets/livescript-BoJSFi3a.svg +1 -0
  347. package/apps/web/dist/assets/lock-CXdZHto3.svg +1 -0
  348. package/apps/web/dist/assets/log-PUd3bLPV.svg +1 -0
  349. package/apps/web/dist/assets/lolcode-C8EcpPZs.svg +1 -0
  350. package/apps/web/dist/assets/lottie-DdYYxJQL.svg +1 -0
  351. package/apps/web/dist/assets/{lspLanguageFeatures-CplKbdW4.js → lspLanguageFeatures-DI8_dTOp.js} +1 -1
  352. package/apps/web/dist/assets/lua-DGjzYnY0.svg +1 -0
  353. package/apps/web/dist/assets/luau-Bv7BN-Iy.svg +1 -0
  354. package/apps/web/dist/assets/lynx-BBmImVQc.svg +1 -0
  355. package/apps/web/dist/assets/lyric-Dphp5I7f.svg +1 -0
  356. package/apps/web/dist/assets/macaulay2-DC43Xv5F.svg +1 -0
  357. package/apps/web/dist/assets/main-D1Y-WDQ4.css +1 -0
  358. package/apps/web/dist/assets/main-LsqGdepC.js +158 -0
  359. package/apps/web/dist/assets/makefile-B4F0WZrz.svg +1 -0
  360. package/apps/web/dist/assets/markdoc-DhOGSiVa.svg +1 -0
  361. package/apps/web/dist/assets/markdoc-config-3pNUCrL7.svg +1 -0
  362. package/apps/web/dist/assets/markdown-CpukAbx0.svg +1 -0
  363. package/apps/web/dist/assets/markdownlint-Ch5JxnYU.svg +1 -0
  364. package/apps/web/dist/assets/markojs-C_I16WqH.svg +1 -0
  365. package/apps/web/dist/assets/material-file-icons-5.40.0/LICENSE.txt +8 -0
  366. package/apps/web/dist/assets/mathematica-CJxyc50p.svg +1 -0
  367. package/apps/web/dist/assets/matlab-DnkzKNhI.svg +1 -0
  368. package/apps/web/dist/assets/maven-Cp_nbRKZ.svg +1 -0
  369. package/apps/web/dist/assets/mdsvex-E4r19TyL.svg +1 -0
  370. package/apps/web/dist/assets/{mdx-DiInMCu3.js → mdx-BdPaDdpH.js} +1 -1
  371. package/apps/web/dist/assets/mdx-BtBWUBcH.svg +1 -0
  372. package/apps/web/dist/assets/mercurial-Bej1B86N.svg +1 -0
  373. package/apps/web/dist/assets/merlin-CuMEHxoj.svg +1 -0
  374. package/apps/web/dist/assets/mermaid-DLsddOB2.svg +1 -0
  375. package/apps/web/dist/assets/meson-DRhlgjJC.svg +1 -0
  376. package/apps/web/dist/assets/metro-BzJRuvE6.svg +1 -0
  377. package/apps/web/dist/assets/minecraft-B-o488a_.svg +1 -0
  378. package/apps/web/dist/assets/minecraft-fabric-rYp7PYPW.svg +1 -0
  379. package/apps/web/dist/assets/mint-BcmbYsz6.svg +1 -0
  380. package/apps/web/dist/assets/mist.clone-DL10PFcI.svg +1 -0
  381. package/apps/web/dist/assets/mjml-CtvXcvzm.svg +1 -0
  382. package/apps/web/dist/assets/mocha-VS0yU83W.svg +1 -0
  383. package/apps/web/dist/assets/modernizr-BQd9jxJP.svg +1 -0
  384. package/apps/web/dist/assets/mojo-BMCeLwSe.svg +1 -0
  385. package/apps/web/dist/assets/monaco-EglqICVw.js +68 -0
  386. package/apps/web/dist/assets/moon-WFHPC1JR.svg +1 -0
  387. package/apps/web/dist/assets/moonscript-DR4gdqiC.svg +1 -0
  388. package/apps/web/dist/assets/mrpack-DcBar9lx.svg +1 -0
  389. package/apps/web/dist/assets/mxml-7PX7Komx.svg +1 -0
  390. package/apps/web/dist/assets/nano-staged-BMsUW7Cb.svg +1 -0
  391. package/apps/web/dist/assets/nano-staged_light-BfGLfkH7.svg +1 -0
  392. package/apps/web/dist/assets/ndst-CdJFXo_n.svg +1 -0
  393. package/apps/web/dist/assets/nest-CPqvKoYS.svg +1 -0
  394. package/apps/web/dist/assets/nest-controller.clone-7nwmjdBF.svg +1 -0
  395. package/apps/web/dist/assets/nest-decorator.clone-CBMMACYR.svg +1 -0
  396. package/apps/web/dist/assets/nest-filter.clone-Cacnm0Wm.svg +1 -0
  397. package/apps/web/dist/assets/nest-gateway.clone-B18-aejb.svg +1 -0
  398. package/apps/web/dist/assets/nest-guard.clone-M_fiqCaC.svg +1 -0
  399. package/apps/web/dist/assets/nest-interceptor.clone-BflnCxWo.svg +1 -0
  400. package/apps/web/dist/assets/nest-middleware.clone-BUbGiX3x.svg +1 -0
  401. package/apps/web/dist/assets/nest-module.clone-Vsu9ICcI.svg +1 -0
  402. package/apps/web/dist/assets/nest-pipe.clone-C748ipHJ.svg +1 -0
  403. package/apps/web/dist/assets/nest-resolver.clone-BLuU-dIF.svg +1 -0
  404. package/apps/web/dist/assets/nest-service.clone-Dm68BmqF.svg +1 -0
  405. package/apps/web/dist/assets/netlify-_7KOAkD-.svg +1 -0
  406. package/apps/web/dist/assets/netlify_light-DPXJPD2K.svg +1 -0
  407. package/apps/web/dist/assets/next-CCXOG12z.svg +1 -0
  408. package/apps/web/dist/assets/next_light-COM1_zpx.svg +1 -0
  409. package/apps/web/dist/assets/nextflow-C9Ctlyg1.svg +1 -0
  410. package/apps/web/dist/assets/nginx-OUvapv2h.svg +1 -0
  411. package/apps/web/dist/assets/ngrx-actions-DD4Cp7cj.svg +1 -0
  412. package/apps/web/dist/assets/ngrx-effects-ewPTGjfj.svg +1 -0
  413. package/apps/web/dist/assets/ngrx-entity-Ck0gY2-5.svg +1 -0
  414. package/apps/web/dist/assets/ngrx-reducer-DG8TYnZA.svg +1 -0
  415. package/apps/web/dist/assets/ngrx-selectors-C7stCz81.svg +1 -0
  416. package/apps/web/dist/assets/ngrx-state-B-WK3oew.svg +1 -0
  417. package/apps/web/dist/assets/nim-DAERcoNn.svg +1 -0
  418. package/apps/web/dist/assets/nix-B4Y-u9vY.svg +1 -0
  419. package/apps/web/dist/assets/nodejs-Ftt-223_.svg +1 -0
  420. package/apps/web/dist/assets/nodejs_alt-BVdVtgyN.svg +1 -0
  421. package/apps/web/dist/assets/nodemon-h64ocqpb.svg +1 -0
  422. package/apps/web/dist/assets/npm-B9KN-Ntj.svg +1 -0
  423. package/apps/web/dist/assets/nuget-NH90BmqI.svg +1 -0
  424. package/apps/web/dist/assets/nunjucks-t2nAimXd.svg +1 -0
  425. package/apps/web/dist/assets/nuxt-CPbvhIgt.svg +1 -0
  426. package/apps/web/dist/assets/nx-EK_WNDNV.svg +1 -0
  427. package/apps/web/dist/assets/objective-c-D9CspH-N.svg +1 -0
  428. package/apps/web/dist/assets/objective-cpp-DUObGPHd.svg +1 -0
  429. package/apps/web/dist/assets/ocaml-nynLDQtu.svg +1 -0
  430. package/apps/web/dist/assets/odin-0ANKKdWy.svg +1 -0
  431. package/apps/web/dist/assets/onnx-LOzSMtGs.svg +1 -0
  432. package/apps/web/dist/assets/opa-BdkqTXNT.svg +1 -0
  433. package/apps/web/dist/assets/opam-JIDUixFe.svg +1 -0
  434. package/apps/web/dist/assets/openapi-Bmb3LvaR.svg +1 -0
  435. package/apps/web/dist/assets/openapi_light-M7Flwgb0.svg +1 -0
  436. package/apps/web/dist/assets/opencode-BHa_lWVF.svg +1 -0
  437. package/apps/web/dist/assets/opencode_light-1WfIvPPU.svg +1 -0
  438. package/apps/web/dist/assets/opentofu-Bg2cGXvq.svg +1 -0
  439. package/apps/web/dist/assets/opentofu_light-Dcgr5Lg_.svg +1 -0
  440. package/apps/web/dist/assets/otne-sbWZ5nOK.svg +1 -0
  441. package/apps/web/dist/assets/oxc-B93MLZjn.svg +1 -0
  442. package/apps/web/dist/assets/packship-BwshS3ck.svg +1 -0
  443. package/apps/web/dist/assets/palette-DSMdeYgY.svg +1 -0
  444. package/apps/web/dist/assets/panda-CIYZTHE4.svg +1 -0
  445. package/apps/web/dist/assets/parcel-C6vwjAsm.svg +1 -0
  446. package/apps/web/dist/assets/pascal-CvGWfjv2.svg +1 -0
  447. package/apps/web/dist/assets/pawn-BS1CqHEF.svg +1 -0
  448. package/apps/web/dist/assets/payload-DnHpsSkV.svg +1 -0
  449. package/apps/web/dist/assets/payload_light-ClSj5gY0.svg +1 -0
  450. package/apps/web/dist/assets/pdf-FSVsLfd_.svg +1 -0
  451. package/apps/web/dist/assets/pdm-BL2Z_Xyb.svg +1 -0
  452. package/apps/web/dist/assets/peg-CSjGGAfF.svg +1 -0
  453. package/apps/web/dist/assets/percy-CmTXqY9k.svg +1 -0
  454. package/apps/web/dist/assets/perl-BrETzhnK.svg +1 -0
  455. package/apps/web/dist/assets/php-Di6_0azE.svg +1 -0
  456. package/apps/web/dist/assets/php-cs-fixer-B91UIEkw.svg +1 -0
  457. package/apps/web/dist/assets/php_elephant-C7HPmtvE.svg +1 -0
  458. package/apps/web/dist/assets/php_elephant_pink-De2PfWh0.svg +1 -0
  459. package/apps/web/dist/assets/phpstan-B6XmboNy.svg +1 -0
  460. package/apps/web/dist/assets/phpunit-CQMlZ9qI.svg +1 -0
  461. package/apps/web/dist/assets/pinejs-Bkt6T9Ju.svg +1 -0
  462. package/apps/web/dist/assets/pipeline-CpSrXJTF.svg +1 -0
  463. package/apps/web/dist/assets/pkl-vAv-q5Xo.svg +1 -0
  464. package/apps/web/dist/assets/plastic-BPoXwN5v.svg +1 -0
  465. package/apps/web/dist/assets/playwright-CZDGDv97.svg +1 -0
  466. package/apps/web/dist/assets/plop-W11ZnJ0J.svg +1 -0
  467. package/apps/web/dist/assets/pm2-ecosystem-C3A6uMzh.svg +1 -0
  468. package/apps/web/dist/assets/pnpm-yTf4SVeA.svg +1 -0
  469. package/apps/web/dist/assets/pnpm_light-DpaB6grN.svg +1 -0
  470. package/apps/web/dist/assets/poetry-BzkVVJUz.svg +1 -0
  471. package/apps/web/dist/assets/postcss-nFnRZwev.svg +1 -0
  472. package/apps/web/dist/assets/posthtml-CseEoKin.svg +1 -0
  473. package/apps/web/dist/assets/powerpoint-B9_xf1B4.svg +1 -0
  474. package/apps/web/dist/assets/powershell-C6NGchuF.svg +1 -0
  475. package/apps/web/dist/assets/pre-commit-BSTONpj6.svg +1 -0
  476. package/apps/web/dist/assets/prettier-CblUXfdG.svg +1 -0
  477. package/apps/web/dist/assets/prisma-CqGoYTXg.svg +1 -0
  478. package/apps/web/dist/assets/processing-BxhqhkO7.svg +1 -0
  479. package/apps/web/dist/assets/prolog-ERHATOz6.svg +1 -0
  480. package/apps/web/dist/assets/prompt-CRtaY-vl.svg +1 -0
  481. package/apps/web/dist/assets/proto-BKheaoud.svg +1 -0
  482. package/apps/web/dist/assets/protractor-Biy3qAIN.svg +1 -0
  483. package/apps/web/dist/assets/pug-BIbhOJge.svg +1 -0
  484. package/apps/web/dist/assets/puppet-zaZRHErA.svg +1 -0
  485. package/apps/web/dist/assets/puppeteer-DEba_DZG.svg +1 -0
  486. package/apps/web/dist/assets/purescript-Cuz-x90n.svg +1 -0
  487. package/apps/web/dist/assets/python-B51K8IGV.svg +1 -0
  488. package/apps/web/dist/assets/{python-O93J5sRJ.js → python-BrXsyyj_.js} +1 -1
  489. package/apps/web/dist/assets/python-misc-BbpyPaM-.svg +1 -0
  490. package/apps/web/dist/assets/pytorch-Cn8bH_sd.svg +1 -0
  491. package/apps/web/dist/assets/qsharp-C_kSW5Ab.svg +1 -0
  492. package/apps/web/dist/assets/quarto-rQmTlqz3.svg +1 -0
  493. package/apps/web/dist/assets/quasar-LM89YPuZ.svg +1 -0
  494. package/apps/web/dist/assets/quokka-Xv0MtYYB.svg +1 -0
  495. package/apps/web/dist/assets/qwik-KZjX0BVb.svg +1 -0
  496. package/apps/web/dist/assets/r-DgBVcMP_.svg +1 -0
  497. package/apps/web/dist/assets/racket-CMbJyNha.svg +1 -0
  498. package/apps/web/dist/assets/raml-C-qEzwsG.svg +1 -0
  499. package/apps/web/dist/assets/razor-CUVD-QLE.svg +1 -0
  500. package/apps/web/dist/assets/{razor-DpA8sAYd.js → razor-xmumdcGT.js} +1 -1
  501. package/apps/web/dist/assets/rbxmk-BsXG_IOL.svg +1 -0
  502. package/apps/web/dist/assets/rc-z_4QSbxF.svg +1 -0
  503. package/apps/web/dist/assets/react-DVwDfBp3.svg +1 -0
  504. package/apps/web/dist/assets/react_ts-_1j79TVC.svg +1 -0
  505. package/apps/web/dist/assets/readme-CRQaYHSO.svg +1 -0
  506. package/apps/web/dist/assets/reason-korllTtu.svg +1 -0
  507. package/apps/web/dist/assets/red-DTtxFQDO.svg +1 -0
  508. package/apps/web/dist/assets/redux-action-Cke8cYw-.svg +1 -0
  509. package/apps/web/dist/assets/redux-reducer-FoNH6lOj.svg +1 -0
  510. package/apps/web/dist/assets/redux-selector-B5jgC3IP.svg +1 -0
  511. package/apps/web/dist/assets/redux-store-DzLqp-yq.svg +1 -0
  512. package/apps/web/dist/assets/regedit-DLAjE0ih.svg +1 -0
  513. package/apps/web/dist/assets/remark-CWTU59CW.svg +1 -0
  514. package/apps/web/dist/assets/remix-DI6vrrHY.svg +1 -0
  515. package/apps/web/dist/assets/remix_light-COv4KSh3.svg +1 -0
  516. package/apps/web/dist/assets/renovate-COrNPmCW.svg +1 -0
  517. package/apps/web/dist/assets/replit-DXy3-whC.svg +1 -0
  518. package/apps/web/dist/assets/rescript-CqBh5fPE.svg +1 -0
  519. package/apps/web/dist/assets/rescript-interface-Dslk_4sh.svg +1 -0
  520. package/apps/web/dist/assets/restql-BN8DNxn7.svg +1 -0
  521. package/apps/web/dist/assets/riot-9zacm7BW.svg +1 -0
  522. package/apps/web/dist/assets/roadmap-C5LFZKe0.svg +1 -0
  523. package/apps/web/dist/assets/roblox-BF0l82yD.svg +1 -0
  524. package/apps/web/dist/assets/robot-DnWiYtgc.svg +1 -0
  525. package/apps/web/dist/assets/robots-a3009G78.svg +1 -0
  526. package/apps/web/dist/assets/rocket-CzehGL9J.svg +1 -0
  527. package/apps/web/dist/assets/rojo-K5BAThMH.svg +1 -0
  528. package/apps/web/dist/assets/rolldown-CCHKjFzw.svg +1 -0
  529. package/apps/web/dist/assets/rollup-1MedXjdi.svg +1 -0
  530. package/apps/web/dist/assets/rome-BSbWRa52.svg +1 -0
  531. package/apps/web/dist/assets/routing-IVwG3_tz.svg +1 -0
  532. package/apps/web/dist/assets/rspec-Rqv36fnX.svg +1 -0
  533. package/apps/web/dist/assets/rstack-IiLpkzX3.svg +1 -0
  534. package/apps/web/dist/assets/rubocop-W3fJz17I.svg +1 -0
  535. package/apps/web/dist/assets/rubocop_light-BdWvyfnM.svg +1 -0
  536. package/apps/web/dist/assets/ruby-BHFOa6L9.svg +1 -0
  537. package/apps/web/dist/assets/ruff-kgacv5ZG.svg +1 -0
  538. package/apps/web/dist/assets/rust-DMNQdMcG.svg +1 -0
  539. package/apps/web/dist/assets/salesforce-4bgftkqW.svg +1 -0
  540. package/apps/web/dist/assets/salt-Cft8i9zp.svg +1 -0
  541. package/apps/web/dist/assets/san-BMnlrhAs.svg +1 -0
  542. package/apps/web/dist/assets/sas-DPJZAFgR.svg +1 -0
  543. package/apps/web/dist/assets/sass-9oWjJ7Kf.svg +1 -0
  544. package/apps/web/dist/assets/sbt-DbLKkm1J.svg +1 -0
  545. package/apps/web/dist/assets/scala-aE0d5Kis.svg +1 -0
  546. package/apps/web/dist/assets/scheme-DkihYuFg.svg +1 -0
  547. package/apps/web/dist/assets/scons-DJV5WTmD.svg +1 -0
  548. package/apps/web/dist/assets/scons_light-B2fnP4_Y.svg +1 -0
  549. package/apps/web/dist/assets/screwdriver-CkvzdfmG.svg +1 -0
  550. package/apps/web/dist/assets/search-CbC3iLj3.svg +1 -0
  551. package/apps/web/dist/assets/semantic-release-Dogu_C5z.svg +1 -0
  552. package/apps/web/dist/assets/semantic-release_light-DIhnbFjn.svg +1 -0
  553. package/apps/web/dist/assets/semgrep-CPQALOgS.svg +1 -0
  554. package/apps/web/dist/assets/sentry-D58FJxx5.svg +1 -0
  555. package/apps/web/dist/assets/sequelize-C6Ymalea.svg +1 -0
  556. package/apps/web/dist/assets/serverless-QZsOIF8r.svg +1 -0
  557. package/apps/web/dist/assets/settings-DyEElZBl.svg +1 -0
  558. package/apps/web/dist/assets/shader-Bjv2Zv8K.svg +1 -0
  559. package/apps/web/dist/assets/shellcheck-DTR1RnoY.svg +1 -0
  560. package/apps/web/dist/assets/shellcheck_light-_r9G9oAI.svg +1 -0
  561. package/apps/web/dist/assets/silverstripe-DKiZV7X8.svg +1 -0
  562. package/apps/web/dist/assets/simulink-BTi39qTY.svg +1 -0
  563. package/apps/web/dist/assets/siyuan-C2kqb6ZD.svg +1 -0
  564. package/apps/web/dist/assets/sketch-C6MPNaDh.svg +1 -0
  565. package/apps/web/dist/assets/skill-CsTNG9dd.svg +1 -0
  566. package/apps/web/dist/assets/slim-ssC5V7EC.svg +1 -0
  567. package/apps/web/dist/assets/slint-DtJLD6Qi.svg +1 -0
  568. package/apps/web/dist/assets/slug-Br_1B1yc.svg +1 -0
  569. package/apps/web/dist/assets/smarty-D2LJyf79.svg +1 -0
  570. package/apps/web/dist/assets/sml-Bzffk1I4.svg +1 -0
  571. package/apps/web/dist/assets/snakemake-DCI9pat0.svg +1 -0
  572. package/apps/web/dist/assets/snapcraft-DclrZPKf.svg +1 -0
  573. package/apps/web/dist/assets/snowpack-B1HubwQS.svg +1 -0
  574. package/apps/web/dist/assets/snowpack_light-B9Juodm3.svg +1 -0
  575. package/apps/web/dist/assets/snyk-CeYeWfpE.svg +1 -0
  576. package/apps/web/dist/assets/solidity-L_2RId-b.svg +1 -0
  577. package/apps/web/dist/assets/sonarcloud-DqPW4NMu.svg +1 -0
  578. package/apps/web/dist/assets/spwn-DM6k0jd3.svg +1 -0
  579. package/apps/web/dist/assets/stackblitz-DwxhpZZc.svg +1 -0
  580. package/apps/web/dist/assets/stan-DiuxlWb_.svg +1 -0
  581. package/apps/web/dist/assets/steadybit-Zo5mnlIQ.svg +1 -0
  582. package/apps/web/dist/assets/stencil-BOIrAb_N.svg +1 -0
  583. package/apps/web/dist/assets/stitches-DuwUNwW8.svg +1 -0
  584. package/apps/web/dist/assets/stitches_light-DhBTATZE.svg +1 -0
  585. package/apps/web/dist/assets/storybook-8hLJJ690.svg +1 -0
  586. package/apps/web/dist/assets/stryker-bt6-O_CV.svg +1 -0
  587. package/apps/web/dist/assets/sty.clone-Cujqq-bP.svg +1 -0
  588. package/apps/web/dist/assets/stylable-ClIXN3nh.svg +1 -0
  589. package/apps/web/dist/assets/stylelint-BrpBoVMQ.svg +1 -0
  590. package/apps/web/dist/assets/stylelint_light-DaHsuq7L.svg +1 -0
  591. package/apps/web/dist/assets/stylus-CN5LY1pd.svg +1 -0
  592. package/apps/web/dist/assets/sublime-CZapD7oK.svg +1 -0
  593. package/apps/web/dist/assets/subtitles-DXAS4J7N.svg +1 -0
  594. package/apps/web/dist/assets/supabase-Di69_Gxl.svg +1 -0
  595. package/apps/web/dist/assets/svelte-BzdjuKpL.svg +1 -0
  596. package/apps/web/dist/assets/svelte_js.clone-BEEZUpfk.svg +1 -0
  597. package/apps/web/dist/assets/svelte_ts.clone-Bz-pUeer.svg +1 -0
  598. package/apps/web/dist/assets/svg-BGAtL3nZ.svg +1 -0
  599. package/apps/web/dist/assets/svgo-DPr1Dvia.svg +1 -0
  600. package/apps/web/dist/assets/svgr-Cmwlz1vj.svg +1 -0
  601. package/apps/web/dist/assets/swagger-WMZaykFY.svg +1 -0
  602. package/apps/web/dist/assets/sway-CVDhegDt.svg +1 -0
  603. package/apps/web/dist/assets/swc-B2z4JPFI.svg +1 -0
  604. package/apps/web/dist/assets/swift-C0ltu3i6.svg +1 -0
  605. package/apps/web/dist/assets/syncpack-ZPDNt6i7.svg +1 -0
  606. package/apps/web/dist/assets/systemd-BXI9UdZI.svg +1 -0
  607. package/apps/web/dist/assets/systemd_light-BFjsWtQs.svg +1 -0
  608. package/apps/web/dist/assets/table-D7AWR19h.svg +1 -0
  609. package/apps/web/dist/assets/tailwindcss-E29z3cu4.svg +1 -0
  610. package/apps/web/dist/assets/tape.clone-D_2sWxeq.svg +1 -0
  611. package/apps/web/dist/assets/taskfile-dSD9YrzU.svg +1 -0
  612. package/apps/web/dist/assets/tauri-Dq0-hcjj.svg +1 -0
  613. package/apps/web/dist/assets/taze-Cta2ozO5.svg +1 -0
  614. package/apps/web/dist/assets/tcl-zFapWKQk.svg +1 -0
  615. package/apps/web/dist/assets/teal-BSRSg4xl.svg +1 -0
  616. package/apps/web/dist/assets/templ-BrX7gPqB.svg +1 -0
  617. package/apps/web/dist/assets/template-DZ-sDdmY.svg +1 -0
  618. package/apps/web/dist/assets/terraform-BlPcYaG6.svg +1 -0
  619. package/apps/web/dist/assets/test-js-OwrXCHKi.svg +1 -0
  620. package/apps/web/dist/assets/test-jsx-B8K3rlw-.svg +1 -0
  621. package/apps/web/dist/assets/test-ts-Uf59rGo6.svg +1 -0
  622. package/apps/web/dist/assets/tex-Hzjkwjtg.svg +1 -0
  623. package/apps/web/dist/assets/textlint-DfUvfvO4.svg +1 -0
  624. package/apps/web/dist/assets/tilt-LjNxWg-6.svg +1 -0
  625. package/apps/web/dist/assets/tldraw-3Kby2Vlr.svg +1 -0
  626. package/apps/web/dist/assets/tldraw_light-TCjCffr-.svg +1 -0
  627. package/apps/web/dist/assets/tobi-DVIcB8M9.svg +1 -0
  628. package/apps/web/dist/assets/tobimake-kl8Hqi8N.svg +1 -0
  629. package/apps/web/dist/assets/toc-DYpUhZld.svg +1 -0
  630. package/apps/web/dist/assets/todo-gzOFSJ-g.svg +1 -0
  631. package/apps/web/dist/assets/toml-ZLHWK_sx.svg +1 -0
  632. package/apps/web/dist/assets/toml_light-OBSBqMGq.svg +1 -0
  633. package/apps/web/dist/assets/toon-CQzjjnPj.svg +1 -0
  634. package/apps/web/dist/assets/travis-CAxkeomb.svg +1 -0
  635. package/apps/web/dist/assets/tree-CIalc_dQ.svg +1 -0
  636. package/apps/web/dist/assets/trigger-B4wseTIv.svg +1 -0
  637. package/apps/web/dist/assets/{tsMode-qBmFN2NS.js → tsMode-CkDNjbjK.js} +1 -1
  638. package/apps/web/dist/assets/tsconfig-Bjf4jQfg.svg +1 -0
  639. package/apps/web/dist/assets/tsdoc-BpNgHDO4.svg +1 -0
  640. package/apps/web/dist/assets/tsdown-BkZbYvkN.svg +1 -0
  641. package/apps/web/dist/assets/tsil-Bkt1hdJ_.svg +1 -0
  642. package/apps/web/dist/assets/tune-9adzML3q.svg +1 -0
  643. package/apps/web/dist/assets/turborepo-DNORwR5D.svg +1 -0
  644. package/apps/web/dist/assets/turborepo_light-D3ZWPpDE.svg +1 -0
  645. package/apps/web/dist/assets/twig-CqyC89_c.svg +1 -0
  646. package/apps/web/dist/assets/twine-zZzwaKaF.svg +1 -0
  647. package/apps/web/dist/assets/typedoc-Db5-Fjwt.svg +1 -0
  648. package/apps/web/dist/assets/{typescript-BjR2yH8S.js → typescript-BYDg93Ut.js} +1 -1
  649. package/apps/web/dist/assets/typescript-D_U-p-G1.svg +1 -0
  650. package/apps/web/dist/assets/typescript-def-DriBH7_f.svg +1 -0
  651. package/apps/web/dist/assets/typst-CoAhtl4c.svg +1 -0
  652. package/apps/web/dist/assets/uiua-B7OLi-gm.svg +1 -0
  653. package/apps/web/dist/assets/umi-CYgldeZU.svg +1 -0
  654. package/apps/web/dist/assets/uml-W9x7FuXD.svg +1 -0
  655. package/apps/web/dist/assets/uml_light-pZRShlLJ.svg +1 -0
  656. package/apps/web/dist/assets/unity-BNzPrpqd.svg +1 -0
  657. package/apps/web/dist/assets/unlicense-Cju0tTjp.svg +1 -0
  658. package/apps/web/dist/assets/unocss-DVQ-RdpC.svg +1 -0
  659. package/apps/web/dist/assets/url-DaITLCEd.svg +1 -0
  660. package/apps/web/dist/assets/uv-F8wIEKlh.svg +1 -0
  661. package/apps/web/dist/assets/vagrant-BP3EYUgn.svg +1 -0
  662. package/apps/web/dist/assets/vala-D9t6dJt6.svg +1 -0
  663. package/apps/web/dist/assets/vanilla-extract-75PewYHq.svg +1 -0
  664. package/apps/web/dist/assets/varnish-C4kR7D6O.svg +1 -0
  665. package/apps/web/dist/assets/vedic-CQZw4l0x.svg +1 -0
  666. package/apps/web/dist/assets/velite-Be8mHui6.svg +1 -0
  667. package/apps/web/dist/assets/velocity-C1gK7bMI.svg +1 -0
  668. package/apps/web/dist/assets/vercel-7qFLBAX3.svg +1 -0
  669. package/apps/web/dist/assets/vercel_light-N8AQQPHB.svg +1 -0
  670. package/apps/web/dist/assets/verdaccio-CCNTjZIL.svg +1 -0
  671. package/apps/web/dist/assets/verified-SvGAS5or.svg +1 -0
  672. package/apps/web/dist/assets/verilog-CkzCTd_s.svg +1 -0
  673. package/apps/web/dist/assets/verse-K-ZkvxZV.svg +1 -0
  674. package/apps/web/dist/assets/verse_light-CLscIU_r.svg +1 -0
  675. package/apps/web/dist/assets/vfl-D9qLlJt-.svg +1 -0
  676. package/apps/web/dist/assets/video-B_X_LvvN.svg +1 -0
  677. package/apps/web/dist/assets/vim-Dls2bNAn.svg +1 -0
  678. package/apps/web/dist/assets/virtual-D1EhHTfe.svg +1 -0
  679. package/apps/web/dist/assets/visualstudio-2wBP4zqg.svg +1 -0
  680. package/apps/web/dist/assets/vite-DRU0wIJ-.svg +1 -0
  681. package/apps/web/dist/assets/vitest-BArfhq13.svg +1 -0
  682. package/apps/web/dist/assets/vlang-o3PzMBkk.svg +1 -0
  683. package/apps/web/dist/assets/vscode-BvZO6gHV.svg +1 -0
  684. package/apps/web/dist/assets/vue-DJBoCu9j.svg +1 -0
  685. package/apps/web/dist/assets/vue-config-DnesLCi2.svg +1 -0
  686. package/apps/web/dist/assets/vuex-store-CC7Qmm5u.svg +1 -0
  687. package/apps/web/dist/assets/wakatime-Dye6fNMc.svg +1 -0
  688. package/apps/web/dist/assets/wakatime_light-CYZx-6N2.svg +1 -0
  689. package/apps/web/dist/assets/wallaby-CCUOfHFd.svg +1 -0
  690. package/apps/web/dist/assets/wally-CqJM8T3g.svg +1 -0
  691. package/apps/web/dist/assets/warp-CgIW2eQH.svg +1 -0
  692. package/apps/web/dist/assets/warp_light-CjTppUCb.svg +1 -0
  693. package/apps/web/dist/assets/watchman-H_cM_bwG.svg +1 -0
  694. package/apps/web/dist/assets/webassembly-BMgXNvua.svg +1 -0
  695. package/apps/web/dist/assets/webhint-DxoGuy63.svg +1 -0
  696. package/apps/web/dist/assets/webpack-BMke-Ny3.svg +1 -0
  697. package/apps/web/dist/assets/wepy-BgP-Furc.svg +1 -0
  698. package/apps/web/dist/assets/werf-D13MHWtz.svg +1 -0
  699. package/apps/web/dist/assets/windicss-DYoZFE3g.svg +1 -0
  700. package/apps/web/dist/assets/wolframlanguage-C5GdlbiJ.svg +1 -0
  701. package/apps/web/dist/assets/word-CFvm8uAr.svg +1 -0
  702. package/apps/web/dist/assets/{workers-x9_8y1ur.js → workers-CMKTm3o5.js} +1 -1
  703. package/apps/web/dist/assets/wrangler-D_cfQmo-.svg +1 -0
  704. package/apps/web/dist/assets/wxt-Bsz7D6e7.svg +1 -0
  705. package/apps/web/dist/assets/xaml-Wh7EHkVc.svg +1 -0
  706. package/apps/web/dist/assets/xmake-Cq_S7JW7.svg +1 -0
  707. package/apps/web/dist/assets/xml-C-Q_MfUP.svg +1 -0
  708. package/apps/web/dist/assets/{xml-CL70_TAY.js → xml-DLqAxpyK.js} +1 -1
  709. package/apps/web/dist/assets/yaml-BZ3ilcHv.svg +1 -0
  710. package/apps/web/dist/assets/{yaml-qno5z39m.js → yaml-Y5128Ncw.js} +1 -1
  711. package/apps/web/dist/assets/yang-BnZZVyDi.svg +1 -0
  712. package/apps/web/dist/assets/yarn--gleSda9.svg +1 -0
  713. package/apps/web/dist/assets/zeabur-DDm7jWc3.svg +1 -0
  714. package/apps/web/dist/assets/zeabur_light-E7ma-0y_.svg +1 -0
  715. package/apps/web/dist/assets/zig-CwGkQIG3.svg +1 -0
  716. package/apps/web/dist/assets/zip-Dw2p3C1u.svg +1 -0
  717. package/apps/web/dist/assets/zizmor-CVHX2g5g.svg +1 -0
  718. package/apps/web/dist/index.html +11 -2
  719. package/docs/guides/install.md +2 -0
  720. package/package.json +1 -1
  721. package/apps/web/dist/assets/FileEditor-twkRcPR8.js +0 -1
  722. package/apps/web/dist/assets/FileViewer-B6J1gfWW.js +0 -1
  723. package/apps/web/dist/assets/index-BvfzAW2A.js +0 -158
  724. package/apps/web/dist/assets/index-DxcI8GSl.css +0 -1
  725. package/apps/web/dist/assets/monaco-D_A7VB90.js +0 -68
@@ -1,158 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FileViewer-B6J1gfWW.js","assets/monaco-D_A7VB90.js","assets/editor.api-TQGsXQVT.js","assets/editor-B8GMDV7_.css","assets/monaco-n7clI0si.css","assets/FileEditor-twkRcPR8.js"])))=>i.map(i=>d[i]);
2
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();try{let e=localStorage.getItem(`larness.theme`);(e===`dark`||e===`system`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches)&&(document.documentElement.dataset.theme=`dark`)}catch{}function u(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=u(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function d(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=u(e))&&(r&&(r+=` `),r+=t);return r}var f=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},p=(e,t)=>({classGroupId:e,validator:t}),m=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),h=`-`,g=[],_=`arbitrary..`,v=e=>{let t=x(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return b(e);let n=e.split(h);return y(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?f(i,t):t:i||g}return n[e]||g}}},y=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=y(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(h):e.slice(t).join(h),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},b=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?_+r:void 0})(),x=e=>{let{theme:t,classGroups:n}=e;return S(n,t)},S=(e,t)=>{let n=m();for(let r in e){let i=e[r];C(i,n,r,t)}return n},C=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];w(i,t,n,r)}},w=(e,t,n,r)=>{typeof e==`string`?T(e,t,n):typeof e==`function`?E(e,t,n,r):D(e,t,n,r)},T=(e,t,n)=>{let r=e===``?t:O(t,e);r.classGroupId=n},E=(e,t,n,r)=>{k(e)?C(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(p(n,e)))},D=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];C(o,O(t,a),n,r)}},O=(e,t)=>{let n=e,r=t.split(h),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=m(),n.nextPart.set(t,i)),n=i}return n},k=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,A=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},j=`!`,M=`:`,N=[],ee=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),te=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===M){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(j)?(c=s.slice(0,-1),l=!0):s.startsWith(j)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ee(t,l,c,u)};if(t){let e=t+M,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ee(N,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},P=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ne=e=>({cache:A(e.cacheSize),parseClassName:te(e),sortModifiers:P(e),postfixLookupClassGroupIds:F(e),...v(e)}),F=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},re=/\s+/,ie=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(re),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+j:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},ae=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=oe(n))&&(i&&(i+=` `),i+=r);return i},oe=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=oe(e[r]))&&(n&&(n+=` `),n+=t);return n},se=(e,...t)=>{let n,r,i,a,o=o=>(n=ne(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ie(e,n);return i(e,a),a};return a=o,(...e)=>a(ae(...e))},ce=[],le=e=>{let t=t=>t[e]||ce;return t.isThemeGetter=!0,t.themeKey=e,t},ue=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,de=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,me=/\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$/,he=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,ge=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ve=e=>fe.test(e),I=e=>!!e&&!Number.isNaN(Number(e)),ye=e=>!!e&&Number.isInteger(Number(e)),be=e=>e.endsWith(`%`)&&I(e.slice(0,-1)),xe=e=>pe.test(e),Se=()=>!0,Ce=e=>me.test(e)&&!he.test(e),we=()=>!1,Te=e=>ge.test(e),Ee=e=>_e.test(e),De=e=>!L(e)&&!R(e),Oe=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),ke=e=>We(e,Je,we),L=e=>ue.test(e),Ae=e=>We(e,Ye,Ce),je=e=>We(e,Xe,I),Me=e=>We(e,Qe,Se),Ne=e=>We(e,Ze,we),Pe=e=>We(e,Ke,we),Fe=e=>We(e,qe,Ee),Ie=e=>We(e,$e,Te),R=e=>de.test(e),Le=e=>Ge(e,Ye),Re=e=>Ge(e,Ze),ze=e=>Ge(e,Ke),Be=e=>Ge(e,Je),Ve=e=>Ge(e,qe),He=e=>Ge(e,$e,!0),Ue=e=>Ge(e,Qe,!0),We=(e,t,n)=>{let r=ue.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ge=(e,t,n=!1)=>{let r=de.exec(e);return r?r[1]?t(r[1]):n:!1},Ke=e=>e===`position`||e===`percentage`,qe=e=>e===`image`||e===`url`,Je=e=>e===`length`||e===`size`||e===`bg-size`,Ye=e=>e===`length`,Xe=e=>e===`number`,Ze=e=>e===`family-name`,Qe=e=>e===`number`||e===`weight`,$e=e=>e===`shadow`,et=se(()=>{let e=le(`color`),t=le(`font`),n=le(`text`),r=le(`font-weight`),i=le(`tracking`),a=le(`leading`),o=le(`breakpoint`),s=le(`container`),c=le(`spacing`),l=le(`radius`),u=le(`shadow`),d=le(`inset-shadow`),f=le(`text-shadow`),p=le(`drop-shadow`),m=le(`blur`),h=le(`perspective`),g=le(`aspect`),_=le(`ease`),v=le(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),R,L],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[R,L,c],T=()=>[ve,`full`,`auto`,...w()],E=()=>[ye,`none`,`subgrid`,R,L],D=()=>[`auto`,{span:[`full`,ye,R,L]},ye,R,L],O=()=>[ye,`auto`,R,L],k=()=>[`auto`,`min`,`max`,`fr`,R,L],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ve,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[s,ve,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[ve,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,R,L],ne=()=>[...b(),ze,Pe,{position:[R,L]}],F=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],re=()=>[`auto`,`cover`,`contain`,Be,ke,{size:[R,L]}],ie=()=>[be,Le,Ae],ae=()=>[``,`none`,`full`,l,R,L],oe=()=>[``,I,Le,Ae],se=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ue=()=>[I,be,ze,Pe],de=()=>[``,`none`,m,R,L],fe=()=>[`none`,I,R,L],pe=()=>[`none`,I,R,L],me=()=>[I,R,L],he=()=>[ve,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[xe],breakpoint:[xe],color:[Se],container:[xe],"drop-shadow":[xe],ease:[`in`,`out`,`in-out`],font:[De],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[xe],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[xe],shadow:[xe],spacing:[`px`,I],text:[xe],"text-shadow":[xe],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ve,L,R,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,R,L]}],"container-named":[Oe],columns:[{columns:[I,`auto`,L,R,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ye,`auto`,R,L]}],basis:[{basis:[ve,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[I,ve,`auto`,`initial`,`none`,L]}],grow:[{grow:[``,I,R,L]}],shrink:[{shrink:[``,I,R,L]}],order:[{order:[ye,`first`,`last`,`none`,R,L]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Le,Ae]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ue,Me]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,be,L]}],"font-family":[{font:[Re,Ne,t]}],"font-features":[{"font-features":[L]}],"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:[i,R,L]}],"line-clamp":[{"line-clamp":[I,`none`,R,je]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,R,L]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,R,L]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...se(),`wavy`]}],"text-decoration-thickness":[{decoration:[I,`from-font`,`auto`,R,Ae]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[I,`auto`,R,L]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ye,R,L]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,R,L]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,R,L]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:re()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ye,R,L],radial:[``,R,L],conic:[``,ye,R,L]},Ve,Fe]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...se(),`hidden`,`none`]}],"divide-style":[{divide:[...se(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...se(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[I,R,L]}],"outline-w":[{outline:[``,I,Le,Ae]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`inner`,`none`,u,He,Ie]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,He,Ie]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[I,Ae]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,He,Ie]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[I,R,L]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[I]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[R,L]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[I]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,R,L]}],filter:[{filter:[``,`none`,R,L]}],blur:[{blur:de()}],brightness:[{brightness:[I,R,L]}],contrast:[{contrast:[I,R,L]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,He,Ie]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,I,R,L]}],"hue-rotate":[{"hue-rotate":[I,R,L]}],invert:[{invert:[``,I,R,L]}],saturate:[{saturate:[I,R,L]}],sepia:[{sepia:[``,I,R,L]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,R,L]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[I,R,L]}],"backdrop-contrast":[{"backdrop-contrast":[I,R,L]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,I,R,L]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[I,R,L]}],"backdrop-invert":[{"backdrop-invert":[``,I,R,L]}],"backdrop-opacity":[{"backdrop-opacity":[I,R,L]}],"backdrop-saturate":[{"backdrop-saturate":[I,R,L]}],"backdrop-sepia":[{"backdrop-sepia":[``,I,R,L]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,R,L]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[I,`initial`,R,L]}],ease:[{ease:[`linear`,`initial`,_,R,L]}],delay:[{delay:[I,R,L]}],animate:[{animate:[`none`,v,R,L]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,R,L]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":[`scale-3d`],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[R,L,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":[`translate-none`],zoom:[{zoom:[ye,R,L]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,R,L]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,R,L]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[I,Le,Ae,je]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function z(...e){return et(d(e))}var tt=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),nt=o(((e,t)=>{t.exports=tt()})),B=nt(),rt={primary:`bg-accent text-white shadow-[0_1px_2px_rgba(0,0,0,.12)] hover:brightness-110 active:brightness-95`,secondary:`border border-line bg-surface text-ink shadow-[0_1px_1px_rgba(0,0,0,.03)] hover:bg-surface-2`,ghost:`text-ink-2 hover:bg-black/[.045] hover:text-ink dark:hover:bg-white/[.06]`,soft:`bg-accent-soft text-accent hover:bg-accent/20`,danger:`bg-danger text-white shadow-[0_1px_2px_rgba(0,0,0,.12)] hover:brightness-110`},it={sm:`h-7 gap-1.5 rounded-lg px-2.5 text-[12px]`,md:`h-8 gap-2 rounded-[9px] px-3 text-[12.5px]`};function V({variant:e=`secondary`,size:t=`md`,leading:n,className:r,children:i,type:a=`button`,...o}){return(0,B.jsxs)(`button`,{type:a,className:z(`inline-flex select-none items-center justify-center whitespace-nowrap font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 focus-visible:ring-offset-1 focus-visible:ring-offset-canvas`,`disabled:pointer-events-none disabled:opacity-45`,rt[e],it[t],r),...o,children:[n,i]})}var at=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ee(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ee(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),ee(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=ee(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=ee(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ee(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function te(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ne=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function F(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function re(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else F(re.bind(null,e))}var ie={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ie,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=re,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=F,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),ot=o(((e,t)=>{t.exports=at()})),H=l(ot(),1),st=Object.defineProperty,ct=(e,t)=>st(e,`name`,{value:t,configurable:!0}),lt=!!(typeof window<`u`&&window.document&&window.document.createElement);function ut(e,t,{checkForDefaultPrevented:n=!0}={}){return ct(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}ct(ut,`composeEventHandlers`);function dt(e){if(!lt)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}ct(dt,`getOwnerWindow`);function ft(e){if(!lt)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}ct(ft,`getOwnerDocument`);function pt(e,t=!1){let{activeElement:n}=ft(e);if(!n?.nodeName)return null;if(mt(n)&&n.contentDocument)return pt(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ft(n).getElementById(e);if(t)return t}}return n}ct(pt,`getActiveElement`);function mt(e){return e.tagName===`IFRAME`}ct(mt,`isFrame`);var ht=Object.defineProperty,gt=(e,t)=>ht(e,`name`,{value:t,configurable:!0});function _t(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}gt(_t,`setRef`);function vt(...e){return t=>{let n=!1,r=e.map(e=>{let r=_t(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():_t(e[t],null)}}}}gt(vt,`composeRefs`);function yt(...e){return H.useCallback(vt(...e),e)}gt(yt,`useComposedRefs`);var bt=Object.defineProperty,xt=(e,t)=>bt(e,`name`,{value:t,configurable:!0});function St(e,t){let n=H.createContext(t);n.displayName=e+`Context`;let r=xt(e=>{let{children:t,...r}=e,i=H.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=H.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return xt(i,`useContext`),[r,i]}xt(St,`createContext`);function Ct(e,t=[]){let n=[];function r(t,r){let i=H.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=xt(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=H.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=H.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return xt(s,`useContext`),[o,s]}xt(r,`createContext`);let i=xt(()=>{let t=n.map(e=>H.createContext(e));return xt(function(n){let r=n?.[e]||t;return H.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,wt(i,...t)]}xt(Ct,`createContextScope`);function wt(...e){let t=e[0];if(e.length===1)return t;let n=xt(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return xt(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return H.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}xt(wt,`composeContextScopes`);var Tt=globalThis?.document?H.useLayoutEffect:()=>{},Et=Object.defineProperty,Dt=(e,t)=>Et(e,`name`,{value:t,configurable:!0}),Ot=H.useId||(()=>void 0),kt=0;function At(e){let[t,n]=H.useState(Ot());return Tt(()=>{e||n(e=>e??String(kt++))},[e]),e||(t?`radix-${t}`:``)}Dt(At,`useId`);var jt=Object.defineProperty,Mt=(e,t)=>jt(e,`name`,{value:t,configurable:!0}),Nt=H.useEffectEvent,Pt=H.useInsertionEffect;function Ft(e){if(typeof Nt==`function`)return Nt(e);let t=H.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Pt==`function`?Pt(()=>{t.current=e}):Tt(()=>{t.current=e}),H.useMemo(()=>((...e)=>t.current?.(...e)),[])}Mt(Ft,`useEffectEvent`);var It=Object.defineProperty,Lt=(e,t)=>It(e,`name`,{value:t,configurable:!0}),Rt=H.useInsertionEffect||Tt;function zt({prop:e,defaultProp:t,onChange:n=Lt(()=>{},`onChange`),caller:r}){let[i,a,o]=Bt({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,H.useCallback(t=>{if(s){let n=Vt(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Lt(zt,`useControllableState`);function Bt({defaultProp:e,onChange:t}){let[n,r]=H.useState(e),i=H.useRef(n),a=H.useRef(t);return Rt(()=>{a.current=t},[t]),H.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Lt(Bt,`useUncontrolledState`);function Vt(e){return typeof e==`function`}Lt(Vt,`isFunction`);var Ht=Symbol(`RADIX:SYNC_STATE`);function Ut(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ft(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=H.useReducer((t,n)=>{if(n.type===Ht)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=H.useRef(p);H.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=H.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return H.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Ht,state:i})},[i,d.state,c]),[h,f]}Lt(Ut,`useControllableStateReducer`);var Wt=o((e=>{var t=ot();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),Gt=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Wt()})),Kt=l(Gt(),1),qt=Object.defineProperty,Jt=(e,t)=>qt(e,`name`,{value:t,configurable:!0});function Yt(e){let t=H.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=on(r),H.Children.forEach(r,e=>{if(tn(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;rn(n)&&typeof un==`function`;)n=un(n._payload);a=Qt(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=H.cloneElement(a,void 0,s):!o&&H.Children.count(r)===1&&H.isValidElement(r)&&(a=r);let c=a?en(a):void 0,l=yt(n,c);if(!a){if(r||r===0)throw Error(o?ln(e):cn(e));return r}let u=$t(i,a.props??{});return a.type!==H.Fragment&&(u.ref=n?l:c),H.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Jt(Yt,`createSlot`);var Xt=Symbol.for(`radix.slottable`);function Zt(e){let t=Jt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Xt,t}Jt(Zt,`createSlottable`);var Qt=Jt((e,t)=>`child`in e.props?H.isValidElement(t)?H.cloneElement(t,void 0,e.props.children(t.props.children)):null:H.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function $t(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=sn(a,i))}return{...e,...n}}Jt($t,`mergeProps`);function en(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Jt(en,`getElementRef`);function tn(e){return H.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Xt}Jt(tn,`isSlottable`);var nn=Symbol.for(`react.lazy`);function rn(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===nn&&`_payload`in e&&an(e._payload)}Jt(rn,`isLazyComponent`);function an(e){return typeof e==`object`&&!!e&&`then`in e}Jt(an,`isPromiseLike`);function on(e){let t=e;for(;rn(t)&&typeof un==`function`;)t=un(t._payload);return t}Jt(on,`useUnwrappedLazy`);function sn(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Jt(sn,`concatAriaDescribedby`);var cn=Jt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ln=Jt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),un=H.use,dn=Object.defineProperty,fn=(e,t)=>dn(e,`name`,{value:t,configurable:!0}),pn=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Yt(`Primitive.${t}`),r=H.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function mn(e,t){e&&Kt.flushSync(()=>e.dispatchEvent(t))}fn(mn,`dispatchDiscreteCustomEvent`);var hn=Object.defineProperty,gn=(e,t)=>hn(e,`name`,{value:t,configurable:!0}),_n=H.useInsertionEffect;function vn(e){let t=H.useRef(e);return typeof _n==`function`?_n(()=>{t.current=e}):Tt(()=>{t.current=e}),H.useMemo(()=>((...e)=>t.current?.(...e)),[])}gn(vn,`useCallbackRef`);var yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=`dismissableLayer.update`,Sn=`dismissableLayer.pointerDownOutside`,Cn=`dismissableLayer.focusOutside`,wn,Tn=H.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),En=H.forwardRef(bn(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=H.useContext(Tn),[d,f]=H.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=H.useState({}),h=yt(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=H.useRef(!1),C=kn(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:H.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=An(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=vn(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return H.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),H.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wn=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),jn(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=wn))}},[d,p,n,u]),H.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),jn())},[d,u]),H.useEffect(()=>{let e=bn(()=>m({}),`handleUpdate`);return document.addEventListener(xn,e),()=>document.removeEventListener(xn,e)},[]),(0,B.jsx)(pn.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:ut(e.onFocusCapture,w.onFocusCapture),onBlurCapture:ut(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:ut(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Dn(){let e=H.useContext(Tn),[t,n]=H.useState(null);return H.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}bn(Dn,`useDismissableLayerSurface`);var On=bn(()=>!0,`IS_TRUE`);function kn(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=On}=t,s=vn(e),c=H.useRef(!1),l=H.useRef(!1),u=H.useRef(new Map),d=H.useRef(()=>{});return H.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}bn(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}bn(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}bn(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}bn(p,`handleInteractionBubble`);let m=bn(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Mn(Sn,s,p,{discrete:!0})};if(bn(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:bn(()=>c.current=!0,`onPointerDownCapture`)}}bn(kn,`usePointerDownOutside`);function An(e,t=globalThis?.document){let n=vn(e),r=H.useRef(!1);return H.useEffect(()=>{let e=bn(e=>{e.target&&!r.current&&Mn(Cn,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:bn(()=>r.current=!0,`onFocusCapture`),onBlurCapture:bn(()=>r.current=!1,`onBlurCapture`)}}bn(An,`useFocusOutside`);function jn(){let e=new CustomEvent(xn);document.dispatchEvent(e)}bn(jn,`dispatchUpdate`);function Mn(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?mn(i,a):i.dispatchEvent(a)}bn(Mn,`handleAndDispatchCustomEvent`);var Nn=Object.defineProperty,Pn=(e,t)=>Nn(e,`name`,{value:t,configurable:!0}),Fn=`focusScope.autoFocusOnMount`,In=`focusScope.autoFocusOnUnmount`,Ln={bubbles:!1,cancelable:!0},Rn=H.forwardRef(Pn(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=H.useState(null),u=vn(a),d=vn(o),f=H.useRef(null),p=yt(t,l),m=H.useRef(i);H.useEffect(()=>{m.current=i});let h=H.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=H.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;H.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:Yn(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||Yn(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Yn(c)};Pn(e,`handleFocusIn`),Pn(t,`handleFocusOut`),Pn(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),H.useEffect(()=>{if(c){Xn.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Fn,Ln);c.addEventListener(Fn,u),c.dispatchEvent(t),t.defaultPrevented||(Un($n(Gn(c)),{select:!0}),document.activeElement===e&&Yn(c))}return()=>{c.removeEventListener(Fn,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(In,Ln);c.addEventListener(In,d),c.dispatchEvent(r),r.defaultPrevented||Yn(e??t.body,{select:!0}),c.removeEventListener(In,d),Xn.remove(g)},0)}}},[c,u,d,g]);let _=H.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Wn(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Yn(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Yn(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,B.jsx)(pn.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),zn=H.createContext(null);function Bn({registry:e,children:t}){return e?(0,B.jsx)(zn.Provider,{value:e,children:t}):t}Pn(Bn,`FocusScopeBranchProvider`);function Vn(){let[e,t]=H.useState([]);return{nodes:e,registry:H.useMemo(()=>({add:Pn(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:Pn(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}Pn(Vn,`useFocusScopeBranchRegistry`);function Hn(e){let t=H.useContext(zn);H.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}Pn(Hn,`useFocusScopeBranch`);function Un(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Yn(r,{select:t}),document.activeElement!==n)return}Pn(Un,`focusFirst`);function Wn(e){let t=Gn(e);return[Kn(t,e),Kn(t.reverse(),e)]}Pn(Wn,`getTabbableEdges`);function Gn(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Pn(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Pn(Gn,`getTabbableCandidates`);function Kn(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):qn(r,{upTo:t})))return r}Pn(Kn,`findVisible`);function qn(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Pn(qn,`isHidden`);function Jn(e){return e.tagName===`INPUT`&&typeof e.select==`function`}Pn(Jn,`isSelectableInput`);function Yn(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Jn(e)&&t&&e.select()}}Pn(Yn,`focus`);var Xn=Zn();function Zn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Qn(e,t),e.unshift(t)},remove(t){e=Qn(e,t),e[0]?.resume()}}}Pn(Zn,`createFocusScopesStack`);function Qn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Pn(Qn,`arrayRemove`);function $n(e){return e.filter(e=>e.tagName!==`A`)}Pn($n,`removeLinks`);var er=Object.defineProperty,tr=H.forwardRef(((e,t)=>er(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=H.useState(!1);Tt(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Kt.createPortal((0,B.jsx)(pn.div,{...r,ref:t}),o):null},`Portal`)),nr=Object.defineProperty,rr=(e,t)=>nr(e,`name`,{value:t,configurable:!0});function ir(e,t){return H.useReducer((e,n)=>t[e][n]??e,e)}rr(ir,`useStateMachine`);var ar=rr(e=>{let{present:t,children:n}=e,r=or(t),i=typeof n==`function`?n({present:r.isPresent}):H.Children.only(n),a=cr(r.ref,ur(i));return typeof n==`function`||r.isPresent?H.cloneElement(i,{ref:a}):null},`Presence`);function or(e){let[t,n]=H.useState(),r=H.useRef(null),i=H.useRef(e),a=H.useRef(`none`),o=H.useRef(void 0),[s,c]=ir(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return H.useEffect(()=>{s===`mounted`?(a.current=o.current??lr(r.current),o.current=void 0):a.current=`none`},[s]),Tt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=lr(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Tt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=rr(a=>{let o=lr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=rr(e=>{e.target===t&&(a.current=lr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:H.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=lr(t)}else r.current=null;n(e)},[])}}rr(or,`usePresence`);function sr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}rr(sr,`setRef`);function cr(...e){let t=H.useRef(e);return t.current=e,H.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=sr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():sr(n[e],null)}}},[])}rr(cr,`useStableComposedRefs`);function lr(e){return e?.animationName||`none`}rr(lr,`getAnimationName`);function ur(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}rr(ur,`getElementRef`);var dr=Object.defineProperty,fr=(e,t)=>dr(e,`name`,{value:t,configurable:!0}),pr=0,mr=null;function hr(e){return gr(),e.children}fr(hr,`FocusGuards`);function gr(){H.useEffect(()=>{mr||={start:_r(),end:_r()};let{start:e,end:t}=mr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),pr++,()=>{pr===1&&(mr?.start.remove(),mr?.end.remove(),mr=null),pr=Math.max(0,pr-1)}},[])}fr(gr,`useFocusGuards`);function _r(){let 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}fr(_r,`createFocusGuard`);var vr=function(){return vr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vr.apply(this,arguments)};function yr(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function br(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var xr=`right-scroll-bar-position`,Sr=`width-before-scroll-bar`,Cr=`with-scroll-bars-hidden`,wr=`--removed-body-scroll-bar-size`;function Tr(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Er(e,t){var n=(0,H.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Dr=typeof window<`u`?H.useLayoutEffect:H.useEffect,Or=new WeakMap;function kr(e,t){var n=Er(t||null,function(t){return e.forEach(function(e){return Tr(e,t)})});return Dr(function(){var t=Or.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Tr(e,null)}),i.forEach(function(e){r.has(e)||Tr(e,a)})}Or.set(n,e)},[e]),n}function Ar(e){return e}function jr(e,t){t===void 0&&(t=Ar);var n=[],r=!1;return{read:function(){if(r)throw 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(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Mr(e){e===void 0&&(e={});var t=jr(null);return t.options=vr({async:!0,ssr:!1},e),t}var Nr=function(e){var t=e.sideCar,n=yr(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return H.createElement(r,vr({},n))};Nr.isSideCarExport=!0;function Pr(e,t){return e.useMedium(t),Nr}var Fr=Mr(),Ir=function(){},Lr=H.forwardRef(function(e,t){var n=H.useRef(null),r=H.useState({onScrollCapture:Ir,onWheelCapture:Ir,onTouchMoveCapture:Ir}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=yr(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=kr([n,t]),C=vr(vr({},b),i);return H.createElement(H.Fragment,null,u&&H.createElement(x,{sideCar:Fr,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?H.cloneElement(H.Children.only(s),vr(vr({},C),{ref:S})):H.createElement(v,vr({},C,{className:c,ref:S}),s))});Lr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Lr.classNames={fullWidth:Sr,zeroRight:xr};var Rr=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function zr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Rr();return t&&e.setAttribute(`nonce`,t),e}function Br(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Vr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Hr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=zr())&&(Br(t,n),Vr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ur=function(){var e=Hr();return function(t,n){H.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Wr=function(){var e=Ur();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Gr={left:0,top:0,right:0,gap:0},Kr=function(e){return parseInt(e||``,10)||0},qr=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Kr(n),Kr(r),Kr(i)]},Jr=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Gr;var t=qr(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Yr=Wr(),Xr=`data-scroll-locked`,Zr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
3
- .${Cr} {
4
- overflow: hidden ${r};
5
- padding-right: ${s}px ${r};
6
- }
7
- body[${Xr}] {
8
- overflow: hidden ${r};
9
- overscroll-behavior: contain;
10
- ${[t&&`position: relative ${r};`,n===`margin`&&`
11
- padding-left: ${i}px;
12
- padding-top: ${a}px;
13
- padding-right: ${o}px;
14
- margin-left:0;
15
- margin-top:0;
16
- margin-right: ${s}px ${r};
17
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
18
- }
19
-
20
- .${xr} {
21
- right: ${s}px ${r};
22
- }
23
-
24
- .${Sr} {
25
- margin-right: ${s}px ${r};
26
- }
27
-
28
- .${xr} .${xr} {
29
- right: 0 ${r};
30
- }
31
-
32
- .${Sr} .${Sr} {
33
- margin-right: 0 ${r};
34
- }
35
-
36
- body[${Xr}] {
37
- ${wr}: ${s}px;
38
- }
39
- `},Qr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},$r=function(){H.useEffect(function(){return document.body.setAttribute(Xr,(Qr()+1).toString()),function(){var e=Qr()-1;e<=0?document.body.removeAttribute(Xr):document.body.setAttribute(Xr,e.toString())}},[])},ei=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;$r();var a=H.useMemo(function(){return Jr(i)},[i]);return H.createElement(Yr,{styles:Zr(a,!t,i,n?``:`!important`)})},ti=!1;if(typeof window<`u`)try{var ni=Object.defineProperty({},"passive",{get:function(){return ti=!0,!0}});window.addEventListener(`test`,ni,ni),window.removeEventListener(`test`,ni,ni)}catch{ti=!1}var ri=ti?{passive:!1}:!1,ii=function(e){return e.tagName===`TEXTAREA`},ai=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ii(e)&&n[t]===`visible`)},oi=function(e){return ai(e,`overflowY`)},si=function(e){return ai(e,`overflowX`)},ci=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),di(e,r)){var i=fi(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},li=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ui=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},di=function(e,t){return e===`v`?oi(t):si(t)},fi=function(e,t){return e===`v`?li(t):ui(t)},pi=function(e,t){return e===`h`&&t===`rtl`?-1:1},mi=function(e,t,n,r,i){var a=pi(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=fi(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&di(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},hi=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gi=function(e){return[e.deltaX,e.deltaY]},_i=function(e){return e&&`current`in e?e.current:e},vi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yi=function(e){return`
40
- .block-interactivity-${e} {pointer-events: none;}
41
- .allow-interactivity-${e} {pointer-events: all;}
42
- `},bi=0,xi=[];function Si(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),i=H.useState(bi++)[0],a=H.useState(Wr)[0],o=H.useRef(e);H.useEffect(function(){o.current=e},[e]),H.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=br([e.lockRef.current],(e.shards||[]).map(_i),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=H.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=hi(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ci(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ci(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return mi(h,t,e,h===`h`?s:c,!0)},[]),c=H.useCallback(function(e){var n=e;if(xi.length&&xi[xi.length-1]===a){var r=`deltaY`in n?gi(n):hi(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&vi(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(_i).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=H.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ci(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=H.useCallback(function(e){n.current=hi(e),r.current=void 0},[]),d=H.useCallback(function(t){l(t.type,gi(t),t.target,s(t,e.lockRef.current))},[]),f=H.useCallback(function(t){l(t.type,hi(t),t.target,s(t,e.lockRef.current))},[]);H.useEffect(function(){return xi.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,ri),document.addEventListener(`touchmove`,c,ri),document.addEventListener(`touchstart`,u,ri),function(){xi=xi.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,ri),document.removeEventListener(`touchmove`,c,ri),document.removeEventListener(`touchstart`,u,ri)}},[]);var p=e.removeScrollBar,m=e.inert;return H.createElement(H.Fragment,null,m?H.createElement(a,{styles:yi(i)}):null,p?H.createElement(ei,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ci(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var wi=Pr(Fr,Si),Ti=H.forwardRef(function(e,t){return H.createElement(Lr,vr({},e,{ref:t,sideCar:wi}))});Ti.classNames=Lr.classNames;var Ei=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Di=new WeakMap,Oi=new WeakMap,ki={},Ai=0,ji=function(e){return e&&(e.host||ji(e.parentNode))},Mi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ji(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ni=function(e,t,n,r){var i=Mi(t,Array.isArray(e)?e:[e]);ki[n]||(ki[n]=new WeakMap);var a=ki[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Di.get(e)||0)+1,l=(a.get(e)||0)+1;Di.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Oi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ai++,function(){o.forEach(function(e){var t=Di.get(e)-1,i=a.get(e)-1;Di.set(e,t),a.set(e,i),t||(Oi.has(e)||e.removeAttribute(r),Oi.delete(e)),i||e.removeAttribute(n)}),Ai--,Ai||(Di=new WeakMap,Di=new WeakMap,Oi=new WeakMap,ki={})}},Pi=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ei(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ni(r,i,n,`aria-hidden`)):function(){return null}},Fi=Object.defineProperty,Ii=(e,t)=>Fi(e,`name`,{value:t,configurable:!0}),Li=`Dialog`,[Ri,zi]=Ct(Li),[Bi,Vi]=Ri(Li),Hi=Ii(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=H.useRef(null),c=H.useRef(null),{nodes:l,registry:u}=Vn(),[d,f]=zt({prop:r,defaultProp:i??!1,onChange:a,caller:Li}),[p,m]=H.useState(0),[h,g]=H.useState(0);return(0,B.jsx)(Bi,{scope:t,triggerRef:s,contentRef:c,contentId:At(),titleId:At(),descriptionId:At(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:H.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Ui=`DialogPortal`,[Wi,Gi]=Ri(Ui,{forceMount:void 0}),Ki=Ii(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Vi(Ui,t);return(0,B.jsx)(Wi,{scope:t,forceMount:n,children:H.Children.map(r,e=>(0,B.jsx)(ar,{present:n||a.open,children:(0,B.jsx)(tr,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),qi=`DialogOverlay`,Ji=H.forwardRef(Ii(function(e,t){let n=Gi(qi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Vi(qi,e.__scopeDialog);return a.modal?(0,B.jsx)(ar,{present:r||a.open,children:(0,B.jsx)(Xi,{...i,ref:t})}):null},`DialogOverlay`)),Yi=Yt(`DialogOverlay.RemoveScroll`),Xi=H.forwardRef(Ii(function(e,t){let{__scopeDialog:n,...r}=e,i=Vi(qi,n),a=yt(t,Dn());return(0,B.jsx)(Ti,{as:Yi,allowPinchZoom:!0,shards:H.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,B.jsx)(pn.div,{"data-state":sa(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Zi=`DialogContent`,Qi=H.forwardRef(Ii(function(e,t){let n=Gi(Zi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Vi(Zi,e.__scopeDialog);return(0,B.jsx)(ar,{present:r||a.open,children:a.modal?(0,B.jsx)($i,{...i,ref:t}):(0,B.jsx)(ea,{...i,ref:t})})},`DialogContent`)),$i=H.forwardRef(Ii(function(e,t){let n=Vi(Zi,e.__scopeDialog),r=H.useRef(null),i=yt(t,n.contentRef,r);return H.useEffect(()=>{let e=r.current;if(e)return Pi(e)},[]),(0,B.jsx)(ta,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ut(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ut(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ut(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ea=H.forwardRef(Ii(function(e,t){let n=Vi(Zi,e.__scopeDialog),r=H.useRef(!1),i=H.useRef(!1);return(0,B.jsx)(ta,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),ta=H.forwardRef(Ii(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Vi(Zi,n);return gr(),(0,B.jsx)(Bn,{registry:l.branchRegistry,children:(0,B.jsx)(Rn,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(En,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?oa(o,l.descriptionId):o,"data-state":sa(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),na=H.forwardRef(Ii(function(e,t){let{__scopeDialog:n,...r}=e,i=Vi(`DialogTitle`,n),{setTitleCount:a}=i;return Tt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,B.jsx)(pn.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),ra=H.forwardRef(Ii(function(e,t){let{__scopeDialog:n,...r}=e,i=Vi(`DialogDescription`,n),{setDescriptionCount:a}=i;return Tt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,B.jsx)(pn.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),ia=`DialogClose`,aa=H.forwardRef(Ii(function(e,t){let{__scopeDialog:n,...r}=e,i=Vi(ia,n);return(0,B.jsx)(pn.button,{type:`button`,...r,ref:t,onClick:ut(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function oa(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ii(oa,`concatAriaDescribedby`);function sa(e){return e?`open`:`closed`}Ii(sa,`getState`);var ca=Hi,la=aa,ua=(0,H.forwardRef)(({className:e,overlayClassName:t,children:n,...r},i)=>(0,B.jsxs)(Ki,{children:[(0,B.jsx)(Ji,{className:z(`fixed inset-0 z-[300] bg-black/20 backdrop-blur-[2px]`,t)}),(0,B.jsx)(Qi,{ref:i,className:z(`fixed inset-0 z-[301] m-auto h-fit w-[min(560px,calc(100vw-40px))]`,`rounded-2xl border border-line bg-surface p-5 text-ink shadow-[var(--shadow-pop)] outline-none`,e),...r,children:n})]}));ua.displayName=`DialogContent`;function da({className:e,...t}){return(0,B.jsx)(na,{className:z(`text-[15px] font-semibold tracking-[-.01em]`,e),...t})}function fa({className:e,...t}){return(0,B.jsx)(ra,{className:z(`mt-1 text-[12px] leading-5 text-ink-2`,e),...t})}var pa,ma=Object.defineProperty,ha=(e,t)=>ma(e,`name`,{value:t,configurable:!0});function ga(e){let t=e+`CollectionProvider`,[n,r]=Ct(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=ha(e=>{let{scope:t,children:n}=e,r=H.useRef(null),a=H.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Yt(s),l=H.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=yt(t,a(s,n).collectionRef);return(0,B.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Yt(u),p=H.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=H.useRef(null),s=yt(t,o),c=a(u,n);return H.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return H.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return ha(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}ha(ga,`createCollection`);var _a=new WeakMap,va=(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],_a.set(this,!0)}set(e,t){return _a.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=xa(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ya(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ya(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ya(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}static#t=pa=()=>(ha(this,`OrderedDict`),this)},pa());function ya(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=ba(e,t);return n===-1?void 0:e[n]}ha(ya,`at`);function ba(e,t){let n=e.length,r=xa(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ha(ba,`toSafeIndex`);function xa(e){return e!==e||e===0?0:Math.trunc(e)}ha(xa,`toSafeInteger`);function Sa(e){let t=e+`CollectionProvider`,[n,r]=Ct(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=ha(({state:e,...t})=>e?(0,B.jsx)(u,{...t,state:e}):(0,B.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=ha(e=>{let t=_();return(0,B.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=ha(e=>{let{scope:t,children:n,state:r}=e,a=H.useRef(null),[s,c]=H.useState(null),l=yt(a,c),[u,d]=r,f=H.useRef(new va),p=H.useCallback(()=>{let e=f.current;return Ta(e)||e.sort(Ea),e},[]);return H.useEffect(()=>{if(!s)return;let e=Da(()=>{d(e=>{let t=e.toSorted(Ea);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,B.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,B.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=Yt(d),p=H.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=yt(t,a(d,n).collectionElementRef);return(0,B.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=Yt(m),g=H.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=H.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=H.useRef(i);Ca(l.current,i)||(l.current=i);let u=l.current,d=yt(t,H.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);Tt(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=H.useRef(null);return H.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new va(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(Ea)}))}),H.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new va(t);return n.delete(e.element),n})},[s]),(0,B.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return H.useState(new va)}ha(_,`useInitCollection`);function v(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}ha(v,`useCollection`);function y(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return ha(y,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:v,useGetCollection:y,useInitCollection:_}]}ha(Sa,`createCollection`);function Ca(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ha(Ca,`shallowEqual`);function wa(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ha(wa,`isElementPreceding`);function Ta(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}ha(Ta,`isInDocumentOrder`);function Ea(e,t){return!e[1].element||!t[1].element?0:wa(e[1].element,t[1].element)?-1:1}ha(Ea,`sortByDocumentPosition`);function Da(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ha(Da,`getChildListObserver`);var Oa=Object.defineProperty,ka=(e,t)=>Oa(e,`name`,{value:t,configurable:!0}),Aa={LTR:`ltr`,RTL:`rtl`},ja=H.createContext(void 0);function Ma(e){let t=H.useContext(ja);return e||t||Aa.LTR}ka(Ma,`useDirection`);var Na=[`top`,`right`,`bottom`,`left`],Pa=Math.min,Fa=Math.max,Ia=Math.round,La=Math.floor,Ra=e=>({x:e,y:e}),za={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ba(e,t,n){return Fa(e,Pa(t,n))}function Va(e,t){return typeof e==`function`?e(t):e}function Ha(e){return e.split(`-`)[0]}function Ua(e){return e.split(`-`)[1]}function Wa(e){return e===`x`?`y`:`x`}function Ga(e){return e===`y`?`height`:`width`}function Ka(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function qa(e){return Wa(Ka(e))}function Ja(e,t,n){n===void 0&&(n=!1);let r=Ua(e),i=qa(e),a=Ga(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ro(o)),[o,ro(o)]}function Ya(e){let t=ro(e);return[Xa(e),t,Xa(t)]}function Xa(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Za=[`left`,`right`],Qa=[`right`,`left`],$a=[`top`,`bottom`],eo=[`bottom`,`top`];function to(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Qa:Za:t?Za:Qa;case`left`:case`right`:return t?$a:eo;default:return[]}}function no(e,t,n,r){let i=Ua(e),a=to(Ha(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Xa)))),a}function ro(e){let t=Ha(e);return za[t]+e.slice(t.length)}function io(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ao(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:io(e)}function oo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function so(e,t,n){let{reference:r,floating:i}=e,a=Ka(t),o=qa(t),s=Ga(o),c=Ha(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ua(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function co(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Va(t,e),p=ao(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=oo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=oo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var lo=50,uo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:co},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=so(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<lo&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=so(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},fo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Va(e,t)||{};if(l==null)return{};let d=ao(u),f={x:n,y:r},p=qa(i),m=Ga(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Pa(d[_],T),D=Pa(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Ba(E,k,O),j=!c.arrow&&Ua(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),po=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Va(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ha(r),_=Ka(o),v=Ha(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ro(o)]:Ya(o)),x=p!==`none`;!d&&x&&b.push(...no(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ja(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Ka(t)||T.every(e=>Ka(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Ka(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ho(e){return Na.some(t=>e[t]>=0)}var go=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Va(e,t);switch(i){case`referenceHidden`:{let e=mo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ho(e)}}}case`escaped`:{let e=mo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ho(e)}}}default:return{}}}}},_o=new Set([`left`,`top`]);async function vo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ha(n),s=Ua(n),c=Ka(n)===`y`,l=_o.has(o)?-1:1,u=a&&c?-1:1,d=Va(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var yo=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await vo(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},bo=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Va(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ka(i),p=Wa(f),m=u[p],h=u[f],g=(e,t)=>Ba(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Va(e,t),u={x:n,y:r},d=Ka(i),f=Wa(d),p=u[f],m=u[d],h=Va(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=_o.has(Ha(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},So=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Va(e,t),c=await i.detectOverflow(t,s),l=Ha(n),u=Ua(n),d=Ka(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Pa(p-c[m],g),y=Pa(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Fa(c.left,c.right):S=p-2*Fa(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Co(){return typeof window<`u`}function wo(e){return Do(e)?(e.nodeName||``).toLowerCase():`#document`}function To(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Eo(e){return((Do(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Do(e){return Co()?e instanceof Node||e instanceof To(e).Node:!1}function Oo(e){return Co()?e instanceof Element||e instanceof To(e).Element:!1}function ko(e){return Co()?e instanceof HTMLElement||e instanceof To(e).HTMLElement:!1}function Ao(e){return!Co()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof To(e).ShadowRoot}function jo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ho(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Mo(e){return/^(table|td|th)$/.test(wo(e))}function No(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Po=/transform|translate|scale|rotate|perspective|filter/,Fo=/paint|layout|strict|content/,Io=e=>!!e&&e!==`none`,Lo;function Ro(e){let t=Oo(e)?Ho(e):e;return Io(t.transform)||Io(t.translate)||Io(t.scale)||Io(t.rotate)||Io(t.perspective)||!Bo()&&(Io(t.backdropFilter)||Io(t.filter))||Po.test(t.willChange||``)||Fo.test(t.contain||``)}function zo(e){let t=Wo(e);for(;ko(t)&&!Vo(t);){if(Ro(t))return t;if(No(t))return null;t=Wo(t)}return null}function Bo(){return Lo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Lo}function Vo(e){return/^(html|body|#document)$/.test(wo(e))}function Ho(e){return To(e).getComputedStyle(e)}function Uo(e){return Oo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wo(e){if(wo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ao(e)&&e.host||Eo(e);return Ao(t)?t.host:t}function Go(e){let t=Wo(e);return Vo(t)?(e.ownerDocument||e).body:ko(t)&&jo(t)?t:Go(t)}function Ko(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Go(e),i=r===e.ownerDocument?.body,a=To(r);if(i){let e=qo(a);return t.concat(a,a.visualViewport||[],jo(r)?r:[],e&&n?Ko(e):[])}return t.concat(r,Ko(r,[],n))}function qo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jo(e){let t=Ho(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ko(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ia(n)!==a||Ia(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Yo(e){return Oo(e)?e:e.contextElement}function Xo(e){let t=Yo(e);if(!ko(t))return Ra(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Jo(t),o=(a?Ia(n.width):n.width)/r,s=(a?Ia(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Zo=Ra(0);function Qo(e){let t=To(e);return!Bo()||!t.visualViewport?Zo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $o(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===To(e)}function es(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Yo(e),o=Ra(1);t&&(r?Oo(r)&&(o=Xo(r)):o=Xo(e));let s=$o(a,n,r)?Qo(a):Ra(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=To(a),t=Oo(r)?To(r):r,n=e,i=qo(n);for(;i&&t!==n;){let e=Xo(i),t=i.getBoundingClientRect(),r=Ho(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=To(i),i=qo(n)}}return oo({width:u,height:d,x:c,y:l})}function ts(e,t){let n=Uo(e).scrollLeft;return t?t.left+n:es(Eo(e)).left+n}function ns(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ts(e,n),y:n.top+t.scrollTop}}function rs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Eo(r),s=t?No(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ra(1),u=Ra(0),d=ko(r);if((d||!a)&&((wo(r)!==`body`||jo(o))&&(c=Uo(r)),d)){let e=es(r);l=Xo(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ns(o,c):Ra(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function is(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function as(e){let t=Uo(e),n=e.ownerDocument.body,r=Fa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Fa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ts(e),o=-t.scrollTop;return Ho(n).direction===`rtl`&&(a+=Fa(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var os=25;function ss(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=To(e),a=Eo(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Bo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ts(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=os&&(s-=o)}return{width:s,height:c,x:l,y:u}}function cs(e,t){let n=es(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Xo(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ls(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ss(e,n,t);else if(t===`document`)r=as(Eo(e));else if(Oo(t))r=cs(t,n);else{let n=Qo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oo(r)}function us(e,t){let n=t.get(e);if(n)return n;let r=Ko(e,[],!1).filter(e=>Oo(e)&&wo(e)!==`body`),i=null,a=Ho(e).position===`fixed`,o=a?Wo(e):e;for(;Oo(o)&&!Vo(o);){let e=Ho(o),t=Ro(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Wo(o)}return t.set(e,r),r}function ds(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?No(t)?[]:us(t,this._c):[].concat(n),r],o=ls(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ls(t,a[e],i);s=Fa(n.top,s),c=Pa(n.right,c),l=Pa(n.bottom,l),u=Fa(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function fs(e){let{width:t,height:n}=Jo(e);return{width:t,height:n}}function ps(e,t,n){let r=ko(t),i=Eo(t),a=n===`fixed`,o=es(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ra(0);if((r||!a)&&((wo(t)!==`body`||jo(i))&&(s=Uo(t)),r)){let e=es(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ts(i));let l=i&&!r&&!a?ns(i,s):Ra(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ms(e){return Ho(e).position===`static`}function hs(e,t){if(!ko(e)||Ho(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Eo(e)===n&&(n=n.ownerDocument.body),n}function gs(e,t){let n=To(e);if(No(e))return n;if(!ko(e)){let t=Wo(e);for(;t&&!Vo(t);){if(Oo(t)&&!ms(t))return t;t=Wo(t)}return n}let r=hs(e,t);for(;r&&Mo(r)&&ms(r);)r=hs(r,t);return r&&Vo(r)&&ms(r)&&!Ro(r)?n:r||zo(e)||n}var _s=async function(e){let t=this.getOffsetParent||gs,n=this.getDimensions,r=await n(e.floating);return{reference:ps(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vs(e){return Ho(e).direction===`rtl`}var ys={convertOffsetParentRelativeRectToViewportRelativeRect:rs,getDocumentElement:Eo,getClippingRect:ds,getOffsetParent:gs,getElementRects:_s,getClientRects:is,getDimensions:fs,getScale:Xo,isElement:Oo,isRTL:vs};function bs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xs(e,t,n){let r=null,i,a=Eo(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=La(d),h=La(a.clientWidth-(u+f)),g=La(a.clientHeight-(d+p)),_=La(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Fa(0,Pa(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!bs(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=To(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ss(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Yo(e),u=i||a?[...l?Ko(l):[],...t?Ko(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?xs(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?es(e):null;c&&g();function g(){let t=es(e);h&&!bs(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Cs=yo,ws=bo,Ts=po,Es=So,Ds=go,Os=fo,ks=xo,As=(e,t,n)=>{let r=new Map,i=n??{},a={...ys,...i.platform,_c:r};return uo(e,t,{...i,platform:a})},js=typeof document<`u`?H.useLayoutEffect:function(){};function Ms(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ms(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ms(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ns(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ps(e,t){let n=Ns(e);return Math.round(t*n)/n}function Fs(e){let t=H.useRef(e);return js(()=>{t.current=e}),t}function Is(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=H.useState(r);Ms(f,r)||p(r);let[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=H.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=H.useRef(null),C=H.useRef(null),w=H.useRef(u),T=c!=null,E=Fs(c),D=Fs(i),O=Fs(l),k=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),As(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Ms(w.current,t)&&(w.current=t,Kt.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);js(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=H.useRef(!1);js(()=>(A.current=!0,()=>{A.current=!1}),[]),js(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=H.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=H.useMemo(()=>({reference:b,floating:x}),[b,x]),N=H.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Ps(M.floating,u.x),r=Ps(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ns(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Ls=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Os({element:r.current,padding:i}).fn(n):r?Os({element:r,padding:i}).fn(n):{}}}},Rs=(e,t)=>{let n=Cs(e);return{name:n.name,fn:n.fn,options:[e,t]}},zs=(e,t)=>{let n=ws(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bs=(e,t)=>({fn:ks(e).fn,options:[e,t]}),Vs=(e,t)=>{let n=Ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hs=(e,t)=>{let n=Es(e);return{name:n.name,fn:n.fn,options:[e,t]}},Us=(e,t)=>{let n=Ds(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ws=(e,t)=>{let n=Ls(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gs=Object.defineProperty,Ks=H.forwardRef(((e,t)=>Gs(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,B.jsx)(pn.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,B.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),qs=Object.defineProperty,Js=(e,t)=>qs(e,`name`,{value:t,configurable:!0});function Ys(e){let[t,n]=H.useState(void 0);return Tt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Js(Ys,`useSize`);var Xs=Object.defineProperty,Zs=(e,t)=>Xs(e,`name`,{value:t,configurable:!0}),Qs={Partial:`partial`,Always:`always`},$s={Optimized:`optimized`,Always:`always`},ec=`Popper`,[tc,nc]=Ct(ec),[rc,ic]=tc(ec),ac=Zs(e=>{let{__scopePopper:t,children:n}=e,[r,i]=H.useState(null),[a,o]=H.useState(void 0);return(0,B.jsx)(rc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),oc=`PopperAnchor`,sc=H.forwardRef(Zs(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=ic(oc,n),o=H.useRef(null),s=a.onAnchorChange,c=yt(t,H.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=H.useRef(null);H.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&_c(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,B.jsx)(pn.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),cc=`PopperContent`,[lc,uc]=tc(cc),dc=H.forwardRef(Zs(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=Qs.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=$s.Optimized,onPlaced:m,...h}=e,g=ic(cc,n),[_,v]=H.useState(null),y=yt(t,v),[b,x]=H.useState(null),S=Ys(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(hc),altBoundary:O},{refs:A,floatingStyles:j,placement:M,isPositioned:N,middlewareData:ee}=Is({strategy:`fixed`,placement:T,whileElementsMounted:Zs((...e)=>Ss(...e,{animationFrame:p===$s.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Rs({mainAxis:i+w,alignmentAxis:o}),c&&zs({mainAxis:!0,crossAxis:!1,...d===Qs.Partial?{limiter:Bs()}:{},...k}),c&&Vs({...k}),Hs({...k,apply:Zs(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&Ws({element:b,padding:s}),gc({arrowWidth:C,arrowHeight:w}),f&&Us(O?{strategy:`referenceHidden`,...k}:{strategy:`referenceHidden`,padding:k.padding,altBoundary:k.altBoundary})]}),te=g.setPlacementState;Tt(()=>(te(M),()=>{te(void 0)}),[M,te]);let[P,ne]=_c(M),F=vn(m);Tt(()=>{N&&F?.()},[N,F]);let re=ee.arrow?.x,ie=ee.arrow?.y,ae=ee.arrow?.centerOffset!==0,[oe,se]=H.useState();return Tt(()=>{_&&se(window.getComputedStyle(_).zIndex)},[_]),(0,B.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:N?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[ee.transformOrigin?.x,ee.transformOrigin?.y].join(` `),...ee.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,B.jsx)(lc,{scope:n,placedSide:P,placedAlign:ne,onArrowChange:x,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,B.jsx)(pn.div,{"data-side":P,"data-align":ne,...h,ref:y,style:{...h.style,animation:N?h.style?.animation:`none`}})})})},`PopperContent`)),fc=`PopperArrow`,pc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},mc=H.forwardRef(Zs(function(e,t){let{__scopePopper:n,...r}=e,i=uc(fc,n),a=pc[i.placedSide];return(0,B.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,B.jsx)(Ks,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function hc(e){return e!==null}Zs(hc,`isNotNull`);var gc=Zs(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=_c(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function _c(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Zs(_c,`getSideAndAlignFromPlacement`);var vc=Object.defineProperty,yc=(e,t)=>vc(e,`name`,{value:t,configurable:!0}),bc=!1;function xc(){let[e,t]=H.useState(bc);return H.useEffect(()=>{bc||(bc=!0,t(!0))},[]),e}yc(xc,`useIsHydrated`);var Sc=H.useSyncExternalStore;function Cc(){return()=>{}}yc(Cc,`subscribe`);function wc(){return Sc(Cc,()=>!0,()=>!1)}yc(wc,`useIsHydratedModern`);var Tc=typeof Sc==`function`?wc:xc,Ec=Object.defineProperty,Dc=(e,t)=>Ec(e,`name`,{value:t,configurable:!0}),Oc=`rovingFocusGroup.onEntryFocus`,kc={bubbles:!1,cancelable:!0},Ac=`RovingFocusGroup`,[jc,Mc,Nc]=ga(Ac),[Pc,Fc]=Ct(Ac,[Nc]),Ic={Vertical:`vertical`,Horizontal:`horizontal`},Lc={LTR:`ltr`,RTL:`rtl`},[Rc,zc]=Pc(Ac),Bc=H.forwardRef(Dc(function(e,t){return(0,B.jsx)(jc.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(jc.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(Vc,{...e,ref:t})})})},`RovingFocusGroup`)),Vc=H.forwardRef(Dc(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=H.useRef(null),p=yt(t,f),m=Ma(a),[h,g]=zt({prop:o,defaultProp:s??null,onChange:c,caller:Ac}),[_,v]=H.useState(!1),y=vn(l),b=Mc(n),x=H.useRef(!1),[S,C]=H.useState(0);return H.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Oc,y),()=>e.removeEventListener(Oc,y)},[y]),(0,B.jsx)(Rc,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:H.useCallback(e=>g(e),[g]),onItemShiftTab:H.useCallback(()=>v(!0),[]),onFocusableItemAdd:H.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:H.useCallback(()=>C(e=>e-1),[]),children:(0,B.jsx)(pn.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:ut(e.onMouseDown,()=>{x.current=!0}),onFocus:ut(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Oc,kc);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);qc([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:ut(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),Hc=`RovingFocusGroupItem`,Uc=H.forwardRef(Dc(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=At(),l=a||c,u=zc(Hc,n),d=u.currentTabStopId===l,f=Mc(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Tc();return Tt(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),H.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,B.jsx)(jc.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,B.jsx)(pn.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:ut(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:ut(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:ut(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Kc(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Jc(n,r+1):n.slice(r+1)}setTimeout(()=>qc(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Wc={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Gc(e,t){return t===Lc.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Dc(Gc,`getDirectionAwareKey`);function Kc(e,t,n){let r=Gc(e.key,n);if(!(t===Ic.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Ic.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Wc[r]}Dc(Kc,`getFocusIntent`);function qc(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Dc(qc,`focusFirst`);function Jc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Dc(Jc,`wrapArray`);var Yc=Object.defineProperty,Xc=(e,t)=>Yc(e,`name`,{value:t,configurable:!0}),Zc=[`Enter`,` `],Qc=[`ArrowDown`,`PageUp`,`Home`],$c=[`ArrowUp`,`PageDown`,`End`],el=[...Qc,...$c];[...Zc],[...Zc];var tl=`Menu`,[nl,rl,il]=ga(tl),[al,ol]=Ct(tl,[il,nc,Fc]),sl=nc(),cl=Fc(),[ll,ul]=al(tl),[dl,fl]=al(tl),pl=Xc(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=sl(t),[c,l]=H.useState(null),u=H.useRef(!1),d=vn(a),f=Ma(i);return H.useEffect(()=>{let e=Xc(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Xc(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),H.useEffect(()=>{if(!n)return;let e=Xc(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,B.jsx)(ac,{...s,children:(0,B.jsx)(ll,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,B.jsx)(dl,{scope:t,onClose:H.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),ml=H.forwardRef(Xc(function(e,t){let{__scopeMenu:n,...r}=e,i=sl(n);return(0,B.jsx)(sc,{...i,...r,ref:t})},`MenuAnchor`)),hl=`MenuPortal`,[gl,_l]=al(hl,{forceMount:void 0}),vl=Xc(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=ul(hl,t);return(0,B.jsx)(gl,{scope:t,forceMount:n,children:(0,B.jsx)(ar,{present:n||a.open,children:(0,B.jsx)(tr,{asChild:!0,container:i,children:r})})})},`MenuPortal`),yl=`MenuContent`,[bl,xl]=al(yl),Sl=H.forwardRef(Xc(function(e,t){let n=_l(yl,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=ul(yl,e.__scopeMenu),o=fl(yl,e.__scopeMenu);return(0,B.jsx)(nl.Provider,{scope:e.__scopeMenu,children:(0,B.jsx)(ar,{present:r||a.open,children:(0,B.jsx)(nl.Slot,{scope:e.__scopeMenu,children:o.modal?(0,B.jsx)(Cl,{...i,ref:t}):(0,B.jsx)(wl,{...i,ref:t})})})})},`MenuContent`)),Cl=H.forwardRef(Xc(function(e,t){let n=ul(yl,e.__scopeMenu),r=H.useRef(null),i=yt(t,r);return H.useEffect(()=>{let e=r.current;if(e)return Pi(e)},[]),(0,B.jsx)(El,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ut(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),wl=H.forwardRef(Xc(function(e,t){let n=ul(yl,e.__scopeMenu);return(0,B.jsx)(El,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Tl=Yt(`MenuContent.ScrollLock`),El=H.forwardRef(Xc(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=ul(yl,n),_=fl(yl,n),v=sl(n),y=cl(n),b=rl(n),[x,S]=H.useState(null),C=H.useRef(null),[w,T]=H.useState(null);Hn(w);let{nodes:E,registry:D}=Vn(),O=!!(i||m),k=yt(t,C,g.onContentChange,T),A=H.useRef(0),j=H.useRef(``),M=H.useRef(0),N=H.useRef(null),ee=H.useRef(`right`),te=H.useRef(0),P=H.useMemo(()=>m?[C,...E.map(e=>({current:e}))]:[],[C,E,m]),ne=m?Ti:H.Fragment,F=m?{as:Tl,allowPinchZoom:!0,shards:P}:void 0,re=Xc(e=>{let t=j.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Xl(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){j.current=e,window.clearTimeout(A.current),e!==``&&(A.current=window.setTimeout(()=>s(``),1e3))}Xc(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);H.useEffect(()=>()=>window.clearTimeout(A.current),[]),gr();let ie=H.useCallback(e=>ee.current===N.current?.side&&Ql(e,N.current?.area),[]);return(0,B.jsx)(bl,{scope:n,searchRef:j,onItemEnter:H.useCallback(e=>{ie(e)&&e.preventDefault()},[ie]),onItemLeave:H.useCallback(e=>{ie(e)||(C.current?.focus(),S(null))},[ie]),onTriggerLeave:H.useCallback(e=>{ie(e)&&e.preventDefault()},[ie]),pointerGraceTimerRef:M,onPointerGraceIntentChange:H.useCallback(e=>{N.current=e},[]),children:(0,B.jsx)(Bn,{registry:O?D:null,children:(0,B.jsx)(ne,{...F,children:(0,B.jsx)(Rn,{asChild:!0,trapped:i,branches:E,onMountAutoFocus:ut(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,B.jsx)(En,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,B.jsx)(Bc,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:ut(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,B.jsx)(dc,{role:`menu`,"aria-orientation":`vertical`,"data-state":Gl(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:k,style:{outline:`none`,...h.style},onKeyDown:ut(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&re(e.key));let i=C.current;if(e.target!==i||!el.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);$c.includes(e.key)&&a.reverse(),Jl(a)}),onBlur:ut(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),j.current=``)}),onPointerMove:ut(e.onPointerMove,$l(e=>{let t=e.target,n=te.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>te.current?`right`:`left`;ee.current=t,te.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Dl=H.forwardRef(Xc(function(e,t){let{__scopeMenu:n,...r}=e;return(0,B.jsx)(pn.div,{role:`group`,...r,ref:t})},`MenuGroup`)),Ol=H.forwardRef(Xc(function(e,t){let{__scopeMenu:n,...r}=e;return(0,B.jsx)(pn.div,{...r,ref:t})},`MenuLabel`)),kl=`MenuItem`,Al=`menu.itemSelect`,jl=H.forwardRef(Xc(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=H.useRef(null),o=fl(kl,e.__scopeMenu),s=xl(kl,e.__scopeMenu),c=yt(t,a),l=H.useRef(!1),u=Xc(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Al,{bubbles:!0,cancelable:!0});e.addEventListener(Al,e=>r?.(e),{once:!0}),mn(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,B.jsx)(Ml,{...i,ref:c,disabled:n,onClick:ut(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:ut(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:ut(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Zc.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Ml=H.forwardRef(Xc(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=xl(kl,n),s=cl(n),c=H.useRef(null),l=yt(t,c),[u,d]=H.useState(!1),[f,p]=H.useState(``);return H.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,B.jsx)(nl.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,B.jsx)(Uc,{asChild:!0,...s,focusable:!r,children:(0,B.jsx)(pn.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:ut(e.onPointerMove,$l(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ut(e.onPointerLeave,$l(e=>o.onItemLeave(e))),onFocus:ut(e.onFocus,()=>d(!0)),onBlur:ut(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Nl,Pl]=al(`MenuRadioGroup`,{value:void 0,onValueChange:Xc(()=>{},`onValueChange`)}),Fl=H.forwardRef(Xc(function(e,t){let{value:n,onValueChange:r,...i}=e,a=vn(r);return(0,B.jsx)(Nl,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,B.jsx)(Dl,{...i,ref:t})})},`MenuRadioGroup`)),Il=`MenuRadioItem`,Ll=H.forwardRef(Xc(function(e,t){let{value:n,...r}=e,i=Pl(Il,e.__scopeMenu),a=n===i.value;return(0,B.jsx)(zl,{scope:e.__scopeMenu,checked:a,children:(0,B.jsx)(jl,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ql(a),onSelect:ut(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Rl=`MenuItemIndicator`,[zl,Bl]=al(Rl,{checked:!1}),Vl=H.forwardRef(Xc(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=Bl(Rl,n);return(0,B.jsx)(ar,{present:r||Kl(a.checked)||a.checked===!0,children:(0,B.jsx)(pn.span,{...i,ref:t,"data-state":ql(a.checked)})})},`MenuItemIndicator`)),Hl=H.forwardRef(Xc(function(e,t){let{__scopeMenu:n,...r}=e;return(0,B.jsx)(pn.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[Ul,Wl]=al(`MenuSub`);function Gl(e){return e?`open`:`closed`}Xc(Gl,`getOpenState`);function Kl(e){return e===`indeterminate`}Xc(Kl,`isIndeterminate`);function ql(e){return Kl(e)?`indeterminate`:e?`checked`:`unchecked`}Xc(ql,`getCheckedState`);function Jl(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Xc(Jl,`focusFirst`);function Yl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Xc(Yl,`wrapArray`);function Xl(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Yl(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Xc(Xl,`getNextMatch`);function Zl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Xc(Zl,`isPointInPolygon`);function Ql(e,t){return t?Zl({x:e.clientX,y:e.clientY},t):!1}Xc(Ql,`isPointerInGraceArea`);function $l(e){return t=>t.pointerType===`mouse`?e(t):void 0}Xc($l,`whenMouse`);var eu=Object.defineProperty,tu=(e,t)=>eu(e,`name`,{value:t,configurable:!0}),nu=`DropdownMenu`,[ru,iu]=Ct(nu,[ol]),au=ol(),[ou,su]=ru(nu),cu=tu(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=au(t),l=H.useRef(null),[u,d]=zt({prop:i,defaultProp:a??!1,onChange:o,caller:nu});return(0,B.jsx)(ou,{scope:t,triggerId:At(),triggerRef:l,contentId:At(),open:u,onOpenChange:d,onOpenToggle:H.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,B.jsx)(pl,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),lu=`DropdownMenuTrigger`,uu=H.forwardRef(tu(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=su(lu,n),o=au(n),s=yt(t,a.triggerRef);return(0,B.jsx)(ml,{asChild:!0,...o,children:(0,B.jsx)(pn.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:ut(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:ut(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),du=tu(e=>{let{__scopeDropdownMenu:t,...n}=e,r=au(t);return(0,B.jsx)(vl,{...r,...n})},`DropdownMenuPortal`),fu=`DropdownMenuContent`,pu=H.forwardRef(tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=su(fu,n),a=au(n),o=H.useRef(!1);return(0,B.jsx)(Sl,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:ut(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:ut(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.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)`}})},`DropdownMenuContent`)),mu=H.forwardRef(tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=au(n);return(0,B.jsx)(Ol,{...i,...r,ref:t})},`DropdownMenuLabel`)),hu=H.forwardRef(tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=au(n);return(0,B.jsx)(jl,{...i,...r,ref:t})},`DropdownMenuItem`)),gu=H.forwardRef(tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=au(n);return(0,B.jsx)(Fl,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),_u=H.forwardRef(tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=au(n);return(0,B.jsx)(Ll,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),vu=H.forwardRef(tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=au(n);return(0,B.jsx)(Vl,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),yu=H.forwardRef(tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=au(n);return(0,B.jsx)(Hl,{...i,...r,ref:t})},`DropdownMenuSeparator`)),bu=cu,xu=uu,Su=gu,Cu=(0,H.forwardRef)(({className:e,sideOffset:t=6,align:n=`end`,...r},i)=>(0,B.jsx)(du,{children:(0,B.jsx)(pu,{ref:i,sideOffset:t,align:n,className:z(`z-[200] min-w-[190px] rounded-xl border border-line bg-surface/95 p-1.5 text-ink shadow-[var(--shadow-pop)] backdrop-blur-xl`,`data-[state=open]:animate-in data-[state=closed]:animate-out`,e),...r})}));Cu.displayName=`DropdownMenuContent`;function wu({className:e,children:t}){return(0,B.jsx)(mu,{className:z(`px-2.5 pb-1 pt-1.5 text-[10.5px] font-semibold text-ink-3`,e),children:t})}var Tu=(0,H.forwardRef)(({className:e,inset:t,...n},r)=>(0,B.jsx)(hu,{ref:r,className:z(`relative flex cursor-default select-none items-center gap-2 rounded-lg px-2.5 py-1.5 text-[12px] text-ink-2 outline-none transition-colors`,`data-[highlighted]:bg-black/[.05] data-[highlighted]:text-ink dark:data-[highlighted]:bg-white/[.07]`,`data-[disabled]:pointer-events-none data-[disabled]:opacity-45`,t&&`pl-8`,e),...n}));Tu.displayName=`DropdownMenuItem`;var Eu=(0,H.forwardRef)(({className:e,children:t,...n},r)=>(0,B.jsxs)(_u,{ref:r,className:z(`relative flex cursor-default select-none items-center gap-2 rounded-lg py-1.5 pl-2.5 pr-8 text-[12px] text-ink-2 outline-none transition-colors`,`data-[highlighted]:bg-black/[.05] data-[highlighted]:text-ink dark:data-[highlighted]:bg-white/[.07]`,e),...n,children:[t,(0,B.jsx)(vu,{className:`absolute right-2`,children:(0,B.jsx)(`span`,{className:`block h-1.5 w-1.5 rounded-full bg-accent`})})]}));Eu.displayName=`DropdownMenuRadioItem`;var Du=(0,H.forwardRef)(({className:e,...t},n)=>(0,B.jsx)(yu,{ref:n,className:z(`my-1 h-px bg-line`,e),...t}));Du.displayName=`DropdownMenuSeparator`;function Ou({message:e,onDismiss:t,retry:n}){return e?(0,B.jsx)(ku,{message:e,onDismiss:t,retry:n},e):null}function ku({message:e,onDismiss:t,retry:n}){let[r,i]=(0,H.useState)(!1);return r?null:(0,B.jsxs)(`div`,{role:`alert`,className:`pointer-events-none fixed top-4 left-1/2 z-[360] flex w-max max-w-[min(28rem,calc(100%_-_2rem))] -translate-x-1/2 items-center gap-2 rounded-xl border border-danger/30 bg-surface px-3 py-2 text-[12px] leading-5 text-ink shadow-[var(--shadow-pop)]`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full bg-danger`}),(0,B.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e}),n?(0,B.jsx)(V,{size:`sm`,variant:`secondary`,className:`pointer-events-auto shrink-0`,onClick:n.run,children:n.label}):null,(0,B.jsx)(V,{size:`sm`,variant:`ghost`,className:`pointer-events-auto shrink-0`,"aria-label":`关闭错误消息`,onClick:()=>{t?t():i(!0)},children:`关闭`})]})}var Au=`w-full rounded-lg border border-line bg-surface-2 px-2.5 text-[12px] font-normal text-ink transition-colors focus-visible:border-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/25 disabled:opacity-45`,ju=`min-w-0 placeholder:text-ink-3`;function Mu({className:e,variant:t=`field`,...n}){return(0,B.jsx)(`input`,{className:z(ju,t===`field`&&[Au,`h-8`],e),...n})}function Nu({className:e,variant:t=`field`,...n}){return(0,B.jsx)(`textarea`,{className:z(ju,t===`field`&&[Au,`py-1.5`],e),...n})}function Pu({className:e,...t}){return(0,B.jsx)(`input`,{...t,type:`checkbox`,className:z(`size-4 shrink-0 appearance-none rounded border border-line bg-surface outline-none checked:border-accent checked:bg-accent checked:after:mx-auto checked:after:block checked:after:h-2.5 checked:after:w-1.5 checked:after:rotate-45 checked:after:border-b-2 checked:after:border-r-2 checked:after:border-white focus-visible:ring-2 focus-visible:ring-accent/50 disabled:opacity-45`,e)})}function Fu({label:e,value:t,options:n,onValueChange:r,placeholder:i=`请选择`,disabled:a,className:o}){let s=(0,H.useId)(),c=n.find(e=>e.value===t);return(0,B.jsxs)(bu,{modal:!1,children:[(0,B.jsxs)(xu,{"aria-label":e,"aria-describedby":s,disabled:a||n.length===0,className:z(Au,`flex h-8 items-center justify-between gap-2 text-left enabled:hover:border-accent/50`,o),children:[(0,B.jsx)(`span`,{id:s,className:z(`truncate`,!c&&`text-ink-3`),children:c?.label??i}),(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`-mt-1 size-1.5 shrink-0 rotate-45 border-b border-r`})]}),(0,B.jsx)(Cu,{align:`start`,sideOffset:4,className:`z-[350] max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[var(--radix-dropdown-menu-trigger-width)] max-w-[var(--radix-dropdown-menu-content-available-width)] overflow-auto`,children:(0,B.jsx)(Su,{value:t,onValueChange:e=>{let t=n.find(t=>t.value===e);t&&r(t.value)},children:n.map(e=>(0,B.jsx)(Eu,{value:e.value,children:(0,B.jsx)(`span`,{className:`min-w-0 break-all`,children:e.label})},e.value))})})]})}var Iu=(0,H.forwardRef)(function({label:e,active:t=!1,tone:n=`default`,className:r,children:i,type:a=`button`,...o},s){return(0,B.jsx)(`button`,{ref:s,type:a,"aria-label":e,title:e,"aria-pressed":t||void 0,className:z(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,`disabled:pointer-events-none disabled:opacity-40`,t?`bg-accent-soft text-accent`:`text-ink-2 hover:bg-black/[.05] hover:text-ink dark:hover:bg-white/[.07]`,n===`danger`&&`hover:bg-danger/10 hover:text-danger`,r),...o,children:i})});function Lu({children:e,className:t}){return(0,B.jsx)(`kbd`,{className:z(`inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-[5px] border border-line bg-surface-2 px-1 font-sans text-[10px] font-medium text-ink-3`,t),children:e})}var Ru=Object.defineProperty,zu=(e,t)=>Ru(e,`name`,{value:t,configurable:!0}),Bu={Automatic:`automatic`,Manual:`manual`},Vu=`Tabs`,[Hu,Uu]=Ct(Vu,[Fc]),Wu=Fc(),[Gu,Ku]=Hu(Vu),qu=H.forwardRef(zu(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=Bu.Automatic,...l}=e,u=Ma(s),[d,f]=zt({prop:r,onChange:i,defaultProp:a??``,caller:Vu});return(0,B.jsx)(Gu,{scope:n,baseId:At(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,B.jsx)(pn.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Ju=`TabsList`,Yu=H.forwardRef(zu(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Ku(Ju,n),o=Wu(n);return(0,B.jsx)(Bc,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,B.jsx)(pn.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Xu=`TabsTrigger`,Zu=H.forwardRef(zu(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Ku(Xu,n),s=Wu(n),c=Qu(o.baseId,r),l=$u(o.baseId,r),u=r===o.value;return(0,B.jsx)(Uc,{asChild:!0,...s,focusable:!i,active:u,children:(0,B.jsx)(pn.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:ut(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:ut(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:ut(e.onFocus,()=>{let e=o.activationMode!==Bu.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`));function Qu(e,t){return`${e}-trigger-${t}`}zu(Qu,`makeTriggerId`);function $u(e,t){return`${e}-content-${t}`}zu($u,`makeContentId`);var ed=qu;function td({className:e,children:t,...n}){let r=(0,H.useRef)(null),[i,a]=(0,H.useState)({left:0,width:0,visible:!1});return(0,H.useEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>{let t=e.querySelector(`[data-state='active']`);if(!t){a(e=>e.visible?{...e,visible:!1}:e);return}let n={left:t.offsetLeft,width:t.offsetWidth,visible:!0};a(e=>e.visible&&e.left===n.left&&e.width===n.width?e:n)};t();let n=new ResizeObserver(t);n.observe(e);for(let t of Array.from(e.children))n.observe(t);let i=new MutationObserver(t);return i.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-state`]}),()=>{n.disconnect(),i.disconnect()}},[]),(0,B.jsxs)(Yu,{ref:r,className:z(`relative inline-flex items-center gap-0.5 rounded-[9px] bg-surface-3 p-0.5`,e),...n,children:[(0,B.jsx)(`span`,{"aria-hidden":!0,className:z(`pointer-events-none absolute inset-y-0.5 left-0 rounded-[7px] bg-surface shadow-sm ring-1 ring-inset ring-line-strong/40`,`transition-[transform,width,opacity] duration-300 ease-[cubic-bezier(0.34,1.3,0.44,1)] motion-reduce:transition-none`,i.visible?`opacity-100`:`scale-[0.96] opacity-0`),style:{width:i.width,transform:`translate3d(${i.left}px,0,0)`}}),t]})}function nd({className:e,...t}){return(0,B.jsx)(Zu,{className:z(`relative inline-flex h-6 items-center rounded-[7px] px-2 text-[11.5px] font-medium text-ink-2 outline-none transition-colors`,`data-[state=active]:text-ink`,e),...t})}var rd=Object.defineProperty,id=(e,t)=>rd(e,`name`,{value:t,configurable:!0}),ad=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`}),od=H.forwardRef(id(function(e,t){return(0,B.jsx)(pn.span,{...e,ref:t,style:{...ad,...e.style}})},`VisuallyHidden`)),sd=Object.defineProperty,cd=(e,t)=>sd(e,`name`,{value:t,configurable:!0}),[ld,ud]=Ct(`Tooltip`,[nc]),dd=nc(),fd=`TooltipProvider`,pd=700,md=`tooltip.open`,[hd,gd]=ld(fd),_d=cd(e=>{let{__scopeTooltip:t,delayDuration:n=pd,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=H.useRef(!0),s=H.useRef(!1),c=H.useRef(0);return H.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,B.jsx)(hd,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:H.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:H.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:H.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),vd=`Tooltip`,[yd,bd]=ld(vd),xd=cd(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=gd(vd,e.__scopeTooltip),l=dd(t),[u,d]=H.useState(null),[f,p]=H.useState(void 0),m=At(),h=H.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=H.useRef(!1),[y,b]=zt({prop:r,defaultProp:i??!1,onChange:cd(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(md))):c.onClose(),a?.(e)},`onChange`),caller:vd}),x=H.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=H.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=H.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=H.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);H.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,B.jsx)(ac,{...l,children:(0,B.jsx)(yd,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:H.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:H.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),Sd=`TooltipTrigger`,Cd=H.forwardRef(cd(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=bd(Sd,n),o=gd(Sd,n),s=dd(n),c=yt(t,H.useRef(null),a.onTriggerChange),l=H.useRef(!1),u=H.useRef(!1),d=H.useCallback(()=>l.current=!1,[]);return H.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,B.jsx)(sc,{asChild:!0,...s,children:(0,B.jsx)(pn.button,{"aria-describedby":a.open?Bd(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:ut(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:ut(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:ut(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:ut(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:ut(e.onBlur,a.onClose),onClick:ut(e.onClick,a.onClose)})})},`TooltipTrigger`)),wd=`TooltipPortal`,[Td,Ed]=ld(wd,{forceMount:void 0}),Dd=cd(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=bd(wd,t);return(0,B.jsx)(Td,{scope:t,forceMount:n,children:(0,B.jsx)(ar,{present:n||a.open,children:(0,B.jsx)(tr,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Od=`TooltipContent`,kd=H.forwardRef(cd(function(e,t){let n=Ed(Od,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=bd(Od,e.__scopeTooltip);return(0,B.jsx)(ar,{present:r||o.open,children:o.disableHoverableContent?(0,B.jsx)(Md,{side:i,...a,ref:t}):(0,B.jsx)(Ad,{side:i,...a,ref:t})})},`TooltipContent`)),Ad=H.forwardRef(cd(function(e,t){let n=bd(Od,e.__scopeTooltip),r=gd(Od,e.__scopeTooltip),i=H.useRef(null),a=yt(t,i),[o,s]=H.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=H.useCallback(()=>{s(null),d(!1)},[d]),p=H.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Fd(r,Pd(r,n.getBoundingClientRect())),a=Id(t.getBoundingClientRect()),o=Rd([...i,...a]);s(o),d(!0)},[d]);return H.useEffect(()=>()=>f(),[f]),H.useEffect(()=>{if(c&&u){let e=cd(e=>p(e,u),`handleTriggerLeave`),t=cd(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),H.useEffect(()=>{if(o){let e=cd(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Ld(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,B.jsx)(Md,{...e,ref:a})},`TooltipContentHoverable`)),jd=Zt(`TooltipContent`),Md=H.forwardRef(cd(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=bd(Od,n),u=dd(n),{onClose:d}=l,[f,p]=H.useState(null),m=yt(t,p);Hn(f),H.useEffect(()=>(document.addEventListener(md,d),()=>document.removeEventListener(md,d)),[d]),H.useEffect(()=>{if(l.trigger){let e=cd(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return Tt(()=>(h(a),()=>{h(void 0)}),[a,h]),(0,B.jsx)(En,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,B.jsxs)(dc,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,B.jsx)(jd,{children:r}),i?(0,B.jsx)(od,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Nd=H.forwardRef(cd(function(e,t){let{__scopeTooltip:n,...r}=e,i=dd(n);return(0,B.jsx)(mc,{...i,...r,ref:t})},`TooltipArrow`));function Pd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}cd(Pd,`getExitSideFromRect`);function Fd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}cd(Fd,`getPaddedExitPoints`);function Id(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}cd(Id,`getPointsFromRect`);function Ld(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}cd(Ld,`isPointInPolygon`);function Rd(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),zd(t)}cd(Rd,`getHull`);function zd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}cd(zd,`getHullPresorted`);function Bd(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}cd(Bd,`concatAriaDescribedby`);var Vd=_d;function Hd({label:e,children:t,side:n=`bottom`,className:r}){return(0,B.jsxs)(xd,{children:[(0,B.jsx)(Cd,{asChild:!0,children:t}),(0,B.jsx)(Dd,{children:(0,B.jsxs)(kd,{side:n,sideOffset:6,className:z(`z-[200] select-none rounded-md bg-[#1d1d1f] px-2 py-1 text-[11px] font-medium text-white shadow-lg`,`data-[state=delayed-open]:animate-in dark:bg-[#f5f5f7] dark:text-[#1d1d1f]`,r),children:[e,(0,B.jsx)(Nd,{className:`fill-[#1d1d1f] dark:fill-[#f5f5f7]`})]})})]})}var Ud=H.createContext(void 0),Wd=e=>{let t=H.useContext(Ud);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Gd=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,B.jsx)(Ud.Provider,{value:e,children:t})),Kd={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},qd=new class{#e=Kd;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Jd(e){setTimeout(e,0)}var Yd=typeof window>`u`||`Deno`in globalThis;function Xd(){}function Zd(e,t){return typeof e==`function`?e(t):e}function Qd(e){return typeof e==`number`&&e>=0&&e!==1/0}function $d(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ef(e,t){return typeof e==`function`?e(t):e}function tf(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==rf(o,t.options))return!1}else if(!of(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function nf(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(af(t.options.mutationKey)!==af(a))return!1}else if(!of(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function rf(e,t){return(t?.queryKeyHashFn||af)(e)}function af(e){return JSON.stringify(e,(e,t)=>df(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function of(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!of(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!of(e[r],t[r]))return!1;return!0}return!1}var sf=Object.prototype.hasOwnProperty;function cf(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=uf(e)&&uf(t);if(!r&&!(df(e)&&df(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:sf.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=cf(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function lf(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!sf.call(t,n)||e[n]!==t[n])return!1;return!0}function uf(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function df(e){if(!ff(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!ff(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function ff(e){return Object.prototype.toString.call(e)===`[object Object]`}function pf(e){return new Promise(t=>{qd.setTimeout(t,e)})}function mf(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:cf(e,t)}function hf(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function gf(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var _f=Symbol();function vf(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===_f?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function yf(e,t){return typeof e==`function`?e(...t):!!e}var bf=Symbol();function xf(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[bf]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var Sf=()=>Yd,Cf=()=>Sf(),wf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Tf=new class extends wf{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Ef=Jd;function Df(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Ef,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Of=Df(),kf=new class extends wf{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Af(e){return Math.min(1e3*2**e,3e4)}function jf(e){return(e??`online`)!==`online`||kf.isOnline()}var Mf=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Nf(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Xd);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Mf(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Tf.isFocused()&&(e.networkMode===`always`||kf.isOnline())&&e.canRun(),p=()=>jf(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Cf()?0:3),a=e.retryDelay??Af,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),pf(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var Pf=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Qd(this.gcTime)&&(this.#e=qd.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cf()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(qd.clearTimeout(this.#e),this.#e=void 0)}};function Ff(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{xf(e,()=>t.signal,()=>n=!0,l[bf])},d=vf(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?gf:hf;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Lf:If,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:If(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function If(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Lf(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Rf(e,t){return t?If(e,t)!=null:!1}function zf(e,t){return!t||!e.getPreviousPageParam?!1:Lf(e,t)!=null}var Bf=class extends Pf{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Uf(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Uf(this.options);e.data!==void 0&&(this.setState(Hf(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=mf(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Xd).catch(Xd):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ef(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_f||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>ef(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!$d(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[bf]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=vf(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ff(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Nf({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Mf&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Mf){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Vf(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Hf(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Of.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Vf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jf(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Hf(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Uf(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Wf=class extends wf{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Kf(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qf(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qf(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof ef(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!lf(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Jf(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||ef(this.options.enabled,this.#t)!==ef(t.enabled,this.#t)||ef(this.options.staleTime,this.#t)!==ef(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||ef(this.options.enabled,this.#t)!==ef(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return lf(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Xd)),t}#h(e){return!Cf()&&ef(this.options.enabled,this.#t)!==!1&&Qd(e)}#g(){this.#b();let e=ef(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=$d(this.#r.dataUpdatedAt,e)+1;this.#u=qd.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return ef(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=qd.setInterval(()=>{(this.options.refetchIntervalInBackground||Tf.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(qd.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(qd.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Kf(e,t),o=i&&Jf(e,n,t,r);(a||o)&&(l={...l,...Vf(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=mf(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=mf(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=i?.error===f?i.errorUpdatedAt:Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Yf(e,t),refetch:this.refetch,isEnabled:ef(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),lf(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();Of.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Gf(e,t){return ef(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||ef(t.retryOnMount,e)!==!1)}function Kf(e,t){return Gf(e,t)||e.state.data!==void 0&&qf(e,t,t.refetchOnMount)}function qf(e,t,n){if(ef(t.enabled,e)!==!1&&ef(t.staleTime,e)!==`static`){let r=ef(n,e);return r===`always`||r!==!1&&Yf(e,t)}return!1}function Jf(e,t,n,r){return(e!==t||ef(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Yf(e,n)}function Yf(e,t){return ef(t.enabled,e)!==!1&&e.isStaleByTime(ef(t.staleTime,e))}var Xf=class extends Wf{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Rf(t,n.data),hasPreviousPage:zf(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Zf=class extends Pf{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Qf(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Nf({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Of.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Qf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var $f=class extends wf{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Zf({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ep(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=ep(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=ep(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=ep(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Of.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>nf(t,e))}findAll(e={}){return this.getAll().filter(t=>nf(e,t))}notify(e){Of.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Of.batch(()=>Promise.all(e.map(e=>e.continue().catch(Xd))))}};function ep(e){return e.options.scope?.id}var tp=class extends wf{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),lf(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&af(t.mutationKey)!==af(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Qf();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Of.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},np=class extends wf{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??rf(r,t),a=this.get(i);return a||(a=new Bf({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Of.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>tf(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>tf(e,t)):t}notify(e){Of.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Of.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Of.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rp=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new np,this.#t=e.mutationCache||new $f,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Tf.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=kf.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ef(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Zd(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Of.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Of.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Of.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Of.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Xd).catch(Xd)}invalidateQueries(e,t={}){return Of.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Of.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(Xd)),r?Promise.resolve():t}));return Promise.all(r).then(Xd)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(ef(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ef(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Xd).catch(Xd)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Xd).catch(Xd)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return kf.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(af(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{of(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(af(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{of(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=rf(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===_f&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},ip=H.createContext(!1),ap=()=>H.useContext(ip);ip.Provider;function op(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var sp=H.createContext(op()),cp=()=>H.useContext(sp),lp=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?yf(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},up=e=>{H.useEffect(()=>{e.clearReset()},[e])},dp=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||yf(n,[e.error,r])),fp=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},pp=(e,t)=>e?.suspense&&t.isPending,mp=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function hp(e,t,n){let r=ap(),i=cp(),a=Wd(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,fp(o),lp(o,i,s),up(i);let[l]=H.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);H.useEffect(()=>{l.setOptions(o)},[o,l]);let d=!r&&c;if(H.useSyncExternalStore(H.useCallback(e=>{let t=d?l.subscribe(Of.batchCalls(e)):Xd;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),pp(o,u))throw mp(o,l,i);if(dp({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function gp(e,t){return hp(e,Wf,t)}function _p(e,t){let n=Wd(t),[r]=H.useState(()=>new tp(n,e));H.useEffect(()=>{r.setOptions(e)},[r,e]);let i=H.useSyncExternalStore(H.useCallback(e=>r.subscribe(Of.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=H.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Xd)},[r]);if(i.error&&yf(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function vp(e,t){return hp(e,Xf,t)}var yp=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),bp=o(((e,t)=>{t.exports=yp()})),xp=o((e=>{var t=bp(),n=ot(),r=Gt();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function m(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var v=null,y=null;function b(e,t,n){return e===n||e===t&&(v=e,!0)}function x(e,t,n){return e===n?(y=e,!1):e===t&&(y!==null&&(v=e),!0)}function S(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function C(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var w=Object.assign,T=Symbol.for(`react.element`),E=Symbol.for(`react.transitional.element`),D=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),k=Symbol.for(`react.strict_mode`),A=Symbol.for(`react.profiler`),j=Symbol.for(`react.consumer`),M=Symbol.for(`react.context`),N=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),P=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),F=Symbol.for(`react.activity`),re=Symbol.for(`react.legacy_hidden`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.for(`react.view_transition`),oe=Symbol.for(`react.recoverable`),se=Symbol.iterator;function ce(e){return typeof e!=`object`||!e?null:(e=se&&e[se]||e[`@@iterator`],typeof e==`function`?e:null)}var le=Symbol.for(`react.client.reference`);function ue(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case O:return`Fragment`;case A:return`Profiler`;case k:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case F:return`Activity`;case ae:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case D:return`Portal`;case M:return e.displayName||`Context`;case j:return(e._context.displayName||`Context`)+`.Consumer`;case N:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?ue(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var de=Array.isArray,fe=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function ve(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function I(e,t){ge++,he[ge]=e.current,e.current=t}var ye=_e(null),be=_e(null),xe=_e(null),Se=_e(null);function Ce(e,t){switch(I(xe,t),I(be,e),I(ye,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xp(t),e=Sp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ve(ye),I(ye,e)}function we(){ve(ye),ve(be),ve(xe)}function Te(e){var t=e.memoizedState;t!==null&&(vh._currentValue=t.memoizedState,I(Se,e)),t=ye.current;var n=Sp(t,e.type);t!==n&&(I(be,e),I(ye,n))}function Ee(e){be.current===e&&(ve(ye),ve(be)),Se.current===e&&(ve(Se),vh._currentValue=me)}var De,Oe;function ke(e){if(De===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);De=t&&t[1]||``,Oe=-1<e.stack.indexOf(`
43
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
44
- `+De+e+Oe}var L=!1;function Ae(e,t){if(!e||L)return``;L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
45
- `),l=s.split(`
46
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
47
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{L=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ke(n):``}function je(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke(`Lazy`);case 13:return e.child!==t&&t!==null?ke(`Suspense Fallback`):ke(`Suspense`);case 19:return ke(`SuspenseList`);case 0:case 15:return Ae(e.type,!1);case 11:return Ae(e.type.render,!1);case 1:return Ae(e.type,!0);case 31:return ke(`Activity`);case 30:return ke(`ViewTransition`);default:return``}}function Me(e){try{var t=``,n=null;do t+=je(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
48
- Error generating stack: `+e.message+`
49
- `+e.stack}}var Ne=Object.prototype.hasOwnProperty,Pe=t.unstable_scheduleCallback,Fe=t.unstable_cancelCallback,Ie=t.unstable_shouldYield,R=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,z=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function B(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function it(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 V(){var e=z;return z<<=1,!(z&62914560)&&(z=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function H(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function st(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ye(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ct(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ct(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function lt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ut(e,t){var n=t&-t;return n=n&42?1:dt(n),(n&(e.suspendedLanes|t))===0?n:0}function dt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ft(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function pt(){var e=pe.p;return e===0?(e=window.event,e===void 0?32:Ph(e.type)):e}function mt(e,t){var n=pe.p;try{return pe.p=e,t()}finally{pe.p=n}}var ht=Math.random().toString(36).slice(2),gt=`__reactFiber$`+ht,_t=`__reactProps$`+ht,vt=`__reactContainer$`+ht,yt=`__reactEvents$`+ht,bt=`__reactListeners$`+ht,xt=`__reactHandles$`+ht,St=`__reactResources$`+ht,Ct=`__reactMarker$`+ht,wt=`__reactLoad$`+ht;function Tt(e){delete e[gt],delete e[_t],delete e[bt],delete e[xt]}function Et(e){var t;if(t=e[gt])return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cm(e);e!==null;){if(n=e[gt])return n;e=Cm(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[gt]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[Ct]=!0}function jt(e){e[wt]=void 0}var Mt=new Set,Nt={};function Pt(e,t){Ft(e,t),Ft(e+`Capture`,t)}function Ft(e,t){for(Nt[e]=t,e=0;e<t.length;e++)Mt.add(t[e])}var It=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]*$`),Lt={},Rt={};function zt(e){return Ne.call(Rt,e)?!0:Ne.call(Lt,e)?!1:It.test(e)?Rt[e]=!0:(Lt[e]=!0,!1)}var Bt=!1;function Vt(){var e=Bt;return Bt=!1,e}function Ht(e,t,n){if(zt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Ut(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Wt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Jt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yt(e){if(!e._valueTracker){var t=qt(e)?`checked`:`value`;e._valueTracker=Jt(e,t,``+e[t])}}function Xt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Zt=/[\n"\\]/g;function Qt(e){return e.replace(Zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function $t(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Kt(t)):e.value!==``+Kt(t)&&(e.value=``+Kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):tn(e,Kt(n)):o===`number`&&e.value==t?tn(e,Kt(e.value)):tn(e,Kt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Kt(s):e.removeAttribute(`name`)}function en(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Yt(e);return}n=n==null?``:``+Kt(n),t=t==null?n:``+Kt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Yt(e)}function tn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function nn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Kt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function rn(e,t,n){t!=null&&(t=``+Kt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Kt(n)}function an(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(de(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Yt(e)}function on(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sn=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 cn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||sn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function ln(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Bt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(cn(e,a,r),Bt=!0)}else for(var o in t)t.hasOwnProperty(o)&&cn(e,o,t[o])}function un(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 dn=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`],[`maskType`,`mask-type`],[`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`]]),fn=/^[\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 pn(e){return fn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function mn(){}var hn=null;function gn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _n=null,vn=null;function yn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;a:switch(e=t.stateNode,t.type){case`input`:if($t(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Qt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[_t]||null;if(!a)throw Error(i(90));$t(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Xt(r)}break a;case`textarea`:rn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&nn(e,!!n.multiple,t,!1)}}}var bn=!1;function xn(e,t,n){if(bn)return e(t,n);bn=!0;try{return e(t)}finally{if(bn=!1,(_n!==null||vn!==null)&&(Kd(),_n&&(t=_n,e=vn,vn=_n=null,yn(t),e)))for(t=0;t<e.length;t++)yn(e[t])}}function Sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[_t]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Cn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,wn=!1;if(Cn)try{var Tn={};Object.defineProperty(Tn,"passive",{get:function(){wn=!0}}),window.addEventListener(`test`,Tn,Tn),window.removeEventListener(`test`,Tn,Tn)}catch{wn=!1}var En=null,Dn=null,On=null;function kn(){if(On)return On;var e,t=Dn,n=t.length,r,i=`value`in En?En.value:En.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return On=i.slice(e,1<r?1-r:void 0)}function An(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function jn(){return!0}function Mn(){return!1}function Nn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?jn:Mn,this.isPropagationStopped=Mn,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=jn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=jn)},persist:function(){},isPersistent:jn}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fn=Nn(Pn),In=w({},Pn,{view:0,detail:0}),Ln=Nn(In),Rn,zn,Bn,Vn=w({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Bn&&(Bn&&e.type===`mousemove`?(Rn=e.screenX-Bn.screenX,zn=e.screenY-Bn.screenY):zn=Rn=0,Bn=e),Rn)},movementY:function(e){return`movementY`in e?e.movementY:zn}}),Hn=Nn(Vn),Un=Nn(w({},Vn,{dataTransfer:0})),Wn=Nn(w({},In,{relatedTarget:0})),Gn=Nn(w({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Kn=Nn(w({},Pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),qn=Nn(w({},Pn,{data:0})),Jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Yn={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`},Xn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xn[e])?!!t[e]:!1}function Qn(){return Zn}var $n=Nn(w({},In,{key:function(e){if(e.key){var t=Jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=An(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Yn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qn,charCode:function(e){return e.type===`keypress`?An(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?An(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),er=Nn(w({},Vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tr=Nn(w({},Pn,{submitter:0})),nr=Nn(w({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qn})),rr=Nn(w({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ir=Nn(w({},Vn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ar=Nn(w({},Pn,{newState:0,oldState:0,source:0})),or=[9,13,27,32],sr=Cn&&`CompositionEvent`in window,cr=null;Cn&&`documentMode`in document&&(cr=document.documentMode);var lr=Cn&&`TextEvent`in window&&!cr,ur=Cn&&(!sr||cr&&8<cr&&11>=cr),dr=` `,fr=!1;function pr(e,t){switch(e){case`keyup`:return or.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function mr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var hr=!1;function gr(e,t){switch(e){case`compositionend`:return mr(t);case`keypress`:return t.which===32?(fr=!0,dr):null;case`textInput`:return e=t.data,e===dr&&fr?null:e;default:return null}}function _r(e,t){if(hr)return e===`compositionend`||!sr&&pr(e,t)?(e=kn(),On=Dn=En=null,hr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return ur&&t.locale!==`ko`?null:t.data;default:return null}}var vr={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 yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){_n?vn?vn.push(r):vn=[r]:_n=r,t=rp(t,`onChange`),0<t.length&&(n=new Fn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Yf(e,0)}function wr(e){if(Xt(Ot(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(Cn){var Dr;if(Cn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,gn(e)),xn(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ne.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zr(e.document)}return t}function Wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Gr=Cn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jr&&Rr(Jr,r)||(Jr=r,r=rp(qr,`onSelect`),0<r.length&&(t=new Fn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};Cn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),Pt(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Dd.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Fd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ti(e){if(50<Id)throw Id=0,Ld=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ji(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ki(r)&&(s=1);else if(typeof r==`string`)s=ih(e,n,ye.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case F:return e=Oi(31,n,t,a),e.elementType=F,e.lanes=o,e;case O:return Ni(n.children,a,o,t);case k:s=8,a|=24;break;case A:return e=Oi(12,n,t,a|2),e.elementType=A,e.lanes=o,e;case ee:return e=Oi(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=Oi(19,n,t,a),e.elementType=te,e.lanes=o,e;case re:case ae:return e=a|32,e=Oi(30,n,t,e),e.elementType=ae,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case M:s=10;break a;case j:s=9;break a;case N:s=11;break a;case P:s=14;break a;case ne:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:Me(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:Me(t)}}var zi=[],Bi=0,Vi=null,Hi=0,Ui=[],Wi=0,Gi=null,Ki=1,qi=``;function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e,Hi=t}function Yi(e,t,n){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Gi=e;var r=Ki;e=qi;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ki=1<<32-Ye(t)+i|n<<i|r,qi=a+e}else Ki=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null;for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,qi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null}function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Ki=t.id,qi=t.overflow,Gi=e}var $i=null,ea=null,ta=!1,na=null,ra=!1,ia=Error(i(519));function aa(e){throw da(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ia}function oa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gt]=e,t[_t]=r,n){case`dialog`:Xf(`cancel`,t),Xf(`close`,t);break;case`iframe`:case`object`:case`embed`:Xf(`load`,t);break;case`video`:case`audio`:for(n=0;n<qf.length;n++)Xf(qf[n],t);break;case`source`:Xf(`error`,t);break;case`img`:case`image`:case`link`:Xf(`error`,t),Xf(`load`,t);break;case`details`:Xf(`toggle`,t);break;case`input`:Xf(`invalid`,t),en(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Xf(`invalid`,t);break;case`textarea`:Xf(`invalid`,t),an(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||lp(t.textContent,n)?(r.popover!=null&&(Xf(`beforetoggle`,t),Xf(`toggle`,t)),r.onScroll!=null&&Xf(`scroll`,t),r.onScrollEnd!=null&&Xf(`scrollend`,t),r.onClick!=null&&(t.onclick=mn),t=!0):t=!1,t||aa(e,!0)}function sa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:$i=$i.return}}function ca(e){if(e!==$i)return!1;if(!ta)return sa(e),ta=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||wp(e.type,e.memoizedProps)),n=!n),n&&ea&&aa(e),sa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=Sm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=Sm(e)}else t===27?(t=ea,Np(e.type)?(e=xm,xm=null,ea=e):ea=t):ea=$i?bm(e.stateNode.nextSibling):null;return!0}function la(){ea=$i=null,ta=!1}function ua(){var e=na;return e!==null&&(yd===null?yd=e:yd.push.apply(yd,e),na=null),e}function da(e){na===null?na=[e]:na.push(e)}var fa=_e(null),pa=null,ma=null;function ha(e,t,n){I(fa,t._currentValue),t._currentValue=n}function ga(e){e._currentValue=fa.current,ve(fa)}function _a(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function va(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),_a(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),_a(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),_a(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ya(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[vh]:e.push(vh))}a=a.return}return e!==null&&va(t,e,n,r),t.flags|=262144,e!==null}function ba(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xa(e){pa=e,ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sa(e){return wa(pa,e)}function Ca(e,t){return pa===null&&xa(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ma===null){if(e===null)throw Error(i(308));ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ma=ma.next=t;return n}var Ta=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ea=t.unstable_scheduleCallback,Da=t.unstable_NormalPriority,Oa={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ka(){return{controller:new Ta,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ea(Da,function(){e.controller.abort()})}function ja(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ma=null;function Na(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pa=null,Fa=0,Ia=0,La=null;function Ra(e,t){if(Pa===null){var n=Pa=[];Fa=0,Ia=Hf(),La={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Fa++,t.then(za,za),t}function za(){if(--Fa===0&&(Ma=null,Pa!==null)){La!==null&&(La.status=`fulfilled`);var e=Pa;Pa=null,Ia=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ba(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Va=fe.S;fe.S=function(e,t){if(Sd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=Of;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=Of;r!==null;)ja(r,n),r=r.next;if(Ia!==0){r=Ma,r===null&&(r=Ma=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Va!==null&&Va(e,t)};var Ha=_e(null);function Ua(){var e=Ha.current;return e===null?rd.pooledCache:e}function Wa(e,t){t===null?I(Ha,Ha.current):I(Ha,t.pool)}function Ga(){var e=Ua();return e===null?null:{parent:Oa._currentValue,pool:e}}var Ka=Error(i(460)),qa=Error(i(474)),Ja=Error(i(542)),Ya={then:function(){}};function Xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Za(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(mn,mn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(mn,mn);else{if(e=rd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e}throw $a=t,Ka}}function Qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?($a=e,Ka):e}}var $a=null;function eo(){if($a===null)throw Error(i(459));var e=$a;return $a=null,e}function to(e){if(e===Ka||e===Ja)throw Error(i(483))}var no=null,ro=0;function io(e){var t=ro;return ro+=1,no===null&&(no=[]),Za(no,e,t)}function ao(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function oo(e,t){throw t.$$typeof===T?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function so(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===O?(e=d(e,t,n.props.children,r,n.key),ao(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ne&&Qa(i)===t.type)?(t=a(t,n.props),ao(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),ao(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ii(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case E:return n=Mi(t.type,t.key,t.props,null,e.mode,n),ao(n,t),n.return=e,n;case D:return t=Ii(t,e.mode,n),t.return=e,t;case ne:return t=Qa(t),f(e,t,n)}if(de(t)||ce(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,io(t),n);if(t.$$typeof===M)return f(e,Ca(e,t),n);oo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case E:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case ne:return n=Qa(n),p(e,t,n,r)}if(de(n)||ce(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,io(n),r);if(n.$$typeof===M)return p(e,t,Ca(e,n),r);oo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case E:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:return r=Qa(r),m(e,t,n,r,i)}if(de(r)||ce(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,io(r),i);if(r.$$typeof===M)return m(e,t,n,Ca(t,r),i);oo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ta&&Ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ta&&Ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ta&&Ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ta&&Ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ta&&Ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ta&&Ji(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),ao(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ne&&Qa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ao(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Ni(o.props.children,e.mode,c,o.key),ao(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),ao(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case ne:return o=Qa(o),_(e,r,o,c)}if(de(o))return h(e,r,o,c);if(ce(o)){if(l=ce(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,io(o),c);if(o.$$typeof===M)return _(e,r,Ca(e,o),c);oo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ro=0;var i=_(e,t,n,r);return no=null,i}catch(t){if(t===Ka||t===Ja)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var co=so(!0),lo=so(!1),uo=!1;function fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function po(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function mo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ho(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,nd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function go(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}function _o(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var vo=!1;function yo(){if(vo){var e=La;if(e!==null)throw e}}function bo(e,t,n,r){vo=!1;var i=e.updateQueue;uo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(ad&f)===f:(r&f)===f){f!==0&&f===Ia&&(vo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=w({},d,f);break a;case 2:uo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),pd|=o,e.lanes=o,e.memoizedState=d}}function xo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function So(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)xo(n[e],t)}var Co=_e(null),wo=_e(0);function To(e,t){e=dd,I(wo,e),I(Co,t),dd=e|t.baseLanes}function Eo(){I(wo,dd),I(Co,Co.current)}function Do(){dd=wo.current,ve(Co),ve(wo)}var Oo=_e(null),ko=null;function Ao(e){var t=e.alternate;I(Fo,Fo.current&1),I(Oo,e),ko===null&&(t===null||Co.current!==null||t.memoizedState!==null)&&(ko=e)}function jo(e){I(Fo,Fo.current),I(Oo,e),ko===null&&(ko=e)}function Mo(e){e.tag===22?(I(Fo,Fo.current),I(Oo,e),ko===null&&(ko=e)):No()}function No(){I(Fo,Fo.current),I(Oo,Oo.current)}function Po(e){ve(Oo),ko===e&&(ko=null),ve(Fo)}var Fo=_e(0);function Io(e,t){I(Oo,Oo.current),I(Fo,t)}function Lo(e){ve(Fo),ve(Oo),ko===e&&(ko=null)}function Ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_m(n)||vm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zo=0,Bo=null,Vo=null,Ho=null,Uo=!1,Wo=!1,Go=!1,Ko=0,qo=0,Jo=null,Yo=0;function Xo(){throw Error(i(321))}function Zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Qo(e,t,n,r,i,a){return zo=a,Bo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fe.H=e===null||e.memoizedState===null?hc:gc,Go=!1,a=n(r,i),Go=!1,Wo&&(a=es(t,n,r,i)),$o(e),a}function $o(e){fe.H=mc;var t=Vo!==null&&Vo.next!==null;if(zo=0,Ho=Vo=Bo=null,Uo=!1,qo=0,Jo=null,t)throw Error(i(300));e===null||Nc||(e=e.dependencies,e!==null&&ba(e)&&(Nc=!0))}function es(e,t,n,r){Bo=e;var a=0;do{if(Wo&&(Jo=null),qo=0,Wo=!1,25<=a)throw Error(i(301));if(a+=1,Ho=Vo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}fe.H=_c,o=t(n,r)}while(Wo);return o}function ts(){var e=fe.H,t=e.useState()[0];return t=typeof t.then==`function`?cs(t):t,e=e.useState()[0],(Vo===null?null:Vo.memoizedState)!==e&&(Bo.flags|=1024),t}function ns(){var e=Ko!==0;return Ko=0,e}function rs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function is(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}zo=0,Ho=Vo=Bo=null,Wo=!1,qo=Ko=0,Jo=null}function as(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function os(){if(Vo===null){var e=Bo.alternate;e=e===null?null:e.memoizedState}else e=Vo.next;var t=Ho===null?Bo.memoizedState:Ho.next;if(t!==null)Ho=t,Vo=e;else{if(e===null)throw Bo.alternate===null?Error(i(467)):Error(i(310));Vo=e,e={memoizedState:Vo.memoizedState,baseState:Vo.baseState,baseQueue:Vo.baseQueue,queue:Vo.queue,next:null},Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cs(e){var t=qo;return qo+=1,Jo===null&&(Jo=[]),e=Za(Jo,e,t),t=Bo,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,fe.H=t===null||t.memoizedState===null?hc:gc),e}function ls(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return cs(e);if(e.$$typeof===oe)return;if(e.$$typeof===M)return Sa(e)}throw Error(i(438,String(e)))}function us(e){var t=null,n=Bo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Bo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ss(),Bo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ie;return t.index++,n}function ds(e,t){return typeof t==`function`?t(e):t}function fs(e){return ps(os(),Vo,e)}function ps(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(zo&f)===f:(ad&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ia&&(d=!0);else if((zo&p)===p){u=u.next,p===Ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Bo.lanes|=p,pd|=p;f=u.action,Go&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Bo.lanes|=f,pd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(Nc=!0,d&&(n=La,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ms(e){var t=os(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Lr(o,t.memoizedState)||(Nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function hs(e,t,n){var r=Bo,a=os(),o=ta;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((Vo||a).memoizedState,n);if(s&&(a.memoizedState=n,Nc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},_s.bind(null,r,a,n,t),null),e){if(r.flags|=2048,rd===null)throw Error(i(349));o||zo&127||gs(r,t,n)}return n}function gs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Bo.updateQueue,t===null?(t=ss(),Bo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _s(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function bs(e){var t=Ci(e,2);t!==null&&Vd(t,e,2)}function xs(e){var t=as();if(typeof e==`function`){var n=e;if(e=n(),Go){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ps(e,Vo,typeof r==`function`?r:ds)}function Cs(e,t,n,r,a){if(dc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};fe.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=fe.T,o={};o.types=a===null?null:a.types,fe.T=o;try{var s=n(i,r),c=fe.S;c!==null&&c(o,s),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),fe.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(ta){var n=rd.formState;if(n!==null){a:{var r=Bo;if(ta){if(ea){b:{for(var i=ea,a=ra;i.nodeType!==8;)if(!a||(i=bm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=bm(i.nextSibling),r=i.data===`F!`;break a}}aa(r)}r=!1}r&&(t=n[0])}}return n=as(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,Bo,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,Bo,!1,r.queue),r=as(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,Bo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(os(),Vo,e)}function Ms(e,t,n){if(t=ps(e,t,ks)[0],e=fs(ds)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=cs(t)}catch(e){throw e===Ka?Ja:e}else r=t;t=os();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Bo.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=os(),n=Vo;if(n!==null)return Ms(t,n,e);os(),t=t.memoizedState,n=os();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Bo.updateQueue,t===null&&(t=ss(),Bo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Is(){return os().memoizedState}function Ls(e,t,n,r){var i=as();Bo.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=os();r=r===void 0?null:r;var a=i.memoizedState.inst;Vo!==null&&r!==null&&Zo(r,Vo.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(Bo.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){Bo.flags|=4;var t=Bo.updateQueue;if(t===null)t=ss(),Bo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=os().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(nd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zo(t,r[1]))return r[0];if(r=e(),Go){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||zo&1073741824&&!(ad&261930)?e.memoizedState=t:(e.memoizedState=n,e=zd(),Bo.lanes|=e,pd|=e,n)}function Zs(e,t,n,r){return Lr(n,t)?n:Co.current===null?!(zo&106)||zo&1073741824&&!(ad&261930)?(Nc=!0,e.memoizedState=n):(e=zd(),Bo.lanes|=e,pd|=e,t):(e=Xs(e,n,r),Lr(e,t)||(Nc=!0),e)}function Qs(e,t,n,r,i){var a=pe.p;pe.p=a!==0&&8>a?a:8;var o=fe.T,s={};s.types=o===null?null:o.types,fe.T=s,uc(e,!1,t,n);try{var c=i(),l=fe.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Ba(c,r),Rd(e)):lc(e,t,r,Rd(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Rd())}finally{pe.p=a,o!==null&&s.types!==null&&(o.types=s.types),fe.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,me,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:me},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Rd())}function rc(){return Sa(vh)}function ic(){return os().memoizedState}function ac(){return os().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Rd();e=mo(n);var r=ho(t,e,n);r!==null&&(Vd(r,t,n),go(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Rd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=Si(e,t,n,r),n!==null&&(Vd(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Rd())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Lr(s,o))return xi(e,t,i,0),rd===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return Vd(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:Hf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&Vd(t,e,2)}function dc(e){var t=e.alternate;return e===Bo||t!==null&&t===Bo}function fc(e,t){Wo=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}var mc={readContext:Sa,use:ls,useCallback:Xo,useContext:Xo,useEffect:Xo,useImperativeHandle:Xo,useLayoutEffect:Xo,useInsertionEffect:Xo,useMemo:Xo,useReducer:Xo,useRef:Xo,useState:Xo,useDebugValue:Xo,useDeferredValue:Xo,useTransition:Xo,useSyncExternalStore:Xo,useId:Xo,useHostTransitionStatus:Xo,useFormState:Xo,useActionState:Xo,useOptimistic:Xo,useMemoCache:Xo,useCacheRefresh:Xo,useEffectEvent:Xo},hc={readContext:Sa,use:ls,useCallback:function(e,t){return as().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=as();t=t===void 0?null:t;var r=e();if(Go){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=as();if(n!==void 0){var i=n(t);if(Go){Je(!0);try{n(t)}finally{Je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=sc.bind(null,Bo,e),[r.memoizedState,e]},useRef:function(e){var t=as();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,Bo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(as(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,Bo,e.queue,!0,!1),as().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Bo,a=as();if(ta){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),rd===null)throw Error(i(349));ad&127||gs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},_s.bind(null,r,o,n,t),null),n},useId:function(){var e=as(),t=rd.identifierPrefix;if(ta){var n=qi,r=Ki;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ko++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=as();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,Bo,!0,n),n.dispatch=t,[e,t]},useMemoCache:us,useCacheRefresh:function(){return as().memoizedState=oc.bind(null,Bo)},useEffectEvent:function(e){var t=as(),n={impl:e};return t.memoizedState=n,function(){if(nd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:Sa,use:ls,useCallback:Js,useContext:Sa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:fs,useRef:Is,useState:function(){return fs(ds)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(os(),Vo.memoizedState,e,t)},useTransition:function(){var e=fs(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(os(),Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:Sa,use:ls,useCallback:Js,useContext:Sa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ms,useRef:Is,useState:function(){return ms(ds)},useDebugValue:qs,useDeferredValue:function(e,t){var n=os();return Vo===null?Xs(n,e,t):Zs(n,Vo.memoizedState,e,t)},useTransition:function(){var e=ms(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=os();return Vo===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs};function vc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:w({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=mo(r);i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Vd(t,e,r),go(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rd(),i=mo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Vd(t,e,r),go(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rd(),r=mo(n);r.tag=2,t!=null&&(r.callback=t),t=ho(e,r,n),t!==null&&(Vd(t,e,n),go(t,e,n))}};function bc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(i,a):!0}function xc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&yc.enqueueReplaceState(t,t.state,null)}function Sc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=w({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Cc(e){gi(e)}function wc(e){console.error(e)}function Tc(e){gi(e)}function Ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){return n=mo(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=mo(e),e.tag=3,e}function Ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(Td===null?Td=new Set([this]):Td.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ya(t,n,a,!0),n=Oo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ko===null?$d():n.alternate===null&&fd===0&&(fd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Sf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Sf(e,r,a)),!1}throw Error(i(435,n.tag))}return Sf(e,r,a),$d(),!1}if(ta)return t=Oo.current,t===null?(r!==ia&&(t=Error(i(423),{cause:r}),da(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=Oc(e.stateNode,r,a),_o(e,a),fd!==4&&(fd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ia&&(e=Error(i(422),{cause:r}),da(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),vd===null?vd=[o]:vd.push(o),fd!==4&&(fd=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,r,e),_o(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Td===null||!Td.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=kc(a),Ac(a,e,n,r),_o(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(i(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?lo(t,null,n,r):co(t,e.child,n,r)}function Fc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return xa(t),r=Qo(e,t,n,o,a,i),s=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(ta&&s&&Xi(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,a===null?null:a.cachePool),a===null?Eo():To(t,a),Mo(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Wa(t,null),Eo(),No()):(Wa(t,a.cachePool),To(t,a),No(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=Ua();return a=a===null?null:{parent:Oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Wa(t,null),Eo(),Mo(t),e!==null&&ya(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return co(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Po(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ta){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(jo(t),(e=ea)?(e=gm(e,ra),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=536870912,null}return Vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(jo(t),a){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Nc||ya(e,t,n,!1),a=(n&e.childLanes)!==0,Nc||a){if(Co.current===null){if(r=rd,r!==null&&(s=ut(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),Vd(r,e,s),Mc;$d()}t=Hc(e,t,n)}else e=o.treeContext,ea=bm(s.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=Vc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Gc(e,t,n,r,i){return xa(t),n=Qo(e,t,n,r,void 0,i),r=ns(),e!==null&&!Nc?(rs(e,t,i),ll(e,t,i)):(ta&&r&&Xi(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return xa(t),t.updateQueue=null,n=es(t,r,n,i),$o(e),r=ns(),e!==null&&!Nc?(rs(e,t,a),ll(e,t,a)):(ta&&r&&Xi(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(xa(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=Sa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},fo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&yc.enqueueReplaceState(a,a.state,null),bo(t,r,a,i),yo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=Sa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&xc(t,a,r,o),uo=!1;var f=t.memoizedState;a.state=f,bo(t,r,a,i),yo(),l=t.memoizedState,s||f!==l||uo?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=uo||bc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,po(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=Sa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&xc(t,a,r,c),uo=!1,f=t.memoizedState,a.state=f,bo(t,r,a,i),yo();var p=t.memoizedState;o!==d||f!==p||uo||e!==null&&e.dependencies!==null&&ba(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=uo||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ba(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Wc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=co(t,e.child,null,i),t.child=co(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return la(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ga()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=gd),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Fo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ta){if(i?Ao(t):No(),(e=ea)?(e=gm(e,ra),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=vm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(No(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(Ao(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(No(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ga():(s=Oa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(Ao(t),n=e.child,e=n.sibling,n=Ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return co(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Ao(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(No(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,co(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,a)):(No(),t.child=e.child,t.flags|=128,null);if(Ao(t),vm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,da({value:a,source:null,stack:null})),tl(e,t,c)}if(Nc||ya(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(Co.current!==null)return tl(e,t,c);if(r=rd,r!==null&&(a=ut(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),Vd(r,e,a),Mc;return _m(o)||$d(),tl(e,t,c)}return _m(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=bm(o.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=$c(t,a.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_a(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ro(n)===null&&(t=e),e=e.sibling}return t}function al(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ol(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Fo.current;if(t.flags&128)return Io(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Io(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=ta?Hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return ha(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ya(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ba(e)))}function dl(e,t,n){switch(t.tag){case 3:Ce(t,t.stateNode.containerInfo),ha(t,Oa,e.memoizedState.cache),la();break;case 27:case 5:Te(t);break;case 4:Ce(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,jo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ao(t),t.flags|=128,null;r=ya(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(Ao(t),e=ll(e,t,n),e===null?null:e.sibling)}Ao(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ya(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Io(t,Fo.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:ha(t,Oa,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Nc=!1,dl(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,ta&&t.flags&1048576&&Yi(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Qa(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===N){t.tag=11,t=Fc(null,t,e,r,n);break a}if(a===P){t.tag=14,t=Ic(null,t,e,r,n);break a}if(a===M){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=ue(e)||e,Error(i(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Sc(r,t.pendingProps),qc(e,t,r,a,n);case 3:a:{if(Ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,po(e,t),bo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ha(t,Oa,r),r!==o.cache&&va(t,[Oa],n,!0),yo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Jc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),da(a),t=Jc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ea=bm(e.firstChild),$i=t,ta=!0,na=null,ra=!0,n=lo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(la(),r===a){t=ll(e,t,n);break a}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Wm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ta||(t.stateNode=Cp(t.type,t.pendingProps,xe.current,t)):t.memoizedState=Wm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Te(t),e===null&&ta&&(r=t.stateNode=Em(t.type,t.pendingProps,xe.current),$i=t,ra=!0,a=ea,Np(t.type)?(xm=a,ea=bm(r.firstChild)):ea=a),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ta&&((a=r=ea)&&(r=mm(r,t.type,t.pendingProps,ra),r===null?a=!1:(t.stateNode=r,$i=t,ea=bm(r.firstChild),ra=!1,a=!0)),a||aa(t)),Te(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,wp(a,o)?r=null:s!==null&&wp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Qo(e,t,ts,null,null,n),vh._currentValue=a),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&ta&&((e=n=ea)&&(n=hm(n,t.pendingProps,ra),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||aa(t)),null;case 13:return Qc(e,t,n);case 4:return Ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:return Pc(e,t,t.pendingProps.children,n),t.child;case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,xa(t),a=Sa(a),r=r(a),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return xa(t),r=Sa(Oa),e===null?(a=Ua(),a===null&&(a=rd,o=ka(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},fo(t),ha(t,Oa,a)):((e.lanes&n)!==0&&(po(e,t),bo(t,null,null,n),yo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ha(t,Oa,r),r!==a.cache&&va(t,[Oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ha(t,Oa,r))),Pc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ta&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function pl(e){e.flags|=4}function ml(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ah(t,r):ah(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Xd())e.flags|=8192;else throw $a=Ya,qa}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!oh(t)){if(Xd())e.flags|=8192;else throw $a=Ya,qa}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:V(),e.lanes|=t,_d|=t)}function _l(e,t){if(!ta)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function vl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function yl(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vl(t),null;case 1:return vl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ga(Oa),we(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ca(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ua())),vl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(pl(t),o===null?(vl(t),ml(t,a,null,r,n)):(vl(t),hl(t,o))):o?o===e.memoizedState?(vl(t),t.flags&=-16777217):(pl(t),vl(t),hl(t,o)):(e=e.memoizedProps,e!==r&&pl(t),vl(t),ml(t,a,e,r,n)),null;case 27:if(Ee(t),n=xe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}e=ye.current,ca(t)?oa(t,e):(e=Em(a,r,n),t.stateNode=e,pl(t))}return vl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ee(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}if(o=ye.current,ca(t))oa(t,o);else{var s=yp(xe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[gt]=t,o[_t]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(fp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&pl(t)}}return vl(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=xe.current,ca(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=$i,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||lp(e.nodeValue,n)),e||aa(t,!0)}else e=yp(e).createTextNode(r),e[gt]=t,t.stateNode=e}return vl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ca(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[gt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),e=!1}else n=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Po(t),t):(Po(t),null);if(t.flags&128)throw Error(i(558))}return vl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ca(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[gt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),a=!1}else a=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Po(t),t):(Po(t),null)}return Po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gl(t,t.updateQueue),vl(t),null);case 4:return we(),e===null&&$f(t.stateNode.containerInfo),t.flags|=67108864,vl(t),null;case 10:return ga(t.type),vl(t),null;case 19:if(Lo(t),r=t.memoizedState,r===null)return vl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)_l(r,!1);else{if(fd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ro(e),o!==null){for(t.flags|=128,_l(r,!1),e=o.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return Io(t,Fo.current&1|2),ta&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>Cd&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ta)return vl(t),null}else 2*Le()-r.renderingStartTime>Cd&&n!==536870912&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,o=Fo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ta?Io(t,o):(n=o,I(Oo,t),I(Fo,n),ko===null&&(ko=t)),ta&&Ji(t,r.treeForkCount),e}return vl(t),null;case 22:case 23:return Po(t),Do(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vl(t),t.subtreeFlags&6&&(t.flags|=8192)):vl(t),n=t.updateQueue,n!==null&&gl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ve(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ga(Oa),vl(t),null;case 25:return null;case 30:return t.flags|=33554432,vl(t),null}throw Error(i(156,t.tag))}function bl(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Oa),we(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ee(t),null;case 31:if(t.memoizedState!==null){if(Po(t),t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return we(),null;case 10:return ga(t.type),null;case 22:case 23:return Po(t),Do(),e!==null&&ve(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Oa),null;case 25:return null;default:return null}}function xl(e,t){switch(Zi(t),t.tag){case 3:ga(Oa),we();break;case 26:case 27:case 5:Ee(t);break;case 4:we();break;case 31:t.memoizedState!==null&&Po(t);break;case 13:Po(t);break;case 19:Lo(t);break;case 10:ga(t.type);break;case 22:case 23:Po(t),Do(),e!==null&&ve(Ha);break;case 24:ga(Oa)}}function Sl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){xf(t,t.return,e)}}function Cl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){xf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){xf(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{So(t,n)}catch(t){xf(e,e.return,t)}}}function Tl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){xf(e,t,n)}}function El(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Gp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Kp(e);f(e.child,!1,lm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){xf(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){xf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){xf(e,t,n)}else n.current=null}}function Ol(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)dm(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&dm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&fm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){xf(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;mp(r,e.type,n,t),r[_t]=t}catch(t){xf(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Np(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Np(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mn)),Ol(e,r),Bt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Np(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),Bt=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Np(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);fp(t,r,n),t[gt]=e,t[_t]=n}catch(t){xf(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=zp(o);r.push(s),s.view&&(a=!0)}else a||zp(o).view&&(a=!0);Bl=!0,Ip(o,Gl===0?t:t+`_`+Gl,n),Gl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Lp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Jl(e.child,t),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=hi(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Bd(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=hi(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Bd(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Bd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Bd(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=zp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Ip(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Bp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Bd(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,ou=!1,su=!1,cu=!1,lu=typeof WeakSet==`function`?WeakSet:Set,uu=null,du=!1,fu=!1,pu=!1,mu=!1;function hu(e,t,n){if(e=e.containerInfo,_p=Dh,e=Ur(e),Wr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(vp={focusedElem:e,selectionRange:r},Dh=!1,n=(n&335544064)===n,uu=t,t=n?9270:1024;uu!==null;){if(e=uu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),gu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),gu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),gu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,uu=r):(n&&$l(e),gu(n))}}Vl=null}function gu(e){for(;uu!==null;){var t=uu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Sc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){xf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)pm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:pm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=pi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=hi(a.default,a.update),a!==`none`&&Kl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,uu=r;break}uu=t.return}}function _u(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Lu(e,n),r&4&&Sl(5,n);break;case 1:if(Lu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){xf(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){xf(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Lu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{So(e,t)}catch(e){xf(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Lu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Lu(e,n);break;case 31:Lu(e,n),r&4&&Eu(e,n);break;case 13:Lu(e,n),r&4&&Du(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Tf.bind(null,n),ym(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||ou;t=au,i=ou,au=r,(ou=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),zu(e,n,r)):Lu(e,n),au=t,ou=i}break;case 30:Lu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Lu(e,n)}}function vu(e,t){for(e=e.child;e!==null;)yu(e,t),e=e.sibling}function yu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){xf(e,e.return,t)}bu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Bt=!0}catch(t){xf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Fp(s,!0):Fp(e.stateNode,!1)}catch(t){xf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&vu(e,t);break;default:vu(e,t)}}function bu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:yu(n,r);break a;case 22:n.memoizedState===null&&bu(n,r);break a;default:bu(n,r)}}e=e.sibling}}function xu(e){var t=e.alternate;t!==null&&(e.alternate=null,xu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Su=null,Cu=!1;function wu(e,t,n){for(n=n.child;n!==null;)Tu(e,t,n),n=n.sibling}function Tu(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:ou||Dl(n,t),wu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ou&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ou||Dl(n,t),Al(n);var r=Su,i=Cu;Np(n.type)&&(Su=n.stateNode,Cu=!1),wu(e,t,n),Dm(n.stateNode,n.type,n.memoizedProps),Su=r,Cu=i;break;case 5:ou||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=Su,i=Cu,Su=null,wu(e,t,n),Su=r,Cu=i,Su!==null){if(Cu)try{(Su.nodeType===9?Su.body:Su.nodeName===`HTML`?Su.ownerDocument.body:Su).removeChild(n.stateNode),Bt=!0}catch(e){xf(n,t,e)}else try{Su.removeChild(n.stateNode),Bt=!0}catch(e){xf(n,t,e)}}break;case 18:Su!==null&&(Cu?(e=Su,Pp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),$h(e)):Pp(Su,n.stateNode));break;case 4:r=Su,i=Cu,Su=n.stateNode.containerInfo,Cu=!0,wu(e,t,n),Su=r,Cu=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),ou||Cl(4,n,t),wu(e,t,n);break;case 1:ou||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),wu(e,t,n);break;case 21:wu(e,t,n);break;case 22:ou=(r=ou)||n.memoizedState!==null,wu(e,t,n),ou=r;break;case 30:Dl(n,t),wu(e,t,n);break;case 7:ou||Dl(n,t),wu(e,t,n);break;default:wu(e,t,n)}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{$h(e)}catch(e){xf(t,t.return,e)}}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{$h(e)}catch(e){xf(t,t.return,e)}}function Ou(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new lu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new lu),t;default:throw Error(i(435,e.tag))}}function ku(e,t){var n=Ou(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ef.bind(null,e,t);t.then(r,r)}})}function Au(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Np(l.type)){Su=l.stateNode,Cu=!1;break a}break;case 5:Su=l.stateNode,Cu=!1;break a;case 3:case 4:Su=l.stateNode.containerInfo,Cu=!0;break a}l=l.return}if(Su===null)throw Error(i(160));Tu(s,c,o),Su=null,Cu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Mu(t,e,n),t=t.sibling}var ju=null;function Mu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Au(t,e,n),Nu(e),a&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),a&64&&au&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ju,Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(au)e.stateNode=Cp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Ct]||r[gt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),fp(r,t,n),r[gt]=e,At(r),t=r;break a;case`link`:if(o=nh(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=nh(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[gt]=e,At(r),t=r}e.stateNode=t}}else au||rh(o,e.type,e.stateNode)}else e.stateNode=Zm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ou||t.parentNode.removeChild(t)):a.count--,n===null?au||rh(o,e.type,e.stateNode):Zm(o,n,e.memoizedProps))}break;case 27:Au(t,e,n),Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),r!==null&&a&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=su,su=!1,Au(t,e,n),su=o,Nu(e),a&512&&(ou||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{on(t,``),Bt=!0}catch(t){xf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),a&1024&&(cu=!0);break;case 6:if(Au(t,e,n),Nu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Bt=!0}catch(t){xf(e,e.return,t)}}break;case 3:if(Bt=!1,th=null,o=ju,ju=jm(t.containerInfo),Au(t,e,n),ju=o,Nu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{$h(t.containerInfo)}catch(t){xf(e,e.return,t)}cu&&(cu=!1,Pu(e)),Bt=!1;break;case 4:a=su,su=au,r=Vt(),o=ju,ju=jm(e.stateNode.containerInfo),Au(t,e,n),Nu(e),ju=o,Bt&&fu&&(pu=!0),Bt=r,su=a;break;case 12:Au(t,e,n),Nu(e);break;case 31:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 13:Au(t,e,n),Nu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(xd=Le()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=ou,u=su;au=c||o,su=u||o,ou=l||s,Au(t,e,n),ou=l,su=u,au=c,Nu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||ou||(t=s||ou,n=au,r=ou,au=o||au,ou=t,Ru(e,2),au=n,ou=r),!o&&su||vu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ku(e,n))));break;case 19:Au(t,e,n),Nu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ku(e,t)));break;case 30:a&512&&(ou||r===null||Dl(r,r.return)),a=Vt(),o=fu,s=(n&335544064)===n,c=e.memoizedProps,fu=s&&hi(c.default,c.update)!==`none`,Au(t,e,n),Nu(e),s&&r!==null&&Bt&&(e.flags|=4),fu=o,Bt=a;break;case 21:break;case 7:a&512&&(ou||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Au(t,e,n),Nu(e)}}function Nu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ml(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(jl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(on(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(i(161))}}catch(t){xf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Dh=!0,t.reset(),Dh=!1),e=e.sibling}}function Fu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Iu(t,e),t=t.sibling;else iu(t,!1)}function Iu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(mu=du=!1,Wl(),Fu(t,e),!du&&!pu){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Lp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),mu=!0}Ul=null;break;case 5:Fu(t,e);break;case 4:r=du,du=!1,Fu(t,e),du&&(pu=!0),du=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Fu(t,e):Xl(e,!1));break;case 30:r=du,i=Wl(),du=!1,Fu(t,e),du&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Bd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),du=e.flags&32?!0:r;break;default:Fu(t,e)}}function Lu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_u(e,t.alternate,t),t=t.sibling}function Ru(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Ru(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Ru(n,r);break;case 27:r&2&&Dm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Ru(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ou||i.parentNode.removeChild(i),Ru(n,r);break;case 22:n.memoizedState===null&&Ru(n,r);break;case 30:Dl(n,n.return),Ru(n,r);break;case 7:Dl(n,n.return);default:Ru(n,r)}e=e.sibling}}function zu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:zu(i,a,n),Sl(4,a);break;case 1:if(zu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){xf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)xo(l[i],c)}catch(e){xf(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),zu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||rh(jm(c.ownerDocument),a.type,c),zu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:zu(i,a,n);break;case 31:zu(i,a,n),s&&o&4&&Eu(i,a);break;case 13:zu(i,a,n),s&&o&4&&Du(i,a);break;case 22:a.memoizedState===null&&zu(i,a,n),El(a,a.return);break;case 30:zu(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:zu(i,a,n)}t=t.sibling}}function Bu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Aa(n))}function Vu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Hu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Uu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Uu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Hu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Hu(e,t,n,r);break;case 3:Hu(e,t,n,r),i&&mu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Aa(a)));break;case 12:if(a&2048){Hu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){xf(t,t.return,e)}}else Hu(e,t,n,r);break;case 31:Hu(e,t,n,r);break;case 13:Hu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&tu(t),o._visibility&2?Hu(e,t,n,r):(o._visibility|=2,Wu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Hu(e,t,n,r):Gu(e,t)),a&2048&&Bu(s,t);break;case 24:Hu(e,t,n,r),a&2048&&Vu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Hu(e,t,n,r);break;default:Hu(e,t,n,r)}}function Wu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Wu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Wu(a,o,s,c,i)):u._visibility&2?Wu(a,o,s,c,i):Gu(a,o),i&&l&2048&&Bu(o.alternate,o);break;case 24:Wu(a,o,s,c,i),i&&l&2048&&Vu(o.alternate,o);break;default:Wu(a,o,s,c,i)}t=t.sibling}}function Gu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Gu(n,r),i&2048&&Bu(r.alternate,r);break;case 24:Gu(n,r),i&2048&&Vu(r.alternate,r);break;default:Gu(n,r)}t=t.sibling}}var Ku=8192;function qu(e,t,n){if(e.subtreeFlags&Ku)for(e=e.child;e!==null;)Ju(e,t,n),e=e.sibling}function Ju(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&Ku&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ch(n,e)):lh(n,ju,e.memoizedState,e.memoizedProps));break;case 5:qu(e,t,n),e.flags&Ku&&(e=e.stateNode,(t&335544128)===t&&ch(n,e));break;case 3:case 4:var r=ju;ju=jm(e.stateNode.containerInfo),qu(e,t,n),ju=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ku,Ku=16777216,qu(e,t,n),Ku=r):qu(e,t,n));break;case 30:if((e.flags&Ku)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}qu(e,t,n);break;default:qu(e,t,n)}}function Yu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zu(e),e=e.sibling}function Zu(e){switch(e.tag){case 0:case 11:case 15:Xu(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Xu(e);break;case 12:Xu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qu(e)):Xu(e);break;default:Xu(e)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];uu=r,$u(r,e)}Yu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Qu(t));break;default:Qu(t)}e=e.sibling}}function $u(e,t){for(;uu!==null;){var n=uu;switch(n.tag){case 0:case 11:case 15:Cl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,uu=r;else a:for(n=e;uu!==null;){r=uu;var i=r.sibling,a=r.return;if(xu(r),r===n){uu=null;break a}if(i!==null){i.return=a,uu=i;break a}uu=a}}}var ed={getCacheForType:function(e){var t=Sa(Oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Sa(Oa).controller.signal}},td=typeof WeakMap==`function`?WeakMap:Map,nd=0,rd=null,id=null,ad=0,od=0,sd=null,cd=!1,ld=!1,ud=!1,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=0,vd=null,yd=null,bd=!1,xd=0,Sd=0,Cd=1/0,wd=null,Td=null,Ed=0,Dd=null,Od=null,kd=0,Ad=0,jd=null,Md=null,Nd=null,Pd=null,Fd=null,Id=0,Ld=null;function Rd(){return nd&2&&ad!==0?ad&-ad:fe.T===null?pt():Hf()}function zd(){if(gd===0){if(!(ad&536870912)||ta){var e=et;et<<=1,!(et&3932160)&&(et=262144),gd=e}else gd=536870912}return e=Oo.current,e!==null&&(e.flags|=32),gd}function Bd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Gp(pi(e.memoizedProps,n))),Pd===null&&(Pd=[]),Pd.push(t.bind(null,r))}}function Vd(e,t,n){(e===rd&&(od===2||od===9)||e.cancelPendingCommit!==null)&&(Jd(e,0),Gd(e,ad,gd,!1)),H(e,n),nd&2&&e===rd||(e===rd&&(!(nd&2)&&(md|=n),fd===4&&Gd(e,ad,gd,!1)),Pf(e))}function Hd(e,t,n){if(nd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||B(e,t),a=r?nf(e,t):ef(e,t,!0),o=r;do{if(a===0){ld&&!r&&Gd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Wd(n))a=ef(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=vd;var l=c.current.memoizedState.isDehydrated;if(l&&(Jd(c,s).flags|=256),s=ef(c,s,!1),s!==2&&s!==6){if(ud&&!l){c.errorRecoveryDisabledLanes|=o,md|=o,a=4;break a}o=yd,yd=a,o!==null&&(yd===null?yd=o:yd.push.apply(yd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Jd(e,0),Gd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Gd(r,t,gd,!cd);break a;case 2:yd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=xd+300-Le(),10<a)){if(Gd(r,t,gd,!cd),nt(r,0,!0)!==0)break a;kd=t,r.timeoutHandle=Dp(Ud.bind(null,r,n,yd,wd,bd,t,gd,md,_d,cd,o,`Throttled`,-0,0),a);break a}Ud(r,n,yd,wd,bd,t,gd,md,_d,cd,o,null,-0,0)}break}}while(1);Pf(e)}function Ud(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mn},Vl=null,Ju(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ph.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?xd-Le():(a&4194048)===a?Sd-Le():0,m=dh(d,m),m!==null)?(kd=a,e.cancelPendingCommit=m(uf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Gd(e,a,o,!l)):uf(e,t,a,n,r,i,o,s,c,l,u,d)}function Wd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Lr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Gd(e,t,n,r){t=rt(e,t),t&=~hd,t&=~md,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ct(e,n,t)}function Kd(){return nd&6?!0:(Ff(0,!1),!1)}function qd(){if(id!==null){if(od===0)var e=id.return;else e=id,ma=pa=null,is(e),no=null,ro=0,e=id;for(;e!==null;)xl(e.alternate,e),e=e.return;id=null}}function Jd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Op(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),kd=0,qd(),rd=e,id=n=Ai(e.current,null),ad=t,od=0,sd=null,cd=!1,ld=B(e,t),ud=!1,_d=gd=hd=md=pd=fd=0,yd=vd=null,bd=!1,dd=rt(e,t),bi(),n}function Yd(e,t){Bo=null,fe.H=mc,t===Ka||t===Ja?(t=eo(),od=3):t===qa?(t=eo(),od=4):od=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,sd=t,id===null&&(fd=1,Ec(e,Ri(t,e.current)))}function Xd(){var e=Oo.current;return e===null?!0:(ad&4194048)===ad?ko===null:(ad&62914560)===ad||ad&536870912?e===ko:!1}function Zd(){var e=fe.H;return fe.H=mc,e===null?mc:e}function Qd(){var e=fe.A;return fe.A=ed,e}function $d(){fd=4,cd||(ad&4194048)!==ad&&Oo.current!==null||(ld=!0),!(pd&134217727)&&!(md&134217727)||rd===null||Gd(rd,ad,gd,!1)}function ef(e,t,n){var r=nd;nd|=2;var i=Zd(),a=Qd();(rd!==e||ad!==t)&&(wd=null,Jd(e,t)),t=!1;var o=fd;a:do try{if(od!==0&&id!==null){var s=id,c=sd;switch(od){case 8:qd(),o=6;break a;case 3:case 2:case 9:case 6:Oo.current===null&&(t=!0);var l=od;if(od=0,sd=null,sf(e,s,c,l),n&&ld){o=0;break a}break;default:l=od,od=0,sd=null,sf(e,s,c,l)}}tf(),o=fd;break}catch(t){Yd(e,t)}while(1);return t&&e.shellSuspendCounter++,ma=pa=null,nd=r,fe.H=i,fe.A=a,id===null&&(rd=null,ad=0,bi()),o}function tf(){for(;id!==null;)af(id)}function nf(e,t){var n=nd;nd|=2;var r=Zd(),a=Qd();rd!==e||ad!==t?(wd=null,Cd=Le()+500,Jd(e,t)):ld=B(e,t);a:do try{if(od!==0&&id!==null){t=id;var o=sd;b:switch(od){case 1:od=0,sd=null,sf(e,t,o,1);break;case 2:case 9:if(Xa(o)){od=0,sd=null,of(t);break}t=function(){od!==2&&od!==9||rd!==e||(od=7),Pf(e)},o.then(t,t);break a;case 3:od=7;break a;case 4:od=5;break a;case 7:Xa(o)?(od=0,sd=null,of(t)):(od=0,sd=null,sf(e,t,o,7));break;case 5:var s=null;switch(id.tag){case 26:s=id.memoizedState;case 5:case 27:var c=id;if(s?oh(s):c.stateNode.complete){od=0,sd=null;var l=c.sibling;if(l!==null)id=l;else{var u=c.return;u===null?id=null:(id=u,cf(u))}break b}}od=0,sd=null,sf(e,t,o,5);break;case 6:od=0,sd=null,sf(e,t,o,6);break;case 8:qd(),fd=6;break a;default:throw Error(i(462))}}rf();break}catch(t){Yd(e,t)}while(1);return ma=pa=null,fe.H=r,fe.A=a,nd=n,id===null?(rd=null,ad=0,bi(),fd):0}function rf(){for(;id!==null&&!Ie();)af(id)}function af(e){var t=fl(e.alternate,e,dd);e.memoizedProps=e.pendingProps,t===null?cf(e):id=t}function of(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,ad);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,ad);break;case 5:is(t);var r=t;r===$i&&(ta?(sa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(sa(r),ta=!0));default:xl(n,t),t=id=ji(t,dd),t=fl(n,t,dd)}e.memoizedProps=e.pendingProps,t===null?cf(e):id=t}function sf(e,t,n,r){ma=pa=null,is(t),no=null,ro=0;var i=t.return;try{if(jc(e,i,t,n,ad)){fd=1,Ec(e,Ri(n,e.current)),id=null;return}}catch(t){if(i!==null)throw id=i,t;fd=1,Ec(e,Ri(n,e.current)),id=null;return}t.flags&32768?(ta||r===1?e=!0:ld||ad&536870912?e=!1:(cd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),lf(t,e)):cf(t)}function cf(e){var t=e;do{if(t.flags&32768){lf(t,cd);return}e=t.return;var n=yl(t.alternate,t,dd);if(n!==null){id=n;return}if(t=t.sibling,t!==null){id=t;return}id=t=e}while(t!==null);fd===0&&(fd=5)}function lf(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,id=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){id=e;return}id=e=n}while(e!==null);fd=6,id=null}function uf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do vf();while(Ed!==0);if(nd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===rd&&(id=rd=null,ad=0),Od=t,Dd=e,kd=n,jd=a,Md=r,df(e,t,n,s,c,l,f)}}function df(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ad=s,s|=yi,st(e,n,s,r,i,a),Pd=null,(n&335544064)===n?(Fd=Na(e),r=10262):(Fd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Df(Ve,function(){return yf(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=fe.T,fe.T=null,i=pe.p,pe.p=2,a=nd,nd|=4;try{hu(e,t,n)}finally{nd=a,pe.p=i,fe.T=r}}Ed=1,Bl?Nd=Up(o,e.containerInfo,Fd,mf,hf,pf,gf,yf,ff,null,null):(mf(),hf(),gf())}function ff(e){if(Ed!==0){var t=Dd.onRecoverableError;t(e,{componentStack:null})}}function pf(){Ed===3&&(Ed=0,Iu(Od,Dd),Ed=4)}function mf(){if(Ed===1){Ed=0;var e=Dd,t=Od,n=kd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=fe.T,fe.T=null;var i=pe.p;pe.p=2;var a=nd;nd|=4;try{fu=pu=!1,Mu(t,e,n),n=vp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Vr(s,h),v=Vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Dh=!!_p,vp=_p=null}finally{nd=a,pe.p=i,fe.T=r}}e.current=t,Ed=2}}function hf(){if(Ed===2){Ed=0;var e=Dd,t=Od,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=fe.T,fe.T=null;var r=pe.p;pe.p=2;var i=nd;nd|=4;try{_u(e,t.alternate,t)}finally{nd=i,pe.p=r,fe.T=n}}Ed=3}}function gf(){if(Ed===4||Ed===3){Ed=0;var e=Nd;Nd=null,R();var t=Dd,n=Od,r=kd,i=Md,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Ed=5:(Ed=0,Od=Dd=null,_f(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Td=null),ft(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=fe.T,a=pe.p,pe.p=2,fe.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{fe.T=n,pe.p=a}}if(i=Pd,o=Fd,Fd=null,i!==null&&(Pd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);kd&3&&vf(),Pf(t),a=t.pendingLanes,r&261930&&a&42?t===Ld?Id++:(Id=0,Ld=t):(Id=0,Ld=null),Ff(0,!1)}}function _f(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function vf(){return Nd!==null&&(Nd.skipTransition(),Nd=null),mf(),hf(),gf(),yf()}function yf(){if(Ed!==5)return!1;var e=Dd,t=Ad;Ad=0;var n=ft(kd),r=fe.T,a=pe.p;try{pe.p=32>n?32:n,fe.T=null,n=jd,jd=null;var o=Dd,s=kd;if(Ed=0,Od=Dd=null,kd=0,nd&6)throw Error(i(331));var c=nd;if(nd|=4,Zu(o.current),Uu(o,o.current,s,n),nd=c,Ff(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,o)}catch{}return!0}finally{pe.p=a,fe.T=r,_f(e,t)}}function bf(e,t,n){t=Ri(n,t),t=Oc(e.stateNode,t,2),e=ho(e,t,2),e!==null&&(H(e,2),Pf(e))}function xf(e,t,n){if(e.tag===3)bf(e,e,n);else for(;t!==null;){if(t.tag===3){bf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Td===null||!Td.has(r))){e=Ri(n,e),n=kc(2),r=ho(t,n,2),r!==null&&(Ac(n,r,t,e),H(r,2),Pf(r));break}}t=t.return}}function Sf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new td;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ud=!0,i.add(n),e=Cf.bind(null,e,t,n),t.then(e,e))}function Cf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rd===e&&(ad&n)===n&&(fd===4||fd===3&&(ad&62914560)===ad&&300>Le()-xd?nd&2?hd|=n:Jd(e,0):hd|=n,_d===ad&&(_d=0)),Pf(e)}function wf(e,t){t===0&&(t=V()),e=Ci(e,t),e!==null&&(H(e,t),Pf(e))}function Tf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wf(e,n)}function Ef(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),wf(e,n)}function Df(e,t){return Pe(e,t)}var Of=null,kf=null,Af=!1,jf=!1,Mf=!1,Nf=0;function Pf(e){e!==kf&&e.next===null&&(kf===null?Of=kf=e:kf=kf.next=e),jf=!0,Af||(Af=!0,Vf())}function Ff(e,t){if(!Mf&&jf){Mf=!0;do for(var n=!1,r=Of;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Bf(r,a))}else a=ad,a=nt(r,r===rd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||B(r,a)||(n=!0,Bf(r,a))}r=r.next}while(n);Mf=!1}}function If(){Lf()}function Lf(){jf=Af=!1;var e=0;Nf!==0&&Ep()&&(e=Nf);for(var t=Le(),n=null,r=Of;r!==null;){var i=r.next,a=Rf(r,t);a===0?(r.next=null,n===null?Of=i:n.next=i,i===null&&(kf=n)):(n=r,(e!==0||a&3)&&(jf=!0)),r=i}Ed!==0&&Ed!==5||Ff(e,!1),Nf!==0&&(Nf=0)}function Rf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=rd,n=ad,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(od===2||od===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Fe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||B(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Fe(r),ft(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=zf.bind(null,e),n=Pe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Fe(r),e.callbackPriority=2,e.callbackNode=null,2}function zf(e,t){if(Ed!==0&&Ed!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(vf()&&e.callbackNode!==n)return null;var r=ad;return r=nt(e,e===rd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Hd(e,r,t),Rf(e,Le()),e.callbackNode!=null&&e.callbackNode===n?zf.bind(null,e):null)}function Bf(e,t){if(vf())return null;Hd(e,t,!0)}function Vf(){jp(function(){nd&6?Pe(ze,If):Lf()})}function Hf(){if(Nf===0){var e=Ia;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),Nf=e}return Nf}function Uf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:pn(e)}function Wf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Uf((i[_t]||null).action),o=r.submitter;o&&(t=(t=o[_t]||null)?Uf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Fn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Nf!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Gf=0;Gf<ui.length;Gf++){var Kf=ui[Gf];di(Kf.toLowerCase(),`on`+(Kf[0].toUpperCase()+Kf.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),Ft(`onMouseEnter`,[`mouseout`,`mouseover`]),Ft(`onMouseLeave`,[`mouseout`,`mouseover`]),Ft(`onPointerEnter`,[`pointerout`,`pointerover`]),Ft(`onPointerLeave`,[`pointerout`,`pointerover`]),Pt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Pt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Pt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Pt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var qf=`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(` `),Jf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(qf));function Yf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(e)}i.currentTarget=null,a=c}}}}function Xf(e,t){var n=t[yt];n===void 0&&(n=t[yt]=new Set);var r=e+`__bubble`;n.has(r)||(ep(t,e,2,!1),n.add(r))}function Zf(e,t,n){var r=0;t&&(r|=4),ep(n,e,r,t)}var Qf=`_reactListening`+Math.random().toString(36).slice(2);function $f(e){if(!e[Qf]){e[Qf]=!0,Mt.forEach(function(t){t!==`selectionchange`&&(Jf.has(t)||Zf(t,!1,e),Zf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qf]||(t[Qf]=!0,Zf(`selectionchange`,!1,t))}}function ep(e,t,n,r){switch(Ph(t)){case 2:var i=Oh;break;case 8:i=kh;break;default:i=Ah}n=i.bind(null,t,n,e),i=void 0,!wn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function tp(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Et(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}xn(function(){var r=a,i=gn(n),s=[];a:{var c=li.get(e);if(c!==void 0){var l=Fn,u=e;switch(e){case`keypress`:if(An(n)===0)break a;case`keydown`:case`keyup`:l=$n;break;case`focusin`:u=`focus`,l=Wn;break;case`focusout`:u=`blur`,l=Wn;break;case`beforeblur`:case`afterblur`:l=Wn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Un;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=nr;break;case ni:case ri:case ii:l=Gn;break;case ci:l=rr;break;case`scroll`:case`scrollend`:l=Ln;break;case`wheel`:l=ir;break;case`copy`:case`cut`:case`paste`:l=Kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=er;break;case`submit`:l=tr;break;case`toggle`:case`beforetoggle`:l=ar}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Sn(m,p),g!=null&&d.push(np(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==hn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[vt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Et(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Hn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=er,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ot(c),h=l==null?u:Ot(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?C(c,l,ip):null,c!==null&&ap(s,u,c,d,!1),l!==null&&f!==null&&ap(s,f,l,d,!0)))}a:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Tr;else if(yr(c)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&un(r.elementType)&&(_=Tr):_=Pr;if(_&&=_(e,r)){br(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ot(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(s,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(s,n,i)}var y;if(sr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else hr?pr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ur&&n.locale!==`ko`&&(hr||b!==`onCompositionStart`?b===`onCompositionEnd`&&hr&&(y=kn()):(En=i,Dn=`value`in En?En.value:En.textContent,hr=!0)),v=rp(r,b),0<v.length&&(b=new qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=mr(n),y!==null&&(b.data=y)))),(y=lr?gr(e,n):_r(e,n))&&(b=rp(r,`onBeforeInput`),0<b.length&&(v=new qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Wf(s,e,r,n,i)}Yf(s,t)})}function np(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rp(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Sn(e,n),i!=null&&r.unshift(np(e,i,a)),i=Sn(e,t),i!=null&&r.push(np(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ip(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ap(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Sn(n,a),l!=null&&o.unshift(np(n,l,c))):i||(l=Sn(n,a),l!=null&&o.push(np(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var op=/\r\n?/g,sp=/\u0000|\uFFFD/g;function cp(e){return(typeof e==`string`?e:``+e).replace(op,`
50
- `).replace(sp,``)}function lp(e,t){return t=cp(t),cp(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||on(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&on(e,``+r);else return;break;case`className`:Ut(e,`class`,r);break;case`tabIndex`:Ut(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ut(e,n,r);break;case`style`:ln(e,r,o);return;case`data`:if(t!==`object`){Ut(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&up(e,t,`name`,a.name,a,null),up(e,t,`formEncType`,a.formEncType,a,null),up(e,t,`formMethod`,a.formMethod,a,null),up(e,t,`formTarget`,a.formTarget,a,null)):(up(e,t,`encType`,a.encType,a,null),up(e,t,`method`,a.method,a,null),up(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=mn);return;case`onScroll`:r!=null&&Xf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Xf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=pn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Xf(`beforetoggle`,e),Xf(`toggle`,e),Ht(e,`popover`,r);break;case`xlinkActuate`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ht(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=dn.get(n)||n,Ht(e,n,r);else return}Bt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:ln(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)on(e,r);else if(typeof r==`number`||typeof r==`bigint`)on(e,``+r);else return;break;case`onScroll`:r!=null&&Xf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Xf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=mn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Nt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[_t]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Bt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ht(e,n,r)}return}Bt=!0}function fp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Xf(`error`,e),Xf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:up(e,t,o,s,n,null)}}a&&up(e,t,`srcSet`,n.srcSet,n,null),r&&up(e,t,`src`,n.src,n,null);return;case`input`:Xf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:up(e,t,r,d,n,null)}}en(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Xf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:up(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&nn(e,!!r,n,!0):nn(e,!!r,t,!1);return;case`textarea`:for(s in Xf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:up(e,t,s,c,n,null)}an(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:up(e,t,l,r,n,null)}return;case`dialog`:Xf(`beforetoggle`,e),Xf(`toggle`,e),Xf(`cancel`,e),Xf(`close`,e);break;case`iframe`:case`object`:Xf(`load`,e);break;case`video`:case`audio`:for(r=0;r<qf.length;r++)Xf(qf[r],e);break;case`image`:Xf(`error`,e),Xf(`load`,e);break;case`details`:Xf(`toggle`,e);break;case`embed`:case`source`:case`link`:Xf(`error`,e),Xf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:up(e,t,u,r,n,null)}return;default:if(un(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&dp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&up(e,t,c,r,n,null))}var pp={};function mp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||up(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Bt=!0),o=m;break;case`name`:m!==f&&(Bt=!0),a=m;break;case`checked`:m!==f&&(Bt=!0),u=m;break;case`defaultChecked`:m!==f&&(Bt=!0),d=m;break;case`value`:m!==f&&(Bt=!0),s=m;break;case`defaultValue`:m!==f&&(Bt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&up(e,t,p,m,r,f)}}$t(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||up(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Bt=!0),p=o;break;case`defaultValue`:o!==l&&(Bt=!0),c=o;break;case`multiple`:o!==l&&(Bt=!0),s=o;default:o!==l&&up(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?nn(e,!!n,n?[]:``,!1):nn(e,!!n,t,!0)):nn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:up(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Bt=!0),p=a;break;case`defaultValue`:a!==o&&(Bt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&up(e,t,s,a,r,o)}rn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:up(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Bt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:up(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&up(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:up(e,t,u,p,r,m)}return;default:if(un(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&dp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||dp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&up(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||up(e,t,f,p,r,m)}function hp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function gp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&hp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&hp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var _p=null,vp=null;function yp(e){return e.nodeType===9?e:e.ownerDocument}function xp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Sp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Cp(e,t,n,r){return n=yp(n).createElement(e),n[gt]=r,n[_t]=t,fp(n,e,t),At(n),n}function wp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tp=null;function Ep(){var e=window.event;return e&&e.type===`popstate`?e!==Tp&&(Tp=e,!0):(Tp=null,!1)}var Dp=typeof setTimeout==`function`?setTimeout:void 0,Op=typeof clearTimeout==`function`?clearTimeout:void 0,kp=typeof Promise==`function`?Promise:void 0,Ap=typeof requestAnimationFrame==`function`?requestAnimationFrame:Dp,jp=typeof queueMicrotask==`function`?queueMicrotask:kp===void 0?Dp:function(e){return kp.resolve(null).then(e).catch(Mp)};function Mp(e){setTimeout(function(){throw e})}function Np(e){return e===`head`}function Pp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),$h(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Om(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Om(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Om(e.ownerDocument.body)}n=i}while(n);$h(t)}function Fp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Ip(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Lp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Rp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function zp(e){return Rp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Bp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Rp(t,n,e)}function Vp(e){return e.documentElement.clientHeight}function Hp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Up(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Vp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=sh(f),u>uh){s.length=o;break}f=new Promise(Hp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Wp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Wp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Wp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Wp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Gp(e){return{name:e,group:new Wp(`group`,e),imagePair:new Wp(`image-pair`,e),old:new Wp(`old`,e),new:new Wp(`new`,e)}}function Kp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Kp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Zp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Yp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,qp,e,s,r)}this._eventListeners=a}};function qp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Kp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Zp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Yp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Jp,e,n,i),r.splice(t,1),a!==null&&a()}};function Jp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Yp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Xp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Zp(e,t,n,r){if(e.length===0)return-1;r=Xp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Xp(a.optionsOrUseCapture)===r)return i}return-1}Kp.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Yp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Yp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Kp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag!==6&&(e=_(e),wm(e,t))}Kp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,$p,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Qp(t[n],e);n--);};function $p(e,t){return t.push(e),!1}Kp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=yp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,em,e,void 0,void 0))};function em(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Kp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,tm,e,void 0,void 0)};function tm(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Kp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,nm,e,void 0,void 0);for(var n=t=0;n<rm.length;n++){var r=rm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):rm[t++]=r}rm.length=t}};function nm(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var rm=[],im=!1;function am(e,t,n){rm.push({fragmentInstance:e,observer:t,instance:n}),im||(im=!0,Tm(function(){im=!1;var e=rm;rm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Kp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,om,e,void 0,void 0),e};function om(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}Kp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Kp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,$p,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||sm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function sm(e,t,n,r,i){var a=Et(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=C(n,a,S),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=C(r,a,S),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function cm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Kp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,$p,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),cm(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),cm(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function lm(e,t){return e=_(e),um(e,t),!1}function um(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function dm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Yp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<rm.length;i++){var a=rm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(rm[r++]=a)}rm.length=r,n.observe(e)}),um(e,t))}function fm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Yp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?am(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function pm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:pm(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=bm(e.nextSibling),e===null)break}return null}function hm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bm(e.nextSibling),e===null))return null;return e}function gm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bm(e.nextSibling),e===null))return null;return e}function _m(e){return e.data===`$?`||e.data===`$~`}function vm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ym(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function bm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var xm=null;function Sm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function wm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Tm(e){Ap(function(){Ap(function(t){return e(t)})})}function Em(e,t,n){switch(t=yp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Dm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&up(e,t,r,null,pp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===mn&&(e.onclick=null),Tt(e)}function Om(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var km=new Map,Am=new Set;function jm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Mm=pe.d;pe.d={f:Nm,r:Pm,D:Lm,C:Rm,L:zm,m:Bm,X:Hm,S:Vm,M:Um};function Nm(){var e=Mm.f(),t=Kd();return e||t}function Pm(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):Mm.r(e)}var Fm=typeof document>`u`?null:document;function Im(e,t,n){var r=Fm;if(r&&typeof t==`string`&&t){var i=Qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Am.has(i)||(Am.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),At(t),r.head.appendChild(t)))}}function Lm(e){Mm.D(e),Im(`dns-prefetch`,e,null)}function Rm(e,t){Mm.C(e,t),Im(`preconnect`,e,t)}function zm(e,t,n){Mm.L(e,t,n);var r=Fm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Qt(n.imageSizes)+`"]`)):i+=`[href="`+Qt(e)+`"]`;var a=i;switch(t){case`style`:a=Gm(e);break;case`script`:a=Ym(e)}if(!(km.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),km.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Km(a))||t===`script`&&r.querySelector(Xm(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){jt(o)}),At(o),r.head.appendChild(o)}}}function Bm(e,t){Mm.m(e,t);var n=Fm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Qt(r)+`"][href="`+Qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ym(e)}if(!km.has(a)&&(e=w({rel:`modulepreload`,href:e},t),km.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Xm(a)))return}r=n.createElement(`link`),fp(r,`link`,e),At(r),n.head.appendChild(r)}}}function Vm(e,t,n){Mm.S(e,t,n);var r=Fm;if(r&&e){var i=kt(r).hoistableStyles,a=Gm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Km(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=km.get(a))&&$m(e,n);var c=o=r.createElement(`link`);At(c),fp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Hm(e,t){Mm.X(e,t);var n=Fm;if(n&&e){var r=kt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=w({src:e,async:!0},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),At(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t){Mm.M(e,t);var n=Fm;if(n&&e){var r=kt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),At(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Wm(e,t,n,r){var a=(a=xe.current)?jm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Gm(n.href),t=kt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Gm(n.href);var o=kt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Km(e)))?o._p||(s.instance=o,s.state.loading=5):(o=km.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},km.set(e,o)),Jm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Ym(n),t=kt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Gm(e){return`href="`+Qt(e)+`"`}function Km(e){return`link[rel="stylesheet"][`+e+`]`}function qm(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Jm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=jt.bind(null,t),fp(t,`link`,n),At(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Ym(e){return`[src="`+Qt(e)+`"]`}function Xm(e){return`script[async]`+e}function Zm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Qt(n.href)+`"]`);if(r)return t.instance=r,At(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),fp(r,`style`,a),Qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Gm(n.href);var o=e.querySelector(Km(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=qm(n),(a=km.get(a))&&$m(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),fp(o,`link`,r),t.state.loading|=4,Qm(o,n.precedence,e),t.instance=o;case`script`:return o=Ym(n.src),(a=e.querySelector(Xm(o)))?(t.instance=a,At(a),a):(r=n,(a=km.get(o))&&(r=w({},n),eh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),fp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Qm(r,n.precedence,e));return t.instance}function Qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function eh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var th=null;function nh(e,t,n){if(th===null){var r=new Map,i=th=new Map;i.set(n,r)}else i=th,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[gt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function rh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ih(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ah(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function oh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function sh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ch(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=sh(t),e.suspenseyImages.push(t)),e=mh.bind(e),t.decode().then(e,e))}function lh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Gm(r.href),a=t.querySelector(Km(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ph.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=qm(r),(i=km.get(i))&&$m(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),fp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ph.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var uh=0;function dh(e,t){return e.stylesheets&&e.count===0&&gh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&uh===0&&(uh=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>uh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function fh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)gh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ph(){this.count--,fh(this)}function mh(){this.imgCount--,fh(this)}var hh=null;function gh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hh=new Map,t.forEach(_h,e),hh=null,ph.call(e))}function _h(e,t){if(!(t.state.loading&4)){var n=hh.get(e);if(n)var r=n.get(null);else{n=new Map,hh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ph.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var vh={$$typeof:M,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function yh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function bh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new yh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=ka(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},fo(a),e}function xh(e){return e?(e=Ei,e):Ei}function Sh(e,t,n,r,i,a){i=xh(i),r.context===null?r.context=i:r.pendingContext=i,r=mo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ho(e,r,t),n!==null&&(Vd(n,e,t),go(n,e,t))}function Ch(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wh(e,t){Ch(e,t),(e=e.alternate)&&Ch(e,t)}function Th(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&Vd(t,e,67108864),wh(e,67108864)}}function Eh(e){if(e.tag===13||e.tag===31){var t=Rd();t=dt(t);var n=Ci(e,t);n!==null&&Vd(n,e,t),wh(e,t)}}var Dh=!0;function Oh(e,t,n,r){var i=fe.T;fe.T=null;var a=pe.p;try{pe.p=2,Ah(e,t,n,r)}finally{pe.p=a,fe.T=i}}function kh(e,t,n,r){var i=fe.T;fe.T=null;var a=pe.p;try{pe.p=8,Ah(e,t,n,r)}finally{pe.p=a,fe.T=i}}function Ah(e,t,n,r){if(Dh){var i=jh(r);if(i===null)tp(e,t,r,Mh,n),Uh(e,r);else if(Gh(i,e,t,n,r))r.stopPropagation();else if(Uh(e,r),t&4&&-1<Hh.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}Pf(a),!(nd&6)&&(Cd=Le()+500,Ff(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&Vd(s,a,2),Kd(),wh(a,2)}if(a=jh(r),a===null&&tp(e,t,r,Mh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else tp(e,t,r,null,n)}}function jh(e){return e=gn(e),Nh(e)}var Mh=null;function Nh(e){if(Mh=null,e=Et(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Mh=e,null}function Ph(e){switch(e){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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var Fh=!1,Ih=null,Lh=null,Rh=null,zh=new Map,Bh=new Map,Vh=[],Hh=`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 Uh(e,t){switch(e){case`focusin`:case`focusout`:Ih=null;break;case`dragenter`:case`dragleave`:Lh=null;break;case`mouseover`:case`mouseout`:Rh=null;break;case`pointerover`:case`pointerout`:zh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Bh.delete(t.pointerId)}}function Wh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dt(t),t!==null&&Th(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Gh(e,t,n,r,i){switch(t){case`focusin`:return Ih=Wh(Ih,e,t,n,r,i),!0;case`dragenter`:return Lh=Wh(Lh,e,t,n,r,i),!0;case`mouseover`:return Rh=Wh(Rh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return zh.set(a,Wh(zh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Bh.set(a,Wh(Bh.get(a)||null,e,t,n,r,i)),!0}return!1}function Kh(e){var t=Et(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,mt(e.priority,function(){Eh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,mt(e.priority,function(){Eh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=jh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);hn=r,n.target.dispatchEvent(r),hn=null}else return t=Dt(n),t!==null&&Th(t),e.blockedOn=n,!1;t.shift()}return!0}function Jh(e,t,n){qh(e)&&n.delete(t)}function Yh(){Fh=!1,Ih!==null&&qh(Ih)&&(Ih=null),Lh!==null&&qh(Lh)&&(Lh=null),Rh!==null&&qh(Rh)&&(Rh=null),zh.forEach(Jh),Bh.forEach(Jh)}function Xh(e,n){e.blockedOn===n&&(e.blockedOn=null,Fh||(Fh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Yh)))}var Zh=null;function Qh(e){Zh!==e&&(Zh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Zh===e&&(Zh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Nh(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function $h(e){function t(t){return Xh(t,e)}Ih!==null&&Xh(Ih,e),Lh!==null&&Xh(Lh,e),Rh!==null&&Xh(Rh,e),zh.forEach(t),Bh.forEach(t);for(var n=0;n<Vh.length;n++){var r=Vh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Vh.length&&(n=Vh[0],n.blockedOn===null);)Kh(n),n.blockedOn===null&&Vh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[_t]||null;if(typeof a==`function`)o||Qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(Nh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Qh(n)}}}function eg(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function tg(e){this._internalRoot=e}ng.prototype.render=tg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Sh(n,Rd(),e,t,null,null)},ng.prototype.unmount=tg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sh(e.current,2,null,e,null,null),Kd(),t[vt]=null}};function ng(e){this._internalRoot=e}ng.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vh.length&&t!==0&&t<Vh[n].priority;n++);Vh.splice(n,0,e),n===0&&Kh(e)}};var rg=n.version;if(rg!==`19.3.1`)throw Error(i(527,rg,`19.3.1`));pe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var ig={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:fe,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ag=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ag.isDisabled&&ag.supportsFiber)try{Ke=ag.inject(ig),qe=ag}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Cc,s=wc,c=Tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=bh(e,1,!1,null,null,n,r,null,o,s,c,eg),e[vt]=t.current,$f(e),new tg(t)}})),Sp=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=xp()})),Cp=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,wp=/^[\\/]{2}/;function Tp(e,t){return t+e.replace(/\\/g,`/`)}var Ep=`popstate`;function Dp(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Op(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Np(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Pp(t)}return Ip(t,n,null,e)}function kp(e,t){if(e===!1||e==null)throw Error(t)}function Ap(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function jp(){return Math.random().toString(36).substring(2,10)}function Mp(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Np(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Fp(t):t,state:n,key:t&&t.key||r||jp(),mask:i}}function Pp({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Fp(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ip(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Dp(e)?e:Np(h.location,e,t);n&&n(r,e),l=u()+1;let d=Mp(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Dp(e)?e:Np(h.location,e,t);n&&n(r,e),l=u();let i=Mp(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Lp(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Ep,d),c=e,()=>{i.removeEventListener(Ep,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Lp(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),kp(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Pp(t);return i=i.replace(/ $/,`%20`),!n&&wp.test(i)&&(i=r+i),new URL(i,r)}function Rp(e,t,n=`/`){return zp(e,t,n,!1)}function zp(e,t,n,r,i){let a=om((typeof t==`string`?Fp(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Bp(e),s=null,c=am(a);for(let e=0;s==null&&e<o.length;++e)s=tm(o[e],c,r);return s}function Bp(e){let t=Vp(e);return Up(t),t}function Vp(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;kp(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=mm([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(kp(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Vp(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:$p(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=im(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Hp(e.path))a(e,t,!0,n)}),t}function Hp(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Hp(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Up(e){e.sort((e,t)=>e.score===t.score?em(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Wp=/^:[\w-]+$/,Gp=/^:[\w-]+/,Kp=3.5,qp=3,Jp=2,Yp=1,Xp=10,Zp=-2,Qp=e=>e===`*`;function $p(e,t){let n=e.split(`/`),r=n.length;return n.some(Qp)&&(r+=Zp),t&&(r+=Jp),n.filter(e=>!Qp(e)).reduce((e,t)=>e+(Wp.test(t)?qp:Gp.test(t)?Kp:t===``?Yp:Xp),r)}function em(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function tm(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?rm(u,l,s.matcher,s.compiledParams):nm(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=nm({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:mm([a,d.pathname]),pathnameBase:gm(mm([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=mm([a,d.pathnameBase]))}return o}function nm(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=im(e.path,e.caseSensitive,e.end);return rm(e,t,n,r)}function rm(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=hm(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=hm(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function im(e,t=!1,n=!0){Ap(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 r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/((?:[^/?()[\]*^\\]|\\.)+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function am(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Ap(!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 (${t}).`),e}}function om(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function sm(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Fp(e):e,a;return n?(n=pm(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?cm(n.substring(1),`/`):cm(n,t)):a=t,{pathname:a,search:_m(r),hash:vm(i)}}function cm(e,t){let n=hm(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function lm(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. 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 um(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function dm(e){let t=um(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function fm(e,t,n,r=!1){let i;typeof e==`string`?i=Fp(e):(i={...e},kp(!i.pathname||!i.pathname.includes(`?`),lm(`?`,`pathname`,`search`,i)),kp(!i.pathname||!i.pathname.includes(`#`),lm(`#`,`pathname`,`hash`,i)),kp(!i.search||!i.search.includes(`#`),lm(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=sm(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var pm=e=>e.replace(/[\\/]{2,}/g,`/`),mm=e=>pm(e.join(`/`));function hm(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var gm=e=>hm(e).replace(/^\/*/,`/`),_m=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,vm=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ym=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function bm(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function xm(e){return mm(e.map(e=>e.route.path).filter(Boolean))||`/`}var Sm=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Cm(e,t){let n=e;if(typeof n!=`string`||!Cp.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Sm)try{let e=new URL(window.location.href),r=wp.test(n)?new URL(Tp(n,e.protocol)):new URL(n),a=om(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Ap(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var wm=new URL(`http://localhost`);function Tm(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),wm)}catch{return wm}}function Em(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Dm(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Om(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Em(i,n),s=!Em(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Dm(e,i)||!Em(i,a)))throw Error(`External navigation is not allowed`)}var km=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(km);var Am=[`GET`,...km];new Set(Am);var jm=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Mm(e){try{return jm.includes(new URL(e).protocol)}catch{return!1}}var Nm=H.createContext(null);Nm.displayName=`DataRouter`;var Pm=H.createContext(null);Pm.displayName=`DataRouterState`;var Fm=H.createContext(null);Fm.displayName=`DataRouterData`;var Im=H.createContext(null);Im.displayName=`DataRouterNavigation`;var Lm=H.createContext(!1);function Rm(){return H.useContext(Lm)}var zm=H.createContext({isTransitioning:!1});zm.displayName=`ViewTransition`;var Bm=H.createContext(null);Bm.displayName=`Fetchers`;var Vm=H.createContext(null);Vm.displayName=`Await`;var Hm=H.createContext(null);Hm.displayName=`Navigation`;var Um=H.createContext(null);Um.displayName=`Location`;var Wm=H.createContext({outlet:null,matches:[],isDataRoute:!1});Wm.displayName=`Route`;var Gm=H.createContext(!1);Gm.displayName=`IsDataRoute`;var Km=H.createContext(void 0);Km.displayName=`RouteId`;var qm=H.createContext(null);qm.displayName=`RouteError`;var Jm=`REACT_ROUTER_ERROR`,Ym=`REDIRECT`,Xm=`ROUTE_ERROR_RESPONSE`;function Zm(e){if(e.startsWith(`${Jm}:${Ym}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Qm(e){if(e.startsWith(`${Jm}:${Xm}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new ym(t.status,t.statusText,t.data)}catch{}}function $m(e,{relative:t}={}){kp(eh(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=H.useContext(Hm),{hash:i,pathname:a,search:o}=ah(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:mm([n,a])),r.createHref({pathname:s,search:o,hash:i})}function eh(){return H.useContext(Um)!=null}function th(){return kp(eh(),`useLocation() may be used only in the context of a <Router> component.`),H.useContext(Um).location}var nh=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function rh(){return H.useContext(Gm)?xh():ih()}function ih(){kp(eh(),`useNavigate() may be used only in the context of a <Router> component.`);let e=H.useContext(Nm),{basename:t,navigator:n}=H.useContext(Hm),{matches:r}=H.useContext(Wm),{pathname:i}=th(),a=JSON.stringify(dm(r)),o=H.useRef(!1);return H.useLayoutEffect(()=>{o.current=!0}),H.useCallback((r,s={})=>{if(Ap(o.current,nh),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=fm(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:mm([t,c.pathname])),Om(typeof r==`string`?r:Pp(r),n.createHref(c),Tm(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}H.createContext(null);function ah(e,{relative:t}={}){let{matches:n}=H.useContext(Wm),{pathname:r}=th(),i=JSON.stringify(dm(n));return H.useMemo(()=>fm(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function oh(e,t){return sh(e,t)}function sh(e,t,n){kp(eh(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=H.useContext(Hm),{matches:i}=H.useContext(Wm),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=th(),l;if(t){let e=typeof t==`string`?Fp(t):t;kp(s===`/`||e.pathname?.startsWith(s),`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 "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f;f=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):Rp(e,{pathname:d});let p=mh(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:mm([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:mm([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?H.createElement(Um.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function ch(){let e=bh(),t=bm(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return H.createElement(H.Fragment,null,H.createElement(`h2`,null,`Unexpected Application Error!`),H.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?H.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var lh=H.createElement(ch,null),uh=class extends H.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=Lm;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):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`){let t=Qm(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:H.createElement(Wm.Provider,{value:this.props.routeContext},H.createElement(Gm.Provider,{value:this.props.routeContext.isDataRoute},H.createElement(Km.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},H.createElement(qm.Provider,{value:e,children:this.props.component}))));return this.context?H.createElement(fh,{error:e},t):t}},dh=new WeakMap;function fh({children:e,error:t}){let{basename:n,navigator:r}=H.useContext(Hm);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Zm(t.digest);if(e){let i=dh.get(t);if(i)throw i;let a=Cm(e.location,n),o=a.absoluteURL||a.to;if(Om(e.location,o,Tm(r),`allow-explicit`),Mm(o))throw Error(`Invalid redirect location`);if(Sm&&!dh.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw dh.set(t,n),n}}return H.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function ph({routeContext:e,match:t,children:n}){let r=H.useContext(Nm);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),H.createElement(Wm.Provider,{value:e},H.createElement(Gm.Provider,{value:e.isDataRoute},H.createElement(Km.Provider,{value:t.route.id},n)))}function mh(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);kp(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:xm(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||lh,o&&(s<0&&c===0?(Ch(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?H.createElement(n.route.Component,null):n.route.element?n.route.element:e,H.createElement(ph,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?H.createElement(uh,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function hh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gh(e){let t=H.useContext(Nm);return kp(t,hh(e)),t}function _h(e){let t=H.useContext(Pm);return kp(t,hh(e)),t}function vh(e){let t=H.useContext(Fm);return kp(t,hh(e)),t}function yh(e){let t=H.useContext(Km);return kp(t,`${e} can only be used on routes that contain a unique "id"`),t}function bh(){let e=H.useContext(qm),t=vh(`useRouteError`),n=yh(`useRouteError`);return e===void 0?t.errors?.[n]:e}function xh(){let{router:e}=gh(`useNavigate`),t=yh(`useNavigate`),n=H.useRef(!1);return H.useLayoutEffect(()=>{n.current=!0}),H.useCallback(async(r,i={})=>{Ap(n.current,nh),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Sh={};function Ch(e,t,n){!t&&!Sh[e]&&(Sh[e]=!0,Ap(!1,n))}function wh(e,t){if(e===!1||e==null)throw Error(t)}function Th(e,t,n){let r=typeof e==`string`?new URL(e,n??(typeof window>`u`?`server://singlefetch/`:window.location.origin)):new URL(e);return n&&r.origin!==n&&(r=new URL(r.pathname+r.search+r.hash,n)),r.pathname.endsWith(`/`)?r.pathname=`${r.pathname}_.${t}`:r.pathname=`${r.pathname}.${t}`,r}async function Eh(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Dh(e){return e!=null&&typeof e.page==`string`}function Oh(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 kh(e,t,n){return Ph((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Eh(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Oh).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Ah(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function jh(e,t,{includeHydrateFallback:n}={}){return Mh(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Mh(e){return[...new Set(e)]}function Nh(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Ph(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Dh(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Nh(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var Fh=H.createContext(void 0);Fh.displayName=`FrameworkContext`;function Ih(){let e=H.useContext(Fh);return wh(e,`You must render this element inside a <HydratedRouter> element`),e}function Lh(e,t){let n=H.useContext(Fh),[r,i]=H.useState(!1),[a,o]=H.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=H.useRef(null);H.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),H.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Rh(s,p),onBlur:Rh(c,m),onMouseEnter:Rh(l,p),onMouseLeave:Rh(u,m),onTouchStart:Rh(d,p)}]:[a,f,{}]:[!1,f,{}]}function Rh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function zh({page:e,...t}){let n=Rm(),{nonce:r}=Ih(),{router:i}=gh(`PrefetchPageLinks`),a=H.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?H.createElement(Vh,{page:e,matches:a,...t}):H.createElement(Hh,{page:e,matches:a,...t})):null}function Bh(e){let{manifest:t,routeModules:n}=Ih(),[r,i]=H.useState([]);return H.useEffect(()=>{let r=!1;return kh(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Vh({page:e,matches:t,...n}){let r=th(),{unstable_apiServerOrigin:i}=Ih(),a=H.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Th(e,`rsc`,i),a=!1,o=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?a=!0:o.push(e.route.id);return a&&o.length>0&&n.searchParams.set(`_routes`,o.join(`,`)),[i?n.toString():n.pathname+n.search]},[e,r,t,i]);return H.createElement(H.Fragment,null,a.map(e=>H.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Hh({page:e,matches:t,...n}){let r=th(),{manifest:i,routeModules:a,unstable_apiServerOrigin:o}=Ih(),{matches:s}=_h(`PrefetchPageLinks`),{loaderData:c}=vh(`PrefetchPageLinks`),l=H.useMemo(()=>Ah(e,t,s,i,r,`data`),[e,t,s,i,r]),u=H.useMemo(()=>Ah(e,t,s,i,r,`assets`),[e,t,s,i,r]),d=H.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!l.some(t=>t.route.id===e.route.id)&&e.route.id in c&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let u=Th(e,`data`,o);return s&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[o?u.toString():u.pathname+u.search]},[c,r,i,l,t,e,a,o]),f=H.useMemo(()=>jh(u,i),[u,i]),p=Bh(u);return H.createElement(H.Fragment,null,d.map(e=>H.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),f.map(e=>H.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),p.map(({key:e,link:t})=>H.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Uh(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}H.memo(Wh);function Wh({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=H.useContext(Nm);kp(a,`You must render this element inside a <DataRouterContext.Provider> element`);let o=H.useContext(Fh)?.routeDiscoveryRuntime;return H.useEffect(()=>{n.initialized&&o?.markReady()},[n.initialized,o]),sh(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function Gh({to:e,replace:t,state:n,relative:r}){kp(eh(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=H.useContext(Hm);Ap(!i,`<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:o}=H.useContext(Wm),{pathname:s}=th(),c=rh(),l=fm(e,dm(o),s,r===`path`);Om(typeof e==`string`?e:Pp(e),a.createHref(l),Tm(a),`reject`);let u=JSON.stringify(l);return H.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Kh(e){kp(!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 qh({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){kp(!eh(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=H.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Fp(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=H.useMemo(()=>{let e=om(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Ap(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:H.createElement(Hm.Provider,{value:c},H.createElement(Um.Provider,{children:t,value:h}))}function Jh({children:e,location:t}){return oh(Yh(e),t)}H.Component;function Yh(e,t=[]){let n=[];return H.Children.forEach(e,(e,r)=>{if(!H.isValidElement(e))return;let i=[...t,r];if(e.type===H.Fragment){n.push.apply(n,Yh(e.props.children,i));return}kp(e.type===Kh,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;kp(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=Yh(a.children,i)),n.push(o)}),n}var Xh=`application/x-www-form-urlencoded`;function Zh(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Qh(e){return Zh(e)&&e.tagName.toLowerCase()===`button`}function $h(e){return Zh(e)&&e.tagName.toLowerCase()===`form`}function eg(e){return Zh(e)&&e.tagName.toLowerCase()===`input`}function tg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ng(e,t){return e.button===0&&(!t||t===`_self`)&&!tg(e)}function rg(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function ig(e,t){let n=rg(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var ag=null;function og(){if(ag===null)try{new FormData(document.createElement(`form`),0),ag=!1}catch{ag=!0}return ag}var sg=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function cg(e){return e!=null&&!sg.has(e)?(Ap(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xh}"`),null):e}function lg(e,t){let n,r,i,a,o;if($h(e)){let o=e.getAttribute(`action`);r=o?om(o,t):null,n=e.getAttribute(`method`)||`get`,i=cg(e.getAttribute(`enctype`))||Xh,a=new FormData(e)}else if(Qh(e)||eg(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?om(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=cg(e.getAttribute(`formenctype`))||cg(o.getAttribute(`enctype`))||Xh,a=new FormData(o,e),!og()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Zh(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Xh,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var ug=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ug&&(window.__reactRouterVersion=`8`)}catch{}function dg({basename:e,children:t,useTransitions:n,window:r}){let i=H.useRef(null);i.current??=Op({window:r,v5Compat:!0});let a=i.current,[o,s]=H.useState({action:a.action,location:a.location}),c=H.useCallback(e=>{n===!1?s(e):H.startTransition(()=>s(e))},[n]);return H.useLayoutEffect(()=>a.listen(c),[a,c]),H.createElement(qh,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var fg=H.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=H.useContext(Hm),v=typeof l==`string`&&Cp.test(l),y=Cm(l,h);l=y.to;let b=$m(l,{relative:r}),x=th(),S=null;if(o){let e=fm(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:mm([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Lh(n,p),E=hg(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=H.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:Uh(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?H.createElement(H.Fragment,null,k,H.createElement(zh,{page:b})):k});fg.displayName=`Link`;var pg=H.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ah(a,{relative:c.relative}),d=th(),f=H.useContext(Im),{navigator:p,basename:m}=H.useContext(Hm),h=f!=null&&xg(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f?.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=om(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(y)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return H.createElement(fg,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});pg.displayName=`NavLink`;var mg=H.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=H.useContext(Hm),g=yg(),_=bg(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Cp.test(s);return H.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?H.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});mg.displayName=`Form`;function hg(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=rh(),d=th(),f=ah(e,{relative:o});return H.useCallback(p=>{if(ng(p,t)){p.preventDefault();let t=n===void 0?Pp(d)===Pp(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?H.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function gg(e){Ap(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=H.useRef(rg(e)),n=H.useRef(!1),r=th(),i=H.useMemo(()=>ig(r.search,n.current?null:t.current),[r.search]),a=rh();return[i,H.useCallback((e,t)=>{let r=rg(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var _g=0,vg=()=>`__${String(++_g)}__`;function yg(){let{router:e}=gh(`useSubmit`),{basename:t}=H.useContext(Hm),n=yh(`useSubmit`),r=e.fetch,i=e.navigate;return H.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=lg(e,t);a.navigate===!1?await r(a.fetcherKey||vg(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function bg(e,{relative:t}={}){let{basename:n}=H.useContext(Hm),r=H.useContext(Wm);kp(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ah(e||`.`,{relative:t})},o=th();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:mm([n,a.pathname])),Pp(a)}function xg(e,{relative:t}={}){let n=H.useContext(zm);kp(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=gh(`useViewTransitionState`),i=ah(e,{relative:t});if(!n.isTransitioning)return!1;let a=om(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=om(n.nextLocation.pathname,r)||n.nextLocation.pathname;return nm(i.pathname,o)!=null||nm(i.pathname,a)!=null}var Sg=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Cg(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Sg(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var wg=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Tg=e=>{let t=wg(e);return t.charAt(0).toUpperCase()+t.slice(1)},Eg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Dg={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Og(e){return e!=null}function kg(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Dg.width,a=e.size??e.height??Dg.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Eg(...c):Eg(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Dg[`stroke-width`])*Number(e.size??e.width??Dg.width)/Number(t.size??t.width??Dg.width):t.strokeWidth??Dg[`stroke-width`];return[`svg`,{...Object.entries(Dg).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Og(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Og(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Og(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Ag(e,t={}){return kg(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var jg=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Mg=(0,H.createContext)({}),Ng=()=>(0,H.useContext)(Mg),Pg=(0,H.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=Ng()??{},y=!!c||jg(d),[b,x,S=[]]=Ag(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Eg(v,s),hasA11yProp:y,attributes:d});return(0,H.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,H.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function U(e,t=[],n=[]){let r=typeof e==`string`?Cg(e,t,n):e,i=(0,H.forwardRef)(({className:e,...t},n)=>(0,H.createElement)(Pg,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Tg(r.name)),i}var Fg={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};Fg.node;var Ig=U(Fg),Lg={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};Lg.node;var Rg=U(Lg),zg={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};zg.node;var Bg=U(zg),Vg={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Vg.node;var Hg=U(Vg),Ug={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};Ug.node;var Wg=U(Ug),Gg={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};Gg.node;var Kg=U(Gg),qg={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};qg.node;var Jg=U(qg),Yg={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};Yg.node;var Xg=U(Yg),Zg={name:`bug`,size:24,node:[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]};Zg.node;var Qg=U(Zg),$g={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};$g.node;var e_=U($g),t_={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};t_.node;var n_=U(t_),r_={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};r_.node;var i_=U(r_),a_={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};a_.node;var o_=U(a_),s_={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};s_.node;var c_=U(s_),l_={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};l_.node;var u_=U(l_),d_={name:`clock-3`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]};d_.node;var f_=U(d_),p_={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};p_.node;var m_=U(p_),h_={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};h_.node;var g_=U(h_),__={name:`copy`,size:24,node:[[`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`}]]};__.node;var v_=U(__),y_={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};y_.node;var b_=U(y_),x_={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};x_.node;var S_=U(x_),C_={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};C_.node;var w_=U(C_),T_={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};T_.node;var E_=U(T_),D_={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};D_.node;var O_=U(D_),k_={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};k_.node;var A_=U(k_),j_={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};j_.node;var M_=U(j_),N_={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};N_.node;var P_=U(N_),F_={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};F_.node;var I_=U(F_),L_={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};L_.node;var R_=U(L_),z_={name:`folder-search`,size:24,node:[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]};z_.node;var B_=U(z_),V_={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};V_.node;var H_=U(V_),U_={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};U_.node;var W_=U(U_),G_={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};G_.node,U(G_);var K_={name:`git-compare`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]};K_.node;var q_=U(K_),J_={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};J_.node,U(J_);var Y_={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Y_.node;var X_=U(Y_),Z_={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Z_.node;var Q_=U(Z_),$_={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};$_.node;var ev=U($_),tv={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};tv.node;var nv=U(tv),rv={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};rv.node;var iv=U(rv),av={name:`memory-stick`,size:24,node:[[`path`,{d:`M12 12v-2`,key:`fwoke6`}],[`path`,{d:`M12 18v-2`,key:`qj6yno`}],[`path`,{d:`M16 12v-2`,key:`heuere`}],[`path`,{d:`M16 18v-2`,key:`s1ct0w`}],[`path`,{d:`M2 11h1.5`,key:`15p63e`}],[`path`,{d:`M20 18v-2`,key:`12ehxp`}],[`path`,{d:`M20.5 11H22`,key:`khsy7a`}],[`path`,{d:`M4 18v-2`,key:`1c3oqr`}],[`path`,{d:`M8 12v-2`,key:`1mwtfd`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`rect`,{x:`2`,y:`6`,width:`20`,height:`10`,rx:`2`,key:`1qcswk`}]]};av.node;var ov=U(av),sv={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};sv.node;var cv=U(sv),lv={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};lv.node;var uv=U(lv),dv={name:`monitor`,size:24,node:[[`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`}]]};dv.node;var fv=U(dv),pv={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};pv.node;var mv=U(pv),hv={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};hv.node;var gv=U(hv),_v={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};_v.node;var vv=U(_v),yv={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};yv.node;var bv=U(yv),xv={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};xv.node;var Sv=U(xv),Cv={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};Cv.node;var wv=U(Cv),Tv={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Tv.node;var Ev=U(Tv),Dv={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Dv.node;var Ov=U(Dv),kv={name:`refresh-cw`,size:24,node:[[`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`}]]};kv.node;var Av=U(kv),jv={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};jv.node;var Mv=U(jv),Nv={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Nv.node;var Pv=U(Nv),Fv={name:`server`,size:24,node:[[`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`}]]};Fv.node;var Iv=U(Fv),Lv={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Lv.node;var Rv=U(Lv),zv={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};zv.node;var Bv=U(zv),Vv={name:`shield-exclamation-point`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]],aliases:[`shield-alert`]};Vv.node;var Hv=U(Vv),Uv={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};Uv.node;var Wv=U(Uv),Gv={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Gv.node;var Kv=U(Gv),qv={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};qv.node;var Jv=U(qv),Yv={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Yv.node;var Xv=U(Yv),Zv={name:`sun`,size:24,node:[[`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`}]]};Zv.node;var Qv=U(Zv),$v={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};$v.node;var ey=U($v),ty={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};ty.node;var ny=U(ty),ry={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};ry.node;var iy=U(ry),ay={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};ay.node,U(ay);var oy={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};oy.node;var sy=U(oy),cy={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};cy.node;var ly=U(cy);function uy(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function dy(e,t=`|`){return e.map(e=>Ly(e)).join(t)}function fy(e,t){return typeof t==`bigint`?t.toString():t}var py=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function my(e){return new py(e)}function hy(e){return e==null}function gy(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function _y(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function vy(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function yy(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function by(e){return yy(e._zod.def)??e._zod.def.shape}function xy(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return vy(this,t,e),e},enumerable:!0,configurable:!0})}function Sy(e,t,n){t in e?vy(e,t,n):e[t]=n}function Cy(e,t,n,r){let i=by(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?xy(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Sy(e,a,r?r(n.value,a):n.value))}}function wy(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?xy(e,n,()=>t[n]):Sy(e,n,r.value))}}function Ty(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ey(e){return JSON.stringify(e)}function Dy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Oy=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ky(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ay=my(()=>{if(Db.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function jy(e){if(ky(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ky(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function My(e){return jy(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Ny=new Set([`string`,`number`,`symbol`]);function Py(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Fy(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Iy(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ly(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ry(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var zy={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},By={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Vy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Cy(i,e,Hy(e,t)),Fy(e,Ty(n,{shape:i,checks:[]}))}function Hy(e,t){let n=by(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Uy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Hy(e,t)),a={};return Cy(a,e,Reflect.ownKeys(by(e)).filter(e=>!i.has(e))),Fy(e,Ty(n,{shape:a,checks:[]}))}function Wy(e,t){if(!jy(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=by(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Fy(e,Ty(e._zod.def,{shape:Gy(e,t)}))}function Gy(e,t){let n={};return Cy(n,e,Reflect.ownKeys(by(e))),wy(n,t),n}function Ky(e,t){if(!jy(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Fy(e,Ty(e._zod.def,{shape:Gy(e,t)}))}function qy(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Cy(n,e,Reflect.ownKeys(by(e))),Cy(n,t,Reflect.ownKeys(by(t))),Fy(e,Ty(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Jy(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Hy(t,n)):void 0,o={};return Cy(o,t,Reflect.ownKeys(by(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Fy(t,Ty(t._zod.def,{shape:o,checks:[]}))}function Yy(e,t,n){let r=n?new Set(Hy(t,n)):void 0,i={};return Cy(i,t,Reflect.ownKeys(by(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Fy(t,Ty(t._zod.def,{shape:i}))}function Xy(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Zy(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Qy(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function $y(e){return typeof e==`string`?e:e?.message}function eb(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function tb(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function nb(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:$y(e.inst?._zod.def?.error?.(e))??$y(a?.(e))??$y(t?.error?.(e))??$y(n.customError?.(e))??$y(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var rb=/[\uD800-\uDBFF]/;function ib(e){let t=e.length;if(!rb.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function ab(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function ob(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function sb(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function cb(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):fb(e,n,r.value)}}function lb(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function ub(e,t,n){return lb(e,t,n,!1)}function db(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return lb(this,n,r(this))},set(e){lb(this,n,e)}})}return t}function fb(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:lb(this,t,n.bind(this))},set(e){lb(this,t,e)}})}function pb(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var mb,hb=!1,gb={configurable:!0,get(){hb=!0}};function _b(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&mb!==e._zod?mb=void 0:(mb=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,gb);let e=hb;hb=!1;try{let r=n(this);return hb?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),hb||=e,r}catch(n){throw delete this[t],hb||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function vb(e,t,n,r){let i=pb(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var yb=`~constantCatch`;function bb(e){let t=()=>e;return t[yb]=!0,t}var xb,Sb={value:void 0,enumerable:!1},Cb=`captureStackTrace`in Error?Error:null;function wb(e){let t=Cb;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Cb=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function W(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Sb.value=new a(r);try{Object.defineProperty(n,"_zod",Sb)}finally{Sb.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),cb(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?wb(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Tb=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Eb=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(xb=globalThis).__zod_globalConfig??(xb.__zod_globalConfig={});var Db=globalThis.__zod_globalConfig;function Ob(e){return e&&Object.assign(Db,e),Db}function kb(){let e=this._zod;return e.message??=JSON.stringify(e.def,fy,2),e.message}function Ab(e){this._zod.message=e}var jb={get:kb,set:Ab,enumerable:!0,configurable:!0},Mb={value:void 0,enumerable:!1},Nb=new WeakSet([Object.prototype,Error.prototype]),Pb=W(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Mb.value=t,Object.defineProperty(e,"issues",Mb),Mb.value=void 0,Object.defineProperty(e,"message",jb);let n=Object.getPrototypeOf(e);Nb.has(n)||(Nb.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Fb(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Ib(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Fb(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Lb(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Rb(e,t){return{callee:t?.callee??e,Err:t?.Err}}var zb=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Tb;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>nb(e,o,Ob())));throw Oy(n,a?.callee??t),n}return s.value};return t},Bb=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>nb(e,o,Ob())));throw Oy(n,a?.callee??t),n}return s.value};return t},Vb=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Tb;return a.issues.length?Hb(e,a.issues,i):{success:!0,data:a.value}};function Hb(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>nb(e,n,Ob()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Ub=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Hb(e,a.issues,i):{success:!0,data:a.value}},Wb=Symbol.for(`zod.compile.invalid`),Gb=Symbol.for(`zod.compile.fallback`),Kb=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Wb)return!0;if(r.definite===!0&&n===void 0)return!1}return qb(e,t,n)});function qb(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Gb]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Tb;return a.issues.length===0}var Jb=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Yb=e=>{let t=zb(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Rb(n,a))};return n},Xb=e=>{let t=zb(e),n=(e,r,i,a)=>t(e,r,i,Rb(n,a));return n},Zb=e=>{let t=Bb(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Rb(n,a))};return n},Qb=e=>{let t=Bb(e),n=async(e,r,i,a)=>await t(e,r,i,Rb(n,a));return n},$b=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Vb(e)(t,n,i)},ex=e=>(t,n,r)=>Vb(e)(t,n,r),tx=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ub(e)(t,n,i)},nx=e=>async(t,n,r)=>Ub(e)(t,n,r),rx=/^[cC][0-9a-z]{6,}$/,ix=/^[0-9a-z]+$/,ax=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ox=/^[0-9a-vA-V]{20}$/,sx=/^[A-Za-z0-9]{27}$/,cx=/^[a-zA-Z0-9_-]{21}$/;function lx(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var ux=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dx=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fx=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,px=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mx=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function hx(){return new RegExp(mx,`u`)}var gx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_x=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,vx=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,yx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xx=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Sx=/^https?$/,Cx=/^\+[1-9]\d{6,14}$/,wx=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Tx(e){return RegExp(`^${e}$`)}var Ex=Tx(wx);function Dx(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ox(e){return RegExp(`^${Dx(e)}$`)}function kx(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Dx({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Dx({precision:e.precision})}`:n;return RegExp(`^${wx}T(?:${r})$`)}var Ax=/^[\s\S]{0,}$/,jx=/^-?\d+(?:\.\d+)?$/,Mx=/^(?:true|false)$/i,Nx=/^[^A-Z]*$/,Px=/^[^a-z]*$/,Fx=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ix=e=>{let t=e.value;return!hy(t)&&t.length!==void 0},Lx={number:`number`,bigint:`bigint`,object:`date`},Rx=W(`$ZodCheckLessThan`,(e,t)=>{Fx.init(e,t);let n=Lx[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Lx[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zx=W(`$ZodCheckGreaterThan`,(e,t)=>{Fx.init(e,t);let n=Lx[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Lx[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bx=W(`$ZodCheckMultipleOf`,(e,t)=>{Fx.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):_y(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Vx=W(`$ZodCheckNumberFormat`,(e,t)=>{Fx.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=zy[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Hx=W(`$ZodCheckMaxLength`,(e,t)=>{var n;Fx.init(e,t),(n=e._zod.def).when??(n.when=Ix),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?ib(r):i)<=t.maximum)return;let a=ab(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ux=W(`$ZodCheckMinLength`,(e,t)=>{var n;Fx.init(e,t),(n=e._zod.def).when??(n.when=Ix),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?ib(r):i)>=t.minimum)return;let a=ab(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wx=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;Fx.init(e,t),(n=e._zod.def).when??(n.when=Ix),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?ib(r):i;if(a===t.length)return;let o=ab(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Gx=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Fx.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Kx=W(`$ZodCheckRegex`,(e,t)=>{Gx.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),qx=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Nx,Gx.init(e,t)}),Jx=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Px,Gx.init(e,t)}),Yx=W(`$ZodCheckIncludes`,(e,t)=>{Fx.init(e,t);let n=Py(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xx=W(`$ZodCheckStartsWith`,(e,t)=>{Fx.init(e,t);let n=RegExp(`^${Py(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Zx=W(`$ZodCheckEndsWith`,(e,t)=>{Fx.init(e,t);let n=RegExp(`.*${Py(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Qx=W(`$ZodCheckOverwrite`,(e,t)=>{Fx.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),$x=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
51
- `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
52
- `)}\n};`)(...Object.values(this.closed))}},eS={major:4,minor:6,patch:7},tS=W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eS;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Xy(t),a;for(let o of n){if(o._zod.def.when){if(Zy(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Tb;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(tb(t.issues,n,e),i||=Xy(t,n))});else{if(t.issues.length===n)continue;tb(t.issues,n,e),i||=Xy(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Xy(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Tb;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Tb;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return ub(this,`~standard`,iS(this))},set"~standard"(e){lb(this,`~standard`,e)}}),nS=(e,t)=>e.issues.length?{issues:e.issues.map(e=>nb(e,t,Ob()))}:{value:e.value};async function rS(e,t){let n={async:!0};return nS(await e._zod.run({value:t,issues:[]},n),n)}function iS(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return nS(r,n)}catch{}return rS(e,t)},vendor:`zod`,version:1}}var aS=W(`$ZodString`,(e,t)=>{tS.init(e,t),e._zod.pattern=t.pattern??Ax,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),oS=W(`$ZodStringFormat`,(e,t)=>{Gx.init(e,t),aS.init(e,t)}),sS=W(`$ZodGUID`,(e,t)=>{t.pattern??=dx,oS.init(e,t)}),cS=W(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=fx(e)}else t.pattern??=fx();oS.init(e,t)}),lS=W(`$ZodEmail`,(e,t)=>{t.pattern??=px,oS.init(e,t)});function uS(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function dS(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?uS(e)||2:fS(e,t)}function fS(e,t){if(!t.normalize&&t.protocol?.source===Sx.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var pS=/[\t\n\r]/g;function mS(e){return e.replace(pS,``)}function hS(e,t){return t.lastIndex=0,t.test(e.hostname)}function gS(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var _S=W(`$ZodURL`,(e,t)=>{oS.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=dS(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=mS(r);return}t.hostname&&!hS(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!gS(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:mS(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),vS=W(`$ZodEmoji`,(e,t)=>{t.pattern??=hx(),oS.init(e,t)}),yS=W(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?cx:lx(t.length),oS.init(e,t)}),bS=W(`$ZodCUID`,(e,t)=>{t.pattern??=rx,oS.init(e,t)}),xS=W(`$ZodCUID2`,(e,t)=>{t.pattern??=ix,oS.init(e,t)}),SS=W(`$ZodULID`,(e,t)=>{t.pattern??=ax,oS.init(e,t)}),CS=W(`$ZodXID`,(e,t)=>{t.pattern??=ox,oS.init(e,t)}),wS=W(`$ZodKSUID`,(e,t)=>{t.pattern??=sx,oS.init(e,t)}),TS=W(`$ZodISODateTime`,(e,t)=>{t.pattern??=kx(t),oS.init(e,t)}),ES=W(`$ZodISODate`,(e,t)=>{t.pattern??=Ex,oS.init(e,t)}),DS=W(`$ZodISOTime`,(e,t)=>{t.pattern??=Ox(t),oS.init(e,t)}),OS=W(`$ZodISODuration`,(e,t)=>{t.pattern??=ux,oS.init(e,t)}),kS=W(`$ZodIPv4`,(e,t)=>{t.pattern??=gx,oS.init(e,t)}),AS=/^[0-9a-fA-F:.]+$/;function jS(e){return AS.test(e)?uS(`http://[${e}]`):!1}var MS=W(`$ZodIPv6`,(e,t)=>{t.pattern??=_x,oS.init(e,t),e._zod.check=n=>{jS(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),NS=W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=vx,oS.init(e,t)});function PS(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:jS(n)}var FS=W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=yx,oS.init(e,t),e._zod.check=n=>{PS(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function IS(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var LS=/^[0-9a-zA-Z+/]*={0,2}$/,RS=W(`$ZodBase64`,(e,t)=>{t.pattern??=LS,oS.init(e,t),e._zod.check=n=>{IS(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),zS=/^[A-Za-z0-9_-]*$/;function BS(e){if(!zS.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return IS(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var VS=W(`$ZodBase64URL`,(e,t)=>{t.pattern??=zS,oS.init(e,t),e._zod.check=n=>{BS(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),HS=W(`$ZodE164`,(e,t)=>{t.pattern??=Cx,oS.init(e,t)});function US(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var WS=W(`$ZodJWT`,(e,t)=>{oS.init(e,t),e._zod.check=n=>{US(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),GS=W(`$ZodNumber`,(e,t)=>{tS.init(e,t),e._zod.pattern=jx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),KS=W(`$ZodNumberFormat`,(e,t)=>{Vx.init(e,t),GS.init(e,t)}),qS=W(`$ZodBoolean`,(e,t)=>{tS.init(e,t),e._zod.pattern=Mx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),JS=W(`$ZodUnknown`,(e,t)=>{tS.init(e,t),e._zod.parse=e=>e}),YS=W(`$ZodNever`,(e,t)=>{tS.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function XS(e,t){let n=eb(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of eb(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,tb(n.issues,t,e),n}}return i(n,a)}}var ZS=e=>Array.isArray(e)?e.length:-1;function QS(e,t,n){e.issues.length&&t.issues.push(...Qy(n,e.issues)),t.value[n]=e.value}var $S=W(`$ZodArray`,(e,t)=>{tS.init(e,t);let n=Db.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>QS(t,r,e)));else if(QS(c,r,e),s&&c.issues.length!==0&&Xy(c))break}return o.length?Promise.all(o).then(()=>r):r},XS(e,ZS)});function eC(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Qy(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var tC=[];function nC(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:tC,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Ry(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function rC(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Xy(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>eC(e,n,i,t,d,f))):eC(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var iC=W(`$ZodObject`,(e,t)=>{tS.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=my(()=>nC(t));_b(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||vy(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ky,o=t.catchall,s,c=Db.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Xy(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>eC(n,t,e,r,a,o))):eC(s,t,e,r,a,o)}return o?rC(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),aC=W(`$ZodObjectJIT`,(e,t)=>{iC.init(e,t);let n=e._zod.parse,r=my(()=>nC(t)),i=Db.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new $x([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
53
- let ${e}_ab = false;
54
- for (let i = 0; i < ${e}.issues.length; i++) {
55
- const iss = ${e}.issues[i];
56
- iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
57
- payload.issues.push(iss);
58
- if (iss.continue !== true) ${e}_ab = true;
59
- }
60
- if (${e}_ab && ctx && ctx.abortEarly) {
61
- payload.value = newResult;
62
- return payload;
63
- }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Ey(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
64
- const ${n}_present = ${i};
65
- if (!${n}.issues.length || ${n}_present) {
66
- if (${n}.issues.length) {${c(n,r)}
67
- }
68
-
69
- if (${e}) {
70
- newResult[${r}] = ${n}.value;
71
- }
72
- }
73
-
74
- `)}else f?(o.write(`
75
- if (${n}.issues.length) {${c(n,r)}
76
- }
77
- `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
78
- if (${n}.value !== undefined || ${i}) {
79
- newResult[${r}] = ${n}.value;
80
- }
81
- `)):o.write(`
82
- const ${n}_present = ${i};
83
- if (${n}.issues.length) {${c(n,r)}
84
- }
85
- if (!${n}_present && !${n}.issues.length) {
86
- payload.issues.push({
87
- code: "invalid_type",
88
- expected: "nonoptional",
89
- input: undefined,
90
- path: [${r}]
91
- });
92
- if (ctx && ctx.abortEarly) {
93
- payload.value = newResult;
94
- return payload;
95
- }
96
- }
97
-
98
- if (${n}_present) {
99
- newResult[${r}] = ${n}.value;
100
- }
101
-
102
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ky,c=!Db.jitless,l=c&&Ay.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?rC([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function oC(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Xy(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>nb(e,r,Ob())))}),t)}var sC=W(`$ZodUnion`,(e,t)=>{tS.init(e,t),_b(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),_b(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),_b(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),_b(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>gy(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>oC(t,r,e,i)):oC(o,r,e,i)}});function cC(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var lC=W(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,sC.init(e,t);let n=e._zod.parse;_b(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||vy(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=yy(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=my(()=>cC(t));e._zod.parse=(i,a)=>{let o=i.value;if(!ky(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),uC=W(`$ZodIntersection`,(e,t)=>{tS.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>fC(e,t,n)):fC(e,i,a)}});function dC(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(jy(e)&&jy(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=dC(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=dC(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function fC(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=dC(t.value,n.value);if(!c.valid){if(Xy(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var pC=W(`$ZodEnum`,(e,t)=>{tS.init(e,t);let n=uy(t.entries),r=new Set(n);e._zod.values=r,_b(e,`pattern`,e=>{let t=uy(e.def.entries).filter(e=>Ny.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Py(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),mC=W(`$ZodLiteral`,(e,t)=>{tS.init(e,t);let n=new Set(t.values);e._zod.values=n,_b(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Py(e):e?Py(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),hC=W(`$ZodTransform`,(e,t)=>{tS.init(e,t),e._zod.optin=`optional`,Db.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Eb(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Tb;return n.value=i,n}});function gC(e,t){return e.value=t.issues.length?void 0:t.value,e}var _C=W(`$ZodOptional`,(e,t)=>{tS.init(e,t),_b(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,_b(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),_b(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${gy(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>gC(e,t)):gC(e,r)}return t.innerType._zod.run(e,n)}}),vC=W(`$ZodExactOptional`,(e,t)=>{_C.init(e,t),_b(e,`values`,e=>e.def.innerType._zod.values),_b(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),yC=W(`$ZodNullable`,(e,t)=>{tS.init(e,t),_b(e,`optin`,e=>e.def.innerType._zod.optin),_b(e,`optout`,e=>e.def.innerType._zod.optout),_b(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${gy(t.source)}|null)$`):void 0}),_b(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),bC=W(`$ZodDefault`,(e,t)=>{tS.init(e,t),e._zod.optin=`defaulted`,_b(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>xC(e,t)):xC(r,t)}});function xC(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var SC=W(`$ZodPrefault`,(e,t)=>{tS.init(e,t),e._zod.optin=`defaulted`,_b(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),CC=W(`$ZodNonOptional`,(e,t)=>{tS.init(e,t),_b(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>wC(t,e)):wC(i,e)}});function wC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function TC(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>nb(e,r,Ob()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var EC=W(`$ZodCatch`,(e,t)=>{tS.init(e,t),_b(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),_b(e,`optout`,e=>e.def.innerType._zod.optout),_b(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>TC(e,r,t,n)):TC(e,r,t,n)}}),DC=W(`$ZodPipe`,(e,t)=>{tS.init(e,t),_b(e,`values`,e=>e.def.in._zod.values),_b(e,`optin`,e=>e.def.in._zod.optin),_b(e,`optout`,e=>e.def.out._zod.optout),_b(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>OC(e,t.in,n)):OC(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>OC(e,t.out,n)):OC(r,t.out,n)}});function OC(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var kC=W(`$ZodReadonly`,(e,t)=>{tS.init(e,t),_b(e,`propValues`,e=>e.def.innerType._zod.propValues),_b(e,`values`,e=>e.def.innerType._zod.values),_b(e,`optin`,e=>e.def.innerType?._zod?.optin),_b(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(AC):AC(r)}});function AC(e){return e.memo||(e.value=Object.freeze(e.value)),e}var jC=W(`$ZodCustom`,(e,t)=>{Fx.init(e,t),tS.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>MC(t,n,r,e));MC(i,n,r,e)}});function MC(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(sb(e))}}var NC=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},PC=`~memo`,FC=[];function IC(e){return typeof e==`object`&&!!e}function LC(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var RC=new WeakMap,zC=0,BC=1,VC=2;function HC(e,t,n){let r=RC.get(e);if(r!==void 0)return r?VC:zC;if(t.has(e))return VC;t.add(e);let i=zC,a=e=>{if(i!==VC&&e?._zod){let r=HC(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=zC;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?BC:o.value?._zod?HC(o.value,t,n):zC;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=yy(c);s(e?o(e,!0):BC),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?HC(r,t,!1):BC);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),UC(e,i)}function UC(e,t){return t!==BC&&RC.set(e,t===VC),t}function WC(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var GC,KC=[],qC={alloc(e,t,n){let r=GC;if(!r)return n;GC=void 0;let i={value:n,issues:null};return r.set(t.value,i),KC.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&YC(n,e.value))throw new NC;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=HC(e,new Set,!1);if(i===zC)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===VC||r?n=!0:r=!0}let l=s.value;if(!IC(l))return t(s,c);let u=c[PC];u||(u={buckets:new WeakMap,backEdges:void 0},c[PC]=u);let d;i===c?d=a:(d=WC(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...LC(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;GC=d;let p=KC.length,m=t(s,c);GC=void 0;let h=KC.length>p?KC.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?LC(e.issues):FC),e)):(h&&(h.issues=m.issues.length?LC(m.issues):FC),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function JC(){return qC}function YC(e,t){let n=e[PC]?.backEdges;return n!==void 0&&IC(t)&&n.has(t)}var XC=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(ob(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Ly(e.values[0])}`:`Invalid option: expected one of ${dy(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${dy(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function ZC(){return{localeError:XC()}}var QC,$C=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ew(){return new $C}(QC=globalThis).__zod_globalRegistry??(QC.__zod_globalRegistry=ew());var tw=globalThis.__zod_globalRegistry;function nw(e){return e.checks&&=[...e.checks],e}function rw(e,t){return new e(nw({type:`string`,...Iy(t)}))}function iw(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Iy(t)})}function aw(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Iy(t)})}function ow(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Iy(t)})}function sw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Iy(t)})}function cw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Iy(t)})}function lw(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Iy(t)})}function uw(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Iy(t)})}function dw(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Iy(t)})}function fw(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Iy(t)})}function pw(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Iy(t)})}function mw(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Iy(t)})}function hw(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Iy(t)})}function gw(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Iy(t)})}function _w(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Iy(t)})}function vw(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Iy(t)})}function yw(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Iy(t)})}function bw(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Iy(t)})}function xw(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Iy(t)})}function Sw(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Iy(t)})}function Cw(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Iy(t)})}function ww(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Iy(t)})}function Tw(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Iy(t)})}function Ew(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Iy(t)})}function Dw(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Iy(t)})}function Ow(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Iy(t)})}function kw(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Iy(t)})}function Aw(e,t){return new e(nw({type:`number`,checks:[],...Iy(t)}))}function jw(e,t){return new e(nw({type:`number`,coerce:!0,checks:[],...Iy(t)}))}function Mw(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Iy(t)})}function Nw(e,t){return new e({type:`boolean`,...Iy(t)})}function Pw(e){return new e({type:`unknown`})}function Fw(e,t){return new e({type:`never`,...Iy(t)})}function Iw(e,t){return new Rx({check:`less_than`,...Iy(t),value:e,inclusive:!1})}function Lw(e,t){return new Rx({check:`less_than`,...Iy(t),value:e,inclusive:!0})}function Rw(e,t){return new zx({check:`greater_than`,...Iy(t),value:e,inclusive:!1})}function zw(e,t){return new zx({check:`greater_than`,...Iy(t),value:e,inclusive:!0})}function Bw(e,t){return new Bx({check:`multiple_of`,...Iy(t),value:e})}function Vw(e,t){return new Hx({check:`max_length`,...Iy(t),maximum:e})}function Hw(e,t){return new Ux({check:`min_length`,...Iy(t),minimum:e})}function Uw(e,t){return new Wx({check:`length_equals`,...Iy(t),length:e})}function Ww(e,t){return new Kx({check:`string_format`,format:`regex`,...Iy(t),pattern:e})}function Gw(e){return new qx({check:`string_format`,format:`lowercase`,...Iy(e)})}function Kw(e){return new Jx({check:`string_format`,format:`uppercase`,...Iy(e)})}function qw(e,t){return new Yx({check:`string_format`,format:`includes`,...Iy(t),includes:e})}function Jw(e,t){return new Xx({check:`string_format`,format:`starts_with`,...Iy(t),prefix:e})}function Yw(e,t){return new Zx({check:`string_format`,format:`ends_with`,...Iy(t),suffix:e})}function Xw(e){return new Qx({check:`overwrite`,tx:e})}function Zw(e){return Xw(t=>t.normalize(e))}function Qw(){return Xw(e=>e.trim())}function $w(){return Xw(e=>e.toLowerCase())}function eT(){return Xw(e=>e.toUpperCase())}function tT(){return Xw(e=>Dy(e))}function nT(e,t,n){return new e({type:`array`,element:t,...Iy(n)})}function rT(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Iy(n)})}function iT(e,t){let n=aT(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(sb(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(sb(r))}},e(t.value,t)),t);return n}function aT(e,t){let n=new Fx({check:`custom`,...Iy(t)});return n._zod.check=e,n}function oT(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&vy(e,t,n[t]);return e}function sT(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??tw,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function cT(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function lT(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,lT(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&oT(o.schema,c),t.io===`input`&&yT(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function uT(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function dT(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${uT(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+uT(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
103
-
104
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function fT(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;fT(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var pT=new Set([`type`,`properties`,`required`,`additionalProperties`]),mT=[`oneOf`,`anyOf`];function hT(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function gT(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!pT.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??hT(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}vy(n,r,e.length===1?e[0]:gT(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=hT(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function _T(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of pT)if(t in e)return;let n=t.filter(e=>mT.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=gT(t);else{let e=n[0],i=mT.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>gT([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,oT(e,r))}function vT(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):oT(i,s),oT(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())fT(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])_T(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}oT(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,vy(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:xT(t,`input`,e.processors),output:xT(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function yT(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return yT(r.element,n);if(r.type===`set`)return yT(r.valueType,n);if(r.type===`lazy`)return yT(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return yT(r.innerType,n);if(r.type===`intersection`)return yT(r.left,n)||yT(r.right,n);if(r.type===`record`||r.type===`map`)return yT(r.keyType,n)||yT(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:yT(r.in,n)||yT(r.out,n);if(r.type===`object`){for(let e in r.shape)if(yT(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(yT(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(yT(e,n))return!0;return!!(r.rest&&yT(r.rest,n))}return!1}var bT=(e,t={})=>n=>{let r=sT({...n,processors:t});return lT(e,r),dT(r,e),vT(r,e)},xT=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=sT({...i??{},target:a,io:t,processors:n});return lT(e,o),dT(o,e),vT(o,e)},ST=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},CT=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},wT=(e,t)=>{ST(e,`minimum`,t),CT(e,`maximum`,t)},TT=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ET=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},DT=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},OT=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},kT=(e,t)=>ST(e,`minimum`,t.minimum),AT=(e,t)=>CT(e,`maximum`,t.maximum),jT=e=>(t,n)=>{OT(t,n.format);let[r,i]=e[n.format];ST(t,`minimum`,r),CT(t,`maximum`,i)},MT={greater_than:(e,t)=>ST(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>CT(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>TT(e,t.value),number_format:jT(zy),bigint_format:jT(By),min_length:kT,max_length:AT,length_equals:(e,t)=>wT(e,t.length),min_size:kT,max_size:AT,size_equals:(e,t)=>wT(e,t.size),string_format:(e,t)=>{OT(e,t.format),t.pattern&&ET(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>DT(e,t.mime)};function NT(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)MT[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ST(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ST(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&CT(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&CT(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&TT(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&DT(t,i.mime);for(let e of i.patterns??[])ET(t,e);return t}var PT={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},FT=new Map([[LS,bx],[zS,xx]]),IT=e=>FT.get(e)??e,LT=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=NT(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=PT[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(IT);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},RT=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=NT(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):cT(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},zT=(e,t,n,r)=>{n.type=`boolean`},BT=(e,t,n,r)=>{n.not={}},VT=(e,t,n,r)=>{let i=e._zod.def,a=uy(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},HT=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(cT(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(cT(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},UT=(e,t,n,r)=>{cT(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},WT=(e,t,n,r)=>{cT(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},GT=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=NT(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=lT(a.element,t,{...r,path:[...r.path,`items`]})};function KT(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?KT(t.out):t.type===`catch`?KT(t.innerType):e._zod.optin}var qT=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&cT(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)vy(i.properties,e,lT(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?KT(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=lT(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},JT=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>lT(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},YT=(e,t,n,r)=>{let i=e._zod.def,a=lT(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=lT(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},XT=(e,t,n,r)=>{let i=e._zod.def,a=lT(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},ZT=(e,t,n,r)=>{let i=e._zod.def;lT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},QT=Symbol();function $T(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(cT(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),QT):JSON.parse(o)}var eE=(e,t,n,r)=>{let i=e._zod.def;lT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=$T(i.defaultValue,e,t,n,r);o!==QT&&(n.default=o)},tE=(e,t,n,r)=>{let i=e._zod.def;lT(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=$T(i.defaultValue,e,t,n,r);o!==QT&&(n._prefault=o)},nE=(e,t,n,r)=>{let i=e._zod.def;lT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{cT(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},rE=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;lT(o,t,r);let s=t.seen.get(e);s.ref=o},iE=(e,t,n,r)=>{let i=e._zod.def;lT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},aE=(e,t,n,r)=>{let i=e._zod.def;lT(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},oE=new WeakSet([Object.prototype,Error.prototype]);function sE(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var cE=W(`ZodError`,(e,t)=>{Pb.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);oE.has(n)||(oE.add(n),sE(n,`format`,e=>t=>Lb(e,t)),sE(n,`flatten`,e=>t=>Ib(e,t)),sE(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,fy,2)}),sE(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,fy,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),lE=zb(cE),uE=Bb(cE),dE=Vb(cE),fE=Ub(cE),pE=Yb(cE),mE=Xb(cE),hE=Zb(cE),gE=Qb(cE),_E=$b(cE),vE=ex(cE),yE=tx(cE),bE=nx(cE);function xE(){Db.localeError||Ob(ZC())}function SE(){Db.memoizer||Ob({memoizer:JC()})}var CE=W(`ZodType`,(e,t)=>(xE(),tS.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Ty(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Fy(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(zD(e,t))},superRefine(e,t){return this.check(BD(e,t))},overwrite(e){return this.check(Xw(e))},optional(){return xD(this)},exactOptional(){return CD(this)},nullable(){return TD(this)},nullish(){return xD(TD(this))},nonoptional(e){return jD(this,e)},array(){return oD(this)},or(e){return uD([this,e])},and(e){return mD(this,e)},transform(e){return FD(this,yD(e))},default(e){return DD(this,e)},prefault(e){return kD(this,e)},catch(e){return ND(this,e)},pipe(e){return FD(this,e)},readonly(){return LD(this)},describe(e){let t=this.clone();return tw.add(t,{description:e}),t},meta(...e){if(e.length===0)return tw.get(this);let t=this.clone();return tw.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ub(this,`~standard`,{...iS(this),jsonSchema:{input:xT(this,`input`),output:xT(this,`output`)}})},set"~standard"(e){lb(this,`~standard`,e)},parse:function e(t,n){return lE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await uE(this,t,n,{callee:e})},safeParse(e,t){return dE(this,e,t)},async safeParseAsync(e,t){return fE(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){lb(this,`spa`,e)},validate(e,t){return Kb(this,e,t)},validateAsync(e,t){return Jb(this,e,t)},encode:function e(t,n){return pE(this,t,n,{callee:e})},decode:function e(t,n){return mE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await hE(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await gE(this,t,n,{callee:e})},safeEncode(e,t){return _E(this,e,t)},safeDecode(e,t){return vE(this,e,t)},async safeEncodeAsync(e,t){return yE(this,e,t)},async safeDecodeAsync(e,t){return bE(this,e,t)},toJSONSchema(e){return bT(this,{})(e)},get description(){return tw.get(this)?.description},get _def(){return this._zod.def}}),wE=W(`_ZodString`,(e,t)=>{aS.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LT(e,t,n,r)},db({format:e=>NT(e).format??null,minLength:e=>NT(e).minimum??null,maxLength:e=>NT(e).maximum??null},{regex(...e){return this.check(Ww(...e))},includes(...e){return this.check(qw(...e))},startsWith(...e){return this.check(Jw(...e))},endsWith(...e){return this.check(Yw(...e))},min(...e){return this.check(Hw(...e))},max(...e){return this.check(Vw(...e))},length(...e){return this.check(Uw(...e))},nonempty(...e){return this.check(Hw(1,...e))},lowercase(e){return this.check(Gw(e))},uppercase(e){return this.check(Kw(e))},trim(){return this.check(Qw())},normalize(...e){return this.check(Zw(...e))},toLowerCase(){return this.check($w())},toUpperCase(){return this.check(eT())},slugify(){return this.check(tT())}})),TE=W(`ZodString`,(e,t)=>{aS.init(e,t),wE.init(e,t)},{email(e){return this.check(iw(jE,e))},url(e){return this.check(uw(PE,e))},jwt(e){return this.check(Tw(YE,e))},emoji(e){return this.check(dw(FE,e))},guid(e){return this.check(aw(ME,e))},uuid(e){return this.check(ow(NE,e))},uuidv4(e){return this.check(sw(NE,e))},uuidv6(e){return this.check(cw(NE,e))},uuidv7(e){return this.check(lw(NE,e))},nanoid(e){return this.check(fw(IE,e))},cuid(e){return this.check(pw(LE,e))},cuid2(e){return this.check(mw(RE,e))},ulid(e){return this.check(hw(zE,e))},base64(e){return this.check(Sw(KE,e))},base64url(e){return this.check(Cw(qE,e))},xid(e){return this.check(gw(BE,e))},ksuid(e){return this.check(_w(VE,e))},ipv4(e){return this.check(vw(HE,e))},ipv6(e){return this.check(yw(UE,e))},cidrv4(e){return this.check(bw(WE,e))},cidrv6(e){return this.check(xw(GE,e))},e164(e){return this.check(ww(JE,e))},datetime(e){return this.check(Ew(DE,e))},date(e){return this.check(Dw(OE,e))},time(e){return this.check(Ow(kE,e))},duration(e){return this.check(kw(AE,e))}});function G(e){return rw(TE,e)}var EE=W(`ZodStringFormat`,(e,t)=>{oS.init(e,t),wE.init(e,t)}),DE=W(`ZodISODateTime`,(e,t)=>{TS.init(e,t),EE.init(e,t)}),OE=W(`ZodISODate`,(e,t)=>{ES.init(e,t),EE.init(e,t)}),kE=W(`ZodISOTime`,(e,t)=>{DS.init(e,t),EE.init(e,t)}),AE=W(`ZodISODuration`,(e,t)=>{OS.init(e,t),EE.init(e,t)}),jE=W(`ZodEmail`,(e,t)=>{lS.init(e,t),EE.init(e,t)}),ME=W(`ZodGUID`,(e,t)=>{sS.init(e,t),EE.init(e,t)}),NE=W(`ZodUUID`,(e,t)=>{cS.init(e,t),EE.init(e,t)}),PE=W(`ZodURL`,(e,t)=>{_S.init(e,t),EE.init(e,t)}),FE=W(`ZodEmoji`,(e,t)=>{vS.init(e,t),EE.init(e,t)}),IE=W(`ZodNanoID`,(e,t)=>{yS.init(e,t),EE.init(e,t)}),LE=W(`ZodCUID`,(e,t)=>{bS.init(e,t),EE.init(e,t)}),RE=W(`ZodCUID2`,(e,t)=>{xS.init(e,t),EE.init(e,t)}),zE=W(`ZodULID`,(e,t)=>{SS.init(e,t),EE.init(e,t)}),BE=W(`ZodXID`,(e,t)=>{CS.init(e,t),EE.init(e,t)}),VE=W(`ZodKSUID`,(e,t)=>{wS.init(e,t),EE.init(e,t)}),HE=W(`ZodIPv4`,(e,t)=>{kS.init(e,t),EE.init(e,t)}),UE=W(`ZodIPv6`,(e,t)=>{MS.init(e,t),EE.init(e,t)}),WE=W(`ZodCIDRv4`,(e,t)=>{NS.init(e,t),EE.init(e,t)}),GE=W(`ZodCIDRv6`,(e,t)=>{FS.init(e,t),EE.init(e,t)}),KE=W(`ZodBase64`,(e,t)=>{RS.init(e,t),EE.init(e,t)}),qE=W(`ZodBase64URL`,(e,t)=>{VS.init(e,t),EE.init(e,t)}),JE=W(`ZodE164`,(e,t)=>{HS.init(e,t),EE.init(e,t)}),YE=W(`ZodJWT`,(e,t)=>{WS.init(e,t),EE.init(e,t)}),XE=W(`ZodNumber`,(e,t)=>{GS.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RT(e,t,n,r),e.isFinite=!0},db({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=NT(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=NT(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=NT(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>NT(e).format??null},{gt(e,t){return this.check(Rw(e,t))},gte(e,t){return this.check(zw(e,t))},min(e,t){return this.check(zw(e,t))},lt(e,t){return this.check(Iw(e,t))},lte(e,t){return this.check(Lw(e,t))},max(e,t){return this.check(Lw(e,t))},int(e){return this.check(QE(e))},safe(e){return this.check(QE(e))},positive(e){return this.check(Rw(0,e))},nonnegative(e){return this.check(zw(0,e))},negative(e){return this.check(Iw(0,e))},nonpositive(e){return this.check(Lw(0,e))},multipleOf(e,t){return this.check(Bw(e,t))},step(e,t){return this.check(Bw(e,t))},finite(){return this}}));function K(e){return Aw(XE,e)}var ZE=W(`ZodNumberFormat`,(e,t)=>{KS.init(e,t),XE.init(e,t)});function QE(e){return Mw(ZE,e)}var $E=W(`ZodBoolean`,(e,t)=>{qS.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zT(e,t,n,r)});function eD(e){return Nw($E,e)}var tD=W(`ZodUnknown`,(e,t)=>{JS.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function nD(){return Pw(tD)}var rD=W(`ZodNever`,(e,t)=>{YS.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BT(e,t,n,r)});function iD(e){return Fw(rD,e)}var aD=W(`ZodArray`,(e,t)=>{SE(),$S.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GT(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Hw(e,t))},nonempty(e){return this.check(Hw(1,e))},max(e,t){return this.check(Vw(e,t))},length(e,t){return this.check(Uw(e,t))},unwrap(){return this.element}});function oD(e,t){return nT(aD,e,t)}var sD=W(`ZodObject`,(e,t)=>{SE(),aC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qT(e,t,n,r),vb(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return gD(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Ty(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Ty(this._zod.def,{catchall:nD()}))},loose(){return this.clone(Ty(this._zod.def,{catchall:nD()}))},strict(){return this.clone(Ty(this._zod.def,{catchall:iD()}))},strip(){return this.clone(Ty(this._zod.def,{catchall:void 0}))},extend(e){return Wy(this,e)},safeExtend(e){return Ky(this,e)},merge(e){return qy(this,e)},pick(e){return Vy(this,e)},omit(e){return Uy(this,e)},partial(...e){return Jy(bD,this,e[0])},exactPartial(...e){return Jy(SD,this,e[0],`exactPartial`)},required(...e){return Yy(AD,this,e[0])}});function q(e,t){return new sD({type:`object`,shape:e??{},...Iy(t)})}function cD(e,t){return new sD({type:`object`,shape:e,catchall:iD(),...Iy(t)})}var lD=W(`ZodUnion`,(e,t)=>{sC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JT(e,t,n,r),e.options=t.options});function uD(e,t){return new lD({type:`union`,options:e,...Iy(t)})}var dD=W(`ZodDiscriminatedUnion`,(e,t)=>{lD.init(e,t),lC.init(e,t)});function fD(e,t,n){return new dD({type:`union`,options:t,discriminator:e,...Iy(n)})}var pD=W(`ZodIntersection`,(e,t)=>{uC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YT(e,t,n,r)});function mD(e,t){return new pD({type:`intersection`,left:e,right:t})}var hD=W(`ZodEnum`,(e,t)=>{pC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VT(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new hD({...t,checks:[],...Iy(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new hD({...t,checks:[],...Iy(r),entries:i})}});function gD(e,t){return new hD({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Iy(t)})}var _D=W(`ZodLiteral`,(e,t)=>{mC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HT(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function J(e,t){return new _D({type:`literal`,values:Array.isArray(e)?e:[e],...Iy(t)})}var vD=W(`ZodTransform`,(e,t)=>{SE(),hC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WT(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Eb(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(sb(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(sb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function yD(e){return new vD({type:`transform`,transform:e})}var bD=W(`ZodOptional`,(e,t)=>{_C.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xD(e){return new bD({type:`optional`,innerType:e})}var SD=W(`ZodExactOptional`,(e,t)=>{vC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function CD(e){return new SD({type:`optional`,innerType:e})}var wD=W(`ZodNullable`,(e,t)=>{yC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TD(e){return new wD({type:`nullable`,innerType:e})}var ED=W(`ZodDefault`,(e,t)=>{bC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function DD(e,t){return new ED({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():My(t)}})}var OD=W(`ZodPrefault`,(e,t)=>{SC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kD(e,t){return new OD({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():My(t)}})}var AD=W(`ZodNonOptional`,(e,t)=>{CC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jD(e,t){return new AD({type:`nonoptional`,innerType:e,...Iy(t)})}var MD=W(`ZodCatch`,(e,t)=>{EC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ND(e,t){return new MD({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:bb(t)})}var PD=W(`ZodPipe`,(e,t)=>{DC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rE(e,t,n,r),e.in=t.in,e.out=t.out});function FD(e,t){return new PD({type:`pipe`,in:e,out:t})}var ID=W(`ZodReadonly`,(e,t)=>{kC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iE(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function LD(e){return new ID({type:`readonly`,innerType:e})}var RD=W(`ZodCustom`,(e,t)=>{jC.init(e,t),CE.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UT(e,t,n,r)});function zD(e,t={}){return rT(RD,e,t)}function BD(e,t){return iT(e,t)}function VD(e){return jw(XE,e)}var HD=Sp(),UD=gD([`project`,`default`,`session`]),WD=G().min(1).max(128),GD=uD([q({workspace:J(`default`)}).strict(),q({projectId:WD}).strict(),q({sessionId:WD}).strict()]),KD=G().min(1).max(4096).refine(e=>{let t=e.replaceAll(`\\`,`/`);return!t.startsWith(`/`)&&!t.includes(`\0`)&&t.split(`/`).every(e=>e!==`..`&&!e.includes(`:`))},`Expected a relative path inside the authorized root`).transform(e=>e.replaceAll(`\\`,`/`)),qD=G().regex(/^[a-f0-9]{64}$/);q({scope:GD,path:KD,content:G().max(1048576),expectedVersion:qD}).strict(),uD([q({workspace:J(`default`),path:KD,version:qD.optional()}).strict(),q({projectId:WD,path:KD,version:qD.optional()}).strict(),q({sessionId:WD,path:KD,version:qD.optional()}).strict()]),q({path:KD.default(`.`),limit:VD().int().min(1).max(200).default(50),cursor:G().min(1).max(2048).optional()}).strict();var JD=q({path:G(),realPath:G(),content:G(),version:qD,size:K().int().nonnegative(),encoding:J(`utf-8`)}),YD=JD.omit({content:!0,encoding:!0}).extend({previousVersion:qD}),XD=q({items:oD(q({path:G(),name:G(),type:gD([`file`,`directory`]),size:K().int().nonnegative().optional()})),nextCursor:G().nullable(),revision:qD}),ZD=q({kind:J(`file`),scope:GD,path:KD,version:qD.optional()}).strict(),QD=q({executable:G().min(1).max(4096).refine(e=>!e.includes(`\0`)),args:oD(G().max(8192).refine(e=>!e.includes(`\0`))).max(256),cwd:KD.default(`.`),timeoutMs:K().int().min(1).max(6e5).default(12e4)}).strict().refine(e=>e.args.reduce((e,t)=>e+t.length,e.executable.length)<=65536),$D=gD([`CREATED`,`RUNNING`,`CANCELLING`,`COMPLETED`,`FAILED`,`CANCELLED`,`TIMED_OUT`,`INTERRUPTED`]);q({after:VD().int().min(0).max(2**53-1).default(0),limit:VD().int().min(1).max(500).default(100)}).strict();var eO=q({cursor:K().int().positive(),data:G().max(16384).refine(e=>new TextEncoder().encode(e).byteLength<=16384),channel:gD([`stdout`,`stderr`]),timestamp:K().int()}).strict(),tO=q({status:$D,exitCode:K().int().nullable(),reasonCode:G().nullable(),truncated:eD(),startedAt:K().nullable(),endedAt:K().nullable()});q({}).strict();var nO=G().regex(/^cmd_[a-f0-9-]{36}$/);q({topic:J(`command`),resourceId:nO,after:K().int().min(0).max(2**53-1).default(0)}).strict();var rO=q({kind:J(`event`),protocolVersion:J(1),topic:J(`command`),eventId:G(),streamId:nO,resourceId:nO,sequence:K().int().nonnegative(),timestamp:K(),type:J(`command.status`),payload:tO}),iO=q({id:nO,scope:q({projectId:G()}).strict().or(q({sessionId:G()}).strict()),status:$D,exitCode:K().nullable(),reasonCode:G().nullable(),truncated:eD(),startedAt:K().nullable(),endedAt:K().nullable(),currentSequence:K().int().nonnegative()}),aO=q({chunks:oD(eO).max(500),oldestCursor:K().int().positive(),nextCursor:K().int().nonnegative(),truncated:eD(),resyncRequired:eD()}),oO=eO.extend({kind:J(`command.output`),resourceId:nO}).strict(),sO=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`],cO=[`stable`,`beta`],lO=gD(sO),uO=gD(cO);function dO(e){let t;try{t=new URL(e)}catch{return!1}return(t.protocol===`http:`||t.protocol===`https:`)&&t.username===``&&t.password===``&&t.pathname===`/`&&t.search===``&&t.hash===``}var fO=G().max(2048).refine(dO,`must be an http(s) origin without path, query or credentials`),pO=cD({host:G().min(1).max(255),port:QE().min(1).max(65535),publicUrl:fO.nullable(),trustedProxies:oD(G().min(1)).max(64)}),mO=cD({sessionTtlMinutes:QE().min(1).max(43200),idleTtlMinutes:QE().min(1).max(43200),requireHttpsForRemote:eD()}),hO=cD({rpId:G().min(1).max(253),rpName:G().min(1).max(128),origin:fO}),gO=cD({level:lO,retentionDays:QE().min(1).max(3650)}),_O=cD({channel:uO,autoCheck:eD(),autoInstall:eD()}),vO=cD({enabled:eD(),port:K().int().min(1).max(65535).default(3211)}),yO=cD({events:K().int().min(1).max(3650).default(90),turns:K().int().min(1).max(3650).default(180),summaries:K().int().min(1).max(3650).default(90)}),bO=cD({enabled:eD().default(!1),deleteSessions:eD().default(!1),keepPinned:eD().default(!0),retentionDays:yO.default({events:90,turns:180,summaries:90}),maxBytes:K().int().min(0).default(0)}),xO=bO.parse({});cD({version:J(1),server:pO,auth:mO,webauthn:hO,logging:gO,updates:_O,preview:vO,cleanup:bO.default(xO)}),q({action:gD([`start`,`stop`,`restart`]),expectedPm2Name:G().min(1).max(256),requestKey:G().min(1).max(256),confirmed:J(!0)}).strict();var SO=`[0-9a-f-]{36}`,CO=G().regex(RegExp(`^tgt_${SO}$`)),wO=G().regex(RegExp(`^bld_${SO}$`)),TO=G().regex(RegExp(`^art_${SO}$`)),EO=G().regex(RegExp(`^plan_${SO}$`)),DO=G().trim().min(1).max(80).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/,`must be a simple service name`),OO=G().trim().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._+-]*$/,`must be a simple version label`);function kO(e){for(let t of e){let e=t.codePointAt(0)??0;if(e<=31||e===127)return!0}return!1}var AO=e=>!kO(e);function jO(e,t){return!e||e.length>1024||kO(e)||e.includes(`\\`)?!1:e===`.`?t:e.startsWith(`/`)||/^[A-Za-z]:/.test(e)?!1:e.split(`/`).every(e=>e.length>0&&e!==`.`&&e!==`..`)}var MO=G().min(1).max(1024).refine(e=>jO(e,!0),`must be a relative path inside the project`),NO=G().min(1).max(1024).refine(e=>jO(e,!1),`must be a relative directory inside the project`),PO=G().min(1).max(1024).refine(e=>e.startsWith(`/`)&&!e.includes(`..`)&&!kO(e),`must be an absolute HTTP path without traversal`),FO=oD(G().min(1).max(4096).refine(AO,`must not contain control characters`)).min(1).max(64),IO=cD({command:FO,cwd:MO.default(`.`),outputDir:NO,timeoutMs:QE().min(1e3).max(6e5).default(3e5)}),LO=cD({command:FO,cwd:MO.default(`.`)}),RO=cD({path:PO,port:QE().min(1024).max(65535),timeoutMs:QE().min(1e3).max(12e4).default(3e4),intervalMs:QE().min(100).max(1e4).default(500)}),zO=cD({version:OO,build:IO,start:LO,health:RO,recovery:cD({strategy:gD([`restart`,`none`]),maxAttempts:QE().min(0).max(10).default(3)})});uD([cD({targetId:CO}),cD({name:DO})]);var BO=cD({branch:G().max(255).nullable(),commit:G().max(128).nullable(),dirty:eD().nullable()});q({id:CO,projectId:G().min(1).max(128),name:DO,currentArtifactId:TO.nullable(),currentVersion:OO.nullable(),createdAt:QE(),updatedAt:QE()});var VO=gD([`RUNNING`,`SUCCEEDED`,`FAILED`,`CANCELLED`]);q({id:wO,targetId:CO,projectId:G().min(1).max(128),status:VO,spec:zO,specHash:G().regex(/^[a-f0-9]{64}$/),reasonCode:G().max(64).nullable(),logRef:G().min(1).max(1024),startedAt:QE().nullable(),endedAt:QE().nullable(),createdAt:QE()}),q({id:TO,buildId:wO,targetId:CO,projectId:G().min(1).max(128),version:OO,artifactHash:G().regex(/^[a-f0-9]{64}$/),sizeBytes:QE().nonnegative(),fileCount:QE().nonnegative(),source:BO,createdAt:QE()});var HO=gD([`READY`,`WAITING_APPROVAL`,`AUTHORIZED`,`APPLYING`,`HEALTH_CHECK`,`SUCCEEDED`,`FAILED`,`CANCELLED`,`EXPIRED`,`INVALIDATED`,`UNKNOWN`]),UO=cD({strategy:gD([`restart`,`none`]),maxAttempts:QE().min(0).max(10),previousArtifactAvailable:eD(),databaseRollback:J(`unsupported`)}),WO=cD({scope:J(`single-service`),firstDeploy:eD(),restartRequired:J(!0),downtime:J(`brief`),replacesVersion:OO.nullable(),replacesArtifact:TO.nullable()}),GO=cD({version:J(1),targetId:CO,projectId:G().min(1).max(128),artifactId:TO,artifactHash:G().regex(/^[a-f0-9]{64}$/),artifactVersion:OO,previousArtifactId:TO.nullable(),previousVersion:OO.nullable(),specHash:G().regex(/^[a-f0-9]{64}$/),source:BO,health:RO,recovery:UO,impact:WO,expiresAt:QE().positive()});q({id:EO,targetId:CO,projectId:G().min(1).max(128),artifactId:TO,previousArtifactId:TO.nullable(),previousVersion:OO.nullable(),version:OO,status:HO,plan:GO,planHash:G().regex(/^[a-f0-9]{64}$/),expiresAt:QE(),requestedBy:G().min(1).max(128),createdAt:QE()});var KO=G().regex(RegExp(`^dauth_${SO}$`)),qO=G().regex(RegExp(`^dapv_${SO}$`)),JO=gD([`apply`,`start`,`stop`,`restart`,`recover`]),YO=gD([`standard`,`strict`,`readonly`,`autonomous`]),XO=cD({type:gD([`human`,`agent`]),id:G().min(1).max(128)});cD({domain:J(`service-ops`),projectId:G().min(1).max(128),targetId:CO,action:JO.default(`apply`),policy:YO,policySnapshotId:G().min(1).max(128),actor:XO,clientSessionId:G().min(1).max(128).nullable().default(null),sessionId:G().min(1).max(128).nullable().default(null),turnId:G().min(1).max(128).nullable().default(null)});var ZO=cD({domain:J(`service-ops`),projectId:G().min(1).max(128),targetId:CO,planId:EO,action:JO,planHash:G().regex(/^[a-f0-9]{64}$/),artifactHash:G().regex(/^[a-f0-9]{64}$/)}),QO=gD([`PENDING`,`AUTHORIZED`,`DENIED`,`EXPIRED`,`REVOKED`,`CONSUMED`,`INVALIDATED`]),$O=gD([`PENDING`,`APPROVED`,`DENIED`,`EXPIRED`,`REVOKED`]);q({id:KO,planId:EO,targetId:CO,projectId:G().min(1).max(128),action:JO,actorType:gD([`human`,`agent`]),actorId:G().min(1).max(128),clientSessionId:G().min(1).max(128).nullable(),sessionId:G().min(1).max(128).nullable(),turnId:G().min(1).max(128).nullable(),policy:YO,policySnapshotId:G().min(1).max(128),status:QO,planHash:G().regex(/^[a-f0-9]{64}$/),artifactHash:G().regex(/^[a-f0-9]{64}$/),scope:ZO,scopeHash:G().regex(/^[a-f0-9]{64}$/),approvalId:qO.nullable(),expiresAt:QE(),decidedAt:QE().nullable(),consumedAt:QE().nullable(),reasonCode:G().max(64).nullable(),createdAt:QE()}),q({id:qO,authorizationId:KO,planId:EO,targetId:CO,projectId:G().min(1).max(128),status:$O,planHash:G().regex(/^[a-f0-9]{64}$/),artifactHash:G().regex(/^[a-f0-9]{64}$/),requestedBy:G().min(1).max(128),decidedBy:G().min(1).max(128).nullable(),expiresAt:QE(),decidedAt:QE().nullable(),createdAt:QE()});var ek=G().regex(RegExp(`^dep_${SO}$`)),tk=gD([`running`,`stopped`]),nk=gD([`stopped`,`starting`,`running`,`unhealthy`,`stopping`,`failed`,`unknown`]),rk=q({targetId:CO,projectId:G().min(1).max(128),name:DO,pm2Name:G().min(1).max(256),projectName:G().nullable(),source:gD([`pm2-cli`,`deployment`]),version:OO.nullable(),artifactHash:G().regex(/^[a-f0-9]{64}$/).nullable(),desiredState:tk,observedState:nk,pid:QE().positive().nullable(),lastHealthAt:QE().nullable(),reasonCode:G().max(64).nullable(),updatedAt:QE()}),ik=q({pm2Home:G().min(1).max(4096).optional(),items:oD(rk),unassociated:oD(q({pm2Name:G(),reason:G()}))}),ak=gD([`APPLYING`,`HEALTH_CHECK`,`SUCCEEDED`,`FAILED`,`UNKNOWN`]);q({id:ek,targetId:CO,planId:EO,authorizationId:KO,artifactId:TO,previousArtifactId:TO.nullable(),previousVersion:OO.nullable(),version:OO,status:ak,planHash:G().regex(/^[a-f0-9]{64}$/),artifactHash:G().regex(/^[a-f0-9]{64}$/),reasonCode:G().max(64).nullable(),startedAt:QE(),endedAt:QE().nullable(),createdAt:QE()}),q({topic:J(`service-ops`),resourceId:CO,after:QE().min(0).max(2**53-1).default(0)}).strict(),q({observedState:nk,desiredState:tk,version:OO.nullable(),artifactHash:G().regex(/^[a-f0-9]{64}$/).nullable(),pid:QE().positive().nullable(),deploymentId:ek.nullable(),reasonCode:G().max(64).nullable()});var ok=G().regex(RegExp(`^sauth_${SO}$`)),sk=gD([`start`,`stop`,`restart`,`recover`]),ck=gD([`PENDING`,`AUTHORIZED`,`DENIED`,`EXPIRED`,`REVOKED`,`CONSUMED`]);cD({domain:J(`service-ops`),projectId:G().min(1).max(128),targetId:CO,action:sk,artifactHash:G().regex(/^[a-f0-9]{64}$/),version:OO}),q({id:ok,targetId:CO,projectId:G().min(1).max(128),action:sk,actorType:gD([`human`,`agent`]),actorId:G().min(1).max(128),clientSessionId:G().min(1).max(128).nullable(),sessionId:G().min(1).max(128).nullable(),turnId:G().min(1).max(128).nullable(),policy:YO,policySnapshotId:G().min(1).max(128),status:ck,artifactHash:G().regex(/^[a-f0-9]{64}$/),version:OO,scopeHash:G().regex(/^[a-f0-9]{64}$/),expiresAt:QE(),decidedAt:QE().nullable(),decidedBy:G().min(1).max(128).nullable(),consumedAt:QE().nullable(),reasonCode:G().max(64).nullable(),createdAt:QE()}),cD({version:J(1),artifactId:TO,targetId:CO,hash:G().regex(/^[a-f0-9]{64}$/),files:oD(cD({path:G().min(1).max(1024),size:QE().nonnegative(),hash:G().regex(/^[a-f0-9]{64}$/)}))}),q({available:eD(),nodeExecutable:G(),entry:G().nullable(),version:G().nullable(),home:G(),namespace:J(`larness`),serviceNamePattern:J(`larness:<projectId>:<serviceKey>`),project:q({id:G(),name:G(),root:G(),releaseRoot:G()}).nullable(),unassociatedServices:oD(q({pm2Name:G(),reason:G()})).optional(),services:oD(q({projectId:G(),projectName:G(),name:G(),pm2Name:G(),observedState:nk,pid:QE().nullable(),updatedAt:QE()}))});var lk=eD().default(!1),uk=`workspace.sessions.changed`,dk=`workspace.jobs.changed`,fk=fD(`kind`,[q({kind:J(`subscribed`),subscription:q({topic:J(`system`),resourceId:J(`system`)})}),q({kind:J(uk)})]),pk=q({kind:J(dk)}),mk=oD(q({path:G().min(1),changeType:gD([`created`,`modified`]),version:G().min(1),existed:eD(),category:gD([`deliverable`,`process`])})),hk=G().min(1).max(4096).refine(e=>!e.includes(`\0`),`Git path cannot contain NUL`),gk=G().min(1).max(255).refine(e=>!e.includes(`\0`)&&!e.startsWith(`-`),`Invalid branch name`);uD([q({action:J(`add`),paths:oD(hk).min(1).max(200)}).strict(),q({action:J(`unstage`),paths:oD(hk).min(1).max(200)}).strict(),q({action:J(`discard`),path:hk,confirmed:J(!0)}).strict(),q({action:J(`commit`),message:G().min(1).max(4e3)}).strict(),q({action:J(`createBranch`),name:gk}).strict(),q({action:J(`switchBranch`),name:gk}).strict(),q({action:J(`pull`)}).strict(),q({action:J(`push`)}).strict()]),q({decision:gD([`approve`,`reject`])}).strict(),q({path:G().min(1).max(4096),staged:gD([`true`,`false`]).default(`false`)}).strict(),q({limit:VD().int().min(1).max(100).default(50),cursor:VD().int().nonnegative().default(0)}).strict(),q({limit:VD().int().min(1).max(200).default(100),cursor:VD().int().nonnegative().default(0)}).strict(),gD([`script`,`agent`]);var _k=gD([`skip`,`run_once`]),vk=gD([`readonly`,`autonomous`]);gD([`scheduled`,`manual`,`catch_up`]),gD([`queued`,`running`,`succeeded`,`failed`,`timed_out`,`cancelled`,`interrupted`,`skipped`]),gD([`JOB_SCRIPT_FAILED`,`JOB_TIMEOUT`,`JOB_RUN_CANCELLED`,`JOB_AGENT_FAILED`,`JOB_AGENT_INCOMPLETE`,`JOB_INTERRUPTED`,`JOB_OVERLAP`]);var yk=G().min(9).max(128).refine(e=>e.trim().split(/\s+/).length===5,`Cron 必须是 5 字段`),bk=G().min(1).max(64),xk=fD(`type`,[q({type:J(`cron`),expression:yk,timezone:bk}).strict(),q({type:J(`interval`),seconds:K().int().min(60).max(604800),timezone:bk}).strict()]),Sk={name:G().trim().min(1).max(80),projectId:G().min(1).max(128).nullable(),schedule:xk,enabled:eD().default(!0),timeoutSeconds:K().int().min(60).max(3600).default(600),missedPolicy:_k.default(`skip`)};fD(`kind`,[q({...Sk,kind:J(`script`),script:q({source:G().min(1).max(65536)}).strict()}).strict(),q({...Sk,kind:J(`agent`),agent:q({prompt:G().trim().min(1).max(10240),model:G().min(1).max(128).nullable().optional(),credentialProfileId:G().min(1).max(128).nullable().optional(),thinking:G().min(1).max(32).nullable().optional(),approvalPolicy:vk.default(`readonly`)}).strict()}).strict()]),q({name:G().trim().min(1).max(80).optional(),enabled:eD().optional(),schedule:xk.optional(),timeoutSeconds:K().int().min(60).max(3600).optional(),missedPolicy:_k.optional(),script:q({source:G().min(1).max(65536)}).strict().optional(),agent:q({prompt:G().trim().min(1).max(10240).optional(),model:G().min(1).max(128).nullable().optional(),credentialProfileId:G().min(1).max(128).nullable().optional(),thinking:G().min(1).max(32).nullable().optional(),approvalPolicy:vk.optional()}).strict().optional()}).strict();var Ck=q({id:G().min(1).max(80),title:G().trim().min(1).max(200),detail:G().max(500).optional(),status:gD([`pending`,`running`,`done`,`failed`])}).strict(),wk=q({title:G().trim().min(1).max(200),steps:oD(Ck).min(1).max(12)}).strict().superRefine((e,t)=>{new Set(e.steps.map(e=>e.id)).size!==e.steps.length&&t.addIssue({code:`custom`,message:`Step IDs must be unique`}),e.steps.filter(e=>e.status===`running`).length>1&&t.addIssue({code:`custom`,message:`Only one step can be running`})}).safeExtend({id:G().min(1),kind:J(`plan`),createdAt:K().int().nonnegative(),turnId:G().optional()}),Tk=G().regex(/^term_[a-f0-9-]{36}$/);q({title:G().min(1).max(80).refine(e=>[...e].every(e=>{let t=e.codePointAt(0)??0;return t>=32&&(t<127||t>159)})).transform(e=>e.trim()).pipe(G().min(1))}).strict();var Ek=G().regex(/^[a-zA-Z0-9_-]{1,64}$/),Dk=gD([`CREATED`,`RUNNING`,`STOPPING`,`EXITED`,`TERMINATED`,`INTERRUPTED`]);q({scope:GD.optional(),cwd:KD.default(`.`),sourceSessionId:G().min(1).max(128).optional(),riskAcknowledged:J(!0)}).strict(),q({role:Ek,executable:G(),args:oD(G()),cwd:KD.default(`.`).describe(`Project-relative working directory. Defaults to the project root (.). Use the package directory for a direct package command.`)}).strict().superRefine((e,t)=>{QD.safeParse(e&&{executable:e.executable,args:e.args,cwd:e.cwd}).success||t.addIssue({code:`custom`,message:`Invalid program parameters`})}),q({terminalId:Tk,after:K().int().nonnegative().max(2**53-1).default(0),limit:K().int().min(1).max(500).default(100)}).strict(),q({terminalId:Tk}).strict();var Ok=q({kind:J(`terminal`),projectId:G().min(1),terminalId:Tk,role:Ek.nullable()}).strict(),kk=uD([ZD,Ok,q({kind:J(`preview`),projectId:G().min(1).max(128),serviceId:G().regex(/^svc_[a-f0-9-]{36}$/),path:G().min(1).max(2048),name:G().min(1).max(128).optional()}).strict()]);q({connectionId:G().uuid()}).strict(),q({terminalId:Tk}).strict(),q({terminalId:Tk,leaseGeneration:K().int().positive(),inputSequence:K().int().positive().max(2**53-1),data:G().min(1).max(8192).refine(e=>new TextEncoder().encode(e).length<=8192)}).strict(),q({terminalId:Tk,leaseGeneration:K().int().positive()}).strict(),q({terminalId:Tk,leaseGeneration:K().int().positive()}).strict(),q({action:gD([`acquire`,`renew`,`release`]),connectionId:G().uuid(),leaseGeneration:K().int().positive().optional()}).strict(),q({connectionId:G().uuid(),leaseGeneration:K().int().positive(),cols:K().int().min(2).max(500),rows:K().int().min(1).max(300)}).strict(),q({type:J(`terminal.input`),terminalId:Tk,leaseGeneration:K().int().positive(),inputSequence:K().int().positive().max(2**53-1),data:G().max(8192).refine(e=>new TextEncoder().encode(e).length<=8192)}).strict(),q({topic:J(`terminal`),resourceId:Tk,after:K().int().nonnegative().max(2**53-1).default(0)}).strict();var Ak=q({cursor:K().int().positive(),data:G().max(16384).refine(e=>new TextEncoder().encode(e).length<=16384),timestamp:K().int()}).strict(),jk=Ak.extend({kind:J(`terminal.output`),resourceId:Tk}).strict(),Mk=q({ownerType:gD([`human`,`agent`]),ownerClientSessionId:G(),ownerConnectionId:G().nullable(),ownerTurnId:G().nullable(),ownerExecutionId:G().nullable(),generation:K().int().positive(),expiresAt:K().int()}),Nk=q({status:Dk,exitCode:K().int().nullable(),reasonCode:G().nullable(),lease:Mk.nullable()}),Pk=q({kind:J(`event`),protocolVersion:J(1),topic:J(`terminal`),eventId:G(),streamId:Tk,resourceId:Tk,sequence:K().int().positive(),timestamp:K(),type:gD([`terminal.created`,`terminal.status`,`terminal.exit`,`terminal.lease`]),payload:Nk}),Fk=q({writeBlocked:eD(),id:Tk,projectId:G().nullable(),workspaceSessionId:G().nullable(),sourceSessionId:G().nullable(),cwd:G(),shell:G(),mode:gD([`shell`,`dev`]),role:G().nullable(),title:G().nullable().default(null),status:Dk,exitCode:K().nullable(),reasonCode:G().nullable(),currentSequence:K().int(),lease:Mk.nullable()}),Ik=q({chunks:oD(Ak).max(500),nextCursor:K().int(),oldestCursor:K().int(),truncated:eD(),resyncRequired:eD()}),Lk=q({kind:J(`subscribed`),connectionId:G().uuid(),subscription:q({topic:J(`terminal`),resourceId:G()})}),Rk=q({kind:J(`terminal.input.ack`),inputSequence:K().int(),accepted:eD()}),zk=q({kind:J(`error`),code:G()}),Bk=q({items:oD(Fk),nextCursor:Tk.nullable()}),Vk=G().regex(/^svc_[a-f0-9-]{36}$/),Hk=gD([`REGISTERING`,`STARTING`,`RUNNING`,`UNKNOWN`,`UNREGISTERED`]),Uk=J(`temporary`),Wk=q({host:gD([`127.0.0.1`,`::1`]),port:K().int().min(1).max(65535),protocol:J(`http`)}).strict(),Gk=q({kind:Uk.describe(`temporary development preview only; registration does not create a persistent PM2 service`),terminalId:Tk.describe(`Managed terminal owning the real listening process; not a PM2 targetId or pm2Name`),name:G().trim().min(1).max(80),endpoint:Wk.describe(`Use the terminal listener's port and a loopback host value. The backend discovers the actual bind address, including wildcard listeners.`)}).strict(),Kk=q({id:Vk,projectId:G().min(1).max(128),sourceSessionId:G().min(1).max(128).nullable(),name:G().min(1).max(80),kind:Uk,status:Hk,terminalId:Tk,terminalExecutionId:G().min(1).max(128),endpointGeneration:K().int().nonnegative(),endpoint:Wk,previewEligible:eD(),reasonCode:G().nullable(),createdAt:K().int(),updatedAt:K().int(),endedAt:K().int().nullable()}),qk=q({items:oD(Kk),nextCursor:G().nullable()}),Jk=q({id:G().min(1).max(128),projectId:G().min(1).max(128),kind:J(`service.register`),risk:J(`L2`),status:gD([`PREPARED`,`WAITING_APPROVAL`,`APPROVED`,`RUNNING`,`COMPLETED`,`FAILED`,`REJECTED`,`EXPIRED`,`INTERRUPTED`]),params:Gk,paramsHash:G(),snapshotVersion:G(),requestedBy:G(),decidedBy:G().nullable(),expiresAt:K().int(),decidedAt:K().int().nullable(),startedAt:K().int().nullable(),endedAt:K().int().nullable(),result:nD(),createdAt:K().int()}),Yk=q({status:Hk,terminalId:Tk,terminalExecutionId:G().min(1).max(128),endpointGeneration:K().int().nonnegative(),reasonCode:G().nullable()});q({topic:J(`service`),resourceId:Vk,after:K().int().min(0).max(2**53-1).default(0)}).strict();var Xk=G().regex(/^(?:(?:project|session):[a-zA-Z0-9_-]{1,128}|workspace:default)$/),Zk=G().regex(/^file:(?:(?:project|session):[a-zA-Z0-9_-]{1,128}|workspace:default)$/);q({topic:J(`file`),resourceId:Xk,paths:oD(KD).min(1).max(128).default([`.`]),after:K().int().min(0).max(2**53-1).default(0)}).strict(),q({streamId:uD([Zk,nO,Tk,Vk,G().regex(/^ops:tgt_[0-9a-f-]{36}$/)]),after:VD().int().min(0).max(2**53-1).default(0),limit:VD().int().min(1).max(500).default(100)}).strict();var Qk=q({path:KD,version:qD.optional(),changeType:gD([`created`,`modified`,`deleted`])}),$k=q({reasonCode:gD([`WATCH_UNAVAILABLE`,`WATCH_LIMIT`,`SCAN_LIMIT`,`QUEUE_OVERFLOW`,`ROOT_UNAVAILABLE`,`DIRECTORY_REPLACED`,`RECOVERED`,`SCAN_FAILED`])}),eA=q({kind:J(`event`),protocolVersion:J(1),topic:J(`file`),eventId:G(),streamId:Zk,sequence:K().int().nonnegative(),timestamp:K()}),tA=uD([eA.extend({type:J(`file.changed`),payload:Qk}),eA.extend({type:J(`file.resync.required`),payload:$k})]),nA=q({items:oD(uD([tA,rO,Pk,uD([q({kind:J(`event`),protocolVersion:J(1),topic:J(`service`),eventId:G(),streamId:Vk,sequence:K().int().nonnegative(),timestamp:K(),projectId:G().optional()}).extend({type:gD([`service.registered`,`service.status`,`service.unregistered`]),payload:Yk})])])),currentSequence:K().int().nonnegative(),resyncRequired:eD()}),rA=q({kind:J(`subscribed`),subscription:q({topic:J(`file`),resourceId:Xk}),currentSequence:K().int().nonnegative(),resyncRequired:eD(),partial:eD()}),iA=q({kind:J(`error`),code:G(),message:G()}),aA=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.name=`ApiError`,this.status=e,this.code=t,this.details=r}};function oA(e,t){if(!(e instanceof aA))return t;switch(e.code){case`RESOURCE_LOCKED`:return`项目正在写入,请稍后重试。`;case`FORBIDDEN`:case`UNAUTHORIZED`:return`当前操作没有权限。`;case`VALIDATION_ERROR`:return`输入无效,请核对后重试。`;default:return t}}var sA=null;function cA(e){sA=e}var lA=``;async function Y(e,t={}){let n={accept:`application/json`,...t.headers};t.body!==void 0&&(n[`content-type`]=`application/json`),t.csrf&&(n[`x-csrf-token`]=sA??``);let r=await fetch(`${lA}${e}`,{method:t.method??`GET`,credentials:`same-origin`,headers:n,body:t.body===void 0?void 0:JSON.stringify(t.body)}),i=await r.text(),a;if(i.length>0)try{a=JSON.parse(i)}catch{a=void 0}if(!r.ok){let t=a?.error,n=t?.code??`INTERNAL`,i=t?.message??`Request failed with ${r.status}`;throw r.status===401&&e!==`/api/auth/session`&&window.dispatchEvent(new Event(`larness:unauthenticated`)),new aA(r.status,n,i,t?.details)}return a}async function uA(e){return Y(`/api/fs/directories${e===void 0?``:`?path=${encodeURIComponent(e)}`}`)}async function dA(){return(await Y(`/api/projects`)).projects}async function fA(e){return Y(`/api/projects`,{method:`POST`,body:e,csrf:!0})}async function pA(e){await Y(`/api/projects/order`,{method:`PUT`,body:{projectIds:e},csrf:!0})}async function mA(e){await Y(`/api/projects/${encodeURIComponent(e)}`,{method:`DELETE`,csrf:!0})}async function hA(e,t){await Y(`/api/projects/${encodeURIComponent(e)}`,{method:`PATCH`,body:t,csrf:!0})}async function gA(){return(await Y(`/api/models`)).models}async function _A(){return Y(`/api/models/catalog`)}async function vA(e){await Y(`/api/models/default`,{method:`PUT`,body:e,csrf:!0})}async function yA(e){await Y(`/api/models/catalog/visibility`,{method:`PATCH`,body:e,csrf:!0})}async function bA(){return Y(`/api/models/catalog/refresh`,{method:`POST`,body:{},csrf:!0})}async function xA(){return(await Y(`/api/credentials`)).credentials}async function SA(e){return Y(`/api/credentials`,{method:`POST`,body:e,csrf:!0})}async function CA(e,t){await wA(e,{endpoint:t})}async function wA(e,t){await Y(`/api/credentials/${encodeURIComponent(e)}`,{method:`PATCH`,body:t,csrf:!0})}async function TA(e){await Y(`/api/credentials/${encodeURIComponent(e)}`,{method:`DELETE`,csrf:!0})}async function EA(){return(await Y(`/api/sessions?limit=100`)).sessions}async function DA(e){return Y(`/api/sessions`,{method:`POST`,body:e,csrf:!0})}async function OA(e){return Y(`/api/sessions/${encodeURIComponent(e)}`)}async function kA(e,t){return Y(`/api/sessions/${encodeURIComponent(e)}`,{method:`PATCH`,body:t,csrf:!0})}async function AA(e){await Y(`/api/sessions/${encodeURIComponent(e)}`,{method:`DELETE`,csrf:!0})}async function jA(e,t,n){return Y(`/api/sessions/${encodeURIComponent(e)}/turns`,{method:`POST`,body:t,csrf:!0,headers:{"idempotency-key":n}})}async function MA(e){return Y(`/api/turns/${encodeURIComponent(e)}/cancel`,{method:`POST`,body:{},csrf:!0})}async function NA(e){return Y(`/api/turns/${encodeURIComponent(e)}/resume`,{method:`POST`,body:{},csrf:!0})}async function PA(e,t=0,n=200){return Y(`/api/sessions/${encodeURIComponent(e)}/events?after=${t}&limit=${n}`)}async function FA(e,t=0,n=200){let r=[],i=t;for(;;){let t=await PA(e,i,n);if(r.push(...t.items),i=t.nextSeq,!t.hasMore)return r}}async function IA(e,t){await Y(`/api/approvals/${encodeURIComponent(e)}`,{method:`POST`,body:{decision:t},csrf:!0})}function LA(e){let t=[`#0A84FF`,`#FF9F0A`,`#30D158`,`#BF5AF2`,`#64D2FF`],n=Array.from(e.id).reduce((e,t)=>e+t.charCodeAt(0),0);return{id:e.id,kind:e.kind,name:e.name,rootPath:e.realPath,branch:null,git:e.gitDetected,accent:t[n%t.length]??t[0]}}function RA(e){return{id:e.id,label:e.label,provider:e.provider===`openai-compatible`?`openai-compatible`:`deepseek`,model:e.model,detail:`${Math.round(e.capabilities.maxContextTokens/1e3)}K 上下文 · 工具调用`,maxContextTokens:e.capabilities.maxContextTokens}}function zA(e){return{workspaceKind:UD.parse(e.workspaceKind??(e.projectId?`project`:`session`)),workspacePath:e.workspacePath,id:e.id,projectId:e.projectId,title:e.title,status:lk.parse(e.hasActiveTurn)?`running`:`idle`,updatedAt:e.updatedAt}}var BA=Date.now(),VA=e=>e*6e4,HA=[{id:`prj_larness`,name:`larness-web`,rootPath:`/Users/bulv/Desktop/Larness`,branch:`feat/agent-runtime`,git:!0,accent:`#0A84FF`},{id:`prj_docs`,name:`docs-site`,rootPath:`/Users/bulv/Desktop/docs-site`,branch:null,git:!1,accent:`#FF9F0A`}],UA=[{id:`ses_1`,projectId:`prj_larness`,title:`实现 Agent 工具调用审批`,status:`idle`,updatedAt:BA-VA(2)},{id:`ses_2`,projectId:`prj_larness`,title:`修复终端重连时的 Tab 状态`,status:`idle`,updatedAt:BA-VA(48)},{id:`ses_3`,projectId:`prj_docs`,title:`整理文档站首页导航`,status:`idle`,updatedAt:BA-VA(95)},{id:`ses_4`,projectId:null,title:`调研 DeepSeek 流式工具调用`,status:`idle`,updatedAt:BA-VA(26)},{id:`ses_5`,projectId:null,title:`整理本周部署记录`,status:`idle`,updatedAt:BA-VA(180)}],WA=[{id:`mdl_deepseek_chat`,label:`DeepSeek V3.2`,provider:`deepseek`,model:`deepseek-chat`,detail:`128K 上下文 · 工具调用`,maxContextTokens:128e3},{id:`mdl_deepseek_reasoner`,label:`DeepSeek R1`,provider:`deepseek`,model:`deepseek-reasoner`,detail:`推理模式 · 64K 上下文`,maxContextTokens:64e3},{id:`mdl_glm`,label:`GLM-4.6`,provider:`glm`,model:`glm-4.6`,detail:`200K 上下文 · 工具调用`,maxContextTokens:2e5}],GA=[{id:`svc_web_dev`,projectId:`prj_larness`,name:`web-dev`,port:5173,status:`running`,runtime:`native`,kind:`development`,pid:48213,uptime:`2h 14m`},{id:`svc_api_dev`,projectId:`prj_larness`,name:`api-dev`,port:3001,status:`running`,runtime:`native`,kind:`development`,pid:48277,uptime:`1h 52m`},{id:`svc_web_prod`,projectId:`prj_larness`,name:`web-prod`,port:8080,status:`stopped`,runtime:`pm2`,kind:`production`},{id:`svc_docs_dev`,projectId:`prj_docs`,name:`docs-dev`,port:4321,status:`running`,runtime:`native`,kind:`development`,pid:48311,uptime:`38m`}],KA=[{id:`ter_1`,projectId:`prj_larness`,title:`pnpm dev`,cwd:`/Users/bulv/Desktop/Larness`,port:5173,status:`running`},{id:`ter_2`,projectId:null,title:`zsh`,cwd:`~`,status:`running`},{id:`ter_3`,projectId:`prj_docs`,title:`pnpm docs:dev`,cwd:`/Users/bulv/Desktop/docs-site`,port:4321,status:`running`}],qA=[{path:`apps/web/src/app/AppShell.tsx`,status:`modified`,staged:!1,additions:42,deletions:8},{path:`apps/web/src/features/chat/Composer.tsx`,status:`modified`,staged:!1,additions:18,deletions:3},{path:`packages/shared/src/events.ts`,status:`modified`,staged:!0,additions:9,deletions:0},{path:`docs/architecture/overview.md`,status:`modified`,staged:!0,additions:6,deletions:1},{path:`apps/web/src/components/windows/WindowLayer.tsx`,status:`added`,staged:!1,additions:74,deletions:0}],JA={cpuPercent:38,memoryUsedBytes:9.6*1024**3,memoryTotalBytes:16*1024**3,diskUsedBytes:284*1024**3,diskTotalBytes:460*1024**3,sampledAt:BA},YA=[{id:`msg_u_1`,kind:`message`,role:`user`,text:`把首页改成三栏工作台,然后构建并部署到生产服务。`,createdAt:BA-VA(6)},{id:`msg_a_1`,kind:`message`,role:`assistant`,text:`我先检查项目结构、构建脚本和现有端口,再把首页替换为三栏布局。构建完成后会给出部署计划,等你确认后才会切换生产服务。`,createdAt:BA-VA(5)},{id:`plan_1`,kind:`plan`,title:`执行计划`,createdAt:BA-VA(5),steps:[{id:`step_1`,title:`检查项目结构与构建脚本`,status:`done`},{id:`step_2`,title:`实现三栏工作台与窗口层`,status:`done`,detail:`12 个文件`},{id:`step_3`,title:`构建 web 并验证产物`,status:`done`},{id:`step_4`,title:`部署 web-prod 到 8080`,status:`pending`,detail:`等待你的批准`}]},{id:`tool_1`,kind:`tool`,name:`read_file`,summary:`读取 package.json 与 vite.config.ts`,args:`{ "paths": ["package.json", "apps/web/vite.config.ts"] }`,status:`done`,output:`2 个文件 · 1.8 KB · 发现 build / preview 脚本`,durationMs:84,createdAt:BA-VA(5)},{id:`tool_2`,kind:`tool`,name:`run_command`,summary:`pnpm --filter @larness/web build`,args:`{ "command": "pnpm --filter @larness/web build", "cwd": "." }`,status:`done`,output:`vite v7.1.7 building for production…
105
- ✓ 1842 modules transformed
106
- dist/assets/index-8f2a1c.js 412.8 kB │ gzip: 126.4 kB
107
- ✓ built in 3.42s`,durationMs:3421,createdAt:BA-VA(4)},{id:`appr_1`,kind:`approval`,serviceName:`web-prod`,port:8080,version:`c0f3a2d · build 2026-10-31 20:44`,impact:`替换当前停止中的生产服务;健康检查通过后写入部署记录。`,status:`pending`,createdAt:BA-VA(3)}],XA={projects:HA,sessions:UA,models:WA,host:JA,services:GA,terminals:KA,gitChanges:qA},ZA=new rp({defaultOptions:{queries:{staleTime:1/0,refetchOnWindowFocus:!1,retry:!1}}}),QA={projects:[],sessions:[],models:[],host:{cpuPercent:0,memoryUsedBytes:0,memoryTotalBytes:0,diskUsedBytes:0,diskTotalBytes:0,sampledAt:0},services:[],terminals:[],gitChanges:[]};async function $A(){let[e,t,n]=await Promise.all([dA(),EA(),gA()]);return{...QA,projects:e.map(LA),sessions:t.map(zA),models:n.map(RA)}}function ej(){let e=gp({queryKey:[`workspace`],queryFn:$A,enabled:!0,staleTime:0}),t=e.data??QA;return{...e,data:t,isPending:e.isPending}}function tj(){let e=gp({queryKey:[`model-catalog`],queryFn:_A,enabled:!0,staleTime:0,retry:!1});return{catalog:e.data,isPending:e.isPending,error:e.error,refetch:e.refetch}}function nj(e){return gp({queryKey:[`session-model`,e],queryFn:()=>OA(e??``),enabled:e!==null,staleTime:0,retry:!1}).data??null}var rj=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},ij=(e=>e?rj(e):rj),aj=e=>e;function oj(e,t=aj){let n=H.useSyncExternalStore(e.subscribe,H.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return H.useDebugValue(n),n}var sj=e=>{let t=ij(e),n=e=>oj(t,e);return Object.assign(n,t),n},cj=(e=>e?sj(e):sj);function lj(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return uj(i)?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var uj=e=>typeof e?.then==`function`,dj=e=>({then(t){return t?fj(t)(e):this}}),fj=e=>t=>{try{let n=e(t);return uj(n)?n:dj(n)}catch(e){return{then(t,n){return n?fj(n)(e):this}}}},pj=(e,t)=>(n,r,i)=>{let a={storage:lj(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(...e)=>(f(...e),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return fj(u.getItem.bind(u))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return uj(t)?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).then(()=>void 0,n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{++s,u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>{try{return Promise.resolve(h())}catch(e){return Promise.reject(e)}},hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p},mj=new Map;function hj(e){mj.get(e)?.cancel(),mj.delete(e)}function gj(e,t){if(mj.has(e))return;let n=document.querySelector(`[data-window-frame="${CSS.escape(e)}"]`),r=document.querySelector(`[aria-label="项目窗口"]`);if(!n?.animate||!r||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){t();return}let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=getComputedStyle(n).transform,s=o&&o!==`none`?`${o} `:``,c=n.animate([{transform:`${s}translate(0, 0) scale(1)`,opacity:1,pointerEvents:`none`},{transform:`${s}translate(${a.x+a.width/2-i.x-i.width/2}px, ${a.y+a.height/2-i.y-i.height/2}px) scale(.08)`,opacity:0,pointerEvents:`none`}],{duration:200,easing:`cubic-bezier(.4,0,.2,1)`,fill:`forwards`});mj.set(e,c),c.finished.then(()=>{mj.get(e)===c&&t()}).catch(()=>{}).finally(()=>{mj.get(e)===c&&mj.delete(e),c.cancel()})}function _j(e,t){return t.mode===`all`?!0:t.mode===`global`?e.projectId===null:e.projectId===t.projectId}function vj(e,t){return e.filter(e=>_j(e,t))}function yj(e,t){if(e[0]?.kind===`terminal`){let n=e.filter(e=>e.resourceId!==`terminal:empty`);return n.find(e=>e.id===t)??n.at(-1)??e[0]}return e.find(e=>e.id===t)??e[0]}function bj(e,t){let n=e.length;for(let r=e.length-1;r>=0;--r)if(e[r]?.projectId===t.projectId){n=r+1;break}let r=[...e];return r.splice(n,0,t),r}var xj=8,Sj={files:{width:760,height:520},terminal:{width:680,height:420},services:{width:620,height:460},browser:{width:760,height:540},"git-diff":{width:720,height:480}};function Cj(e,t){let n=Math.max(420,Math.min(e.width,Math.max(420,t.width-16))),r=Math.max(280,Math.min(e.height,Math.max(280,t.height-16))),i=Math.max(xj,t.width-n-xj),a=Math.max(xj,t.height-r-xj);return{width:n,height:r,x:Math.min(Math.max(xj,e.x),i),y:Math.min(Math.max(xj,e.y),a)}}function wj(e,t,n){let r=Sj[e],i=Math.min(r.width,n.width-16),a=Math.min(r.height,n.height-16),o=t%5*28;return Cj({width:i,height:a,x:Math.max(xj,n.width-i-56-o),y:Math.max(xj,32+o)},n)}function Tj(e,t=null){return e?`project:${e}`:t?`session:${t}`:`global`}function Ej(e){let t=e.tabs[0];return Tj(t?.projectId??null,t?.sourceSessionId??null)}function Dj(){return{width:window.innerWidth,height:Math.max(480,window.innerHeight-48)}}function Oj(e){return`${e}_${crypto.randomUUID()}`}function kj(e){return e.reduce((e,t)=>Math.max(e,t.z),0)}function Aj(e){return!e||e===`header`?`global`:e}function jj(e,t){return!e||e===`header`?null:t?{mode:`project`,projectId:t}:{mode:`global`}}var Mj=new Set([`ter_1`,`svc_web_dev`,`browser_preview`]);function Nj(e){return e.projectId===`prj_larness`||Mj.has(e.resourceId)||e.kind===`services`&&e.resourceId.startsWith(`svc_`)||e.kind===`browser`&&e.browser===void 0||e.kind===`files`&&e.file===void 0||e.kind===`git-diff`&&e.git===void 0}function Pj(e,t){let n=e??{};if(!Array.isArray(n.windows))return e;let r=Date.now(),i=0,a=n.windows.flatMap(e=>{let t=e.tabs.filter(e=>!Nj(e)).map(e=>({...e,viewKey:e.viewKey??(e.kind===`files`&&e.file?`file:${e.resourceId}`:e.kind===`git-diff`&&e.git?`diff:${e.projectId}:${e.git.path}`:e.kind===`browser`&&e.browser?`browser:${e.browser.serviceId}:${e.browser.path}`:`${e.kind}:${e.resourceId}`),createdAt:e.createdAt??r+i++}));if(!t.length)return[];let n=new Map;for(let e of t){let t=`${e.kind}:${Tj(e.projectId,e.sourceSessionId)}`;n.set(t,[...n.get(t)??[],e])}return[...n.values()].map((t,n)=>({...e,id:n===0?e.id:`${e.id}:scope:${n}`,tabs:t,filter:{mode:`all`},activeTabId:yj(t,e.activeTabId)?.id??null}))});return{windows:a,focusedId:a.some(e=>e.id===n.focusedId)?n.focusedId??null:a.at(-1)?.id??null,zCounter:n.zCounter??10,lastFilters:n.lastFilters??{}}}var Fj=cj()(pj((e,t)=>({closeRequest:null,windows:[],focusedId:null,zCounter:10,lastFilters:{},open:({kind:n,resourceId:r,title:i,projectId:a=null,sessionId:o=null,source:s=`header`,file:c,git:l,browser:u,activate:d=!0})=>{let f=t(),p=n===`files`&&c?`file:${r}`:n===`git-diff`&&l?`diff:${a}:${l.path}`:n===`browser`&&u?`browser:${u.serviceId}:${u.path}`:`${n}:${r}`,m=Tj(a,o),h=f.windows.find(e=>Ej(e)===m&&e.tabs.some(e=>e.viewKey?e.viewKey===p:e.kind===n&&e.resourceId===r)),g=Math.max(f.zCounter+1,kj(f.windows)+1),_=jj(s,a);if(h){d&&hj(h.id);let t=h.tabs.find(e=>e.viewKey?e.viewKey===p:e.kind===n&&e.resourceId===r),i=t&&(c||l||u)?{...t,...c?{file:c}:{},...l?{git:l}:{},...u?{browser:u}:{},projectId:a,sourceSessionId:o,originType:Aj(s)}:void 0,m=i&&t?t.projectId===a?h.tabs.map(e=>e.id===t.id?i:e):bj(h.tabs.filter(e=>e.id!==t.id),i):h.tabs,v=t?_j(t,h.filter):!1,y=d?_??(v?h.filter:{mode:`all`}):v?h.filter:{mode:`all`};e({windows:f.windows.map(e=>e.id===h.id?{...e,...d?{minimized:!1,activeTabId:t?.id??e.activeTabId,z:g}:{},filter:y,tabs:m}:e),...d?{focusedId:h.id}:{},zCounter:d?g:f.zCounter,lastFilters:{...f.lastFilters,[n]:y}});return}let v={id:Oj(`tab`),kind:n,resourceId:r,viewKey:p,createdAt:Date.now(),title:i,projectId:a,sourceSessionId:o,originType:Aj(s),...c?{file:c}:{},...l?{git:l}:{},...u?{browser:u}:{}},y=f.windows.find(e=>Ej(e)===m&&e.tabs.some(e=>e.kind===n));if(y){d&&hj(y.id);let t=bj(y.tabs,v),r=_??y.filter;_j(v,r)||(r={mode:`all`}),e({windows:f.windows.map(e=>e.id===y.id?{...e,tabs:t,...d?{activeTabId:v.id,minimized:!1,z:g}:{},filter:r}:e),...d?{focusedId:y.id}:{},zCounter:d?g:f.zCounter,lastFilters:{...f.lastFilters,[n]:r}});return}let b=_??f.lastFilters[n]??{mode:`all`};_j(v,b)||(b={mode:`all`});let x=wj(n,f.windows.length,Dj()),S={id:Oj(`win`),tabs:[v],activeTabId:d?v.id:null,filter:b,...x,z:g,minimized:!d,maximized:!1,pinned:!1,restore:null};e({windows:[...f.windows,S],...d?{focusedId:S.id}:{},zCounter:g,lastFilters:{...f.lastFilters,[n]:b}})},focus:n=>{hj(n);let r=t(),i=r.windows.find(e=>e.id===n);if(!i)return;let a=yj(vj(i.tabs,i.filter),i.activeTabId)?.id??null;if(r.focusedId===n&&!i.minimized&&a===i.activeTabId)return;let o=Math.max(r.zCounter+1,kj(r.windows)+1);e({windows:r.windows.map(e=>e.id===n?{...e,activeTabId:a,minimized:!1,z:o}:e),focusedId:n,zCounter:o})},close:n=>{let r=t().windows.find(e=>e.id===n);r&&(r.tabs.some(e=>[`files`,`git-diff`,`browser`].includes(e.kind))?e({closeRequest:{windowId:n,tabIds:r.tabs.map(e=>e.id)}}):t().hide(n))},hide:n=>{gj(n,()=>{let r=t();e({windows:r.windows.map(e=>e.id===n?{...e,minimized:!0}:e),focusedId:r.focusedId===n?r.windows.find(e=>e.id!==n&&!e.minimized)?.id??null:r.focusedId})})},hideScope:e=>{let{windows:n,hide:r}=t();for(let t of n)!t.minimized&&!t.pinned&&Ej(t)===e&&r(t.id)},restore:e=>{t().focus(e)},toggleMaximize:n=>{e({windows:t().windows.map(e=>e.id===n?{...e,maximized:!e.maximized,restore:e.maximized?null:{x:e.x,y:e.y,width:e.width,height:e.height}}:e)})},togglePin:n=>{let r=t(),i=Math.max(r.zCounter+1,kj(r.windows)+1);e({windows:r.windows.map(e=>e.id===n?{...e,pinned:!e.pinned,z:i}:e),zCounter:i,focusedId:n})},setActiveTab:(n,r)=>{e({windows:t().windows.map(e=>e.id===n?{...e,activeTabId:r}:e)})},closeTab:(n,r)=>{let i=t(),a=i.windows.find(e=>e.id===n);if(!a)return;if(a.tabs.length<=1){e({windows:i.windows.filter(e=>e.id!==n),focusedId:null});return}let o=a.tabs.filter(e=>e.id!==r),s=yj(vj(o,a.filter),a.activeTabId)?.id??null;e({windows:i.windows.map(e=>e.id===n?{...e,tabs:o,activeTabId:s}:e)})},setBounds:(n,r)=>{e({windows:t().windows.map(e=>e.id===n?{...e,...Cj(r,Dj())}:e)})},setFilter:(n,r)=>{let i=t(),a=i.windows.find(e=>e.id===n);if(!a)return;let o=yj(vj(a.tabs,r),a.activeTabId)?.id??null;e({windows:i.windows.map(e=>e.id===n?{...e,filter:r,activeTabId:o}:e),lastFilters:{...i.lastFilters,[a.tabs[0]?.kind??`terminal`]:r}})}}),{name:`larness.windows.v2`,version:4,migrate:Pj,partialize:e=>({windows:e.windows,focusedId:e.focusedId,zCounter:e.zCounter,lastFilters:e.lastFilters})}));function Ij(e){return`projectId`in e?`project:${e.projectId}`:`sessionId`in e?`session:${e.sessionId}`:`workspace:default`}function Lj(e,t){return[`files`,Ij(e),`content`,t]}async function Rj(e,t){return JD.parse(await Y(`/api/files?${new URLSearchParams({...e,path:t})}`))}async function zj(e,t,n,r){return YD.parse(await Y(`/api/files`,{method:`PUT`,csrf:!0,headers:{"Idempotency-Key":crypto.randomUUID()},body:{scope:e,path:t,content:n,expectedVersion:r}}))}async function Bj(e,t,n){let[r,i]=Ij(e).split(`:`),a=new URLSearchParams({path:t,...n?{cursor:n}:{}});return XD.parse(await Y(`/api/${r===`project`?`projects`:r===`session`?`sessions`:`workspaces`}/${encodeURIComponent(i)}/files?${a}`))}function Vj(e){if(e instanceof aA){if([`FILE_NOT_EDITABLE`,`PAYLOAD_TOO_LARGE`].includes(e.code))return`不支持编辑:仅支持 512 KiB 以内的普通 UTF-8 文本。`;if(e.code===`VERSION_CONFLICT`)return`磁盘文件已变化,草稿已保留。`;if(e.code===`RESOURCE_LOCKED`)return`项目正在写入,请稍后重试;草稿已保留。`;if([`NOT_FOUND`,`FORBIDDEN`,`PATH_OUTSIDE_PROJECT`].includes(e.code))return`文件不可用或已失去访问权限;本地草稿已保留。`}return`文件操作失败,请刷新后重试;本地草稿已保留。`}var Hj=cj(e=>({drafts:{},saving:{},monitoring:{},closeRequest:null,edit:(t,n,r)=>e(e=>({drafts:{...e.drafts,[t]:{text:n,baseVersion:r}}})),discard:t=>e(e=>{let n={...e.drafts};return delete n[t],{drafts:n}})}));async function Uj(e,t,n){let r=await ZA.fetchQuery({queryKey:Lj(e,t),queryFn:()=>Rj(e,t),staleTime:0});return Fj.getState().open({kind:`files`,resourceId:r.realPath,title:r.path.split(`/`).at(-1)??r.path,projectId:`projectId`in e?e.projectId:null,sessionId:`sessionId`in e?e.sessionId:null,source:n,file:{scope:e,path:r.path}}),r}var Wj=new Map;function Gj(e){let t=Wj.get(e.resourceId);if(t)return t;let n=Hj.getState().drafts[e.resourceId],r=e.file;if(!n||!r)return Promise.resolve();Hj.setState(t=>({saving:{...t.saving,[e.resourceId]:!0}}));let i=(async()=>{try{let t=await zj(r.scope,r.path,n.text,n.baseVersion);ZA.setQueryData(Lj(r.scope,r.path),{...t,content:n.text,encoding:`utf-8`});let i=Hj.getState().drafts[e.resourceId];i===n?Hj.getState().discard(e.resourceId):i&&Hj.getState().edit(e.resourceId,i.text,t.version)}finally{Hj.setState(t=>({saving:{...t.saving,[e.resourceId]:!1}})),Wj.delete(e.resourceId),ZA.invalidateQueries({queryKey:Lj(r.scope,r.path)})}})();return Wj.set(e.resourceId,i),i}function Kj(e,t){let n=Ij(e),r=JSON.stringify([...new Set(t)].sort()),[i,a]=(0,H.useState)(`正在连接文件监听…`);return(0,H.useEffect)(()=>{let e=JSON.parse(r);if(!e.length)return;let t=!1,i=0,o=1e3,s,c,l=!1,u=`file:${n}`,d=()=>{t||ZA.invalidateQueries({queryKey:[`files`,n]})},f=async()=>{if(!(l||t)){l=!0;try{for(let e=0;e<10&&!t;e++){let n=nA.parse(await Y(`/api/resource-events?${new URLSearchParams({streamId:u,after:String(i),limit:`500`})}`));if(t)return;if(n.resyncRequired||!n.items.length){i=n.currentSequence;break}if(i=Math.max(i,n.items.at(-1)?.sequence??i),i>=n.currentSequence)break;e===9&&(i=n.currentSequence)}}catch{t||a(`监听恢复失败,请手动刷新。`)}finally{l=!1,d()}}},p=()=>{if(t)return;let r=new URL(`/ws`,window.location.href);r.protocol=r.protocol===`https:`?`wss:`:`ws:`,s=new WebSocket(r),s.onopen=()=>s?.send(JSON.stringify({type:`subscribe`,subscriptions:[{topic:`file`,resourceId:n,paths:e.slice(0,128),after:i}]})),s.onmessage=r=>{if(t)return;let s;try{s=JSON.parse(String(r.data))}catch{a(`文件监听响应无效,请刷新。`);return}let c=rA.safeParse(s);if(c.success&&c.data.subscription.resourceId===n){o=1e3,a(c.data.partial||e.length>128?`部分监听,请按需手动刷新。`:`文件监听已连接`),f(),d();return}if(iA.safeParse(s).success){a(`文件监听不可用,请手动刷新。`);return}let l=tA.safeParse(s);l.success&&l.data.streamId===u&&(l.data.sequence<=i||(l.data.sequence===i+1?i=l.data.sequence:f(),l.data.type===`file.resync.required`&&a(l.data.payload.reasonCode===`RECOVERED`?`文件监听已连接`:`监听已降级,请手动刷新。`),d()))},s.onerror=()=>{t||a(`文件监听断开,可手动刷新。`)},s.onclose=()=>{t||(a(`文件监听断开,正在重连;可手动刷新。`),c=setTimeout(p,o),o=Math.min(o*2,1e4))}};return p(),()=>{t=!0,clearTimeout(c),s?.close()}},[n,r]),i}function qj(e,t,n){if(e)return{projectId:e};let r=n.find(e=>e.id===t);return r&&r.workspaceKind!=="default"?{sessionId:r.id}:{workspace:`default`}}function Jj(e,t,n){let r=qj(e,t,n);return`projectId`in r?`project:${r.projectId}`:`sessionId`in r?`session:${r.sessionId}`:`global`}function Yj(e,t){return`workspace`in qj(null,e,t)?`默认工作区`:`独立会话`}var Xj=cj()(pj((e,t)=>({projectId:null,sessionId:``,pinnedSessionId:null,draftSession:null,sidebarWidth:268,resourceWidth:340,sidebarCollapsed:!1,resourceCollapsed:!1,mobileSidebarOpen:!1,expandedProjects:{prj_larness:!0,prj_docs:!0},focusComposerNonce:0,reconcileWorkspace:(n,r)=>{let i=t();if(i.sessionId!==``&&i.sessionId===i.pinnedSessionId)return;let a=i.projectId===null||n.includes(i.projectId);if(a&&i.draftSession?.id===i.sessionId&&i.draftSession.projectId===i.projectId)return;let o=r.find(e=>e.id===i.sessionId);if(o){(o.projectId!==i.projectId||i.draftSession)&&t().selectSession(o.id,o.projectId);return}let s=a?i.projectId:null;a&&i.sessionId.startsWith(`draft_`)?e({draftSession:{id:i.sessionId,projectId:s}}):t().startDraft(s)},selectSession:(t,n)=>e({sessionId:t,projectId:n,pinnedSessionId:null,draftSession:null,mobileSidebarOpen:!1}),openPinnedSession:(t,n)=>e({sessionId:t,projectId:n,pinnedSessionId:t,draftSession:null,mobileSidebarOpen:!1}),startDraft:t=>e(e=>{if(e.draftSession!==null&&e.draftSession.projectId===t)return{sessionId:e.draftSession.id,projectId:t,mobileSidebarOpen:!1};let n=`draft_${crypto.randomUUID()}`;return{draftSession:{id:n,projectId:t},sessionId:n,projectId:t,mobileSidebarOpen:!1}}),commitDraft:(t,n)=>e({sessionId:t,projectId:n,draftSession:null,mobileSidebarOpen:!1}),setSidebarWidth:t=>e({sidebarWidth:t}),setResourceWidth:t=>e({resourceWidth:t}),toggleSidebar:()=>e(e=>({sidebarCollapsed:!e.sidebarCollapsed})),toggleResource:()=>e(e=>({resourceCollapsed:!e.resourceCollapsed})),setMobileSidebar:t=>e({mobileSidebarOpen:t}),toggleProject:t=>e(e=>({expandedProjects:{...e.expandedProjects,[t]:!(e.expandedProjects[t]??!0)}})),setExpandedProjects:t=>e({expandedProjects:t}),focusComposer:()=>e(e=>({focusComposerNonce:e.focusComposerNonce+1}))}),{name:`larness.nav.v1`,version:1,partialize:e=>({projectId:e.projectId,sessionId:e.sessionId,draftSession:e.draftSession,sidebarWidth:e.sidebarWidth,resourceWidth:e.resourceWidth,sidebarCollapsed:e.sidebarCollapsed,resourceCollapsed:e.resourceCollapsed,expandedProjects:e.expandedProjects})}));function Zj({projectId:e}){let t=Xj(e=>e.sessionId),{data:n}=ej(),r=qj(e,t,n.sessions);return(0,B.jsx)(Qj,{scope:r},Ij(r))}function Qj({scope:e}){let[t,n]=(0,H.useState)([`.`]),[r,i]=(0,H.useState)(null);return Kj(e,t),(0,B.jsxs)(`div`,{className:`p-1.5 text-[11px] text-ink-2`,children:[(0,B.jsx)(Ou,{message:r,onDismiss:()=>i(null)}),(0,B.jsx)($j,{scope:e,path:`.`,depth:0,expanded:t,toggle:e=>n(t=>t.includes(e)?t.filter(t=>t!==e&&!t.startsWith(`${e}/`)):[...t,e]),open:t=>{i(null),Uj(e,t,`projectId`in e?`project`:`workspace`in e?`global`:`session`).catch(e=>i(Vj(e)))}})]})}function $j({scope:e,path:t,depth:n,expanded:r,toggle:i,open:a}){let o=vp({queryKey:[`files`,Ij(e),`directory`,t],initialPageParam:void 0,queryFn:({pageParam:n})=>Bj(e,t,n),getNextPageParam:e=>e.nextCursor??void 0,staleTime:0});return(0,B.jsxs)(B.Fragment,{children:[o.isPending?(0,B.jsx)(`p`,{className:`p-2 text-ink-3`,children:`正在读取目录…`}):null,(0,B.jsx)(Ou,{message:o.isError?Vj(o.error):null,retry:{label:`重新加载目录`,run:()=>void ZA.resetQueries({queryKey:[`files`,Ij(e),`directory`,t]})}}),o.data?.pages.flatMap(e=>e.items).map(t=>(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`button`,{type:`button`,"aria-label":t.type===`directory`?`目录 ${t.name}`:`打开文件 ${t.name}`,"aria-expanded":t.type===`directory`?r.includes(t.path):void 0,className:`flex h-[26px] w-full items-center gap-1.5 rounded px-1.5 text-left hover:bg-accent-soft`,style:{paddingLeft:6+n*12},onClick:()=>t.type===`directory`?i(t.path):a(t.path),children:[t.type===`directory`?(0,B.jsxs)(B.Fragment,{children:[r.includes(t.path)?(0,B.jsx)(n_,{size:11}):(0,B.jsx)(o_,{size:11}),(0,B.jsx)(H_,{size:13,className:`text-warning`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`w-[11px]`}),(0,B.jsx)(P_,{size:13,className:`text-ink-3`})]}),(0,B.jsx)(`span`,{className:`truncate`,children:t.name})]}),t.type===`directory`&&r.includes(t.path)?(0,B.jsx)($j,{scope:e,path:t.path,depth:n+1,expanded:r,toggle:i,open:a}):null]},t.path)),t===`.`&&o.isSuccess&&o.data.pages.every(e=>e.items.length===0)?(0,B.jsx)(`p`,{className:`px-2 py-3 text-[10.5px] text-ink-3`,children:`当前工作区暂无文件`}):null,o.hasNextPage?(0,B.jsx)(`button`,{type:`button`,className:`px-3 py-2 text-accent`,disabled:o.isFetchingNextPage,onClick:()=>void o.fetchNextPage(),children:`加载更多文件`}):null]})}var eM={running:`bg-success`,idle:`bg-ink-3`,waiting:`bg-warning`,error:`bg-danger`,info:`bg-accent`};function tM({tone:e=`idle`,pulse:t=!1,className:n}){return(0,B.jsx)(`span`,{className:z(`relative inline-flex h-1.5 w-1.5 shrink-0 rounded-full`,eM[e],n),children:t?(0,B.jsx)(`span`,{className:z(`absolute inset-0 animate-ping rounded-full opacity-60`,eM[e])}):null})}async function nM(e){return Y(`/api/projects/${encodeURIComponent(e)}/git/status`)}async function rM(e,t,n){return Y(`/api/projects/${encodeURIComponent(e)}/git/diff?path=${encodeURIComponent(t)}&staged=${n}`)}async function iM(e,t=100,n=0){return(await Y(`/api/projects/${encodeURIComponent(e)}/git/branches?limit=${t}&cursor=${n}`)).items}async function aM(e,t){return Y(`/api/projects/${encodeURIComponent(e)}/git/actions`,{method:`POST`,csrf:!0,body:t})}async function oM(e,t){return Y(`/api/resource-actions/${encodeURIComponent(e)}/decision`,{method:`POST`,csrf:!0,body:{decision:t}})}async function sM(e){return Y(`/api/resource-actions/${encodeURIComponent(e)}/execute`,{method:`POST`,csrf:!0,body:{}})}function cM(){return{folders:new Map,files:[]}}function lM(e){let t=cM();for(let n of e){let e=t;for(let t of n.path.split(`/`).slice(0,-1)){e.folders.has(t)||e.folders.set(t,cM());let n=e.folders.get(t);n&&(e=n)}e.files.push(n)}return t}var uM={modified:`M`,added:`A`,deleted:`D`,renamed:`R`,untracked:`U`,conflicted:`!`};function dM({changes:e,disabled:t,onOpen:n,onStage:r,onUnstage:i,onDiscard:a}){function o(e,s){return(0,B.jsxs)(B.Fragment,{children:[[...e.folders].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>{let n=t,r=e;for(;!n.files.length&&n.folders.size===1;){let e=[...n.folders][0];if(!e)break;r+=`/${e[0]}`,n=e[1]}return(0,B.jsxs)(`details`,{open:!0,className:`group/folder`,children:[(0,B.jsxs)(`summary`,{style:{paddingLeft:8+s*12},className:`flex cursor-pointer list-none items-center gap-1.5 py-1 text-[11px] text-ink-2 hover:bg-surface-2`,children:[(0,B.jsx)(o_,{size:11,className:`shrink-0 transition-transform group-open/folder:rotate-90 motion-reduce:transition-none`}),(0,B.jsx)(H_,{size:13,className:`shrink-0 text-warning`}),(0,B.jsx)(`span`,{className:`truncate`,children:r})]}),o(n,s+1)]},e)}),e.files.sort((e,t)=>e.path.localeCompare(t.path)).map(e=>(0,B.jsxs)(`div`,{style:{paddingLeft:8+s*12},className:`group flex min-w-0 items-center gap-1 rounded-md pr-1 hover:bg-surface-2 focus-within:bg-surface-2`,children:[(0,B.jsxs)(`button`,{type:`button`,title:e.origPath?`${e.origPath} → ${e.path}`:e.path,"aria-label":`查看差异 ${e.path}${e.staged?`(已暂存)`:``}`,onClick:()=>n(e),className:`flex min-w-0 flex-1 items-center gap-1.5 py-1 text-left text-[11px] text-ink-2`,children:[(0,B.jsx)(M_,{size:13,className:`shrink-0 text-accent`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.path.split(`/`).at(-1)})]}),!e.staged&&e.status!==`conflicted`?(0,B.jsx)(`button`,{type:`button`,disabled:t,"aria-label":`暂存 ${e.path}`,title:`暂存更改`,onClick:()=>r(e.path),className:`flex h-6 w-6 shrink-0 items-center justify-center rounded text-ink-3 opacity-0 transition-opacity hover:bg-surface group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100 disabled:opacity-30 [@media(hover:none)]:opacity-100`,children:(0,B.jsx)(Ov,{size:13})}):null,e.staged?(0,B.jsx)(`button`,{type:`button`,disabled:t,"aria-label":`取消暂存 ${e.path}`,title:`取消暂存(保留工作区修改)`,onClick:()=>i(e.path),className:`flex h-6 w-6 shrink-0 items-center justify-center rounded text-ink-3 opacity-0 transition-opacity hover:bg-surface group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100 disabled:opacity-30 [@media(hover:none)]:opacity-100`,children:(0,B.jsx)(uv,{size:13})}):e.status===`conflicted`?null:(0,B.jsx)(`button`,{type:`button`,disabled:t,"aria-label":`放弃更改 ${e.path}`,title:e.status===`untracked`?`放弃更改(删除未跟踪文件)`:`放弃未暂存更改`,onClick:()=>a(e),className:`flex h-6 w-6 shrink-0 items-center justify-center rounded text-ink-3 opacity-0 transition-opacity hover:bg-danger/10 hover:text-danger group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100 disabled:opacity-30 [@media(hover:none)]:opacity-100`,children:(0,B.jsx)(iy,{size:13})}),(0,B.jsx)(`span`,{title:e.status,className:`w-4 shrink-0 text-center font-mono text-[10px] ${e.status===`deleted`||e.status===`conflicted`?`text-danger`:e.status===`untracked`||e.status===`added`?`text-success`:`text-warning`}`,children:uM[e.status]??e.status.slice(0,1).toUpperCase()})]},e.path))]})}return(0,B.jsx)(`div`,{children:o(lM(e),0)})}function fM({projectId:e}){return(0,B.jsx)(mM,{projectId:e},e??`none`)}function pM(e,t){return`diff:${e}:${t}`}function mM({projectId:e}){let[t,n]=(0,H.useState)(null),r=Fj(e=>e.open),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(``),c=(0,H.useRef)(!1),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(``),[p,m]=(0,H.useState)(null),[h,g]=(0,H.useState)(``),_=gp({queryKey:[`git`,`status`,e],queryFn:()=>nM(e??``),enabled:e!==null,refetchInterval:3e3,retry:!1}),v=gp({queryKey:[`git`,`branches`,e],queryFn:()=>iM(e??``),enabled:e!==null,retry:!1}),y=()=>{n(null),f(``)};if(e===null)return(0,B.jsx)(`p`,{className:`px-2 py-3 text-[10.5px] text-ink-3`,children:`暂无 Git 仓库`});if(_.isPending)return(0,B.jsx)(`p`,{className:`px-2 py-3 text-[10.5px] text-ink-3`,children:`读取 Git 状态…`});if(_.isError&&!_.data)return(0,B.jsx)(`p`,{className:`px-2 py-3 text-[10.5px] text-ink-3`,children:`Git 暂不可用`});let b=_.data;if(!b)return null;let x=[...b.staged.map(e=>({...e,staged:!0})),...b.unstaged.map(e=>({...e,staged:!1})),...b.untracked.map(e=>({path:e,origPath:null,status:`untracked`,staged:!1})),...b.conflicts.map(e=>({...e,staged:!1}))],S=async()=>{await Promise.all([_.refetch(),v.refetch()])},C=async e=>{if(!c.current){c.current=!0,u(!0),f(``);try{await e(),await S()}catch(e){f(oA(e,`Git 操作失败,请核对状态后重试。`)),await S()}finally{c.current=!1,u(!1)}}},w=t=>C(async()=>{if((await sM((await aM(e,t)).id)).status!==`COMPLETED`)throw Error(`Git 操作未完成,请重试核对。`);t.action===`discard`&&n(null),t.action===`commit`&&s(``),t.action===`createBranch`&&g(``)}),T=t=>C(async()=>{let n=await aM(e,t);m(n)}),E=e=>C(async()=>{if(!p)return;let t=await oM(p.id,e);m(t),e===`reject`&&m(null)}),D=()=>C(async()=>{if(!p)return;let e=await sM(p.id);if(m(e.status===`COMPLETED`||e.status===`FAILED`?null:e),e.status!==`COMPLETED`)throw Error(`Git 操作未完成,请核对状态后重试。`)}),O=x.filter(e=>e.staged),k=[...new Map(x.filter(e=>!e.staged).map(e=>[e.path,e])).values()],A=l||p!==null||_.isError,j=t=>r({kind:`git-diff`,resourceId:pM(e,t.path),title:t.path.split(`/`).pop()??t.path,projectId:e,source:`project`,git:{path:t.path,staged:t.staged}}),M=()=>{!A&&o.trim()&&O.length&&w({action:`commit`,message:o.trim()})};return(0,B.jsxs)(`div`,{"data-testid":`git-panel`,className:`relative flex h-full min-h-0 flex-col px-1 pb-1`,children:[(0,B.jsxs)(`div`,{className:`shrink-0 space-y-2 px-1 pb-2`,children:[(0,B.jsx)(Nu,{"aria-label":`提交信息`,value:o,disabled:l,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),M())},rows:2,placeholder:`提交信息(⌘ / Ctrl + Enter)`,className:`resize-none py-2 text-[11px] focus:outline-none`}),(0,B.jsxs)(`button`,{type:`button`,title:`仅提交已暂存的更改`,"aria-label":`提交已暂存 (${O.length})`,disabled:A||!o.trim()||!O.length,onClick:M,className:`flex h-8 w-full items-center justify-center gap-1.5 rounded-lg bg-accent text-[11px] font-medium text-white transition-opacity disabled:opacity-40`,children:[(0,B.jsx)(e_,{size:14}),`提交`]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[[{title:`已暂存`,rows:O},{title:`更改`,rows:k}].map(e=>e.rows.length?(0,B.jsxs)(`details`,{open:!0,className:`mb-1`,children:[(0,B.jsxs)(`summary`,{className:`flex cursor-pointer items-center gap-2 px-2 py-1.5 text-[11px] font-medium text-ink-2`,children:[(0,B.jsx)(`span`,{children:e.title}),(0,B.jsx)(`span`,{className:`ml-auto rounded-full bg-accent-soft px-1.5 text-[10px] text-accent`,children:e.rows.length})]}),(0,B.jsx)(dM,{changes:e.rows,disabled:A,onOpen:j,onStage:e=>void w({action:`add`,paths:[e]}),onUnstage:e=>void w({action:`unstage`,paths:[e]}),onDiscard:e=>{f(``),n(e)}})]},e.title):null),x.length?null:(0,B.jsx)(`p`,{className:`px-2 py-3 text-[11px] text-ink-3`,children:`工作区干净`})]}),(0,B.jsxs)(`div`,{className:`relative mt-1 flex shrink-0 items-center gap-1 border-t border-line px-1 pt-1.5 text-ink-3`,role:`toolbar`,"aria-label":`Git 操作`,children:[(0,B.jsxs)(`button`,{type:`button`,disabled:A,"aria-label":`管理分支`,title:b.upstream??`未设置上游`,onClick:()=>a(e=>!e),"aria-expanded":i,className:`flex min-w-0 flex-1 items-center gap-1 rounded px-1 py-1 text-[10.5px] hover:bg-surface-2 disabled:opacity-40`,children:[(0,B.jsx)(W_,{size:13}),(0,B.jsx)(`span`,{className:`truncate`,children:b.branch})]}),(0,B.jsxs)(`span`,{className:`shrink-0 font-mono text-[9px]`,title:`传入 / 传出提交`,children:[`↓`,b.behind,` ↑`,b.ahead]}),(0,B.jsx)(`button`,{type:`button`,disabled:A,"aria-label":`拉取(仅快进)`,title:`拉取(仅快进)`,onClick:()=>void T({action:`pull`}),className:`rounded p-1.5 hover:bg-surface-2 disabled:opacity-40`,children:(0,B.jsx)(Bg,{size:13})}),(0,B.jsx)(`button`,{type:`button`,disabled:A,"aria-label":`推送`,title:`推送`,onClick:()=>void T({action:`push`}),className:`rounded p-1.5 hover:bg-surface-2 disabled:opacity-40`,children:(0,B.jsx)(Jg,{size:13})}),(0,B.jsx)(`button`,{type:`button`,disabled:l,"aria-label":`刷新 Git`,"aria-busy":l,title:`刷新 Git`,onClick:()=>void C(async()=>{}),className:`rounded p-1.5 hover:bg-surface-2 disabled:opacity-40`,children:(0,B.jsx)(Av,{size:12,className:l?`animate-spin motion-reduce:animate-none`:``})}),i?(0,B.jsxs)(`section`,{"aria-label":`分支管理`,className:`absolute bottom-full left-0 right-0 z-10 mb-2 space-y-2 rounded-xl border border-line bg-surface p-3 shadow-lg`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-medium text-ink-2`,children:[`分支`,(0,B.jsx)(`button`,{type:`button`,"aria-label":`关闭分支管理`,onClick:()=>a(!1),children:(0,B.jsx)(sy,{size:12})})]}),(0,B.jsx)(Fu,{label:`切换分支`,value:b.branch,disabled:A||!v.data,onValueChange:e=>{e!==b.branch&&w({action:`switchBranch`,name:e})},placeholder:b.branch,options:(v.data??[]).map(e=>({value:e.name,label:e.name}))}),(0,B.jsxs)(`form`,{className:`flex gap-1`,onSubmit:e=>{e.preventDefault(),!A&&h.trim()&&w({action:`createBranch`,name:h.trim()})},children:[(0,B.jsx)(Mu,{"aria-label":`新分支名`,value:h,onChange:e=>g(e.target.value),placeholder:`新分支名`,className:`min-w-0 flex-1 py-1 text-[11px]`}),(0,B.jsx)(`button`,{type:`submit`,"aria-label":`创建分支`,title:`创建分支`,disabled:A||!h.trim(),className:`rounded border border-line px-2 disabled:opacity-40`,children:(0,B.jsx)(Ov,{size:13})})]})]}):null]}),(0,B.jsx)(ca,{open:t!==null,onOpenChange:e=>{!e&&!l&&y()},children:(0,B.jsxs)(ua,{className:`space-y-4 text-sm`,onEscapeKeyDown:e=>{l&&e.preventDefault()},onPointerDownOutside:e=>{l&&e.preventDefault()},children:[(0,B.jsx)(da,{children:`放弃更改?`}),(0,B.jsx)(fa,{children:t?.status===`untracked`?`该文件尚未被 Git 跟踪,确认后将删除,无法通过 Git 恢复。`:`该文件的未暂存修改将丢失,恢复为暂存区版本;已暂存内容会保留。`}),(0,B.jsx)(`p`,{className:`break-all rounded bg-surface-2 p-2 font-mono text-xs`,children:t?.path}),(0,B.jsx)(Ou,{message:d,onDismiss:()=>f(``)}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,disabled:l,onClick:y,children:`取消`}),(0,B.jsx)(V,{className:`bg-danger text-white`,disabled:l||p!==null||_.isError,onClick:()=>{t&&w({action:`discard`,path:t.path,confirmed:!0})},children:`确认放弃`})]})]})}),t===null?(0,B.jsx)(Ou,{message:d||(_.isError?`Git 状态读取失败,请刷新后继续。`:i&&v.isError?`分支读取失败,请刷新重试。`:null),onDismiss:d?()=>f(``):void 0}):null,p?(0,B.jsxs)(`section`,{"aria-label":`Git 操作审批`,className:`max-h-56 shrink-0 space-y-1.5 overflow-auto rounded border border-warning/30 bg-warning/[.05] p-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-[10.5px] font-medium text-ink`,children:[(0,B.jsx)(`span`,{children:`Git 操作审批`}),(0,B.jsx)(`span`,{className:`ml-auto rounded-full border border-line bg-surface px-1.5 text-[9px]`,children:p.status})]}),(0,B.jsx)(`p`,{className:`break-all font-mono text-[9.5px] text-ink-3`,children:JSON.stringify(p.params)}),(0,B.jsxs)(`p`,{className:`text-[9.5px] text-ink-3`,children:[`风险 `,p.risk,` · 到期 `,new Date(p.expiresAt).toLocaleTimeString()]}),(0,B.jsxs)(`div`,{className:`flex gap-1`,children:[p.status===`WAITING_APPROVAL`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>E(`approve`),className:`flex-1 rounded bg-accent px-2 py-1 text-[10px] text-white disabled:opacity-45`,children:`批准`}),(0,B.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>E(`reject`),className:`flex-1 rounded border border-line px-2 py-1 text-[10px] disabled:opacity-45`,children:`拒绝`})]}):null,p.status===`APPROVED`?(0,B.jsx)(`button`,{type:`button`,disabled:l,onClick:D,className:`flex-1 rounded bg-accent px-2 py-1 text-[10px] text-white disabled:opacity-45`,children:`执行一次`}):null]})]}):null]})}var hM=[{id:`files`,label:`文件`,icon:I_},{id:`git`,label:`Git`,icon:W_}];function gM(){let{data:e}=ej(),t=Xj(e=>e.projectId),n=Xj(e=>e.resourceWidth),[r,i]=(0,H.useState)(`files`);t===`prj_larness`&&e.gitChanges;let a={files:void 0,git:void 0};return(0,B.jsx)(`aside`,{"aria-label":`项目资源`,"data-project-resources":!0,className:`hidden shrink-0 bg-surface/40 xl:flex xl:flex-col`,style:{width:n},children:(0,B.jsxs)(ed,{value:r,onValueChange:e=>i(e),className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(`div`,{className:`shrink-0 px-2.5 pb-1.5 pt-2.5`,children:(0,B.jsx)(td,{"aria-label":`项目资源分区`,className:`flex w-full`,children:hM.map(({id:e,label:t,icon:n})=>(0,B.jsxs)(nd,{id:`resource-tab-${e}`,value:e,className:`h-7 flex-1 justify-center gap-1.5 px-2`,children:[(0,B.jsx)(n,{size:13,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:t}),typeof a[e]==`number`?(0,B.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-2 px-1.5 text-[10px] leading-4 text-ink-3`,children:a[e]}):null]},e))})}),(0,B.jsx)(`div`,{role:`tabpanel`,id:`resource-files`,"aria-labelledby":`resource-tab-files`,hidden:r!==`files`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,children:(0,B.jsx)(Zj,{projectId:t})}),(0,B.jsx)(`div`,{role:`tabpanel`,id:`resource-git`,"aria-labelledby":`resource-tab-git`,hidden:r!==`git`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2 pt-2`,children:(0,B.jsx)(fM,{projectId:t})})]})})}function _M(){return gp({queryKey:[`bootstrap`],queryFn:()=>Y(`/api/bootstrap`),staleTime:5e3,retry:!1})}function vM(e=!0){return gp({queryKey:[`session`],enabled:e,queryFn:async()=>{try{let e=await Y(`/api/auth/session`);return cA(e.csrfToken),e}catch(e){if(e instanceof aA&&e.code===`UNAUTHENTICATED`)return cA(null),null;throw e}},retry:!1,staleTime:0,refetchInterval:3e4})}function yM(){let e=Wd();(0,H.useEffect)(()=>{let t=()=>{e.invalidateQueries({queryKey:[`session`]}),e.invalidateQueries({queryKey:[`bootstrap`]})};return window.addEventListener(`larness:unauthenticated`,t),()=>window.removeEventListener(`larness:unauthenticated`,t)},[e])}function bM(){let e=Wd(),t=rh();return async()=>{try{await Y(`/api/auth/logout`,{method:`POST`,csrf:!0})}finally{cA(null),e.clear(),t(`/`,{replace:!0})}}}function xM({session:e,open:t,onClose:n}){let r=Wd(),[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(null);(0,H.useEffect)(()=>{a(e?.title??``),l(null),s(!1)},[e]);let u=async()=>{if(e!==null&&i.trim()){s(!0),l(null);try{await kA(e.id,{title:i.trim()}),await r.invalidateQueries({queryKey:[`workspace`]}),n()}catch(e){l(oA(e,`重命名失败`))}finally{s(!1)}}};return(0,B.jsx)(ca,{open:t&&e!==null,onOpenChange:e=>e?void 0:n(),children:(0,B.jsxs)(ua,{children:[(0,B.jsx)(da,{children:`重命名会话`}),(0,B.jsx)(fa,{children:`标题只用于展示,不参与授权。`}),(0,B.jsx)(Mu,{value:i,onChange:e=>a(e.target.value),"aria-label":`会话标题`,autoFocus:!0,className:`mt-4 h-9`}),(0,B.jsx)(Ou,{message:c,onDismiss:()=>l(null)}),(0,B.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:n,children:`取消`}),(0,B.jsx)(V,{variant:`primary`,size:`sm`,disabled:o||!i.trim(),onClick:()=>void u(),children:o?`正在保存…`:`保存`})]})]})})}var SM=[`jobs`],CM=[`jobs`,`summary`],wM=e=>[`jobs`,`detail`,e],TM=e=>[`jobs`,`runs`,e];async function EM(){return Y(`/api/jobs`)}async function DM(){return Y(`/api/jobs/summary`)}async function OM(e){return Y(`/api/jobs/${encodeURIComponent(e)}`)}async function kM(e){return Y(`/api/jobs`,{method:`POST`,csrf:!0,body:e})}async function AM(e,t){return Y(`/api/jobs/${encodeURIComponent(e)}`,{method:`PATCH`,csrf:!0,body:t})}async function jM(e){await Y(`/api/jobs/${encodeURIComponent(e)}`,{method:`DELETE`,csrf:!0})}async function MM(e){return Y(`/api/jobs/${encodeURIComponent(e)}/run`,{method:`POST`,csrf:!0})}async function NM(e,t){let n=new URLSearchParams({limit:`50`});return t&&n.set(`cursor`,t),Y(`/api/jobs/${encodeURIComponent(e)}/runs?${n.toString()}`)}async function PM(e){return Y(`/api/job-runs/${encodeURIComponent(e)}/cancel`,{method:`POST`,csrf:!0})}function FM(e,t=Date.now()){let n=Math.max(0,t-e),r=Math.floor(n/6e4);if(r<1)return`刚刚`;if(r<60)return`${r} 分钟前`;let i=Math.floor(r/60);return i<24?`${i} 小时前`:`${Math.floor(i/24)} 天前`}function IM(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||t<=0)return null;let n=Math.max(0,e),r=1024**3;if(t>=1024*r){let e=1024*r;return{used:`${(n/e).toFixed(1)}`,total:`${(t/e).toFixed(1)} TB`}}if(t>=100*r)return{used:`${Math.round(n/r)}`,total:`${Math.round(t/r)} GB`};let i=t>=10*r?0:1;return{used:`${(n/r).toFixed(1)}`,total:`${(t/r).toFixed(i)} GB`}}function LM(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||t<=0?0:Math.min(100,Math.max(0,e/t*100))}var RM={queued:`排队中`,running:`运行中`,succeeded:`成功`,failed:`失败`,timed_out:`超时`,cancelled:`已取消`,interrupted:`已中断`,skipped:`已跳过`},zM={queued:`text-warning`,running:`text-accent`,succeeded:`text-success`,failed:`text-danger`,timed_out:`text-danger`,cancelled:`text-ink-3`,interrupted:`text-danger`,skipped:`text-ink-3`},BM={scheduled:`计划`,manual:`手动`,catch_up:`补跑`},VM={script:`脚本`,agent:`Agent`};function HM(e){return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}function UM(e){return e.schedule.type===`cron`?`Cron ${e.schedule.expression} · ${e.schedule.timezone}`:`每 ${e.schedule.seconds} 秒 · ${e.schedule.timezone}`}function WM(e){return e===null?`—`:e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`}function GM(e){return e.lastStatus}function KM({open:e,onOpenChange:t}){let n=Wd(),[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(!1),[l,u]=(0,H.useState)(null),d=gp({queryKey:SM,queryFn:EM,enabled:e,refetchInterval:e?5e3:!1}),f=gp({queryKey:wM(r??``),queryFn:()=>OM(r??``),enabled:e&&r!==null,refetchInterval:e&&r!==null?2e3:!1}),p=gp({queryKey:TM(r??``),queryFn:()=>NM(r??``),enabled:e&&r!==null,refetchInterval:e&&r!==null?2e3:!1}),m=gp({queryKey:[`projects`,`jobs`],queryFn:dA,enabled:e}),h=gp({queryKey:[`model-catalog`,`jobs`],queryFn:_A,enabled:e&&a!==null});(0,H.useEffect)(()=>{e||(i(null),o(null),c(!1),u(null))},[e]),(0,H.useEffect)(()=>{d.data&&!d.isFetching&&r!==null&&!d.data.items.some(e=>e.id===r)&&(i(null),c(!1))},[d.data,r,d.isFetching]);let g=()=>{n.invalidateQueries({queryKey:SM}),n.invalidateQueries({queryKey:CM}),r!==null&&(n.invalidateQueries({queryKey:wM(r)}),n.invalidateQueries({queryKey:TM(r)}))},_=_p({mutationFn:e=>MM(e),retry:!1,onMutate:()=>u(null),onError:e=>u(oA(e,`执行失败`)),onSettled:g}),v=_p({mutationFn:e=>PM(e),retry:!1,onMutate:()=>u(null),onError:e=>u(oA(e,`取消失败`)),onSettled:g}),y=_p({mutationFn:e=>jM(e),retry:!1,onMutate:()=>u(null),onError:e=>u(oA(e,`删除失败`)),onSuccess:()=>{i(null),c(!1)},onSettled:g}),b=_p({mutationFn:({id:e,enabled:t})=>AM(e,{enabled:t}),retry:!1,onMutate:()=>u(null),onError:e=>u(oA(e,`更新失败`)),onSettled:g}),x=()=>{i(null),o(null),c(!1),u(null),t(!1)},S=f.data;return(0,B.jsx)(ca,{open:e,onOpenChange:e=>{e||x()},children:(0,B.jsxs)(ua,{className:`flex h-[min(700px,calc(100dvh-32px))] w-[min(980px,calc(100vw-32px))] flex-col overflow-hidden p-0`,"data-testid":`jobs-dialog`,children:[(0,B.jsxs)(`header`,{className:`flex shrink-0 items-center gap-2 border-b border-line px-3 py-2`,children:[(0,B.jsx)(m_,{size:14,className:`text-ink-3`}),(0,B.jsx)(da,{className:`text-[12px] font-semibold`,children:`自动化任务`}),(0,B.jsx)(fa,{className:`sr-only`,children:`管理 Cron / 固定间隔的脚本与 Agent 任务,查看运行历史`}),(0,B.jsx)(`span`,{className:`rounded bg-surface-2 px-1.5 text-[10px] text-ink-3`,children:d.data?.items.length??0}),(0,B.jsx)(`div`,{className:`flex-1`}),(0,B.jsxs)(V,{size:`sm`,variant:`ghost`,disabled:d.isFetching,onClick:()=>void d.refetch(),children:[(0,B.jsx)(Av,{size:12,className:d.isFetching?`animate-spin`:void 0}),`刷新`]}),(0,B.jsx)(la,{asChild:!0,children:(0,B.jsx)(V,{size:`sm`,variant:`ghost`,"aria-label":`关闭自动化任务`,children:(0,B.jsx)(sy,{size:14})})})]}),(0,B.jsx)(Ou,{message:l??(d.isError?`任务列表读取失败,请刷新重试。`:null),onDismiss:l?()=>u(null):void 0}),a===null?r===null?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-line px-3 py-2`,children:[(0,B.jsx)(`p`,{className:`text-[11px] text-ink-3`,children:`支持按 Cron 表达式或固定间隔运行脚本和 Agent。`}),(0,B.jsxs)(V,{size:`sm`,variant:`secondary`,onClick:()=>o(`new`),children:[(0,B.jsx)(Ov,{size:12}),`新建任务`]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:d.isPending?(0,B.jsx)(`p`,{role:`status`,className:`p-2 text-[11px] text-ink-3`,children:`正在读取任务…`}):d.data?.items.length?(0,B.jsx)(`div`,{className:`space-y-1`,children:d.data.items.map(e=>(0,B.jsxs)(`button`,{type:`button`,"aria-label":`${e.name} ${e.lastStatus?RM[e.lastStatus]:`未运行`}`,onClick:()=>i(e.id),className:`flex w-full items-center gap-3 rounded-lg border border-transparent px-2 py-2 text-left hover:border-line hover:bg-surface-2`,children:[(0,B.jsx)(`span`,{className:z(`h-1.5 w-1.5 shrink-0 rounded-full`,e.enabled?`bg-success`:`bg-ink-3/40`)}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate text-[12px] font-medium`,children:e.name}),(0,B.jsx)(`span`,{className:`rounded bg-surface-2 px-1.5 text-[9.5px] text-ink-3`,children:VM[e.kind]}),!e.enabled&&(0,B.jsx)(`span`,{className:`text-[9.5px] text-ink-3`,children:`已停用`})]}),(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-[10px] text-ink-3`,children:UM(e)})]}),(0,B.jsxs)(`span`,{className:`shrink-0 text-right`,children:[(0,B.jsx)(qM,{status:e.lastStatus}),(0,B.jsx)(`span`,{className:`mt-0.5 block text-[10px] text-ink-3`,children:e.nextRunAt?`下次 ${HM(e.nextRunAt)}`:`不排期`})]})]},e.id))}):d.isError?null:(0,B.jsx)(`div`,{className:`grid min-h-full place-items-center p-4`,children:(0,B.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,B.jsx)(m_,{size:20,className:`text-ink-3`}),(0,B.jsx)(`p`,{className:`text-[12px] font-medium`,children:`还没有定时任务`}),(0,B.jsx)(`p`,{className:`max-w-xs text-[10.5px] text-ink-3`,children:`创建脚本或 Agent 任务,Larness 会按 Cron / 间隔在本机执行并保留运行记录。`}),(0,B.jsxs)(V,{size:`sm`,variant:`secondary`,onClick:()=>o(`new`),children:[(0,B.jsx)(Ov,{size:12}),`新建任务`]})]})})})]}):(0,B.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":`任务详情`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-line px-3 py-2`,children:[(0,B.jsx)(V,{size:`sm`,variant:`ghost`,"aria-label":`返回任务列表`,onClick:()=>{i(null),c(!1)},children:(0,B.jsx)(Hg,{size:12})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`h3`,{className:`truncate text-[12.5px] font-semibold`,children:S?.name??`任务`}),S!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`rounded bg-surface-2 px-1.5 py-0.5 text-[10px] text-ink-3`,children:VM[S.kind]}),(0,B.jsx)(qM,{status:GM(S)}),(0,B.jsx)(`span`,{className:`text-[10px] text-ink-3`,children:S.enabled?`已启用`:`已停用`})]})]}),(0,B.jsx)(`p`,{className:`mt-1 text-[10px] text-ink-3`,children:S===void 0?`正在读取任务…`:UM(S)})]}),S!==void 0&&(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(0,B.jsx)(V,{size:`sm`,variant:`ghost`,onClick:()=>b.mutate({id:S.id,enabled:!S.enabled}),disabled:b.isPending,children:S.enabled?`停用`:`启用`}),(0,B.jsxs)(V,{size:`sm`,variant:`secondary`,onClick:()=>_.mutate(S.id),disabled:_.isPending,children:[(0,B.jsx)(Ev,{size:12}),`立即执行`]}),(0,B.jsx)(V,{size:`sm`,variant:`secondary`,onClick:()=>o(S),children:`编辑`}),(0,B.jsxs)(V,{size:`sm`,variant:`danger`,onClick:()=>c(!0),disabled:y.isPending,children:[(0,B.jsx)(ny,{size:12}),`删除`]})]})]}),s&&S!==void 0&&(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-line bg-danger/5 px-3 py-2 text-[11px]`,children:[(0,B.jsx)(`span`,{children:`删除后不再触发,运行历史保留。运行中的任务会被取消。`}),(0,B.jsx)(`div`,{className:`flex-1`}),(0,B.jsx)(V,{size:`sm`,variant:`ghost`,onClick:()=>c(!1),children:`取消`}),(0,B.jsx)(V,{size:`sm`,variant:`danger`,onClick:()=>y.mutate(S.id),disabled:y.isPending,children:`确认删除`})]}),S===void 0?(0,B.jsx)(`p`,{role:`status`,className:`p-3 text-[11px] text-ink-3`,children:`正在读取任务详情…`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-2 px-3 py-2 md:grid-cols-4`,children:[(0,B.jsx)(JM,{label:`下一次运行`,value:S.nextRunAt?HM(S.nextRunAt):`—`}),(0,B.jsx)(JM,{label:`最近运行`,value:S.lastRunAt?FM(S.lastRunAt):`—`}),(0,B.jsx)(JM,{label:`超时`,value:`${S.timeoutSeconds} 秒`}),(0,B.jsx)(JM,{label:`错过触发`,value:S.missedPolicy===`run_once`?`补跑一次`:`跳过`})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-3`,children:(0,B.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,B.jsx)(YM,{title:`执行配置`,children:S.kind===`script`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`mb-2 rounded bg-warning/10 px-2 py-1.5 text-[10.5px] text-warning`,children:`脚本以本机账户权限运行,可访问项目外文件和网络。输出有长度限制并经过脱敏。`}),(0,B.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded bg-surface-2 p-2 text-[10.5px] leading-relaxed`,children:S.script?.source??``})]}):(0,B.jsxs)(`dl`,{className:`space-y-2 text-[11px]`,children:[(0,B.jsx)(XM,{label:`审批策略`,value:S.agent?.approvalPolicy===`autonomous`?`完全自主`:`只读`}),(0,B.jsx)(XM,{label:`模型`,value:S.agent?.model??`继承会话默认`}),(0,B.jsx)(XM,{label:`提示词`,value:(0,B.jsx)(`span`,{className:`whitespace-pre-wrap`,children:S.agent?.prompt??``})}),S.agent?.sessionId&&(0,B.jsx)(XM,{label:`会话`,value:(0,B.jsx)(`button`,{type:`button`,className:`text-accent hover:underline`,onClick:()=>{Xj.getState().openPinnedSession(S.agent?.sessionId??``,S.projectId),x()},children:`打开任务会话`})})]})}),(0,B.jsx)(YM,{title:`运行历史`,children:p.isPending?(0,B.jsx)(`p`,{className:`text-[11px] text-ink-3`,children:`正在读取运行历史…`}):p.data?.items.length?(0,B.jsx)(`div`,{className:`space-y-2`,children:p.data.items.map(e=>(0,B.jsx)(ZM,{run:e,onCancel:()=>v.mutate(e.id),onOpenSession:e.sessionId?()=>{Xj.getState().openPinnedSession(e.sessionId??``,S.projectId),x()}:void 0,cancelling:v.isPending},e.id))}):(0,B.jsx)(`p`,{className:`text-[11px] text-ink-3`,children:`还没有运行记录。`})})]})})]})]}):(0,B.jsx)(QM,{job:a===`new`?null:a,projects:m.data??[],catalog:h.data??null,onCancel:()=>o(null),onSaved:async e=>{o(null),i(e.id),g()},onError:u})]})})}function qM({status:e}){return e===null?(0,B.jsx)(`span`,{className:`text-[10px] text-ink-3`,children:`未运行`}):(0,B.jsx)(`span`,{className:z(`text-[10px] font-medium`,zM[e]),children:RM[e]})}function JM({label:e,value:t}){return(0,B.jsxs)(`div`,{className:`rounded-lg bg-surface-2 px-2 py-1.5`,children:[(0,B.jsx)(`div`,{className:`text-[9.5px] text-ink-3`,children:e}),(0,B.jsx)(`div`,{className:`mt-0.5 truncate text-[11px]`,children:t})]})}function YM({title:e,children:t}){return(0,B.jsxs)(`section`,{className:`rounded-lg border border-line p-2`,children:[(0,B.jsx)(`h4`,{className:`mb-2 text-[11px] font-semibold`,children:e}),t]})}function XM({label:e,value:t}){return(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(`dt`,{className:`w-16 shrink-0 text-ink-3`,children:e}),(0,B.jsx)(`dd`,{className:`min-w-0 flex-1`,children:t})]})}function ZM({run:e,onCancel:t,onOpenSession:n,cancelling:r}){let i=e.status===`running`||e.status===`queued`;return(0,B.jsxs)(`div`,{className:`rounded-lg border border-line px-2 py-1.5 text-[10.5px]`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(qM,{status:e.status}),(0,B.jsx)(`span`,{className:`text-ink-3`,children:BM[e.trigger]}),(0,B.jsx)(`span`,{className:`text-ink-3`,children:FM(e.createdAt)}),(0,B.jsx)(`span`,{className:`text-ink-3`,children:WM(e.durationMs)}),(0,B.jsx)(`span`,{className:`flex-1`}),i&&(0,B.jsxs)(V,{size:`sm`,variant:`ghost`,onClick:t,disabled:r,children:[(0,B.jsx)(Xv,{size:10}),`取消`]}),n&&(0,B.jsx)(V,{size:`sm`,variant:`ghost`,onClick:n,children:`打开会话`})]}),e.output&&(0,B.jsx)(`pre`,{className:`mt-1 max-h-24 overflow-auto rounded bg-surface-2 p-1.5 text-[10px]`,children:e.output}),e.errorMessage&&(0,B.jsx)(`p`,{className:`mt-1 text-[10px] text-danger`,children:e.errorMessage})]})}function QM({job:e,projects:t,catalog:n,onCancel:r,onSaved:i,onError:a}){let o=(0,H.useId)(),[s,c]=(0,H.useState)(e?.name??``),[l,u]=(0,H.useState)(e?.projectId??``),[d,f]=(0,H.useState)(e?.kind??`script`),[p,m]=(0,H.useState)(e?.schedule.type??`cron`),[h,g]=(0,H.useState)(e?.schedule.type===`cron`?e.schedule.expression:`0 9 * * *`),[_,v]=(0,H.useState)(e?.schedule.type===`interval`?String(e.schedule.seconds):`300`),[y,b]=(0,H.useState)(e?.schedule.timezone??Intl.DateTimeFormat().resolvedOptions().timeZone),[x,S]=(0,H.useState)(String(e?.timeoutSeconds??600)),[C,w]=(0,H.useState)(e?.missedPolicy??`skip`),[T,E]=(0,H.useState)(e?.script?.source??`console.log("hello")`),[D,O]=(0,H.useState)(e?.agent?.prompt??``),[k,A]=(0,H.useState)(e?.agent?.approvalPolicy??`readonly`),[j,M]=(0,H.useState)(e?.agent?.model&&e.agent.credentialProfileId?`${e.agent.credentialProfileId}::${e.agent.model}`:``),[N,ee]=(0,H.useState)(e?.agent?.approvalPolicy===`autonomous`),[te,P]=(0,H.useState)(!1),[ne,F]=(0,H.useState)(null),re=(n?.groups??[]).flatMap(e=>e.models.filter(e=>e.visible!==!1).map(t=>({key:`${e.credentialProfileId}::${t.id}`,label:`${e.credentialLabel} · ${t.label}`}))),ie=async()=>{F(null);let t=s.trim();if(!t)return F(`请填写任务名称`);if(p===`cron`&&h.trim().split(/\s+/).length!==5)return F(`Cron 必须是 5 字段表达式`);let n=Number(_);if(p===`interval`&&(!Number.isInteger(n)||n<60))return F(`间隔至少 60 秒`);let r=Number(x);if(!Number.isInteger(r)||r<60||r>3600)return F(`超时需在 60–3600 秒之间`);if(d===`agent`&&!D.trim())return F(`请填写 Agent 提示词`);if(d===`script`&&!T.trim())return F(`请填写脚本源码`);if(d===`agent`&&k===`autonomous`&&!N)return F(`请先确认完全自主风险`);let o=p===`cron`?{type:`cron`,expression:h.trim(),timezone:y.trim()}:{type:`interval`,seconds:n,timezone:y.trim()},[c,u]=j?j.split(`::`):[null,null],f=d===`script`?{name:t,projectId:l||null,kind:`script`,schedule:o,enabled:e?.enabled??!0,timeoutSeconds:r,missedPolicy:C,script:{source:T}}:{name:t,projectId:l||null,kind:`agent`,schedule:o,enabled:e?.enabled??!0,timeoutSeconds:r,missedPolicy:C,agent:{prompt:D.trim(),model:u??null,credentialProfileId:c??null,thinking:e?.agent?.thinking??null,approvalPolicy:k}},m={name:t,enabled:e?.enabled??!0,schedule:o,timeoutSeconds:r,missedPolicy:C,...d===`script`?{script:{source:T}}:{agent:{prompt:D.trim(),model:u??null,credentialProfileId:c??null,thinking:e?.agent?.thinking??null,approvalPolicy:k}}};P(!0);try{i(e?await AM(e.id,m):await kM(f))}catch(e){a(oA(e,`保存任务失败,请重试。`))}finally{P(!1)}};return(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,B.jsx)(V,{size:`sm`,variant:`ghost`,"aria-label":`取消编辑`,onClick:r,children:(0,B.jsx)(Hg,{size:12})}),(0,B.jsx)(`h3`,{className:`text-[12.5px] font-semibold`,children:e?`编辑任务`:`新建任务`})]}),(0,B.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,B.jsx)($M,{label:`名称`,children:(0,B.jsx)(Mu,{value:s,onChange:e=>c(e.target.value)})}),(0,B.jsx)($M,{label:`项目`,children:(0,B.jsx)(Fu,{label:`项目`,value:l,onValueChange:u,disabled:e!==null,options:[{value:``,label:`默认工作区`},...t.filter(e=>e.kind!=="default").map(e=>({value:e.id,label:e.name}))]})}),(0,B.jsx)($M,{label:`类型`,children:(0,B.jsx)(Fu,{label:`类型`,value:d,onValueChange:f,disabled:e!==null,options:[{value:`script`,label:`脚本`},{value:`agent`,label:`Agent`}]})}),(0,B.jsx)($M,{label:`触发方式`,children:(0,B.jsx)(Fu,{label:`触发方式`,value:p,onValueChange:m,options:[{value:`cron`,label:`Cron`},{value:`interval`,label:`固定间隔`}]})}),p===`cron`?(0,B.jsx)($M,{label:`Cron(分 时 日 月 周)`,children:(0,B.jsx)(Mu,{value:h,onChange:e=>g(e.target.value)})}):(0,B.jsx)($M,{label:`间隔(秒)`,children:(0,B.jsx)(Mu,{type:`number`,min:60,value:_,onChange:e=>v(e.target.value)})}),(0,B.jsx)($M,{label:`时区(IANA)`,children:(0,B.jsx)(Mu,{value:y,onChange:e=>b(e.target.value)})}),(0,B.jsx)($M,{label:`超时(秒)`,children:(0,B.jsx)(Mu,{type:`number`,min:60,max:3600,value:x,onChange:e=>S(e.target.value)})}),(0,B.jsx)($M,{label:`错过触发`,children:(0,B.jsx)(Fu,{label:`错过触发`,value:C,onValueChange:w,options:[{value:`skip`,label:`跳过`},{value:`run_once`,label:`补跑一次`}]})}),d===`script`?(0,B.jsxs)(`div`,{className:`md:col-span-2`,children:[(0,B.jsx)($M,{label:`脚本源码(Node ESM)`,children:(0,B.jsx)(Nu,{className:`h-40 resize-y font-mono leading-relaxed`,value:T,onChange:e=>E(e.target.value)})}),(0,B.jsx)(`p`,{className:`mt-1 text-[10px] text-warning`,children:`脚本以本机账户权限运行,可访问项目外文件和网络。`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`md:col-span-2`,children:(0,B.jsx)($M,{label:`Agent 提示词`,children:(0,B.jsx)(Nu,{className:`h-28 resize-y leading-relaxed`,value:D,onChange:e=>O(e.target.value)})})}),(0,B.jsx)($M,{label:`审批策略`,children:(0,B.jsx)(Fu,{label:`审批策略`,value:k,onValueChange:e=>{A(e),ee(!1)},options:[{value:`readonly`,label:`只读`},{value:`autonomous`,label:`完全自主`}]})}),(0,B.jsx)($M,{label:`模型`,children:(0,B.jsx)(Fu,{label:`模型`,value:j,onValueChange:M,options:[{value:``,label:`继承会话默认`},...re.map(e=>({value:e.key,label:e.label}))]})}),k===`autonomous`&&(0,B.jsxs)(`label`,{htmlFor:`${o}-confirm-autonomous`,className:`md:col-span-2 flex items-start gap-2 rounded-lg border border-danger/30 bg-danger/5 px-2 py-2 text-[11px]`,children:[(0,B.jsx)(Pu,{id:`${o}-confirm-autonomous`,className:`mt-0.5`,checked:N,onChange:e=>ee(e.target.checked)}),(0,B.jsx)(`span`,{children:`我了解:该任务无人值守运行,可按完全自主策略执行已登记工具(含文件写入 / 命令)。程序以本机账户权限运行,可访问项目外文件和网络。`})]})]})]}),ne&&(0,B.jsx)(`p`,{role:`alert`,className:`mt-2 text-[11px] text-danger`,children:ne}),(0,B.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,B.jsx)(V,{size:`sm`,variant:`ghost`,onClick:r,children:`取消`}),(0,B.jsx)(V,{size:`sm`,variant:`secondary`,onClick:()=>void ie(),disabled:te,children:te?`保存中…`:`保存`})]})]})}function $M({label:e,children:t}){return(0,B.jsxs)(`label`,{className:`block`,children:[(0,B.jsx)(`span`,{className:`mb-1 block text-[10.5px] text-ink-3`,children:e}),t]})}var eN=[{value:`https://open.bigmodel.cn/api/paas/v4`,label:`标准 · 国内`},{value:`https://open.bigmodel.cn/api/coding/paas/v4`,label:`Coding Plan · 国内`},{value:`https://api.z.ai/api/paas/v4`,label:`标准 · 国际`},{value:`https://api.z.ai/api/coding/paas/v4`,label:`Coding Plan · 国际`}],tN=eN[0].value;function nN(e){return e===`glm`?`GLM`:e===`openai-compatible`?`兼容`:`DeepSeek`}function rN(e){return e.contextWindow===null?`窗口未知`:`${Math.round(e.contextWindow/1024)}K 上下文`}function iN(e){if(!e.thinking.supported)return`不支持思考档位`;let t=e.thinking.mode??`levels`;return t===`toggle`?`思考 开 / 关`:t===`mandatory-levels`?`思考 低 / 中 / 高(强制)`:`思考 低 / 中 / 高`}function aN(e){return e.syncedAt===null?`尚未同步`:`同步于 ${new Date(e.syncedAt).toLocaleString(`zh-CN`,{hour12:!1})}`}function oN({open:e,onOpenChange:t}){let n=(0,H.useId)(),r=Wd(),[i,a]=(0,H.useState)({kind:`list`}),[o,s]=(0,H.useState)([]),[c,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(`deepseek`),[f,p]=(0,H.useState)(tN),[m,h]=(0,H.useState)(``),[g,_]=(0,H.useState)(`128`),[v,y]=(0,H.useState)(``),[b,x]=(0,H.useState)(`128`),[S,C]=(0,H.useState)(`DeepSeek Key`),[w,T]=(0,H.useState)(``),[E,D]=(0,H.useState)(!1),[O,k]=(0,H.useState)(!1),[A,j]=(0,H.useState)(!1),[M,N]=(0,H.useState)(!1),[ee,te]=(0,H.useState)(null),P=c?.groups??(c===null?[]:[c]),ne=c?.defaultSelection??null,F=i.kind===`key`?P.find(e=>e.credentialProfileId===i.credentialId):void 0,re=F?F.models.filter(e=>E||e.contextWindow!==null):[],ie=F?F.models.filter(e=>e.contextWindow===null).length:0,ae=e=>o.find(t=>t.id===e)?.masked??``,oe=e=>o.find(t=>t.id===e)?.endpoint??null,se=i.kind===`key`?o.find(e=>e.id===i.credentialId):void 0,ce=async()=>{N(!0),te(null);try{let[e,t]=await Promise.all([xA(),_A().catch(()=>null)]);s(e),l(t)}catch(e){te(oA(e,`加载模型设置失败`))}finally{N(!1)}};(0,H.useEffect)(()=>{e?ce():(T(``),D(!1),k(!1),a({kind:`list`}))},[e]),(0,H.useEffect)(()=>{se?.provider===`openai-compatible`&&(y(se.endpoint??``),x(String(Math.max(1,Math.round((se.contextWindow??128e3)/1024)))))},[se?.id,se?.endpoint,se?.contextWindow]);let le=async e=>{j(!0),te(null);try{let t=await bA();l(t);let n=t.groups.find(t=>t.credentialProfileId===e);e&&(!n||n.lastRefreshError)&&te(`Key 已保存,目录同步失败。请打开该 Key 后重试刷新。`)}catch(t){te(e?`Key 已保存,目录同步失败。请打开该 Key 后重试刷新。`:oA(t,`刷新目录失败`));let n=await _A().catch(()=>null);n&&l(n)}finally{await r.invalidateQueries({queryKey:[`model-catalog`]}),j(!1)}},ue=async(e,t)=>{if(t.contextWindow===null)te(`该模型未声明上下文窗口,暂时不能设为默认。`);else{j(!0),te(null);try{await vA({model:t.id,credentialProfileId:e.credentialProfileId}),l(await _A()),await r.invalidateQueries({queryKey:[`model-catalog`]})}catch(e){te(oA(e,`设置默认模型失败`))}finally{j(!1)}}},de=async(e,t)=>{j(!0),te(null);try{await yA({credentialProfileId:e.credentialProfileId,modelId:t.id,visible:t.visible===!1}),l(await _A()),await r.invalidateQueries({queryKey:[`model-catalog`]})}catch(e){te(oA(e,`更新显示状态失败`))}finally{j(!1)}},fe=async()=>{if(w.trim()){j(!0),te(null);try{let e=await SA({provider:u,label:S.trim()||(u===`glm`?`GLM Key`:`DeepSeek Key`),apiKey:w,...u===`glm`?{endpoint:f}:{},...u===`openai-compatible`?{endpoint:m.trim(),contextWindow:Math.max(1,Number(g)||128)*1024}:{}});T(``),await ce(),await le(e.id),a({kind:`list`})}catch(e){te(oA(e,`保存 Key 失败`))}finally{j(!1)}}},pe=async(e,t)=>{j(!0),te(null);try{await CA(e,t),await ce(),await le()}catch(e){te(oA(e,`更新端点失败`))}finally{j(!1)}},me=async e=>{j(!0),te(null);try{await wA(e,{endpoint:v.trim(),contextWindow:Math.max(1,Number(b)||128)*1024}),await ce(),await le()}catch(e){te(oA(e,`保存兼容端点失败`))}finally{j(!1)}},he=async e=>{j(!0),te(null);try{await TA(e),k(!1),a({kind:`list`}),await ce(),await r.invalidateQueries({queryKey:[`model-catalog`]})}catch(e){te(oA(e,`删除 Key 失败`))}finally{k(!1),j(!1)}};return(0,B.jsx)(ca,{open:e,onOpenChange:t,children:(0,B.jsxs)(ua,{className:`flex h-[min(660px,calc(100dvh-32px))] w-[min(820px,calc(100vw-32px))] flex-col overflow-hidden p-0`,children:[(0,B.jsxs)(`header`,{className:`flex shrink-0 items-start gap-2 border-b border-line px-4 py-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(da,{children:`模型与凭据`}),(0,B.jsx)(fa,{children:`Key 只保存在本机;隐藏的模型不会出现在会话选择器里。`})]}),(0,B.jsx)(la,{asChild:!0,children:(0,B.jsx)(V,{variant:`ghost`,size:`sm`,"aria-label":`关闭模型设置`,children:(0,B.jsx)(sy,{size:14})})})]}),(0,B.jsx)(Ou,{message:ee,onDismiss:()=>te(null)}),i.kind===`list`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between px-4 py-2`,children:[(0,B.jsx)(`span`,{className:`text-[10.5px] font-semibold text-ink-3`,children:`提供方与 Key`}),(0,B.jsxs)(V,{size:`sm`,variant:`secondary`,onClick:()=>a({kind:`add`}),children:[(0,B.jsx)(Ov,{size:12}),`添加 Key`]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto px-4 pb-3`,children:[P.length===0?(0,B.jsx)(`p`,{className:`rounded-xl border border-dashed border-line px-3 py-6 text-center text-[11px] text-ink-3`,children:o.length===0?`还没有 Key。添加后即可同步官方模型目录。`:`目录为空,先刷新一次。`}):null,P.map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>a({kind:`key`,credentialId:e.credentialProfileId}),className:`flex w-full items-center gap-3 rounded-xl border border-line bg-surface px-3 py-2.5 text-left transition-colors hover:bg-surface-2/60`,children:[(0,B.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-surface-2 text-ink-3`,children:(0,B.jsx)(Q_,{size:14})}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 text-[12.5px] font-medium text-ink`,children:[nN(e.provider),` · `,e.credentialLabel,(0,B.jsx)(`span`,{className:`font-mono text-[10px] text-ink-3`,children:ae(e.credentialProfileId)})]}),(0,B.jsxs)(`span`,{className:`mt-0.5 flex items-center gap-2 text-[10.5px] text-ink-3`,children:[(0,B.jsxs)(`span`,{children:[e.models.length,` 个模型`]}),e.provider===`glm`?(0,B.jsx)(`span`,{className:`rounded bg-surface-2 px-1 py-[1px]`,children:(oe(e.credentialProfileId)??tN).includes(`/coding/`)?`Coding`:`标准`}):null,(0,B.jsx)(`span`,{children:`·`}),(0,B.jsx)(`span`,{children:aN(e)}),e.stale?(0,B.jsx)(`span`,{className:`text-warning`,children:`· 待刷新`}):null]})]}),(0,B.jsx)(o_,{size:13,className:`shrink-0 text-ink-3`})]},e.credentialProfileId))]}),(0,B.jsx)(`footer`,{className:`shrink-0 border-t border-line px-4 py-2 text-[10.5px] text-ink-3`,children:`默认模型用于新会话;会话内可在输入框切换到其他可见模型。`})]}):null,i.kind===`key`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-line px-4 py-2`,children:[(0,B.jsx)(V,{size:`sm`,variant:`ghost`,"aria-label":`返回凭据列表`,onClick:()=>a({kind:`list`}),children:(0,B.jsx)(Hg,{size:13})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`truncate text-[12.5px] font-semibold`,children:F?`${nN(F.provider)} · ${F.credentialLabel}`:`Key`}),(0,B.jsx)(`p`,{className:`text-[10px] text-ink-3`,children:F?aN(F):``})]}),F?.provider===`glm`?(0,B.jsx)(Fu,{label:`GLM 端点`,value:se?.endpoint??tN,disabled:A,onValueChange:e=>void pe(i.credentialId,e),options:eN,className:`h-7 w-auto text-[10.5px]`}):null,(0,B.jsxs)(V,{size:`sm`,variant:`secondary`,disabled:A,onClick:()=>void le(),children:[(0,B.jsx)(Av,{size:12,className:A?`animate-spin`:void 0}),`刷新目录`]}),ie>0?(0,B.jsx)(V,{size:`sm`,variant:`ghost`,"aria-pressed":E,"aria-label":E?`隐藏不可用模型`:`显示不可用模型`,onClick:()=>D(e=>!e),children:E?`隐藏不可用`:`显示不可用 (${ie})`}):null,(0,B.jsx)(V,{size:`sm`,variant:`ghost`,"aria-label":`删除 Key`,disabled:A,onClick:()=>k(!0),children:(0,B.jsx)(ny,{size:12})})]}),F?.provider===`openai-compatible`?(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-end gap-2 border-b border-line px-4 py-2`,children:[(0,B.jsxs)(`label`,{htmlFor:`${n}-endpoint-edit`,className:`block min-w-0 flex-1 text-[10px] font-semibold text-ink-3`,children:[`端点 URL`,(0,B.jsx)(Mu,{id:`${n}-endpoint-edit`,value:v,onChange:e=>y(e.target.value),"aria-label":`兼容端点 URL`,className:`mt-1 h-7 font-mono text-[10.5px]`})]}),(0,B.jsxs)(`label`,{htmlFor:`${n}-window-edit`,className:`block w-24 text-[10px] font-semibold text-ink-3`,children:[`窗口(K)`,(0,B.jsx)(Mu,{id:`${n}-window-edit`,value:b,onChange:e=>x(e.target.value),"aria-label":`兼容上下文窗口(K)`,inputMode:`numeric`,className:`mt-1 h-7 font-mono text-[10.5px]`})]}),(0,B.jsx)(V,{size:`sm`,variant:`secondary`,disabled:A||!v.trim(),onClick:()=>void me(i.credentialId),children:`保存`})]}):null,(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:F===void 0?(0,B.jsx)(`p`,{className:`px-4 py-3 text-[11px] text-ink-3`,children:`目录不可用,请刷新。`}):re.length===0?(0,B.jsx)(`p`,{className:`px-4 py-3 text-[11px] text-ink-3`,children:F.models.length===0?`该 Key 还没有可用模型,点“刷新目录”同步。`:`暂无可选模型;可显示不可用项查看原因。`}):re.map(e=>{let t=e.id===ne?.model&&F.credentialProfileId===ne.credentialProfileId,n=e.contextWindow===null;return(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line/60 px-4 py-2 last:border-b-0`,children:[(0,B.jsxs)(`button`,{type:`button`,disabled:n||A,onClick:()=>void ue(F,e),className:`min-w-0 flex-1 text-left disabled:cursor-not-allowed disabled:opacity-45`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 text-[12px] font-medium text-ink`,children:[e.label,t?(0,B.jsx)(`span`,{className:`rounded-full bg-accent-soft px-1.5 py-[1px] text-[9px] text-accent`,children:`默认`}):null]}),(0,B.jsxs)(`span`,{className:`mt-0.5 block text-[10.5px] text-ink-3`,children:[rN(e),` · `,iN(e),n?` · 不可选`:``]})]}),(0,B.jsxs)(`button`,{type:`button`,"aria-pressed":e.visible!==!1,"aria-label":`${e.label} 在会话中显示`,disabled:A,onClick:()=>void de(F,e),className:`flex h-7 items-center gap-1 rounded-lg px-1.5 text-[10.5px] text-ink-3 transition-colors hover:bg-surface-2 hover:text-ink disabled:opacity-50`,children:[e.visible===!1?(0,B.jsx)(O_,{size:13}):(0,B.jsx)(A_,{size:13}),e.visible===!1?`隐藏`:`显示`]})]},e.id)})}),(0,B.jsx)(`footer`,{className:`shrink-0 border-t border-line px-4 py-2 text-[10.5px] text-ink-3`,children:`点模型名设为新会话默认;眼睛图标控制是否出现在输入框选择器。`}),(0,B.jsx)(ca,{open:O,onOpenChange:e=>!e&&!A?k(!1):void 0,children:(0,B.jsxs)(ua,{overlayClassName:`z-[310]`,className:`z-[311] w-[min(400px,calc(100vw-40px))] space-y-3 text-sm`,children:[(0,B.jsx)(da,{children:`删除 Key?`}),(0,B.jsxs)(fa,{children:[F?`${nN(F.provider)} · ${F.credentialLabel}`:`该 Key`,` `,`会从本机移除,对应模型也会从选择器中消失;此操作不可撤销。`]}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,disabled:A,onClick:()=>k(!1),children:`取消`}),(0,B.jsxs)(V,{variant:`danger`,disabled:A,onClick:()=>void he(i.credentialId),children:[A?(0,B.jsx)(ev,{size:12,className:`animate-spin`}):null,`删除`]})]})]})})]}):null,i.kind===`add`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-line px-4 py-2`,children:[(0,B.jsx)(V,{size:`sm`,variant:`ghost`,"aria-label":`返回凭据列表`,onClick:()=>a({kind:`list`}),children:(0,B.jsx)(Hg,{size:13})}),(0,B.jsx)(`span`,{className:`text-[12.5px] font-semibold`,children:`添加 Key`})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-4`,children:[(0,B.jsx)(`div`,{className:`flex gap-1`,children:[`deepseek`,`glm`,`openai-compatible`].map(e=>(0,B.jsx)(`button`,{type:`button`,"aria-pressed":u===e,onClick:()=>{d(e),C(e===`glm`?`GLM Key`:e===`openai-compatible`?`兼容 Key`:`DeepSeek Key`)},className:`h-7 rounded-lg px-2.5 text-[10.5px] transition-colors ${u===e?`bg-accent-soft text-accent`:`bg-surface-2 text-ink-3 hover:text-ink`}`,children:e===`glm`?`GLM`:e===`openai-compatible`?`兼容`:`DeepSeek`},e))}),u===`glm`?(0,B.jsxs)(`div`,{className:`block text-[10.5px] font-semibold text-ink-3`,children:[`端点`,(0,B.jsx)(Fu,{label:`GLM 端点`,value:f,onValueChange:p,options:eN,className:`mt-1`})]}):null,u===`openai-compatible`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`label`,{htmlFor:`${n}-endpoint`,className:`block text-[10.5px] font-semibold text-ink-3`,children:[`端点 URL`,(0,B.jsx)(Mu,{id:`${n}-endpoint`,value:m,onChange:e=>h(e.target.value),"aria-label":`兼容端点 URL`,placeholder:`https://api.example.com/v1`,className:`mt-1 font-mono text-[11px]`})]}),(0,B.jsxs)(`label`,{htmlFor:`${n}-window`,className:`block text-[10.5px] font-semibold text-ink-3`,children:[`上下文窗口(K)`,(0,B.jsx)(Mu,{id:`${n}-window`,value:g,onChange:e=>_(e.target.value),"aria-label":`兼容上下文窗口(K)`,inputMode:`numeric`,className:`mt-1 font-mono text-[11px]`})]})]}):null,(0,B.jsxs)(`label`,{htmlFor:`${n}-credential-name`,className:`block text-[10.5px] font-semibold text-ink-3`,children:[`名称`,(0,B.jsx)(Mu,{id:`${n}-credential-name`,value:S,onChange:e=>C(e.target.value),"aria-label":`凭据名称`,className:`mt-1 text-[11px]`})]}),(0,B.jsxs)(`label`,{htmlFor:`${n}-api-key`,className:`block text-[10.5px] font-semibold text-ink-3`,children:[`API Key`,(0,B.jsx)(Mu,{id:`${n}-api-key`,type:`password`,value:w,onChange:e=>T(e.target.value),"aria-label":`API Key`,placeholder:`sk-…`,autoComplete:`off`,className:`mt-1 font-mono text-[11px]`})]}),(0,B.jsxs)(V,{variant:`primary`,size:`sm`,disabled:A||!w.trim()||u===`openai-compatible`&&!m.trim(),onClick:()=>void fe(),children:[A?(0,B.jsx)(ev,{size:12,className:`animate-spin`}):null,`添加`]})]})]}):null,M?(0,B.jsxs)(`p`,{className:`flex shrink-0 items-center gap-1.5 px-4 py-2 text-[10.5px] text-ink-3`,children:[(0,B.jsx)(ev,{size:11,className:`animate-spin`}),` 正在读取…`]}):null]})})}function sN({open:e,onOpenChange:t}){let n=(0,H.useId)(),r=Wd(),[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(``),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(null),v=(0,H.useCallback)(async e=>{h(!0),_(null);try{p(await uA(e))}catch(e){_(oA(e,`无法读取目录`))}finally{h(!1)}},[]);(0,H.useEffect)(()=>{e?v():(a(``),s(``),d(null),l(!1),p(null),_(null))},[v,e]);let y=async()=>{if(i.trim()){l(!0),d(null);try{await fA({rootPath:i.trim(),...o.trim()?{name:o.trim()}:{}}),await r.invalidateQueries({queryKey:[`workspace`]}),t(!1)}catch(e){d(oA(e,`添加项目失败`))}finally{l(!1)}}};return(0,B.jsx)(ca,{open:e,onOpenChange:t,children:(0,B.jsxs)(ua,{className:`w-[min(640px,calc(100vw-40px))]`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-lg bg-accent-soft text-accent`,children:(0,B.jsx)(R_,{size:15})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(da,{children:`添加项目`}),(0,B.jsx)(fa,{children:`浏览本机目录并选择项目根目录;不会复制或删除源码。`})]})]}),(0,B.jsxs)(`div`,{className:`mt-4 rounded-xl border border-line bg-surface-2/40`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-line px-2 py-1.5`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`上一级`,title:`上一级`,disabled:f===null||f.parent===null||m,onClick:()=>f?.parent&&void v(f.parent),className:`flex h-6 w-6 items-center justify-center rounded text-ink-3 hover:bg-black/[.06] hover:text-ink disabled:opacity-40 dark:hover:bg-white/[.08]`,children:(0,B.jsx)(c_,{size:13})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`主目录`,title:`主目录`,disabled:m,onClick:()=>void v(f?.home),className:`flex h-6 w-6 items-center justify-center rounded text-ink-3 hover:bg-black/[.06] hover:text-ink disabled:opacity-40 dark:hover:bg-white/[.08]`,children:(0,B.jsx)(X_,{size:12})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`刷新目录`,title:`刷新`,disabled:m,onClick:()=>void v(f?.path),className:`flex h-6 w-6 items-center justify-center rounded text-ink-3 hover:bg-black/[.06] hover:text-ink disabled:opacity-40 dark:hover:bg-white/[.08]`,children:(0,B.jsx)(Av,{size:12})}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-1 font-mono text-[10.5px] text-ink-2`,children:f?.path??(g?`目录不可用`:`读取中…`)})]}),(0,B.jsxs)(`div`,{className:`h-[230px] overflow-auto p-1.5`,children:[m?(0,B.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-1.5 text-[11px] text-ink-3`,children:[(0,B.jsx)(ev,{size:12,className:`animate-spin`}),` 正在读取目录…`]}):f?.entries.length===0?(0,B.jsx)(`p`,{className:`px-2 py-3 text-[11px] text-ink-3`,children:`没有子目录`}):f?.entries.map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>void v(e.path),className:`flex h-8 w-full items-center gap-2 rounded-md px-2 text-left text-[11.5px] text-ink-2 hover:bg-black/[.05] hover:text-ink dark:hover:bg-white/[.07]`,children:[(0,B.jsx)(H_,{size:13,className:`shrink-0 text-accent/80`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]},e.path)),f?.truncated?(0,B.jsx)(`p`,{className:`px-2 py-1 text-[10px] text-warning`,children:`目录过多,仅显示前 500 项`}):null]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-line px-2 py-1.5`,children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[10px] text-ink-3`,children:i||`尚未选择项目目录`}),(0,B.jsx)(V,{variant:`secondary`,size:`sm`,disabled:f===null||m,onClick:()=>{f!==null&&(a(f.path),o.trim()||s(f.path.split(/[\\/]/).filter(Boolean).at(-1)??``))},children:`选择当前目录`})]})]}),(0,B.jsxs)(`label`,{htmlFor:`${n}-directory`,className:`mt-3 block text-[11px] font-medium text-ink-2`,children:[`项目目录(也可直接粘贴绝对路径)`,(0,B.jsx)(Mu,{id:`${n}-directory`,value:i,onChange:e=>a(e.target.value),"aria-label":`项目目录`,placeholder:`/Users/me/project`,spellCheck:!1,className:`mt-1.5 h-9 font-mono text-[11.5px]`})]}),(0,B.jsxs)(`label`,{htmlFor:`${n}-name`,className:`mt-2.5 block text-[11px] font-medium text-ink-2`,children:[`显示名称(可选)`,(0,B.jsx)(Mu,{id:`${n}-name`,value:o,onChange:e=>s(e.target.value),placeholder:`默认取目录名`,className:`mt-1.5 h-9 text-[11.5px]`})]}),(0,B.jsx)(Ou,{message:u??g,onDismiss:u?()=>d(null):void 0}),(0,B.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:()=>t(!1),children:`取消`}),(0,B.jsx)(V,{variant:`primary`,size:`sm`,disabled:c||!i.trim(),onClick:()=>void y(),children:c?`正在添加…`:`添加项目`})]})]})})}function cN({project:e,open:t,onClose:n}){let r=Wd(),[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(null);(0,H.useEffect)(()=>{a(e?.name??``),l(null),s(!1)},[e]);let u=async()=>{if(e!==null&&i.trim()){s(!0),l(null);try{await hA(e.id,{name:i.trim()}),await r.invalidateQueries({queryKey:[`workspace`]}),n()}catch(e){l(oA(e,`重命名失败`))}finally{s(!1)}}};return(0,B.jsx)(ca,{open:t&&e!==null,onOpenChange:e=>e?void 0:n(),children:(0,B.jsxs)(ua,{children:[(0,B.jsx)(da,{children:`重命名项目`}),(0,B.jsx)(fa,{children:`只改变展示名称,不移动或重命名本地目录。`}),(0,B.jsx)(Mu,{value:i,onChange:e=>a(e.target.value),"aria-label":`项目名称`,autoFocus:!0,className:`mt-4 h-9`}),(0,B.jsx)(Ou,{message:c,onDismiss:()=>l(null)}),(0,B.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:n,children:`取消`}),(0,B.jsx)(V,{variant:`primary`,size:`sm`,disabled:o||!i.trim(),onClick:()=>void u(),children:o?`正在保存…`:`保存`})]})]})})}var lN=cj(e=>({draft:``,modelId:`deepseek-flash`,credentialProfileId:null,thinking:`medium`,policy:`standard`,setDraft:t=>e({draft:t}),setModelId:t=>e({modelId:t}),setCredentialProfileId:t=>e({credentialProfileId:t}),setThinking:t=>e({thinking:t}),setPolicy:t=>e({policy:t})})),uN=[`service-ops`,`services`],dN=e=>[`service-ops`,`deployments`,e],fN=e=>[`service-ops`,`logs`,e];async function pN(e,t){return rk.parse(await Y(`/api/service-ops/services/${encodeURIComponent(e)}/control`,{method:`POST`,csrf:!0,body:t}))}async function mN(){return ik.parse(await Y(`/api/service-ops/services`))}async function hN(e){return(await Y(`/api/service-ops/services/${encodeURIComponent(e)}/deployments`)).items}async function gN(e){return Y(`/api/service-ops/services/${encodeURIComponent(e)}/logs`)}var _N={stopped:`已停止`,starting:`启动中`,running:`运行中`,unhealthy:`不健康`,stopping:`停止中`,failed:`失败`,unknown:`未知`},vN={start:`启动`,stop:`停止`,restart:`重启`};function yN({open:e,onOpenChange:t}){let n=Wd(),[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(!1),l=gp({queryKey:uN,queryFn:mN,enabled:e,refetchInterval:e?3e3:!1}),u=l.data?.items.find(({targetId:e})=>e===r);(0,H.useEffect)(()=>{l.data&&r&&!l.data.items.some(e=>e.targetId===r)&&(i(null),o(null),c(!1))},[l.data,r]);let d=u?.targetId??``,f=gp({queryKey:dN(d),queryFn:()=>hN(d),enabled:e&&!!u&&u.source!==`pm2-cli`}),p=gp({queryKey:fN(d),queryFn:()=>gN(d),enabled:e&&!!u,refetchInterval:e&&u?3e3:!1}),m=()=>n.invalidateQueries({queryKey:[`service-ops`]}),h=_p({mutationFn:({service:e,action:t,requestKey:n})=>pN(e.targetId,{action:t,requestKey:n,expectedPm2Name:e.pm2Name,confirmed:!0}),retry:!1,onSuccess:()=>{o(null),c(!1)},onError:()=>{o(null),c(!0)},onSettled:()=>{m()}}),g=e=>{if(!u||h.isPending)return;c(!1);let t={service:u,action:e,requestKey:crypto.randomUUID()};e===`start`?h.mutate(t):o(t)},_=e=>{let n=Xj.getState();n.projectId===e.projectId&&n.sessionId||n.startDraft(e.projectId);let r=lN.getState();r.draft.trim()||r.setDraft(`请检查 PM2 服务 ${e.pm2Name} 的状态和日志。`),n.focusComposer(),t(!1)},v=h.isPending||l.isError||!!u&&[`starting`,`stopping`,`unknown`].includes(u.observedState);return(0,B.jsx)(ca,{open:e,onOpenChange:e=>{e||(i(null),o(null),c(!1)),t(e)},children:(0,B.jsxs)(ua,{className:`flex h-[min(660px,calc(100dvh-32px))] w-[min(900px,calc(100vw-32px))] flex-col overflow-hidden p-0`,"data-testid":`service-ops-dialog`,children:[(0,B.jsxs)(`header`,{className:`flex shrink-0 items-center gap-2 border-b border-line px-3 py-2`,children:[(0,B.jsx)(Iv,{size:14,className:`text-ink-3`}),(0,B.jsx)(da,{className:`text-[12px] font-semibold`,children:`服务运维`}),(0,B.jsx)(fa,{className:`sr-only`,children:`查看正式服务状态、日志及启停操作`}),(0,B.jsx)(`span`,{className:`rounded bg-surface-2 px-1.5 text-[10px] text-ink-3`,children:l.data?.items.length??0}),(0,B.jsx)(`div`,{className:`flex-1`}),(0,B.jsxs)(V,{size:`sm`,variant:`ghost`,disabled:l.isFetching,onClick:()=>void m(),children:[(0,B.jsx)(Av,{size:12,className:l.isFetching?`animate-spin`:void 0}),`刷新`]}),(0,B.jsx)(la,{asChild:!0,children:(0,B.jsx)(V,{size:`sm`,variant:`ghost`,"aria-label":`关闭服务运维`,children:(0,B.jsx)(sy,{size:14})})})]}),(0,B.jsx)(Ou,{message:s?`操作失败,请刷新状态和日志后再试。`:l.isError?l.data?`刷新失败,当前为上次观察结果。`:`正式服务不可用,请刷新重试。`:u&&p.isError?`日志读取失败,请刷新重试。`:null,onDismiss:s?()=>c(!1):void 0}),l.isPending?(0,B.jsx)(`p`,{role:`status`,className:`p-3 text-[11px] text-ink-3`,children:`正在读取服务…`}):u?(0,B.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":`服务详情`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-start gap-2 border-b border-line px-3 py-2`,children:[(0,B.jsx)(V,{size:`sm`,variant:`ghost`,"aria-label":`返回服务列表`,onClick:()=>{i(null),c(!1)},children:(0,B.jsx)(Hg,{size:12})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`h3`,{className:`truncate text-[12.5px] font-semibold`,children:u.name}),(0,B.jsx)(bN,{service:u})]}),(0,B.jsxs)(`p`,{className:`mt-1 text-[10px] text-ink-3`,children:[`所属项目 `,u.projectName??u.projectId]})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(0,B.jsxs)(V,{size:`sm`,variant:`secondary`,onClick:()=>_(u),children:[(0,B.jsx)(Kg,{size:12}),`在项目会话中处理`]}),u.observedState!==`running`&&(0,B.jsxs)(V,{size:`sm`,variant:`secondary`,disabled:v||u.reasonCode===`PM2_MISSING`,onClick:()=>g(`start`),children:[(0,B.jsx)(Ev,{size:12}),`启动`]}),(0,B.jsxs)(V,{size:`sm`,variant:`secondary`,disabled:v||u.observedState===`stopped`,onClick:()=>g(`restart`),children:[(0,B.jsx)(Mv,{size:12}),`重启`]}),(0,B.jsxs)(V,{size:`sm`,variant:`danger`,disabled:v||u.observedState===`stopped`,onClick:()=>g(`stop`),children:[(0,B.jsx)(Xv,{size:11}),`停止`]})]})]}),(0,B.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-2 px-3 py-2 md:grid-cols-4`,children:[(0,B.jsx)(xN,{label:`PM2 服务`,value:u.pm2Name,mono:!0}),(0,B.jsx)(xN,{label:`进程 PID`,value:u.pid?.toString()??`—`,mono:!0}),(0,B.jsx)(xN,{label:`健康检查`,value:u.lastHealthAt?FM(u.lastHealthAt):`未核验`}),(0,B.jsx)(xN,{label:`最近观察`,value:FM(u.updatedAt)})]}),h.isPending&&(0,B.jsxs)(`p`,{role:`status`,className:`px-3 pb-2 text-[11px] text-ink-3`,children:[`正在`,vN[h.variables.action],`,等待 PM2 状态…`]}),u.reasonCode&&u.reasonCode!==`HEALTH_UNVERIFIED`&&(0,B.jsx)(`p`,{className:`px-3 pb-2 text-[11px] text-danger [overflow-wrap:anywhere]`,children:u.reasonCode===`PM2_MISSING`?`PM2 中已无此服务,请在项目会话中重新部署。`:u.reasonCode}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-1.5 px-3 pb-3`,children:[(0,B.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-[10px] uppercase tracking-[0.08em] text-ink-3`,children:[(0,B.jsx)(ey,{size:11}),`运行日志`]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-lg border border-line bg-[#0f1115] p-2 font-mono text-[10px] leading-5 text-[#c7ccd4]`,children:p.isPending?(0,B.jsx)(`p`,{className:`text-white/35`,children:`读取中…`}):(0,B.jsx)(`pre`,{className:`whitespace-pre-wrap break-all`,children:p.data?.text||(p.isError?`日志暂不可用`:`暂无日志`)})}),p.data?.truncated&&(0,B.jsx)(`p`,{className:`text-[10px] text-ink-3`,children:`仅显示最近日志。`})]}),u.source!==`pm2-cli`&&(0,B.jsxs)(`details`,{className:`max-h-36 shrink-0 overflow-auto border-t border-line px-3 py-2 text-[11px] text-ink-2`,children:[(0,B.jsxs)(`summary`,{className:`cursor-pointer`,children:[`历史发布记录`,u.version?` · ${u.version}`:``]}),f.isError?(0,B.jsx)(`p`,{children:`发布记录读取失败`}):f.data?.length?f.data.map(e=>(0,B.jsx)(SN,{deployment:e},e.id)):(0,B.jsx)(`p`,{className:`mt-2`,children:`暂无发布记录`})]})]}):(0,B.jsxs)(`section`,{className:`min-h-0 flex-1 overflow-auto p-3`,"aria-label":`正式服务列表`,children:[l.data?.items.length?(0,B.jsx)(`div`,{className:`grid grid-cols-1 gap-2 md:grid-cols-2`,children:l.data.items.map(e=>(0,B.jsxs)(`button`,{type:`button`,className:`min-w-0 rounded-lg border border-line bg-surface p-2.5 text-left transition-colors hover:bg-surface-2`,onClick:()=>{i(e.targetId),c(!1)},children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate text-[12px] font-medium`,children:e.name}),(0,B.jsx)(bN,{service:e}),(0,B.jsx)(`span`,{className:`ml-auto rounded bg-black/[0.04] px-1.5 py-0.5 text-[9px] text-ink-3 dark:bg-white/[0.07]`,children:`PM2`})]}),(0,B.jsx)(`p`,{className:`mt-2 truncate text-[11px] text-ink-2`,children:e.projectName??e.projectId}),(0,B.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-ink-3`,children:e.pm2Name}),(0,B.jsxs)(`p`,{className:`mt-2 text-[9.5px] text-ink-3`,children:[e.pid?`PID ${e.pid} · `:``,`观察于`,` `,FM(e.updatedAt)]})]},e.targetId))}):!l.isError&&(0,B.jsxs)(`div`,{className:`grid h-full content-center justify-items-center gap-2 text-center`,children:[(0,B.jsx)(Iv,{size:22,className:`text-ink-3`}),(0,B.jsx)(`p`,{className:`text-[12px] font-medium`,children:`暂无正式服务`}),(0,B.jsx)(`p`,{className:`max-w-sm text-[11px] text-ink-3`,children:`在项目会话中让 Agent 通过 PM2 部署,运行后即可查看和管理。`})]}),!!l.data?.unassociated.length&&(0,B.jsxs)(`div`,{className:`mt-3 rounded-lg border border-line bg-surface-2/50 p-2.5 text-[11px] text-ink-3`,children:[(0,B.jsx)(`p`,{children:`未关联项目的 PM2 服务`}),l.data.unassociated.map(e=>(0,B.jsx)(`p`,{className:`mt-1 font-mono text-[10px] [overflow-wrap:anywhere]`,children:e.pm2Name},e.pm2Name))]})]}),l.data?.pm2Home&&(0,B.jsxs)(`details`,{className:`shrink-0 border-t border-line bg-surface-2/30 px-3 py-2 text-[10px] text-ink-3`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer`,children:`本机 PM2 查询命令`}),(0,B.jsx)(`p`,{className:`mt-2`,children:`终端查询时使用此实例目录,与页面保持一致。`}),(0,B.jsx)(`code`,{className:`mt-1 block select-all break-all font-mono text-ink-2`,children:`PM2_HOME='${l.data.pm2Home.replaceAll(`'`,`'\\''`)}' pm2 list`})]}),(0,B.jsx)(ca,{open:e&&!!a,onOpenChange:e=>{!e&&!h.isPending&&o(null)},children:(0,B.jsxs)(ua,{className:`w-[min(400px,calc(100vw-32px))] space-y-3`,children:[(0,B.jsxs)(da,{children:[a?vN[a.action]:`操作`,`服务?`]}),(0,B.jsx)(fa,{className:`text-[12px] leading-relaxed`,children:a?.action===`stop`?`停止后服务将无法访问,可随时重新启动。`:`重启期间服务会短暂中断。`}),(0,B.jsxs)(`div`,{className:`rounded-lg border border-line bg-surface-2/50 p-2.5`,children:[(0,B.jsx)(`p`,{className:`text-[12px] font-medium`,children:a?.service.name}),(0,B.jsx)(`p`,{className:`mt-1 text-[11px] text-ink-3`,children:a?.service.projectName??a?.service.projectId}),(0,B.jsx)(`p`,{className:`mt-1 break-all font-mono text-[10px] text-ink-3`,children:a?.service.pm2Name})]}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(V,{size:`sm`,variant:`secondary`,disabled:h.isPending,onClick:()=>o(null),children:`取消`}),(0,B.jsx)(V,{size:`sm`,variant:a?.action===`stop`?`danger`:`primary`,disabled:h.isPending,onClick:()=>{a&&h.mutate(a)},children:h.isPending?`处理中…`:`确认${a?vN[a.action]:`操作`}`})]})]})})]})})}function bN({service:e}){return(0,B.jsx)(`span`,{className:z(`shrink-0 rounded-full border px-1.5 py-[1px] text-[9px]`,e.observedState===`running`?`border-success/20 bg-success/10 text-success`:e.observedState===`failed`||e.observedState===`unhealthy`?`border-danger/20 bg-danger/10 text-danger`:`border-line bg-surface-2 text-ink-3`),children:_N[e.observedState]})}function xN({label:e,value:t,mono:n}){return(0,B.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-line bg-surface-2/50 px-2 py-1.5`,children:[(0,B.jsx)(`p`,{className:`text-[9px] uppercase tracking-[0.08em] text-ink-3`,children:e}),(0,B.jsx)(`p`,{className:z(`mt-1 truncate text-[11px]`,n&&`font-mono`),title:t,children:t})]})}function SN({deployment:e}){return(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-[11px] text-ink-3`,children:[(0,B.jsx)(`span`,{children:e.version}),(0,B.jsx)(`span`,{children:e.reasonCode??e.status}),(0,B.jsx)(`span`,{children:FM(e.createdAt)})]})}function CN(e,t,n){let r=e.indexOf(t);if(r<0)return e;let i=Math.max(0,Math.min(n,e.length)),a=i>r?i-1:i;if(a===r)return e;let o=[...e];return o.splice(r,1),o.splice(a,0,t),o}function wN(e,t){let n=new Map(e.map(e=>[e.id,e])),r=t.map(e=>n.get(e)).filter(e=>e!==void 0),i=new Set(t);return[...e.filter(e=>e.kind==="default"),...r,...e.filter(e=>e.kind!=="default"&&!i.has(e.id))]}var TN=cj(e=>({extra:[],create:t=>{let n={id:`ses_local_${Math.random().toString(36).slice(2,9)}`,projectId:t,title:`新会话`,status:`idle`,updatedAt:Date.now()};return e(e=>({extra:[n,...e.extra]})),n},rename:(t,n)=>e(e=>({extra:e.extra.map(e=>e.id===t?{...e,title:n}:e)}))}));function EN(){let e=TN(e=>e.create),t=Xj(e=>e.startDraft),n=Xj(e=>e.selectSession),r=Xj(e=>e.focusComposer);return(0,H.useCallback)(async()=>{let e=Xj.getState().projectId;t(e),r()},[e,r,n,t])}var DN=e=>[`terminals`,`detail`,e],ON=e=>[`EXITED`,`TERMINATED`,`INTERRUPTED`].includes(e),kN=e=>e.title??e.role??`Shell ${e.id.slice(-6)}`;async function AN(e){return Fk.parse(await Y(`/api/terminals/${encodeURIComponent(e)}`))}async function jN(e,t){return Bk.parse(await Y(`/api/terminals?limit=50${t&&`projectId`in t?`&projectId=${encodeURIComponent(t.projectId)}`:t&&`sessionId`in t?`&workspaceSessionId=${encodeURIComponent(t.sessionId)}`:`&global=true`}${e?`&cursor=${encodeURIComponent(e)}`:``}`))}async function MN(e,t){return Fk.parse(await Y(`/api/terminals`,{method:`POST`,csrf:!0,headers:{"Idempotency-Key":t},body:{scope:e,riskAcknowledged:!0}}))}async function NN(e,t,n){let r=Fk.parse(await Y(`/api/terminals/${encodeURIComponent(e)}/${t}`,{method:`POST`,csrf:!0,body:n}));return ZA.setQueryData(DN(e),r),t===`rename`&&Fj.setState(t=>({windows:t.windows.map(t=>({...t,tabs:t.tabs.map(t=>t.resourceId===e?{...t,title:kN(r)}:t)}))})),await ZA.invalidateQueries({queryKey:[`terminals`]}),r}function PN(e){ZA.setQueryData(DN(e.id),e),Fj.getState().open({kind:`terminal`,resourceId:e.id,title:kN(e),projectId:e.projectId,sessionId:e.projectId?e.sourceSessionId:e.workspaceSessionId,source:e.mode===`dev`?`agent`:e.projectId?`project`:e.workspaceSessionId?`session`:`global`});for(let t of Fj.getState().windows)if(t.tabs.some(t=>t.resourceId===e.id))for(let e of t.tabs)e.resourceId===`terminal:empty`&&Fj.getState().closeTab(t.id,e.id)}function FN(e,t){let n=Ok.safeParse(e.resourceTarget);return!n.success||typeof e.originClientSessionId!=`string`||e.originClientSessionId!==t?!1:(IN(n.data),!0)}function IN(e,t=!1){ZA.invalidateQueries({queryKey:[`terminals`]}),Fj.getState().open({kind:`terminal`,resourceId:e.terminalId,title:e.role??`终端`,projectId:e.projectId,source:`agent`,activate:t})}function LN(e){return e.status===`EXITED`||e.status===`TERMINATED`||e.status===`INTERRUPTED`&&e.reasonCode===`NOT_STARTED`}async function RN(e,t){let n=Ok.safeParse(e.closedTerminalTarget);if(!n.success||!t||e.originClientSessionId!==t)return!1;let{terminalId:r,projectId:i}=n.data,a=()=>Fj.getState().windows.flatMap(e=>e.tabs.filter(e=>e.kind===`terminal`&&e.resourceId===r&&e.projectId===i).map(t=>({windowId:e.id,tabId:t.id})));if(!a().length)return!1;try{let e=await AN(r);if(e.id!==r||e.projectId!==i||!LN(e))return!1;ZA.setQueryData(DN(r),e);let t=Fj.getState().focusedId;for(let e of a())Fj.getState().closeTab(e.windowId,e.tabId);return t&&Fj.getState().windows.some(e=>e.id===t)&&Fj.setState({focusedId:t}),ZA.invalidateQueries({queryKey:[`terminals`]}),!0}catch{return!1}}function zN(e){return e.payload??{}}function BN(e,t){let n=e[t];return typeof n==`string`?n:void 0}function VN(e,t){let n=e[t];return typeof n==`number`?n:void 0}var HN=new Set([`normal`,`budget`,`output_truncated`,`provider_error`,`error`,`cancelled`,`interrupted`]);function UN(e){let t=e.terminalReason;return typeof t==`string`&&HN.has(t)?t:void 0}function WN(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return[...e,t];let r=[...e];return r[n]=t,r}function GN(e,t,n){return e.map(e=>e.kind===`tool`&&e.id===t?{...e,...n}:e)}function KN(e,t,n){return e.map(e=>e.kind===`approval`&&e.id===t?{...e,status:n}:e)}function qN(e,t){let n=BN(t,`toolCallId`)??`${e.eventId}_tool`,r=BN(t,`turnId`);return r===void 0?n:`${r}:${n}`}function JN(e,t){let n=e.find(e=>e.kind===`message`&&e.id===t.messageId);return WN(e,{id:t.messageId,kind:`message`,role:`assistant`,text:`${n?.text??``}${t.text}`,createdAt:n?.createdAt??t.createdAt,...n?.turnId===void 0&&t.turnId===void 0?{}:{turnId:n?.turnId??t.turnId},streaming:!0})}function YN(e,t){let n=zN(t),r=BN(n,`turnId`)??t.eventId;switch(t.type){case`user.message`:{let i=BN(n,`text`)??``;return WN(e.filter(e=>!e.id.startsWith(`optimistic_user_`)),{id:`msg_${r}_user`,kind:`message`,role:`user`,text:i,createdAt:t.timestamp,turnId:r})}case`assistant.message`:{let i=BN(n,`text`)??``;return WN(e,{id:BN(n,`messageId`)??`msg_${r}_assistant`,kind:`message`,role:`assistant`,text:i,createdAt:t.timestamp,turnId:r})}case`assistant.delta`:{let i=BN(n,`text`)??``;return JN(e,{messageId:BN(n,`messageId`)??`msg_${r}_assistant`,text:i,createdAt:t.timestamp,turnId:r})}case`tool.requested`:return WN(e,{id:qN(t,n),kind:`tool`,turnId:r,name:BN(n,`name`)??`tool`,summary:BN(n,`argsSummary`)??``,args:``,status:`running`,createdAt:t.timestamp});case`tool.started`:{let i=qN(t,n);return e.some(e=>e.kind===`tool`&&e.id===i)?GN(e,i,{status:`running`}):WN(e,{id:i,kind:`tool`,turnId:r,name:BN(n,`name`)??`tool`,summary:``,args:``,status:`running`,createdAt:t.timestamp})}case`tool.command.created`:{let r=BN(n,`commandId`),i=QD.safeParse(n.command);return r&&/^cmd_[a-f0-9-]{36}$/.test(r)?GN(e,qN(t,n),{commandId:r,...i.success?{args:JSON.stringify(i.data,null,2),commandLabel:[i.data.executable.split(/[\\/]/).at(-1),...i.data.args].join(` `)}:{}}):e}case`tool.completed`:{let i=qN(t,n),a=kk.safeParse(n.resourceTarget),o=Array.isArray(n.supersedes)?n.supersedes.filter(e=>typeof e==`string`):[],s=GN(e,i,{status:`done`,output:BN(n,`resultSummary`)??``,...a.success?{resourceTarget:a.data}:{}});return o.reduce((e,n)=>GN(e,qN(t,{turnId:r,toolCallId:n}),{retried:!0}),s)}case`tool.failed`:return GN(e,qN(t,n),{status:`error`,output:`${BN(n,`errorCode`)??`TOOL_ERROR`}: ${BN(n,`message`)??`tool failed`}`});case`file.changed`:{let i=BN(n,`path`)??`file`,a=BN(n,`version`)??``,o=BN(n,`changeType`)??`modified`;return WN(e,{id:`file_${r}_${i}_${a}`,kind:`artifact`,turnId:r,title:`${o===`created`?`已创建`:`已修改`} ${i}`,description:`文件变更 · ${o}`,meta:a.slice(0,12),createdAt:t.timestamp})}case`tool.approval.required`:return WN(e,{id:BN(n,`approvalId`)??`approval_${t.eventId}`,kind:`approval`,turnId:r,toolName:BN(n,`toolName`),summary:BN(n,`summary`),risk:BN(n,`risk`),scope:n.scope,expiresAt:VN(n,`expiresAt`),status:`pending`,createdAt:t.timestamp});case`tool.approval.resolved`:{let t=BN(n,`approvalId`)??``,r=BN(n,`decision`)===`approved`?`approved`:`rejected`;return e.some(e=>e.kind===`approval`&&e.id===t)?KN(e,t,r):e}case`plan.updated`:{let t=wk.safeParse(n.plan);return t.success?WN(e,t.data):e}case`artifact.created`:{let t=n.artifact;return t===void 0?e:WN(e,t)}case`turn.failed`:return WN(e,{id:`error_${r}`,kind:`error`,turnId:r,message:`${BN(n,`errorCode`)??`INTERNAL`}: ${BN(n,`message`)??`执行失败`}`,createdAt:t.timestamp});case`turn.interrupted`:return WN(e,{id:`interrupted_${r}`,kind:`error`,turnId:r,message:`执行已中断,请重新发送任务。`,createdAt:t.timestamp});case`turn.cancelled`:return WN(e,{id:`cancelled_${r}`,kind:`error`,turnId:r,message:`已停止当前执行。`,createdAt:t.timestamp});default:return e}}function XN(e,t){let n=YN(e,t);if(!$N(t))return n;let r=zN(t),i=eP(t),a=t.type===`turn.completed`?`completed`:t.type===`turn.failed`?`failed`:t.type===`turn.cancelled`?`cancelled`:`interrupted`,o=UN(r),s=mk.safeParse(r.fileResults),c=VN(r,`fileResultsOmitted`);return n.map(e=>e.turnId===i&&e.kind===`message`?{...e,streaming:!1,...e.role===`user`?{turnOutcome:a,durationMs:VN(r,`durationMs`),...o===void 0?{}:{terminalReason:o},...s.success?{fileResults:s.data}:{},...c===void 0?{}:{fileResultsOmitted:c}}:{}}:e)}function ZN(e){let t={};for(let n of e){if(n.type!==`model.usage`)continue;let e=zN(n),r=BN(e,`model`),i=VN(e,`inputTokens`),a=VN(e,`contextWindow`);r!==void 0&&i!==void 0&&a!==void 0&&(t[r]={inputTokens:i,contextWindow:a,updatedAt:n.timestamp})}return t}function QN(e){return e.reduce((e,t)=>XN(e,t),[])}function $N(e){return e.type===`turn.completed`||e.type===`turn.failed`||e.type===`turn.cancelled`||e.type===`turn.interrupted`}function eP(e){return BN(zN(e),`turnId`)??null}function tP(e){return e.replace(/\s+/g,` `).trim().slice(-240).trimStart()}function nP(e,t){return e.findIndex(e=>e.id===t.id)===-1?[...e,{id:t.id,kind:`reasoning`,text:tP(t.text),streaming:!0,createdAt:t.createdAt,...t.turnId===void 0?{}:{turnId:t.turnId}}]:e.map(e=>e.id===t.id&&e.kind===`reasoning`?{...e,text:tP(`${e.text}${t.text}`),streaming:!0}:e)}function rP(e,t){return new Promise((n,r)=>{if(t.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=window.setTimeout(()=>{t.removeEventListener(`abort`,a),n()},e),a=()=>{window.clearTimeout(i),r(new DOMException(`Aborted`,`AbortError`))};t.addEventListener(`abort`,a,{once:!0})})}function iP(e){return`${e}_${Math.random().toString(36).slice(2,10)}`}function aP(e,t){return{id:e,kind:`message`,role:`assistant`,text:t,createdAt:Date.now(),streaming:!0}}new class{async snapshot(){return await Promise.resolve(),structuredClone(XA)}async timeline(e){return await Promise.resolve(),e===`ses_1`?structuredClone(YA):[]}async*sendTurn({text:e,signal:t}){let n={id:iP(`plan`),kind:`plan`,title:`执行计划`,createdAt:Date.now(),steps:[{id:`p1`,title:`确认当前会话与项目状态`,status:`running`},{id:`p2`,title:`更新工作台并启动开发服务`,status:`pending`},{id:`p3`,title:`验证预览地址与日志`,status:`pending`}]};await rP(420,t),yield{type:`plan`,item:n},await rP(520,t),yield{type:`plan`,item:{...n,steps:[{id:`p1`,title:`确认当前会话与项目状态`,status:`done`},{id:`p2`,title:`更新工作台并启动开发服务`,status:`running`},{id:`p3`,title:`验证预览地址与日志`,status:`pending`}]}};let r=aP(iP(`msg`),``);yield{type:`message.assistant`,item:r};for(let n of[`收到。`,`我会在 **${e.slice(0,24)}** 这个任务上继续,`,`先读取项目脚本和现有端口,再启动开发服务。`])await rP(160,t),yield{type:`message.delta`,id:r.id,text:n};let i={id:iP(`tool`),kind:`tool`,name:`read_file`,summary:`读取 package.json 与 vite.config.ts`,args:`{ "paths": ["package.json", "apps/web/vite.config.ts"] }`,status:`running`,createdAt:Date.now()};yield{type:`tool`,item:i},await rP(700,t),yield{type:`tool.update`,id:i.id,patch:{status:`done`,durationMs:76,output:`2 个文件 · 1.8 KB · 发现 dev / build 脚本`}},await rP(320,t),yield{type:`plan`,item:{...n,steps:[{id:`p1`,title:`确认当前会话与项目状态`,status:`done`},{id:`p2`,title:`更新工作台并启动开发服务`,status:`running`},{id:`p3`,title:`验证预览地址与日志`,status:`pending`}]}};let a={id:iP(`tool`),kind:`tool`,name:`run_command`,summary:`pnpm --filter @larness/web dev`,args:`{ "command": "pnpm --filter @larness/web dev", "cwd": ".", "timeout": 120000 }`,status:`running`,createdAt:Date.now()};yield{type:`tool`,item:a},await rP(1100,t),yield{type:`tool.update`,id:a.id,patch:{status:`done`,durationMs:1084,output:`VITE v7.1.7 ready in 412 ms
108
- ➜ Local: http://localhost:5173/`}},yield{type:`plan`,item:{...n,steps:[{id:`p1`,title:`确认当前会话与项目状态`,status:`done`},{id:`p2`,title:`更新工作台并启动开发服务`,status:`done`},{id:`p3`,title:`验证预览地址与日志`,status:`running`}]}};let o=aP(iP(`msg`),``);yield{type:`message.assistant`,item:o};for(let e of[`开发服务器已启动,端口 **5173**。`,`你可以从顶部浏览器入口打开预览,`,`或在右侧服务区查看实时日志。`])await rP(180,t),yield{type:`message.delta`,id:o.id,text:e};yield{type:`artifact`,item:{id:iP(`art`),kind:`artifact`,title:`本地预览已就绪`,description:`Vite 开发服务运行在 5173,可从浏览器窗口打开。`,meta:`http://localhost:5173`,href:`http://localhost:5173`,createdAt:Date.now()}},yield{type:`plan`,item:{...n,steps:[{id:`p1`,title:`确认当前会话与项目状态`,status:`done`},{id:`p2`,title:`更新工作台并启动开发服务`,status:`done`},{id:`p3`,title:`验证预览地址与日志`,status:`done`}]}},yield{type:`turn.done`}}async resolveApproval(e,t){await new Promise(e=>window.setTimeout(e,600))}async cancelTurn(e){await Promise.resolve()}};var oP=null,sP=null,cP=null,lP=null,uP=0,dP=!1;function fP(e){return{id:`error_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,kind:`error`,message:e,createdAt:Date.now()}}function pP(){cP!==null&&(window.clearTimeout(cP),cP=null),lP=null,sP?.close(),sP=null}function mP(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.type===`context.compressed`)return{degraded:(typeof n.payload==`object`&&n.payload!==null?n.payload:{}).degraded===!0,createdAt:n.timestamp}}return null}function hP(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.type!==`turn.completed`)continue;let r=typeof n.payload==`object`&&n.payload!==null?n.payload.usage:null;if(typeof r==`object`&&r){let e=r;if(typeof e.inputTokens==`number`)return e.inputTokens;if(typeof e.totalTokens==`number`)return e.totalTokens}}return 0}function gP(e){let t=bP.getState();e.sessionId===t.sessionId&&bP.setState({items:JN(t.items,{messageId:e.messageId,text:e.text,createdAt:e.timestamp,turnId:e.turnId}),isStreaming:!0,activeTurnId:t.activeTurnId??e.turnId,turnStartedAt:t.turnStartedAt??e.timestamp})}function _P(e){let t=bP.getState();e.sessionId===t.sessionId&&bP.setState({items:nP(t.items,{id:`reasoning_${e.turnId}`,turnId:e.turnId,text:e.text,createdAt:e.timestamp}),activeTurnId:t.activeTurnId??e.turnId,turnStartedAt:t.turnStartedAt??e.timestamp})}function vP(e,t=!1){let n=bP.getState();if(e.sessionId!==void 0&&e.sessionId!==n.sessionId||e.sequence<=n.lastSeq)return;if(e.sequence!==n.lastSeq+1){n.syncEvents();return}let r=e.payload??{},i=eP(e),a=typeof r.status==`string`?r.status:null,o=e.type===`turn.created`||e.type===`turn.status`?i??n.activeTurnId:n.activeTurnId,s=$N(e)?!1:e.type===`turn.created`||a===`QUEUED`||a===`PREPARING`||a===`RUNNING`||a===`WAITING_APPROVAL`||a===`CANCELLING`||n.isStreaming,c=$N(e),l=XN(n.items,e).map(e=>c&&e.kind===`reasoning`?{...e,streaming:!1}:e),u=e.type===`turn.completed`&&typeof r.usage==`object`&&r.usage!==null?r.usage:null,d=typeof u?.inputTokens==`number`?u.inputTokens:typeof u?.totalTokens==`number`?u.totalTokens:n.contextTokens,f=e.type===`model.usage`?{...n.modelUsage,...ZN([e])}:n.modelUsage;bP.setState({items:c?l.map(e=>e.kind===`message`?{...e,streaming:!1}:e):l,lastSeq:e.sequence,activeTurnId:c?null:o,isStreaming:s,contextTokens:d,contextNotice:e.type===`context.compressed`?{degraded:r.degraded===!0,createdAt:e.timestamp}:n.contextNotice,modelUsage:f,turnStartedAt:c||s?c?null:n.turnStartedAt??e.timestamp:n.turnStartedAt}),e.type===`tool.completed`&&RN(r,ZA.getQueryData([`session`])?.clientSessionId),t&&e.type===`tool.completed`&&typeof r.originClientSessionId==`string`&&(ZA.invalidateQueries({queryKey:[`terminals`]}),FN(r,ZA.getQueryData([`session`])?.clientSessionId))}function yP(e){if(typeof window>`u`)return;pP(),lP=e;let t=window.location.protocol===`https:`?`wss`:`ws`,n=new WebSocket(`${t}://${window.location.host}/ws`);sP=n,n.addEventListener(`open`,()=>{lP===e&&n.send(JSON.stringify({type:`subscribe`,subscriptions:[{topic:`agent`,resourceId:e}]}))}),n.addEventListener(`message`,t=>{if(lP!==e)return;let n;try{n=JSON.parse(String(t.data))}catch{return}if(typeof n!=`object`||!n)return;let r=n;r.kind===`subscribed`?(typeof r.currentSequence==`number`?r.currentSequence:0)>bP.getState().lastSeq&&bP.getState().syncEvents():r.kind===`assistant.delta`&&r.topic===`agent`?gP(r):r.kind===`assistant.reasoning.delta`&&r.topic===`agent`?_P(r):r.kind===`event`&&r.topic===`agent`&&vP(r,!0)}),n.addEventListener(`close`,t=>{sP===n&&lP===e&&(sP=null,t.code===1008?window.dispatchEvent(new Event(`larness:unauthenticated`)):cP=window.setTimeout(()=>{lP===e&&yP(e)},1e3))}),n.addEventListener(`error`,()=>n.close())}var bP=cj((e,t)=>({sessionId:``,items:[],loading:!1,isStreaming:!1,activeTurnId:null,turnStartedAt:null,contextTokens:0,contextNotice:null,modelUsage:{},lastSeq:0,load:async n=>{let r=++uP;if(pP(),oP?.abort(),oP=null,e({sessionId:n,items:[],loading:!!n,isStreaming:!1,activeTurnId:null,turnStartedAt:null,contextTokens:0,contextNotice:null,modelUsage:{},lastSeq:0}),!n)e({loading:!1});else if(n.startsWith(`draft_`))e({loading:!1});else try{let[i,a]=await Promise.all([OA(n),FA(n,0)]);if(r!==uP||t().sessionId!==n)return;e({items:QN(a),lastSeq:a.at(-1)?.sequence??0,loading:!1,isStreaming:i.activeTurn!==null,activeTurnId:i.activeTurn?.id??null,turnStartedAt:i.activeTurn?.createdAt??null,contextTokens:hP(a),contextNotice:mP(a),modelUsage:ZN(a)});let o=ZA.getQueryData([`session`]);for(let e of a)e.type===`tool.completed`&&typeof e.payload==`object`&&e.payload!==null&&RN(e.payload,o?.clientSessionId);yP(n)}catch(t){if(r!==uP)return;e({loading:!1,items:[fP(t instanceof Error?t.message:`加载会话失败`)]})}},disconnect:()=>{pP()},syncEvents:async()=>{let n=t().sessionId;if(n&&!dP){dP=!0;try{let e=await FA(n,t().lastSeq);if(t().sessionId!==n)return;for(let t of e)vP(t)}catch(t){let n=t instanceof Error?t.message:`事件补拉失败`;e(e=>({items:[...e.items,fP(`事件补拉失败:${n}`)]}))}finally{dP=!1}}},send:async n=>{let r=n.trim();if(!r||t().isStreaming)return;let i=t().sessionId;if(!i)return;let a=lN.getState(),o=Xj.getState().draftSession;if(o!==null&&o.id===i){e({isStreaming:!0,turnStartedAt:Date.now()});try{let e=await DA(o.projectId===null?{}:{projectId:o.projectId});await kA(e.id,{model:a.modelId,thinking:a.thinking,credentialProfileId:a.credentialProfileId,approvalPolicyId:a.policy}),await jA(e.id,{input:r,model:a.modelId,thinking:a.thinking,...a.credentialProfileId===null?{}:{credentialProfileId:a.credentialProfileId}},crypto.randomUUID()),await ZA.invalidateQueries({queryKey:[`workspace`]}),Xj.getState().commitDraft(e.id,e.projectId)}catch(t){let n=t instanceof Error?t.message:`发送失败`;e(e=>({isStreaming:!1,turnStartedAt:null,items:[...e.items,fP(`发送失败:${n}`)]}))}return}let s={id:`optimistic_user_${Date.now()}`,kind:`message`,role:`user`,text:r,createdAt:Date.now()};e(e=>({items:[...e.items,s],isStreaming:!0,turnStartedAt:Date.now()}));try{await kA(i,{model:a.modelId,thinking:a.thinking,credentialProfileId:a.credentialProfileId,approvalPolicyId:a.policy}),e({activeTurnId:(await jA(i,{input:r,model:a.modelId,thinking:a.thinking,...a.credentialProfileId===null?{}:{credentialProfileId:a.credentialProfileId}},crypto.randomUUID())).turnId}),await ZA.invalidateQueries({queryKey:[`workspace`]}),await t().syncEvents()}catch(n){let r=n instanceof Error?n.message:`发送失败`;e(e=>({isStreaming:!1,turnStartedAt:null,items:[...e.items.filter(e=>e.id!==s.id),fP(`发送失败:${r}`)]})),await t().syncEvents()}},stop:()=>{let e=t().activeTurnId;e!==null&&MA(e).catch(e=>{let t=e instanceof Error?e.message:`停止失败`;bP.setState(e=>({items:[...e.items,fP(`停止失败:${t}`)]}))})},resumeTurn:async n=>{try{e({isStreaming:!0,activeTurnId:(await NA(n)).turnId,turnStartedAt:Date.now()}),await t().syncEvents()}catch(e){let t=e instanceof Error?e.message:`无法继续该任务`;bP.setState(e=>({items:[...e.items,fP(`继续失败:${t}`)]}))}},resolveApproval:async(n,r)=>{let i=r===`approve`?`approved`:`rejected`,a=t=>e(e=>({items:e.items.map(e=>e.kind===`approval`&&e.id===n?{...e,status:t}:e)}));if(t().items.find(e=>e.kind===`approval`&&e.id===n)?.status!==`pending`)return;let o=t().sessionId;await IA(n,r),t().sessionId===o&&(a(i),await t().syncEvents())}})),xP=5;function SP({mobile:e=!1}){let t=(0,H.useId)(),{data:n}=ej(),{projectId:r,sessionId:i,draftSession:a,sidebarWidth:o,expandedProjects:s,toggleProject:c,setExpandedProjects:l,selectSession:u,startDraft:d}=Xj(),f=TN(e=>e.extra),p=bP(e=>null),m=EN(),h=bM(),g=Wd(),_=Xj(e=>e.focusComposer),[v,y]=(0,H.useState)(``),[b,x]=(0,H.useState)({}),[S,C]=(0,H.useState)(!1),[w,T]=(0,H.useState)(!1),[E,D]=(0,H.useState)(!1),[O,k]=(0,H.useState)(!1),[A,j]=(0,H.useState)(0),M=gp({queryKey:CM,queryFn:DM,enabled:!0,refetchInterval:15e3}),N=Math.max(0,(M.data?.failedLast24h??0)-A);(0,H.useEffect)(()=>{O&&M.data&&j(M.data.failedLast24h)},[O,M.data]);let[ee,te]=(0,H.useState)(null),[P,ne]=(0,H.useState)(null),[F,re]=(0,H.useState)(null),[ie,ae]=(0,H.useState)(null),oe=(0,H.useRef)(null),se=(0,H.useRef)(``),ce=(0,H.useRef)(!1),le=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(ee===null)return;let e=()=>te(null),t=e=>{e.key===`Escape`&&te(null)};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,t),window.addEventListener(`blur`,e),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,t),window.removeEventListener(`blur`,e)}},[ee]);let ue=(e,t,n,r)=>{e.preventDefault(),e.stopPropagation(),te(t===`project`&&n===`prj_default`?null:{kind:t,id:n,title:r,x:e.clientX,y:e.clientY})},de=(0,H.useMemo)(()=>[...n.sessions].sort((e,t)=>t.updatedAt-e.updatedAt),[f,n.sessions]),fe=e=>{d(e===`prj_default`?null:e),_()},pe=de.find(e=>e.id===i),me=r===null&&(!pe||pe.workspaceKind==="default"),he=v.trim().toLowerCase(),ge=e=>e.status!==`idle`||e.id===p,_e=e=>e.id===i?2:+!!ge(e),ve=n.projects.map(e=>{let t=e.name.toLowerCase().includes(he);return{...e,matchesName:t,sessions:de.filter(n=>(e.kind==="default"?n.workspaceKind==="default":n.projectId===e.id)&&(t||n.title.toLowerCase().includes(he)))}}),I=ve.filter(e=>e.matchesName||e.sessions.length>0),ye=de.filter(e=>!he||e.title.toLowerCase().includes(he)||e.projectId&&n.projects.find(t=>t.id===e.projectId)?.name.toLowerCase().includes(he)).slice(0,6),be=ve.filter(e=>e.kind!=="default"),xe=he.length===0&&be.length>1,Se=new Map(be.map((e,t)=>[e.id,t])),Ce=F?be.findIndex(e=>e.id===F.id):-1,we=F?.moved===!0&&F.targetIndex!==Ce&&F.targetIndex!==Ce+1,Te=()=>{document.body.style.userSelect=se.current},Ee=()=>{le.current===null&&(le.current=s,l(Object.fromEntries(ve.map(e=>[e.id,!1]))))},De=()=>{let e=le.current;e!==null&&(le.current=null,l(e))},Oe=async e=>{let t=g.getQueryData([`workspace`]);t&&g.setQueryData([`workspace`],{...t,projects:wN(t.projects,e)});try{await pA(e),await g.invalidateQueries({queryKey:[`workspace`]}),ae(null)}catch(e){t&&g.setQueryData([`workspace`],t),ae(oA(e,`调整项目顺序失败`)),g.invalidateQueries({queryKey:[`workspace`]})}},ke=(e,t)=>{if(F!==null||!xe||t===`prj_default`||e.button!==0)return;try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}se.current=document.body.style.userSelect,document.body.style.userSelect=`none`;let n=be.findIndex(e=>e.id===t);re({id:t,pointerId:e.pointerId,startY:e.clientY,moved:!1,targetIndex:Math.max(0,n)})},L=e=>{if(F===null||F.pointerId!==e.pointerId)return;!F.moved&&Math.abs(e.clientY-F.startY)>=4&&Ee();let t=oe.current?Array.from(oe.current.querySelectorAll(`[data-project-drop-index]`)).map(e=>{let t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}):[];re(n=>{if(n===null||n.pointerId!==e.pointerId||!n.moved&&Math.abs(e.clientY-n.startY)<4)return n;let r=t.findIndex(t=>e.clientY<(t.top+t.bottom)/2),i=r===-1?t.length:r;return n.moved&&n.targetIndex===i?n:{...n,moved:!0,targetIndex:i}})},Ae=e=>{if(F===null||F.pointerId!==e.pointerId)return;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}Te(),De();let t=F;if(re(null),!t.moved)return;ce.current=!0,window.setTimeout(()=>{ce.current=!1},0);let n=be.map(e=>e.id),r=CN(n,t.id,t.targetIndex);r!==n&&Oe(r)},je=()=>{Te(),De(),re(null)},Me=(e,t)=>{if(!xe||t===`prj_default`||e.key!==`ArrowUp`&&e.key!==`ArrowDown`)return;e.preventDefault();let n=be.map(e=>e.id),r=n.indexOf(t),i=r+(e.key===`ArrowUp`?-1:1);if(r<0||i<0||i>=n.length)return;let a=[...n];[a[r],a[i]]=[a[i],a[r]],Oe(a)};return(0,H.useEffect)(()=>()=>{document.body.style.userSelect=se.current;let e=le.current;e!==null&&(le.current=null,l(e))},[l]),(0,B.jsxs)(`aside`,{className:z(`shrink-0 flex-col bg-surface/45`,e?`flex h-full bg-surface`:`hidden md:flex`),style:{width:e?268:o},"aria-label":`项目与会话导航`,children:[(0,B.jsx)(`div`,{className:`px-2.5 pt-3`,children:(0,B.jsxs)(`button`,{type:`button`,onClick:m,className:`group flex h-8 w-full items-center gap-2 rounded-[9px] border border-line bg-surface px-2.5 text-[12px] font-medium text-ink shadow-[var(--shadow-card)] transition-colors hover:border-accent/30 hover:bg-accent-soft`,children:[(0,B.jsx)(Ov,{size:14,className:`text-accent`}),(0,B.jsx)(`span`,{children:`新建会话`}),(0,B.jsx)(Lu,{className:`ml-auto group-hover:border-accent/20`,children:`⌘K`})]})}),(0,B.jsx)(`div`,{className:`px-2.5 pt-2.5`,children:(0,B.jsxs)(`label`,{htmlFor:`${t}-search`,className:`flex h-7 items-center gap-1.5 rounded-lg bg-black/[.035] px-2 text-ink-3 transition-colors focus-within:bg-surface focus-within:ring-1 focus-within:ring-accent/30 dark:bg-white/[.05]`,children:[(0,B.jsx)(Pv,{size:12.5}),(0,B.jsx)(Mu,{id:`${t}-search`,variant:`bare`,value:v,onChange:e=>y(e.target.value),placeholder:`搜索项目或会话`,className:`h-full w-full bg-transparent text-[11.5px] text-ink outline-none placeholder:text-ink-3`,"aria-label":`搜索项目或会话`})]})}),(0,B.jsxs)(`div`,{className:`mt-3 flex min-h-0 flex-1 flex-col overflow-y-auto px-1.5 pb-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center px-2 pb-1 text-[10px] font-semibold uppercase tracking-[.08em] text-ink-3`,children:[`项目`,(0,B.jsx)(`button`,{type:`button`,onClick:()=>C(!0),"aria-label":`添加项目`,className:`ml-auto flex h-5 w-5 items-center justify-center rounded-md text-ink-3 hover:bg-black/[.05] hover:text-ink dark:hover:bg-white/[.07]`,children:(0,B.jsx)(R_,{size:12})})]}),(0,B.jsxs)(`div`,{ref:oe,"data-project-list":!0,children:[I.map(e=>{let t=s[e.id]??!0,n=e.kind==="default",r=n?-1:Se.get(e.id)??-1,o=F?.id===e.id&&F.moved,l=n?null:e.id,f=!he&&a?.projectId===l,p=xP-Number(f),m=!he&&e.sessions.length>p,h=b[e.id]??!1,g=e.sessions;if(m&&!h){let e=new Set([...g].sort((e,t)=>_e(t)-_e(e)).slice(0,p));g=g.filter(t=>e.has(t))}return(0,B.jsxs)(`div`,{"data-project-id":e.id,className:z(`relative mb-0.5`,o?`opacity-60`:null),children:[we&&F&&!n&&F.targetIndex===r?(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute -top-px left-1 right-1 z-10 h-0.5 rounded-full bg-accent`}):null,(0,B.jsxs)(`div`,{className:`flex items-center gap-0.5`,"data-project-drop-index":n?void 0:r,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-label":n?`默认工作区`:void 0,"aria-keyshortcuts":xe&&!n?`ArrowUp ArrowDown`:void 0,"aria-pressed":n?me:void 0,title:xe&&!n?`拖拽调整项目顺序;聚焦后可按上下方向键`:void 0,onClick:()=>{ce.current?ce.current=!1:c(e.id)},onPointerDown:t=>ke(t,e.id),onPointerMove:L,onPointerUp:Ae,onPointerCancel:je,onKeyDown:t=>Me(t,e.id),onContextMenu:t=>ue(t,`project`,e.id,e.name),"aria-expanded":t,className:z(`flex h-[27px] min-w-0 flex-1 items-center gap-1.5 rounded-md px-1.5 text-left text-[11.5px] text-ink-2 hover:bg-black/[.035] hover:text-ink dark:hover:bg-white/[.05]`,xe&&!n?`cursor-grab`:null,F?.id===e.id?`cursor-grabbing`:null),children:[t?(0,B.jsx)(n_,{size:11,className:`text-ink-3`}):(0,B.jsx)(o_,{size:11,className:`text-ink-3`}),(0,B.jsx)(`span`,{className:`flex h-4 w-4 items-center justify-center rounded-[4px]`,style:{backgroundColor:`${e.accent}18`,color:e.accent},children:(0,B.jsx)(H_,{size:10})}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),n?(0,B.jsx)(`span`,{className:`text-[9px] text-ink-3`,children:`内置`}):e.git?(0,B.jsx)(`span`,{className:`font-mono text-[9px] text-ink-3`,children:e.branch??`git`}):(0,B.jsx)(`span`,{className:`text-[9px] text-ink-3`,children:`no git`})]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`在 ${e.name} 中新建会话`,onClick:()=>fe(e.id),className:`flex h-5 w-5 shrink-0 items-center justify-center rounded text-ink-3 hover:bg-black/[.06] hover:text-ink dark:hover:bg-white/[.08]`,children:(0,B.jsx)(Ov,{size:11})})]}),t?(0,B.jsxs)(`div`,{className:`ml-[10px] border-l border-line/70 pl-1`,children:[f?(0,B.jsx)(CP,{title:`新会话`,draft:!0,active:a?.id===i,running:!1,onClick:()=>d(l)}):null,g.length?g.map(e=>(0,B.jsx)(CP,{title:e.title,active:e.id===i,running:ge(e),onClick:()=>u(e.id,l),onContextMenu:t=>ue(t,`session`,e.id,e.title)},e.id)):f?null:(0,B.jsx)(`div`,{className:`px-2 py-1 text-[10.5px] text-ink-3`,children:`暂无会话`}),m?(0,B.jsx)(`button`,{type:`button`,"aria-expanded":h,onClick:()=>x(t=>({...t,[e.id]:!h})),className:`flex h-6 w-full items-center rounded-md pl-5 pr-2 text-left text-[10.5px] text-ink-3 hover:bg-black/[.035] hover:text-ink dark:hover:bg-white/[.05]`,children:h?`收起`:`展开更多`}):null]}):null]},e.id)}),we&&F&&F.targetIndex===be.length?(0,B.jsx)(`div`,{className:`relative h-0`,"aria-hidden":`true`,children:(0,B.jsx)(`div`,{className:`absolute inset-x-1 -top-px h-0.5 rounded-full bg-accent`})}):null]}),I.length===0?(0,B.jsx)(`div`,{className:`mx-1 rounded-lg border border-dashed border-line px-2.5 py-3 text-[10.5px] text-ink-3`,children:he?`没有匹配的项目或会话`:`还没有登记项目。点击项目标题旁的 + 添加本机目录。`}):null,(0,B.jsxs)(`div`,{className:`mt-3 flex items-center px-2 pb-1 text-[10px] font-semibold uppercase tracking-[.08em] text-ink-3`,children:[`最近`,(0,B.jsx)(`span`,{className:`ml-auto font-normal normal-case tracking-normal text-ink-3/70`,children:ye.length})]}),ye.map(e=>{let t=n.projects.find(t=>t.id===e.projectId);return(0,B.jsxs)(`button`,{type:`button`,onClick:()=>u(e.id,e.projectId),onContextMenu:t=>ue(t,`session`,e.id,e.title),className:z(`group flex w-full flex-col gap-0.5 rounded-lg px-2 py-1.5 text-left transition-colors`,e.id===i?`bg-accent-soft/70 text-ink`:`text-ink-2 hover:bg-black/[.035] dark:hover:bg-white/[.05]`),children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[ge(e)?(0,B.jsx)(wP,{}):(0,B.jsx)(f_,{size:11,className:`shrink-0 text-ink-3`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11.5px] font-medium`,children:e.title})]}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 pl-[17px] text-[9.5px] text-ink-3`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:t?.name??(e.workspaceKind==="default"?`默认工作区`:`独立会话`)}),(0,B.jsx)(`span`,{children:`·`}),(0,B.jsx)(`span`,{className:`shrink-0`,children:FM(e.updatedAt)})]})]},`recent_${e.id}`)})]}),(0,B.jsxs)(`div`,{className:`shrink-0 border-t border-line px-2 py-2`,children:[(0,B.jsx)(TP,{icon:Ig,label:`服务运维`,onClick:()=>D(!0)}),(0,B.jsx)(TP,{icon:ly,label:`自动化任务`,badge:N,onClick:()=>k(!0)}),(0,B.jsx)(TP,{icon:Rv,label:`设置与模型`,onClick:()=>T(!0)}),(0,B.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-black/[.035] dark:hover:bg-white/[.05]`,children:[(0,B.jsxs)(`div`,{className:`relative flex h-6 w-6 items-center justify-center rounded-full bg-gradient-to-br from-[#ffd60a] to-[#ff9f0a] text-[10px] font-semibold text-[#1d1d1f]`,children:[`B`,(0,B.jsx)(`span`,{className:`absolute -bottom-0.5 -right-0.5 h-1.5 w-1.5 rounded-full bg-success ring-2 ring-surface`})]}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{className:`truncate text-[11.5px] font-medium text-ink`,children:`bulv`}),(0,B.jsx)(`div`,{className:`truncate text-[9.5px] text-ink-3`,children:`本机操作者`})]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`退出登录`,title:`退出登录`,"data-testid":`logout-button`,onClick:()=>void h(),className:`flex h-6 w-6 items-center justify-center rounded-md text-ink-3 hover:bg-black/[.06] hover:text-danger dark:hover:bg-white/[.08]`,children:(0,B.jsx)(nv,{size:13})})]})]}),ee?(0,B.jsxs)(`div`,{role:`menu`,"aria-label":`会话或项目操作`,onPointerDown:e=>e.stopPropagation(),className:`fixed z-[220] w-[184px] rounded-xl border border-line bg-surface p-1 shadow-[var(--shadow-pop)]`,style:{left:Math.min(ee.x,window.innerWidth-196),top:Math.min(ee.y,window.innerHeight-112)},children:[(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{ne({kind:ee.kind===`project`?`rename-project`:`rename-session`,id:ee.id,title:ee.title}),te(null)},className:`flex h-8 w-full items-center gap-2 rounded-lg px-2.5 text-left text-[11.5px] text-ink-2 hover:bg-black/[.045] hover:text-ink dark:hover:bg-white/[.07]`,children:[(0,B.jsx)(bv,{size:13,className:`text-ink-3`}),ee.kind===`project`?`重命名项目`:`重命名会话`]}),(0,B.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{ne({kind:ee.kind===`project`?`remove-project`:`archive-session`,id:ee.id,title:ee.title}),te(null)},className:`flex h-8 w-full items-center gap-2 rounded-lg px-2.5 text-left text-[11.5px] text-danger hover:bg-danger/10`,children:[ee.kind===`project`?(0,B.jsx)(ny,{size:13}):(0,B.jsx)(Rg,{size:13}),ee.kind===`project`?`移除项目`:`归档会话`]})]}):null,(0,B.jsx)(Ou,{message:ie,onDismiss:()=>ae(null)}),(0,B.jsx)(xM,{session:P?.kind===`rename-session`?{id:P.id,title:P.title}:null,open:P?.kind===`rename-session`,onClose:()=>ne(null)}),(0,B.jsx)(cN,{project:P?.kind===`rename-project`?{id:P.id,name:P.title}:null,open:P?.kind===`rename-project`,onClose:()=>ne(null)}),(0,B.jsx)(EP,{open:P?.kind===`archive-session`,title:`归档会话`,description:`“${P?.title??``}”将从列表中隐藏,工作目录与源码不会被删除。`,confirmLabel:`归档`,onCancel:()=>ne(null),onConfirm:async()=>{P?.kind===`archive-session`&&(await AA(P.id),await g.invalidateQueries({queryKey:[`workspace`]}),P.id===i&&u(``,null),ne(null))}}),(0,B.jsx)(EP,{open:P?.kind===`remove-project`,title:`移除项目`,description:`仅移除“${P?.title??``}”的登记,不会删除本地源码;项目内会话会变成独立会话。`,confirmLabel:`移除项目`,onCancel:()=>ne(null),onConfirm:async()=>{P?.kind===`remove-project`&&(await mA(P.id),await g.invalidateQueries({queryKey:[`workspace`]}),P.id===r&&u(``,null),ne(null))}}),(0,B.jsx)(sN,{open:S,onOpenChange:C}),(0,B.jsx)(yN,{open:E,onOpenChange:D}),(0,B.jsx)(KM,{open:O,onOpenChange:k}),(0,B.jsx)(oN,{open:w,onOpenChange:T})]})}function CP({title:e,active:t,running:n,draft:r=!1,onClick:i,onContextMenu:a}){return(0,B.jsxs)(`button`,{type:`button`,onClick:i,onContextMenu:a,"aria-current":t?`true`:void 0,"aria-busy":n,className:z(`flex h-[26px] w-full items-center gap-1.5 rounded-md px-2 text-left text-[11px] transition-colors`,t?`bg-accent-soft font-medium text-ink`:`text-ink-2 hover:bg-black/[.035] hover:text-ink dark:hover:bg-white/[.05]`),children:[(0,B.jsx)(`span`,{className:`flex w-3 shrink-0 items-center justify-center`,"aria-hidden":`true`,children:n?(0,B.jsx)(wP,{}):(0,B.jsx)(tM,{tone:t?`info`:`idle`})}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,B.jsx)(`span`,{className:`shrink-0 rounded bg-black/[.045] px-1 py-[1px] text-[8.5px] text-ink-3 dark:bg-white/[.07]`,children:`草稿`}):null]})}function wP(){return(0,B.jsx)(ev,{size:11,className:`shrink-0 animate-spin text-accent motion-reduce:animate-none`,"aria-hidden":`true`})}function TP({icon:e,label:t,badge:n,onClick:r}){return(0,B.jsxs)(`button`,{type:`button`,onClick:r,disabled:r===void 0,className:`flex h-7 w-full items-center gap-2 rounded-lg px-2 text-[11.5px] text-ink-2 transition-colors hover:bg-black/[.035] hover:text-ink disabled:cursor-default disabled:opacity-60 dark:hover:bg-white/[.05]`,children:[(0,B.jsx)(e,{size:13.5,strokeWidth:1.75,className:`text-ink-3`}),(0,B.jsx)(`span`,{className:`flex-1 text-left`,children:t}),n!==void 0&&n>0?(0,B.jsx)(`span`,{title:`${n} 个失败任务`,className:`rounded-full bg-danger px-1.5 text-[9px] font-semibold leading-4 text-white`,children:n>99?`99+`:n}):null]})}function EP({open:e,title:t,description:n,confirmLabel:r,onCancel:i,onConfirm:a}){let[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(null);(0,H.useEffect)(()=>{e&&(s(!1),l(null))},[e]);let u=async()=>{s(!0),l(null);try{await a()}catch(e){l(oA(e,`操作失败`)),s(!1)}};return(0,B.jsx)(ca,{open:e,onOpenChange:e=>e?void 0:i(),children:(0,B.jsxs)(ua,{children:[(0,B.jsx)(da,{children:t}),(0,B.jsx)(fa,{children:n}),(0,B.jsx)(Ou,{message:c,onDismiss:()=>l(null)}),(0,B.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:i,disabled:o,children:`取消`}),(0,B.jsx)(V,{variant:`danger`,size:`sm`,disabled:o,onClick:()=>void u(),children:o?`处理中…`:r})]})]})})}var DP=(e,t,n)=>Math.min(n,Math.max(t,e));function OP({side:e,label:t,value:n,min:r,max:i,defaultValue:a,onChange:o,className:s}){return(0,B.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":t,"aria-valuenow":Math.round(n),"aria-valuemin":r,"aria-valuemax":i,tabIndex:0,onPointerDown:t=>{t.preventDefault();let a=t.clientX,s=n,c=document.body.style.cursor,l=document.body.style.userSelect;document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`;let u=t=>{let n=e===`left`?t.clientX-a:a-t.clientX;o(DP(s+n,r,i))},d=()=>{document.body.style.cursor=c,document.body.style.userSelect=l,window.removeEventListener(`pointermove`,u),window.removeEventListener(`pointerup`,d)};window.addEventListener(`pointermove`,u),window.addEventListener(`pointerup`,d)},onDoubleClick:()=>o(a),onKeyDown:t=>{if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault();let a=t.shiftKey?64:16,s=t.key===`ArrowRight`?a:-a;o(DP(n+(e===`left`?s:-s),r,i))},className:`relative z-30 w-px shrink-0 cursor-col-resize bg-line transition-colors hover:bg-accent/45 focus-visible:bg-accent/60 focus-visible:outline-none ${s??``}`,children:(0,B.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-y-0 -left-2 -right-2`})})}var kP=`larness.theme`,AP=(0,H.createContext)(null);function jP(e,t){return e===`system`?t?`dark`:`light`:e}function MP(){try{let e=localStorage.getItem(kP);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`light`}function NP({children:e}){let[t,n]=(0,H.useState)(MP),[r,i]=(0,H.useState)(!1);(0,H.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`);i(e.matches);let t=e=>i(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let a=jP(t,r);(0,H.useEffect)(()=>{document.documentElement.dataset.theme=a,document.documentElement.style.colorScheme=a;try{localStorage.setItem(kP,t)}catch{}},[a,t]);let o=(0,H.useCallback)(e=>n(e),[]),s=(0,H.useMemo)(()=>({theme:t,resolved:a,setTheme:o}),[t,a,o]);return(0,B.jsx)(AP.Provider,{value:s,children:e})}function PP(){let e=(0,H.useContext)(AP);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}var FP=90;function IP({icon:e,label:t,value:n,valueClass:r}){return(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(e,{size:13,strokeWidth:1.9,className:`shrink-0 text-ink-3`}),(0,B.jsx)(`span`,{className:`text-[9px] font-medium uppercase tracking-[.08em] text-ink-3`,children:t}),(0,B.jsx)(`span`,{className:`font-mono text-[10px] font-medium tabular-nums ${r}`,children:n})]})}function LP({metrics:e}){let t=e===null?null:Math.min(100,Math.max(0,e.cpuPercent)),n=t===null?`—`:`${Math.round(t)}%`,r=t!==null&&t>FP,i=IM(e?.memoryUsedBytes??0,e?.memoryTotalBytes??0),a=LM(e?.memoryUsedBytes??0,e?.memoryTotalBytes??0);return(0,B.jsxs)(`div`,{className:`mr-1 hidden items-center gap-3 xl:flex`,children:[(0,B.jsx)(`span`,{className:`sr-only`,children:`服务端资源占用`}),(0,B.jsx)(IP,{icon:b_,label:`CPU`,value:n,valueClass:r?`text-danger`:`text-ink`}),(0,B.jsx)(IP,{icon:ov,label:`RAM`,valueClass:`text-ink`,value:i===null?`—`:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:i!==null&&a>FP?`text-danger`:void 0,children:i.used}),` / `,i.total]})})]})}async function RP(){return Y(`/api/system/metrics`)}var zP=4e3;function BP(e){return gp({queryKey:[`host-metrics`],queryFn:RP,enabled:!0,refetchInterval:zP,staleTime:0,retry:!1}).data??null}function VP(e){let[t,n]=(0,H.useState)(()=>typeof window>`u`?!1:window.matchMedia(e).matches);return(0,H.useEffect)(()=>{let t=window.matchMedia(e);n(t.matches);let r=e=>n(e.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function HP({version:e}){let{data:t}=ej(),{theme:n,resolved:r,setTheme:i}=PP(),{projectId:a,sessionId:o,toggleSidebar:s,setMobileSidebar:c}=Xj(),l=VP(`(max-width: 767px)`),u=bP(e=>e.items.some(e=>e.kind===`approval`&&e.status===`pending`)),d=bP(e=>e.isStreaming),f=BP(t.host),p=t.projects.find(e=>e.id===a)??null,m=n===`system`?fv:r===`dark`?mv:Qv,h=typeof e==`string`&&e!==`0.0.0`&&/^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(e)?`v${e}`:`版本未知`;return(0,B.jsxs)(`header`,{className:`relative z-50 flex h-12 shrink-0 items-center gap-2 border-b border-line bg-surface/70 px-2.5 backdrop-blur-xl`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(`div`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-[7px] bg-gradient-to-br from-[#3d9bff] to-[#0066d6] text-[11px] font-bold text-white shadow-sm`,children:`L`}),(0,B.jsx)(`span`,{className:`shrink-0 text-[12.5px] font-semibold tracking-[-.01em]`,children:`Larness`}),(0,B.jsx)(`span`,{className:`shrink-0 rounded-full border border-line bg-surface-2 px-1.5 py-[1px] font-mono text-[9px] text-ink-3`,children:h})]}),(0,B.jsx)(Iu,{label:l?`打开导航`:`切换侧栏`,onClick:()=>l?c(!0):s(),children:(0,B.jsx)(gv,{size:15})}),(0,B.jsx)(`span`,{className:`mx-0.5 h-3.5 w-px shrink-0 bg-line`}),(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`truncate text-[12.5px] font-semibold tracking-[-.01em]`,children:p?.name??Yj(o,t.sessions)}),(0,B.jsx)(`span`,{className:`text-ink-3`,children:`/`}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(tM,{tone:d?`running`:`idle`,pulse:d}),(0,B.jsx)(`span`,{className:`text-[11px] text-ink-2`,children:d?`Agent 运行中`:`空闲`})]}),p?.branch?(0,B.jsxs)(`span`,{className:`ml-1 hidden items-center gap-1 rounded-full border border-line bg-surface-2 px-2 py-[2px] font-mono text-[10px] text-ink-2 md:flex`,children:[(0,B.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-accent/70`}),p.branch]}):null]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,B.jsx)(LP,{metrics:f}),(0,B.jsxs)(bu,{children:[(0,B.jsx)(xu,{asChild:!0,children:(0,B.jsx)(Iu,{label:`外观与主题`,children:(0,B.jsx)(m,{size:15})})}),(0,B.jsxs)(Cu,{align:`end`,children:[(0,B.jsx)(wu,{children:`外观`}),(0,B.jsxs)(Su,{value:n,onValueChange:e=>i(e),children:[(0,B.jsxs)(Eu,{value:`light`,children:[(0,B.jsx)(Qv,{size:13}),` 浅色`]}),(0,B.jsxs)(Eu,{value:`dark`,children:[(0,B.jsx)(mv,{size:13}),` 深色`]}),(0,B.jsxs)(Eu,{value:`system`,children:[(0,B.jsx)(fv,{size:13}),` 跟随系统`]})]})]})]}),(0,B.jsxs)(bu,{children:[(0,B.jsx)(xu,{asChild:!0,children:(0,B.jsxs)(Iu,{label:`通知`,className:`relative`,children:[(0,B.jsx)(Xg,{size:15}),u?(0,B.jsx)(`span`,{className:`absolute right-1.5 top-1.5 h-1.5 w-1.5 rounded-full bg-danger ring-2 ring-surface`}):null]})}),(0,B.jsxs)(Cu,{align:`end`,className:`w-[280px]`,children:[(0,B.jsx)(wu,{children:`通知`}),u?(0,B.jsxs)(Tu,{className:`items-start gap-2 py-2`,children:[(0,B.jsx)(tM,{tone:`waiting`,className:`mt-1`}),(0,B.jsxs)(`span`,{children:[(0,B.jsx)(`span`,{className:`block text-[12px] font-medium text-ink`,children:`部署待批准`}),(0,B.jsx)(`span`,{className:`mt-0.5 block text-[11px] text-ink-3`,children:`web-prod 计划切换到 c0f3a2d,等待你的批准。`})]})]}):(0,B.jsx)(Tu,{disabled:!0,children:`暂无新通知`})]})]})]})]})}var UP=o(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),WP=o(((e,t)=>{var n=UP();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),GP=l(o(((e,t)=>{t.exports=WP()()}))(),1);function KP(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function qP(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function JP(e){return typeof e==`number`&&!isNaN(e)}function YP(e){return parseInt(e,10)}function XP(e,t,n){if(e[t])return Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}var ZP=[`Moz`,`Webkit`,`O`,`ms`];function QP(e=`transform`){if(typeof window>`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;n<ZP.length;n++)if($P(e,ZP[n])in t)return ZP[n];return``}function $P(e,t){return t?`${t}${eF(e)}`:e}function eF(e){let t=``,n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]===`-`?n=!0:t+=e[r];return t}var tF=QP(),nF=``;function rF(e,t){nF||=KP([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(t){return qP(e[t])})??``;let n=e[nF];return qP(n)?!!n.call(e,t):!1}function iF(e,t,n){let r=e;do{if(rF(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function aF(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.addEventListener?e.addEventListener(t,a,i):e.attachEvent?e.attachEvent(`on`+t,a):e[`on`+t]=a}function oF(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.removeEventListener?e.removeEventListener(t,a,i):e.detachEvent?e.detachEvent(`on`+t,a):e[`on`+t]=null}function sF(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=YP(n.borderTopWidth),t+=YP(n.borderBottomWidth),t}function cF(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=YP(n.borderLeftWidth),t+=YP(n.borderRightWidth),t}function lF(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=YP(n.paddingTop),t-=YP(n.paddingBottom),t}function uF(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=YP(n.paddingLeft),t-=YP(n.paddingRight),t}function dF(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}}function fF(e,t){let n=mF(e,t,`px`);return{[$P(`transform`,tF)]:n}}function pF(e,t){return mF(e,t,``)}function mF({x:e,y:t},n,r){let i=`translate(${e}${r},${t}${r})`;return n&&(i=`translate(${`${typeof n.x==`string`?n.x:n.x+r}`}, ${`${typeof n.y==`string`?n.y:n.y+r}`})`+i),i}function hF(e,t){return e.targetTouches&&KP(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&KP(e.changedTouches,e=>t===e.identifier)}function gF(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function _F(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function vF(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??_F();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
109
- `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
110
- `,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&xF(e.body,`react-draggable-transparent-selection`)}function yF(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{bF(e)}):bF(e)}function bF(e){if(e)try{e.body&&SF(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function xF(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function SF(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function CF(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:AF(r);let i=jF(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+YP(s.paddingLeft)+YP(o.marginLeft),top:-i.offsetTop+YP(s.paddingTop)+YP(o.marginTop),right:uF(a)-cF(i)-i.offsetLeft+YP(s.paddingRight)-YP(o.marginRight),bottom:lF(a)-sF(i)-i.offsetTop+YP(s.paddingBottom)-YP(o.marginBottom)}}return JP(r.right)&&(t=Math.min(t,r.right)),JP(r.bottom)&&(n=Math.min(n,r.bottom)),JP(r.left)&&(t=Math.max(t,r.left)),JP(r.top)&&(n=Math.max(n,r.top)),[t,n]}function wF(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function TF(e){return e.props.axis===`both`||e.props.axis===`x`}function EF(e){return e.props.axis===`both`||e.props.axis===`y`}function DF(e,t,n){let r=typeof t==`number`?hF(e,t):null;if(typeof t==`number`&&!r)return null;let i=jF(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return dF(r||e,a,n.props.scale)}function OF(e,t,n){let r=!JP(e.lastX),i=jF(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function kF(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function AF(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function jF(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}var MF=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},NF={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},PF=NF.mouse,FF=class extends H.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(`<DraggableCore> not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!iF(e.target,this.props.handle,t)||this.props.cancel&&iF(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=gF(e);this.touchIdentifier=r;let i=DF(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=OF(this,a,o);MF(`DraggableCore: handleDragStart: %j`,s),MF(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&vF(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,aF(n,PF.move,this.handleDrag),aF(n,PF.stop,this.handleDragStop))},this.handleDrag=e=>{let t=DF(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=wF(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=OF(this,n,r);if(MF(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1)try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}else this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=DF(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=wF(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=OF(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&yF(a.ownerDocument),MF(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(MF(`DraggableCore: Removing handlers`),oF(a.ownerDocument,PF.move,this.handleDrag),oF(a.ownerDocument,PF.stop,this.handleDragStop))},this.onMouseDown=e=>(PF=NF.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(PF=NF.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(PF=NF.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(PF=NF.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&aF(e,NF.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;oF(t,NF.mouse.move,this.handleDrag),oF(t,NF.touch.move,this.handleDrag),oF(t,NF.mouse.stop,this.handleDragStop),oF(t,NF.touch.stop,this.handleDragStop),oF(e,NF.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&yF(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Kt.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(MF(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return H.cloneElement(H.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};FF.displayName=`DraggableCore`,FF.propTypes={allowAnyClick:GP.default.bool,allowMobileScroll:GP.default.bool,children:GP.default.node.isRequired,disabled:GP.default.bool,enableUserSelectHack:GP.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:GP.default.arrayOf(GP.default.number),handle:GP.default.string,cancel:GP.default.string,nodeRef:GP.default.object,nonce:GP.default.string,onStart:GP.default.func,onDrag:GP.default.func,onStop:GP.default.func,onMouseDown:GP.default.func,scale:GP.default.number,className:XP,style:XP,transform:XP},FF.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var IF=class extends H.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(MF(`Draggable: onDragStart: %j`,t),this.props.onStart(e,kF(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;MF(`Draggable: onDrag: %j`,t);let n=kF(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=CF(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,kF(this,t))===!1)return!1;MF(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(MF(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Kt.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,f={},p=null,m=!s||this.state.dragging,h=s||r,g={x:TF(this)&&m?this.state.x:h.x,y:EF(this)&&m?this.state.y:h.y};this.state.isElementSVG?p=pF(g,c):f=fF(g,c);let _=H.Children.only(n),v=d(_.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return H.createElement(FF,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},H.cloneElement(_,{className:v,style:{..._.props.style,...f},transform:p}))}};IF.displayName=`Draggable`,IF.propTypes={...FF.propTypes,axis:GP.default.oneOf([`both`,`x`,`y`,`none`]),bounds:GP.default.oneOfType([GP.default.shape({left:GP.default.number,right:GP.default.number,top:GP.default.number,bottom:GP.default.number}),GP.default.string,GP.default.oneOf([!1])]),defaultClassName:GP.default.string,defaultClassNameDragging:GP.default.string,defaultClassNameDragged:GP.default.string,defaultPosition:GP.default.shape({x:GP.default.number,y:GP.default.number}),positionOffset:GP.default.shape({x:GP.default.oneOfType([GP.default.number,GP.default.string]),y:GP.default.oneOfType([GP.default.number,GP.default.string])}),position:GP.default.shape({x:GP.default.number,y:GP.default.number}),className:XP,style:XP,transform:XP},IF.defaultProps={...FF.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var LF=IF,RF=function(){return RF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},RF.apply(this,arguments)},zF={width:`100%`,height:`10px`,top:`0px`,left:`0px`,cursor:`row-resize`},BF={width:`10px`,height:`100%`,top:`0px`,left:`0px`,cursor:`col-resize`},VF={width:`20px`,height:`20px`,position:`absolute`,zIndex:1},HF={top:RF(RF({},zF),{top:`-5px`}),right:RF(RF({},BF),{left:void 0,right:`-5px`}),bottom:RF(RF({},zF),{top:void 0,bottom:`-5px`}),left:RF(RF({},BF),{left:`-5px`}),topRight:RF(RF({},VF),{right:`-10px`,top:`-10px`,cursor:`ne-resize`}),bottomRight:RF(RF({},VF),{right:`-10px`,bottom:`-10px`,cursor:`se-resize`}),bottomLeft:RF(RF({},VF),{left:`-10px`,bottom:`-10px`,cursor:`sw-resize`}),topLeft:RF(RF({},VF),{left:`-10px`,top:`-10px`,cursor:`nw-resize`})},UF=(0,H.memo)(function(e){var t=e.onResizeStart,n=e.direction,r=e.children,i=e.replaceStyles,a=e.className,o=(0,H.useCallback)(function(e){t(e,n)},[t,n]),s=(0,H.useCallback)(function(e){t(e,n)},[t,n]),c=(0,H.useMemo)(function(){return RF(RF({position:`absolute`,userSelect:`none`},HF[n]),i??{})},[i,n]);return(0,B.jsx)(`div`,{className:a||void 0,style:c,onMouseDown:o,onTouchStart:s,children:r})}),WF=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),GF=function(){return GF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},GF.apply(this,arguments)},KF={width:`auto`,height:`auto`},qF=function(e,t,n){return Math.max(Math.min(e,n),t)},JF=function(e,t,n){var r=Math.round(e/t);return r*t+n*(r-1)},YF=function(e,t){return new RegExp(e,`i`).test(t)},XF=function(e){return!!(e.touches&&e.touches.length)},ZF=function(e){return!(!e.clientX&&e.clientX!==0||!e.clientY&&e.clientY!==0)},QF=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(n,r,i){return Math.abs(r-e)<Math.abs(t[n]-e)?i:n},0),i=Math.abs(t[r]-e);return n===0||i<n?t[r]:e},$F=function(e){return e=e.toString(),e===`auto`||e.endsWith(`px`)||e.endsWith(`%`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`vmax`)||e.endsWith(`vmin`)?e:`${e}px`},eI=function(e,t,n,r){if(e&&typeof e==`string`){if(e.endsWith(`px`))return Number(e.replace(`px`,``));if(e.endsWith(`%`)){var i=Number(e.replace(`%`,``))/100;return t*i}if(e.endsWith(`vw`)){var i=Number(e.replace(`vw`,``))/100;return n*i}if(e.endsWith(`vh`)){var i=Number(e.replace(`vh`,``))/100;return r*i}}return e},tI=function(e,t,n,r,i,a,o){return r=eI(r,e.width,t,n),i=eI(i,e.height,t,n),a=eI(a,e.width,t,n),o=eI(o,e.height,t,n),{maxWidth:r===void 0?void 0:Number(r),maxHeight:i===void 0?void 0:Number(i),minWidth:a===void 0?void 0:Number(a),minHeight:o===void 0?void 0:Number(o)}},nI=function(e){return Array.isArray(e)?e:[e,e]},rI=`as.ref.style.className.grid.gridGap.snap.bounds.boundsByDirection.size.defaultSize.minWidth.minHeight.maxWidth.maxHeight.lockAspectRatio.lockAspectRatioExtraWidth.lockAspectRatioExtraHeight.enable.handleStyles.handleClasses.handleWrapperStyle.handleWrapperClass.children.onResizeStart.onResize.onResizeStop.handleComponent.scale.resizeRatio.snapGap`.split(`.`),iI=`__resizable_base__`,aI=function(e){WF(t,e);function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.delta={width:0,height:0},n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement(`div`);return t.style.width=`100%`,t.style.height=`100%`,t.style.position=`absolute`,t.style.transform=`scale(0, 0)`,t.style.left=`0`,t.style.flex=`0 0 100%`,t.classList?t.classList.add(iI):t.className+=iI,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.state={isResizing:!1,width:n.propsSize?.width??`auto`,height:n.propsSize?.height??`auto`,direction:`right`,original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:`100%`,width:`100%`,backgroundColor:`rgba(0,0,0,0)`,cursor:`auto`,opacity:0,position:`fixed`,zIndex:9999,top:`0`,left:`0`,bottom:`0`,right:`0`},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||KF},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,i=this.resizable.style.position;i!==`relative`&&(this.resizable.style.position=`relative`),e=this.resizable.style.width===`auto`?n:this.resizable.offsetWidth,t=this.resizable.style.height===`auto`?r:this.resizable.offsetHeight,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(e.state[t]===void 0||e.state[t]===`auto`)return`auto`;if(e.propsSize&&e.propsSize[t]&&e.propsSize[t]?.toString().endsWith(`%`)){if(e.state[t].toString().endsWith(`%`))return e.state[t].toString();var n=e.getParentSize();return`${Number(e.state[t].toString().replace(`px`,``))/n[t]*100}%`}return $F(e.state[t])};return{width:t&&t.width!==void 0&&!this.state.isResizing?$F(t.width):n(`width`),height:t&&t.height!==void 0&&!this.state.isResizing?$F(t.height):n(`height`)}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;n!==`wrap`&&(t=!0,this.parentNode.style.flexWrap=`wrap`),e.style.position=`relative`,e.style.minWidth=`100%`,e.style.minHeight=`100%`;var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener(`mouseup`,this.onMouseUp),this.window.addEventListener(`mousemove`,this.onMouseMove),this.window.addEventListener(`mouseleave`,this.onMouseUp),this.window.addEventListener(`touchmove`,this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener(`touchend`,this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener(`mouseup`,this.onMouseUp),this.window.removeEventListener(`mousemove`,this.onMouseMove),this.window.removeEventListener(`mouseleave`,this.onMouseUp),this.window.removeEventListener(`touchmove`,this.onMouseMove,!0),this.window.removeEventListener(`touchend`,this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:e.flexBasis===`auto`?void 0:e.flexBasis})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return this.state[t]===`auto`&&this.state.original[t]===e&&(n===void 0||n===`auto`)?`auto`:e},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n=this.props.boundsByDirection,r=this.state.direction,i=n&&YF(`left`,r),a=n&&YF(`top`,r),o,s;if(this.props.bounds===`parent`){var c=this.parentNode;c&&(o=i?this.resizableRight-this.parentLeft:c.offsetWidth+(this.parentLeft-this.resizableLeft),s=a?this.resizableBottom-this.parentTop:c.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds===`window`?this.window&&(o=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,s=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(o=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),s=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return o&&Number.isFinite(o)&&(e=e&&e<o?e:o),s&&Number.isFinite(s)&&(t=t&&t<s?t:s),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=nI(this.props.resizeRatio||1),i=r[0],a=r[1],o=this.state,s=o.direction,c=o.original,l=this.props,u=l.lockAspectRatio,d=l.lockAspectRatioExtraHeight,f=l.lockAspectRatioExtraWidth,p=c.width,m=c.height,h=d||0,g=f||0;return YF(`right`,s)&&(p=c.width+(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),YF(`left`,s)&&(p=c.width-(e-c.x)*i/n,u&&(m=(p-g)/this.ratio+h)),YF(`bottom`,s)&&(m=c.height+(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),YF(`top`,s)&&(m=c.height-(t-c.y)*a/n,u&&(p=(m-h)*this.ratio+g)),{newWidth:p,newHeight:m}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var i=this.props,a=i.lockAspectRatio,o=i.lockAspectRatioExtraHeight,s=i.lockAspectRatioExtraWidth,c=r.width===void 0?10:r.width,l=n.width===void 0||n.width<0?e:n.width,u=r.height===void 0?10:r.height,d=n.height===void 0||n.height<0?t:n.height,f=o||0,p=s||0;if(a){var m=(u-f)*this.ratio+p,h=(d-f)*this.ratio+p,g=(c-p)/this.ratio+f,_=(l-p)/this.ratio+f,v=Math.max(c,m),y=Math.min(l,h),b=Math.max(u,g),x=Math.min(d,_);e=qF(e,v,y),t=qF(t,b,x)}else e=qF(e,c,l),t=qF(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if(this.props.bounds===`parent`){var t=this.parentNode;if(t){var n=t.getBoundingClientRect();this.parentLeft=n.left*e,this.parentTop=n.top*e}}if(this.props.bounds&&typeof this.props.bounds!=`string`){var r=this.props.bounds.getBoundingClientRect();this.targetLeft=r.left*e,this.targetTop=r.top*e}if(this.resizable){var i=this.resizable.getBoundingClientRect(),a=i.left,o=i.top,s=i.right,c=i.bottom;this.resizableLeft=a*e,this.resizableRight=s*e,this.resizableTop=o*e,this.resizableBottom=c*e}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n=0,r=0;if(e.nativeEvent&&ZF(e.nativeEvent)?(n=e.nativeEvent.clientX,r=e.nativeEvent.clientY):e.nativeEvent&&XF(e.nativeEvent)&&(n=e.nativeEvent.touches[0].clientX,r=e.nativeEvent.touches[0].clientY),!(this.props.onResizeStart&&this.resizable&&this.props.onResizeStart(e,t,this.resizable)===!1)){this.props.size&&(this.props.size.height!==void 0&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),this.props.size.width!==void 0&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio==`number`?this.props.lockAspectRatio:this.size.width/this.size.height;var i,a=this.window.getComputedStyle(this.resizable);if(a.flexBasis!==`auto`){var o=this.parentNode;if(o){var s=this.window.getComputedStyle(o).flexDirection;this.flexDir=s.startsWith(`row`)?`row`:`column`,i=a.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var c={original:{x:n,y:r,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:GF(GF({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||`auto`}),direction:t,flexBasis:i};this.setState(c)}}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&XF(e))try{e.preventDefault(),e.stopPropagation()}catch{}var n=this.props,r=n.maxWidth,i=n.maxHeight,a=n.minWidth,o=n.minHeight,s=XF(e)?e.touches[0].clientX:e.clientX,c=XF(e)?e.touches[0].clientY:e.clientY,l=this.state,u=l.direction,d=l.original,f=l.width,p=l.height,m=this.getParentSize(),h=tI(m,this.window.innerWidth,this.window.innerHeight,r,i,a,o);r=h.maxWidth,i=h.maxHeight,a=h.minWidth,o=h.minHeight;var g=this.calculateNewSizeFromDirection(s,c),_=g.newHeight,v=g.newWidth,y=this.calculateNewMaxFromBoundary(r,i);this.props.snap&&this.props.snap.x&&(v=QF(v,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(_=QF(_,this.props.snap.y,this.props.snapGap));var b=this.calculateNewSizeFromAspectRatio(v,_,{width:y.maxWidth,height:y.maxHeight},{width:a,height:o});if(v=b.newWidth,_=b.newHeight,this.props.grid){var x=JF(v,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),S=JF(_,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),C=this.props.snapGap||0,w=C===0||Math.abs(x-v)<=C?x:v,T=C===0||Math.abs(S-_)<=C?S:_;v=w,_=T}var E={width:v-d.width,height:_-d.height};if(this.delta=E,f&&typeof f==`string`){if(f.endsWith(`%`)){var D=v/m.width*100;v=`${D}%`}else if(f.endsWith(`vw`)){var O=v/this.window.innerWidth*100;v=`${O}vw`}else if(f.endsWith(`vh`)){var k=v/this.window.innerHeight*100;v=`${k}vh`}}if(p&&typeof p==`string`){if(p.endsWith(`%`)){var D=_/m.height*100;_=`${D}%`}else if(p.endsWith(`vw`)){var O=_/this.window.innerWidth*100;_=`${O}vw`}else if(p.endsWith(`vh`)){var k=_/this.window.innerHeight*100;_=`${k}vh`}}var A={width:this.createSizeForCssProperty(v,`width`),height:this.createSizeForCssProperty(_,`height`)};this.flexDir===`row`?A.flexBasis=A.width:this.flexDir===`column`&&(A.flexBasis=A.height);var j=this.state.width!==A.width,M=this.state.height!==A.height,N=this.state.flexBasis!==A.flexBasis,ee=j||M||N;ee&&(0,Kt.flushSync)(function(){t.setState(A)}),this.props.onResize&&ee&&this.props.onResize(e,u,this.resizable,E)}},t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction;t.original,n&&this.resizable&&(this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,this.delta),this.props.size&&this.setState({width:this.props.size.width??`auto`,height:this.props.size.height??`auto`}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:GF(GF({},this.state.backgroundStyle),{cursor:`auto`})}))},t.prototype.updateSize=function(e){this.setState({width:e.width??`auto`,height:e.height??`auto`})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,r=t.handleStyles,i=t.handleClasses,a=t.handleWrapperStyle,o=t.handleWrapperClass,s=t.handleComponent;if(!n)return null;var c=Object.keys(n).map(function(t){return n[t]===!1?null:(0,B.jsx)(UF,{direction:t,onResizeStart:e.onResizeStart,replaceStyles:r&&r[t],className:i&&i[t],children:s&&s[t]?s[t]:null},t)});return(0,B.jsx)(`div`,{className:o,style:a,children:c})},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce(function(t,n){return rI.indexOf(n)===-1&&(t[n]=e.props[n]),t},{}),n=GF(GF(GF({position:`relative`,userSelect:this.state.isResizing?`none`:`auto`},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:`border-box`,flexShrink:0});this.state.flexBasis&&(n.flexBasis=this.state.flexBasis);var r=this.props.as||`div`;return(0,B.jsxs)(r,GF({style:n,className:this.props.className},t,{ref:function(t){t&&(e.resizable=t)},children:[this.state.isResizing&&(0,B.jsx)(`div`,{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:`div`,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(H.PureComponent),oI=function(e,t){return oI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},oI(e,t)};function sI(e,t){oI(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var cI=function(){return cI=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},cI.apply(this,arguments)};function lI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var uI={width:`auto`,height:`auto`,display:`inline-block`,position:`absolute`,top:0,left:0},dI=function(e){return{bottom:e,bottomLeft:e,bottomRight:e,left:e,right:e,top:e,topLeft:e,topRight:e}},fI=function(e){sI(t,e);function t(t){var n=e.call(this,t)||this;return n.resizingPosition={x:0,y:0},n.offsetFromParent={left:0,top:0},n.resizableElement={current:null},n.originalPosition={x:0,y:0},n.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:t.maxWidth,maxHeight:t.maxHeight},n.onResizeStart=n.onResizeStart.bind(n),n.onResize=n.onResize.bind(n),n.onResizeStop=n.onResizeStop.bind(n),n.onDragStart=n.onDragStart.bind(n),n.onDrag=n.onDrag.bind(n),n.onDragStop=n.onDragStop.bind(n),n.getMaxSizesFromProps=n.getMaxSizesFromProps.bind(n),n}return t.prototype.componentDidMount=function(){this.updateOffsetFromParent();var e=this.offsetFromParent,t=e.left,n=e.top,r=this.getDraggablePosition(),i=r.x,a=r.y;this.draggable.setState({x:i-t,y:a-n}),this.forceUpdate()},t.prototype.getDraggablePosition=function(){var e=this.draggable.state;return{x:e.x,y:e.y}},t.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},t.prototype.getParentSize=function(){return this.resizable.getParentSize()},t.prototype.getMaxSizesFromProps=function(){return{maxWidth:this.props.maxWidth===void 0?2**53-1:this.props.maxWidth,maxHeight:this.props.maxHeight===void 0?2**53-1:this.props.maxHeight}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(e){var t=this.props.scale;switch(this.props.bounds){case`window`:return window.innerHeight/t;case`body`:return document.body.offsetHeight/t;default:return e.offsetHeight}},t.prototype.getOffsetWidth=function(e){var t=this.props.scale;switch(this.props.bounds){case`window`:return window.innerWidth/t;case`body`:return document.body.offsetWidth/t;default:return e.offsetWidth}},t.prototype.onDragStart=function(e,t){if(this.props.onDragStart&&this.props.onDragStart(e,t)===!1)return!1;var n=this.getDraggablePosition();if(this.originalPosition=n,this.props.bounds){var r=this.getParent(),i=this.props.scale,a;if(this.props.bounds===`parent`)a=r;else if(this.props.bounds===`body`){var o=r.getBoundingClientRect(),s=o.left,c=o.top,l=document.body.getBoundingClientRect(),u=-(s-r.offsetLeft*i-l.left)/i,d=-(c-r.offsetTop*i-l.top)/i,f=(document.body.offsetWidth-this.resizable.size.width*i)/i+u,p=(document.body.offsetHeight-this.resizable.size.height*i)/i+d;return this.setState({bounds:{top:d,right:f,bottom:p,left:u}})}else if(this.props.bounds===`window`){if(!this.resizable)return;var m=r.getBoundingClientRect(),h=m.left,g=m.top,_=-(h-r.offsetLeft*i)/i,v=-(g-r.offsetTop*i)/i,f=(window.innerWidth-this.resizable.size.width*i)/i+_,p=(window.innerHeight-this.resizable.size.height*i)/i+v;return this.setState({bounds:{top:v,right:f,bottom:p,left:_}})}else typeof this.props.bounds==`string`?a=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(a=this.props.bounds);if(a instanceof HTMLElement&&r instanceof HTMLElement){var y=a.getBoundingClientRect(),b=y.left,x=y.top,S=r.getBoundingClientRect(),C=S.left,w=S.top,T=(b-C)/i,E=x-w;if(this.resizable){this.updateOffsetFromParent();var D=this.offsetFromParent;this.setState({bounds:{top:E-D.top,right:T+(a.offsetWidth-this.resizable.size.width)-D.left/i,bottom:E+(a.offsetHeight-this.resizable.size.height)-D.top,left:T-D.left/i}})}}}},t.prototype.onDrag=function(e,t){if(this.props.onDrag){var n=this.offsetFromParent,r=n.left,i=n.top;if(!this.props.dragAxis||this.props.dragAxis===`both`)return this.props.onDrag(e,cI(cI({},t),{x:t.x+r,y:t.y+i}));if(this.props.dragAxis===`x`)return this.props.onDrag(e,cI(cI({},t),{x:t.x+r,y:this.originalPosition.y+i,deltaY:0}));if(this.props.dragAxis===`y`)return this.props.onDrag(e,cI(cI({},t),{x:this.originalPosition.x+r,y:t.y+i,deltaX:0}))}},t.prototype.onDragStop=function(e,t){if(this.props.onDragStop){var n=this.offsetFromParent,r=n.left,i=n.top;if(!this.props.dragAxis||this.props.dragAxis===`both`)return this.props.onDragStop(e,cI(cI({},t),{x:t.x+r,y:t.y+i}));if(this.props.dragAxis===`x`)return this.props.onDragStop(e,cI(cI({},t),{x:t.x+r,y:this.originalPosition.y+i,deltaY:0}));if(this.props.dragAxis===`y`)return this.props.onDragStop(e,cI(cI({},t),{x:this.originalPosition.x+r,y:t.y+i,deltaX:0}))}},t.prototype.onResizeStart=function(e,t,n){if(this.props.onResizeStart&&this.props.onResizeStart(e,t,n)===!1)return!1;e.stopPropagation(),this.setState({resizing:!0});var r=this.props.scale,i=this.offsetFromParent,a=this.getDraggablePosition();if(this.resizingPosition={x:a.x+i.left,y:a.y+i.top},this.originalPosition=a,this.props.bounds){var o=this.getParent(),s=void 0;this.props.bounds===`parent`?s=o:this.props.bounds===`body`?s=document.body:this.props.bounds===`window`?s=window:typeof this.props.bounds==`string`?s=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(s=this.props.bounds);var c=this.getSelfElement();if(c instanceof Element&&(s instanceof HTMLElement||s===window)&&o instanceof HTMLElement){var l=this.getMaxSizesFromProps(),u=l.maxWidth,d=l.maxHeight,f=this.getParentSize();if(u&&typeof u==`string`){if(u.endsWith(`%`)){var p=Number(u.replace(`%`,``))/100;u=f.width*p}else u.endsWith(`px`)&&(u=Number(u.replace(`px`,``)))}if(d&&typeof d==`string`){if(d.endsWith(`%`)){var p=Number(d.replace(`%`,``))/100;d=f.height*p}else d.endsWith(`px`)&&(d=Number(d.replace(`px`,``)))}var m=c.getBoundingClientRect(),h=m.left,g=m.top,_=this.props.bounds===`window`?{left:0,top:0}:s.getBoundingClientRect(),v=_.left,y=_.top,b=this.getOffsetWidth(s),x=this.getOffsetHeight(s),S=t.toLowerCase().endsWith(`left`),C=t.toLowerCase().endsWith(`right`),w=t.startsWith(`top`),T=t.startsWith(`bottom`);if((S||w)&&this.resizable){var E=(h-v)/r+this.resizable.size.width;this.setState({maxWidth:E>Number(u)?u:E})}if(C||this.props.lockAspectRatio&&!S&&!w){var E=b+(v-h)/r;this.setState({maxWidth:E>Number(u)?u:E})}if((w||S)&&this.resizable){var E=(g-y)/r+this.resizable.size.height;this.setState({maxHeight:E>Number(d)?d:E})}if(T||this.props.lockAspectRatio&&!w&&!S){var E=x+(y-g)/r;this.setState({maxHeight:E>Number(d)?d:E})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight})},t.prototype.onResize=function(e,t,n,r){var i=this,a={x:this.originalPosition.x,y:this.originalPosition.y},o=-r.width,s=-r.height;[`top`,`left`,`topLeft`,`bottomLeft`,`topRight`].includes(t)&&(t===`bottomLeft`?a.x+=o:(t===`topRight`||(a.x+=o),a.y+=s));var c=this.draggable.state;(a.x!==c.x||a.y!==c.y)&&(0,Kt.flushSync)(function(){i.draggable.setState(a)}),this.updateOffsetFromParent();var l=this.offsetFromParent,u=this.getDraggablePosition().x+l.left,d=this.getDraggablePosition().y+l.top;this.resizingPosition={x:u,y:d},this.props.onResize&&this.props.onResize(e,t,n,r,{x:u,y:d})},t.prototype.onResizeStop=function(e,t,n,r){this.setState({resizing:!1});var i=this.getMaxSizesFromProps(),a=i.maxWidth,o=i.maxHeight;this.setState({maxWidth:a,maxHeight:o}),this.props.onResizeStop&&this.props.onResizeStop(e,t,n,r,this.resizingPosition)},t.prototype.updateSize=function(e){this.resizable&&this.resizable.updateSize({width:e.width,height:e.height})},t.prototype.updatePosition=function(e){this.draggable.setState(e)},t.prototype.updateOffsetFromParent=function(){var e=this.props.scale,t=this.getParent(),n=this.getSelfElement();if(!t||n===null)return{top:0,left:0};var r=t.getBoundingClientRect(),i=r.left,a=r.top,o=n.getBoundingClientRect(),s=this.getDraggablePosition(),c=t.scrollLeft,l=t.scrollTop;this.offsetFromParent={left:o.left-i+c-s.x*e,top:o.top-a+l-s.y*e}},t.prototype.render=function(){var e=this,t=this.props,n=t.disableDragging,r=t.style,i=t.dragHandleClassName,a=t.position,o=t.onMouseDown,s=t.onMouseUp,c=t.dragAxis,l=t.dragGrid,u=t.bounds,d=t.enableUserSelectHack,f=t.cancel,p=t.children;t.onResizeStart,t.onResize,t.onResizeStop,t.onDragStart,t.onDrag,t.onDragStop;var m=t.resizeHandleStyles,h=t.resizeHandleClasses,g=t.resizeHandleComponent,_=t.enableResizing,v=t.resizeGrid,y=t.resizeHandleWrapperClass,b=t.resizeHandleWrapperStyle,x=t.scale,S=t.allowAnyClick,C=t.dragPositionOffset,w=lI(t,`disableDragging.style.dragHandleClassName.position.onMouseDown.onMouseUp.dragAxis.dragGrid.bounds.enableUserSelectHack.cancel.children.onResizeStart.onResize.onResizeStop.onDragStart.onDrag.onDragStop.resizeHandleStyles.resizeHandleClasses.resizeHandleComponent.enableResizing.resizeGrid.resizeHandleWrapperClass.resizeHandleWrapperStyle.scale.allowAnyClick.dragPositionOffset`.split(`.`)),T=this.props.default?cI({},this.props.default):void 0;delete w.default;var E=n||i?{cursor:`auto`}:{cursor:`move`},D=cI(cI(cI({},uI),E),r),O=this.offsetFromParent,k=O.left,A=O.top,j;a&&(j={x:a.x-k,y:a.y-A});var M=this.state.resizing?void 0:j,N=this.state.resizing?`both`:c;return(0,H.createElement)(LF,{ref:function(t){t&&(e.draggable=t)},handle:i?`.${i}`:void 0,defaultPosition:T,onMouseDown:o,onMouseUp:s,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:N,disabled:n,grid:l,bounds:u?this.state.bounds:void 0,position:M,enableUserSelectHack:d,cancel:f,scale:x,allowAnyClick:S,nodeRef:this.resizableElement,positionOffset:C},(0,H.createElement)(aI,cI({},w,{ref:function(t){t&&(e.resizable=t,e.resizableElement.current=t.resizable)},defaultSize:T,size:this.props.size,enable:typeof _==`boolean`?dI(_):_,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:D,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:v,handleWrapperClass:y,handleWrapperStyle:b,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:m,handleClasses:h,handleComponent:g,scale:this.props.scale}),p))},t.defaultProps={maxWidth:2**53-1,maxHeight:2**53-1,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(H.PureComponent);function pI(e,t){return e?e.kind===`services`?t.services.find(t=>t.id===e.resourceId)?.name??e.title:e.kind===`terminal`?t.terminals.find(t=>t.id===e.resourceId)?.title??e.title:e.title:`窗口`}var mI=e=>[`services`,e],hI=e=>[`services`,`detail`,e],gI=(e,t)=>[`services`,`logs`,e,t];async function _I(e){return qk.parse(await Y(`/api/services?projectId=${encodeURIComponent(e)}&limit=200`)).items}async function vI(e){return Kk.parse(await Y(`/api/services/${encodeURIComponent(e)}`))}async function yI(e,t=0,n=200){return Y(`/api/services/${encodeURIComponent(e)}/logs?after=${t}&limit=${n}`)}async function bI(e){return Jk.parse(await Y(`/api/services`,{method:`POST`,csrf:!0,body:e}))}async function xI(e,t){return Jk.parse(await Y(`/api/resource-actions/${encodeURIComponent(e)}/decision`,{method:`POST`,csrf:!0,body:{decision:t}}))}async function SI(e){return Jk.parse(await Y(`/api/resource-actions/${encodeURIComponent(e)}/execute`,{method:`POST`,csrf:!0,body:{}}))}async function CI(e,t=`/`,n=`embedded`){return Y(`/api/previews/resolve`,{method:`POST`,csrf:!0,body:{serviceId:e,path:t,mode:n}})}async function wI(e){return Kk.parse(await Y(`/api/services/${encodeURIComponent(e)}/stop`,{method:`POST`,csrf:!0,body:{}}))}async function TI(e){return Kk.parse(await Y(`/api/services/${encodeURIComponent(e)}`,{method:`DELETE`,csrf:!0}))}function EI({tab:e}){return e.browser?(0,B.jsx)(OI,{tab:e}):(0,B.jsx)(kI,{tab:e})}function DI(e){return e instanceof aA||e instanceof Error?e.message:`预览不可用`}function OI({tab:e}){let t=e.browser,[n,r]=(0,H.useState)(null),[i,a]=(0,H.useState)(``),[o,s]=(0,H.useState)(!0),[c,l]=(0,H.useState)(0),[u,d]=(0,H.useState)(!1),f=(0,H.useRef)(null),p=`preview-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`;(0,H.useEffect)(()=>{if(!t)return;let e=!1,n=c;return s(!0),a(``),r(null),CI(t.serviceId,t.path).then(t=>{e||n!==c||(r(t),s(!1))}).catch(t=>{e||n!==c||(a(DI(t)),s(!1))}),()=>{e=!0}},[t,c]),(0,H.useEffect)(()=>{n&&f.current?.submit()},[n]);let m=async()=>{if(!t||u)return;d(!0),a(``);let e=window.open(`about:blank`,`_blank`);try{if(!e)throw Error(`浏览器阻止了新窗口`);e.opener=null;let n=await CI(t.serviceId,t.path,`external`),r=document.createElement(`form`);r.method=`POST`,r.action=n.bootstrapUrl,r.target=`preview-external-${Date.now()}`,e.name=r.target,r.style.display=`none`;for(let[e,i]of[[`ticket`,n.ticket],[`path`,t.path]]){let t=document.createElement(`input`);t.type=`hidden`,t.name=e,t.value=i,r.append(t)}document.body.append(r),r.submit(),r.remove()}catch(t){e?.close(),a(DI(t))}finally{d(!1)}};return(0,B.jsxs)(`div`,{className:`flex h-full flex-col bg-surface`,children:[(0,B.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center gap-1 border-b border-line bg-surface-2/45 px-2`,children:[(0,B.jsx)(Iu,{label:`后退`,disabled:!0,className:`h-6 w-6`,children:(0,B.jsx)(Hg,{size:13})}),(0,B.jsx)(Iu,{label:`前进`,disabled:!0,className:`h-6 w-6`,children:(0,B.jsx)(Wg,{size:13})}),(0,B.jsx)(Iu,{label:`刷新预览`,onClick:()=>l(e=>e+1),className:`h-6 w-6`,children:(0,B.jsx)(Av,{size:12,className:o?`animate-spin`:void 0})}),(0,B.jsxs)(`div`,{className:`mx-1 flex h-7 min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-line bg-surface px-2`,children:[(0,B.jsx)(Bv,{size:11,className:`shrink-0 text-success`}),(0,B.jsx)(`span`,{title:`预览地址`,className:`h-full min-w-0 flex-1 truncate font-mono text-[10.5px] leading-7 text-ink-2`,children:n?`${n.origin}${t?.path??`/`}`:`解析预览来源…`}),o?(0,B.jsx)(ev,{size:11,className:`animate-spin text-ink-3`}):null]}),(0,B.jsx)(Iu,{label:`在独立来源打开`,onClick:()=>void m(),disabled:u,className:`h-6 w-6`,children:(0,B.jsx)(E_,{size:12})})]}),(0,B.jsxs)(`div`,{className:`relative min-h-0 flex-1 bg-white`,children:[i?(0,B.jsxs)(`div`,{className:`absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-surface text-center`,children:[(0,B.jsx)(`p`,{role:`alert`,title:i,className:`max-w-[360px] px-4 text-[12px] text-ink-2`,children:`无法访问`}),(0,B.jsx)(`button`,{type:`button`,className:`text-[11px] text-accent underline`,onClick:()=>l(e=>e+1),children:`刷新`})]}):null,(0,B.jsx)(`form`,{ref:f,method:`POST`,action:n?.bootstrapUrl??``,target:p,hidden:!0,children:(0,B.jsx)(`input`,{type:`hidden`,name:`ticket`,value:n?.ticket??``,readOnly:!0})}),(0,B.jsx)(`iframe`,{name:p,title:`项目预览`,"data-testid":`preview-frame`,src:`about:blank`,sandbox:`allow-scripts allow-forms allow-same-origin`,referrerPolicy:`no-referrer`,className:`h-full w-full border-0 bg-white`}),o?(0,B.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-surface/60 text-[11px] text-ink-3`,children:`正在建立隔离预览…`}):null]}),(0,B.jsxs)(`div`,{className:`flex h-6 shrink-0 items-center gap-1.5 border-t border-line bg-surface-2/50 px-2 font-mono text-[9px] text-ink-3`,children:[(0,B.jsx)(S_,{size:10,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`whitespace-nowrap`,children:`独立来源`})]})]})}function kI({tab:e}){let[t,n]=(0,H.useState)(e.resourceId.startsWith(`http`)?e.resourceId:`http://localhost:5173/dashboard`),[r,i]=(0,H.useState)(!1),a=()=>{i(!0),window.setTimeout(()=>i(!1),650)};return(0,B.jsxs)(`div`,{className:`flex h-full flex-col bg-surface`,children:[(0,B.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center gap-1 border-b border-line bg-surface-2/45 px-2`,children:[(0,B.jsx)(Iu,{label:`后退`,disabled:!0,className:`h-6 w-6`,children:(0,B.jsx)(Hg,{size:13})}),(0,B.jsx)(Iu,{label:`前进`,disabled:!0,className:`h-6 w-6`,children:(0,B.jsx)(Wg,{size:13})}),(0,B.jsx)(Iu,{label:`刷新`,onClick:a,className:`h-6 w-6`,children:(0,B.jsx)(Av,{size:12,className:r?`animate-spin`:void 0})}),(0,B.jsxs)(`form`,{className:`mx-1 flex h-7 min-w-0 flex-1 items-center gap-1.5 rounded-lg border border-line bg-surface px-2`,onSubmit:e=>{e.preventDefault(),a()},children:[(0,B.jsx)(Bv,{size:11,className:`shrink-0 text-success`}),(0,B.jsx)(Mu,{variant:`bare`,value:t,onChange:e=>n(e.target.value),"aria-label":`预览地址`,className:`h-full min-w-0 flex-1 bg-transparent font-mono text-[10.5px] text-ink-2 outline-none`}),r?(0,B.jsx)(ev,{size:11,className:`animate-spin text-ink-3`}):null]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto bg-[#f7f8fa]`,children:(0,B.jsx)(AI,{address:t})}),(0,B.jsxs)(`div`,{className:`flex h-6 shrink-0 items-center gap-1.5 border-t border-line bg-surface-2/50 px-2 font-mono text-[9px] text-ink-3`,children:[(0,B.jsx)(S_,{size:10,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`whitespace-nowrap`,children:`演示预览`})]})]})}function AI({address:e}){return(0,B.jsxs)(`div`,{className:`min-h-full bg-[#f7f8fa] text-[#1d1d1f]`,children:[(0,B.jsx)(`div`,{className:`border-b border-black/[.06] bg-white/80 px-6 py-3 backdrop-blur`,children:(0,B.jsxs)(`div`,{className:`mx-auto flex max-w-[900px] items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`flex h-6 w-6 items-center justify-center rounded-lg bg-[#0a84ff] text-[10px] font-bold text-white`,children:`L`}),(0,B.jsx)(`span`,{className:`text-[12px] font-semibold`,children:`Larness`}),(0,B.jsxs)(`nav`,{className:`ml-4 flex items-center gap-4 text-[10.5px] text-[#6e6e73]`,children:[(0,B.jsx)(`span`,{className:`text-[#1d1d1f]`,children:`概览`}),(0,B.jsx)(`span`,{children:`项目`}),(0,B.jsx)(`span`,{children:`运行记录`})]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`rounded-full bg-[#30d158]/10 px-2 py-[2px] text-[9px] font-medium text-[#1f9d48]`,children:`dev · healthy`}),(0,B.jsx)(`div`,{className:`h-6 w-6 rounded-full bg-[#ffd60a]`})]})]})}),(0,B.jsxs)(`div`,{className:`mx-auto max-w-[900px] px-6 py-8`,children:[(0,B.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`text-[10px] font-medium uppercase tracking-[.12em] text-[#86868b]`,children:`Workspace overview`}),(0,B.jsx)(`h2`,{className:`mt-2 text-[28px] font-semibold tracking-[-.03em]`,children:`你的工作空间,已就绪。`}),(0,B.jsx)(`p`,{className:`mt-1.5 max-w-[520px] text-[12px] leading-5 text-[#6e6e73]`,children:`这是 Vite 开发服务的本地预览占位页面。真实项目会在独立来源中加载,不共享管理站的 Cookie。`})]}),(0,B.jsxs)(`div`,{className:`hidden rounded-xl border border-black/[.06] bg-white px-3 py-2 text-right shadow-sm sm:block`,children:[(0,B.jsx)(`div`,{className:`font-mono text-[9px] text-[#86868b]`,children:e}),(0,B.jsx)(`div`,{className:`mt-1 text-[10px] text-[#1f9d48]`,children:`HTTP 200 · 42ms`})]})]}),(0,B.jsx)(`div`,{className:`mt-6 grid grid-cols-3 gap-3`,children:[{label:`运行中的服务`,value:`3`,detail:`+1 今日`,tint:`#0a84ff`},{label:`本周部署`,value:`12`,detail:`全部健康`,tint:`#30d158`},{label:`终端会话`,value:`2`,detail:`1 个空闲`,tint:`#ff9f0a`}].map(e=>(0,B.jsxs)(`div`,{className:`rounded-2xl border border-black/[.06] bg-white p-4 shadow-[0_1px_2px_rgba(0,0,0,.03)]`,children:[(0,B.jsx)(`div`,{className:`text-[10px] text-[#86868b]`,children:e.label}),(0,B.jsxs)(`div`,{className:`mt-2 flex items-end gap-2`,children:[(0,B.jsx)(`span`,{className:`text-[26px] font-semibold leading-none tracking-[-.04em]`,children:e.value}),(0,B.jsx)(`span`,{className:`pb-0.5 text-[9.5px] text-[#6e6e73]`,children:e.detail})]}),(0,B.jsx)(`div`,{className:`mt-3 h-1 rounded-full bg-black/[.05]`,children:(0,B.jsx)(`div`,{className:`h-full rounded-full`,style:{width:e.label===`运行中的服务`?`62%`:`78%`,background:e.tint}})})]},e.label))}),(0,B.jsxs)(`div`,{className:`mt-3 grid grid-cols-[1.4fr_1fr] gap-3`,children:[(0,B.jsxs)(`div`,{className:`rounded-2xl border border-black/[.06] bg-white p-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsx)(`span`,{className:`text-[11px] font-semibold`,children:`最近活动`}),(0,B.jsx)(`span`,{className:`text-[9.5px] text-[#86868b]`,children:`过去 24 小时`})]}),(0,B.jsx)(`div`,{className:`mt-3 flex h-[92px] items-end gap-1.5`,children:[38,52,44,66,58,74,62,80,68,86,72,92].map((e,t)=>(0,B.jsx)(`div`,{className:z(`flex-1 rounded-t-[3px]`,t===11?`bg-[#0a84ff]`:`bg-[#0a84ff]/20`),style:{height:`${e}%`}},t))})]}),(0,B.jsxs)(`div`,{className:`rounded-2xl border border-black/[.06] bg-white p-4`,children:[(0,B.jsx)(`div`,{className:`text-[11px] font-semibold`,children:`当前会话`}),(0,B.jsx)(`div`,{className:`mt-3 space-y-2`,children:[[`feat/agent-runtime`,`feat/agent-runtime`,`运行中`],[`web-prod`,`PM2 · 8080`,`待部署`],[`preview`,`localhost:5173`,`已连接`]].map(([e,t,n])=>(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[#0a84ff]`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`div`,{className:`truncate text-[10.5px] font-medium`,children:e}),(0,B.jsx)(`div`,{className:`truncate font-mono text-[9px] text-[#86868b]`,children:t})]}),(0,B.jsx)(`span`,{className:`text-[9px] text-[#6e6e73]`,children:n})]},e))})]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-center gap-2 border-t border-black/[.05] py-4 text-[9px] text-[#86868b]`,children:[(0,B.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[#30d158]`}),`这是 S0 视觉 Demo 的静态预览,不加载真实项目页面`]})]})}function jI({tab:e}){return(0,B.jsx)(MI,{tab:e})}function MI({tab:e}){let t=e.projectId,n=e.git,r=gp({queryKey:[`git`,`diff`,t,n?.path,n?.staged],queryFn:()=>rM(t??``,n?.path??``,n?.staged===!0),enabled:t!==null&&n!==void 0,retry:!1});if(t===null||n===void 0)return(0,B.jsx)(`p`,{className:`p-4 text-xs text-ink-3`,children:`Diff 目标缺少项目或路径,请重新打开。`});if(r.isPending)return(0,B.jsxs)(`p`,{className:`flex items-center gap-2 p-4 text-xs text-ink-3`,children:[(0,B.jsx)(ev,{size:12,className:`animate-spin`}),` 读取 Diff…`]});if(r.isError)return(0,B.jsx)(Ou,{message:`差异读取失败,请重新打开或重试。`,retry:{label:`重新读取`,run:()=>void r.refetch()}});let i=r.data;return(0,B.jsx)(NI,{data:i})}function NI({data:e}){let t=e.binary?[]:e.diff.split(`
111
- `);return(0,B.jsxs)(`div`,{className:`flex h-full flex-col bg-surface`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-line px-3 py-2`,children:[(0,B.jsx)(q_,{size:14,className:`text-ink-3`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[10.5px] text-ink-2`,children:e.path}),(0,B.jsx)(`span`,{className:`rounded-full border border-line bg-surface-2 px-1.5 py-[1px] text-[9px] text-ink-3`,children:e.staged?`已暂存`:`工作区`})]}),e.binary?(0,B.jsx)(`p`,{className:`p-4 text-xs text-ink-3`,children:`二进制文件不显示文本 Diff;仍可按显式路径暂存 / 提交。`}):e.truncated?(0,B.jsx)(`p`,{className:`p-4 text-xs text-warning`,children:`Diff 超过 1 MiB,已截断;不自动写入或覆盖文件。`}):(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto font-mono text-[10.5px] leading-[19px]`,children:t.map((e,t)=>(0,B.jsxs)(`div`,{className:z(`flex min-w-max whitespace-pre`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-success/[.08]`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-danger/[.07]`),children:[(0,B.jsx)(`span`,{className:`w-5 shrink-0 select-none text-center text-ink-3/70`,children:e.startsWith(`+`)&&!e.startsWith(`+++`)?`+`:e.startsWith(`-`)&&!e.startsWith(`---`)?`-`:` `}),(0,B.jsx)(`span`,{className:`whitespace-pre pr-6 text-ink-2`,children:e||` `})]},`${t}_${e.slice(0,16)}`))}),(0,B.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-3 border-t border-line bg-surface-2/40 px-3 text-[10px] text-ink-3`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(e_,{size:11,className:`text-success`}),`只读 Diff`]}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(Ov,{size:11,className:`text-success`}),`新增`]}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(ny,{size:11,className:`text-danger`}),`删除`]})]})]})}var PI=`modulepreload`,FI=function(e){return`/`+e},II={},LI=function(e){return e.pathname.endsWith(`.css`)},RI=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},zI=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=FI(t,n);let r=s(t),i=LI(r);return RI(II,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:PI,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};(0,H.lazy)(()=>zI(()=>import(`./FileViewer-B6J1gfWW.js`),__vite__mapDeps([0,1,2,3,4])));var BI=(0,H.lazy)(()=>zI(()=>import(`./FileEditor-twkRcPR8.js`),__vite__mapDeps([5,1,2,3,4])));function VI({tab:e}){return e.file?(0,B.jsx)(HI,{tab:e,target:e.file},e.id):(0,B.jsx)(`div`,{className:`p-5 text-sm text-ink-3`,children:`从右侧文件树打开文件。旧的预览 Tab 请关闭后重新打开。`})}function HI({tab:e,target:t}){let n=gp({queryKey:Lj(t.scope,t.path),queryFn:()=>Rj(t.scope,t.path),staleTime:0}),r=Hj(e=>e.monitoring[Ij(t.scope)]),i=Hj(t=>t.drafts[e.resourceId]),a=Hj(t=>t.saving[e.resourceId]??!1),[o,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(!1),u=n.data,d=!!i&&!!u&&i.baseVersion!==u.version,f=i?.text??u?.content;return(0,H.useEffect)(()=>{let t=t=>{(t.metaKey||t.ctrlKey)&&t.key===`s`&&(t.preventDefault(),a||n.isError||d||(s(null),Gj(e).catch(e=>s(Vj(e)))))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[a,n.isError,d,e]),(0,B.jsxs)(`div`,{className:`flex h-full flex-col text-[11px] text-ink-2`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-line p-2`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,title:t.path,children:[t.path,i?` ●`:``]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`刷新文件`,disabled:a,onClick:()=>{s(null),n.refetch()},children:`刷新`}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`保存文件`,disabled:!i||a||d||n.isError,onClick:()=>{s(null),Gj(e).catch(e=>s(Vj(e)))},children:a?`保存中…`:`保存`})]}),(0,B.jsx)(Ou,{message:n.isError?Vj(n.error):d?null:o,onDismiss:n.isError?void 0:()=>s(null)}),d?(0,B.jsxs)(`div`,{className:`shrink-0 space-y-2 border-b border-line bg-warning/10 p-2`,children:[(0,B.jsx)(`p`,{role:`status`,children:`磁盘文件已变化,草稿已保留。`}),(0,B.jsxs)(`div`,{className:`flex gap-4`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:()=>l(!c),children:c?`返回编辑`:`查看差异`}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{Hj.getState().discard(e.resourceId),l(!1),s(null)},children:`重新加载磁盘`}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>{u&&i&&Hj.getState().edit(e.resourceId,i.text,u.version),l(!1),s(null)},children:`手工合并`})]}),(0,B.jsx)(`p`,{className:`text-ink-3`,children:c?`磁盘版本 → 本地草稿`:`重载将放弃草稿;手工合并保留草稿,编辑后按当前磁盘版本保存。`})]}):null,(0,B.jsx)(`div`,{className:`min-h-0 flex-1`,children:f===void 0?(0,B.jsx)(`p`,{className:`p-4`,children:n.isPending?`正在读取完整文件…`:`文件不可用`}):(0,B.jsx)(H.Suspense,{fallback:(0,B.jsx)(`p`,{className:`p-4`,children:`正在加载编辑器…`}),children:(0,B.jsx)(BI,{identity:e.resourceId,path:t.path,text:f,original:c&&d?u?.content:void 0,readOnly:a||n.isError,onChange:t=>{u&&(t===u.content&&(!i||i.baseVersion===u.version)?Hj.getState().discard(e.resourceId):Hj.getState().edit(e.resourceId,t,i?.baseVersion??u.version))}},`${e.resourceId}:${c}`)})}),(0,B.jsxs)(`div`,{className:`shrink-0 border-t border-line px-3 py-1 text-ink-3`,children:[`UTF-8 · `,i?`未保存`:`已同步`,n.isFetching?` · 正在刷新`:``,` · `,r??`正在连接文件监听…`]})]})}function UI(e){return e===`RUNNING`?`运行中`:e===`UNKNOWN`?`不可用`:e===`UNREGISTERED`?`已结束`:e}function WI(e){return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}var GI=new Set([`PREVIEW_TARGET_INVALID`,`APPROVAL_INVALID`,`CONFLICT`,`RESOURCE_UNAVAILABLE`,`NOT_FOUND`,`EXPIRED`]);function KI(e){if(e instanceof aA){if(e.code===`PREVIEW_TARGET_INVALID`)return`无法登记:该端口没有可核验、且属于此终端的监听。请确认服务已在该终端启动;能登记但访问不了时,预览会显示不可用。`;if(e.code===`APPROVAL_INVALID`||e.code===`EXPIRED`)return`这次登记已结束(执行失败或过期),请重新登记。`}return oA(e,`登记失败,请核对服务状态后重试。`)}function qI(e){return e instanceof aA&&(GI.has(e.code)||e.status===401||e.status===403)}var JI=new Map;function YI(e){return typeof e==`object`&&e&&`serviceId`in e&&typeof e.serviceId==`string`?e.serviceId:null}function XI({tab:e}){let t=e.projectId;return t?(0,B.jsx)(ZI,{projectId:t,tabId:e.id,initialId:e.resourceId.startsWith(`svc_`)?e.resourceId:JI.get(e.id)??null}):(0,B.jsx)(`div`,{className:`flex h-full items-center justify-center text-xs text-ink-3`,children:`选择一个项目后查看服务`})}function ZI({projectId:e,tabId:t,initialId:n}){let[r,i]=(0,H.useState)(n),a=e=>{e?JI.set(t,e):JI.delete(t),i(e)},[o,s]=(0,H.useState)(!1),c=gp({queryKey:mI(e),queryFn:()=>_I(e),refetchInterval:2e3});if(r)return(0,B.jsx)(QI,{id:r,onBack:()=>a(null),onRefresh:()=>void c.refetch()});let l=c.data??[];return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-line px-3 py-2`,children:[(0,B.jsx)(Iv,{size:14,className:`text-ink-3`}),(0,B.jsx)(`span`,{className:`text-[12px] font-semibold text-ink`,children:`服务`}),(0,B.jsx)(`span`,{className:`rounded-full bg-surface-2 px-1.5 text-[10px] text-ink-3`,children:l.length}),(0,B.jsx)(V,{className:`ml-auto`,size:`sm`,variant:`secondary`,leading:(0,B.jsx)(Ov,{size:12}),onClick:()=>s(!0),children:`登记服务`})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,B.jsx)(Ou,{message:c.isError?`服务读取失败,请刷新重试。`:null}),l.length===0&&!c.isError?(0,B.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-center`,children:[(0,B.jsx)(Iv,{size:22,className:`text-ink-3`}),(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`p`,{className:`text-[12px] font-medium text-ink`,children:`当前项目暂无服务`}),(0,B.jsx)(`p`,{className:`max-w-[320px] text-[11px] text-ink-3`,children:`在项目终端启动服务后,可按实际监听端口登记。登记不会启动或重启进程。`})]}),(0,B.jsx)(V,{size:`sm`,onClick:()=>s(!0),children:`登记服务`})]}):(0,B.jsx)(`div`,{className:`grid grid-cols-1 gap-2 md:grid-cols-2`,children:l.map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>a(e.id),className:`rounded-lg border border-line bg-surface p-2.5 text-left transition-colors hover:bg-surface-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate text-[12px] font-medium text-ink`,children:e.name}),(0,B.jsx)(`span`,{className:z(`rounded-full border px-1.5 py-[1px] text-[9px]`,e.status===`RUNNING`?`border-success/20 bg-success/10 text-success`:`border-line bg-surface-2 text-ink-3`),children:UI(e.status)}),(0,B.jsx)(`span`,{className:`ml-auto rounded bg-black/[.04] px-1 text-[9px] text-ink-3 dark:bg-white/[.07]`,children:`临时`})]}),(0,B.jsxs)(`div`,{className:`mt-1 font-mono text-[10px] text-ink-3`,children:[e.endpoint.host,`:`,e.endpoint.port]}),(0,B.jsxs)(`div`,{className:`mt-0.5 text-[9.5px] text-ink-3`,children:[`终端 `,e.terminalId.slice(-6),` · `,WI(e.createdAt)]})]},e.id))})]}),(0,B.jsx)(nL,{open:o,projectId:e,onClose:()=>s(!1),onRegistered:e=>{s(!1),a(e)}})]})}function QI({id:e,onBack:t,onRefresh:n}){let r=gp({queryKey:hI(e),queryFn:()=>vI(e),refetchInterval:2e3}),i=gp({queryKey:gI(e,0),queryFn:()=>yI(e,0),refetchInterval:2e3}),[a,o]=(0,H.useState)(``),[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(``),p=Wd(),m=Fj(e=>e.open),h=r.data;if(r.isError)return(0,B.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 text-xs text-ink-3`,children:[(0,B.jsx)(`p`,{role:`alert`,children:`服务不可用或已移除。`}),(0,B.jsx)(V,{size:`sm`,variant:`secondary`,onClick:t,children:`返回列表`})]});if(!h)return(0,B.jsx)(`div`,{className:`p-3 text-xs text-ink-3`,children:`读取服务…`});let g=h.status!==`RUNNING`,_=eL((i.data?.chunks??[]).map(e=>e.data).join(``));return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-start gap-2 border-b border-line px-3 py-2`,children:[(0,B.jsx)(V,{size:`sm`,variant:`ghost`,leading:(0,B.jsx)(Hg,{size:12}),onClick:t,children:`返回`}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate text-[12.5px] font-semibold text-ink`,children:h.name}),(0,B.jsx)(`span`,{className:z(`rounded-full border px-1.5 py-[1px] text-[9px]`,g?`border-line bg-surface-2 text-ink-3`:`border-success/20 bg-success/10 text-success`),children:UI(h.status)})]}),(0,B.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-ink-3`,children:`${h.endpoint.protocol}://${h.endpoint.host}:${h.endpoint.port}`})]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,B.jsx)(V,{size:`sm`,variant:`secondary`,leading:(0,B.jsx)(Jv,{size:12}),onClick:()=>{o(``),AN(h.terminalId).then(PN).catch(()=>o(`所属终端不可用`))},children:`打开终端`}),(0,B.jsx)(V,{size:`sm`,leading:(0,B.jsx)(E_,{size:12}),disabled:h.status!==`RUNNING`,onClick:()=>m({kind:`browser`,resourceId:`browser:${h.id}:/`,browser:{serviceId:h.id,path:`/`},title:`预览 ${h.name}`,projectId:h.projectId,source:`artifact`}),children:`预览`}),(0,B.jsx)(V,{size:`sm`,variant:`danger`,disabled:h.status!==`RUNNING`||l,onClick:()=>{f(``),c(`stop`)},children:`停止服务`}),(0,B.jsx)(V,{size:`sm`,variant:`ghost`,disabled:l,onClick:()=>{f(``),c(`delete`)},children:`删除登记`})]})]}),g?(0,B.jsx)(`div`,{className:`border-b border-line bg-surface-2/60 px-3 py-2 text-[11px] text-ink-3`,children:`服务已结束或暂不可用;登记与预览不会重新启动源进程。`}):null,(0,B.jsx)(Ou,{message:a,onDismiss:()=>o(``)}),(0,B.jsx)(ca,{open:s!==null,onOpenChange:e=>!e&&!l?c(null):void 0,children:(0,B.jsxs)(ua,{className:`w-[400px] space-y-3 text-sm`,children:[(0,B.jsx)(da,{children:s===`stop`?`停止服务?`:`删除登记?`}),(0,B.jsx)(fa,{children:s===`stop`?`会终止该监听进程及其子进程,并撤销预览;终端 Shell 和无关进程不受影响。共享同一进程的其他服务也会失效。`:`只删除登记并撤销预览,不会停止正在运行的进程;终端可继续使用。`}),(0,B.jsx)(Ou,{message:d,onDismiss:()=>f(``)}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,disabled:l,onClick:()=>c(null),children:`取消`}),(0,B.jsx)(V,{variant:s===`stop`?`danger`:`primary`,disabled:l,onClick:()=>{s&&(u(!0),f(``),(s===`stop`?wI(h.id):TI(h.id)).then(async()=>{await p.invalidateQueries({queryKey:mI(h.projectId)}),c(null),t()}).catch(e=>{f(oA(e,s===`stop`?`停止服务失败`:`删除登记失败`))}).finally(()=>u(!1)))},children:s===`stop`?`停止`:`删除`})]})]})}),(0,B.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-2 px-3 py-2 md:grid-cols-4`,children:[(0,B.jsx)($I,{label:`终端`,value:h.terminalId.slice(-6),mono:!0}),(0,B.jsx)($I,{label:`执行`,value:h.terminalExecutionId.slice(-6),mono:!0}),(0,B.jsx)($I,{label:`Generation`,value:String(h.endpointGeneration),mono:!0}),(0,B.jsx)($I,{label:`登记时间`,value:WI(h.createdAt)})]}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pb-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-semibold uppercase tracking-[.08em] text-ink-3`,children:[`关联终端输出`,(0,B.jsx)(`span`,{className:`font-normal normal-case tracking-normal text-ink-3`,children:`不是逐条命令的精确日志`})]}),(0,B.jsxs)(`div`,{className:`mt-1 min-h-0 flex-1 overflow-auto rounded-lg border border-line bg-[#0f1115] p-2 font-mono text-[10px] leading-5 text-[#c7ccd4]`,children:[(0,B.jsx)(Ou,{message:i.isError?`日志读取失败,请刷新重试。`:null}),_?(0,B.jsx)(`pre`,{className:`whitespace-pre-wrap break-all`,children:_}):(0,B.jsx)(`span`,{className:`text-white/35`,children:i.isError?`日志暂不可用`:`暂无输出`})]}),(0,B.jsx)(`button`,{type:`button`,className:`mt-1 self-end text-[10px] text-ink-3 hover:text-ink`,onClick:()=>{n(),r.refetch(),i.refetch()},children:`刷新`})]})]})}function $I({label:e,value:t,mono:n}){return(0,B.jsxs)(`div`,{className:`rounded-lg border border-line bg-surface-2/50 px-2 py-1.5`,children:[(0,B.jsx)(`div`,{className:`text-[9px] uppercase tracking-[.08em] text-ink-3`,children:e}),(0,B.jsx)(`div`,{className:z(`mt-0.5 truncate text-[11px] text-ink`,n&&`font-mono`),children:t})]})}function eL(e){return e.replace(tL,``).replace(/\r\n?/g,`
112
- `)}var tL=new RegExp(String.raw`(?:\x1b\]|\x9d)[^\x07\x1b\x9c]*(?:\x07|\x1b\\|\x9c|$)`+String.raw`|(?:\x1b[P^_X]|[\x90\x98\x9e\x9f])[^\x1b\x9c]*(?:\x1b\\|\x9c|$)`+String.raw`|(?:\x1b\[|\x9b)[0-?]*[ -/]*(?:[@-~]|$)`+String.raw`|\x1b[ -/]*[0-~]|[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]`,`g`);function nL({open:e,projectId:t,onClose:n,onRegistered:r}){let i=(0,H.useId)(),a=Wd(),o=gp({queryKey:[`terminals`,`service-picker`,t],queryFn:()=>jN(void 0,{projectId:t}),enabled:e}),[s,c]=(0,H.useState)(``),[l,u]=(0,H.useState)(``),[d,f]=(0,H.useState)(``),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(``),[_,v]=(0,H.useState)(``),[y,b]=(0,H.useState)(null),x=(o.data?.items??[]).filter(e=>e.status===`RUNNING`),S=async e=>{await a.invalidateQueries({queryKey:mI(t)}),r(e)},C=async()=>{let e=Number(d);if(!s||!l.trim()||!Number.isInteger(e)||e<1||e>65535)v(`请选择运行中的终端,并填写 1–80 字名称与有效端口`);else{m(!0),g(``),v(``);try{let t=await bI({kind:`temporary`,terminalId:s,name:l.trim(),endpoint:{host:`127.0.0.1`,port:e,protocol:`http`}});if(t.status===`WAITING_APPROVAL`)b({id:t.id});else if(t.status===`COMPLETED`){let e=YI(t.result);e?await S(e):g(`登记完成但缺少服务标识`)}else g(`登记未完成:${t.status}`)}catch(e){g(KI(e))}finally{m(!1)}}},w=async()=>{if(y){m(!0),g(``);try{let e=await SI((await xI(y.id,`approve`)).id),t=YI(e.result);if(e.status!==`COMPLETED`||!t){b(null),g(`登记未完成:${e.status},请重新登记。`);return}await S(t)}catch(e){qI(e)&&b(null),g(KI(e))}finally{m(!1)}}},T=async()=>{if(y){m(!0);try{await xI(y.id,`reject`),b(null),n()}catch(e){if(qI(e)){b(null),g(KI(e));return}g(KI(e))}finally{m(!1)}}};return(0,B.jsx)(ca,{open:e,onOpenChange:e=>!e&&!p?n():void 0,children:(0,B.jsxs)(ua,{className:`w-[420px] space-y-3 text-sm`,children:[(0,B.jsx)(da,{children:`登记临时服务`}),(0,B.jsx)(fa,{children:`选择当前项目中运行服务的终端并填写服务的监听端口。后端会核验监听是否属于该终端。`}),(0,B.jsx)(Ou,{message:h,onDismiss:()=>g(``)}),y?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(`p`,{className:`rounded-md border border-line bg-surface-2/60 p-2 text-[11px] text-ink-2`,children:`登记属于 L2 操作,需要审批。批准后会再次核验监听身份并登记。`}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,disabled:p,onClick:()=>void T(),children:`拒绝`}),(0,B.jsx)(V,{disabled:p,onClick:()=>void w(),children:`批准并登记`})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`block space-y-1`,children:[(0,B.jsx)(`span`,{className:`text-[11px] font-medium text-ink-2`,children:`运行中的终端`}),(0,B.jsx)(Fu,{label:`选择终端`,value:s,onValueChange:c,placeholder:`选择终端`,options:x.map(e=>({value:e.id,label:`${e.title??e.role??e.id.slice(-6)} · ${e.id.slice(-6)}`}))})]}),(0,B.jsxs)(`label`,{htmlFor:`${i}-name`,className:`block space-y-1`,children:[(0,B.jsx)(`span`,{className:`text-[11px] font-medium text-ink-2`,children:`服务名称`}),(0,B.jsx)(Mu,{id:`${i}-name`,"aria-label":`服务名称`,value:l,maxLength:80,onChange:e=>u(e.target.value),placeholder:`例如 web`})]}),(0,B.jsxs)(`label`,{htmlFor:`${i}-port`,className:`block space-y-1`,children:[(0,B.jsx)(`span`,{className:`text-[11px] font-medium text-ink-2`,children:`服务端口`}),(0,B.jsx)(Mu,{id:`${i}-port`,"aria-label":`服务端口`,value:d,inputMode:`numeric`,onChange:e=>f(e.target.value.replace(/[^0-9]/g,``)),placeholder:`例如 5173`,className:`font-mono`})]}),(0,B.jsx)(`p`,{className:`text-[10px] text-ink-3`,children:`填写所选终端中服务的实际监听端口。0.0.0.0 和 :: 等监听也可登记,无需改绑定或重启。`}),_?(0,B.jsx)(`p`,{role:`alert`,className:`text-[11px] text-danger`,children:_}):null,(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,disabled:p,onClick:n,children:`取消`}),(0,B.jsx)(V,{disabled:p,onClick:()=>void C(),children:`继续`})]})]})]})})}var rL=2,iL=1,aL=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(rL,Math.floor(u/e.css.cell.width)),rows:Math.max(iL,Math.floor(l/e.css.cell.height))}}},oL=Object.defineProperty,sL=Object.getOwnPropertyDescriptor,cL=(e,t)=>{for(var n in t)oL(e,n,{get:t[n],enumerable:!0})},lL=(e,t,n,r)=>{for(var i=r>1?void 0:r?sL(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&oL(t,n,i),i},X=(e,t)=>(n,r)=>t(n,r,e),uL=`Terminal input`,dL={get:()=>uL,set:e=>uL=e},fL=`Too much output to announce, navigate to rows manually to read`,pL={get:()=>fL,set:e=>fL=e};function mL(e){return e.replace(/\r?\n/g,`\r`)}function hL(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function gL(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function _L(e,t,n,r){e.stopPropagation(),e.clipboardData&&vL(e.clipboardData.getData(`text/plain`),t,n,r)}function vL(e,t,n,r){e=mL(e),e=hL(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function yL(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function bL(e,t,n,r,i){yL(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function xL(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function SL(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var CL=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},wL=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128||(c=(i&31)<<6|a&63,c<128)){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},TL=``,EL=` `,DL=class e{constructor(){this.fg=0,this.bg=0,this.extended=new OL}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},OL=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},kL=class e extends DL{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new OL,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?xL(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},AL=`di$target`,jL=`di$dependencies`,ML=new Map;function NL(e){return e[jL]||[]}function PL(e){if(ML.has(e))return ML.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);FL(t,e,r)};return t._id=e,ML.set(e,t),t}function FL(e,t,n){t[AL]===t?t[jL].push({id:e,index:n}):(t[jL]=[{id:e,index:n}],t[AL]=t)}var IL=PL(`BufferService`),LL=PL(`CoreMouseService`),RL=PL(`CoreService`),zL=PL(`CharsetService`),BL=PL(`InstantiationService`),VL=PL(`LogService`),HL=PL(`OptionsService`),UL=PL(`OscLinkService`),WL=PL(`UnicodeService`),GL=PL(`DecorationService`),KL=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new kL,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):qL(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};KL=lL([X(0,IL),X(1,HL),X(2,UL)],KL);function qL(e,t){if(confirm(`Do you want to navigate to ${t}?
113
-
114
- WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var JL=PL(`CharSizeService`),YL=PL(`CoreBrowserService`),XL=PL(`MouseService`),ZL=PL(`RenderService`),QL=PL(`SelectionService`),$L=PL(`CharacterJoinerService`),eR=PL(`ThemeService`),tR=PL(`LinkProviderService`),nR=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?cR.isErrorNoTelemetry(e)?new cR(e.message+`
115
-
116
- `+e.stack):Error(e.message+`
117
-
118
- `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function rR(e){aR(e)||nR.onUnexpectedError(e)}var iR=`Canceled`;function aR(e){return e instanceof oR||e instanceof Error&&e.name===iR&&e.message===iR}var oR=class extends Error{constructor(){super(iR),this.name=this.message}};function sR(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var cR=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},lR=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function uR(e,t=0){return e[e.length-(1+t)]}var dR;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(dR||={});var fR=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||dR.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};fR.empty=new fR(e=>{});function pR(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var mR;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(mR||={});var hR=null;function gR(e){return hR?.trackDisposable(e),e}function _R(e){hR?.markAsDisposed(e)}function vR(e,t){hR?.setParent(e,t)}function yR(e){return hR?.markAsSingleton(e),e}function bR(e){if(mR.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function xR(...e){return SR(()=>bR(e))}function SR(e){let t=gR({dispose:pR(()=>{_R(t),e()})});return t}var CR=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,gR(this)}dispose(){this._isDisposed||(_R(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{bR(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return vR(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),vR(e,null))}};CR.DISABLE_DISPOSED_WARNING=!1;var wR=CR,TR=class{constructor(){this._store=new wR,gR(this),vR(this._store,this)}dispose(){_R(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};TR.None=Object.freeze({dispose(){}});var ER=class{constructor(){this._isDisposed=!1,gR(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&vR(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,_R(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&vR(e,null),e}},DR=typeof window==`object`?window:globalThis,OR=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};OR.Undefined=new OR(void 0);var kR=OR,AR=class{constructor(){this._first=kR.Undefined,this._last=kR.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===kR.Undefined}clear(){let e=this._first;for(;e!==kR.Undefined;){let t=e.next;e.prev=kR.Undefined,e.next=kR.Undefined,e=t}this._first=kR.Undefined,this._last=kR.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new kR(e);if(this._first===kR.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==kR.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==kR.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==kR.Undefined&&e.next!==kR.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===kR.Undefined&&e.next===kR.Undefined?(this._first=kR.Undefined,this._last=kR.Undefined):e.next===kR.Undefined?(this._last=this._last.prev,this._last.next=kR.Undefined):e.prev===kR.Undefined&&(this._first=this._first.next,this._first.prev=kR.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==kR.Undefined;)yield e.element,e=e.next}},jR=globalThis.performance&&typeof globalThis.performance.now==`function`,MR=class e{static create(t){return new e(t)}constructor(e){this._now=jR&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},NR;(e=>{e.None=()=>TR.None;function t(e,t){return d(e,()=>{},0,void 0,!0,void 0,t)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(e,t,n){return l((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=r;function i(e,t,n){return l((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=i;function a(e,t,n){return l((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=a;function o(e){return e}e.signal=o;function s(...e){return(t,n=null,r)=>u(xR(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=s;function c(e,t,n,i){let a=n;return r(e,e=>(a=t(a,e),a),i)}e.reduce=c;function l(e,t){let n,r=new Z({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function u(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function d(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new Z({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=0,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=d;function f(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=f;function p(e,t=(e,t)=>e===t,n){let r=!0,i;return a(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=p;function m(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=m;function h(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new Z({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=h;function g(e,t){return(n,r,i)=>{let a=t(new v);return e(function(e){let t=a.evaluate(e);t!==_&&n.call(r,t)},void 0,i)}}e.chain=g;let _=Symbol(`HaltChainable`);class v{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:_),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:_}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===_)break;return e}}function y(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Z({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=y;function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Z({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=b;function x(e){return new Promise(t=>n(e)(t))}e.toPromise=x;function S(e){let t=new Z;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=S;function C(e,t){return e(e=>t.fire(e))}e.forward=C;function w(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=w;class T{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;let n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new Z(n),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function E(e,t){return new T(e,t).emitter.event}e.fromObservable=E;function D(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof wR?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=D})(NR||={});var PR=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new MR,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};PR.all=new Set,PR._idPool=0;var FR=PR,IR=-1,LR=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(i),console.warn(e);let a=new BR(i,e);this._errorHandler(a)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}};LR._idPool=1;var RR=LR,zR=class e{constructor(e){this.value=e}static create(){return new e(Error().stack??``)}print(){console.warn(this.value.split(`
119
- `).slice(2).join(`
120
- `))}},BR=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},VR=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},HR=0,UR=class{constructor(e){this.value=e,this.id=HR++}},WR=2,Z=class{constructor(e){this._size=0,this._options=e,this._leakageMon=IR>0||this._options?.leakWarningThreshold?new RR(e?.onListenerError??rR,this._options?.leakWarningThreshold??IR):void 0,this._perfMon=this._options?._profName?new FR(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new VR(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||rR)(n),TR.None}if(this._disposed)return TR.None;t&&(e=e.bind(t));let r=new UR(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=zR.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof UR?(this._deliveryQueue??=new GR,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=SR(()=>{i?.(),this._removeListener(r)});return n instanceof wR?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*WR<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||rR;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof UR)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},GR=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},KR=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Z,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Z,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};KR.INSTANCE=new KR;var qR=KR;function JR(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}qR.INSTANCE.onDidChangeZoomLevel;function YR(e){return qR.INSTANCE.getZoomFactor(e)}qR.INSTANCE.onDidChangeFullscreen;var XR=typeof navigator==`object`?navigator.userAgent:``,ZR=XR.indexOf(`Firefox`)>=0,QR=XR.indexOf(`AppleWebKit`)>=0,$R=XR.indexOf(`Chrome`)>=0,ez=!$R&&XR.indexOf(`Safari`)>=0;XR.indexOf(`Electron/`),XR.indexOf(`Android`);var tz=!1;if(typeof DR.matchMedia==`function`){let e=DR.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=DR.matchMedia(`(display-mode: fullscreen)`);tz=e.matches,JR(DR,e,({matches:e})=>{tz&&t.matches||(tz=e)})}function nz(){return tz}var rz=`en`,iz=!1,az=!1,oz=!1,sz=!1,cz=!1,lz=rz,uz,dz=globalThis,fz;typeof dz.vscode<`u`&&typeof dz.vscode.process<`u`?fz=dz.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(fz=process);var pz=typeof fz?.versions?.electron==`string`&&fz?.type===`renderer`;if(typeof fz==`object`){iz=fz.platform===`win32`,az=fz.platform===`darwin`,oz=fz.platform===`linux`,oz&&fz.env.SNAP&&fz.env.SNAP_REVISION,fz.env.CI||fz.env.BUILD_ARTIFACTSTAGINGDIRECTORY,lz=rz;let e=fz.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,lz=t.resolvedLanguage||rz,t.languagePack?.translationsConfigFile}catch{}sz=!0}else typeof navigator==`object`&&!pz?(uz=navigator.userAgent,iz=uz.indexOf(`Windows`)>=0,az=uz.indexOf(`Macintosh`)>=0,(uz.indexOf(`Macintosh`)>=0||uz.indexOf(`iPad`)>=0||uz.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,oz=uz.indexOf(`Linux`)>=0,uz?.indexOf(`Mobi`),cz=!0,lz=globalThis._VSCODE_NLS_LANGUAGE||rz,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var mz=iz,hz=az,gz=oz,_z=sz;cz&&typeof dz.importScripts==`function`&&dz.origin;var vz=uz,yz=lz,bz;(e=>{function t(){return yz}e.value=t;function n(){return yz.length===2?yz===`en`:yz.length>=3&&yz[0]===`e`&&yz[1]===`n`&&yz[2]===`-`}e.isDefaultVariant=n;function r(){return yz===`en`}e.isDefault=r})(bz||={});var xz=typeof dz.postMessage==`function`&&!dz.importScripts;(()=>{if(xz){let e=[];dz.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),dz.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var Sz=!!(vz&&vz.indexOf(`Chrome`)>=0);vz&&vz.indexOf(`Firefox`),!Sz&&vz&&vz.indexOf(`Safari`),vz&&vz.indexOf(`Edg/`),vz&&vz.indexOf(`Android`);var Cz=typeof navigator==`object`?navigator:{};_z||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||Cz&&Cz.clipboard&&Cz.clipboard.writeText,_z||Cz&&Cz.clipboard&&Cz.clipboard.readText,_z||nz()||Cz.keyboard,`ontouchstart`in DR||Cz.maxTouchPoints,DR.PointerEvent&&(`ontouchstart`in DR||navigator.maxTouchPoints);var wz=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Tz=new wz,Ez=new wz,Dz=new wz,Oz=Array(230),kz;(e=>{function t(e){return Tz.keyCodeToStr(e)}e.toString=t;function n(e){return Tz.strToKeyCode(e)}e.fromString=n;function r(e){return Ez.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return Dz.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Ez.strToKeyCode(e)||Dz.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return Tz.keyCodeToStr(e)}e.toElectronAccelerator=o})(kz||={});var Az=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new jz([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},jz=class{constructor(e){if(e.length===0)throw sR(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=`;`),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function Mz(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return kz.fromString(t)}let t=e.keyCode;if(t===3)return 7;if(ZR)switch(t){case 59:return 85;case 60:if(gz)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(hz)return 57}else if(QR&&(hz&&t===93||!hz&&t===92))return 57;return Oz[t]||0}var Nz=hz?256:2048,Pz=512,Fz=1024,Iz=hz?2048:256,Lz=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.(`AltGraph`),this.keyCode=Mz(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Nz),this.altKey&&(t|=Pz),this.shiftKey&&(t|=Fz),this.metaKey&&(t|=Iz),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Az(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Rz=new WeakMap;function zz(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!==`null`&&n.origin!==`null`&&t.origin!==n.origin)return null}catch{return null}return e.parent}var Bz=class{static getSameOriginWindowChain(e){let t=Rz.get(e);if(!t){t=[],Rz.set(e,t);let n=e,r;do r=zz(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(e);for(let e of i){let i=e.window.deref();if(n+=i?.scrollY??0,r+=i?.scrollX??0,i===t||!e.iframeElement)break;let a=e.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},Vz=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type===`dblclick`&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX==`number`?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=Bz.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Hz=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if($R){let e=navigator.userAgent.match(/Chrome\/(\d+)/);r=(e?parseInt(e[1]):123)<=122}if(e){let t=e,n=e,i=e.view?.devicePixelRatio||1;if(typeof t.wheelDeltaY<`u`)this.deltaY=r?t.wheelDeltaY/(120*i):t.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<`u`&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type===`wheel`){let t=e;this.deltaY=t.deltaMode===t.DOM_DELTA_LINE?ZR&&!hz?-e.deltaY/3:-e.deltaY:-e.deltaY/40}if(typeof t.wheelDeltaX<`u`)this.deltaX=ez&&mz?-(t.wheelDeltaX/120):r?t.wheelDeltaX/(120*i):t.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<`u`&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type===`wheel`){let t=e;this.deltaX=t.deltaMode===t.DOM_DELTA_LINE?ZR&&!hz?-e.deltaX/3:-e.deltaX:-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=r?e.wheelDelta/(120*i):e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},Uz=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),Wz;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof Gz?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:NR.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Uz})})(Wz||={});var Gz=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Uz:(this._emitter||=new Z,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},Kz=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new lR(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new lR(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},qz=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new lR(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=SR(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Jz;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Jz||={});var Yz=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Z,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await NR.toPromise(this._onStateChanged.event)}while(1)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Yz.EMPTY=Yz.fromArray([]);function Xz(e){return Zz(e,0)}function Zz(e,t){switch(typeof e){case`object`:return e===null?Qz(349,t):Array.isArray(e)?tB(e,t):nB(e,t);case`string`:return eB(e,t);case`boolean`:return $z(e,t);case`number`:return Qz(e,t);case`undefined`:return Qz(937,t);default:return Qz(617,t)}}function Qz(e,t){return(t<<5)-t+e|0}function $z(e,t){return Qz(e?433:863,t)}function eB(e,t){t=Qz(149417,t);for(let n=0,r=e.length;n<r;n++)t=Qz(e.charCodeAt(n),t);return t}function tB(e,t){return t=Qz(104579,t),e.reduce((e,t)=>Zz(t,e),t)}function nB(e,t){return t=Qz(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=eB(n,t),Zz(e[n],t)),t)}var{registerWindow:rB,getWindow:iB,getDocument:aB,getWindows:oB,getWindowsCount:sB,getWindowId:cB,getWindowById:lB,hasWindow:uB,onDidRegisterWindow:dB,onWillUnregisterWindow:fB,onDidUnregisterWindow:pB}=function(){let e=new Map,t={window:DR,disposables:new wR};e.set(DR.vscodeWindowId,t);let n=new Z,r=new Z,i=new Z;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return TR.None;let a=new wR,o={window:t,disposables:a.add(new wR)};return e.set(t.vscodeWindowId,o),a.add(SR(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(hB(t,wB.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:DR},getDocument(e){return iB(e).document}}}(),mB=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function hB(e,t,n,r){return new mB(e,t,n,r)}function gB(e,t){return function(n){return t(new Vz(e,n))}}function _B(e){return function(t){return e(new Lz(t))}}var vB=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=gB(iB(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=_B(n)),hB(e,t,i,r)},yB,bB=class extends qz{constructor(e){super(),this.defaultTarget=e&&iB(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},xB=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){rR(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(xB.sort),a.shift().execute();r.set(i,!1)};yB=(t,r,a=0)=>{let o=cB(t),s=new xB(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s}})();var SB=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};SB.None=new SB(0,0);function CB(e){let t=e.getBoundingClientRect(),n=iB(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Xz(n),a=r.get(i);if(a)a.users+=1;else{let o=new Z,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(SR(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var wB={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:QR?`webkitAnimationStart`:`animationstart`,ANIMATION_END:QR?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:QR?`webkitAnimationIteration`:`animationiteration`},TB=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingTop=``,this._paddingLeft=``,this._paddingBottom=``,this._paddingRight=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=EB(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=EB(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=EB(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=EB(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=EB(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=EB(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=EB(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=EB(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=EB(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=EB(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=EB(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=EB(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=EB(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=EB(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function EB(e){return typeof e==`number`?`${e}px`:e}function DB(e){return new TB(e)}var OB=class{constructor(){this._hooks=new wR,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(SR(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=iB(e)}this._hooks.add(hB(a,wB.POINTER_MOVE,e=>{e.buttons===n?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)})),this._hooks.add(hB(a,wB.POINTER_UP,e=>this.stopMonitoring(!0)))}};function kB(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var AB;(e=>(e.Tap=`-xterm-gesturetap`,e.Change=`-xterm-gesturechange`,e.Start=`-xterm-gesturestart`,e.End=`-xterm-gesturesend`,e.Contextmenu=`-xterm-gesturecontextmenu`))(AB||={});var jB=class e extends TR{constructor(){super(),this.dispatched=!1,this.targets=new AR,this.ignoreTargets=new AR,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(NR.runAndSubscribe(dB,({window:e,disposables:t})=>{t.add(hB(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(hB(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(hB(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:DR,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=yR(new e),SR(e.INSTANCE.targets.push(t))):TR.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=yR(new e),SR(e.INSTANCE.ignoreTargets.push(t))):TR.None}static isTouchDevice(){return`ontouchstart`in DR||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this.newGestureEvent(AB.Start,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this.dispatchEvent(i)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this.activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e.HOLD_DELAY&&Math.abs(s.initialPageX-uR(s.rollingPageX))<30&&Math.abs(s.initialPageY-uR(s.rollingPageY))<30){let e=this.newGestureEvent(AB.Tap,s.initialTarget);e.pageX=uR(s.rollingPageX),e.pageY=uR(s.rollingPageY),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&Math.abs(s.initialPageX-uR(s.rollingPageX))<30&&Math.abs(s.initialPageY-uR(s.rollingPageY))<30){let e=this.newGestureEvent(AB.Contextmenu,s.initialTarget);e.pageX=uR(s.rollingPageX),e.pageY=uR(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=uR(s.rollingPageX),n=uR(s.rollingPageY),i=uR(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(AB.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===AB.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===AB.Change||t.type===AB.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=yB(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(AB.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this.activeTouches[r.identifier],a=this.newGestureEvent(AB.Change,i.initialTarget);a.translationX=r.pageX-uR(i.rollingPageX),a.translationY=r.pageY-uR(i.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};jB.SCROLL_FRICTION=-.005,jB.HOLD_DELAY=700,jB.CLEAR_TAP_COUNT_TIME=400,lL([kB],jB,`isTouchDevice`,1);var MB=jB,NB=class extends TR{onclick(e,t){this._register(hB(e,wB.CLICK,n=>t(new Vz(iB(e),n))))}onmousedown(e,t){this._register(hB(e,wB.MOUSE_DOWN,n=>t(new Vz(iB(e),n))))}onmouseover(e,t){this._register(hB(e,wB.MOUSE_OVER,n=>t(new Vz(iB(e),n))))}onmouseleave(e,t){this._register(hB(e,wB.MOUSE_LEAVE,n=>t(new Vz(iB(e),n))))}onkeydown(e,t){this._register(hB(e,wB.KEY_DOWN,e=>t(new Lz(e))))}onkeyup(e,t){this._register(hB(e,wB.KEY_UP,e=>t(new Lz(e))))}oninput(e,t){this._register(hB(e,wB.INPUT,t))}onblur(e,t){this._register(hB(e,wB.BLUR,t))}onfocus(e,t){this._register(hB(e,wB.FOCUS,t))}onchange(e,t){this._register(hB(e,wB.CHANGE,t))}ignoreGesture(e){return MB.ignoreTarget(e)}},PB=11,FB=class extends NB{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`,this.domNode.style.width=PB+`px`,this.domNode.style.height=PB+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new OB),this._register(vB(this.bgDomNode,wB.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(vB(this.domNode,wB.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new bB),this._pointerdownScheduleRepeatTimer=this._register(new Kz)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,iB(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},IB=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},LB=class extends TR{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Z),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new IB(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new VB(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=VB.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},RB=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function zB(e,t){let n=t-e;return function(t){return e+n*UB(t)}}function BB(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var VB=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),BB(zB(e,r),zB(i,t),.33)}return zB(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new RB(this.scrollLeft(t),this.scrollTop(t),!1):new RB(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return e.start(t,n,r)}static start(t,n,r){r+=10;let i=Date.now()-10;return new e(t,n,i,r)}};function HB(e){return e**3}function UB(e){return 1-HB(1-e)}var WB=class extends TR{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Kz)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3||this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},GB=140,KB=class extends NB{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new WB(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new OB),this._shouldRender=!0,this.domNode=DB(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(hB(this.domNode.domNode,wB.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new FB(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=DB(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(hB(this.slider.domNode,wB.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=CB(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(mz&&a>GB){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},qB=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},JB=class extends KB{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new qB(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},YB=class extends KB{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new qB(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`vertical`,scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},XB=500,ZB=50,QB=!0,$B=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},eV=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;do{let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(1);return t<=.5}acceptStandardWheelEvent(e){if($R){let t=YR(iB(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new $B(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if(this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};eV.INSTANCE=new eV;var tV=eV,nV=class extends NB{constructor(e,t,n){super(),this._onScroll=this._register(new Z),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Z),this.onWillScroll=this._onWillScroll.event,this._options=iV(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new YB(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new JB(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=DB(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=DB(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=DB(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new Kz),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=bR(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,hz&&(this._options.className+=` mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Hz(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=bR(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(hB(this._listenOnDomNode,wB.MOUSE_WHEEL,e=>{this._onMouseWheel(new Hz(e))},{passive:!1}))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=tV.INSTANCE;QB&&t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!hz&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=ZB*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=ZB*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(QB&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),XB)}},rV=class extends nV{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function iV(e){let t={lazyRender:typeof e.lazyRender<`u`&&e.lazyRender,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`&&e.alwaysConsumeMouseWheel,scrollYToX:typeof e.scrollYToX<`u`&&e.scrollYToX,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<`u`?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`&&e.horizontalHasArrows,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`&&e.verticalHasArrows,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`&&e.scrollByPage};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,hz&&(t.className+=` mac`),t}var aV=class extends TR{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new Z),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new LB({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>yB(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new rV(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`overviewRuler`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(NR.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(SR(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(SR(()=>this._styleElement.remove())),this._register(NR.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .scrollbar > .slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider.active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(`
121
- `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};aV=lL([X(2,IL),X(3,YL),X(4,LL),X(5,eR),X(6,HL),X(7,ZL)],aV);var oV=class extends TR{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(SR(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:``:t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};oV=lL([X(1,IL),X(2,YL),X(3,GL),X(4,ZL)],oV);var sV=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},cV={full:0,left:0,center:0,right:0},lV={full:0,left:0,center:0,right:0},uV={full:0,left:0,center:0,right:0},dV=class extends TR{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new sV,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(SR(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`overviewRuler`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);lV.full=this._canvas.width,lV.left=e,lV.center=t,lV.right=e,this._refreshDrawHeightConstants(),uV.full=1,uV.left=1,uV.center=1+lV.left,uV.right=1+lV.left+lV.center}_refreshDrawHeightConstants(){cV.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);cV.left=t,cV.center=t,cV.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*cV.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*cV.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*cV.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*cV.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(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(uV[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-cV[e.position||`full`]/2),lV[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+cV[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};dV=lL([X(2,IL),X(3,GL),X(4,ZL),X(5,HL),X(6,eR),X(7,YL)],dV);var Q;(e=>(e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
122
- `,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))(Q||={});var fV;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(fV||={});var pV;(e=>e.ST=`${Q.ESC}\\`)(pV||={});var mV=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${Q.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};mV=lL([X(2,IL),X(3,HL),X(4,RL),X(5,ZL)],mV);var hV=0,gV=0,_V=0,vV=0,yV={css:`#00000000`,rgba:0},bV;(e=>{function t(e,t,n,r){return r===void 0?`#${TV(e)}${TV(t)}${TV(n)}`:`#${TV(e)}${TV(t)}${TV(n)}${TV(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(bV||={});var xV;(e=>{function t(e,t){if(vV=(t.rgba&255)/255,vV===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return hV=a+Math.round((n-a)*vV),gV=o+Math.round((r-o)*vV),_V=s+Math.round((i-s)*vV),{css:bV.toCss(hV,gV,_V),rgba:bV.toRgba(hV,gV,_V)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=wV.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return bV.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[hV,gV,_V]=wV.toChannels(t),{css:bV.toCss(hV,gV,_V),rgba:t}}e.opaque=i;function a(e,t){return vV=Math.round(t*255),[hV,gV,_V]=wV.toChannels(e.rgba),{css:bV.toCss(hV,gV,_V,vV),rgba:bV.toRgba(hV,gV,_V,vV)}}e.opacity=a;function o(e,t){return vV=e.rgba&255,a(e,vV*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(xV||={});var SV;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return hV=parseInt(e.slice(1,2).repeat(2),16),gV=parseInt(e.slice(2,3).repeat(2),16),_V=parseInt(e.slice(3,4).repeat(2),16),bV.toColor(hV,gV,_V);case 5:return hV=parseInt(e.slice(1,2).repeat(2),16),gV=parseInt(e.slice(2,3).repeat(2),16),_V=parseInt(e.slice(3,4).repeat(2),16),vV=parseInt(e.slice(4,5).repeat(2),16),bV.toColor(hV,gV,_V,vV);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return hV=parseInt(r[1]),gV=parseInt(r[2]),_V=parseInt(r[3]),vV=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),bV.toColor(hV,gV,_V,vV);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[hV,gV,_V,vV]=t.getImageData(0,0,1,1).data,vV!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:bV.toRgba(hV,gV,_V,vV),css:e}}e.toColor=r})(SV||={});var CV;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(CV||={});var wV;(e=>{function t(e,t){if(vV=(t&255)/255,vV===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return hV=a+Math.round((n-a)*vV),gV=o+Math.round((r-o)*vV),_V=s+Math.round((i-s)*vV),bV.toRgba(hV,gV,_V)}e.blend=t;function n(e,t,n){let a=CV.relativeLuminance(e>>8),o=CV.relativeLuminance(t>>8);if(EV(a,o)<n){if(o<a){let o=r(e,t,n),s=EV(a,CV.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>EV(a,CV.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=EV(a,CV.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>EV(a,CV.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=EV(CV.relativeLuminance2(o,s,c),CV.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=EV(CV.relativeLuminance2(o,s,c),CV.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=EV(CV.relativeLuminance2(o,s,c),CV.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=EV(CV.relativeLuminance2(o,s,c),CV.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(wV||={});function TV(e){let t=e.toString(16);return t.length<2?`0`+t:t}function EV(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var DV=class extends DL{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},OV=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new kL}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,o=0,s=t.getFg(0),c=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==s||this._workCell.bg!==c){if(e-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,o=a,s=this._workCell.fg,c=this._workCell.bg}a+=this._workCell.getChars().length||EL.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(e,t,n,r,i){let a=e.substring(t,n),o=[];try{o=this._characterJoiners[0].handler(a)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(a);for(let e=0;e<t.length;e++)OV._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,o=e[r];if(o){for(let s=n;s<this._bufferService.cols;s++){let n=t.getWidth(s),c=t.getString(s).length||EL.length;if(n!==0){if(!i&&o[0]<=a&&(o[0]=s,i=!0),o[1]<=a){if(o[1]=s,o=e[++r],!o)break;o[0]<=a?(o[0]=s,i=!0):i=!1}a+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};OV=lL([X(0,IL)],OV);function kV(e){return 57508<=e&&e<=57558}function AV(e){return 9472<=e&&e<=9631}function jV(e){return kV(e)||AV(e)}function MV(){return{css:{canvas:NV(),cell:NV()},device:{canvas:NV(),cell:NV(),char:{width:0,height:0,left:0,top:0}}}}function NV(){return{width:0,height:0}}var PV=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new kL,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,a,o,s,c,l,u){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();n&&m<a+1&&(m=a+1);let h,g=0,_=``,v=0,y=0,b=0,x=0,S=!1,C=0,w=!1,T=0,E=0,D=[],O=l!==-1&&u!==-1;for(let k=0;k<m;k++){e.loadCell(k,this._workCell);let m=this._workCell.getWidth();if(m===0)continue;let A=!1,j=k>=E,M=k,N=this._workCell;if(f.length>0&&k===f[0][0]&&j){let r=f.shift(),i=this._isCellInSelection(r[0],t);for(v=r[0]+1;v<r[1];v++)j&&=i===this._isCellInSelection(v,t);j&&=!n||a<r[0]||a>=r[1],j?(A=!0,N=new DV(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),M=r[1]-1,m=N.getWidth()):E=r[1]}let ee=this._isCellInSelection(k,t),te=n&&k===a,P=O&&k>=l&&k<=u,ne=!1;this._decorationService.forEachDecorationAtCell(k,t,void 0,e=>{ne=!0});let F=N.getChars()||EL;if(F===` `&&(N.isUnderline()||N.isOverline())&&(F=`\xA0`),T=m*s-c.get(F,N.isBold(),N.isItalic()),!h)h=this._document.createElement(`span`);else if(g&&(ee&&w||!ee&&!w&&N.bg===y)&&(ee&&w&&p.selectionForeground||N.fg===b)&&N.extended.ext===x&&P===S&&T===C&&!te&&!A&&!ne&&j){N.isInvisible()?_+=EL:_+=F,g++;continue}else g&&(h.textContent=_),h=this._document.createElement(`span`),g=0,_=``;if(y=N.bg,b=N.fg,x=N.extended.ext,S=P,C=T,w=ee,A&&a>=k&&a<=M&&(a=k),!this._coreService.isCursorHidden&&te&&this._coreService.isCursorInitialized){if(D.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&D.push(`xterm-cursor-blink`),D.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:D.push(`xterm-cursor-outline`);break;case`block`:D.push(`xterm-cursor-block`);break;case`bar`:D.push(`xterm-cursor-bar`);break;case`underline`:D.push(`xterm-cursor-underline`)}}if(N.isBold()&&D.push(`xterm-bold`),N.isItalic()&&D.push(`xterm-italic`),N.isDim()&&D.push(`xterm-dim`),_=N.isInvisible()?EL:N.getChars()||EL,N.isUnderline()&&(D.push(`xterm-underline-${N.extended.underlineStyle}`),_===` `&&(_=`\xA0`),!N.isUnderlineColorDefault())){if(N.isUnderlineColorRGB())h.style.textDecorationColor=`rgb(${DL.toColorRGB(N.getUnderlineColor()).join(`,`)})`;else{let e=N.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&N.isBold()&&e<8&&(e+=8),h.style.textDecorationColor=p.ansi[e].css}}N.isOverline()&&(D.push(`xterm-overline`),_===` `&&(_=`\xA0`)),N.isStrikethrough()&&D.push(`xterm-strikethrough`),P&&(h.style.textDecoration=`underline`);let re=N.getFgColor(),ie=N.getFgColorMode(),ae=N.getBgColor(),oe=N.getBgColorMode(),se=!!N.isInverse();if(se){let e=re;re=ae,ae=e;let t=ie;ie=oe,oe=t}let ce,le,ue=!1;this._decorationService.forEachDecorationAtCell(k,t,void 0,e=>{e.options.layer!==`top`&&ue||(e.backgroundColorRGB&&(oe=50331648,ae=e.backgroundColorRGB.rgba>>8&16777215,ce=e.backgroundColorRGB),e.foregroundColorRGB&&(ie=50331648,re=e.foregroundColorRGB.rgba>>8&16777215,le=e.foregroundColorRGB),ue=e.options.layer===`top`)}),!ue&&ee&&(ce=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,ae=ce.rgba>>8&16777215,oe=50331648,ue=!0,p.selectionForeground&&(ie=50331648,re=p.selectionForeground.rgba>>8&16777215,le=p.selectionForeground)),ue&&D.push(`xterm-decoration-top`);let de;switch(oe){case 16777216:case 33554432:de=p.ansi[ae],D.push(`xterm-bg-${ae}`);break;case 50331648:de=bV.toColor(ae>>16,ae>>8&255,ae&255),this._addStyle(h,`background-color:#${FV((ae>>>0).toString(16),`0`,6)}`);break;default:se?(de=p.foreground,D.push(`xterm-bg-257`)):de=p.background}switch(ce||N.isDim()&&(ce=xV.multiplyOpacity(de,.5)),ie){case 16777216:case 33554432:N.isBold()&&re<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(re+=8),this._applyMinimumContrast(h,de,p.ansi[re],N,ce,void 0)||D.push(`xterm-fg-${re}`);break;case 50331648:let e=bV.toColor(re>>16&255,re>>8&255,re&255);this._applyMinimumContrast(h,de,e,N,ce,le)||this._addStyle(h,`color:#${FV(re.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(h,de,p.foreground,N,ce,le)||se&&D.push(`xterm-fg-257`)}D.length&&=(h.className=D.join(` `),0),!te&&!A&&!ne&&j?g++:h.textContent=_,T!==this.defaultSpacing&&(h.style.letterSpacing=`${T}px`),d.push(h),k=M}return h&&g&&(h.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||jV(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(!i&&!a&&(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=xV.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return s?(this._addStyle(e,`color:${s.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};PV=lL([X(1,$L),X(2,HL),X(3,YL),X(4,RL),X(5,GL),X(6,eR)],PV);function FV(e,t,n){for(;e.length<n;)e=t+e;return e}var IV=class{constructor(e,t){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.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`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.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(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},LV=class{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(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);s>=e.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0])}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function RV(){return new LV}var zV=`xterm-dom-renderer-owner-`,BV=`xterm-rows`,VV=`xterm-fg-`,HV=`xterm-bg-`,UV=`xterm-focus`,WV=`xterm-selection`,GV=1,KV=class extends TR{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=GV++,this._rowElements=[],this._selectionRenderModel=RV(),this.onRequestRedraw=this._register(new Z).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(BV),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(WV),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=MV(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=s.createInstance(PV,document),this._element.classList.add(zV+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._register(SR(()=>{this._element.classList.remove(zV+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new IV(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${BV} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${BV} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${BV} .xterm-dim { color: ${xV.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${BV}.${UV} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${BV}.${UV} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${BV}.${UV} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${BV} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${BV} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${BV} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${BV} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${BV} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${WV} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${WV} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${WV} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${VV}${n} { color: ${r.css}; }${this._terminalSelector} .${VV}${n}.xterm-dim { color: ${xV.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${HV}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${VV}257 { color: ${xV.opaque(e.background).css}; }${this._terminalSelector} .${VV}257.xterm-dim { color: ${xV.multiplyOpacity(xV.opaque(e.background),.5).css}; }${this._terminalSelector} .${HV}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(UV),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(UV),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${zV}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};KV=lL([X(7,BL),X(8,JL),X(9,HL),X(10,IL),X(11,RL),X(12,YL),X(13,eR)],KV);var qV=class extends TR{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Z),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new XV(this._optionsService))}catch{this._measureStrategy=this._register(new YV(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};qV=lL([X(2,HL)],qV);var JV=class extends TR{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},YV=class extends JV{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,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}},XV=class extends JV{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},ZV=class extends TR{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new QV(this._window)),this._onDprChange=this._register(new Z),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Z),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(NR.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(hB(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(hB(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},QV=class extends TR{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ER),this._onDprChange=this._register(new Z),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(SR(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=hB(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},$V=class extends TR{constructor(){super(),this.linkProviders=[],this._register(SR(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function eH(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}function tH(e,t,n,r,i,a,o,s,c){if(!a)return;let l=eH(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+ +!!c),l[1]=Math.min(Math.max(l[1],1),i),l}var nH=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return tH(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=eH(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};nH=lL([X(0,ZL),X(1,JL)],nH);var rH=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},iH={};cL(iH,{getSafariVersion:()=>dH,isChromeOS:()=>_H,isFirefox:()=>cH,isIpad:()=>pH,isIphone:()=>mH,isLegacyEdge:()=>lH,isLinux:()=>gH,isMac:()=>fH,isNode:()=>aH,isSafari:()=>uH,isWindows:()=>hH});var aH=typeof process<`u`&&`title`in process,oH=aH?`node`:navigator.userAgent,sH=aH?`node`:navigator.platform,cH=oH.includes(`Firefox`),lH=oH.includes(`Edge`),uH=/^((?!chrome|android).)*safari/i.test(oH);function dH(){if(!uH)return 0;let e=oH.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var fH=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(sH),pH=sH===`iPad`,mH=sH===`iPhone`,hH=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(sH),gH=sH.indexOf(`Linux`)>=0,_H=/\bCrOS\b/.test(oH),vH=class{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),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},yH=class extends vH{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},bH=class extends vH{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},xH=!aH&&`requestIdleCallback`in window?bH:yH,SH=class{constructor(){this._queue=new xH}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},CH=class extends TR{constructor(e,t,n,r,i,a,o,s,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=s,this._renderer=this._register(new ER),this._pausedResizeTask=new SH,this._observerDisposable=this._register(new ER),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 Z),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Z),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Z),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Z),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new rH((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new wH(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(SR(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=SR(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};CH=lL([X(2,HL),X(3,JL),X(4,RL),X(5,GL),X(6,IL),X(7,YL),X(8,eR)],CH);var wH=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function TH(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return OH(i,a,e,t,n,r)+kH(a,t,n,r)+AH(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,LH(Math.abs(i-e),IH(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return LH(DH(a>t?e:i,n)+(s-1)*n.cols+1+EH(a>t?i:e,n),IH(o,r))}function EH(e,t){return e-1}function DH(e,t){return t.cols-e}function OH(e,t,n,r,i,a){return kH(t,r,i,a).length===0?``:LH(FH(e,t,e,t-MH(t,i),!1,i).length,IH(`D`,a))}function kH(e,t,n,r){let i=e-MH(e,n),a=t-MH(t,n);return LH(Math.abs(i-a)-jH(e,t,n),IH(PH(e,t),r))}function AH(e,t,n,r,i,a){let o;o=kH(t,r,i,a).length>0?r-MH(r,i):t;let s=r,c=NH(e,t,n,r,i,a);return LH(FH(e,o,n,s,c===`C`,i).length,IH(c,a))}function jH(e,t,n){let r=0,i=e-MH(e,n),a=t-MH(t,n);for(let o=0;o<Math.abs(i-a);o++){let a=PH(e,t)===`A`?-1:1;n.buffer.lines.get(i+a*o)?.isWrapped&&r++}return r}function MH(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function NH(e,t,n,r,i,a){let o;return o=kH(n,r,i,a).length>0?r-MH(r,i):t,e<n&&o<=r||e>=n&&o<r?`C`:`D`}function PH(e,t){return e>t?`A`:`B`}function FH(e,t,n,r,i,a){let o=e,s=t,c=``;for(;(o!==n||s!==r)&&s>=0&&s<a.buffer.lines.length;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function IH(e,t){let n=t?`O`:`[`;return Q.ESC+n+e}function LH(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}var RH=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function zH(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var BH=50,VH=15,HH=50,UH=500,WH=RegExp(`\xA0`,`g`),GH=class extends TR{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new kL,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Z),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Z),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Z),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Z),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new RH(this._bufferService),this._activeSelectionMode=0,this._register(SR(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map(e=>e.replace(WH,` `)).join(hH?`\r
123
- `:`
124
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),gH&&e&&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(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=zH(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=eH(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-BH),BH),t/=BH,t/Math.abs(t)+Math.round(t*(VH-1)))}shouldForceSelection(e){return fH?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),HH)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(fH&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<UH&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=TH(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);n?!e||!t||this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,n):this._oldHasSelection&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(t||o.slice(s,c).trim()!==``){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=zH(n,this._bufferService.cols)}};GH=lL([X(3,IL),X(4,RL),X(5,XL),X(6,HL),X(7,ZL),X(8,YL)],GH);var KH=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},qH=class{constructor(){this._color=new KH,this._css=new KH}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},JH=Object.freeze((()=>{let e=[SV.toColor(`#2e3436`),SV.toColor(`#cc0000`),SV.toColor(`#4e9a06`),SV.toColor(`#c4a000`),SV.toColor(`#3465a4`),SV.toColor(`#75507b`),SV.toColor(`#06989a`),SV.toColor(`#d3d7cf`),SV.toColor(`#555753`),SV.toColor(`#ef2929`),SV.toColor(`#8ae234`),SV.toColor(`#fce94f`),SV.toColor(`#729fcf`),SV.toColor(`#ad7fa8`),SV.toColor(`#34e2e2`),SV.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:bV.toCss(r,i,a),rgba:bV.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:bV.toCss(n,n,n),rgba:bV.toRgba(n,n,n)})}return e})()),YH=SV.toColor(`#ffffff`),XH=SV.toColor(`#000000`),ZH=SV.toColor(`#ffffff`),QH=XH,$H={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117},eU=YH,tU=class extends TR{constructor(e){super(),this._optionsService=e,this._contrastCache=new qH,this._halfContrastCache=new qH,this._onChangeColors=this._register(new Z),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:YH,background:XH,cursor:ZH,cursorAccent:QH,selectionForeground:void 0,selectionBackgroundTransparent:$H,selectionBackgroundOpaque:xV.blend(XH,$H),selectionInactiveBackgroundTransparent:$H,selectionInactiveBackgroundOpaque:xV.blend(XH,$H),scrollbarSliderBackground:xV.opacity(YH,.2),scrollbarSliderHoverBackground:xV.opacity(YH,.4),scrollbarSliderActiveBackground:xV.opacity(YH,.5),overviewRulerBorder:YH,ansi:JH.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=nU(e.foreground,YH),t.background=nU(e.background,XH),t.cursor=xV.blend(t.background,nU(e.cursor,ZH)),t.cursorAccent=xV.blend(t.background,nU(e.cursorAccent,QH)),t.selectionBackgroundTransparent=nU(e.selectionBackground,$H),t.selectionBackgroundOpaque=xV.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=nU(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=xV.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?nU(e.selectionForeground,yV):void 0,t.selectionForeground===yV&&(t.selectionForeground=void 0),xV.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=xV.opacity(t.selectionBackgroundTransparent,.3)),xV.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=xV.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=nU(e.scrollbarSliderBackground,xV.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=nU(e.scrollbarSliderHoverBackground,xV.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=nU(e.scrollbarSliderActiveBackground,xV.opacity(t.foreground,.5)),t.overviewRulerBorder=nU(e.overviewRulerBorder,eU),t.ansi=JH.slice(),t.ansi[0]=nU(e.black,JH[0]),t.ansi[1]=nU(e.red,JH[1]),t.ansi[2]=nU(e.green,JH[2]),t.ansi[3]=nU(e.yellow,JH[3]),t.ansi[4]=nU(e.blue,JH[4]),t.ansi[5]=nU(e.magenta,JH[5]),t.ansi[6]=nU(e.cyan,JH[6]),t.ansi[7]=nU(e.white,JH[7]),t.ansi[8]=nU(e.brightBlack,JH[8]),t.ansi[9]=nU(e.brightRed,JH[9]),t.ansi[10]=nU(e.brightGreen,JH[10]),t.ansi[11]=nU(e.brightYellow,JH[11]),t.ansi[12]=nU(e.brightBlue,JH[12]),t.ansi[13]=nU(e.brightMagenta,JH[13]),t.ansi[14]=nU(e.brightCyan,JH[14]),t.ansi[15]=nU(e.brightWhite,JH[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=nU(e.extendedAnsi[r],JH[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0)for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];else switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};tU=lL([X(0,HL)],tU);function nU(e,t){if(e!==void 0)try{return SV.toColor(e)}catch{}return t}var rU=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},iU=class{constructor(){this._services=new rU,this._services.set(BL,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=NL(e).sort((e,t)=>e.index-t.index),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id._id}.`);r.push(n)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},aU={trace:0,debug:1,info:2,warn:3,error:4,off:5},oU=`xterm.js: `,sU=class extends TR{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),cU=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=aU[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:oU)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};sU=lL([X(0,HL)],sU);var cU,lU=class extends TR{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Z),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Z),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Z),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}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 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,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},uU=3,dU=Object.freeze(new DL),fU=0,pU=2,mU=class e{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*uU);let r=t||kL.fromCharData([0,TL,1,0]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[e*uU+0],n=t&2097151;return[this._data[e*uU+1],t&2097152?this._combined[e]:n?xL(n):``,t>>22,t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[e*uU+1]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*uU+0]=e|2097152|t[2]<<22):this._data[e*uU+0]=t[1].charCodeAt(0)|t[2]<<22}getWidth(e){return this._data[e*uU+0]>>22}hasWidth(e){return this._data[e*uU+0]&12582912}getFg(e){return this._data[e*uU+1]}getBg(e){return this._data[e*uU+2]}hasContent(e){return this._data[e*uU+0]&4194303}getCodePoint(e){let t=this._data[e*uU+0];return t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):t&2097151}isCombined(e){return this._data[e*uU+0]&2097152}getString(e){let t=this._data[e*uU+0];return t&2097152?this._combined[e]:t&2097151?xL(t&2097151):``}isProtected(e){return this._data[e*uU+2]&536870912}loadCell(e,t){return fU=e*uU,t.content=this._data[fU+0],t.fg=this._data[fU+1],t.bg=this._data[fU+2],t.content&2097152&&(t.combinedData=this._combined[e]),t.bg&268435456&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){t.content&2097152&&(this._combined[e]=t.combinedData),t.bg&268435456&&(this._extendedAttrs[e]=t.extended),this._data[e*uU+0]=t.content,this._data[e*uU+1]=t.fg,this._data[e*uU+2]=t.bg}setCellFromCodepoint(e,t,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*uU+0]=t|n<<22,this._data[e*uU+1]=r.fg,this._data[e*uU+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[e*uU+0];r&2097152?this._combined[e]+=xL(t):r&2097151?(this._combined[e]=xL(r&2097151)+xL(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*uU+0]=r}insertCells(e,t,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length-e){let r=new kL;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,t,n){if(e%=this.length,t<this.length-e){let r=new kL;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,t,n,r=!1){if(r)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return this._data.length*4*pU<this._data.buffer.byteLength;let n=e*uU;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,n*4*pU<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*pU<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let t=new e(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let e in this._combined)t._combined[e]=this._combined[e];for(let e in this._extendedAttrs)t._extendedAttrs[e]=this._extendedAttrs[e];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*uU+0]&4194303)return e+(this._data[e*uU+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*uU+0]&4194303||this._data[e*uU+2]&50331648)return e+(this._data[e*uU+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<uU;e++)this._data[(n+i)*uU+e]=a[(t+i)*uU+e];a[(t+i)*uU+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<uU;e++)this._data[(n+i)*uU+e]=a[(t+i)*uU+e];a[(t+i)*uU+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t<n;){let e=this._data[t*uU+0],n=e&2097151,a=e&2097152?this._combined[t]:n?xL(n):EL;if(i+=a,r)for(let e=0;e<a.length;++e)r.push(t);t+=e>>22||1}return r&&r.push(t),i}};function hU(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(!a&&r>=s&&r<c){s+=u.length-1;continue}let d=0,f=yU(u,d,t),p=1,m=0;for(;p<u.length;){let e=yU(u,p,t),r=e-m,a=n-f,o=Math.min(r,a);u[d].copyCellsFrom(u[p],m,f,o,!1),f+=o,f===n&&(d++,f=0),m+=o,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(n-1)===2&&(u[d].copyCellsFrom(u[d-1],n-1,f++,1,!1),u[d-1].setCell(n-1,i))}u[d].replaceCells(f,n,i);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o}function gU(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}}function _U(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length}function vU(e,t,n){let r=[],i=e.map((n,r)=>yU(e,r,t)).reduce((e,t)=>e+t),a=0,o=0,s=0;for(;s<i;){if(i-s<n){r.push(i-s);break}a+=n;let c=yU(e,o,t);a>c&&(a-=c,o++);let l=e[o].getWidth(a-1)===2;l&&a--;let u=l?n-1:n;r.push(u),s+=u}return r}function yU(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var bU=class e{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new Z),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),bR(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};bU._nextId=1;var xU=bU,SU={},CU=SU.B;SU[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:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},SU.A={"#":`£`},SU.B=void 0,SU[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},SU.C=SU[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},SU.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},SU.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},SU.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},SU.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},SU.E=SU[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},SU.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},SU.H=SU[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},SU[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`};var wU=4294967295,TU=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=dU.clone(),this.savedCharset=CU,this.markers=[],this._nullCell=kL.fromCharData([0,TL,1,0]),this._whitespaceCell=kL.fromCharData([0,EL,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new xH,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new lU(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new OL),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new OL),this._whitespaceCell}getBlankLine(e,t){return new mU(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>wU?wU:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=dU);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new lU(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(dU),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new mU(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new mU(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=hU(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(dU),n);if(r.length>0){let n=gU(this.lines,r);_U(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(dU),i=n;for(;i-->0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new mU(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(dU),i=[],a=0;for(let o=this.lines.length-1;o>=0;o--){let s=this.lines.get(o);if(!s||!s.isWrapped&&s.getTrimmedLength()<=e)continue;let c=[s];for(;s.isWrapped&&o>0;)s=this.lines.get(--o),c.unshift(s);if(!n){let e=this.ybase+this.y;if(e>=o&&e<o+c.length)continue}let l=c[c.length-1].getTrimmedLength(),u=vU(c,this._cols,e),d=u.length-c.length,f;f=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(dU,!0);p.push(e)}p.length>0&&(i.push({start:o+c.length+a,newLines:p}),a+=p.length),c.push(...p);let m=u.length-1,h=u[m];h===0&&(m--,h=u[m]);let g=c.length-d-1,_=l;for(;g>=0;){let e=Math.min(_,h);if(c[m]===void 0)break;c[m].copyCellsFrom(c[g],_-e,h-e,e,!0),h-=e,h===0&&(m--,h=u[m]),_-=e,_===0&&(g--,_=yU(c,Math.max(g,0),this._cols))}for(let t=0;t<c.length;t++)u[t]<e&&c[t].setCell(u[t],r);let v=d-f;for(;v-->0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,r=n-1,o=0,s=i[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+a-1);l>=0;l--)if(s&&s.start>r+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:r+1,amount:s.newLines.length}),c+=s.newLines.length,s=i[++o]}else this.lines.set(l,t[r--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+a-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new xU(e);return this.markers.push(t),t.register(this.lines.onTrim(e=>{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},EU=class extends TR{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new Z),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 TU(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new TU(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},DU=2,OU=1,kU=class extends TR{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Z),this.onResize=this._onResize.event,this._onScroll=this._register(new Z),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,DU),this.rows=Math.max(e.rawOptions.rows||0,OU),this.buffers=this._register(new EU(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,r&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};kU=lL([X(0,HL)],kU);var AU={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:fH,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRuler:{}},jU=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],MU=class extends TR{constructor(e){super(),this._onOptionChange=this._register(new Z),this.onOptionChange=this._onOptionChange.event;let t={...AU};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(SR(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=e=>{if(!(e in AU))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},t=(e,t)=>{if(!(e in AU))throw Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case`cursorStyle`:if(t||=AU[e],!NU(t))throw Error(`"${t}" is not a valid value for ${e}`);break;case`wordSeparator`:t||=AU[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof t==`number`&&1<=t&&t<=1e3)break;t=jU.includes(t)?t:AU[e];break;case`cursorWidth`:t=Math.floor(t);case`lineHeight`:case`tabStopWidth`:if(t<1)throw Error(`${e} cannot be less than 1, value: ${t}`);break;case`minimumContrastRatio`:t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case`scrollback`:if(t=Math.min(t,4294967295),t<0)throw Error(`${e} cannot be less than 0, value: ${t}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(t<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case`rows`:case`cols`:if(!t&&t!==0)throw Error(`${e} must be numeric, value: ${t}`);break;case`windowsPty`:t??={}}return t}};function NU(e){return e===`block`||e===`underline`||e===`bar`}function PU(e,t=5){if(typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&PU(e[r],t-1);return n}var FU=Object.freeze({insertMode:!1}),IU=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),LU=class extends TR{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Z),this.onData=this._onData.event,this._onUserInput=this._register(new Z),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Z),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Z),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=PU(FU),this.decPrivateModes=PU(IU)}reset(){this.modes=PU(FU),this.decPrivateModes=PU(IU)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace(`sending data (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace(`sending binary (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};LU=lL([X(0,IL),X(1,VL),X(2,HL)],LU);var RU={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function zU(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var BU=String.fromCharCode,VU={DEFAULT:e=>{let t=[zU(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`\x1B[M${BU(t[0])}${BU(t[1])}${BU(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${zU(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${zU(e,!0)};${e.x};${e.y}${t}`}},HU=class extends TR{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Z),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(RU))this.addProtocol(e,RU[e]);for(let e of Object.keys(VU))this.addEncoding(e,VU[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};HU=lL([X(0,IL),X(1,RL),X(2,HL)],HU);var UU=[[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]],WU=[[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]],GU;function KU(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var qU=class{constructor(){if(this.version=`6`,!GU){GU=new Uint8Array(65536),GU.fill(1),GU[0]=0,GU.fill(0,1,32),GU.fill(0,127,160),GU.fill(2,4352,4448),GU[9001]=2,GU[9002]=2,GU.fill(2,11904,42192),GU[12351]=1,GU.fill(2,44032,55204),GU.fill(2,63744,64256),GU.fill(2,65040,65050),GU.fill(2,65072,65136),GU.fill(2,65280,65377),GU.fill(2,65504,65511);for(let e=0;e<UU.length;++e)GU.fill(0,UU[e][0],UU[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?GU[e]:KU(e,WU)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=JU.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return JU.createPropertyValue(0,n,r)}},JU=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new Z,this.onChange=this._onChange.event;let e=new qU;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return!!(e&1)}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|!!n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw 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(t){let n=0,r=0,i=t.length;for(let a=0;a<i;++a){let o=t.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},YU=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function XU(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var ZU=2147483647,QU=256,$U=class e{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>QU)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new e;if(!t.length)return n;for(let e=+!!Array.isArray(t[0]);e<t.length;++e){let r=t[e];if(Array.isArray(r))for(let e=0;e<r.length;++e)n.addSubParam(r[e]);else n.addParam(r)}return n}clone(){let t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>ZU?ZU:e}}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>ZU?ZU:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[t-1];n[t-1]=~r?Math.min(r*10+e,ZU):e}},eW=[],tW=class{constructor(){this._state=0,this._active=eW,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=eW}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=eW,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||eW,!this._active.length)this._handlerFb(this._id,`START`);else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,`PUT`,SL(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3){if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,`END`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}}this._active=eW,this._id=-1,this._state=0}}},nW=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=SL(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(e=>(this._data=``,this._hitLimit=!1,e));return this._data=``,this._hitLimit=!1,t}},rW=[],iW=class{constructor(){this._handlers=Object.create(null),this._active=rW,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=rW}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=rW,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||rW,!this._active.length)this._handlerFb(this._ident,`HOOK`,t);else for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,`PUT`,SL(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,`UNHOOK`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=rW,this._ident=0}},aW=new $U;aW.addParam(0);var oW=class{constructor(e){this._handler=e,this._data=``,this._params=aW,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():aW,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=SL(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(e=>(this._params=aW,this._data=``,this._hitLimit=!1,e));return this._params=aW,this._data=``,this._hitLimit=!1,t}},sW=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}},cW=160,lW=function(){let e=new sW(4095),t=Array.apply(null,Array(256)).map((e,t)=>t),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(cW,0,2,0),e.add(cW,8,5,8),e.add(cW,6,0,6),e.add(cW,11,0,11),e.add(cW,13,13,13),e}(),uW=class extends TR{constructor(e=lW){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new $U,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(SR(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new tW),this._dcsParser=this._register(new iW),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=0,a=0,o;if(this._parseStack.state){if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,i=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](this._params),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}}for(let n=a;n<t;++n){switch(r=e[n],i=this._transitions.table[this.currentState<<8|(r<160?r:cW)],i>>4){case 2:for(let i=n+1;;++i)if(i>=t||(r=e[i])<32||r>126&&r<cW||++i>=t||(r=e[i])<32||r>126&&r<cW||++i>=t||(r=e[i])<32||r>126&&r<cW||++i>=t||(r=e[i])<32||r>126&&r<cW){this._printHandler(e,n,i),n=i-1;break}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let a=this._csiHandlers[this._collect<<8|r],s=a?a.length-1:-1;for(;s>=0&&(o=a[s](this._params),o!==!0);s--)if(o instanceof Promise)return this._preserveStack(3,a,s,i,n),o;s<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++n<t&&(r=e[n])>47&&r<60);n--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(4,c,l,i,n),o;l<0&&this._escHandlerFb(this._collect<<8|r),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|r,this._params);break;case 13:for(let i=n+1;;++i)if(i>=t||(r=e[i])===24||r===26||r===27||r>127&&r<cW){this._dcsParser.put(e,n,i),n=i-1;break}break;case 14:if(o=this._dcsParser.unhook(r!==24&&r!==26),o)return this._preserveStack(6,[],0,i,n),o;r===27&&(i|=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 i=n+1;;i++)if(i>=t||(r=e[i])<32||r>127&&r<cW){this._oscParser.put(e,n,i),n=i-1;break}break;case 6:if(o=this._oscParser.end(r!==24&&r!==26),o)return this._preserveStack(5,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=i&15}}},dW=/^([\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})$/,fW=/^[\da-f]+$/;function pW(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=dW.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),fW.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}}function mW(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function hW(e,t=16){let[n,r,i]=e;return`rgb:${mW(n,t)}/${mW(r,t)}/${mW(i,t)}`}var gW={"(":0,")":1,"*":2,"+":3,"-":1,".":2},_W=131072,vW=10;function yW(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var bW=5e3,xW=0,SW=class extends TR{constructor(e,t,n,r,i,a,o,s,c=new uW){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=a,this._coreMouseService=o,this._unicodeService=s,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new CL,this._utf8Decoder=new wL,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=dU.clone(),this._eraseAttrDataInternal=dU.clone(),this._onRequestBell=this._register(new Z),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Z),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Z),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Z),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Z),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Z),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Z),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Z),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Z),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Z),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Z),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Z),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Z),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 CW(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})}),this._parser.setOscHandlerFallback((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})}),this._parser.setDcsHandlerFallback((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})}),this._parser.setPrintHandler((e,t,n)=>this.print(e,t,n)),this._parser.registerCsiHandler({final:`@`},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:` `,final:`@`},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:`A`},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:` `,final:`A`},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:`B`},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:`C`},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:`D`},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:`E`},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:`F`},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:`G`},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:`H`},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:`I`},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:`J`},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`J`},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:`K`},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`K`},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:`L`},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:`M`},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:`P`},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:`S`},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:`T`},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:`X`},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:`Z`},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:`a`},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:`b`},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:`c`},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:`>`,final:`c`},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:`d`},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:`e`},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:`f`},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:`g`},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:`h`},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`h`},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:`l`},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`l`},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:`m`},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:`n`},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:`?`,final:`n`},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:` `,final:`q`},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:`r`},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:`s`},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:`t`},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:`u`},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(Q.BEL,()=>this.bell()),this._parser.setExecuteHandler(Q.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(Q.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(Q.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(Q.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(Q.BS,()=>this.backspace()),this._parser.setExecuteHandler(Q.HT,()=>this.tab()),this._parser.setExecuteHandler(Q.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(Q.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(fV.IND,()=>this.index()),this._parser.setExecuteHandler(fV.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(fV.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new nW(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new nW(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new nW(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new nW(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new nW(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new nW(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new nW(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new nW(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new nW(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new nW(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new nW(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new nW(e=>this.restoreCursorColor(e))),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(let e in SU)this._parser.registerEscHandler({intermediates:`(`,final:e},()=>this.selectCharset(`(`+e)),this._parser.registerEscHandler({intermediates:`)`,final:e},()=>this.selectCharset(`)`+e)),this._parser.registerEscHandler({intermediates:`*`,final:e},()=>this.selectCharset(`*`+e)),this._parser.registerEscHandler({intermediates:`+`,final:e},()=>this.selectCharset(`+`+e)),this._parser.registerEscHandler({intermediates:`-`,final:e},()=>this.selectCharset(`-`+e)),this._parser.registerEscHandler({intermediates:`.`,final:e},()=>this.selectCharset(`.`+e)),this._parser.registerEscHandler({intermediates:`/`,final:e},()=>this.selectCharset(`/`+e));this._parser.registerEscHandler({intermediates:`#`,final:`8`},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error(`Parsing error: `,e),e)),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new oW((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t(`#SLOW_TIMEOUT`),bW))]).catch(e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than ${bW} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>_W&&(a=this._parseStack.position+_W)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join(``)}"`}`),this._logService.logLevel===0&&this._logService.trace(`parsing data (codes)`,typeof e==`string`?e.split(``).map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<_W&&(this._parseBuffer=new Uint32Array(Math.min(e.length,_W))),o||this._dirtyRowTracker.clearRange(),e.length>_W)for(let t=a;t<e.length;t+=_W){let a=t+_W<e.length?t+_W:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let s=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(s,this._bufferService.rows-1)})}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,l=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;p<n;++p){if(r=e[p],r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}let t=this._unicodeService.charProperties(r,f);i=JU.extractWidth(t);let n=JU.extractShouldJoin(t),m=n?JU.extractWidth(f):0;if(f=t,o&&this._onA11yChar.fire(xL(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-m>s){if(c){let e=d,t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,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),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&d instanceof mU&&d.copyCellsFrom(e,t,0,m,!1);t<s;)e.setCellFromCodepoint(t++,0,1,u)}else if(this._activeBuffer.x=s-1,i===2)continue}if(n&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,r,i);for(let e=i-m;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}else if(l&&(d.insertCells(this._activeBuffer.x,i-m,this._activeBuffer.getNullCell(u)),d.getWidth(s-1)===2&&d.setCellFromCodepoint(s-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<s&&n-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final===`t`&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,e=>!yW(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new oW(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new nW(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(dU));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=JU.extractWidth(t),i=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(a.length*n),s=0;for(let e=0;e<a.length;){let t=a.codePointAt(e)||0;o[s++]=t,e+=t>65535?2:1}let c=s;for(let e=1;e<n;++e)o.copyWithin(c,0,s),c+=s;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent(Q.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent(Q.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent(Q.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent(Q.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent(Q.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,CU),this._charsetService.setgCharset(1,CU),this._charsetService.setgCharset(2,CU),this._charsetService.setgCharset(3,CU);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0)}return!0}requestMode(e,t){let n;(e=>(e[e.NOT_RECOGNIZED=0]=`NOT_RECOGNIZED`,e[e.SET=1]=`SET`,e[e.RESET=2]=`RESET`,e[e.PERMANENTLY_SET=3]=`PERMANENTLY_SET`,e[e.PERMANENTLY_RESET=4]=`PERMANENTLY_RESET`))(n||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:a}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=(e,n)=>(o.triggerDataEvent(`${Q.ESC}[${t?``:`?`}${e};${n}$y`),!0),p=e=>e?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:+(c===132):0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i===`X10`)):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i===`VT200`)):m===1002?f(m,p(i===`DRAG`)):m===1003?f(m,p(i===`ANY`)):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(a===`SGR`)):m===1015?f(m,4):m===1016?f(m,p(a===`SGR_PIXELS`)):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=DL.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=dU.fg,e.bg=dU.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=n-90|16777224):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=n-100|16777224):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=dU.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=dU.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=dU.fg&16777215,r.bg&=-67108864,r.bg|=dU.bg&16777215):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${Q.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Q.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Q.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=dU.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle=`block`;break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle=`underline`;break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle=`bar`}let e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!yW(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${Q.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>vW&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>vW&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(wW(n)){if(r===`?`)t.push({type:0,index:n});else{let e=pW(r);e&&t.push({type:1,index:n,color:e})}}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(`;`);if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):!n.trim()&&this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex(e=>e.startsWith(`id=`));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=pW(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);wW(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,CU),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(gW[e[0]],SU[e[1]]||CU),!0):(this.selectDefaultCharset(),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=dU.clone(),this._eraseAttrDataInternal=dU.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new kL;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=e=>(this._coreService.triggerDataEvent(`${Q.ESC}${e}${Q.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-+!!i.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},CW=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(xW=e,e=t,t=xW),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};CW=lL([X(0,IL)],CW);function wW(e){return 0<=e&&e<256}var TW=5e7,EW=12,DW=50,OW=class extends TR{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 Z),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>TW)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e=>performance.now()-n>=EW?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-n>=EW)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>DW&&(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()}},kW=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(r,n)),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(n,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};kW=lL([X(0,IL)],kW);var AW=!1,jW=class extends TR{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ER),this._onBinary=this._register(new Z),this.onBinary=this._onBinary.event,this._onData=this._register(new Z),this.onData=this._onData.event,this._onLineFeed=this._register(new Z),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Z),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Z),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Z),this._instantiationService=new iU,this.optionsService=this._register(new MU(e)),this._instantiationService.setService(HL,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(kU)),this._instantiationService.setService(IL,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(sU)),this._instantiationService.setService(VL,this._logService),this.coreService=this._register(this._instantiationService.createInstance(LU)),this._instantiationService.setService(RL,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(HU)),this._instantiationService.setService(LL,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(JU)),this._instantiationService.setService(WL,this.unicodeService),this._charsetService=this._instantiationService.createInstance(YU),this._instantiationService.setService(zL,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(kW),this._instantiationService.setService(UL,this._oscLinkService),this._inputHandler=this._register(new SW(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(NR.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(NR.forward(this._bufferService.onResize,this._onResize)),this._register(NR.forward(this.coreService.onData,this._onData)),this._register(NR.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new OW((e,t)=>this._inputHandler.parse(e,t))),this._register(NR.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Z),this._onScroll.event(e=>{this._onScrollApi?.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!AW&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),AW=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,DU),t=Math.max(t,OU),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(XU.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},()=>(XU(this._bufferService),!1))),this._windowsWrappingHeuristics.value=SR(()=>{for(let t of e)t.dispose()})}}},MW={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:[`'`,`"`]};function NW(e,t,n,r){let i={type:0,cancel:!1,key:void 0},a=+!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?i.key=t?Q.ESC+`OA`:Q.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?i.key=t?Q.ESC+`OD`:Q.ESC+`[D`:e.key===`UIKeyInputRightArrow`?i.key=t?Q.ESC+`OC`:Q.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(i.key=t?Q.ESC+`OB`:Q.ESC+`[B`);break;case 8:i.key=e.ctrlKey?`\b`:Q.DEL,e.altKey&&(i.key=Q.ESC+i.key);break;case 9:if(e.shiftKey){i.key=Q.ESC+`[Z`;break}i.key=Q.HT,i.cancel=!0;break;case 13:i.key=e.altKey?Q.ESC+Q.CR:Q.CR,i.cancel=!0;break;case 27:i.key=Q.ESC,e.altKey&&(i.key=Q.ESC+Q.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;i.key=a?Q.ESC+`[1;`+(a+1)+`D`:t?Q.ESC+`OD`:Q.ESC+`[D`;break;case 39:if(e.metaKey)break;i.key=a?Q.ESC+`[1;`+(a+1)+`C`:t?Q.ESC+`OC`:Q.ESC+`[C`;break;case 38:if(e.metaKey)break;i.key=a?Q.ESC+`[1;`+(a+1)+`A`:t?Q.ESC+`OA`:Q.ESC+`[A`;break;case 40:if(e.metaKey)break;i.key=a?Q.ESC+`[1;`+(a+1)+`B`:t?Q.ESC+`OB`:Q.ESC+`[B`;break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=Q.ESC+`[2~`);break;case 46:i.key=a?Q.ESC+`[3;`+(a+1)+`~`:Q.ESC+`[3~`;break;case 36:i.key=a?Q.ESC+`[1;`+(a+1)+`H`:t?Q.ESC+`OH`:Q.ESC+`[H`;break;case 35:i.key=a?Q.ESC+`[1;`+(a+1)+`F`:t?Q.ESC+`OF`:Q.ESC+`[F`;break;case 33:e.shiftKey?i.type=2:i.key=e.ctrlKey?Q.ESC+`[5;`+(a+1)+`~`:Q.ESC+`[5~`;break;case 34:e.shiftKey?i.type=3:i.key=e.ctrlKey?Q.ESC+`[6;`+(a+1)+`~`:Q.ESC+`[6~`;break;case 112:i.key=a?Q.ESC+`[1;`+(a+1)+`P`:Q.ESC+`OP`;break;case 113:i.key=a?Q.ESC+`[1;`+(a+1)+`Q`:Q.ESC+`OQ`;break;case 114:i.key=a?Q.ESC+`[1;`+(a+1)+`R`:Q.ESC+`OR`;break;case 115:i.key=a?Q.ESC+`[1;`+(a+1)+`S`:Q.ESC+`OS`;break;case 116:i.key=a?Q.ESC+`[15;`+(a+1)+`~`:Q.ESC+`[15~`;break;case 117:i.key=a?Q.ESC+`[17;`+(a+1)+`~`:Q.ESC+`[17~`;break;case 118:i.key=a?Q.ESC+`[18;`+(a+1)+`~`:Q.ESC+`[18~`;break;case 119:i.key=a?Q.ESC+`[19;`+(a+1)+`~`:Q.ESC+`[19~`;break;case 120:i.key=a?Q.ESC+`[20;`+(a+1)+`~`:Q.ESC+`[20~`;break;case 121:i.key=a?Q.ESC+`[21;`+(a+1)+`~`:Q.ESC+`[21~`;break;case 122:i.key=a?Q.ESC+`[23;`+(a+1)+`~`:Q.ESC+`[23~`;break;case 123:i.key=a?Q.ESC+`[24;`+(a+1)+`~`:Q.ESC+`[24~`;break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=Q.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=Q.DEL:e.keyCode===219?i.key=Q.ESC:e.keyCode===220?i.key=Q.FS:e.keyCode===221&&(i.key=Q.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let t=MW[e.keyCode]?.[+!!e.shiftKey];if(t)i.key=Q.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),i.key=Q.ESC+n}else if(e.keyCode===32)i.key=Q.ESC+(e.ctrlKey?Q.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),i.key=Q.ESC+t,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(i.key=Q.US),e.key===`@`&&(i.key=Q.NUL))}return i}var PW=0,FW=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new xH,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new xH,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,t)=>this._getKey(e)-this._getKey(t)),t=0,n=0,r=Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(PW=this._search(t),PW===-1)||this._getKey(this._array[PW])!==t)return!1;do if(this._array[PW]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(PW),!0;while(++PW<this._array.length&&this._getKey(this._array[PW])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,t)=>e-t),t=0,n=Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:n[r++]=this._array[i];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(PW=this._search(e),!(PW<0||PW>=this._array.length)&&this._getKey(this._array[PW])===e))do yield this._array[PW];while(++PW<this._array.length&&this._getKey(this._array[PW])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(PW=this._search(e),!(PW<0||PW>=this._array.length)&&this._getKey(this._array[PW])===e))do t(this._array[PW]);while(++PW<this._array.length&&this._getKey(this._array[PW])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},IW=0,LW=0,RW=class extends TR{constructor(){super(),this._decorations=new FW(e=>e?.marker.line),this._onDecorationRegistered=this._register(new Z),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Z),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(SR(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new zW(e);if(t){let e=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,t=>{IW=t.options.x??0,LW=IW+(t.options.width??1),e>=IW&&e<LW&&(!n||(t.options.layer??`bottom`)===n)&&r(t)})}},zW=class extends wR{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Z),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Z),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}get backgroundColorRGB(){return this._cachedBg===null&&(this._cachedBg=this.options.backgroundColor?SV.toColor(this.options.backgroundColor):void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this._cachedFg=this.options.foregroundColor?SV.toColor(this.options.foregroundColor):void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},BW=1e3,VW=class{constructor(e,t=BW){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},HW=20,UW=class extends TR{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``;let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=i.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new VW(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
125
- `))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(hB(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(SR(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<HW+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
126
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===HW+1&&(this._liveRegion.textContent+=pL.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};UW=lL([X(1,BL),X(2,YL),X(3,ZL)],UW);var WW=class extends TR{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new Z),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Z),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(SR(()=>{bR(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(hB(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(hB(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(hB(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(hB(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){this._activeLine!==e.y||this._wasResized?(this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1):this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){this._activeProviderReplies&&t||(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)(!this._activeProviderReplies.has(t)||this._activeProviderReplies.get(t))&&(i=!0);if(!i&&r){let e=r.find(e=>this._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&GW(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,bR(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};WW=lL([X(1,XL),X(2,ZL),X(3,IL),X(4,tR)],WW);function GW(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var KW=class extends jW{constructor(e={}){super(e),this._linkifier=this._register(new ER),this.browser=iH,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ER),this._onCursorMove=this._register(new Z),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Z),this.onKey=this._onKey.event,this._onRender=this._register(new Z),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Z),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Z),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Z),this.onBell=this._onBell.event,this._onFocus=this._register(new Z),this._onBlur=this._register(new Z),this._onA11yCharEmitter=this._register(new Z),this._onA11yTabEmitter=this._register(new Z),this._onWillOpen=this._register(new Z),this._setup(),this._decorationService=this._instantiationService.createInstance(RW),this._instantiationService.setService(GL,this._decorationService),this._linkProviderService=this._instantiationService.createInstance($V),this._instantiationService.setService(tR,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(KL)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(NR.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(NR.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(NR.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(NR.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(SR(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=xV.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${Q.ESC}]${n};${hW(r)}${pV.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=bV.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=bV.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(UW,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(hB(this.element,`copy`,e=>{this.hasSelection()&&gL(e,this._selectionService)}));let e=e=>_L(e,this.textarea,this.coreService,this.optionsService);this._register(hB(this.textarea,`paste`,e)),this._register(hB(this.element,`paste`,e)),cH?this._register(hB(this.element,`mousedown`,e=>{e.button===2&&bL(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(hB(this.element,`contextmenu`,e=>{bL(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),gH&&this._register(hB(this.element,`auxclick`,e=>{e.button===1&&yL(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(hB(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(hB(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(hB(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(hB(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(hB(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(hB(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(hB(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(hB(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,dL.get()),_H||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._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(ZV,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(YL,this._coreBrowserService),this._register(hB(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(hB(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(qV,this._document,this._helperContainer),this._instantiationService.setService(JL,this._charSizeService),this._themeService=this._instantiationService.createInstance(tU),this._instantiationService.setService(eR,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(OV),this._instantiationService.setService($L,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(CH,this.rows,this.screenElement)),this._instantiationService.setService(ZL,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(mV,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(nH),this._instantiationService.setService(XL,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(WW,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(aV,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(GH,this.element,this.screenElement,r)),this._instantiationService.setService(QL,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(NR.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(oV,this.screenElement)),this._register(hB(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),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(UW,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(dV,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(dV,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(KV,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),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()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(hB(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(hB(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=Q.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){vL(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;t||e.key!==`Dead`&&e.key!==`AltGraph`||(this._unprocessedDeadKey=!0);let n=NW(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===Q.ETX||n.key===Q.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(qW(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e===this.cols&&t===this.rows?this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure():super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(dU));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(Q.ESC+`[I`):this.coreService.triggerDataEvent(Q.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.ESC}[4;${t};${e}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}};function qW(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var JW=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},YW=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new kL)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},XW=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new YW(t)}getNullCell(){return new kL}},ZW=class extends TR{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Z),this.onBufferChange=this._onBufferChange.event,this._normal=new XW(this._core.buffers.normal,`normal`),this._alternate=new XW(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 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)}},QW=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},$W=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},eG=[`cols`,`rows`],tG=0,nG=class extends TR{constructor(e){super(),this._core=this._register(new KW(e)),this._addonManager=this._register(new JW),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(eG.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw 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||=new QW(this._core),this._parser}get unicode(){return this._checkProposedApi(),new $W(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._register(new ZW(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
127
- `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return dL.get()},set promptLabel(e){dL.set(e)},get tooMuchOutput(){return pL.get()},set tooMuchOutput(e){pL.set(e)}}}_verifyIntegers(...e){for(tG of e)if(tG===1/0||isNaN(tG)||tG%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(tG of e)if(tG&&(tG===1/0||isNaN(tG)||tG%1!=0||tG<0))throw Error(`This API only accepts positive integers`)}},rG=(0,H.createContext)(null);function iG({children:e,windows:t}){let[n]=(0,H.useState)(()=>new Map);return(0,H.useEffect)(()=>{if(!n.size)return;let e=new Set(t.flatMap(e=>e.tabs.map(e=>e.id)));for(let[t,r]of n)e.has(t)||(r.terminal.dispose(),n.delete(t))},[n,t]),(0,H.useEffect)(()=>()=>{for(let e of n.values())e.terminal.dispose();n.clear()},[n]),(0,B.jsx)(rG.Provider,{value:n,children:e})}function aG(){let e=(0,H.useContext)(rG);if(!e)throw Error(`Terminal screen provider is missing`);return e}function oG(){let e=new nG({fontSize:12,fontFamily:`ui-monospace, Menlo, monospace`,cursorBlink:!0,scrollback:2e3,disableStdin:!0,theme:{background:`#0f1115`,foreground:`#d7dae0`}}),t=new aL;return e.loadAddon(t),{terminal:e,fit:t,cursor:0,log:``,gap:!1,ready:!1,pendingWrite:Promise.resolve()}}var sG={CREATED:`正在创建`,RUNNING:`运行中`,STOPPING:`正在终止`,EXITED:`已退出`,TERMINATED:`已终止`,INTERRUPTED:`已中断`};function cG({id:e,tabId:t,visible:n}){let r=aG(),i=gp({queryKey:DN(e),queryFn:()=>AN(e),enabled:n,staleTime:0,refetchOnMount:`always`,refetchInterval:2e3}),a=i.data?ON(i.data.status):!1,o=i.isFetchedAfterMount&&i.isSuccess,[s,c]=(0,H.useState)(!1);(0,H.useEffect)(()=>{o&&c(!0)},[o]);let l=(o||s)&&!!i.data&&!a,u=i.data?kN(i.data):null;(0,H.useEffect)(()=>{if(u===null)return;let t=Fj.getState();t.windows.some(t=>t.tabs.some(t=>t.resourceId===e&&t.title!==u))&&Fj.setState({windows:t.windows.map(t=>({...t,tabs:t.tabs.map(t=>t.resourceId===e&&t.title!==u?{...t,title:u}:t)}))})},[e,u]);let d=(0,H.useRef)(i.data);d.current=i.data;let f=(0,H.useRef)(null),p=(0,H.useRef)(null),m=(0,H.useRef)(null),h=(0,H.useRef)(!1),[g,_]=(0,H.useState)(null);(0,H.useEffect)(()=>{_(document.getElementById(`terminal-controls-${t}`))},[t]);let[v,y]=(0,H.useState)(!1),[b,x]=(0,H.useState)(null),[S,C]=(0,H.useState)(``),[w,T]=(0,H.useState)(``),[E,D]=(0,H.useState)(!1),[O,k]=(0,H.useState)(``),[A,j]=(0,H.useState)(!0),[M,N]=(0,H.useState)(!1),[ee,te]=(0,H.useState)(Date.now()),P=i.data?.lease,ne=n&&!!b&&P?.ownerConnectionId===b&&P.expiresAt>ee&&i.data?.status===`RUNNING`&&!i.isError,F=ne&&v,re=P?.ownerType===`agent`&&P.expiresAt>ee&&i.data?.status===`RUNNING`&&!i.isError;(0,H.useLayoutEffect)(()=>{if(a){r.get(t)?.terminal.dispose(),r.delete(t),k(``);return}let e=f.current;if(!l||!e)return;let n=r.get(t)??oG();r.set(t,n),p.current=n;let i=n.terminal;return i.element?e.appendChild(i.element):i.open(e),D(n.gap),k(n.ready?n.log:``),j(!n.ready),()=>{p.current=null,i.element?.remove()}},[r,l,t,a]),(0,H.useLayoutEffect)(()=>{x(null),y(!1);let t=f.current,r=p.current;if(!n||!l||!t||!r)return;let{terminal:i,fit:a}=r;i.options.cursorBlink=!0,h.current=!1;let o=!1,s=!1,c=500,u,g,_=null,v=null,b=0,S=null,w=null,T=[],E=0;C(``);let O=()=>o?Promise.resolve():ZA.invalidateQueries({queryKey:DN(e)}),A=()=>{let e=d.current;return!!_&&!!v&&e?.status===`RUNNING`&&e.lease?.ownerConnectionId===_&&e.lease.generation===v&&e.lease.expiresAt>Date.now()&&u?.readyState===WebSocket.OPEN},M=()=>{v=null,y(!1),w=null,T=[],E=0,i.options.disableStdin=!0},N=()=>{if(!A()||w!==null||!T.length)return;let t=T.shift();t!==void 0&&(E-=new TextEncoder().encode(t).length,w=++b,u?.send(JSON.stringify({type:`terminal.input`,terminalId:e,leaseGeneration:v,inputSequence:w,data:t})))},ee=i.onData(e=>{if(!A())return;let t=new TextEncoder().encode(e).length;t>8192||E+t>32768?C(`输入过大,请分段粘贴(单次最多 8 KiB)。`):(T.push(e),E+=t,N())}),P=()=>{r.ready||(r.ready=!0,k(r.log),j(!1))},ne=async()=>{if(!(s||o)){s=!0;try{await r.pendingWrite;for(let t=0;t<8&&!o;t++){let t=Ik.parse(await Y(`/api/terminals/${encodeURIComponent(e)}/output?after=${r.cursor}&limit=100`));if(o)return;r.gap||=t.resyncRequired||t.truncated;let n=r.cursor,a=[];for(let e of t.chunks)e.cursor<=n||(e.cursor!==n+1&&(r.gap=!0),a.push(e.data),n=e.cursor);r.gap&&D(!0);let s=Math.max(n,t.nextCursor);if(!a.length){r.cursor=s,P();break}let c=a.join(``);r.pendingWrite=new Promise(e=>{i.write(c,()=>{r.cursor=s,r.log=(r.log+c).slice(-16384),e()})}),await r.pendingWrite,!o&&r.ready&&k(r.log)}}catch{o||(C(`输出读取失败,正在重试;历史可能不完整。`),P())}finally{s=!1}}},F,re=()=>{clearTimeout(F),F=setTimeout(()=>{!o&&t.clientWidth&&t.clientHeight&&(a.fit(),A()&&NN(e,`resize`,{connectionId:_,leaseGeneration:v,cols:Math.max(2,Math.min(500,i.cols)),rows:Math.max(1,Math.min(300,i.rows))}).catch(()=>{o||(M(),O(),C(`尺寸同步失败,请重新获取输入权。`))}))},100)},ie=new ResizeObserver(re);ie.observe(t),re();let ae=()=>{if(o)return;let t=new URL(`/ws`,location.href);t.protocol=t.protocol===`https:`?`wss:`:`ws:`;let n=new WebSocket(t);u=n,n.onopen=()=>n.send(JSON.stringify({type:`subscribe`,subscriptions:[{topic:`terminal`,resourceId:e,after:0}]})),n.onmessage=t=>{if(o||u!==n)return;let r;try{r=JSON.parse(String(t.data))}catch{M(),C(`终端响应无效,请刷新。`);return}let i=Lk.safeParse(r);if(i.success&&i.data.subscription.resourceId===e){_=i.data.connectionId,c=500,O().then(()=>{!o&&u===n&&n.readyState===WebSocket.OPEN&&x(_)}),ne();return}let a=Rk.safeParse(r);if(a.success&&w===a.data.inputSequence){w=null,N();return}let s=Pk.safeParse(r);if(s.success&&s.data.resourceId===e){(s.data.payload.lease?.generation!==v||s.data.payload.lease?.ownerConnectionId!==_||s.data.payload.status!==`RUNNING`)&&M(),O(),ne();return}if(jk.safeParse(r).success){ne();return}let l=zk.safeParse(r);l.success&&(M(),O(),C(`终端操作被拒绝(${l.data.code}),请重新获取输入权。`))},n.onclose=()=>{o||(_=null,x(null),M(),O(),C(`连接已断开,正在重连;不会重放输入。`),g=setTimeout(ae,c),c=Math.min(c*2,1e4))}},oe=t=>{t.lease&&(d.current=t,ZA.setQueryData(DN(e),t),v=t.lease.generation,S!==v&&(b=0),S=v,y(!0),w=null,i.options.disableStdin=!1,i.focus(),re(),C(``))};m.current={acquire:async()=>{if(!_)throw Error(`Disconnected`);let t=_,n=await NN(e,`lease`,{action:`acquire`,connectionId:t});o||_!==t||n.lease?.ownerConnectionId!==t||oe(n)},takeover:async()=>{if(!_)throw Error(`Disconnected`);let t=_,n=await NN(e,`takeover`,{connectionId:t});o||_!==t||n.lease?.ownerConnectionId!==t||oe(n)},release:async()=>{let t=d.current?.lease,n=t?.ownerConnectionId===_?t?.generation:v;M(),_&&n&&await NN(e,`lease`,{action:`release`,connectionId:_,leaseGeneration:n})}};let se=setInterval(()=>{if(!A())return;let t=_,n=v;NN(e,`lease`,{action:`renew`,connectionId:_,leaseGeneration:v}).then(r=>{!o&&t===_&&n===v&&(d.current=r,ZA.setQueryData(DN(e),r))}).catch(()=>{o||(M(),O(),C(`输入租约续期失败,请重新获取输入权。`))})},1e4),ce=setInterval(()=>{te(Date.now()),i.options.disableStdin=!A(),A()||y(!1),ne()},1e3);return ae(),()=>{o=!0,m.current=null,clearTimeout(g),clearTimeout(F),clearInterval(se),clearInterval(ce),ie.disconnect(),ee.dispose(),u?.close(),i.options.disableStdin=!0,i.options.cursorBlink=!1,i.blur()}},[e,l,n]),(0,H.useEffect)(()=>{if(!n||A||!b||!i.data||i.data.status!==`RUNNING`||i.isError||h.current||(h.current=!0,i.data.mode!==`shell`||i.data.lease&&i.data.lease.expiresAt>Date.now()))return;let t=!1;return N(!0),m.current?.acquire().catch(()=>{t||ZA.invalidateQueries({queryKey:DN(e)})}).finally(()=>{t||N(!1)}),()=>{t=!0,N(!1)}},[b,e,i.data,i.isError,A,n]);let ie=async e=>{N(!0),C(``),T(``);try{await e()}catch{T(`终端操作失败,请刷新状态后重试。`)}finally{N(!1)}};return(0,B.jsxs)(`div`,{"data-testid":`live-terminal`,"data-terminal-id":e,"data-input-state":F?`active`:re?`agent`:`inactive`,className:`flex h-full min-h-0 flex-col bg-[#0f1115] text-white/80`,children:[g?(0,Kt.createPortal)((0,B.jsxs)(bu,{children:[(0,B.jsx)(xu,{asChild:!0,children:(0,B.jsx)(`button`,{type:`button`,"aria-label":`终端操作`,title:`终端操作`,className:`flex w-7 items-center justify-center text-ink-3 hover:bg-surface-2 hover:text-ink`,children:(0,B.jsx)(w_,{size:14})})}),(0,B.jsx)(Cu,{onCloseAutoFocus:e=>{e.preventDefault(),F&&f.current?.querySelector(`.xterm-helper-textarea`)?.focus()},children:(0,B.jsx)(Tu,{"aria-label":ne?`释放输入权`:re?`接管控制`:`获取输入权`,disabled:M||A||!b||!i.data||i.isError||i.data.status!==`RUNNING`||!ne&&!re&&!!P&&P.expiresAt>ee,onSelect:()=>void ie(async()=>{ne?await m.current?.release():re?await m.current?.takeover():await m.current?.acquire()}),children:ne?`交给 AI`:re?`接管控制`:`输入终端`})})]}),g):null,i.data&&i.data.status!==`RUNNING`?(0,B.jsx)(`p`,{role:`status`,className:`px-2 text-xs`,children:sG[i.data.status]}):null,i.data?.reasonCode?(0,B.jsxs)(`p`,{className:`px-2 text-xs`,children:[`状态原因:`,i.data.reasonCode]}):null,i.data?.exitCode!==null&&i.data?.exitCode!==void 0?(0,B.jsxs)(`p`,{className:`px-2 text-xs`,children:[`退出码 `,i.data.exitCode]}):null,!a&&E?(0,B.jsx)(`p`,{role:`status`,className:`px-2 text-xs text-amber-300`,children:`部分历史输出已过期或缺失,当前回放不完整。`}):null,i.isError||!a&&S?(0,B.jsx)(`p`,{role:`alert`,className:`px-2 text-xs text-red-300`,children:!a&&S||`终端不可用,请刷新核对;不会自动重建。`}):null,(0,B.jsx)(Ou,{message:!a&&n?w:null,onDismiss:()=>T(``)}),l?(0,B.jsxs)(B.Fragment,{children:[A?(0,B.jsx)(`p`,{role:`status`,className:`px-2 pt-2 text-xs text-white/60`,children:`正在恢复终端输出…`}):null,(0,B.jsx)(`div`,{ref:f,role:`application`,"aria-label":`交互终端`,className:z(`min-h-0 flex-1 p-2`,A&&`invisible`),onPointerDown:()=>{!ne&&!re&&b&&!M&&(!P||P.expiresAt<=Date.now())&&i.data?.status===`RUNNING`&&ie(async()=>{await m.current?.acquire()})}}),(0,B.jsx)(`pre`,{role:`log`,"aria-label":`终端输出`,"aria-live":`off`,className:`sr-only`,children:O})]}):null]})}function lG({scope:e,label:t=`新建终端`,children:n,className:r}){let[i,a]=(0,H.useState)(null),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(``);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":t,title:`新建终端`,className:r,onClick:()=>{l(``),a({key:crypto.randomUUID(),scope:e})},children:n??`新建终端`}),(0,B.jsx)(ca,{open:i!==null,onOpenChange:e=>{!e&&!o&&a(null)},children:(0,B.jsxs)(ua,{className:`max-w-sm`,children:[(0,B.jsx)(da,{children:`创建终端确认`}),(0,B.jsx)(fa,{children:`终端以本机账户权限运行,可访问项目外文件。`}),(0,B.jsx)(Ou,{message:c,onDismiss:()=>l(``)}),(0,B.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`ghost`,disabled:o,onClick:()=>a(null),children:`取消`}),(0,B.jsx)(V,{disabled:o,onClick:async()=>{if(i&&!o){s(!0),l(``);try{PN(await MN(i.scope,i.key)),a(null),ZA.invalidateQueries({queryKey:[`terminals`]})}catch{l(`创建结果未确认,请重试核对;重试不会重复创建。`)}finally{s(!1)}}},children:o?`正在创建…`:`确认创建`})]})]})})]})}function uG(e,t){return`projectId`in t&&t.projectId!==`prj_default`?e.projectId===t.projectId:`sessionId`in t?e.workspaceSessionId===t.sessionId:!e.projectId&&!e.workspaceSessionId}async function dG(e,t){let n=[],r=new Set,i;do{t.throwIfAborted();let a=await jN(i,e);if(n.push(...a.items.filter(t=>t.status===`RUNNING`&&uG(t,e))),i=a.nextCursor??void 0,i){if(r.has(i))throw Error(`Repeated terminal cursor`);r.add(i)}}while(i);for(let r of n.reverse()){t.throwIfAborted();let n=await AN(r.id).catch(e=>{if(e instanceof aA&&e.status===404)return null;throw e});if(n){if(n.id!==r.id||!uG(n,e))throw Error(`Terminal scope changed`);if(n.status===`RUNNING`)return n}}return null}function fG({projectId:e,sessionId:t,visible:n=!0}){let r=e?{projectId:e}:t?{sessionId:t}:{workspace:`default`},{data:i,isFetchedAfterMount:a,isError:o,isFetching:s,refetch:c}=gp({queryKey:[`terminals`,`restore`,e,t],queryFn:({signal:e})=>dG(r,e),enabled:n,staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1});return(0,H.useEffect)(()=>{n&&i&&a&&!o&&!s&&PN(i)},[i,a,o,s,n]),(0,B.jsx)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-3 text-[12px] text-ink`,children:o&&!s?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{role:`alert`,className:`text-ink-3`,children:`无法恢复终端,请重试。`}),(0,B.jsx)(`button`,{type:`button`,className:`text-accent`,onClick:()=>void c(),children:`重试`}),(0,B.jsx)(lG,{scope:r,className:`text-accent`})]}):!a||s||i?(0,B.jsx)(`p`,{role:`status`,className:`text-ink-3`,children:`正在读取终端…`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Jv,{size:24,"aria-hidden":`true`,className:`text-ink-3/50`}),(0,B.jsx)(`p`,{className:`text-ink-3`,children:`暂无运行中的终端`}),(0,B.jsx)(lG,{scope:r,className:`rounded-lg bg-accent px-3 py-1.5 text-white`})]})})}function pG({tab:e,visible:t}){return e.resourceId===`terminal:empty`?(0,B.jsx)(fG,{projectId:e.projectId,sessionId:e.sourceSessionId??void 0,visible:t}):(0,B.jsx)(cG,{id:e.resourceId,tabId:e.id,visible:t},e.id)}function mG({tab:e,visible:t}){if(!e)return null;switch(e.kind){case`files`:return(0,B.jsx)(VI,{tab:e});case`terminal`:return(0,B.jsx)(pG,{tab:e,visible:t});case`services`:return(0,B.jsx)(XI,{tab:e});case`browser`:return(0,B.jsx)(EI,{tab:e});case`git-diff`:return(0,B.jsx)(jI,{tab:e});default:return null}}function hG({kind:e}){return(0,B.jsx)(e===`terminal`?Jv:e===`services`?Iv:e===`browser`?S_:e===`git-diff`?q_:M_,{size:11.5,className:`shrink-0 text-ink-3`})}function gG(e,t,n){return e?n??e:t===`session`?`独立会话`:`默认工作区`}function _G({window:e}){let[t,n]=(0,H.useState)(null),[r,i]=(0,H.useState)(``),a=Hj(e=>e.saving),o=Hj(e=>e.drafts),s=Fj(e=>e.setActiveTab),c=Fj(e=>e.closeTab),{data:l}=ej(),u=vj(e.tabs,e.filter),d=yj(u,e.activeTabId)?.id,f=u.filter(e=>e.kind!==`terminal`||e.resourceId!==`terminal:empty`),p=e.tabs[0]?.kind,m=(0,H.useRef)(null),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(null);return(0,H.useEffect)(()=>{let t=m.current;if(!t||!e.tabs.length)return;let n=()=>g(t.scrollWidth>t.clientWidth+1),r=new ResizeObserver(n);return r.observe(t),n(),t.querySelector(`[data-tab-id="${d}"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`}),()=>r.disconnect()},[e.tabs,d]),(0,B.jsxs)(`div`,{className:`relative flex h-8 shrink-0 items-stretch border-b border-line bg-surface-2/35`,children:[(0,B.jsx)(Ou,{message:r,onDismiss:()=>i(``)}),h?(0,B.jsx)(`button`,{type:`button`,"aria-label":`向左滚动 Tab`,className:`shrink-0 px-1 text-ink-3 hover:text-ink`,onClick:()=>m.current?.scrollBy({left:-180,behavior:`smooth`}),children:(0,B.jsx)(i_,{size:13})}):null,(0,B.jsx)(`div`,{ref:m,role:`tablist`,"aria-label":`窗口 Tab`,onKeyDown:t=>{if(!(t.target instanceof HTMLElement)||t.target.getAttribute(`role`)!==`tab`)return;let n=f.findIndex(e=>e.id===d),r=t.key===`ArrowRight`?(n+1)%f.length:t.key===`ArrowLeft`?(n-1+f.length)%f.length:t.key===`Home`?0:t.key===`End`?f.length-1:-1,i=f[r];i&&(t.preventDefault(),s(e.id,i.id),m.current?.querySelector(`[data-tab-id="${i.id}"]`)?.focus())},className:`window-tabs-scroll flex h-8 min-w-0 flex-1 items-end gap-0.5 overflow-x-auto overflow-y-hidden px-2`,onWheel:e=>{m.current&&Math.abs(e.deltaY)>Math.abs(e.deltaX)&&(m.current.scrollLeft+=e.deltaY)},children:f.map(r=>{let u=r.id===d,f=l.projects.find(e=>e.id===r.projectId)??null,p=gG(r.projectId,r.originType,f?.name);return(0,B.jsx)(`div`,{className:`flex shrink-0 items-end`,children:(0,B.jsxs)(`div`,{className:z(`group flex h-7 max-w-[220px] shrink-0 items-center gap-1.5 rounded-t-[8px] border border-b-0 px-2.5 text-[10.5px] transition-colors`,u?`border-line bg-surface text-ink`:`border-transparent text-ink-3 hover:bg-black/[.03] hover:text-ink-2 dark:hover:bg-white/[.04]`),children:[_?.id===r.id?(0,B.jsx)(`form`,{onSubmit:async e=>{e.preventDefault();try{await NN(r.resourceId,`rename`,{title:_.title}),v(null)}catch{i(`改名失败,请重试。`)}},children:(0,B.jsx)(Mu,{ref:e=>e?.focus(),"aria-label":`终端名称`,maxLength:80,value:_.title,onChange:e=>v({..._,title:e.target.value}),onKeyDown:e=>{e.key===`Escape`&&v(null)},className:`h-5 w-32 border-accent/40 px-1 text-[11px]`})}):(0,B.jsxs)(`button`,{type:`button`,"data-tab-id":r.id,role:`tab`,"aria-selected":u,onDoubleClick:()=>{r.kind===`terminal`&&r.resourceId.startsWith(`term_`)&&v({id:r.id,title:r.title})},onKeyDown:e=>{e.key===`F2`&&r.kind===`terminal`&&r.resourceId.startsWith(`term_`)&&(e.preventDefault(),v({id:r.id,title:r.title}))},onClick:()=>s(e.id,r.id),title:`${p} · ${r.title}${r.kind===`terminal`?` · 双击或 F2 改名`:``}`,className:`flex min-w-0 flex-1 items-center gap-1.5 focus-visible:outline-none`,children:[(0,B.jsx)(hG,{kind:r.kind}),(0,B.jsxs)(`span`,{className:`truncate`,children:[r.title,o[r.resourceId]?` ●`:``]})]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`关闭 ${r.title}`,disabled:!!t||(a[r.resourceId]??!1),onClick:async t=>{if(t.stopPropagation(),r.kind===`terminal`&&r.resourceId!==`terminal:empty`){n(r.id),i(``);try{let t=await AN(r.resourceId);if(!LN(ON(t.status)?t:await NN(r.resourceId,`terminate`,{confirmed:!0})))throw Error(`Termination unconfirmed`);c(e.id,r.id)}catch{i(`终止未确认,已保留 Tab;请核对状态后重试。`)}finally{n(null)}}else r.file&&o[r.resourceId]?Hj.setState({closeRequest:{windowId:e.id,tabId:r.id}}):c(e.id,r.id)},className:`window-no-drag rounded p-0.5 text-ink-3 opacity-70 transition-opacity hover:bg-black/[.06] hover:text-ink group-hover:opacity-100 dark:hover:bg-white/[.08]`,children:(0,B.jsx)(sy,{size:10})})]})},r.id)})}),h?(0,B.jsx)(`button`,{type:`button`,"aria-label":`向右滚动 Tab`,className:`shrink-0 px-1 text-ink-3 hover:text-ink`,onClick:()=>m.current?.scrollBy({left:180,behavior:`smooth`}),children:(0,B.jsx)(o_,{size:13})}):null,p===`terminal`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{id:`terminal-controls-${d}`,className:`flex shrink-0`}),(0,B.jsx)(lG,{label:`新建终端 Tab`,className:`flex w-8 shrink-0 items-center justify-center text-ink-3 hover:bg-surface-2 hover:text-ink`,scope:e.tabs[0]?.projectId?{projectId:e.tabs[0].projectId}:e.tabs[0]?.originType===`session`&&e.tabs[0].sourceSessionId?{sessionId:e.tabs[0].sourceSessionId}:{workspace:`default`},children:(0,B.jsx)(Ov,{size:14})})]}):null]})}function vG({window:e}){let t=Fj(e=>e.focus),n=Fj(e=>e.close),r=Fj(e=>e.hide),i=Fj(e=>e.toggleMaximize),a=Fj(e=>e.togglePin),o=Fj(e=>e.setBounds),{data:s}=ej(),c=yj(vj(e.tabs,e.filter),e.activeTabId),l=pI(c,s);return(0,B.jsxs)(fI,{bounds:`parent`,dragHandleClassName:`window-drag-handle`,cancel:`.window-no-drag`,disableDragging:e.maximized,enableResizing:!e.maximized,minWidth:420,minHeight:280,size:e.maximized?{width:`100%`,height:`100%`}:{width:e.width,height:e.height},position:e.maximized?{x:0,y:0}:{x:e.x,y:e.y},onMouseDown:()=>t(e.id),onDragStop:(t,n)=>o(e.id,{x:n.x,y:n.y,width:e.width,height:e.height}),onResizeStop:(t,n,r,i,a)=>o(e.id,{x:a.x,y:a.y,width:r.offsetWidth,height:r.offsetHeight}),style:{zIndex:e.z,display:e.minimized?`none`:`flex`,flexDirection:`column`},inert:e.minimized,"data-window-frame":e.id,role:`dialog`,"aria-label":l,className:z(`pointer-events-auto flex flex-col overflow-hidden border border-line bg-surface window-shadow`,e.maximized?`rounded-none`:`rounded-xl`),children:[(0,B.jsxs)(`div`,{className:`window-drag-handle flex h-10 shrink-0 items-center gap-2 border-b border-line bg-surface-2/55 px-3`,children:[(0,B.jsxs)(`div`,{className:`window-no-drag group/traffic flex items-center gap-1.5`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`关闭窗口`,title:`关闭窗口`,onClick:()=>n(e.id),className:`flex h-3 w-3 items-center justify-center rounded-full bg-[#ff5f57] text-[8px] text-[#6b0d08] opacity-95 transition-opacity hover:brightness-95`,children:(0,B.jsx)(sy,{size:7,strokeWidth:2.8,className:`opacity-0 group-hover/traffic:opacity-100`})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`隐藏窗口`,title:`隐藏窗口`,onClick:()=>r(e.id),className:`flex h-3 w-3 items-center justify-center rounded-full bg-[#febc2e] text-[8px] text-[#6b4b00] opacity-95 transition-opacity hover:brightness-95`,children:(0,B.jsx)(uv,{size:7,strokeWidth:3,className:`opacity-0 group-hover/traffic:opacity-100`})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":e.maximized?`还原窗口`:`最大化窗口`,title:e.maximized?`还原窗口`:`最大化窗口`,onClick:()=>i(e.id),className:`flex h-3 w-3 items-center justify-center rounded-full bg-[#28c840] text-[8px] text-[#0b4d12] opacity-95 transition-opacity hover:brightness-95`,children:e.maximized?(0,B.jsx)(cv,{size:7,strokeWidth:2.8,className:`opacity-0 group-hover/traffic:opacity-100`}):(0,B.jsx)(iv,{size:7,strokeWidth:2.8,className:`opacity-0 group-hover/traffic:opacity-100`})})]}),(0,B.jsxs)(`div`,{className:`pointer-events-none absolute left-1/2 -translate-x-1/2 text-center`,children:[(0,B.jsx)(`div`,{className:`max-w-[260px] truncate text-[11.5px] font-medium text-ink`,children:l}),(0,B.jsx)(`div`,{className:`text-[9px] text-ink-3`,children:yG(c?.kind)})]}),(0,B.jsx)(`div`,{className:`window-no-drag ml-auto flex items-center`,children:(0,B.jsx)(Iu,{label:e.pinned?`取消置顶`:`置顶窗口`,active:e.pinned,className:`h-6 w-6`,onClick:()=>a(e.id),children:e.pinned?(0,B.jsx)(Sv,{size:12}):(0,B.jsx)(wv,{size:12})})})]}),c?.kind===`services`?null:(0,B.jsx)(_G,{window:e}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:c?(0,B.jsx)(mG,{tab:c,visible:!e.minimized}):(0,B.jsx)(`div`,{className:`flex h-full items-center justify-center text-[11px] text-ink-3`,children:`暂无打开的 Tab`})})]})}function yG(e){switch(e){case`files`:return`文件`;case`terminal`:return`终端`;case`services`:return`服务`;case`browser`:return`预览`;case`git-diff`:return`Diff`;default:return``}}function bG({scope:e,paths:t}){let n=Kj(e,t),r=Ij(e);return(0,H.useEffect)(()=>{Hj.setState(e=>({monitoring:{...e.monitoring,[r]:n}}))},[r,n]),(0,B.jsx)(`span`,{className:`sr-only`,role:`status`,children:n})}function xG(){let e=(0,H.useRef)([]),t=Fj(e=>e.windows),n=Hj(e=>e.drafts),r=Hj(e=>e.closeRequest),[i,a]=(0,H.useState)(null),[o,s]=(0,H.useState)(!1),c=new Map;for(let e of t)for(let t of e.tabs){if(!t.file)continue;let e=Ij(t.file.scope),n=c.get(e)??{scope:t.file.scope,paths:[]};n.paths.push(t.file.path),c.set(e,n)}(0,H.useEffect)(()=>{let n=t.flatMap(e=>e.tabs.filter(e=>e.file).map(e=>e.resourceId)),r=e.current.filter(e=>!n.includes(e));r.length&&zI(async()=>{let{disposeFileModel:e}=await import(`./FileEditor-twkRcPR8.js`);return{disposeFileModel:e}},__vite__mapDeps([5,1,2,3,4])).then(({disposeFileModel:e})=>{for(let t of r)Fj.getState().windows.some(e=>e.tabs.some(e=>e.file&&e.resourceId===t))||e(t)}),e.current=n},[t]),(0,H.useEffect)(()=>{let e=e=>{Object.keys(Hj.getState().drafts).length&&(e.preventDefault(),e.returnValue=``)};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[]);let l=r?t.find(e=>e.id===r.windowId)?.tabs.find(e=>e.id===r.tabId):void 0,u=()=>{Hj.setState({closeRequest:null}),a(null)},d=()=>{r&&l&&(Hj.getState().discard(l.resourceId),Fj.getState().closeTab(r.windowId,r.tabId),u())};return(0,B.jsxs)(B.Fragment,{children:[[...c].map(([e,t])=>(0,B.jsx)(bG,{...t},e)),r&&l&&n[l.resourceId]?(0,B.jsx)(ca,{open:!0,onOpenChange:e=>{!e&&!o&&u()},children:(0,B.jsxs)(ua,{className:`pointer-events-auto space-y-4 text-sm`,children:[(0,B.jsx)(da,{children:`未保存的文件`}),(0,B.jsxs)(fa,{children:[l.title,` 有未保存的改动。`]}),(0,B.jsx)(Ou,{message:i,onDismiss:()=>a(null)}),(0,B.jsxs)(`div`,{className:`flex gap-3`,children:[(0,B.jsx)(V,{type:`button`,disabled:o,onClick:()=>{s(!0),Gj(l).then(d).catch(e=>a(Vj(e))).finally(()=>s(!1))},children:`保存并关闭`}),(0,B.jsx)(V,{type:`button`,variant:`secondary`,disabled:o,onClick:d,children:`放弃改动`}),(0,B.jsx)(V,{type:`button`,variant:`secondary`,disabled:o,onClick:u,children:`取消`})]})]})}):null]})}function SG(){let e=Fj(e=>e.closeRequest);return e?(0,B.jsx)(CG,{request:e},JSON.stringify(e)):null}function CG({request:e}){let t=Fj(e=>e.windows),n=Hj(e=>e.drafts),r=Hj(e=>e.saving),[i,a]=(0,H.useState)(e.tabIds.length<=1),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(``),u=t.find(t=>t.id===e.windowId)?.tabs.filter(t=>e.tabIds.includes(t.id))??[],d=u.find(e=>e.file&&n[e.resourceId]),f=o||u.some(e=>r[e.resourceId]),p=()=>Fj.setState({closeRequest:null});return(0,H.useEffect)(()=>{if(!(!i||d||f)){for(let t of u)Fj.getState().closeTab(e.windowId,t.id);Fj.setState({closeRequest:null})}},[i,d,f,u,e.windowId]),i&&!d?null:(0,B.jsx)(ca,{open:!0,onOpenChange:e=>{!e&&!f&&p()},children:(0,B.jsxs)(ua,{className:`pointer-events-auto space-y-4 text-sm`,onEscapeKeyDown:e=>{f&&e.preventDefault()},onPointerDownOutside:e=>{f&&e.preventDefault()},children:[(0,B.jsx)(da,{children:i?`未保存的文件`:`关闭 ${u.length} 个 Tab?`}),(0,B.jsx)(fa,{children:i?`${d?.title??`文件`} 有未保存的改动。`:`最小化可以保留这些 Tab,关闭后需要重新打开。`}),(0,B.jsx)(Ou,{message:c,onDismiss:()=>l(``)}),(0,B.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,disabled:f,onClick:p,children:`取消`}),i?d?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(V,{variant:`secondary`,disabled:f,onClick:()=>{Hj.getState().discard(d.resourceId),l(``)},children:`放弃改动并继续`}),(0,B.jsx)(V,{disabled:f,onClick:()=>{s(!0),l(``),Gj(d).then(()=>{Hj.getState().drafts[d.resourceId]&&l(`文件在保存期间有新改动,请再次保存。`)}).catch(()=>l(`保存失败,已保留文件和草稿,请核对后重试。`)).finally(()=>s(!1))},children:`保存并继续`})]}):null:(0,B.jsx)(V,{onClick:()=>a(!0),children:`关闭全部 Tab`})]})]})})}function wG({window:e}){let[t,n]=(0,H.useState)(!e.minimized);if(!t){if(e.minimized)return null;n(!0)}return(0,B.jsx)(vG,{window:e})}function TG(){let{projectId:e,sessionId:t}=Xj(),{data:n}=ej(),r=Jj(e,t,n.sessions),i=Fj(e=>e.windows),a=Fj(e=>e.setBounds);return(0,H.useEffect)(()=>{let e=()=>{for(let e of Fj.getState().windows)e.maximized||a(e.id,{x:e.x,y:e.y,width:e.width,height:e.height})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[a]),(0,H.useEffect)(()=>{let e=window.setTimeout(()=>{for(let e of Fj.getState().windows)e.maximized||a(e.id,{x:e.x,y:e.y,width:e.width,height:e.height})},50);return()=>window.clearTimeout(e)},[a]),(0,H.useEffect)(()=>{let e=e=>{e.button===0&&e.target instanceof Element&&(document.querySelector(`[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]`)||e.target.closest(`[data-window-frame], [data-window-dock], [data-project-resources], [role="dialog"], [role="alertdialog"], [role="menu"]`)||Fj.getState().hideScope(r))};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[r]),(0,B.jsx)(iG,{windows:i,children:(0,B.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 z-40 overflow-hidden`,children:[(0,B.jsx)(SG,{}),(0,B.jsx)(xG,{}),i.filter(e=>Ej(e)===r).map(e=>(0,B.jsx)(wG,{window:e},e.id))]})})}var EG={files:M_,terminal:Jv,services:Iv,browser:S_,"git-diff":q_};function DG(){let{data:e}=ej(),{projectId:t,sessionId:n}=Xj(),{windows:r,focusedId:i,open:a,restore:o}=Fj(),s=Jj(t,n,e.sessions),c=qj(t,n,e.sessions),l=r.filter(e=>Ej(e)===s),u=n=>{let r=l.find(e=>e.tabs[0]?.kind===n);r?o(r.id):(e.terminals.find(e=>e.projectId===t),e.services.find(e=>e.projectId===t),a({kind:n,resourceId:`${n}:empty`,title:n===`terminal`?`终端`:`服务`,projectId:t,sessionId:`sessionId`in c?c.sessionId:null,source:t?`project`:`session`}))};return(0,B.jsx)(`div`,{className:`pointer-events-none relative z-10 mb-1.5 flex justify-center px-1`,children:(0,B.jsxs)(`nav`,{"aria-label":`项目窗口`,"data-window-dock":!0,className:`window-tabs-scroll pointer-events-auto flex max-w-full items-center gap-0.5 overflow-x-auto rounded-[10px] border border-line bg-surface/90 p-0.5 shadow-[var(--shadow-card)] backdrop-blur-xl`,children:[[`terminal`,`services`].map(e=>{let t=EG[e],n=l.find(t=>t.tabs[0]?.kind===e),r=n&&!n.minimized&&n.id===i;return(0,B.jsxs)(`button`,{type:`button`,"aria-label":e===`terminal`?`打开终端窗口`:`打开服务窗口`,"aria-pressed":!!r,onClick:()=>u(e),className:z(`flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 [@media(pointer:coarse)]:h-11 text-[11px] font-medium transition-colors`,r?`bg-accent-soft text-accent`:`text-ink-2 hover:bg-surface-2 hover:text-ink`),children:[(0,B.jsx)(t,{size:12,strokeWidth:1.7,className:e===`terminal`?`text-accent`:`text-success`}),e===`terminal`?`终端`:`服务`,n&&n.tabs.filter(e=>!e.resourceId.endsWith(`:empty`)).length>0?(0,B.jsx)(`span`,{className:`rounded bg-black/[.045] px-1 font-mono text-[9px] dark:bg-white/[.08]`,children:n.tabs.filter(e=>!e.resourceId.endsWith(`:empty`)).length}):null]},e)}),l.filter(e=>e.minimized&&![`terminal`,`services`].includes(e.tabs[0]?.kind??``)).map(e=>{let t=e.tabs.find(t=>t.id===e.activeTabId)??e.tabs[0];if(!t)return null;let n=EG[t.kind];return(0,B.jsxs)(`button`,{type:`button`,"aria-label":`恢复 ${t.title}`,onClick:()=>o(e.id),title:t.title,className:`flex h-6 max-w-32 shrink-0 items-center gap-1 rounded-md px-1.5 [@media(pointer:coarse)]:h-11 text-[11px] text-ink-2 transition-colors hover:bg-surface-2 hover:text-ink`,children:[(0,B.jsx)(n,{size:12,className:`shrink-0 text-accent`}),(0,B.jsx)(`span`,{className:`truncate`,children:t.title}),e.tabs.length>1?(0,B.jsx)(`span`,{className:`text-[9px] text-ink-3`,children:e.tabs.length}):null]},e.id)})]})})}function OG(e){let t=new Set(e.filter(e=>e.kind===`message`&&e.role===`user`&&e.turnOutcome!==void 0).map(e=>e.turnId));return e.filter(e=>e.kind===`approval`&&e.status===`pending`&&(e.turnId===void 0||!t.has(e.turnId)))}var kG=[{id:`off`,label:`关闭`},{id:`low`,label:`低`},{id:`medium`,label:`中`},{id:`high`,label:`高`}];function AG(e){return e===`on`?`开启`:kG.find(t=>t.id===e)?.label??`关闭`}function jG(e){return e===`glm`?`GLM`:e===`openai-compatible`?`兼容`:`DeepSeek`}function MG({groups:e,model:t,credentialProfileId:n,thinking:r,catalogError:i,onSelectModel:a,onSelectThinking:o}){let s=(0,H.useRef)(null),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(`root`),f=t?.thinking.supported===!0,p=f?AG(r):`不支持`;(0,H.useEffect)(()=>{if(!c)return;let e=e=>{s.current!==null&&!s.current.contains(e.target)&&l(!1)},t=e=>{e.key===`Escape`&&l(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[c]);let m=()=>{d(`root`),l(e=>!e)},h=(t,n)=>{a(t,n);let r=e.find(e=>e.credentialProfileId===n)?.models.find(e=>e.id===t);r!==void 0&&!r.thinking.supported&&o(`off`),l(!1)},g=e=>{o(e),l(!1)};return(0,B.jsxs)(`div`,{ref:s,className:`relative`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-label":`模型与思考:${t?.label??`未配置凭据`} · ${p}`,"aria-expanded":c,onClick:m,className:`flex h-7 min-w-0 items-center gap-1.5 rounded-lg px-1.5 text-[11px] font-medium text-ink-2 transition-colors hover:bg-black/[.045] hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40 dark:hover:bg-white/[.06]`,children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,B.jsx)(`span`,{className:`max-w-[96px] truncate sm:max-w-[128px]`,children:t?.label??`选择模型`}),t?(0,B.jsx)(`span`,{className:z(`shrink-0 text-[10px] font-semibold`,r===`off`||!f?`text-ink-3`:`text-accent`),children:p}):null]}),(0,B.jsx)(n_,{size:11,className:`shrink-0 text-ink-3`})]}),c?(0,B.jsxs)(`div`,{role:`dialog`,"aria-label":`模型与思考`,className:`absolute bottom-[calc(100%+8px)] left-0 z-40 w-[240px] rounded-xl border border-line bg-surface/95 p-1.5 text-ink shadow-[var(--shadow-pop)] backdrop-blur-xl`,children:[u===`root`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`button`,{type:`button`,"aria-label":`模型:${t?.label??`选择模型`}`,onClick:()=>d(`models`),className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left transition-colors hover:bg-black/[.05] dark:hover:bg-white/[.07]`,children:[(0,B.jsx)(`span`,{className:`w-12 shrink-0 text-[10px] text-ink-3`,children:`模型`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11.5px] text-ink`,children:t?.label??`选择模型`}),(0,B.jsx)(o_,{size:11,className:`shrink-0 text-ink-3`})]}),(0,B.jsxs)(`button`,{type:`button`,"aria-label":`思考等级:${p}`,disabled:!f,onClick:()=>d(`thinking`),className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left transition-colors hover:bg-black/[.05] disabled:opacity-50 dark:hover:bg-white/[.07]`,children:[(0,B.jsx)(`span`,{className:`w-12 shrink-0 text-[10px] text-ink-3`,children:`思考等级`}),(0,B.jsx)(`span`,{className:z(`min-w-0 flex-1 truncate text-[11.5px]`,f&&r!==`off`?`text-accent`:`text-ink`),children:p}),f?(0,B.jsx)(o_,{size:11,className:`shrink-0 text-ink-3`}):null]})]}):null,u===`models`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1 px-1 pb-1 pt-0.5`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`返回`,onClick:()=>d(`root`),className:`flex h-5 w-5 items-center justify-center rounded-md text-ink-3 hover:bg-black/[.05] hover:text-ink dark:hover:bg-white/[.07]`,children:(0,B.jsx)(i_,{size:12})}),(0,B.jsx)(`span`,{className:`text-[10.5px] font-semibold text-ink-3`,children:`模型`})]}),(0,B.jsxs)(`div`,{className:`max-h-[300px] overflow-y-auto`,children:[e.length===0?(0,B.jsx)(`p`,{className:`mx-1 rounded-lg border border-dashed border-line px-2 py-1.5 text-[10.5px] leading-relaxed text-ink-3`,children:`未配置凭据。先在设置中添加 Key 并刷新目录。`}):null,e.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`truncate px-2.5 pb-1 pt-1 text-[10px] text-ink-3`,children:[jG(e.provider),` · `,e.credentialLabel]}),e.models.length===0?(0,B.jsx)(`p`,{className:`mx-1 mb-1 rounded-lg border border-dashed border-line px-2 py-1.5 text-[10.5px] leading-relaxed text-ink-3`,children:e.lastRefreshError||i?`该 Key 的目录读取失败,请在设置中刷新。`:`该 Key 还没有可用模型,请在设置中刷新目录。`}):e.models.map(r=>{let i=r.id===t?.id&&e.credentialProfileId===n;return(0,B.jsxs)(`button`,{type:`button`,"aria-pressed":i,disabled:r.contextWindow===null,onClick:()=>h(r.id,e.credentialProfileId),className:z(`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-[11.5px] transition-colors`,r.contextWindow===null?`cursor-not-allowed text-ink-3 opacity-50`:i?`bg-black/[.04] text-ink dark:bg-white/[.06]`:`text-ink-2 hover:bg-black/[.05] hover:text-ink dark:hover:bg-white/[.07]`),children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r.label}),(0,B.jsx)(`span`,{className:`shrink-0 text-[9.5px] text-ink-3`,children:r.contextWindow===null?`窗口未知`:`${Math.round(r.contextWindow/1024)}K`}),i?(0,B.jsx)(e_,{size:13,className:`shrink-0 text-accent`}):null]},`${e.credentialProfileId}:${r.id}`)})]},e.credentialProfileId))]})]}):null,u===`thinking`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1 px-1 pb-1 pt-0.5`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`返回`,onClick:()=>d(`root`),className:`flex h-5 w-5 items-center justify-center rounded-md text-ink-3 hover:bg-black/[.05] hover:text-ink dark:hover:bg-white/[.07]`,children:(0,B.jsx)(i_,{size:12})}),(0,B.jsx)(`span`,{className:`text-[10.5px] font-semibold text-ink-3`,children:`思考等级`})]}),kG.map(e=>{let t=e.id===r;return(0,B.jsxs)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>g(e.id),className:z(`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-[11.5px] transition-colors`,t?`bg-black/[.04] text-ink dark:bg-white/[.06]`:`text-ink-2 hover:bg-black/[.05] hover:text-ink dark:hover:bg-white/[.07]`),children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),t?(0,B.jsx)(e_,{size:13,className:`shrink-0 text-accent`}):null]},e.id)})]}):null]}):null]})}var NG=[{id:`standard`,label:`标准审批`,detail:`L0/L1 自动,L2 询问`,icon:Bv,tone:`text-accent`},{id:`strict`,label:`严格审批`,detail:`所有写入都询问`,icon:Hv,tone:`text-warning`},{id:`autonomous`,label:`完全自主`,detail:`所有工具免人工审批`,icon:Hv,tone:`text-danger`},{id:`readonly`,label:`只读`,detail:`禁止修改与执行`,icon:Wv,tone:`text-success`}];function PG(e){return e.thinking.supported?e.thinking.mode===`toggle`?`on`:e.thinking.mode===`mandatory-levels`?`high`:`medium`:`off`}function FG(e,t){if(!e.thinking.supported)return t===`off`;let n=e.thinking.mode??`levels`;return n===`toggle`?t===`off`||t===`on`:n===`mandatory-levels`?[`low`,`medium`,`high`].includes(t):[`off`,`low`,`medium`,`high`].includes(t)}function IG({centered:e=!1,onSubmit:t}){let[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(null),{catalog:o,error:s}=tj(),c=lN(e=>e.draft),l=lN(e=>e.modelId),u=lN(e=>e.thinking),d=lN(e=>e.policy),f=lN(e=>e.setDraft),p=lN(e=>e.setModelId),m=lN(e=>e.credentialProfileId),h=lN(e=>e.setThinking),g=lN(e=>e.setCredentialProfileId),_=lN(e=>e.setPolicy),v=bP(e=>e.isStreaming),y=bP(e=>e.send),b=bP(e=>e.stop),x=Xj(e=>e.focusComposerNonce),S=Xj(e=>!!e.sessionId),C=(0,H.useRef)(null),w=nj(Xj(e=>e.sessionId)),T=(0,H.useRef)(null),E=(0,H.useRef)(null),D=(o?.groups??(o?[o]:[])).map(e=>({...e,models:e.models.filter(e=>e.visible!==!1&&e.contextWindow!==null)})),O=D.flatMap(e=>e.models.map(t=>({group:e,model:t}))),k=O.find(e=>e.model.id===l&&(m===null||e.group.credentialProfileId===m))??O.find(e=>e.model.id===l),A=k?.model??O[0]?.model,j=NG.find(e=>e.id===d)??NG[0],M=j.icon,N=bP(e=>e.modelUsage),ee=A?N[A.id]:void 0,te=bP(e=>OG(e.items).length>0);(0,H.useEffect)(()=>{x>0&&C.current?.focus()},[x]),(0,H.useEffect)(()=>{if(i===null)return;let e=setTimeout(()=>a(null),4e3);return()=>clearTimeout(e)},[i]),(0,H.useEffect)(()=>{w!==null&&w.id!==T.current&&(T.current=w.id,w.model&&p(w.model),w.credentialProfileId&&g(w.credentialProfileId),w.thinking&&h(w.thinking==="default"?`medium`:w.thinking))},[w,p,g,h]),(0,H.useEffect)(()=>{if(w===null||w.model)return;let e=o?.defaultSelection;e&&E.current!==w.id&&(E.current=w.id,p(e.model),g(e.credentialProfileId),h(e.thinking))},[w,o,p,g,h]),(0,H.useEffect)(()=>{if(O.length===0)return;if(!O.some(e=>e.model.id===l&&(m===null||e.group.credentialProfileId===m))){let e=O[0];if(e===void 0)return;p(e.model.id),g(e.group.credentialProfileId),h(PG(e.model));return}let e=O.find(e=>e.model.id===l&&(m===null||e.group.credentialProfileId===m));e!==void 0&&!FG(e.model,u)&&h(PG(e.model))},[O,l,u,m,p,g,h]),(0,H.useEffect)(()=>{let e=C.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(180,Math.max(48,e.scrollHeight))}px`)},[c]);let P=e=>{let t=c&&!c.endsWith(` `)?` `:``;f(`${c}${t}${e} `),requestAnimationFrame(()=>C.current?.focus())},ne=(e,t)=>{p(e),g(t);let n=O.find(n=>n.model.id===e&&n.group.credentialProfileId===t);n!==void 0&&(a(`已切换到 ${n.model.label}`),FG(n.model,u)||h(PG(n.model)))},F=()=>{if(!S||A===void 0||v||te)return;let e=c.trim();e&&(t?.(),y(e),f(``),requestAnimationFrame(()=>C.current?.focus()))};return(0,B.jsxs)(`div`,{className:`relative rounded-[18px] border border-line bg-surface shadow-[var(--shadow-card)] transition-[border-color,box-shadow] focus-within:border-accent/35 focus-within:ring-2 focus-within:ring-accent/10`,children:[i?(0,B.jsx)(`p`,{role:`status`,className:`pointer-events-none absolute bottom-full left-2 mb-1 w-fit max-w-[calc(100%-1rem)] truncate rounded-md bg-surface/90 px-2 py-0.5 text-[10.5px] text-ink-3`,children:i}):null,(0,B.jsx)(Nu,{variant:`bare`,ref:C,value:c,rows:1,placeholder:S?e?`提问、描述要做的改动…`:`继续对话,或提出新的任务…`:`新建或选择一个会话…`,"aria-label":`对话输入`,onChange:e=>f(e.target.value),onKeyDown:e=>{if(e.key===`Enter`&&!e.shiftKey){if(e.nativeEvent.isComposing)return;e.preventDefault(),v||F()}},className:`block max-h-[180px] min-h-[48px] w-full resize-none bg-transparent px-3.5 pt-3 text-[13px] leading-[1.65] text-ink outline-none placeholder:text-ink-3 focus:outline-none focus-visible:outline-none`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 pb-2 pt-1`,children:[(0,B.jsxs)(bu,{children:[(0,B.jsx)(xu,{asChild:!0,children:(0,B.jsx)(Iu,{label:`添加上下文`,className:`h-7 w-7`,children:(0,B.jsx)(Ov,{size:15})})}),(0,B.jsxs)(Cu,{align:`start`,className:`w-[220px]`,children:[(0,B.jsx)(wu,{children:`添加上下文`}),[`@README.md`,`@package.json`,`@apps/web/src/app/AppShell.tsx`].map(e=>(0,B.jsx)(Tu,{onSelect:()=>P(e),className:`font-mono text-[10.5px]`,children:e},e))]})]}),(0,B.jsx)(MG,{groups:D,model:A,credentialProfileId:m??k?.group.credentialProfileId??null,thinking:u,catalogError:s,onSelectModel:ne,onSelectThinking:h}),(0,B.jsxs)(bu,{children:[(0,B.jsx)(xu,{asChild:!0,children:(0,B.jsx)(Iu,{label:`审批策略:${j.label}`,title:`${j.label} · ${j.detail}`,className:`h-7 w-7`,children:(0,B.jsx)(M,{size:15,className:j.tone,"aria-hidden":`true`})})}),(0,B.jsxs)(Cu,{align:`start`,className:`w-[230px]`,children:[(0,B.jsx)(wu,{children:`审批策略`}),(0,B.jsx)(Su,{value:d,onValueChange:e=>{e===`autonomous`&&d!==`autonomous`?r(!0):NG.some(t=>t.id===e)&&_(e)},children:NG.map(e=>(0,B.jsx)(Eu,{value:e.id,className:`items-start py-2`,children:(0,B.jsxs)(`span`,{className:`flex flex-col`,children:[(0,B.jsx)(`span`,{className:`text-[11.5px] font-medium text-ink`,children:e.label}),(0,B.jsx)(`span`,{className:`text-[10px] text-ink-3`,children:e.detail})]})},e.id))})]})]}),(0,B.jsx)(`span`,{className:`flex-1`}),(0,B.jsx)(LG,{used:ee?.inputTokens??null,limit:ee?.contextWindow??A?.contextWindow??128e3}),v?(0,B.jsx)(`button`,{type:`button`,onClick:b,"aria-label":`停止执行`,className:`ml-1 flex h-7 w-7 items-center justify-center rounded-full bg-danger/10 text-danger transition-colors hover:bg-danger/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-danger/40`,children:(0,B.jsx)(Xv,{size:11,fill:`currentColor`})}):(0,B.jsx)(`button`,{type:`button`,onClick:F,disabled:!c.trim()||!S||A===void 0||te,"aria-label":`发送消息`,className:z(`ml-1 flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50`,c.trim()&&S&&A!==void 0&&!te?`bg-accent text-white shadow-[var(--shadow-card)] hover:brightness-110 active:brightness-95`:`bg-black/[.06] text-ink-3 dark:bg-white/[.08]`),children:(0,B.jsx)(Jg,{size:15,strokeWidth:2.2})})]}),(0,B.jsx)(ca,{open:n,onOpenChange:r,children:(0,B.jsxs)(ua,{className:`space-y-4 text-sm`,children:[(0,B.jsx)(da,{children:`启用完全自主?`}),(0,B.jsx)(fa,{children:`Agent 将不再逐次请求工具审批,可自行修改或删除文件、执行命令、进行 Git 推送等操作。程序以本机账户权限运行,可访问项目外文件和网络。请仅在信任当前任务时启用。下一轮生效,随时可以切回标准审批。`}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(V,{variant:`secondary`,onClick:()=>r(!1),children:`取消`}),(0,B.jsx)(V,{variant:`danger`,onClick:()=>{_(`autonomous`),r(!1)},children:`确认启用`})]})]})})]})}function LG({used:e,limit:t}){let n=e!==null&&Number.isFinite(e)&&e>0&&t>0,r=n?Math.min(100,Math.max(0,Math.round(e/t*100))):0,i=n?`单次输入:${e.toLocaleString()} / ${t.toLocaleString()} tokens(${r}%)`:`暂无统计 · 模型窗口 ${t.toLocaleString()} tokens`;return(0,B.jsx)(Hd,{label:i,side:`top`,children:(0,B.jsx)(`div`,{role:`progressbar`,"aria-label":`上下文用量`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n?r:void 0,"aria-valuetext":i,className:z(`flex h-7 w-7 shrink-0 items-center justify-center`,n?r>=90?`text-danger`:r>=75?`text-warning`:`text-accent`:`text-ink-3`),children:(0,B.jsxs)(`svg`,{"aria-hidden":`true`,width:`18`,height:`18`,viewBox:`0 0 20 20`,className:`-rotate-90`,fill:`none`,children:[(0,B.jsx)(`circle`,{cx:`10`,cy:`10`,r:`7`,stroke:`currentColor`,strokeWidth:`2`,className:`text-line-strong`}),n?(0,B.jsx)(`circle`,{cx:`10`,cy:`10`,r:`7`,pathLength:`100`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`100`,strokeDashoffset:100-r,className:`transition-[stroke-dashoffset] duration-150 motion-reduce:transition-none`}):null]})})})}function RG(){let e=bP(e=>e.items),t=bP(e=>e.sessionId),n=OG(e),[r,i]=(0,H.useState)(null),a=Math.max(0,n.findIndex(e=>e.id===r)),o=n[a];return o?(0,B.jsx)(zG,{item:o,index:a,total:n.length,navigate:e=>i(n[a+e]?.id??o.id)},`${t}:${o.id}`):null}function zG({item:e,index:t,total:n,navigate:r}){let i=bP(e=>e.resolveApproval),{data:a}=ej(),o=Xj(e=>e.projectId),[s,c]=(0,H.useState)(!1),[l,u]=(0,H.useState)(null),[d,f]=(0,H.useState)(Date.now);(0,H.useEffect)(()=>{let e=window.setInterval(()=>f(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let p=e.expiresAt!==void 0&&d>=e.expiresAt,m=async t=>{if(!(s||p)){c(!0),u(null);try{await i(e.id,t)}catch(e){u(oA(e,`审批提交失败,请重试`))}finally{c(!1)}}};return(0,B.jsxs)(`section`,{"aria-label":`待处理审批`,className:`mb-2 max-h-[min(42dvh,360px)] overflow-y-auto rounded-xl border border-warning/25 bg-surface p-2.5 shadow-[var(--shadow-card)] text-[12px]`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-ink`,children:[(0,B.jsx)(Bv,{size:14,className:`text-warning`}),(0,B.jsx)(`span`,{children:`需要批准`}),n>1?(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1 text-ink-3`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`上一项审批`,disabled:s||t===0,onClick:()=>r(-1),className:`rounded p-1 disabled:opacity-30`,children:(0,B.jsx)(i_,{size:14})}),(0,B.jsxs)(`span`,{children:[t+1,`/`,n]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`下一项审批`,disabled:s||t===n-1,onClick:()=>r(1),className:`rounded p-1 disabled:opacity-30`,children:(0,B.jsx)(o_,{size:14})})]}):null]}),(0,B.jsx)(`pre`,{className:`mt-1.5 max-h-16 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-surface-2 px-2 py-1.5 font-mono text-[12px] text-ink`,children:e.summary??e.impact??`请求执行操作`}),p?(0,B.jsx)(`p`,{role:`status`,className:`mt-1.5 text-ink-3`,children:`审批已过期,等待任务更新。`}):null,(0,B.jsx)(Ou,{message:l,onDismiss:()=>u(null)}),(0,B.jsxs)(`div`,{className:`mt-1.5 flex items-start gap-3`,children:[(0,B.jsxs)(`details`,{className:`min-w-0 flex-1 pt-1 text-[11px] text-ink-3`,children:[(0,B.jsx)(`summary`,{className:`cursor-pointer`,children:`查看操作详情`}),(0,B.jsxs)(`div`,{className:`mt-1.5 space-y-1 whitespace-pre-wrap break-words`,children:[(0,B.jsxs)(`div`,{children:[a.projects.find(e=>e.id===o)?.name??`默认工作区`,` ·`,` `,e.toolName??e.serviceName??`操作`]}),(0,B.jsxs)(`div`,{children:[`授权范围:仅本次操作 · 风险 `,e.risk??`—`]}),e.expiresAt===void 0?null:(0,B.jsxs)(`div`,{children:[`有效至 `,new Date(e.expiresAt).toLocaleTimeString()]}),(0,B.jsx)(`pre`,{className:`max-h-28 overflow-auto whitespace-pre-wrap`,children:JSON.stringify(e.scope??{},null,2)})]})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 gap-1.5`,children:[(0,B.jsx)(V,{variant:`primary`,size:`sm`,"aria-label":e.toolName?`批准执行`:`批准部署`,disabled:s||p,onClick:()=>void m(`approve`),children:s?`提交中…`:`批准本次`}),(0,B.jsx)(V,{variant:`secondary`,size:`sm`,disabled:s||p,onClick:()=>void m(`reject`),children:`拒绝`})]})]})]})}function BG({icon:e,label:t,ariaLabel:n,onClick:r,disabled:i,titleAttr:a}){return(0,B.jsxs)(`button`,{type:`button`,"aria-label":n,title:a??n,disabled:i,onClick:r,className:z(`group inline-flex h-7 max-w-full items-center gap-1.5 rounded-full border border-line/80 bg-surface-2/55 px-2 text-[11px] text-ink-2`,`transition-colors hover:border-accent/35 hover:bg-accent-soft/30 hover:text-ink`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,`disabled:pointer-events-none disabled:opacity-55`),children:[(0,B.jsx)(e,{size:11,className:`shrink-0 text-accent`}),(0,B.jsx)(`span`,{className:`truncate`,children:t}),(0,B.jsx)(Kg,{size:10,className:`shrink-0 text-ink-3 group-hover:text-accent`})]})}function VG(e){return e.split(`/`).pop()??e}function HG({target:e}){let[t,n]=(0,H.useState)(!1),[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(!1);return(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(BG,{icon:P_,label:`文件 · ${VG(e.path)}`,ariaLabel:`查看文件 · ${e.path}`,disabled:a,onClick:()=>{o(!0),i(null),Uj(e.scope,e.path,`agent`).then(t=>n(e.version!==void 0&&e.version!==t.version)).catch(e=>i(Vj(e))).finally(()=>o(!1))}}),t?(0,B.jsx)(`p`,{role:`status`,className:`mt-1 text-[10.5px] text-ink-3`,children:`文件已变化,已打开当前版本。`}):null,(0,B.jsx)(Ou,{message:r,onDismiss:()=>i(null)})]})}function UG({target:e}){let t=Fj(e=>e.open),n=e.name??e.path;return(0,B.jsx)(BG,{icon:S_,label:`预览 · ${n}`,ariaLabel:`打开预览 · ${n}`,onClick:()=>t({kind:`browser`,resourceId:`browser:${e.serviceId}:${e.path}`,browser:{serviceId:e.serviceId,path:e.path},title:`预览服务`,projectId:e.projectId,source:`agent`})})}function WG(e){return(0,B.jsx)(GG,{...e},JSON.stringify([e.projectId,e.terminalId]))}function GG({terminalId:e,projectId:t,label:n,ariaLabel:r,className:i,variant:a=`link`}){let[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(null),u=(0,H.useRef)(0),d=(0,H.useRef)(!1);(0,H.useEffect)(()=>()=>{u.current+=1,d.current=!1},[]);let f=async()=>{if(d.current)return;d.current=!0;let n=++u.current;s(!0),l(null);try{let r=await AN(e);if(n!==u.current)return;r.id!==e||r.projectId!==t?l({text:`终端归属已变化,无法打开。`,error:!0}):LN(r)?l({text:`终端已关闭`}):r.status===`RUNNING`?PN(r):l({text:r.status===`STOPPING`?`终端正在关闭,请稍后重试。`:r.status===`CREATED`?`终端正在创建,请稍后重试。`:`终端状态异常,请核对状态后重试。`})}catch(e){if(n!==u.current)return;l(e instanceof aA&&e.status===404?{text:`终端已关闭或已被清理`}:{text:`无法读取终端状态,请重试。`,error:!0})}finally{n===u.current&&(d.current=!1,s(!1))}};return(0,B.jsxs)(`div`,{className:`min-w-0`,children:[a===`card`?(0,B.jsx)(BG,{icon:Jv,label:`终端 · ${n.replace(/^打开终端 · /,``)}`,ariaLabel:r??n,disabled:o,onClick:()=>void f()}):(0,B.jsxs)(`button`,{type:`button`,disabled:o,"aria-label":r,"aria-busy":o,onClick:()=>void f(),className:z(`flex max-w-full items-center gap-2 py-1 text-left text-[12px] text-ink-2 hover:text-ink disabled:opacity-50`,i),children:[(0,B.jsx)(Jv,{size:13,className:`shrink-0 text-accent`}),(0,B.jsx)(`span`,{className:`break-all`,children:n})]}),c?.error?(0,B.jsx)(Ou,{message:c.text,onDismiss:()=>l(null)}):c?(0,B.jsx)(`p`,{role:`status`,className:`mt-1 text-[11px] text-ink-3`,children:c.text}):null]})}function KG({target:e}){return(0,B.jsx)(WG,{terminalId:e.terminalId,projectId:e.projectId,label:`打开终端 · ${e.role??e.terminalId}`,variant:`card`})}function qG({files:e,targets:t}){let[n,r]=(0,H.useState)(!1);if(e.length===0)return null;let i=e.filter(e=>!e.existed).length,a=`过程文件 ${e.length} 个${i>0?` · 已清理 ${i} 个`:``}`;return(0,B.jsxs)(`div`,{className:`text-[11px] text-ink-3`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-label":a,"aria-expanded":n,onClick:()=>r(e=>!e),className:`flex items-center gap-1 rounded-md py-0.5 text-left transition-colors hover:text-accent`,children:[(0,B.jsx)(o_,{size:12,className:z(`shrink-0`,n&&`rotate-90`)}),(0,B.jsx)(`span`,{children:a})]}),n?(0,B.jsx)(`ul`,{className:`mt-1 ml-1.5 space-y-1 border-l border-line pl-3`,children:e.map(e=>{let n=t.get(e.path);return(0,B.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[e.existed&&n!==void 0?(0,B.jsx)(HG,{target:n}):(0,B.jsx)(`span`,{className:`break-all`,children:e.path}),(0,B.jsxs)(`span`,{className:`shrink-0`,children:[e.changeType===`created`?`已创建`:`已修改`,e.existed?``:` · 已删除`]})]},e.path)})}):null]})}function JG(e,t){let n=Wd(),[r,i]=(0,H.useState)(`正在连接输出…`);return(0,H.useEffect)(()=>{if(!t)return;let r=!1,a,o,s,c=1e3,l=!1,u=(t=!1)=>{l||=!t,r||s||(s=setTimeout(()=>{s=void 0,r||(n.invalidateQueries({queryKey:[`command`,e,`output`]}),l&&n.invalidateQueries({queryKey:[`command`,e,`state`]})),l=!1},250))},d=()=>{if(r)return;let t=new URL(`/ws`,window.location.href);t.protocol=t.protocol===`https:`?`wss:`:`ws:`,a=new WebSocket(t),a.onopen=()=>{a?.send(JSON.stringify({type:`subscribe`,subscriptions:[{topic:`command`,resourceId:e,after:0}]})),c=1e3,i(`实时输出已连接`),u()},a.onmessage=t=>{let n;try{n=JSON.parse(String(t.data))}catch{return}let r=oO.safeParse(n),i=rO.safeParse(n);r.success&&r.data.resourceId===e&&u(!0),i.success&&i.data.resourceId===e&&u()},a.onerror=()=>i(`输出连接中断,正在刷新状态…`),a.onclose=()=>{r||(i(`输出连接中断,正在重连…`),u(),o=setTimeout(d,c),c=Math.min(c*2,1e4))}};return d(),()=>{r=!0,clearTimeout(o),clearTimeout(s),a?.close()}},[t,n,e]),r}var YG={CREATED:`准备执行`,RUNNING:`执行中`,CANCELLING:`正在停止`,COMPLETED:`已完成`,FAILED:`执行失败`,CANCELLED:`已取消`,TIMED_OUT:`执行超时`,INTERRUPTED:`执行中断`},XG=e=>!e||[`CREATED`,`RUNNING`,`CANCELLING`].includes(e);async function ZG(e,t){let n=t?.cursor??0,r=t?.text??``,i=t?.truncated??!1,a=t?.gap??!1;for(let t=0;t<64;t++){let t=aO.parse(await Y(`/api/commands/${e}/output?after=${n}&limit=500`));if(t.resyncRequired&&!t.chunks.length&&(r=``),r+=t.chunks.filter(e=>e.cursor>n).map(e=>e.data).join(``),i||=t.truncated,a||=t.resyncRequired,t.nextCursor<=n||t.chunks.length<500)return{text:r,truncated:i,gap:a,cursor:t.nextCursor};n=t.nextCursor}return{text:r,truncated:!0,gap:a,cursor:n}}function QG({commandId:e}){let t=Wd(),n=gp({queryKey:[`command`,e,`state`],queryFn:async()=>iO.parse(await Y(`/api/commands/${e}`)),staleTime:0,refetchInterval:e=>XG(e.state.data?.status)&&!e.state.error?2e3:!1}),r=XG(n.data?.status);JG(e,r&&!n.error);let i=gp({queryKey:[`command`,e,`output`],queryFn:()=>ZG(e,t.getQueryData([`command`,e,`output`])),staleTime:0,refetchInterval:r&&!n.error?2e3:!1}),a=n.data?.status;(0,H.useEffect)(()=>{a&&!XG(a)&&t.invalidateQueries({queryKey:[`command`,e,`output`]})},[t,e,a]);let o=()=>t.invalidateQueries({queryKey:[`command`,e]}),s=_p({mutationFn:async()=>iO.parse(await Y(`/api/commands/${e}/cancel`,{method:`POST`,body:{},csrf:!0})),onSuccess:n=>{t.setQueryData([`command`,e,`state`],n),o()},onError:()=>{o()}});return(0,B.jsxs)(`section`,{"aria-label":`命令执行`,className:`mt-2 overflow-hidden rounded-xl border border-line bg-surface`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-2 text-[11px]`,children:[(0,B.jsx)(`span`,{className:`font-semibold text-ink`,children:`命令执行`}),(0,B.jsx)(`span`,{role:`status`,className:`text-ink-2`,children:n.data?YG[n.data.status]:n.error?`命令不可用`:`正在读取状态…`}),n.data?.exitCode!==null&&n.data?.exitCode!==void 0?(0,B.jsxs)(`span`,{className:`font-mono text-ink-3`,children:[`退出码 `,n.data.exitCode]}):null,(0,B.jsxs)(`div`,{className:`ml-auto flex flex-wrap gap-1`,children:[(0,B.jsx)(V,{size:`sm`,variant:`secondary`,onClick:()=>void o(),children:`刷新输出`}),n.data&&r?(0,B.jsx)(V,{size:`sm`,variant:`secondary`,disabled:s.isPending||n.data.status===`CANCELLING`,onClick:()=>s.mutate(),children:`取消命令`}):null]})]}),n.data?.reasonCode?(0,B.jsxs)(`p`,{className:`px-3 text-[11px] text-ink-2`,children:[`原因:`,n.data.reasonCode]}):null,n.data?.status===`INTERRUPTED`?(0,B.jsx)(`p`,{className:`px-3 text-[11px] text-warning`,children:`执行已中断;停止情况以状态原因为准,不能确认时项目保持受阻。`}):null,(0,B.jsx)(Ou,{message:s.error?`取消命令失败,请刷新确认。`:n.error||i.error?`命令状态或输出读取失败。`:null,onDismiss:s.error?()=>s.reset():void 0}),i.data?.gap?(0,B.jsx)(`p`,{className:`px-3 text-[11px] text-warning`,children:`输出有缺口,以下仅为当前可用记录。`}):null,i.data?.truncated||n.data?.truncated?(0,B.jsx)(`p`,{className:`px-3 text-[11px] text-warning`,children:`输出已截断。`}):null,(0,B.jsx)(`pre`,{role:`log`,"aria-label":`命令输出`,className:`max-h-[200px] overflow-auto whitespace-pre-wrap break-words border-t border-line bg-surface-2 px-3 py-2 font-mono text-[11px] text-ink-2`,children:i.data?.text||(r?`等待命令输出…`:`无可用输出`)})]})}function $G(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var eK=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tK=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nK={};function rK(e,t){return((t||nK).jsx?tK:eK).test(e)}var iK=/[ \t\n\f\r]/g;function aK(e){return typeof e==`object`?e.type===`text`&&oK(e.value):oK(e)}function oK(e){return e.replace(iK,``)===``}var sK=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};sK.prototype.normal={},sK.prototype.property={},sK.prototype.space=void 0;function cK(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new sK(n,r,t)}function lK(e){return e.toLowerCase()}var uK=class{constructor(e,t){this.attribute=t,this.property=e}};uK.prototype.attribute=``,uK.prototype.booleanish=!1,uK.prototype.boolean=!1,uK.prototype.commaOrSpaceSeparated=!1,uK.prototype.commaSeparated=!1,uK.prototype.defined=!1,uK.prototype.mustUseProperty=!1,uK.prototype.number=!1,uK.prototype.overloadedBoolean=!1,uK.prototype.property=``,uK.prototype.spaceSeparated=!1,uK.prototype.space=void 0;var dK=s({boolean:()=>pK,booleanish:()=>mK,commaOrSpaceSeparated:()=>vK,commaSeparated:()=>_K,number:()=>$,overloadedBoolean:()=>hK,spaceSeparated:()=>gK}),fK=0,pK=yK(),mK=yK(),hK=yK(),$=yK(),gK=yK(),_K=yK(),vK=yK();function yK(){return 2**++fK}var bK=Object.keys(dK),xK=class extends uK{constructor(e,t,n,r){let i=-1;if(super(e,t),SK(this,`space`,r),typeof n==`number`)for(;++i<bK.length;){let e=bK[i];SK(this,bK[i],(n&dK[e])===dK[e])}}};xK.prototype.defined=!0;function SK(e,t,n){n&&(e[t]=n)}function CK(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new xK(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[lK(r)]=r,n[lK(a.attribute)]=r}return new sK(t,n,e.space)}var wK=CK({properties:{ariaActiveDescendant:null,ariaAtomic:mK,ariaAutoComplete:null,ariaBusy:mK,ariaChecked:mK,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:gK,ariaCurrent:null,ariaDescribedBy:gK,ariaDetails:null,ariaDisabled:mK,ariaDropEffect:gK,ariaErrorMessage:null,ariaExpanded:mK,ariaFlowTo:gK,ariaGrabbed:mK,ariaHasPopup:null,ariaHidden:mK,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gK,ariaLevel:$,ariaLive:null,ariaModal:mK,ariaMultiLine:mK,ariaMultiSelectable:mK,ariaOrientation:null,ariaOwns:gK,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:mK,ariaReadOnly:mK,ariaRelevant:null,ariaRequired:mK,ariaRoleDescription:gK,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:mK,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function TK(e,t){return t in e?e[t]:t}function EK(e,t){return TK(e,t.toLowerCase())}var DK=CK({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:_K,acceptCharset:gK,accessKey:gK,action:null,allow:null,allowFullScreen:pK,allowPaymentRequest:pK,allowUserMedia:pK,alpha:pK,alt:null,as:null,async:pK,autoCapitalize:null,autoComplete:gK,autoFocus:pK,autoPlay:pK,blocking:gK,capture:null,charSet:null,checked:pK,cite:null,className:gK,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:mK,controls:pK,controlsList:gK,coords:$|_K,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pK,defer:pK,dir:null,dirName:null,disabled:pK,download:hK,draggable:mK,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pK,formTarget:null,headers:gK,height:$,hidden:hK,high:$,href:null,hrefLang:null,htmlFor:gK,httpEquiv:gK,id:null,imageSizes:null,imageSrcSet:null,inert:pK,inputMode:null,integrity:null,is:null,isMap:pK,itemId:null,itemProp:gK,itemRef:gK,itemScope:pK,itemType:gK,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pK,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:pK,muted:pK,name:null,nonce:null,noModule:pK,noValidate:pK,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:pK,optimum:$,pattern:null,ping:gK,placeholder:null,playsInline:pK,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pK,referrerPolicy:null,rel:gK,required:pK,reversed:pK,rows:$,rowSpan:$,sandbox:gK,scope:null,scoped:pK,seamless:pK,selected:pK,shadowRootClonable:pK,shadowRootCustomElementRegistry:pK,shadowRootDelegatesFocus:pK,shadowRootMode:null,shadowRootSerializable:pK,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:mK,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:pK,useMap:null,value:mK,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gK,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pK,declare:pK,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:pK,noHref:pK,noShade:pK,noWrap:pK,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:mK,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:pK,disablePictureInPicture:pK,disableRemotePlayback:pK,exportParts:_K,part:gK,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:EK}),OK=CK({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`,maskType:`mask-type`,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:vK,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:gK,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:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:pK,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,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:_K,g2:_K,glyphName:_K,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:vK,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,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:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gK,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vK,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vK,rev:vK,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vK,requiredFeatures:vK,requiredFonts:vK,requiredFormats:vK,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:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:vK,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vK,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vK,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:TK}),kK=CK({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),AK=CK({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:EK}),jK=CK({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),MK={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},NK=/[A-Z]/g,PK=/-[a-z]/g,FK=/^data[-\w.:]+$/i;function IK(e,t){let n=lK(t),r=t,i=uK;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&FK.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(PK,RK);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!PK.test(e)){let n=e.replace(NK,LK);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=xK}return new i(r,t)}function LK(e){return`-`+e.toLowerCase()}function RK(e){return e.charAt(1).toUpperCase()}var zK=cK([wK,DK,kK,AK,jK],`html`),BK=cK([wK,OK,kK,AK,jK],`svg`);function VK(e){return e.join(` `).trim()}var HK=/\/\*(?:[^*]|\*(?!\/))*\*\//g,UK=/\n/g,WK=/^\s*/,GK=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,KK=/^:\s*/,qK=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,JK=/^[;\s]*/,YK=`
128
- `,XK=`/`,ZK=`*`,QK=``,$K=`comment`,eq=`declaration`;function tq(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(UK);t&&(n+=t.length);var i=e.lastIndexOf(YK);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(WK)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(XK==e.charAt(0)&&ZK==e.charAt(1)){for(var n=2;QK!=e.charAt(n)&&(ZK!=e.charAt(n)||XK!=e.charAt(n+1));)++n;if(n+=2,QK===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:$K,comment:o})}}function f(){var e=a(),t=c(GK);if(t){if(d(),!c(KK))return s(`property missing ':'`);var n=c(qK),r=e({type:eq,property:t[0].replace(HK,QK).trim(),value:n?n[0].replace(HK,QK).trim():QK});return c(JK),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function nq(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=tq(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var rq=aq(`end`),iq=aq(`start`);function aq(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function oq(e){let t=iq(e),n=rq(e);if(t&&n)return{start:t,end:n}}function sq(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?lq(e.position):`start`in e||`end`in e?lq(e):`line`in e||`column`in e?cq(e):``}function cq(e){return uq(e&&e.line)+`:`+uq(e&&e.column)}function lq(e){return cq(e&&e.start)+`-`+cq(e&&e.end)}function uq(e){return e&&typeof e==`number`?e:1}var dq=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=sq(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};dq.prototype.file=``,dq.prototype.name=``,dq.prototype.reason=``,dq.prototype.message=``,dq.prototype.stack=``,dq.prototype.column=void 0,dq.prototype.line=void 0,dq.prototype.ancestors=void 0,dq.prototype.cause=void 0,dq.prototype.fatal=void 0,dq.prototype.place=void 0,dq.prototype.ruleId=void 0,dq.prototype.source=void 0;var fq={}.hasOwnProperty,pq=new Map,mq=/[A-Z]/g,hq=/-([a-z])/g,gq=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),_q=new Set([`td`,`th`]),vq=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function yq(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Aq(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=kq(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?BK:zK,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=bq(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function bq(e,t,n){if(t.type===`element`)return xq(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Sq(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return wq(e,t,n);if(t.type===`mdxjsEsm`)return Cq(e,t);if(t.type===`root`)return Tq(e,t,n);if(t.type===`text`)return Eq(e,t)}function xq(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=BK,e.schema=i),e.ancestors.push(t);let a=Iq(e,t.tagName,!1),o=jq(e,t),s=Nq(e,t);return gq.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!aK(e)})),Dq(e,o,a,t),Oq(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Sq(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Lq(e,t.position)}function Cq(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lq(e,t.position)}function wq(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=BK,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Iq(e,t.name,!0),o=Mq(e,t),s=Nq(e,t);return Dq(e,o,a,t),Oq(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Tq(e,t,n){let r={};return Oq(r,Nq(e,t)),e.create(t,e.Fragment,r,n)}function Eq(e,t){return t.value}function Dq(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Oq(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function kq(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Aq(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=iq(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function jq(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&fq.call(t.properties,i)){let a=Pq(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&_q.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Mq(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Lq(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Lq(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Nq(e,t){let n=[],r=-1,i=e.passKeys?new Map:pq;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=bq(e,a,o);s!==void 0&&n.push(s)}return n}function Pq(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=IK(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?$G(n):VK(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:Rq(n):Fq(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?MK[r.property]||r.property:r.attribute,n]}function Fq(e,t){let n={};try{nq(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(hq,Vq))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new dq("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=vq+`#cannot-parse-style-attribute`,r}return n}function Iq(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=rK(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=rK(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return fq.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Lq(e)}function Lq(e,t){let n=new dq("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=vq+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Rq(e){let t={},n;for(n in e)fq.call(e,n)&&(t[zq(n)]=e[n]);return t}function zq(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(mq,Bq);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Bq(e){return`-`+e.toLowerCase()}function Vq(e,t){return t.toUpperCase()}var Hq={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Uq={};function Wq(e,t){let n=t||Uq;return Gq(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Gq(e,t,n){if(qq(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Kq(e.children,t,n)}return Array.isArray(e)?Kq(e,t,n):``}function Kq(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Gq(e[i],t,n);return r.join(``)}function qq(e){return!!(e&&typeof e==`object`)}var Jq=document.createElement(`i`);function Yq(e){let t=`&`+e+`;`;Jq.innerHTML=t;let n=Jq.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Xq(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Zq(e,t){return e.length>0?(Xq(e,e.length,0,t),e):t}var Qq={}.hasOwnProperty;function $q(e){let t={},n=-1;for(;++n<e.length;)eJ(t,e[n]);return t}function eJ(e,t){let n;for(n in t){let r=(Qq.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Qq.call(r,a)||(r[a]=[]);let e=i[a];tJ(r[a],Array.isArray(e)?e:e?[e]:[])}}}function tJ(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Xq(e,0,0,r)}function nJ(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function rJ(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var iJ=gJ(/[A-Za-z]/),aJ=gJ(/[\dA-Za-z]/),oJ=gJ(/[#-'*+\--9=?A-Z^-~]/);function sJ(e){return e!==null&&(e<32||e===127)}var cJ=gJ(/\d/),lJ=gJ(/[\dA-Fa-f]/),uJ=gJ(/[!-/:-@[-`{-~]/);function dJ(e){return e!==null&&e<-2}function fJ(e){return e!==null&&(e<0||e===32)}function pJ(e){return e===-2||e===-1||e===32}var mJ=gJ(/\p{P}|\p{S}/u),hJ=gJ(/\s/);function gJ(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function _J(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&aJ(e.charCodeAt(n+1))&&aJ(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function vJ(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return pJ(r)?(e.enter(n),s(r)):t(r)}function s(r){return pJ(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function yJ(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&pJ(t)?(e.enter(r),c(t)):l(t)}function c(t){return pJ(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var bJ={tokenize:xJ};function xJ(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),vJ(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return dJ(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var SJ=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){CJ(this,e,t,n,!1)}addBefore(e,t,n){CJ(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function CJ(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var wJ={tokenize:EJ},TJ={tokenize:DJ};function EJ(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new SJ;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(TJ,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(TJ,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return dJ(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new SJ;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function DJ(e,t,n){return vJ(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function OJ(e){if(e===null||fJ(e)||hJ(e))return 1;if(mJ(e))return 2}function kJ(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var AJ={name:`attention`,resolveAll:jJ,tokenize:MJ};function jJ(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};NJ(o,-a),NJ(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=Zq(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=Zq(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=Zq(r,kJ(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Zq(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=Zq(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Xq(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function MJ(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=OJ(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=OJ(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function NJ(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var PJ={name:`autolink`,tokenize:FJ};function FJ(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return iJ(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||aJ(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||aJ(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||sJ(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):oJ(t)?(e.consume(t),l):n(t)}function u(e){return aJ(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||aJ(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var IJ={partial:!0,tokenize:LJ};function LJ(e,t,n){return r;function r(t){return pJ(t)?vJ(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||dJ(e)?t(e):n(e)}}var RJ={continuation:{tokenize:BJ},exit:VJ,name:`blockQuote`,tokenize:zJ};function zJ(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return pJ(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function BJ(e,t,n){let r=this;return i;function i(t){return pJ(t)?vJ(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(RJ,t,n)(r)}}function VJ(e){e.exit(`blockQuote`)}var HJ={name:`characterEscape`,tokenize:UJ};function UJ(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return uJ(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var WJ={name:`characterReference`,tokenize:GJ};function GJ(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=aJ,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=lJ,u):(e.enter(`characterReferenceValue`),a=7,o=cJ,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===aJ&&!Yq(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var KJ={partial:!0,tokenize:qJ};function qJ(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var JJ={concrete:!0,name:`codeFenced`,tokenize:YJ};function YJ(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),pJ(t)?vJ(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||dJ(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(KJ,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||dJ(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):pJ(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),vJ(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||dJ(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||dJ(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&pJ(t)?vJ(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||dJ(t)?e.check(KJ,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||dJ(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),pJ(t)?vJ(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),pJ(t)?vJ(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||dJ(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var XJ={name:`codeIndented`,tokenize:QJ},ZJ={partial:!0,tokenize:$J};function QJ(e,t,n){return r;function r(t){return e.enter(`codeIndented`),yJ(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):dJ(t)?e.attempt(ZJ,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||dJ(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function $J(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):dJ(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):yJ(e,t,a,`linePrefix`,4,4)(o)}function a(e){return dJ(e)?i(e):n(e)}}var eY={name:`codeText`,previous:nY,resolve:tY,tokenize:rY};function tY(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function nY(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function rY(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):dJ(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||dJ(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var iY=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&aY(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),aY(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),aY(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);aY(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);aY(this.left,t.reverse())}}}};function aY(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function oY(e){let t={},n=-1,r,i,a,o,s,c,l,u=new iY(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,sY(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Xq(e,0,1/0,u.slice(0)),!l}function sY(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var cY={resolve:uY,tokenize:dY},lY={partial:!0,tokenize:fY};function uY(e){return oY(e),e}function dY(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):dJ(t)?e.check(lY,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function fY(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),vJ(e,a,`linePrefix`)}function a(i){if(i===null||dJ(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function pY(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||sJ(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||dJ(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||fJ(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||sJ(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function mY(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):dJ(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||dJ(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!pJ(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function hY(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):dJ(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),vJ(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||dJ(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function gY(e,t){let n;return r;function r(i){return dJ(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):pJ(i)?vJ(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var _Y={name:`definition`,tokenize:yY},vY={partial:!0,tokenize:bY};function yY(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return mY.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=rJ(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return fJ(t)?gY(e,l)(t):l(t)}function l(t){return pY(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(vY,d,d)(t)}function d(t){return pJ(t)?vJ(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||dJ(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function bY(e,t,n){return r;function r(t){return fJ(t)?gY(e,i)(t):n(t)}function i(t){return hY(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return pJ(t)?vJ(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||dJ(e)?t(e):n(e)}}var xY={name:`hardBreakEscape`,tokenize:SY};function SY(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return dJ(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var CY={name:`headingAtx`,resolve:wY,tokenize:TY};function wY(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};Xq(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function TY(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||fJ(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||dJ(n)?(e.exit(`atxHeading`),t(n)):pJ(n)?vJ(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||fJ(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var EY=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),DY=[`pre`,`script`,`style`,`textarea`],OY={concrete:!0,name:`htmlFlow`,resolveTo:AY,tokenize:jY},kY={partial:!0,tokenize:MY};function AY(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function jY(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):iJ(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):iJ(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return iJ(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||fJ(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&DY.includes(l)?(i=1,r.interrupt?t(s):O(s)):EY.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||aJ(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return pJ(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||iJ(t)?(e.consume(t),b):pJ(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||aJ(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):pJ(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):pJ(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||dJ(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||fJ(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||pJ(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||dJ(t)?O(t):pJ(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):dJ(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(kY,F,k)(t)):t===null||dJ(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(KJ,A,F)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||dJ(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return DY.includes(n)?(e.consume(t),ne):O(t)}return iJ(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||dJ(t)?(e.exit(`htmlFlowData`),F(t)):(e.consume(t),ne)}function F(n){return e.exit(`htmlFlow`),t(n)}}function MY(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(IJ,t,n)}}var NY={name:`htmlText`,tokenize:PY};function PY(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):iJ(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):iJ(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):dJ(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):dJ(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):dJ(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):dJ(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return iJ(t)?(e.consume(t),S):n(t)}function S(t){return t===45||aJ(t)?(e.consume(t),S):C(t)}function C(t){return dJ(t)?(o=C,N(t)):pJ(t)?(e.consume(t),C):M(t)}function w(t){return t===45||aJ(t)?(e.consume(t),w):t===47||t===62||fJ(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||iJ(t)?(e.consume(t),E):dJ(t)?(o=T,N(t)):pJ(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||aJ(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):dJ(t)?(o=D,N(t)):pJ(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):dJ(t)?(o=O,N(t)):pJ(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):dJ(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||fJ(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||fJ(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return pJ(t)?vJ(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var FY={name:`labelEnd`,resolveAll:zY,resolveTo:BY,tokenize:VY},IY={tokenize:HY},LY={tokenize:UY},RY={tokenize:WY};function zY(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Xq(e,0,e.length,n),e}function BY(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=Zq(o,e.slice(i+1,i+r+3)),o=Zq(o,[[`enter`,l,t]]),o=Zq(o,kJ(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=Zq(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=Zq(o,e.slice(a+1)),o=Zq(o,[[`exit`,s,t]]),Xq(e,i,e.length,o),e}function VY(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(rJ(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(IY,u,o?u:d)(t):t===91?e.attempt(LY,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(RY,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function HY(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return fJ(t)?gY(e,a)(t):a(t)}function a(t){return t===41?u(t):pY(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return fJ(t)?gY(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?hY(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return fJ(t)?gY(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function UY(e,t,n){let r=this;return i;function i(t){return mY.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(rJ(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function WY(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var GY={name:`labelStartImage`,resolveAll:FY.resolveAll,tokenize:KY};function KY(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var qY={name:`labelStartLink`,resolveAll:FY.resolveAll,tokenize:JY};function JY(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var YY={name:`lineEnding`,tokenize:XY};function XY(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),vJ(e,t,`linePrefix`)}}var ZY={name:`thematicBreak`,tokenize:QY};function QY(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||dJ(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),pJ(t)?vJ(e,s,`whitespace`)(t):s(t))}}var $Y={continuation:{tokenize:rX},exit:aX,name:`list`,tokenize:nX},eX={partial:!0,tokenize:oX},tX={partial:!0,tokenize:iX};function nX(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:cJ(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(ZY,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return cJ(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(IJ,r.interrupt?n:u,e.attempt(eX,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return pJ(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function rX(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(IJ,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,vJ(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!pJ(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(tX,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,vJ(e,e.attempt($Y,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function iX(e,t,n){let r=this;return vJ(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function aX(e){e.exit(this.containerState.type)}function oX(e,t,n){let r=this;return vJ(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!pJ(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var sX={name:`setextUnderline`,resolveTo:cX,tokenize:lX};function cX(e,t){let n=new SJ,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function lX(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),pJ(t)?vJ(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||dJ(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var uX={tokenize:dX};function dX(e){let t=this,n=e.attempt(IJ,r,e.attempt(this.parser.constructs.flowInitial,i,vJ(e,e.attempt(this.parser.constructs.flow,i,e.attempt(cY,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var fX={resolveAll:gX()},pX=hX(`string`),mX=hX(`text`);function hX(e){return{resolveAll:gX(e===`text`?_X:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function gX(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function _X(e,t){let n=new SJ,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var vX=s({attentionMarkers:()=>EX,contentInitial:()=>bX,disable:()=>DX,document:()=>yX,flow:()=>SX,flowInitial:()=>xX,insideSpan:()=>TX,string:()=>CX,text:()=>wX}),yX={42:$Y,43:$Y,45:$Y,48:$Y,49:$Y,50:$Y,51:$Y,52:$Y,53:$Y,54:$Y,55:$Y,56:$Y,57:$Y,62:RJ},bX={91:_Y},xX={[-2]:XJ,[-1]:XJ,32:XJ},SX={35:CY,42:ZY,45:[sX,ZY],60:OY,61:sX,95:ZY,96:JJ,126:JJ},CX={38:WJ,92:HJ},wX={[-5]:YY,[-4]:YY,[-3]:YY,33:GY,38:WJ,42:AJ,60:[PJ,NY],91:qY,92:[xY,HJ],93:FY,95:AJ,96:eY},TX={null:[AJ,fX]},EX={null:[42,95]},DX={null:[]};function OX(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Zq(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=kJ(a,l.events,l),l.events):[]}function f(e,t){return AX(p(e),t)}function p(e){return kX(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){dJ(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Xq(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function kX(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function AX(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
129
- `;break;case-3:o=`\r
130
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function jX(e){let t={constructs:$q([vX,...(e||{}).extensions||[]]),content:n(bJ),defined:[],document:n(wJ),flow:n(uX),lazy:{},string:n(pX),text:n(mX)};return t;function n(e){return n;function n(n){return OX(t,e,n)}}}function MX(e){for(;!oY(e););return e}var NX=/[\0\t\n\r]/g;function PX(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){NX.lastIndex=c;let n=NX.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var FX=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function IX(e){return e.replace(FX,LX)}function LX(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return nJ(n.slice(t?2:1),t?16:10)}return Yq(n)||e}var RX={}.hasOwnProperty;function zX(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),BX(n)(MX(jX(n).document().write(PX()(e,t,!0))))}function BX(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ye),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(ge),blockQuote:o(de),characterEscape:E,characterReference:E,codeFenced:o(fe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(fe,s),codeText:o(pe,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(me),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(he),hardBreakEscape:o(_e),hardBreakTrailing:o(_e),htmlFlow:o(ve,s),htmlFlowData:E,htmlText:o(ve,s),htmlTextData:E,image:o(I),label:s,link:o(ye),listItem:o(xe),listItemValue:p,listOrdered:o(be,f),listUnordered:o(be),paragraph:o(Se),reference:ie,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ge),strong:o(Ce),thematicBreak:o(Te)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ue,autolinkProtocol:le,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:se,characterReference:ce,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(ee),label:P,labelText:te,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ae,resourceDestinationString:ne,resourceTitleString:F,resource:re,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};HX(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),RX.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||WX).call(o,void 0,e[0])}for(r.position={start:VX(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:VX(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:VX(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+sq({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||WX).call(this,e,r[0])),n.position.end=VX(e.end)}function d(){return Wq(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rJ(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=we(),n.position={start:VX(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=VX(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=VX(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=IX(t),n.identifier=rJ(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function ie(){this.data.referenceType=`collapsed`}function ae(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rJ(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function oe(e){this.data.characterReferenceType=e.type}function se(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=nJ(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Yq(t);let i=this.stack[this.stack.length-1];i.value+=r}function ce(e){let t=this.stack.pop();t.position.end=VX(e.end)}function le(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function de(){return{type:`blockquote`,children:[],position:void 0}}function fe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function pe(){return{type:`inlineCode`,value:``,position:void 0}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function he(){return{type:`emphasis`,children:[],position:void 0}}function ge(){return{type:`heading`,depth:0,children:[],position:void 0}}function _e(){return{type:`break`,position:void 0}}function ve(){return{type:`html`,value:``,position:void 0}}function I(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ye(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Se(){return{type:`paragraph`,children:[],position:void 0}}function Ce(){return{type:`strong`,children:[],position:void 0}}function we(){return{type:`text`,value:``,position:void 0}}function Te(){return{type:`thematicBreak`,position:void 0}}}function VX(e){return{line:e.line,column:e.column,offset:e.offset}}function HX(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?HX(e,r):UX(e,r)}}function UX(e,t){let n;for(n in t)if(RX.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function WX(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+sq({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sq({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+sq({start:t.start,end:t.end})+`) is still open`)}function GX(e){let t=this;t.parser=n;function n(n){return zX(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function KX(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function qX(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
131
- `}]}function JX(e,t){let n=t.value?t.value+`
132
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function YX(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XX(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZX(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=_J(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function QX(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $X(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function eZ(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function tZ(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return eZ(e,t);let i={src:_J(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function nZ(e,t){let n={src:_J(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function rZ(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function iZ(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return eZ(e,t);let i={href:_J(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function aZ(e,t){let n={href:_J(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oZ(e,t,n){let r=e.all(t),i=n?sZ(n):cZ(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
133
- `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
134
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function sZ(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=cZ(n[r])}return t}function cZ(e){return e.spread??e.children.length>1}function lZ(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function uZ(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dZ(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function fZ(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pZ(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=iq(t.children[1]),o=rq(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function mZ(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function hZ(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var gZ=9,_Z=32;function vZ(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(yZ(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(yZ(t.slice(i),i>0,!1)),a.join(``)}function yZ(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===gZ||t===_Z;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===gZ||t===_Z;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function bZ(e,t){let n={type:`text`,value:vZ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function xZ(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var SZ={blockquote:KX,break:qX,code:JX,delete:YX,emphasis:XX,footnoteReference:ZX,heading:QX,html:$X,imageReference:tZ,image:nZ,inlineCode:rZ,linkReference:iZ,link:aZ,listItem:oZ,list:lZ,paragraph:uZ,root:dZ,strong:fZ,table:pZ,tableCell:hZ,tableRow:mZ,text:bZ,thematicBreak:xZ,toml:CZ,yaml:CZ,definition:CZ,footnoteDefinition:CZ};function CZ(){}var{defineProperty:wZ}=Object,TZ=typeof self==`object`?self:globalThis,EZ=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new TZ[e](t)},DZ=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?wZ(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof TZ[e]==`function`?EZ(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(EZ(a,o),i)};return r},OZ=e=>DZ(new Map,e)(0),kZ=``,{toString:AZ}={},{keys:jZ,is:MZ}=Object,NZ=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=AZ.call(e).slice(8,-1);switch(n){case`Array`:return[1,kZ];case`Object`:return[2,kZ];case`Date`:return[3,kZ];case`RegExp`:return[4,kZ];case`Map`:return[5,kZ];case`Set`:return[6,kZ];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},PZ=([e,t])=>e===0&&(t===`function`||t===`symbol`),FZ=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=NZ(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&MZ(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of jZ(o))(e||!PZ(NZ(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?kZ:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(PZ(NZ(n))||PZ(NZ(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!PZ(NZ(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},IZ=(e,{json:t,lossy:n}={})=>{let r=[];return FZ(!(t||n),!!t,new Map,r)(e),r},LZ=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?OZ(IZ(e,t)):structuredClone(e):(e,t)=>OZ(IZ(e,t));function RZ(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function zZ(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function BZ(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||RZ,r=e.options.footnoteBackLabel||zZ,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=_J(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...LZ(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
135
- `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
136
- `}]}}var VZ=(function(e){if(e==null)return KZ;if(typeof e==`function`)return GZ(e);if(typeof e==`object`)return Array.isArray(e)?HZ(e):UZ(e);if(typeof e==`string`)return WZ(e);throw Error(`Expected function, string, or object as test`)});function HZ(e){let t=[],n=-1;for(;++n<e.length;)t[n]=VZ(e[n]);return GZ(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function UZ(e){let t=e;return GZ(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function WZ(e){return GZ(t);function t(t){return t&&t.type===e}}function GZ(e){return t;function t(t,n,r){return!!(qZ(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function KZ(){return!0}function qZ(e){return typeof e==`object`&&!!e&&`type`in e}function JZ(e){return e}var YZ=[],XZ=`skip`;function ZZ(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=VZ(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+JZ(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=YZ;if(s&&r&&(o=QZ(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=QZ(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function QZ(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?YZ:[e]}function $Z(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?ZZ(e,i,tQ(a),o):ZZ(e,i,eQ(a),o)}function eQ(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?tQ(e.enter):e.enter,exit:typeof e.exit==`function`?tQ(e.exit):e.exit}}function tQ(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var nQ={}.hasOwnProperty,rQ={};function iQ(e,t){let n=t||rQ,r=new Map,i=new Map,a={all:s,applyData:oQ,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...SZ,...n.handlers},one:o,options:n,patch:aQ,wrap:cQ};return $Z(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(nQ.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=LZ(n);return r.children=a.all(e),r}return LZ(e)}return(a.options.unknownHandler||sQ)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=lQ(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=lQ(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function aQ(e,t){e.position&&(t.position=oq(e))}function oQ(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,LZ(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function sQ(e,t){let n=t.data||{},r=`value`in t&&!(nQ.call(n,`hProperties`)||nQ.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cQ(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
137
- `});++r<e.length;)r&&n.push({type:`text`,value:`
138
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
139
- `}),n}function lQ(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function uQ(e,t){let n=iQ(e,t),r=n.one(e,void 0),i=BZ(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
140
- `},i)),a}function dQ(e,t){return e&&`run`in e?async function(n,r){let i=uQ(n,{file:r,...t});await e.run(i,r)}:function(n,r){return uQ(n,{file:r,...e||t})}}function fQ(e){if(e)throw e}var pQ=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function mQ(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function hQ(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?gQ(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function gQ(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var _Q={basename:vQ,dirname:yQ,extname:bQ,join:xQ,sep:`/`};function vQ(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);wQ(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function yQ(e){if(wQ(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function bQ(e){wQ(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function xQ(...e){let t=-1,n;for(;++t<e.length;)wQ(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:SQ(n)}function SQ(e){wQ(e);let t=e.codePointAt(0)===47,n=CQ(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function CQ(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function wQ(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var TQ={cwd:EQ};function EQ(){return`/`}function DQ(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function OQ(e){if(typeof e==`string`)e=new URL(e);else if(!DQ(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return kQ(e)}function kQ(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var AQ=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],jQ=class{constructor(e){let t;t=e?DQ(e)?{path:e}:typeof e==`string`||FQ(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:TQ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<AQ.length;){let e=AQ[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)AQ.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?_Q.basename(this.path):void 0}set basename(e){NQ(e,`basename`),MQ(e,`basename`),this.path=_Q.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?_Q.dirname(this.path):void 0}set dirname(e){PQ(this.basename,`dirname`),this.path=_Q.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?_Q.extname(this.path):void 0}set extname(e){if(MQ(e,`extname`),PQ(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=_Q.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){DQ(e)&&(e=OQ(e)),NQ(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?_Q.basename(this.path,this.extname):void 0}set stem(e){NQ(e,`stem`),MQ(e,`stem`),this.path=_Q.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new dq(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function MQ(e,t){if(e&&e.includes(_Q.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+_Q.sep+"`")}function NQ(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function PQ(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function FQ(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var IQ=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),LQ=l(pQ(),1),RQ={}.hasOwnProperty,zQ=new class e extends IQ{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=hQ()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,LQ.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(HQ(`data`,this.frozen),this.namespace[e]=t,this):RQ.call(this.namespace,e)&&this.namespace[e]||void 0:e?(HQ(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=GQ(e),n=this.parser||this.Parser;return BQ(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),BQ(`process`,this.parser||this.Parser),VQ(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=GQ(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);qQ(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),BQ(`processSync`,this.parser||this.Parser),VQ(`processSync`,this.compiler||this.Compiler),this.process(e,r),WQ(`processSync`,`process`,t),n;function r(e,r){t=!0,fQ(e),n=r}}run(e,t,n){UQ(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=GQ(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),WQ(`runSync`,`run`,n),r;function i(e,t){fQ(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=GQ(t),r=this.compiler||this.Compiler;return VQ(`stringify`,r),UQ(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(HQ(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,LQ.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];mQ(o)&&mQ(r)&&(r=(0,LQ.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function BQ(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function VQ(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function HQ(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function UQ(e){if(!mQ(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function WQ(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function GQ(e){return KQ(e)?e:new jQ(e)}function KQ(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function qQ(e){return typeof e==`string`||JQ(e)}function JQ(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var YQ=[],XQ={allowDangerousHtml:!0},ZQ=/^(https?|ircs?|mailto|xmpp)$/i,QQ=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function $Q(e){let t=e$(e),n=t$(e);return n$(t.runSync(t.parse(n),n),e)}function e$(e){let t=e.rehypePlugins||YQ,n=e.remarkPlugins||YQ,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...XQ}:XQ;return zQ().use(GX).use(n).use(dQ,r).use(t)}function t$(e){let t=e.children||``,n=new jQ;return typeof t==`string`?n.value=t:``+t,n}function n$(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||r$;for(let e of QQ)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return $Z(e,l),yq(e,{Fragment:B.Fragment,components:i,ignoreInvalidStyle:!0,jsx:B.jsx,jsxs:B.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Hq)if(Object.hasOwn(Hq,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Hq[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function r$(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||ZQ.test(e.slice(0,t))?e:``}function i$(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function a$(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function o$(e,t,n){let r=VZ((n||{}).ignore||[]),i=s$(t),a=-1;for(;++a<i.length;)ZZ(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return XZ}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i===!1)o.lastIndex=n+1;else{if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function s$(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([c$(e[0]),l$(e[1])])}return t}function c$(e){return typeof e==`string`?new RegExp(a$(e),`g`):e}function l$(e){return typeof e==`function`?e:function(){return e}}var u$=`phrasing`,d$=[`autolink`,`link`,`image`,`label`];function f$(){return{transforms:[b$],enter:{literalAutolink:m$,literalAutolinkEmail:h$,literalAutolinkHttp:h$,literalAutolinkWww:h$},exit:{literalAutolink:y$,literalAutolinkEmail:v$,literalAutolinkHttp:g$,literalAutolinkWww:_$}}}function p$(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:u$,notInConstruct:d$},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:u$,notInConstruct:d$},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:u$,notInConstruct:d$}]}}function m$(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function h$(e){this.config.enter.autolinkProtocol.call(this,e)}function g$(e){this.config.exit.autolinkProtocol.call(this,e)}function _$(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function v$(e){this.config.exit.autolinkEmail.call(this,e)}function y$(e){this.exit(e)}function b$(e){o$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,x$],[RegExp(`(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)`,`gu`),S$]],{ignore:[`link`,`linkReference`]})}function x$(e,t,n,r,i){let a=``;if(!T$(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!C$(n)))return!1;let o=w$(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function S$(e,t,n,r){return!T$(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function C$(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function w$(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=i$(e,`(`),a=i$(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function T$(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||hJ(n)||mJ(n))&&(!t||n!==47)}F$.peek=P$;function E$(){this.buffer()}function D$(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function O$(){this.buffer()}function k$(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function A$(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=rJ(this.sliceSerialize(e)).toLowerCase(),n.label=t}function j$(e){this.exit(e)}function M$(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=rJ(this.sliceSerialize(e)).toLowerCase(),n.label=t}function N$(e){this.exit(e)}function P$(){return`[`}function F$(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function I$(){return{enter:{gfmFootnoteCallString:E$,gfmFootnoteCall:D$,gfmFootnoteDefinitionLabelString:O$,gfmFootnoteDefinition:k$},exit:{gfmFootnoteCallString:A$,gfmFootnoteCall:j$,gfmFootnoteDefinitionLabelString:M$,gfmFootnoteDefinition:N$}}}function L$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:F$},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
141
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?z$:R$))),s(),o}}function R$(e,t,n){return t===0?e:z$(e,t,n)}function z$(e,t,n){return(n?``:` `)+e}var B$=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];G$.attention=K$,G$.peek=q$;function V$(){return{canContainEols:[`delete`],enter:{strikethrough:U$},exit:{strikethrough:W$}}}function H$(){return{handlers:{delete:G$},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:B$}]}}function U$(e){this.enter({type:`delete`,children:[],position:void 0},e)}function W$(e){this.exit(e)}function G$(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function K$(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function q$(){return`~`}function J$(e){return e.length}function Y$(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||J$,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=X$(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Z$(r[d]);else{let e=Z$(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding===!1||n.alignDelimiters===!1&&i===``||n.delimiterStart===!1&&!d||r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
142
- `)}function X$(e){return e==null?``:String(e)}function Z$(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var Q$=VZ([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function $$(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),e1);return i(),o}function e1(e,t,n){return`>`+(n?``:` `)+e}function t1(e,t){return n1(e,t.inConstruct,!0)&&!n1(e,t.notInConstruct,!1)}function n1(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function r1(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
143
- `&&!e.before&&!e.after&&t1(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
144
- `}function i1(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function a1(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function o1(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function s1(e,t,n,r){let i=o1(n),a=e.value||``;if(a1(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,c1);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(i1(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
145
- `,encode:["`"],...o.current()})),t()}return u+=o.move(`
146
- `),a&&(u+=o.move(a+`
147
- `)),u+=o.move(s),c(),u}function c1(e,t,n){return(n?``:` `)+e}function l1(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function u1(e,t,n,r){let i=l1(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
148
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function d1(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function f1(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function p1(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function m1(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function h1(e,t,n){let r=OJ(e),i=OJ(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function g1(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:iJ(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!iJ(a))return;for(;a===45||aJ(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&DY.includes(o)?1:EY.includes(o)?6:7}var _1=new Map([[`*`,!1],[`_`,!0]]);function v1(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function y1(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=_1.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=OJ(u.charCodeAt(u.length-1)),f=OJ((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(S1(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:v1(e,t,a),index:o}}}function b1(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?f1(n.value):p1(n.value),i=m1(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let e=n.value.slice(0,n.value.length-r.length),t=0;for(;e.charCodeAt(e.length-1-t)===92;)t++;t%2&&(e+=`\\`),n.value=e+i}}function x1(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=E1(e,c,r,i),u=y1(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function S1(e,t){let n=new Map;for(let r of e){let e=r.tokens[0].value.charAt(0),i=n.get(e);i||(i=[],n.set(e,i));let a=r.close?i.length:0;for(;a--&&r.start<r.end;){let e=i[a],n=e.end-e.start,o=r.end-r.start;if(r.split?(e.close||r.open)&&o%3&&!((n+o)%3):n!==e.markers.length||n!==o)continue;let s=r.split?n>1&&o>1?2:1:o,c=e.markers.slice(e.end-s,e.end),l=r.markers.slice(r.start,r.start+s),u=c[0],d=l[0];if(u===c[s-1]&&u.value.length===s&&d===l[s-1]&&d.value.length===s&&u.attention===d.attention)t.delete(u),t.delete(d);else{let e=[...new Set([...c,...l])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}e.end-=s,r.start+=s,e.start===e.end&&i.splice(a,1),a=i.length}r.open&&r.start<r.end&&i.push(r)}}function C1(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!uJ(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function w1(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?f1(n(i[o+1],e,t,{before:``,after:``,...c.current()})):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
149
- `)&&l.type===`html`&&g1(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(D1(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=T1(l,f.attention,t,c);a.push(e),s=p1(e.sequences[0])}else{let n=t.handle(l,e,t,{...c.current(),after:u,before:s});if(!n)continue;c.move(n),a.push(n),s=p1(n)}}return r.pop(),a}function T1(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=C1(e.type,a,o),c=s[0],l=n.enter(i);r.move(c);let u=w1(e,n,{...r.current(),before:c,after:c});return r.move(D1(u,c,c)),r.move(c),l(),{children:u,sequences:s}}function E1(e,t,n,r){let i=[],a,o=p1(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===f1(n)&&b1([e],!0),a=void 0,i.push(e),e.value&&(o=p1(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=f1(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=E1(n.children,t,c,c),m=p.length>0?p[0].value:``,h=h1(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&b1(p,!0);let g=p.length>0?p1(p[p.length-1].value):``,_=h1(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&b1(p,!1),h.outside&&d!==`
150
- `&&d!==`\r`&&b1(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function D1(e,t,n){let r=new Map,i=E1(e,r,t,n),a=i,o=y1(a,t,n);for(;o;){let s=x1(e,r,o,t,n);if(!s){a=i;break}r=s.chosen,a=s.tokens,o=s.mistake}let s=``;for(let e of a)s+=e.value;return s}O1.attention=k1,O1.peek=A1;function O1(e,t,n,r){let i=n.enter(`phrasing`),a=D1([T1(e,k1,n,n.createTracker(r))],r.before,r.after);return i(),a}function k1(e,t){return{construct:`emphasis`,markers:d1(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function A1(e,t,n){return n.options.emphasis||`*`}function j1(e,t){let n=!1;return $Z(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Wq(e)&&(t.options.setext||n))}function M1(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(j1(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
151
- `,after:`
152
- `});return r(),t(),o+`
153
- `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
154
- `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
155
- `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=m1(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}N1.peek=P1;function N1(e){return e.value||``}function P1(){return`<`}F1.peek=I1;function F1(e,t,n,r){let i=l1(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function I1(){return`!`}L1.peek=R1;function L1(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function R1(){return`!`}z1.peek=B1;function z1(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function B1(){return"`"}function V1(e,t){let n=Wq(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}H1.peek=U1;function H1(e,t,n,r){let i=l1(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(V1(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,{before:l,after:`](`,...o.current()});l+=o.move(u),c(),l+=o.move(`](`);let d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
156
- `||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:typeof p==`string`?` `:`)`,...o.current()}))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function U1(e,t,n){return V1(e,n)?`<`:`[`}W1.peek=G1;function W1(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function G1(){return`[`}function K1(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function q1(e){let t=K1(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function J1(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Y1(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function X1(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?J1(n):K1(n),s=e.ordered?o===`.`?`)`:`.`:q1(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),Y1(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Z1(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Q1(e,t,n,r){let i=Z1(n),a=n.bulletCurrent||K1(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function $1(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function e0(e,t,n,r){if(!e.children.some(function(e){return Q$(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function t0(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}n0.attention=r0,n0.peek=i0;function n0(e,t,n,r){let i=n.enter(`phrasing`),a=D1([T1(e,r0,n,n.createTracker(r))],r.before,r.after);return i(),a}function r0(e,t){return{construct:`strong`,markers:t0(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function i0(e,t,n){return n.options.strong||`*`}function a0(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function o0(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function s0(e,t,n){let r=(Y1(n)+(n.options.ruleSpaces?` `:``)).repeat(o0(n));return n.options.ruleSpaces?r.slice(0,-1):r}var c0={blockquote:$$,break:r1,code:s1,definition:u1,emphasis:O1,hardBreak:r1,heading:M1,html:N1,image:F1,imageReference:L1,inlineCode:z1,link:H1,linkReference:W1,list:X1,listItem:Q1,paragraph:$1,root:e0,strong:n0,text:a0,thematicBreak:s0};function l0(){return{enter:{table:u0,tableData:m0,tableHeader:m0,tableRow:f0},exit:{codeText:h0,table:d0,tableData:p0,tableHeader:p0,tableRow:p0}}}function u0(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function d0(e){this.exit(e),this.data.inTable=void 0}function f0(e){this.enter({type:`tableRow`,children:[]},e)}function p0(e){this.exit(e)}function m0(e){this.enter({type:`tableCell`,children:[]},e)}function h0(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,g0));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function g0(e,t){return t===`|`?t:e}function _0(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
157
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
158
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Y$(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=c0.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function v0(){return{exit:{taskListCheckValueChecked:b0,taskListCheckValueUnchecked:b0,paragraph:x0}}}function y0(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:S0}}}function b0(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function x0(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function S0(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=c0.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function C0(){return[f$(),I$(),V$(),l0(),v0()]}function w0(e){return{extensions:[p$(),L$(e),H$(),_0(e),y0()]}}var T0={tokenize:z0,partial:!0},E0={tokenize:B0,partial:!0},D0={tokenize:V0,partial:!0},O0={tokenize:H0,partial:!0},k0={tokenize:U0,partial:!0},A0={name:`wwwAutolink`,tokenize:L0,previous:W0},j0={name:`protocolAutolink`,tokenize:R0,previous:G0},M0={name:`emailAutolink`,tokenize:I0,previous:K0},N0={};function P0(){return{text:N0}}for(var F0=48;F0<123;)N0[F0]=M0,F0++,F0===58?F0=65:F0===91&&(F0=97);N0[43]=M0,N0[45]=M0,N0[46]=M0,N0[95]=M0,N0[72]=[M0,j0],N0[104]=[M0,j0],N0[87]=[M0,A0],N0[119]=[M0,A0];function I0(e,t,n){let r=this,i,a;return o;function o(t){return!q0(t)||!K0.call(r,r.previous)||J0(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return q0(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(k0,u,l)(t):t===45||t===95||aJ(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&iJ(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function L0(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!W0.call(r,r.previous)||J0(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(T0,e.attempt(E0,e.attempt(D0,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function R0(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&G0.call(r,r.previous)&&!J0(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(iJ(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||sJ(t)||fJ(t)||hJ(t)||mJ(t)?n(t):e.attempt(E0,e.attempt(D0,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function z0(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function B0(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(O0,c,s)(t):t===null||fJ(t)||hJ(t)||t!==45&&mJ(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function V0(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(O0,t,a)(o):o===null||fJ(o)||hJ(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function H0(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||fJ(o)||hJ(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||fJ(e)||hJ(e)?t(e):r(e)}function a(e){return iJ(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):iJ(t)?(e.consume(t),o):n(t)}}function U0(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return aJ(e)?n(e):t(e)}}function W0(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||fJ(e)}function G0(e){return!iJ(e)}function K0(e){return!(e===47||q0(e))}function q0(e){return e===43||e===45||e===46||e===95||aJ(e)}function J0(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Y0={tokenize:r2,partial:!0};function X0(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:e2,continuation:{tokenize:t2},exit:n2}},text:{91:{name:`gfmFootnoteCall`,tokenize:$0},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Z0,resolveTo:Q0}}}}function Z0(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=rJ(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Q0(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function $0(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||fJ(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(rJ(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return fJ(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function e2(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||fJ(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=rJ(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return fJ(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),vJ(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function t2(e,t,n){return e.check(IJ,t,e.attempt(Y0,t,n))}function n2(e){e.exit(`gfmFootnoteDefinition`)}function r2(e,t,n){let r=this;return vJ(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function i2(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Xq(o,o.length,0,kJ(s,e.slice(r+1,n),t)),Xq(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Xq(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=OJ(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=OJ(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var a2=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){o2(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function o2(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function s2(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function c2(){return{flow:{null:{name:`table`,tokenize:l2,resolveAll:u2}}}}function l2(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):dJ(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):pJ(t)?vJ(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||fJ(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,pJ(t)?vJ(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return pJ(t)?vJ(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||dJ(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return pJ(t)?vJ(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||dJ(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||dJ(n)?(e.exit(`tableRow`),t(n)):pJ(n)?vJ(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||fJ(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function u2(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new a2;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(f2(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=d2(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=d2(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=d2(f,t,o,i,n,d)):(o[0]=o[1],d=d2(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&f2(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=s2(t.events,n))}return e}function d2(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},p2(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=p2(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=p2(t.events,n[2]),a=p2(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},p2(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function f2(e,t,n,r,i){let a=[],o=p2(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function p2(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var m2={name:`tasklistCheck`,tokenize:g2};function h2(){return{text:{91:m2}}}function g2(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return fJ(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return dJ(r)?t(r):pJ(r)?e.check({tokenize:_2},t,n)(r):n(r)}}function _2(e,t,n){return vJ(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function v2(e){return $q([P0(),X0(),i2(e),c2(),h2()])}var y2={};function b2(e){let t=this,n=e||y2,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(v2(n)),a.push(C0()),o.push(w0(n))}var x2={h1:({children:e})=>(0,B.jsx)(`h1`,{className:`mb-2 mt-1 text-[15px] font-medium leading-6 text-ink`,children:e}),h2:({children:e})=>(0,B.jsx)(`h2`,{className:`mb-1.5 mt-3 text-[14px] font-medium leading-5 text-ink`,children:e}),h3:({children:e})=>(0,B.jsx)(`h3`,{className:`mb-1 mt-2.5 text-[13px] font-medium leading-5 text-ink`,children:e}),p:({children:e})=>(0,B.jsx)(`p`,{className:`my-1.5 leading-[1.65] first:mt-0 last:mb-0`,children:e}),strong:({children:e})=>(0,B.jsx)(`strong`,{className:`font-medium text-ink`,children:e}),em:({children:e})=>(0,B.jsx)(`em`,{className:`italic`,children:e}),a:({children:e,href:t})=>(0,B.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent`,children:e}),ul:({children:e})=>(0,B.jsx)(`ul`,{className:`my-1.5 list-disc space-y-0.5 pl-5 marker:text-ink-3`,children:e}),ol:({children:e})=>(0,B.jsx)(`ol`,{className:`my-1.5 list-decimal space-y-0.5 pl-5 marker:text-ink-3`,children:e}),li:({children:e})=>(0,B.jsx)(`li`,{className:`leading-[1.65]`,children:e}),blockquote:({children:e})=>(0,B.jsx)(`blockquote`,{className:`my-2 border-l-2 border-accent/30 pl-3 text-ink-2`,children:e}),hr:()=>(0,B.jsx)(`hr`,{className:`my-3 border-line`}),pre:({children:e})=>(0,B.jsx)(`pre`,{className:`my-2 overflow-x-auto rounded-lg bg-surface-2 px-3 py-2.5 font-mono text-[12px] leading-5 text-ink`,children:e}),code:({children:e,className:t})=>(0,B.jsx)(`code`,{className:t?`font-mono ${t}`:`rounded bg-black/[.06] px-1 py-[1px] font-mono text-[.92em] text-ink dark:bg-white/[.1]`,children:e}),table:({children:e})=>(0,B.jsx)(`div`,{className:`my-2 overflow-x-auto rounded-lg border border-line`,children:(0,B.jsx)(`table`,{className:`w-full border-collapse text-left text-[11.5px]`,children:e})}),thead:({children:e})=>(0,B.jsx)(`thead`,{className:`bg-surface-2 text-ink-2`,children:e}),th:({children:e})=>(0,B.jsx)(`th`,{className:`border-b border-line px-2.5 py-1.5 font-medium`,children:e}),td:({children:e})=>(0,B.jsx)(`td`,{className:`border-b border-line/70 px-2.5 py-1.5 align-top last:border-b-0`,children:e}),tr:({children:e})=>(0,B.jsx)(`tr`,{className:`last:[&>td]:border-b-0`,children:e})};function S2({text:e}){return(0,B.jsx)(`div`,{className:`markdown-body [&_pre_code]:bg-transparent [&_pre_code]:p-0`,children:(0,B.jsx)($Q,{remarkPlugins:[b2],components:x2,children:e})})}function C2({item:e,turnActive:t=!1,commentary:n=!1,onRetry:r}){switch(e.kind){case`message`:return(0,B.jsx)(w2,{item:e,commentary:n});case`plan`:return(0,B.jsx)(E2,{item:e,turnActive:t});case`tool`:return(0,B.jsx)(D2,{item:e});case`reasoning`:return null;case`approval`:return null;case`artifact`:return(0,B.jsx)(O2,{item:e});case`error`:return(0,B.jsxs)(`div`,{role:`status`,className:z(`border-l-2 pl-3 text-[12px] leading-5`,/已停止/.test(e.message)?`border-line text-ink-3`:`border-danger/50 text-ink-2`),children:[e.message,r?(0,B.jsx)(`button`,{type:`button`,onClick:r,className:`ml-2 text-[11px] text-accent hover:underline`,children:`重试`}):null]})}}function w2({item:e,children:t,commentary:n=!1,finalAnswer:r=!1}){let[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(!1);return e.role===`user`&&e.text.startsWith(`Work state checkpoint`)?(0,B.jsx)(`div`,{className:`mb-5 flex justify-end`,children:(0,B.jsxs)(`div`,{className:`max-w-[91%] rounded-[18px] bg-surface-2 px-3.5 py-2.5 text-[12px] leading-[1.65] text-ink-2 sm:max-w-[82%]`,children:[(0,B.jsx)(`div`,{className:`text-ink`,children:`自动继续上一轮的未完成工作`}),(0,B.jsx)(`div`,{className:`mt-0.5`,children:`已带上已完成文件、命令与失败诊断的核对事实。`}),(0,B.jsx)(`button`,{type:`button`,className:`mt-1 text-[11px] text-ink-3 transition-colors hover:text-accent`,onClick:()=>a(e=>!e),children:i?`收起核对事实`:`查看核对事实`}),i?(0,B.jsx)(`pre`,{className:`mt-2 max-h-56 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] text-ink-3`,children:e.text}):null]})}):e.role===`user`?(0,B.jsx)(`div`,{className:`mb-5 flex justify-end`,children:(0,B.jsxs)(`div`,{className:`max-w-[91%] rounded-[18px] bg-accent-soft px-3.5 py-2.5 text-[13px] leading-[1.65] text-ink sm:max-w-[82%]`,children:[(0,B.jsx)(`div`,{className:z(`whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,!i&&e.text.length>1200&&`line-clamp-8`),children:e.text}),e.text.length>1200?(0,B.jsx)(`button`,{type:`button`,className:`mt-1 text-[11px] text-ink-3`,onClick:()=>a(e=>!e),children:i?`收起`:`展开消息`}):null]})}):(0,B.jsxs)(`article`,{className:z(`min-w-0 break-words leading-[1.65] [overflow-wrap:anywhere]`,n?`text-[12px] text-ink-2`:`text-[13px] text-ink`),children:[e.text?(0,B.jsx)(`div`,{"data-testid":r?`final-answer-bubble`:`message-bubble`,className:z(`w-fit min-w-0 max-w-full rounded-2xl rounded-tl-md border border-line bg-surface`,n?`px-3 py-2`:`px-3.5 py-2.5`),children:(0,B.jsx)(S2,{text:e.text})}):null,t,!e.streaming&&e.text?(0,B.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 px-0.5`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":o?`已复制答复`:`复制答复`,className:`rounded p-1 text-ink-3 hover:bg-surface-2`,onClick:()=>{navigator.clipboard.writeText(e.text).then(()=>s(!0)).catch(()=>s(!1))},children:o?(0,B.jsx)(e_,{size:13}):(0,B.jsx)(v_,{size:13})}),(0,B.jsx)(`time`,{dateTime:new Date(e.createdAt).toISOString(),title:new Date(e.createdAt).toLocaleString(),className:`font-mono text-[11px] text-ink-3`,children:new Date(e.createdAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})})]}):null]})}var T2={done:`已完成:`,running:`进行中:`,failed:`失败:`,pending:`待做:`,unfinished:`未完成`};function E2({item:e,turnActive:t}){let[n,r]=(0,H.useState)(!1),i=e.steps.filter(e=>e.status===`done`).length,a=t?e.steps.find(e=>e.status===`running`):void 0;return(0,B.jsxs)(`div`,{className:`text-[12px] text-ink-3`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>r(e=>!e),className:`flex w-full items-start gap-1.5 rounded-md py-1 text-left transition-colors hover:text-accent`,children:[(0,B.jsx)(o_,{size:13,className:z(`mt-0.5 shrink-0`,n&&`rotate-90`)}),(0,B.jsxs)(`span`,{className:a?`text-accent`:void 0,children:[`计划 · `,i,`/`,e.steps.length,a?` · ${a.title}`:` · ${e.title}`]})]}),n?(0,B.jsx)(`ol`,{"aria-label":e.title,className:`ml-5 mt-1 space-y-1.5`,children:e.steps.map(e=>{let n=e.status===`running`&&!t?`unfinished`:e.status;return(0,B.jsxs)(`li`,{className:`flex items-start gap-2`,children:[n===`done`?(0,B.jsx)(e_,{size:13,className:`mt-0.5 shrink-0 text-success`}):n===`running`?(0,B.jsx)(ev,{size:13,className:`mt-0.5 shrink-0 animate-spin text-accent motion-reduce:animate-none`}):n===`failed`||n===`unfinished`?(0,B.jsx)(sy,{size:13,className:`mt-0.5 shrink-0 text-danger`}):(0,B.jsx)(u_,{size:13,className:`mt-0.5 shrink-0`}),(0,B.jsxs)(`span`,{className:`min-w-0 break-words`,children:[e.title,(0,B.jsx)(`span`,{className:n===`unfinished`?`ml-2`:`sr-only`,children:T2[n]}),e.detail?(0,B.jsx)(`span`,{className:`ml-2`,children:e.detail}):null]})]},e.id)})}):null]})}function D2({item:e}){let[t,n]=(0,H.useState)(!1);return(0,B.jsxs)(`div`,{className:`min-w-0 text-[12px] text-ink-3`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`flex w-full items-start gap-1.5 rounded-md py-1 text-left transition-colors hover:text-accent`,children:[(0,B.jsx)(o_,{size:13,className:z(`mt-0.5 shrink-0`,t&&`rotate-90`)}),(0,B.jsx)(`span`,{className:z(`min-w-0 [overflow-wrap:anywhere]`,e.commandLabel&&`line-clamp-2 font-mono`),children:e.commandLabel||e.summary||e.name}),e.status===`error`?(0,B.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-0.5 text-danger`,children:[(0,B.jsx)(sy,{size:13}),` 失败`,e.retried===!0?(0,B.jsx)(`span`,{className:`text-ink-3`,children:`· 已重试`}):null]}):null]}),t?(0,B.jsxs)(`div`,{className:`ml-5 space-y-2`,children:[(0,B.jsxs)(`div`,{className:`text-[11px]`,children:[e.name,e.durationMs===void 0?``:` · ${Math.round(e.durationMs/1e3)}秒`]}),e.args?(0,B.jsx)(`pre`,{className:`max-h-[200px] overflow-auto whitespace-pre-wrap break-words rounded-lg bg-surface-2 p-2.5 font-mono text-[12px] text-ink-2`,children:e.args}):null,e.output?(0,B.jsx)(`pre`,{className:`max-h-[200px] overflow-auto whitespace-pre-wrap break-words rounded-lg bg-surface-2 p-2.5 font-mono text-[12px] text-ink-2`,children:e.output}):null,e.commandId?(0,B.jsx)(QG,{commandId:e.commandId}):null]}):null]})}function O2({item:e}){let t=Fj(e=>e.open),{projectId:n,sessionId:r}=Xj();return e.resourceTarget?.kind===`file`?(0,B.jsx)(HG,{target:e.resourceTarget}):e.resourceTarget?.kind===`preview`?(0,B.jsx)(UG,{target:e.resourceTarget}):e.resourceTarget?.kind===`terminal`?(0,B.jsx)(KG,{target:e.resourceTarget}):(0,B.jsxs)(`div`,{className:`break-words text-[12px] text-ink-2`,children:[(0,B.jsx)(`span`,{children:e.title}),(0,B.jsx)(`p`,{className:`mt-1 text-ink-3`,children:e.description}),e.href?(0,B.jsxs)(`button`,{type:`button`,className:`mt-1 text-accent underline decoration-accent/30 underline-offset-4 hover:decoration-accent`,onClick:()=>t({kind:`browser`,resourceId:e.href??e.id,title:e.title,projectId:n,sessionId:r,source:`artifact`}),children:[`打开 `,e.title]}):null]})}function k2(e){return e.kind===`message`&&e.role===`user`&&e.text.startsWith(`Work state checkpoint`)}function A2(e){let t=[],n=new Map,r;for(let i of e){let e=i.kind===`message`&&i.role===`user`;if(k2(i)&&i.turnId!==void 0&&r!==void 0){n.set(i.turnId,r);continue}let a=i.turnId??(e?i.id:r?.id??i.id),o=n.get(a);if(o)o.items.push(i),e&&(r=o);else{let e={id:a,items:[i]};t.push(e),n.set(a,e),r=e}}return t}function j2(e){let t=0,n=0,r=0;for(let i of e)i.name===`run_command`||i.commandId?r++:i.name===`apply_patch`?n++:[`read_file`,`list_files`,`search_code`].includes(i.name)&&t++;let i=e.length-t-n-r;return[t&&`探索 ${t} 项`,n&&`修改 ${n} 项`,r&&`命令 ${r} 条`,i&&`其他 ${i} 项`].filter(Boolean).join(` · `)||`执行了 0 项操作`}function M2({group:e,active:t}){let n=bP(e=>e.send),r=bP(e=>e.resumeTurn),i=e.items,a=i.find(e=>e.kind===`message`&&e.role===`user`),o=[...i].reverse().find(e=>e.turnId!==void 0)?.turnId,s=i.find(e=>e.kind===`message`&&e.role===`user`&&e.turnId!==void 0&&e.turnId===o),c=t&&s?.turnOutcome===void 0,[l,u]=(0,H.useState)(!1),[d,f]=(0,H.useState)(!1),p=i.filter(e=>e.kind===`tool`&&e.name!==`update_plan`),m=-1,h=-1;i.forEach((e,t)=>{e.kind===`tool`&&(m=t),e.kind===`message`&&e.role===`assistant`&&(h=t)});let g=h>=0&&!c&&(h>m||a?.turnOutcome===`completed`)?i[h]:void 0,_=t&&!g?[...i].reverse().find(e=>e.kind===`message`&&e.role===`assistant`):void 0,v=i.filter(e=>e.kind===`plan`),y=i.filter(e=>e!==a&&e!==g&&e!==_&&(e.kind===`message`&&e.role===`assistant`||e.kind===`tool`&&e.name!==`update_plan`)),b=a?.turnOutcome===`failed`||a?.turnOutcome===`interrupted`,x=a?.turnOutcome===`cancelled`,S=a?.terminalReason===`budget`,C=a?.terminalReason===`output_truncated`,w=a?.durationMs,T=w===void 0?``:` · ${Math.round(w/1e3)}秒`,E=[...i].reverse().find(e=>e.kind===`reasoning`)?.text,D=c&&E&&!p.some(e=>e.status===`running`)&&OG(i).length===0,O=x?`已停止`:b?`执行未完成`:S?`预算停止`:C?`输出被截断`:``,k=p.filter(e=>e.status===`error`),A=k.filter(e=>e.retried===!0).length,j=k.length-A,M=[j>0?`失败 ${j} 项`:``,A>0?`重试成功 ${A} 次`:``].filter(Boolean).join(` · `),N=[O,[j2(p),M].filter(Boolean).join(` · `)+T].filter(Boolean).join(` · `),ee=l?y:!c&&g===void 0?y.filter(e=>e.kind===`tool`&&e.status===`error`):[],te=new Map;for(let e of p){let t=e.resourceTarget;t&&te.set(t.kind===`file`?JSON.stringify([t.scope,t.path]):t.kind===`preview`?`preview:${t.serviceId}:${t.path}`:t.terminalId,t)}let P=new Set([...te.values()].filter(e=>e.kind===`file`).map(e=>e.path)),ne=new Map;for(let e of te.values())e.kind===`file`&&ne.set(e.path,e);let F=a?.fileResults,re=new Set((F??[]).filter(e=>e.category===`deliverable`).map(e=>e.path)),ie=(F??[]).filter(e=>e.category===`process`),ae=F===void 0?[...te.entries()]:[...te.entries()].filter(([,e])=>e.kind!==`file`||re.has(e.path)),oe=i.filter(e=>{if(e.kind!==`artifact`)return!1;let t=e.title.replace(/^已(?:修改|创建) /,``);return F===void 0?!P.has(t):t===e.title}),se=ae.length>0||oe.length>0||ie.length>0||(a?.fileResultsOmitted??0)>0,ce=!c&&se?(0,B.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[ae.length>0?(0,B.jsx)(`section`,{"aria-label":`本次成果`,className:`flex flex-wrap gap-1.5`,children:ae.map(([e,t])=>t.kind===`file`?(0,B.jsx)(HG,{target:t},e):t.kind===`preview`?(0,B.jsx)(UG,{target:t},e):(0,B.jsx)(KG,{target:t},e))}):null,oe.map(e=>(0,B.jsx)(C2,{item:e},e.id)),(0,B.jsx)(qG,{files:ie,targets:ne}),a?.fileResultsOmitted?(0,B.jsx)(`p`,{className:`text-[11px] text-ink-3`,children:`另有 ${a.fileResultsOmitted} 个文件未列出`}):null]}):null;return(0,B.jsxs)(`section`,{"aria-label":`对话轮次`,className:`min-w-0`,children:[a?(0,B.jsx)(C2,{item:a}):null,v.map(e=>(0,B.jsx)(C2,{item:e,turnActive:c},e.id)),(0,B.jsxs)(`div`,{className:`space-y-3`,children:[y.length>0||p.length>0||E!==void 0?(0,B.jsxs)(`div`,{className:`text-[12px] text-ink-3`,children:[(0,B.jsxs)(`button`,{type:`button`,"aria-label":`执行过程 · ${D?`正在思考 · `:``}${N}`,"aria-expanded":l,onClick:()=>u(e=>!e),className:`flex w-full items-start gap-1.5 rounded-md py-1 text-left transition-colors hover:text-accent`,children:[(0,B.jsx)(o_,{size:13,className:z(`mt-0.5 shrink-0`,l&&`rotate-90`)}),(0,B.jsxs)(`span`,{className:`min-w-0`,children:[(0,B.jsx)(`span`,{className:`block break-words`,children:N}),D?(0,B.jsxs)(`span`,{className:`block truncate`,children:[`正在思考 · `,E]}):null]})]}),ee.length>0?(0,B.jsx)(`div`,{className:`ml-1.5 mt-1 space-y-1 border-l border-line pl-3`,children:ee.map(e=>(0,B.jsx)(C2,{item:e,turnActive:c,commentary:!0},e.id))}):null]}):null,a?.turnOutcome===`interrupted`&&a.turnId!==void 0?(0,B.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-md border border-line bg-surface-2 px-2.5 py-1.5 text-[12px] text-ink-2`,children:d?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1`,children:`继续会新建一轮,并带上已完成文件、命令与失败诊断的核对事实;原轮次保持原样。`}),(0,B.jsx)(`button`,{type:`button`,className:`rounded border border-line px-2 py-0.5 text-ink transition-colors hover:text-accent`,onClick:()=>{f(!1),r(a.turnId??``)},children:`确认继续`}),(0,B.jsx)(`button`,{type:`button`,className:`rounded px-2 py-0.5 text-ink-3 transition-colors hover:text-ink`,onClick:()=>f(!1),children:`取消`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1`,children:`上次执行被中断(服务重启或退出)。`}),(0,B.jsx)(`button`,{type:`button`,className:`rounded border border-line px-2 py-0.5 text-ink transition-colors hover:text-accent`,onClick:()=>f(!0),children:`继续这个任务`})]})}):null,_?(0,B.jsx)(C2,{item:_,commentary:!0}):null,g?.kind===`message`?(0,B.jsx)(w2,{item:g,finalAnswer:!0,children:ce}):ce,i.filter(e=>e.kind===`error`).map(e=>(0,B.jsx)(C2,{item:e,onRetry:a?()=>void n(a.text):void 0},e.id))]})]})}function N2(){let e=bP(e=>e.items),t=bP(e=>e.loading),n=bP(e=>e.isStreaming),r=bP(e=>e.contextNotice),i=bP(e=>e.activeTurnId),a=Xj(e=>e.sessionId),o=(0,H.useRef)(null),s=(0,H.useRef)(null),c=(0,H.useRef)(!0),[l,u]=(0,H.useState)(!1),d=(0,H.useCallback)(()=>{let e=o.current;e&&(c.current?e.scrollTop=e.scrollHeight:u(e.scrollHeight-e.scrollTop-e.clientHeight>140))},[]);(0,H.useLayoutEffect)(()=>{c.current=!0,u(!1)},[a]),(0,H.useLayoutEffect)(d,[e,t]),(0,H.useEffect)(()=>{let e=o.current,t=s.current;if(!e||!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(d);return n.observe(e),n.observe(t),()=>n.disconnect()},[d]);let f=A2(e),p=n?i===null?f.at(-1):f.find(e=>e.id===i):void 0,m=OG(e).length>0,h=p&&[...p.items].reverse().find(e=>e.kind===`tool`&&e.name!==`update_plan`&&e.status===`running`),g=p?.items.some(e=>e.kind===`message`&&e.role===`assistant`&&e.streaming),_=``;return m?_=`等待审批`:h?_=`正在执行 · ${h.commandLabel||h.summary||h.name}`:g?_=`正在回复…`:n&&(_=`正在处理…`),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,B.jsx)(`div`,{ref:o,role:`log`,"aria-label":`会话时间线`,onClickCapture:e=>{e.target instanceof Element&&e.target.closest(`button[aria-expanded]`)&&(c.current=!1)},onScroll:e=>{let t=e.currentTarget,n=t.scrollHeight-t.scrollTop-t.clientHeight;c.current=n<70,u(n>140)},className:`min-h-0 flex-1 overflow-y-auto px-4 py-5 sm:px-7 [scrollbar-gutter:stable]`,children:(0,B.jsxs)(`div`,{ref:s,className:`mx-auto w-full max-w-[760px] space-y-8 pb-5`,children:[r?(0,B.jsxs)(`p`,{role:`status`,className:`text-[11px] text-ink-3`,children:[`上下文已压缩`,r.degraded?`(降级:超出部分已截断)`:``]}):null,t?(0,B.jsx)(`div`,{role:`status`,className:`py-8 text-[12px] text-ink-3`,children:`正在加载对话…`}):f.map(e=>(0,B.jsx)(M2,{group:e,active:p===e},`${a}:${e.id}`))]})}),(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`conversation-scroll-edge conversation-scroll-edge-top`}),(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`conversation-scroll-edge conversation-scroll-edge-bottom`}),l?(0,B.jsx)(`button`,{type:`button`,"aria-label":`回到最新消息`,onClick:()=>{c.current=!0,d(),u(!1)},className:`absolute bottom-3 left-1/2 z-10 flex h-8 w-8 -translate-x-1/2 items-center justify-center rounded-full border border-line bg-surface text-accent shadow-[var(--shadow-card)] transition-colors hover:bg-accent-soft`,children:(0,B.jsx)(Bg,{size:14})}):null]}),_?(0,B.jsx)(`div`,{className:`shrink-0 px-4 sm:px-7`,children:(0,B.jsxs)(`div`,{role:`status`,"aria-label":`当前执行状态`,className:`mx-auto flex w-full max-w-[760px] items-center gap-2 py-1.5 text-[12px] text-ink-2`,children:[m?(0,B.jsx)(Hv,{size:13,className:`shrink-0 text-warning`}):(0,B.jsx)(ev,{size:13,"data-testid":`turn-running-spinner`,className:`shrink-0 animate-spin text-accent motion-reduce:animate-none`}),(0,B.jsx)(`span`,{className:`min-w-0 truncate`,title:_,children:_})]})}):null]})}var P2=[{label:`了解项目`,text:`先帮我了解项目结构、主要功能和启动方式。`,icon:B_,color:`text-accent`},{label:`排查问题`,text:`帮我排查一个问题:`,icon:Qg,color:`text-warning`},{label:`实现功能`,text:`我想在这个项目中实现一个功能:`,icon:g_,color:`text-success`}];function F2(){return(0,B.jsxs)(`div`,{className:`mb-5 flex flex-col items-center gap-3 text-center`,children:[(0,B.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-xl border border-accent/20 bg-gradient-to-br from-accent-soft to-surface text-accent`,children:(0,B.jsx)(Kv,{size:20,strokeWidth:1.7,"aria-hidden":`true`})}),(0,B.jsx)(`h2`,{className:`text-[23px] font-semibold tracking-tight text-ink sm:text-[27px]`,children:`今天想做什么?`})]})}function I2(){return(0,B.jsx)(`section`,{"aria-label":`建议任务`,className:`mt-3 flex flex-wrap justify-center gap-2`,children:P2.map(({label:e,text:t,icon:n,color:r})=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>{lN.getState().setDraft(t),Xj.getState().focusComposer()},className:`inline-flex min-h-8 items-center gap-1.5 rounded-lg border border-line bg-surface/70 px-2.5 text-[12px] text-ink-2 transition-colors hover:border-accent/30 hover:bg-accent-soft hover:text-ink focus-visible:outline-2 focus-visible:outline-accent`,children:[(0,B.jsx)(n,{size:14,className:r,"aria-hidden":`true`}),e]},e))})}function L2(){let{data:e}=ej(),{projectId:t,sessionId:n,resourceCollapsed:r,toggleResource:i}=Xj();TN(e=>e.extra);let a=Wd(),[o,s]=(0,H.useState)(!1),c=bP(e=>e.sessionId===n&&!e.loading&&!e.isStreaming&&!e.items.length),l=(0,H.useRef)(null),u=(0,H.useRef)(null),d=(0,H.useRef)(null),f=()=>{c&&l.current&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&(u.current={sessionId:n,top:l.current.getBoundingClientRect().top})};(0,H.useLayoutEffect)(()=>{if(c){d.current?.cancel();return}let e=u.current;u.current=null;let t=l.current;if(e?.sessionId!==n||!t||typeof t.animate!=`function`)return;let r=e.top-t.getBoundingClientRect().top;r&&(d.current=t.animate([{transform:`translateY(${r}px)`},{transform:`translateY(0)`}],{duration:290,easing:`cubic-bezier(.22,.75,.25,1)`}))},[c,n]);let p=[...e.sessions].find(e=>e.id===n),m=e.projects.find(e=>e.id===t),h=async()=>{if(p)try{await AA(p.id),await a.invalidateQueries({queryKey:[`workspace`]})}catch(e){window.dispatchEvent(new CustomEvent(`larness:workspace-error`,{detail:oA(e,`归档会话失败`)}))}};return(0,B.jsxs)(`main`,{className:`conversation-surface flex min-h-0 min-w-0 flex-1 flex-col bg-canvas/55`,children:[(0,B.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-3 px-4 sm:px-7`,children:[(0,B.jsx)(`h1`,{className:`min-w-0 truncate text-[12px] font-medium`,children:p?.title??`新会话`}),(0,B.jsx)(`span`,{className:`ml-auto hidden max-w-[40%] truncate text-[11px] text-ink-3 md:block`,children:m?.name??Yj(n,e.sessions)}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-0.5 md:ml-0`,children:[(0,B.jsx)(Iu,{label:r?`展开项目资源`:`折叠项目资源`,className:`hidden xl:inline-flex`,onClick:i,children:(0,B.jsx)(vv,{size:14})}),(0,B.jsxs)(bu,{children:[(0,B.jsx)(xu,{asChild:!0,children:(0,B.jsx)(Iu,{label:`会话操作`,children:(0,B.jsx)(w_,{size:15})})}),(0,B.jsxs)(Cu,{align:`end`,className:`w-[190px]`,children:[(0,B.jsx)(Tu,{disabled:!p,onSelect:()=>s(!0),children:`重命名会话`}),(0,B.jsx)(Du,{}),(0,B.jsx)(Tu,{disabled:!p||!1,onSelect:()=>void h(),className:`text-danger focus:text-danger`,children:`归档会话`})]})]})]})]}),c?null:(0,B.jsx)(N2,{}),(0,B.jsx)(xM,{session:p?{id:p.id,title:p.title}:null,onClose:()=>s(!1),open:o}),(0,B.jsx)(`div`,{"data-testid":`composer-dock`,"data-placement":c?`center`:`bottom`,className:z(`relative px-4 sm:px-7`,c?`flex min-h-0 flex-1 flex-col overflow-y-auto py-5`:`shrink-0 pb-3 pt-1`),children:(0,B.jsxs)(`div`,{className:z(`relative mx-auto flex w-full max-w-[760px] flex-col`,c&&`my-auto shrink-0`),children:[c?(0,B.jsx)(F2,{}):null,c?null:(0,B.jsx)(DG,{}),(0,B.jsx)(RG,{}),(0,B.jsx)(`div`,{ref:l,"data-composer-motion":!0,className:`relative z-10 min-w-0`,children:(0,B.jsx)(IG,{centered:c,onSubmit:f})}),c?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(I2,{}),(0,B.jsx)(`div`,{className:`mt-5`,children:(0,B.jsx)(DG,{})})]}):null]})})]})}function R2(e){let t=bP(e=>e.load),n=bP(e=>e.disconnect);(0,H.useEffect)(()=>(t(e),()=>n()),[n,t,e])}function z2({version:e}){let{data:t,isPending:n,isError:r}=ej(),i=Xj(e=>e.sessionId),a=Xj(e=>e.reconcileWorkspace),o=Xj(e=>e.sidebarCollapsed),s=Xj(e=>e.sidebarWidth),c=Xj(e=>e.resourceWidth),l=Xj(e=>e.resourceCollapsed),u=Xj(e=>e.setSidebarWidth),d=Xj(e=>e.setResourceWidth),f=Xj(e=>e.mobileSidebarOpen),p=Xj(e=>e.toggleSidebar),m=Xj(e=>e.setMobileSidebar),h=EN(),[g,_]=(0,H.useState)(null);return R2(i),(0,H.useEffect)(()=>{let e=e=>{let t=e.detail;_(typeof t==`string`?t:`操作失败`)};return window.addEventListener(`larness:workspace-error`,e),()=>window.removeEventListener(`larness:workspace-error`,e)},[]),(0,H.useEffect)(()=>{n||r||a(t.projects.map(e=>e.id),t.sessions)},[t.projects,t.sessions,n,r,a]),(0,H.useEffect)(()=>{let e=e=>{if(e.defaultPrevented)return;let t=e.metaKey||e.ctrlKey,n=e.key.toLowerCase();if(t&&n===`k`)e.preventDefault(),h();else if(t&&n===`b`)e.preventDefault(),p();else if(e.key===`Escape`&&!t){let t=Fj.getState(),n=Xj.getState(),r=ZA.getQueryData([`workspace`])?.sessions??[],i=Jj(n.projectId,n.sessionId,r),a=t.windows.filter(e=>!e.minimized&&Ej(e)===i).sort((e,t)=>t.z-e.z)[0];a&&(e.preventDefault(),t.hide(a.id))}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,p]),(0,B.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-canvas text-ink`,"data-testid":`workspace-home`,children:[(0,B.jsx)(HP,{version:e}),(0,B.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,children:[o?null:(0,B.jsx)(SP,{}),o?null:(0,B.jsx)(OP,{side:`left`,label:`调整项目侧栏宽度`,value:s,min:220,max:360,defaultValue:268,onChange:u,className:`hidden md:block`}),(0,B.jsx)(L2,{}),l?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(OP,{side:`right`,label:`调整资源侧栏宽度`,value:c,min:280,max:460,defaultValue:340,onChange:d,className:`hidden xl:block`}),(0,B.jsx)(gM,{})]}),(0,B.jsx)(TG,{})]}),(0,B.jsx)(Ou,{message:g,onDismiss:()=>_(null)}),f?(0,B.jsxs)(`div`,{className:`fixed inset-0 z-[150] md:hidden`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":`关闭导航`,onClick:()=>m(!1),className:`absolute inset-0 bg-black/30 backdrop-blur-[2px]`}),(0,B.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-[280px] shadow-[var(--shadow-window)]`,children:(0,B.jsx)(SP,{mobile:!0})})]}):null]})}function B2(){let e=Wd();(0,H.useEffect)(()=>{let t=!1,n,r,i=window.location.protocol===`https:`?`wss`:`ws`,a={queryKey:[`workspace`],exact:!0},o=async()=>{e.getQueryData(a.queryKey)===void 0&&await e.cancelQueries(a),t||await e.invalidateQueries(a)},s=()=>{let a=new WebSocket(`${i}://${window.location.host}/ws`);n=a;let c=!1;a.addEventListener(`open`,()=>{c=!0,a.send(JSON.stringify({type:`subscribe`,subscriptions:[{topic:`system`,resourceId:`system`}]}))}),a.addEventListener(`message`,n=>{if(!(t||typeof n.data!=`string`))try{let t=JSON.parse(n.data);fk.safeParse(t).success&&o(),pk.safeParse(t).success&&e.invalidateQueries({queryKey:[`jobs`]})}catch{}}),a.addEventListener(`close`,()=>{t||(c&&(e.invalidateQueries({queryKey:[`session`]}),e.invalidateQueries({queryKey:[`bootstrap`]})),r=window.setTimeout(s,1e3))}),a.addEventListener(`error`,()=>a.close())};return s(),()=>{t=!0,window.clearTimeout(r),n?.close()}},[e])}function V2({version:e}){return B2(),(0,B.jsx)(z2,{version:e})}function H2({label:e=`正在加载…`}){return(0,B.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-canvas text-ink`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-ink-2`,children:[(0,B.jsx)(`span`,{className:`inline-flex size-7 items-center justify-center rounded-md bg-accent text-[13px] font-semibold text-accent-ink`,children:`L`}),e]})})}function U2({message:e,onRetry:t}){return(0,B.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-canvas px-6 text-ink`,children:(0,B.jsxs)(`section`,{className:`w-full max-w-[420px] rounded-[18px] border border-line bg-surface p-7 shadow-card`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:`无法连接本机服务`}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-ink-2`,children:e}),t?(0,B.jsx)(`button`,{type:`button`,className:`mt-5 h-10 rounded-md bg-accent px-4 text-sm font-medium text-accent-ink`,onClick:t,children:`重试`}):null]})})}function W2({children:e,redirectTo:t=`/login`}){let n=vM(),r=th();if(n.isPending)return(0,B.jsx)(H2,{});if(!n.data){let e=t===`/login`?`/login?returnTo=${encodeURIComponent(r.pathname+r.search)}`:t;return(0,B.jsx)(Gh,{to:e,replace:!0})}return(0,B.jsx)(B.Fragment,{children:e})}function G2(){let e=_M();if(e.isPending)return(0,B.jsx)(H2,{label:`正在检查工作空间…`});if(e.isError||!e.data)return(0,B.jsx)(U2,{message:e.error instanceof Error?e.error.message:`本机服务未启动`,onRetry:()=>void e.refetch()});let t=e.data.auth,n=window.location.origin===t.passkeyOrigin,r=t.passkeyEnabled&&n&&t.passkeyRegistered?`/login`:`/pair`;return(0,B.jsx)(W2,{redirectTo:r,children:(0,B.jsx)(V2,{version:e.data.app?.version})})}function K2(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function q2(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function J2(){return Y2.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var Y2={stubThis:e=>e};function X2(e){let{id:t}=e;return{...e,id:q2(t),transports:e.transports,type:e.type}}function Z2(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var Q2=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function $2({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Q2({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new Q2({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new Q2({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new Q2({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new Q2({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Q2({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new Q2({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Q2({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Z2(t))return new Q2({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Q2({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Q2({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new Q2({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var e4=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},t4=[`cross-platform`,`platform`];function n4(e){if(e&&!(t4.indexOf(e)<0))return e}async function r4(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!J2())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:q2(t.challenge),user:{...t.user,id:q2(t.user.id)},excludeCredentials:t.excludeCredentials?.map(X2)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=e4.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw $2({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){i4(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=K2(e))}catch(e){i4(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=K2(c.getAuthenticatorData())}catch(e){i4(`getAuthenticatorData()`,e)}return{id:o,rawId:K2(s),response:{attestationObject:K2(c.attestationObject),clientDataJSON:K2(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:n4(a.authenticatorAttachment)}}function i4(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function a4(){if(!J2())return o4.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?o4.stubThis(new Promise(e=>e(!1))):o4.stubThis(e.isConditionalMediationAvailable())}var o4={stubThis:e=>e};function s4({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Q2({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Q2({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Z2(t))return new Q2({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Q2({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new Q2({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function c4(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!J2())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(X2));let a={...t,challenge:q2(t.challenge),allowCredentials:i},o={};if(n){if(!await a4())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=e4.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw s4({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=K2(u.userHandle)),{id:c,rawId:K2(l),response:{authenticatorData:K2(u.authenticatorData),clientDataJSON:K2(u.clientDataJSON),signature:K2(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:n4(s.authenticatorAttachment)}}function l4(e){return e===null||!e.startsWith(`/`)||e.startsWith(`//`)||e===`/login`?`/`:e}function u4(e){if(e instanceof aA){if(e.code===`CHALLENGE_EXPIRED`)return`登录挑战已过期,请重试`;if(e.code===`PASSKEY_AUTH_FAILED`)return`Passkey 登录失败;如果设备已被撤销,请重新配对`;if(e.code===`WEBAUTHN_NOT_CONFIGURED`||e.code===`ORIGIN_INVALID`)return`当前来源不能使用 Passkey,请改用 localhost / HTTPS 或使用配对码`}return e instanceof DOMException&&e.name===`NotAllowedError`?`已取消 Passkey 登录`:oA(e,`登录失败,请重试。`)}function d4(){let[e]=gg(),t=l4(e.get(`returnTo`)),n=_M(),r=vM(),i=Wd(),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(!1),[l,u]=(0,H.useState)(null),d=J2(),f=n.data!==void 0&&window.location.origin===n.data.auth.passkeyOrigin,p=n.data!==void 0&&n.data.initialized&&n.data.auth.passkeyEnabled&&f&&d,m=(0,H.useCallback)(async()=>{try{let e=await Y(`/api/webauthn/authentication/options`,{method:`POST`});return o(e),e}catch(e){return u(u4(e)),null}},[]);if((0,H.useEffect)(()=>{p&&m()},[p,m]),r.data)return(0,B.jsx)(Gh,{to:t,replace:!0});let h=async()=>{c(!0),u(null);try{let e=a??await m();if(e===null)return;let t=await c4({optionsJSON:e.options});await Y(`/api/webauthn/authentication/verify`,{method:`POST`,body:{challengeId:e.challengeId,response:t}}),await i.invalidateQueries({queryKey:[`session`]}),await i.invalidateQueries({queryKey:[`bootstrap`]})}catch(e){u(u4(e)),e instanceof aA&&e.code===`CHALLENGE_EXPIRED`&&(o(null),await m())}finally{c(!1)}};return(0,B.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-canvas px-6 py-10 text-ink`,children:(0,B.jsxs)(`section`,{className:`w-full max-w-[420px] rounded-[18px] border border-line bg-surface p-7 shadow-card`,children:[(0,B.jsxs)(`div`,{className:`mb-6 flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`inline-flex size-7 items-center justify-center rounded-md bg-accent text-[13px] font-semibold text-accent-ink`,children:`L`}),(0,B.jsx)(`span`,{className:`text-[15px] font-semibold tracking-tight`,children:`Larness`}),(0,B.jsx)(`span`,{className:`ml-auto text-xs text-ink-3`,children:n.data?.app.version})]}),(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:`使用 Passkey 登录`}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-ink-2`,children:`使用 Face ID、指纹或系统 PIN 解锁当前工作空间。`}),n.data?null:(0,B.jsx)(`p`,{className:`mt-6 text-sm text-ink-2`,children:n.isError?`无法连接本机服务`:`正在读取工作空间状态…`}),n.data&&!n.data.initialized?(0,B.jsxs)(`p`,{className:`mt-6 rounded-md bg-surface-2 p-3 text-sm text-ink-2`,children:[`工作空间尚未初始化。请先在本机运行 `,(0,B.jsx)(`code`,{children:`pnpm run tui`}),` 完成初始化。`]}):null,n.data&&n.data.initialized&&!f?(0,B.jsxs)(`p`,{className:`mt-6 rounded-md bg-surface-2 p-3 text-sm text-ink-2`,children:[`当前来源 `,(0,B.jsx)(`code`,{children:window.location.origin}),` 不是 canonical origin`,` `,(0,B.jsx)(`code`,{children:n.data.auth.passkeyOrigin}),`。请改用 localhost 或 HTTPS 域名,或使用下方的“使用配对码”入口。`]}):null,n.data&&n.data.initialized&&f&&!d?(0,B.jsx)(`p`,{className:`mt-6 rounded-md bg-surface-2 p-3 text-sm text-ink-2`,children:`当前浏览器不支持 WebAuthn / Passkey,请使用配对码入口。`}):null,n.data&&n.data.initialized&&!n.data.auth.passkeyEnabled?(0,B.jsx)(`p`,{className:`mt-6 rounded-md bg-surface-2 p-3 text-sm text-ink-2`,children:`WebAuthn 配置无效(RP ID / Origin),Passkey 不可用;请使用配对码入口。`}):null,p?(0,B.jsx)(`button`,{type:`button`,className:`mt-6 flex h-10 w-full items-center justify-center rounded-md bg-accent px-4 text-sm font-medium text-accent-ink transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,disabled:s||a===null,onClick:()=>void h(),children:s?`正在验证…`:a===null?`正在准备…`:`使用 Passkey 登录`}):null,(0,B.jsx)(Ou,{message:l,onDismiss:()=>u(null)}),(0,B.jsxs)(`div`,{className:`mt-5 flex items-center justify-between text-sm`,children:[(0,B.jsx)(fg,{className:`text-accent hover:underline`,to:`/pair`,children:`使用配对码`}),p&&a===null?(0,B.jsx)(`button`,{type:`button`,className:`text-ink-2 hover:text-ink`,onClick:()=>void m(),children:`重试准备`}):null]})]})})}var f4=`larness.pairing.request`;function p4(){try{window.sessionStorage.removeItem(f4)}catch{}}function m4(){try{let e=window.sessionStorage.getItem(f4);if(e===null)return null;let t=JSON.parse(e);return typeof t.requestId==`string`&&typeof t.shortCode==`string`&&typeof t.pollToken==`string`&&typeof t.expiresAt==`number`&&t.expiresAt>Date.now()+1e3?t:(p4(),null)}catch{return p4(),null}}function h4(e){try{window.sessionStorage.setItem(f4,JSON.stringify(e))}catch{}}function g4(e){if(e instanceof aA){if(e.code===`NOT_INITIALIZED`)return`工作空间尚未初始化。请先在本机运行 pnpm run tui。`;if(e.code===`CODE_INVALID`){let t=e.details?.attemptsLeft;return t===void 0?`配对码不正确`:`配对码不正确,剩余 ${t} 次尝试`}return e.code===`PAIRING_DENIED`?`本机已拒绝本次配对申请`:e.code===`PAIRING_EXPIRED`?`配对申请或配对码已过期,请重新申请`:e.code===`RATE_LIMITED`?`尝试过于频繁,请稍后再试`:e.code===`ENROLLMENT_EXPIRED`?`Passkey 注册窗口已过期,请重新配对`:e.code===`ORIGIN_INVALID`||e.code===`WEBAUTHN_NOT_CONFIGURED`?`当前来源不能注册 Passkey,请改用 localhost / HTTPS,或在 TUI 中选择“允许本次”`:e.code===`PASSKEY_REGISTRATION_FAILED`?`Passkey 注册失败,请重试或重新配对`:e.message}return e instanceof DOMException&&e.name===`NotAllowedError`?`已取消 Passkey 注册`:e instanceof Error?e.message:`操作失败`}function _4(){let e=vM(),t=Wd(),n=(0,H.useRef)(!1),[r,i]=(0,H.useState)(`creating`),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(null),[l,u]=(0,H.useState)(``),[d,f]=(0,H.useState)(null),[p,m]=(0,H.useState)(null),[h,g]=(0,H.useState)(null),[_,v]=(0,H.useState)(!1),y=J2();(0,H.useEffect)(()=>{e.data&&p4()},[e.data]);let b=(0,H.useCallback)(async()=>{p4(),i(`creating`),g(null),o(null),f(null),m(null),c(null),u(``);try{let e=await Y(`/api/pairing/requests`,{method:`POST`,body:{clientLabel:navigator.userAgent.slice(0,100)}});h4(e),o(e),i(`waiting`)}catch(e){g(g4(e)),i(`error`)}},[]);(0,H.useEffect)(()=>{if(n.current)return;n.current=!0;let e=m4();e===null?b():(o(e),i(`waiting`))},[b]),(0,H.useEffect)(()=>{if(r!==`waiting`||a===null)return;let e=!1,n=setInterval(()=>{(async()=>{try{let n=await Y(`/api/pairing/requests/${a.requestId}`,{headers:{"x-pairing-token":a.pollToken}});if(e)return;n.status===`approved`?(c(n.decision),i(`code`)):n.status===`enrollment_pending`?(c(`trust`),i(`enrollment`)):n.status===`denied`?(p4(),g(`本机已拒绝本次配对申请`),i(`error`)):n.status===`expired`?(p4(),g(`配对申请已过期,请重新申请`),i(`error`)):n.status===`redeemed`&&(p4(),await t.invalidateQueries({queryKey:[`session`]}),i(`error`),g(`该申请已完成配对,请返回工作台`))}catch(t){e||(t instanceof aA&&t.code===`NOT_FOUND`&&p4(),g(g4(t)),i(`error`))}})()},2e3);return()=>{e=!0,clearInterval(n)}},[r,a,t]);let x=(0,H.useCallback)(async()=>{try{let e=await Y(`/api/webauthn/registration/options`,{method:`POST`});return m(e),e}catch(e){return g(g4(e)),null}},[]);if((0,H.useEffect)(()=>{r===`enrollment`&&y&&x()},[r,y,x]),e.data)return(0,B.jsx)(Gh,{to:`/`,replace:!0});let S=async e=>{if(e.preventDefault(),a!==null){v(!0),g(null);try{let e=await Y(`/api/pairing/redeem`,{method:`POST`,body:{requestId:a.requestId,code:l.trim()}});if(e.status===`session`){p4(),await t.invalidateQueries({queryKey:[`session`]}),await t.invalidateQueries({queryKey:[`bootstrap`]}),i(`error`),g(`配对成功,正在进入工作台…`),await t.refetchQueries({queryKey:[`session`]});return}f(e),i(`enrollment`)}catch(e){g(g4(e))}finally{v(!1)}}},C=async()=>{if(p!==null){v(!0),g(null);try{let e=await r4({optionsJSON:p.options});await Y(`/api/webauthn/registration/verify`,{method:`POST`,body:{challengeId:p.challengeId,response:e}}),p4(),await t.invalidateQueries({queryKey:[`session`]}),await t.invalidateQueries({queryKey:[`bootstrap`]}),g(`Passkey 已创建,正在进入工作台…`),await t.refetchQueries({queryKey:[`session`]})}catch(e){g(g4(e)),e instanceof aA&&(e.code===`CHALLENGE_EXPIRED`||e.code===`PASSKEY_REGISTRATION_FAILED`||e.code===`ENROLLMENT_EXPIRED`)&&(m(null),await x())}finally{v(!1)}}};return(0,B.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-canvas px-6 py-10 text-ink`,children:(0,B.jsxs)(`section`,{className:`w-full max-w-[460px] rounded-[18px] border border-line bg-surface p-7 shadow-card`,"data-request-id":a?.requestId??``,"data-stage":r,children:[(0,B.jsxs)(`div`,{className:`mb-6 flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`inline-flex size-7 items-center justify-center rounded-md bg-accent text-[13px] font-semibold text-accent-ink`,children:`L`}),(0,B.jsx)(`span`,{className:`text-[15px] font-semibold tracking-tight`,children:`Larness`})]}),(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:`配对这台浏览器`}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-ink-2`,children:`申请需要在本机 TUI 中批准;配对码只显示一次。`}),r===`creating`?(0,B.jsx)(`p`,{className:`mt-6 text-sm text-ink-2`,children:`正在创建配对申请…`}):null,r===`waiting`&&a?(0,B.jsxs)(`div`,{className:`mt-6`,children:[(0,B.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-ink-3`,children:`短编号`}),(0,B.jsx)(`p`,{className:`mt-1 font-mono text-3xl font-semibold tracking-[0.18em] text-ink`,children:a.shortCode}),(0,B.jsx)(`p`,{className:`mt-3 text-sm text-ink-2`,children:`等待本机 TUI 批准。批准后在此输入一次性配对码。`}),(0,B.jsx)(`button`,{type:`button`,className:`mt-4 text-sm text-accent hover:underline`,onClick:()=>void b(),children:`重新申请`})]}):null,r===`code`&&a?(0,B.jsxs)(`form`,{className:`mt-6`,onSubmit:e=>void S(e),children:[(0,B.jsxs)(`p`,{className:`text-sm text-ink-2`,children:[`已获批准(`,s===`trust`?`始终允许,需要创建 Passkey`:`允许本次`,`)。 请输入 TUI 显示的配对码。`]}),(0,B.jsx)(`label`,{className:`mt-4 block text-xs font-medium text-ink-2`,htmlFor:`pair-code`,children:`配对码`}),(0,B.jsx)(Mu,{id:`pair-code`,className:`mt-1 h-11 px-3 font-mono text-lg tracking-[0.14em]`,value:l,onChange:e=>u(e.target.value.toUpperCase()),placeholder:`XXXXX-XXXXX`,autoComplete:`one-time-code`}),(0,B.jsx)(`button`,{type:`submit`,className:`mt-4 flex h-10 w-full items-center justify-center rounded-md bg-accent px-4 text-sm font-medium text-accent-ink transition hover:opacity-90 disabled:opacity-50`,disabled:_||l.trim().length===0,children:_?`正在兑换…`:`兑换配对码`}),(0,B.jsx)(`button`,{type:`button`,className:`mt-3 text-sm text-ink-2 hover:text-ink`,onClick:()=>void b(),children:`重新申请`})]}):null,r===`enrollment`?(0,B.jsxs)(`div`,{className:`mt-6`,children:[(0,B.jsx)(`p`,{className:`text-sm text-ink-2`,children:`配对码已兑换。必须在窗口过期前创建 Passkey,之后才能进入工作台。`}),d===null?(0,B.jsx)(`p`,{className:`mt-2 text-xs text-ink-3`,children:`已恢复同一配对申请的注册窗口。`}):null,y?null:(0,B.jsx)(`p`,{className:`mt-3 rounded-md bg-surface-2 p-3 text-sm text-ink-2`,children:`当前浏览器不支持 WebAuthn。请重新配对,并在 TUI 中选择“允许本次”。`}),y?(0,B.jsx)(`button`,{type:`button`,className:`mt-4 flex h-10 w-full items-center justify-center rounded-md bg-accent px-4 text-sm font-medium text-accent-ink transition hover:opacity-90 disabled:opacity-50`,disabled:_||p===null,onClick:()=>void C(),children:_?`正在创建…`:p===null?`正在准备…`:`创建 Passkey`}):null,(0,B.jsx)(`button`,{type:`button`,className:`mt-3 text-sm text-ink-2 hover:text-ink`,onClick:()=>void b(),children:`重新配对`})]}):null,r===`error`?(0,B.jsxs)(`div`,{className:`mt-6`,children:[(0,B.jsx)(`button`,{type:`button`,className:`mt-2 flex h-10 w-full items-center justify-center rounded-md bg-accent px-4 text-sm font-medium text-accent-ink transition hover:opacity-90`,onClick:()=>void b(),children:`重新申请`}),(0,B.jsx)(fg,{className:`mt-3 inline-block text-sm text-ink-2 hover:text-ink`,to:`/login`,children:`返回登录`})]}):null,h?(0,B.jsx)(`p`,{role:`alert`,className:`mt-4 rounded-md bg-surface-2 p-3 text-sm text-danger`,children:h}):null,a?(0,B.jsxs)(`p`,{className:`mt-5 text-xs text-ink-3`,children:[`申请有效期至 `,new Date(a.expiresAt).toLocaleTimeString(),`;配对码在其他设备上不显示。`]}):null]})})}function v4(){return yM(),(0,B.jsxs)(Jh,{children:[(0,B.jsx)(Kh,{path:`/`,element:(0,B.jsx)(G2,{})}),(0,B.jsx)(Kh,{path:`/login`,element:(0,B.jsx)(d4,{})}),(0,B.jsx)(Kh,{path:`/pair`,element:(0,B.jsx)(_4,{})}),(0,B.jsx)(Kh,{path:`*`,element:(0,B.jsx)(Gh,{to:`/`,replace:!0})})]})}function y4(){return(0,B.jsx)(v4,{})}var b4=document.getElementById(`root`);if(!b4)throw Error(`Root element not found`);(0,HD.createRoot)(b4).render((0,B.jsx)(H.StrictMode,{children:(0,B.jsx)(NP,{children:(0,B.jsx)(Gd,{client:ZA,children:(0,B.jsx)(Vd,{delayDuration:250,children:(0,B.jsx)(dg,{children:(0,B.jsx)(y4,{})})})})})}));export{s as a,nt as i,PP as n,l as o,ot as r,zI as t};