@caoruhua/open-claude-remote 0.1.0 → 0.1.3

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 (322) hide show
  1. package/README.md +285 -295
  2. package/dist/backend/src/api/auth-routes.d.ts.map +1 -0
  3. package/dist/backend/src/api/auth-routes.js.map +1 -0
  4. package/dist/backend/src/api/config-routes.d.ts +7 -0
  5. package/dist/backend/src/api/config-routes.d.ts.map +1 -0
  6. package/dist/{api → backend/src/api}/config-routes.js +125 -13
  7. package/dist/backend/src/api/config-routes.js.map +1 -0
  8. package/dist/backend/src/api/health-routes.d.ts.map +1 -0
  9. package/dist/backend/src/api/health-routes.js.map +1 -0
  10. package/dist/backend/src/api/hook-routes.d.ts.map +1 -0
  11. package/dist/backend/src/api/hook-routes.js.map +1 -0
  12. package/dist/{api → backend/src/api}/instance-routes.d.ts +5 -1
  13. package/dist/backend/src/api/instance-routes.d.ts.map +1 -0
  14. package/dist/{api → backend/src/api}/instance-routes.js +5 -1
  15. package/dist/backend/src/api/instance-routes.js.map +1 -0
  16. package/dist/backend/src/api/push-routes.d.ts.map +1 -0
  17. package/dist/backend/src/api/push-routes.js.map +1 -0
  18. package/dist/{api → backend/src/api}/router.d.ts +7 -1
  19. package/dist/backend/src/api/router.d.ts.map +1 -0
  20. package/dist/{api → backend/src/api}/router.js +1 -1
  21. package/dist/backend/src/api/router.js.map +1 -0
  22. package/dist/backend/src/api/status-routes.d.ts.map +1 -0
  23. package/dist/backend/src/api/status-routes.js.map +1 -0
  24. package/dist/backend/src/attach.d.ts.map +1 -0
  25. package/dist/{attach.js → backend/src/attach.js} +11 -11
  26. package/dist/backend/src/attach.js.map +1 -0
  27. package/dist/backend/src/auth/auth-middleware.d.ts.map +1 -0
  28. package/dist/backend/src/auth/auth-middleware.js.map +1 -0
  29. package/dist/backend/src/auth/rate-limiter.d.ts.map +1 -0
  30. package/dist/backend/src/auth/rate-limiter.js.map +1 -0
  31. package/dist/backend/src/auth/token-generator.d.ts.map +1 -0
  32. package/dist/{auth → backend/src/auth}/token-generator.js +1 -1
  33. package/dist/backend/src/auth/token-generator.js.map +1 -0
  34. package/dist/{cli-utils.d.ts → backend/src/cli-utils.d.ts} +3 -3
  35. package/dist/backend/src/cli-utils.d.ts.map +1 -0
  36. package/dist/{cli-utils.js → backend/src/cli-utils.js} +49 -36
  37. package/dist/backend/src/cli-utils.js.map +1 -0
  38. package/dist/backend/src/cli.d.ts +22 -0
  39. package/dist/backend/src/cli.d.ts.map +1 -0
  40. package/dist/{cli.js → backend/src/cli.js} +21 -16
  41. package/dist/backend/src/cli.js.map +1 -0
  42. package/dist/{config.d.ts → backend/src/config.d.ts} +29 -5
  43. package/dist/backend/src/config.d.ts.map +1 -0
  44. package/dist/{config.js → backend/src/config.js} +198 -12
  45. package/dist/backend/src/config.js.map +1 -0
  46. package/dist/backend/src/deps/detector.d.ts +18 -0
  47. package/dist/backend/src/deps/detector.d.ts.map +1 -0
  48. package/dist/backend/src/deps/detector.js +49 -0
  49. package/dist/backend/src/deps/detector.js.map +1 -0
  50. package/dist/backend/src/deps/index.d.ts +14 -0
  51. package/dist/backend/src/deps/index.d.ts.map +1 -0
  52. package/dist/backend/src/deps/index.js +219 -0
  53. package/dist/backend/src/deps/index.js.map +1 -0
  54. package/dist/backend/src/deps/installer.d.ts +13 -0
  55. package/dist/backend/src/deps/installer.d.ts.map +1 -0
  56. package/dist/backend/src/deps/installer.js +113 -0
  57. package/dist/backend/src/deps/installer.js.map +1 -0
  58. package/dist/backend/src/deps/platform.d.ts +27 -0
  59. package/dist/backend/src/deps/platform.d.ts.map +1 -0
  60. package/dist/backend/src/deps/platform.js +154 -0
  61. package/dist/backend/src/deps/platform.js.map +1 -0
  62. package/dist/backend/src/deps/prompt.d.ts +51 -0
  63. package/dist/backend/src/deps/prompt.d.ts.map +1 -0
  64. package/dist/backend/src/deps/prompt.js +128 -0
  65. package/dist/backend/src/deps/prompt.js.map +1 -0
  66. package/dist/backend/src/deps/types.d.ts +40 -0
  67. package/dist/backend/src/deps/types.d.ts.map +1 -0
  68. package/dist/backend/src/deps/types.js +54 -0
  69. package/dist/backend/src/deps/types.js.map +1 -0
  70. package/dist/backend/src/hooks/hook-receiver.d.ts +39 -0
  71. package/dist/backend/src/hooks/hook-receiver.d.ts.map +1 -0
  72. package/dist/backend/src/hooks/hook-receiver.js +96 -0
  73. package/dist/backend/src/hooks/hook-receiver.js.map +1 -0
  74. package/dist/backend/src/hooks/hook-types.d.ts +165 -0
  75. package/dist/backend/src/hooks/hook-types.d.ts.map +1 -0
  76. package/dist/backend/src/hooks/hook-types.js +16 -0
  77. package/dist/backend/src/hooks/hook-types.js.map +1 -0
  78. package/dist/backend/src/index.d.ts.map +1 -0
  79. package/dist/{index.js → backend/src/index.js} +27 -32
  80. package/dist/backend/src/index.js.map +1 -0
  81. package/dist/backend/src/logger/logger.d.ts.map +1 -0
  82. package/dist/{logger → backend/src/logger}/logger.js +3 -5
  83. package/dist/{logger → backend/src/logger}/logger.js.map +1 -1
  84. package/dist/backend/src/notification/dingtalk-service.d.ts.map +1 -0
  85. package/dist/{notification → backend/src/notification}/dingtalk-service.js +1 -1
  86. package/dist/backend/src/notification/dingtalk-service.js.map +1 -0
  87. package/dist/backend/src/notification/notification-manager.d.ts +44 -0
  88. package/dist/backend/src/notification/notification-manager.d.ts.map +1 -0
  89. package/dist/backend/src/notification/notification-manager.js +94 -0
  90. package/dist/backend/src/notification/notification-manager.js.map +1 -0
  91. package/dist/backend/src/notification/notification-service-factory.d.ts +67 -0
  92. package/dist/backend/src/notification/notification-service-factory.d.ts.map +1 -0
  93. package/dist/backend/src/notification/notification-service-factory.js +146 -0
  94. package/dist/backend/src/notification/notification-service-factory.js.map +1 -0
  95. package/dist/backend/src/notification/wechat-work-service.d.ts +24 -0
  96. package/dist/backend/src/notification/wechat-work-service.d.ts.map +1 -0
  97. package/dist/backend/src/notification/wechat-work-service.js +88 -0
  98. package/dist/backend/src/notification/wechat-work-service.js.map +1 -0
  99. package/dist/backend/src/pty/output-buffer.d.ts.map +1 -0
  100. package/dist/backend/src/pty/output-buffer.js.map +1 -0
  101. package/dist/backend/src/pty/pty-manager.d.ts.map +1 -0
  102. package/dist/backend/src/pty/pty-manager.js.map +1 -0
  103. package/dist/backend/src/pty/types.d.ts.map +1 -0
  104. package/dist/{pty → backend/src/pty}/types.js.map +1 -1
  105. package/dist/backend/src/pty/virtual-pty.d.ts.map +1 -0
  106. package/dist/backend/src/pty/virtual-pty.js.map +1 -0
  107. package/dist/backend/src/push/push-service.d.ts.map +1 -0
  108. package/dist/backend/src/push/push-service.js.map +1 -0
  109. package/dist/{registry → backend/src/registry}/instance-registry.d.ts +1 -1
  110. package/dist/backend/src/registry/instance-registry.d.ts.map +1 -0
  111. package/dist/{registry → backend/src/registry}/instance-registry.js +1 -1
  112. package/dist/backend/src/registry/instance-registry.js.map +1 -0
  113. package/dist/backend/src/registry/instance-spawner.d.ts.map +1 -0
  114. package/dist/{registry → backend/src/registry}/instance-spawner.js +17 -5
  115. package/dist/backend/src/registry/instance-spawner.js.map +1 -0
  116. package/dist/backend/src/registry/port-finder.d.ts.map +1 -0
  117. package/dist/backend/src/registry/port-finder.js.map +1 -0
  118. package/dist/backend/src/registry/shared-token.d.ts.map +1 -0
  119. package/dist/backend/src/registry/shared-token.js.map +1 -0
  120. package/dist/{registry → backend/src/registry}/stop-instances.d.ts +1 -1
  121. package/dist/backend/src/registry/stop-instances.d.ts.map +1 -0
  122. package/dist/{registry → backend/src/registry}/stop-instances.js +1 -1
  123. package/dist/backend/src/registry/stop-instances.js.map +1 -0
  124. package/dist/{session → backend/src/session}/session-controller.d.ts +21 -6
  125. package/dist/backend/src/session/session-controller.d.ts.map +1 -0
  126. package/dist/{session → backend/src/session}/session-controller.js +108 -25
  127. package/dist/backend/src/session/session-controller.js.map +1 -0
  128. package/dist/backend/src/terminal/terminal-relay.d.ts.map +1 -0
  129. package/dist/backend/src/terminal/terminal-relay.js.map +1 -0
  130. package/dist/backend/src/utils/ansi-filter.d.ts.map +1 -0
  131. package/dist/backend/src/utils/ansi-filter.js.map +1 -0
  132. package/dist/backend/src/utils/file-lock.d.ts.map +1 -0
  133. package/dist/backend/src/utils/file-lock.js.map +1 -0
  134. package/dist/backend/src/utils/ip-monitor.d.ts.map +1 -0
  135. package/dist/backend/src/utils/ip-monitor.js.map +1 -0
  136. package/dist/backend/src/utils/network.d.ts.map +1 -0
  137. package/dist/backend/src/utils/network.js.map +1 -0
  138. package/dist/backend/src/utils/qrcode-banner.d.ts.map +1 -0
  139. package/dist/backend/src/utils/qrcode-banner.js.map +1 -0
  140. package/dist/backend/src/ws/ws-handler.d.ts.map +1 -0
  141. package/dist/backend/src/ws/ws-handler.js.map +1 -0
  142. package/dist/{ws → backend/src/ws}/ws-server.d.ts +1 -1
  143. package/dist/backend/src/ws/ws-server.d.ts.map +1 -0
  144. package/dist/{ws → backend/src/ws}/ws-server.js +2 -2
  145. package/dist/backend/src/ws/ws-server.js.map +1 -0
  146. package/dist/shared/constants.d.ts.map +1 -0
  147. package/dist/shared/constants.js.map +1 -0
  148. package/dist/shared/defaults.d.ts.map +1 -0
  149. package/dist/shared/defaults.js.map +1 -0
  150. package/{shared-dist → dist/shared}/index.d.ts +1 -0
  151. package/dist/shared/index.d.ts.map +1 -0
  152. package/{shared-dist → dist/shared}/index.js +1 -0
  153. package/dist/shared/index.js.map +1 -0
  154. package/{shared-dist → dist/shared}/instance.d.ts +13 -0
  155. package/dist/shared/instance.d.ts.map +1 -0
  156. package/dist/shared/instance.js.map +1 -0
  157. package/dist/shared/notification-types.d.ts +85 -0
  158. package/dist/shared/notification-types.d.ts.map +1 -0
  159. package/dist/shared/notification-types.js +92 -0
  160. package/dist/shared/notification-types.js.map +1 -0
  161. package/{shared-dist → dist/shared}/ws-protocol.d.ts +6 -1
  162. package/dist/shared/ws-protocol.d.ts.map +1 -0
  163. package/dist/shared/ws-protocol.js.map +1 -0
  164. package/frontend-dist/assets/index-DOeBWumG.js +152 -0
  165. package/frontend-dist/index.html +2 -2
  166. package/package.json +62 -27
  167. package/scripts/build.sh +21 -0
  168. package/scripts/dev.sh +11 -0
  169. package/scripts/fix-node-pty-permissions.js +47 -0
  170. package/scripts/git-hooks/pre-commit +258 -0
  171. package/scripts/stop.sh +5 -0
  172. package/dist/api/auth-routes.d.ts.map +0 -1
  173. package/dist/api/auth-routes.js.map +0 -1
  174. package/dist/api/config-routes.d.ts +0 -4
  175. package/dist/api/config-routes.d.ts.map +0 -1
  176. package/dist/api/config-routes.js.map +0 -1
  177. package/dist/api/health-routes.d.ts.map +0 -1
  178. package/dist/api/health-routes.js.map +0 -1
  179. package/dist/api/hook-routes.d.ts.map +0 -1
  180. package/dist/api/hook-routes.js.map +0 -1
  181. package/dist/api/instance-routes.d.ts.map +0 -1
  182. package/dist/api/instance-routes.js.map +0 -1
  183. package/dist/api/push-routes.d.ts.map +0 -1
  184. package/dist/api/push-routes.js.map +0 -1
  185. package/dist/api/router.d.ts.map +0 -1
  186. package/dist/api/router.js.map +0 -1
  187. package/dist/api/status-routes.d.ts.map +0 -1
  188. package/dist/api/status-routes.js.map +0 -1
  189. package/dist/attach.d.ts.map +0 -1
  190. package/dist/attach.js.map +0 -1
  191. package/dist/auth/auth-middleware.d.ts.map +0 -1
  192. package/dist/auth/auth-middleware.js.map +0 -1
  193. package/dist/auth/rate-limiter.d.ts.map +0 -1
  194. package/dist/auth/rate-limiter.js.map +0 -1
  195. package/dist/auth/token-generator.d.ts.map +0 -1
  196. package/dist/auth/token-generator.js.map +0 -1
  197. package/dist/cli-utils.d.ts.map +0 -1
  198. package/dist/cli-utils.js.map +0 -1
  199. package/dist/cli.d.ts +0 -21
  200. package/dist/cli.d.ts.map +0 -1
  201. package/dist/cli.js.map +0 -1
  202. package/dist/config.d.ts.map +0 -1
  203. package/dist/config.js.map +0 -1
  204. package/dist/hooks/hook-receiver.d.ts +0 -39
  205. package/dist/hooks/hook-receiver.d.ts.map +0 -1
  206. package/dist/hooks/hook-receiver.js +0 -46
  207. package/dist/hooks/hook-receiver.js.map +0 -1
  208. package/dist/index.d.ts.map +0 -1
  209. package/dist/index.js.map +0 -1
  210. package/dist/logger/logger.d.ts.map +0 -1
  211. package/dist/notification/dingtalk-service.d.ts.map +0 -1
  212. package/dist/notification/dingtalk-service.js.map +0 -1
  213. package/dist/pty/output-buffer.d.ts.map +0 -1
  214. package/dist/pty/output-buffer.js.map +0 -1
  215. package/dist/pty/pty-manager.d.ts.map +0 -1
  216. package/dist/pty/pty-manager.js.map +0 -1
  217. package/dist/pty/types.d.ts.map +0 -1
  218. package/dist/pty/virtual-pty.d.ts.map +0 -1
  219. package/dist/pty/virtual-pty.js.map +0 -1
  220. package/dist/push/push-service.d.ts.map +0 -1
  221. package/dist/push/push-service.js.map +0 -1
  222. package/dist/registry/instance-registry.d.ts.map +0 -1
  223. package/dist/registry/instance-registry.js.map +0 -1
  224. package/dist/registry/instance-spawner.d.ts.map +0 -1
  225. package/dist/registry/instance-spawner.js.map +0 -1
  226. package/dist/registry/port-finder.d.ts.map +0 -1
  227. package/dist/registry/port-finder.js.map +0 -1
  228. package/dist/registry/shared-token.d.ts.map +0 -1
  229. package/dist/registry/shared-token.js.map +0 -1
  230. package/dist/registry/stop-instances.d.ts.map +0 -1
  231. package/dist/registry/stop-instances.js.map +0 -1
  232. package/dist/session/session-controller.d.ts.map +0 -1
  233. package/dist/session/session-controller.js.map +0 -1
  234. package/dist/terminal/terminal-relay.d.ts.map +0 -1
  235. package/dist/terminal/terminal-relay.js.map +0 -1
  236. package/dist/utils/ansi-filter.d.ts.map +0 -1
  237. package/dist/utils/ansi-filter.js.map +0 -1
  238. package/dist/utils/file-lock.d.ts.map +0 -1
  239. package/dist/utils/file-lock.js.map +0 -1
  240. package/dist/utils/ip-monitor.d.ts.map +0 -1
  241. package/dist/utils/ip-monitor.js.map +0 -1
  242. package/dist/utils/network.d.ts.map +0 -1
  243. package/dist/utils/network.js.map +0 -1
  244. package/dist/utils/pid-file.d.ts +0 -10
  245. package/dist/utils/pid-file.d.ts.map +0 -1
  246. package/dist/utils/pid-file.js +0 -30
  247. package/dist/utils/pid-file.js.map +0 -1
  248. package/dist/utils/qrcode-banner.d.ts.map +0 -1
  249. package/dist/utils/qrcode-banner.js.map +0 -1
  250. package/dist/ws/ws-handler.d.ts.map +0 -1
  251. package/dist/ws/ws-handler.js.map +0 -1
  252. package/dist/ws/ws-server.d.ts.map +0 -1
  253. package/dist/ws/ws-server.js.map +0 -1
  254. package/frontend-dist/assets/index-BqqB1hYe.js +0 -141
  255. package/shared-dist/constants.d.ts.map +0 -1
  256. package/shared-dist/constants.js.map +0 -1
  257. package/shared-dist/defaults.d.ts.map +0 -1
  258. package/shared-dist/defaults.js.map +0 -1
  259. package/shared-dist/index.d.ts.map +0 -1
  260. package/shared-dist/index.js.map +0 -1
  261. package/shared-dist/instance.d.ts.map +0 -1
  262. package/shared-dist/instance.js.map +0 -1
  263. package/shared-dist/question-utils.d.ts +0 -15
  264. package/shared-dist/question-utils.d.ts.map +0 -1
  265. package/shared-dist/question-utils.js +0 -24
  266. package/shared-dist/question-utils.js.map +0 -1
  267. package/shared-dist/ws-protocol.d.ts.map +0 -1
  268. package/shared-dist/ws-protocol.js.map +0 -1
  269. /package/dist/{api → backend/src/api}/auth-routes.d.ts +0 -0
  270. /package/dist/{api → backend/src/api}/auth-routes.js +0 -0
  271. /package/dist/{api → backend/src/api}/health-routes.d.ts +0 -0
  272. /package/dist/{api → backend/src/api}/health-routes.js +0 -0
  273. /package/dist/{api → backend/src/api}/hook-routes.d.ts +0 -0
  274. /package/dist/{api → backend/src/api}/hook-routes.js +0 -0
  275. /package/dist/{api → backend/src/api}/push-routes.d.ts +0 -0
  276. /package/dist/{api → backend/src/api}/push-routes.js +0 -0
  277. /package/dist/{api → backend/src/api}/status-routes.d.ts +0 -0
  278. /package/dist/{api → backend/src/api}/status-routes.js +0 -0
  279. /package/dist/{attach.d.ts → backend/src/attach.d.ts} +0 -0
  280. /package/dist/{auth → backend/src/auth}/auth-middleware.d.ts +0 -0
  281. /package/dist/{auth → backend/src/auth}/auth-middleware.js +0 -0
  282. /package/dist/{auth → backend/src/auth}/rate-limiter.d.ts +0 -0
  283. /package/dist/{auth → backend/src/auth}/rate-limiter.js +0 -0
  284. /package/dist/{auth → backend/src/auth}/token-generator.d.ts +0 -0
  285. /package/dist/{index.d.ts → backend/src/index.d.ts} +0 -0
  286. /package/dist/{logger → backend/src/logger}/logger.d.ts +0 -0
  287. /package/dist/{notification → backend/src/notification}/dingtalk-service.d.ts +0 -0
  288. /package/dist/{pty → backend/src/pty}/output-buffer.d.ts +0 -0
  289. /package/dist/{pty → backend/src/pty}/output-buffer.js +0 -0
  290. /package/dist/{pty → backend/src/pty}/pty-manager.d.ts +0 -0
  291. /package/dist/{pty → backend/src/pty}/pty-manager.js +0 -0
  292. /package/dist/{pty → backend/src/pty}/types.d.ts +0 -0
  293. /package/dist/{pty → backend/src/pty}/types.js +0 -0
  294. /package/dist/{pty → backend/src/pty}/virtual-pty.d.ts +0 -0
  295. /package/dist/{pty → backend/src/pty}/virtual-pty.js +0 -0
  296. /package/dist/{push → backend/src/push}/push-service.d.ts +0 -0
  297. /package/dist/{push → backend/src/push}/push-service.js +0 -0
  298. /package/dist/{registry → backend/src/registry}/instance-spawner.d.ts +0 -0
  299. /package/dist/{registry → backend/src/registry}/port-finder.d.ts +0 -0
  300. /package/dist/{registry → backend/src/registry}/port-finder.js +0 -0
  301. /package/dist/{registry → backend/src/registry}/shared-token.d.ts +0 -0
  302. /package/dist/{registry → backend/src/registry}/shared-token.js +0 -0
  303. /package/dist/{terminal → backend/src/terminal}/terminal-relay.d.ts +0 -0
  304. /package/dist/{terminal → backend/src/terminal}/terminal-relay.js +0 -0
  305. /package/dist/{utils → backend/src/utils}/ansi-filter.d.ts +0 -0
  306. /package/dist/{utils → backend/src/utils}/ansi-filter.js +0 -0
  307. /package/dist/{utils → backend/src/utils}/file-lock.d.ts +0 -0
  308. /package/dist/{utils → backend/src/utils}/file-lock.js +0 -0
  309. /package/dist/{utils → backend/src/utils}/ip-monitor.d.ts +0 -0
  310. /package/dist/{utils → backend/src/utils}/ip-monitor.js +0 -0
  311. /package/dist/{utils → backend/src/utils}/network.d.ts +0 -0
  312. /package/dist/{utils → backend/src/utils}/network.js +0 -0
  313. /package/dist/{utils → backend/src/utils}/qrcode-banner.d.ts +0 -0
  314. /package/dist/{utils → backend/src/utils}/qrcode-banner.js +0 -0
  315. /package/dist/{ws → backend/src/ws}/ws-handler.d.ts +0 -0
  316. /package/dist/{ws → backend/src/ws}/ws-handler.js +0 -0
  317. /package/{shared-dist → dist/shared}/constants.d.ts +0 -0
  318. /package/{shared-dist → dist/shared}/constants.js +0 -0
  319. /package/{shared-dist → dist/shared}/defaults.d.ts +0 -0
  320. /package/{shared-dist → dist/shared}/defaults.js +0 -0
  321. /package/{shared-dist → dist/shared}/instance.js +0 -0
  322. /package/{shared-dist → dist/shared}/ws-protocol.js +0 -0
@@ -0,0 +1,152 @@
1
+ (function(){const C=document.createElement("link").relList;if(C&&C.supports&&C.supports("modulepreload"))return;for(const H of document.querySelectorAll('link[rel="modulepreload"]'))A(H);new MutationObserver(H=>{for(const N of H)if(N.type==="childList")for(const z of N.addedNodes)z.tagName==="LINK"&&z.rel==="modulepreload"&&A(z)}).observe(document,{childList:!0,subtree:!0});function D(H){const N={};return H.integrity&&(N.integrity=H.integrity),H.referrerPolicy&&(N.referrerPolicy=H.referrerPolicy),H.crossOrigin==="use-credentials"?N.credentials="include":H.crossOrigin==="anonymous"?N.credentials="omit":N.credentials="same-origin",N}function A(H){if(H.ep)return;H.ep=!0;const N=D(H);fetch(H.href,N)}})();function Wp(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var wc={exports:{}},xn={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Yf;function $p(){if(Yf)return xn;Yf=1;var f=Symbol.for("react.transitional.element"),C=Symbol.for("react.fragment");function D(A,H,N){var z=null;if(N!==void 0&&(z=""+N),H.key!==void 0&&(z=""+H.key),"key"in H){N={};for(var s in H)s!=="key"&&(N[s]=H[s])}else N=H;return H=N.ref,{$$typeof:f,type:A,key:z,ref:H!==void 0?H:null,props:N}}return xn.Fragment=C,xn.jsx=D,xn.jsxs=D,xn}var Vf;function Gp(){return Vf||(Vf=1,wc.exports=$p()),wc.exports}var V=Gp(),xc={exports:{}},Re={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Xf;function Yp(){if(Xf)return Re;Xf=1;var f=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),z=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),p=Symbol.iterator;function m(O){return O===null||typeof O!="object"?null:(O=p&&O[p]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,n={};function o(O,U,Q){this.props=O,this.context=U,this.refs=n,this.updater=Q||w}o.prototype.isReactComponent={},o.prototype.setState=function(O,U){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,U,"setState")},o.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function l(){}l.prototype=o.prototype;function u(O,U,Q){this.props=O,this.context=U,this.refs=n,this.updater=Q||w}var S=u.prototype=new l;S.constructor=u,_(S,o.prototype),S.isPureReactComponent=!0;var E=Array.isArray;function b(){}var x={H:null,A:null,T:null,S:null},y=Object.prototype.hasOwnProperty;function R(O,U,Q){var ee=Q.ref;return{$$typeof:f,type:O,key:U,ref:ee!==void 0?ee:null,props:Q}}function L(O,U){return R(O.type,U,O.props)}function I(O){return typeof O=="object"&&O!==null&&O.$$typeof===f}function M(O){var U={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(Q){return U[Q]})}var B=/\/+/g;function G(O,U){return typeof O=="object"&&O!==null&&O.key!=null?M(""+O.key):U.toString(36)}function X(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(b,b):(O.status="pending",O.then(function(U){O.status==="pending"&&(O.status="fulfilled",O.value=U)},function(U){O.status==="pending"&&(O.status="rejected",O.reason=U)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function W(O,U,Q,ee,he){var ce=typeof O;(ce==="undefined"||ce==="boolean")&&(O=null);var K=!1;if(O===null)K=!0;else switch(ce){case"bigint":case"string":case"number":K=!0;break;case"object":switch(O.$$typeof){case f:case C:K=!0;break;case g:return K=O._init,W(K(O._payload),U,Q,ee,he)}}if(K)return he=he(O),K=ee===""?"."+G(O,0):ee,E(he)?(Q="",K!=null&&(Q=K.replace(B,"$&/")+"/"),W(he,U,Q,"",function(ie){return ie})):he!=null&&(I(he)&&(he=L(he,Q+(he.key==null||O&&O.key===he.key?"":(""+he.key).replace(B,"$&/")+"/")+K)),U.push(he)),1;K=0;var P=ee===""?".":ee+":";if(E(O))for(var ne=0;ne<O.length;ne++)ee=O[ne],ce=P+G(ee,ne),K+=W(ee,U,Q,ce,he);else if(ne=m(O),typeof ne=="function")for(O=ne.call(O),ne=0;!(ee=O.next()).done;)ee=ee.value,ce=P+G(ee,ne++),K+=W(ee,U,Q,ce,he);else if(ce==="object"){if(typeof O.then=="function")return W(X(O),U,Q,ee,he);throw U=String(O),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return K}function $(O,U,Q){if(O==null)return O;var ee=[],he=0;return W(O,ee,"","",function(ce){return U.call(Q,ce,he++)}),ee}function Y(O){if(O._status===-1){var U=O._result;U=U(),U.then(function(Q){(O._status===0||O._status===-1)&&(O._status=1,O._result=Q)},function(Q){(O._status===0||O._status===-1)&&(O._status=2,O._result=Q)}),O._status===-1&&(O._status=0,O._result=U)}if(O._status===1)return O._result.default;throw O._result}var k=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},F={map:$,forEach:function(O,U,Q){$(O,function(){U.apply(this,arguments)},Q)},count:function(O){var U=0;return $(O,function(){U++}),U},toArray:function(O){return $(O,function(U){return U})||[]},only:function(O){if(!I(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Re.Activity=a,Re.Children=F,Re.Component=o,Re.Fragment=D,Re.Profiler=H,Re.PureComponent=u,Re.StrictMode=A,Re.Suspense=c,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,Re.__COMPILER_RUNTIME={__proto__:null,c:function(O){return x.H.useMemoCache(O)}},Re.cache=function(O){return function(){return O.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(O,U,Q){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ee=_({},O.props),he=O.key;if(U!=null)for(ce in U.key!==void 0&&(he=""+U.key),U)!y.call(U,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&U.ref===void 0||(ee[ce]=U[ce]);var ce=arguments.length-2;if(ce===1)ee.children=Q;else if(1<ce){for(var K=Array(ce),P=0;P<ce;P++)K[P]=arguments[P+2];ee.children=K}return R(O.type,he,ee)},Re.createContext=function(O){return O={$$typeof:z,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:N,_context:O},O},Re.createElement=function(O,U,Q){var ee,he={},ce=null;if(U!=null)for(ee in U.key!==void 0&&(ce=""+U.key),U)y.call(U,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(he[ee]=U[ee]);var K=arguments.length-2;if(K===1)he.children=Q;else if(1<K){for(var P=Array(K),ne=0;ne<K;ne++)P[ne]=arguments[ne+2];he.children=P}if(O&&O.defaultProps)for(ee in K=O.defaultProps,K)he[ee]===void 0&&(he[ee]=K[ee]);return R(O,ce,he)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(O){return{$$typeof:s,render:O}},Re.isValidElement=I,Re.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:Y}},Re.memo=function(O,U){return{$$typeof:h,type:O,compare:U===void 0?null:U}},Re.startTransition=function(O){var U=x.T,Q={};x.T=Q;try{var ee=O(),he=x.S;he!==null&&he(Q,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(b,k)}catch(ce){k(ce)}finally{U!==null&&Q.types!==null&&(U.types=Q.types),x.T=U}},Re.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},Re.use=function(O){return x.H.use(O)},Re.useActionState=function(O,U,Q){return x.H.useActionState(O,U,Q)},Re.useCallback=function(O,U){return x.H.useCallback(O,U)},Re.useContext=function(O){return x.H.useContext(O)},Re.useDebugValue=function(){},Re.useDeferredValue=function(O,U){return x.H.useDeferredValue(O,U)},Re.useEffect=function(O,U){return x.H.useEffect(O,U)},Re.useEffectEvent=function(O){return x.H.useEffectEvent(O)},Re.useId=function(){return x.H.useId()},Re.useImperativeHandle=function(O,U,Q){return x.H.useImperativeHandle(O,U,Q)},Re.useInsertionEffect=function(O,U){return x.H.useInsertionEffect(O,U)},Re.useLayoutEffect=function(O,U){return x.H.useLayoutEffect(O,U)},Re.useMemo=function(O,U){return x.H.useMemo(O,U)},Re.useOptimistic=function(O,U){return x.H.useOptimistic(O,U)},Re.useReducer=function(O,U,Q){return x.H.useReducer(O,U,Q)},Re.useRef=function(O){return x.H.useRef(O)},Re.useState=function(O){return x.H.useState(O)},Re.useSyncExternalStore=function(O,U,Q){return x.H.useSyncExternalStore(O,U,Q)},Re.useTransition=function(){return x.H.useTransition()},Re.version="19.2.4",Re}var Kf;function Gc(){return Kf||(Kf=1,xc.exports=Yp()),xc.exports}var q=Gc();const xt=Wp(q);var Ec={exports:{}},En={},Rc={exports:{}},Ac={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Zf;function Vp(){return Zf||(Zf=1,(function(f){function C(W,$){var Y=W.length;W.push($);e:for(;0<Y;){var k=Y-1>>>1,F=W[k];if(0<H(F,$))W[k]=$,W[Y]=F,Y=k;else break e}}function D(W){return W.length===0?null:W[0]}function A(W){if(W.length===0)return null;var $=W[0],Y=W.pop();if(Y!==$){W[0]=Y;e:for(var k=0,F=W.length,O=F>>>1;k<O;){var U=2*(k+1)-1,Q=W[U],ee=U+1,he=W[ee];if(0>H(Q,Y))ee<F&&0>H(he,Q)?(W[k]=he,W[ee]=Y,k=ee):(W[k]=Q,W[U]=Y,k=U);else if(ee<F&&0>H(he,Y))W[k]=he,W[ee]=Y,k=ee;else break e}}return $}function H(W,$){var Y=W.sortIndex-$.sortIndex;return Y!==0?Y:W.id-$.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var N=performance;f.unstable_now=function(){return N.now()}}else{var z=Date,s=z.now();f.unstable_now=function(){return z.now()-s}}var c=[],h=[],g=1,a=null,p=3,m=!1,w=!1,_=!1,n=!1,o=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,u=typeof setImmediate<"u"?setImmediate:null;function S(W){for(var $=D(h);$!==null;){if($.callback===null)A(h);else if($.startTime<=W)A(h),$.sortIndex=$.expirationTime,C(c,$);else break;$=D(h)}}function E(W){if(_=!1,S(W),!w)if(D(c)!==null)w=!0,b||(b=!0,M());else{var $=D(h);$!==null&&X(E,$.startTime-W)}}var b=!1,x=-1,y=5,R=-1;function L(){return n?!0:!(f.unstable_now()-R<y)}function I(){if(n=!1,b){var W=f.unstable_now();R=W;var $=!0;try{e:{w=!1,_&&(_=!1,l(x),x=-1),m=!0;var Y=p;try{t:{for(S(W),a=D(c);a!==null&&!(a.expirationTime>W&&L());){var k=a.callback;if(typeof k=="function"){a.callback=null,p=a.priorityLevel;var F=k(a.expirationTime<=W);if(W=f.unstable_now(),typeof F=="function"){a.callback=F,S(W),$=!0;break t}a===D(c)&&A(c),S(W)}else A(c);a=D(c)}if(a!==null)$=!0;else{var O=D(h);O!==null&&X(E,O.startTime-W),$=!1}}break e}finally{a=null,p=Y,m=!1}$=void 0}}finally{$?M():b=!1}}}var M;if(typeof u=="function")M=function(){u(I)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,G=B.port2;B.port1.onmessage=I,M=function(){G.postMessage(null)}}else M=function(){o(I,0)};function X(W,$){x=o(function(){W(f.unstable_now())},$)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(W){W.callback=null},f.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<W?Math.floor(1e3/W):5},f.unstable_getCurrentPriorityLevel=function(){return p},f.unstable_next=function(W){switch(p){case 1:case 2:case 3:var $=3;break;default:$=p}var Y=p;p=$;try{return W()}finally{p=Y}},f.unstable_requestPaint=function(){n=!0},f.unstable_runWithPriority=function(W,$){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Y=p;p=W;try{return $()}finally{p=Y}},f.unstable_scheduleCallback=function(W,$,Y){var k=f.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?k+Y:k):Y=k,W){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=Y+F,W={id:g++,callback:$,priorityLevel:W,startTime:Y,expirationTime:F,sortIndex:-1},Y>k?(W.sortIndex=Y,C(h,W),D(c)===null&&W===D(h)&&(_?(l(x),x=-1):_=!0,X(E,Y-k))):(W.sortIndex=F,C(c,W),w||m||(w=!0,b||(b=!0,M()))),W},f.unstable_shouldYield=L,f.unstable_wrapCallback=function(W){var $=p;return function(){var Y=p;p=$;try{return W.apply(this,arguments)}finally{p=Y}}}})(Ac)),Ac}var Qf;function Xp(){return Qf||(Qf=1,Rc.exports=Vp()),Rc.exports}var Dc={exports:{}},Ot={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Jf;function Kp(){if(Jf)return Ot;Jf=1;var f=Gc();function C(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function D(){}var A={d:{f:D,r:function(){throw Error(C(522))},D,C:D,L:D,m:D,X:D,S:D,M:D},p:0,findDOMNode:null},H=Symbol.for("react.portal");function N(c,h,g){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H,key:a==null?null:""+a,children:c,containerInfo:h,implementation:g}}var z=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ot.createPortal=function(c,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(C(299));return N(c,h,null,g)},Ot.flushSync=function(c){var h=z.T,g=A.p;try{if(z.T=null,A.p=2,c)return c()}finally{z.T=h,A.p=g,A.d.f()}},Ot.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,A.d.C(c,h))},Ot.prefetchDNS=function(c){typeof c=="string"&&A.d.D(c)},Ot.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var g=h.as,a=s(g,h.crossOrigin),p=typeof h.integrity=="string"?h.integrity:void 0,m=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?A.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:a,integrity:p,fetchPriority:m}):g==="script"&&A.d.X(c,{crossOrigin:a,integrity:p,fetchPriority:m,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ot.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=s(h.as,h.crossOrigin);A.d.M(c,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&A.d.M(c)},Ot.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,a=s(g,h.crossOrigin);A.d.L(c,g,{crossOrigin:a,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Ot.preloadModule=function(c,h){if(typeof c=="string")if(h){var g=s(h.as,h.crossOrigin);A.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else A.d.m(c)},Ot.requestFormReset=function(c){A.d.r(c)},Ot.unstable_batchedUpdates=function(c,h){return c(h)},Ot.useFormState=function(c,h,g){return z.H.useFormState(c,h,g)},Ot.useFormStatus=function(){return z.H.useHostTransitionStatus()},Ot.version="19.2.4",Ot}var e_;function j_(){if(e_)return Dc.exports;e_=1;function f(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(C){console.error(C)}}return f(),Dc.exports=Kp(),Dc.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var t_;function Zp(){if(t_)return En;t_=1;var f=Xp(),C=Gc(),D=j_();function A(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 H(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function N(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function z(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 s(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 c(e){if(N(e)!==e)throw Error(A(188))}function h(e){var t=e.alternate;if(!t){if(t=N(e),t===null)throw Error(A(188));return t!==e?null:e}for(var i=e,r=t;;){var d=i.return;if(d===null)break;var v=d.alternate;if(v===null){if(r=d.return,r!==null){i=r;continue}break}if(d.child===v.child){for(v=d.child;v;){if(v===i)return c(d),e;if(v===r)return c(d),t;v=v.sibling}throw Error(A(188))}if(i.return!==r.return)i=d,r=v;else{for(var T=!1,j=d.child;j;){if(j===i){T=!0,i=d,r=v;break}if(j===r){T=!0,r=d,i=v;break}j=j.sibling}if(!T){for(j=v.child;j;){if(j===i){T=!0,i=v,r=d;break}if(j===r){T=!0,r=v,i=d;break}j=j.sibling}if(!T)throw Error(A(189))}}if(i.alternate!==r)throw Error(A(190))}if(i.tag!==3)throw Error(A(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var a=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function M(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var B=Symbol.for("react.client.reference");function G(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===B?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _:return"Fragment";case o:return"Profiler";case n:return"StrictMode";case E:return"Suspense";case b:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case u:return e.displayName||"Context";case l:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case x:return t=e.displayName||null,t!==null?t:G(e.type)||"Memo";case y:t=e._payload,e=e._init;try{return G(e(t))}catch{}}return null}var X=Array.isArray,W=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=D.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},k=[],F=-1;function O(e){return{current:e}}function U(e){0>F||(e.current=k[F],k[F]=null,F--)}function Q(e,t){F++,k[F]=e.current,e.current=t}var ee=O(null),he=O(null),ce=O(null),K=O(null);function P(e,t){switch(Q(ce,t),Q(he,e),Q(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vf(t),e=pf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(ee),Q(ee,e)}function ne(){U(ee),U(he),U(ce)}function ie(e){e.memoizedState!==null&&Q(K,e);var t=ee.current,i=pf(t,e.type);t!==i&&(Q(he,e),Q(ee,i))}function _e(e){he.current===e&&(U(ee),U(he)),K.current===e&&(U(K),bn._currentValue=Y)}var fe,ye;function ve(e){if(fe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||"",ye=-1<i.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+fe+e+ye}var Te=!1;function Pe(e,t){if(!e||Te)return"";Te=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(oe){var ae=oe}Reflect.construct(e,[],de)}else{try{de.call()}catch(oe){ae=oe}e.call(de.prototype)}}else{try{throw Error()}catch(oe){ae=oe}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(oe){if(oe&&ae&&typeof oe.stack=="string")return[oe.stack,ae.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=r.DetermineComponentFrameRoot(),T=v[0],j=v[1];if(T&&j){var Z=T.split(`
44
+ `),se=j.split(`
45
+ `);for(d=r=0;r<Z.length&&!Z[r].includes("DetermineComponentFrameRoot");)r++;for(;d<se.length&&!se[d].includes("DetermineComponentFrameRoot");)d++;if(r===Z.length||d===se.length)for(r=Z.length-1,d=se.length-1;1<=r&&0<=d&&Z[r]!==se[d];)d--;for(;1<=r&&0<=d;r--,d--)if(Z[r]!==se[d]){if(r!==1||d!==1)do if(r--,d--,0>d||Z[r]!==se[d]){var le=`
46
+ `+Z[r].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=r&&0<=d);break}}}finally{Te=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ve(i):""}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve("Lazy");case 13:return e.child!==t&&t!==null?ve("Suspense Fallback"):ve("Suspense");case 19:return ve("SuspenseList");case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return ve("Activity");default:return""}}function Mt(e){try{var t="",i=null;do t+=Se(e,i),i=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var It=Object.prototype.hasOwnProperty,xe=f.unstable_scheduleCallback,Ee=f.unstable_cancelCallback,Ae=f.unstable_shouldYield,ge=f.unstable_requestPaint,we=f.unstable_now,Ke=f.unstable_getCurrentPriorityLevel,qe=f.unstable_ImmediatePriority,gt=f.unstable_UserBlockingPriority,Ze=f.unstable_NormalPriority,ct=f.unstable_LowPriority,Qe=f.unstable_IdlePriority,ke=f.log,De=f.unstable_setDisableYieldValue,Xt=null,ut=null;function Et(e){if(typeof ke=="function"&&De(e),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(Xt,e)}catch{}}var vt=Math.clz32?Math.clz32:Os,Ji=Math.log,Fr=Math.LN2;function Os(e){return e>>>=0,e===0?32:31-(Ji(e)/Fr|0)|0}var Ei=256,Mi=262144,tt=4194304;function rt(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&261888;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 bt(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var d=0,v=e.suspendedLanes,T=e.pingedLanes;e=e.warmLanes;var j=r&134217727;return j!==0?(r=j&~v,r!==0?d=rt(r):(T&=j,T!==0?d=rt(T):i||(i=j&~e,i!==0&&(d=rt(i))))):(j=r&~v,j!==0?d=rt(j):T!==0?d=rt(T):i||(i=r&~e,i!==0&&(d=rt(i)))),d===0?0:t!==0&&t!==d&&(t&v)===0&&(v=d&-d,i=t&-t,v>=i||v===32&&(i&4194048)!==0)?t:d}function Nt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ut(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 kt(){var e=tt;return tt<<=1,(tt&62914560)===0&&(tt=4194304),e}function jt(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function si(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(e,t,i,r,d,v){var T=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var j=e.entanglements,Z=e.expirationTimes,se=e.hiddenUpdates;for(i=T&~i;0<i;){var le=31-vt(i),de=1<<le;j[le]=0,Z[le]=-1;var ae=se[le];if(ae!==null)for(se[le]=null,le=0;le<ae.length;le++){var oe=ae[le];oe!==null&&(oe.lane&=-536870913)}i&=~de}r!==0&&Si(e,r,0),v!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=v&~(T&~t))}function Si(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-vt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|i&261930}function Kt(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var r=31-vt(i),d=1<<r;d&t|e[r]&t&&(e[r]|=t),i&=~d}}function ni(e,t){var i=t&-t;return i=(i&42)!==0?1:ki(i),(i&(e.suspendedLanes|t))!==0?0:i}function ki(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 Oi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function bi(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:jf(e.type))}function er(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var ai=Math.random().toString(36).slice(2),Rt="__reactFiber$"+ai,Pt="__reactProps$"+ai,qr="__reactContainer$"+ai,_o="__reactEvents$"+ai,Og="__reactListeners$"+ai,Bg="__reactHandles$"+ai,iu="__reactResources$"+ai,Bs="__reactMarker$"+ai;function go(e){delete e[Rt],delete e[Pt],delete e[_o],delete e[Og],delete e[Bg]}function Wr(e){var t=e[Rt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[qr]||i[Rt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=xf(e);e!==null;){if(i=e[Rt])return i;e=xf(e)}return t}e=i,i=e.parentNode}return null}function $r(e){if(e=e[Rt]||e[qr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Hs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(A(33))}function Gr(e){var t=e[iu];return t||(t=e[iu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Bs]=!0}var ru=new Set,su={};function Er(e,t){Yr(e,t),Yr(e+"Capture",t)}function Yr(e,t){for(su[e]=t,e=0;e<t.length;e++)ru.add(t[e])}var Hg=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]*$"),nu={},au={};function zg(e){return It.call(au,e)?!0:It.call(nu,e)?!1:Hg.test(e)?au[e]=!0:(nu[e]=!0,!1)}function jn(e,t,i){if(zg(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){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,""+i)}}function Pn(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Bi(e,t,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+r)}}function oi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ou(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ig(e,t,i){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var d=r.get,v=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(T){i=""+T,v.call(this,T)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(T){i=""+T},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function vo(e){if(!e._valueTracker){var t=ou(e)?"checked":"value";e._valueTracker=Ig(e,t,""+e[t])}}function lu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),r="";return e&&(r=ou(e)?e.checked?"true":"false":e.value),e=r,e!==i?(t.setValue(e),!0):!1}function Fn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ng=/[\n"\\]/g;function li(e){return e.replace(Ng,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function po(e,t,i,r,d,v,T,j){e.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.type=T:e.removeAttribute("type"),t!=null?T==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+oi(t)):e.value!==""+oi(t)&&(e.value=""+oi(t)):T!=="submit"&&T!=="reset"||e.removeAttribute("value"),t!=null?mo(e,T,oi(t)):i!=null?mo(e,T,oi(i)):r!=null&&e.removeAttribute("value"),d==null&&v!=null&&(e.defaultChecked=!!v),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+oi(j):e.removeAttribute("name")}function cu(e,t,i,r,d,v,T,j){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.type=v),t!=null||i!=null){if(!(v!=="submit"&&v!=="reset"||t!=null)){vo(e);return}i=i!=null?""+oi(i):"",t=t!=null?""+oi(t):i,j||t===e.value||(e.value=t),e.defaultValue=t}r=r??d,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=j?e.checked:!!r,e.defaultChecked=!!r,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(e.name=T),vo(e)}function mo(e,t,i){t==="number"&&Fn(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Vr(e,t,i,r){if(e=e.options,t){t={};for(var d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&r&&(e[i].defaultSelected=!0)}else{for(i=""+oi(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,r&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function uu(e,t,i){if(t!=null&&(t=""+oi(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+oi(i):""}function hu(e,t,i,r){if(t==null){if(r!=null){if(i!=null)throw Error(A(92));if(X(r)){if(1<r.length)throw Error(A(93));r=r[0]}i=r}i==null&&(i=""),t=i}i=oi(t),e.defaultValue=i,r=e.textContent,r===i&&r!==""&&r!==null&&(e.value=r),vo(e)}function Xr(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Ug=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 du(e,t,i){var r=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,i):typeof i!="number"||i===0||Ug.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function fu(e,t,i){if(t!=null&&typeof t!="object")throw Error(A(62));if(e=e.style,i!=null){for(var r in i)!i.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var d in t)r=t[d],t.hasOwnProperty(d)&&i[d]!==r&&du(e,d,r)}else for(var v in t)t.hasOwnProperty(v)&&du(e,v,t[v])}function So(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 jg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Pg=/^[\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 qn(e){return Pg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Hi(){}var bo=null;function yo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kr=null,Zr=null;function _u(e){var t=$r(e);if(t&&(e=t.stateNode)){var i=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(po(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+li(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var r=i[t];if(r!==e&&r.form===e.form){var d=r[Pt]||null;if(!d)throw Error(A(90));po(r,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<i.length;t++)r=i[t],r.form===e.form&&lu(r)}break e;case"textarea":uu(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Vr(e,!!i.multiple,t,!1)}}}var Co=!1;function gu(e,t,i){if(Co)return e(t,i);Co=!0;try{var r=e(t);return r}finally{if(Co=!1,(Kr!==null||Zr!==null)&&(Ta(),Kr&&(t=Kr,e=Zr,Zr=Kr=null,_u(t),e)))for(t=0;t<e.length;t++)_u(e[t])}}function zs(e,t){var i=e.stateNode;if(i===null)return null;var r=i[Pt]||null;if(r===null)return null;i=r[t];e: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 e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(A(231,t,typeof i));return i}var zi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wo=!1;if(zi)try{var Is={};Object.defineProperty(Is,"passive",{get:function(){wo=!0}}),window.addEventListener("test",Is,Is),window.removeEventListener("test",Is,Is)}catch{wo=!1}var tr=null,xo=null,Wn=null;function vu(){if(Wn)return Wn;var e,t=xo,i=t.length,r,d="value"in tr?tr.value:tr.textContent,v=d.length;for(e=0;e<i&&t[e]===d[e];e++);var T=i-e;for(r=1;r<=T&&t[i-r]===d[v-r];r++);return Wn=d.slice(e,1<r?1-r:void 0)}function $n(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 Gn(){return!0}function pu(){return!1}function Ft(e){function t(i,r,d,v,T){this._reactName=i,this._targetInst=d,this.type=r,this.nativeEvent=v,this.target=T,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(i=e[j],this[j]=i?i(v):v[j]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Gn:pu,this.isPropagationStopped=pu,this}return a(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Gn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Gn)},persist:function(){},isPersistent:Gn}),t}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yn=Ft(Rr),Ns=a({},Rr,{view:0,detail:0}),Fg=Ft(Ns),Eo,Ro,Us,Vn=a({},Ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Do,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!==Us&&(Us&&e.type==="mousemove"?(Eo=e.screenX-Us.screenX,Ro=e.screenY-Us.screenY):Ro=Eo=0,Us=e),Eo)},movementY:function(e){return"movementY"in e?e.movementY:Ro}}),mu=Ft(Vn),qg=a({},Vn,{dataTransfer:0}),Wg=Ft(qg),$g=a({},Ns,{relatedTarget:0}),Ao=Ft($g),Gg=a({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),Yg=Ft(Gg),Vg=a({},Rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xg=Ft(Vg),Kg=a({},Rr,{data:0}),Su=Ft(Kg),Zg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qg={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"},Jg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ev(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jg[e])?!!t[e]:!1}function Do(){return ev}var tv=a({},Ns,{key:function(e){if(e.key){var t=Zg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$n(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Qg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Do,charCode:function(e){return e.type==="keypress"?$n(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$n(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),iv=Ft(tv),rv=a({},Vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bu=Ft(rv),sv=a({},Ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Do}),nv=Ft(sv),av=a({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ov=Ft(av),lv=a({},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}),cv=Ft(lv),uv=a({},Rr,{newState:0,oldState:0}),hv=Ft(uv),dv=[9,13,27,32],Lo=zi&&"CompositionEvent"in window,js=null;zi&&"documentMode"in document&&(js=document.documentMode);var fv=zi&&"TextEvent"in window&&!js,yu=zi&&(!Lo||js&&8<js&&11>=js),Cu=" ",wu=!1;function xu(e,t){switch(e){case"keyup":return dv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qr=!1;function _v(e,t){switch(e){case"compositionend":return Eu(t);case"keypress":return t.which!==32?null:(wu=!0,Cu);case"textInput":return e=t.data,e===Cu&&wu?null:e;default:return null}}function gv(e,t){if(Qr)return e==="compositionend"||!Lo&&xu(e,t)?(e=vu(),Wn=xo=tr=null,Qr=!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 yu&&t.locale!=="ko"?null:t.data;default:return null}}var vv={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 Ru(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vv[e.type]:t==="textarea"}function Au(e,t,i,r){Kr?Zr?Zr.push(r):Zr=[r]:Kr=r,t=Ia(t,"onChange"),0<t.length&&(i=new Yn("onChange","change",null,i,r),e.push({event:i,listeners:t}))}var Ps=null,Fs=null;function pv(e){uf(e,0)}function Xn(e){var t=Hs(e);if(lu(t))return e}function Du(e,t){if(e==="change")return t}var Lu=!1;if(zi){var To;if(zi){var Mo="oninput"in document;if(!Mo){var Tu=document.createElement("div");Tu.setAttribute("oninput","return;"),Mo=typeof Tu.oninput=="function"}To=Mo}else To=!1;Lu=To&&(!document.documentMode||9<document.documentMode)}function Mu(){Ps&&(Ps.detachEvent("onpropertychange",ku),Fs=Ps=null)}function ku(e){if(e.propertyName==="value"&&Xn(Fs)){var t=[];Au(t,Fs,e,yo(e)),gu(pv,t)}}function mv(e,t,i){e==="focusin"?(Mu(),Ps=t,Fs=i,Ps.attachEvent("onpropertychange",ku)):e==="focusout"&&Mu()}function Sv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xn(Fs)}function bv(e,t){if(e==="click")return Xn(t)}function yv(e,t){if(e==="input"||e==="change")return Xn(t)}function Cv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:Cv;function qs(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(r=0;r<i.length;r++){var d=i[r];if(!It.call(t,d)||!Zt(e[d],t[d]))return!1}return!0}function Ou(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bu(e,t){var i=Ou(e);e=0;for(var r;i;){if(i.nodeType===3){if(r=e+i.textContent.length,e<=t&&r>=t)return{node:i,offset:t-e};e=r}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Ou(i)}}function Hu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Fn(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Fn(e.document)}return t}function ko(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 wv=zi&&"documentMode"in document&&11>=document.documentMode,Jr=null,Oo=null,Ws=null,Bo=!1;function Iu(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Bo||Jr==null||Jr!==Fn(r)||(r=Jr,"selectionStart"in r&&ko(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}),Ws&&qs(Ws,r)||(Ws=r,r=Ia(Oo,"onSelect"),0<r.length&&(t=new Yn("onSelect","select",null,t,i),e.push({event:t,listeners:r}),t.target=Jr)))}function Ar(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var es={animationend:Ar("Animation","AnimationEnd"),animationiteration:Ar("Animation","AnimationIteration"),animationstart:Ar("Animation","AnimationStart"),transitionrun:Ar("Transition","TransitionRun"),transitionstart:Ar("Transition","TransitionStart"),transitioncancel:Ar("Transition","TransitionCancel"),transitionend:Ar("Transition","TransitionEnd")},Ho={},Nu={};zi&&(Nu=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function Dr(e){if(Ho[e])return Ho[e];if(!es[e])return e;var t=es[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Nu)return Ho[e]=t[i];return e}var Uu=Dr("animationend"),ju=Dr("animationiteration"),Pu=Dr("animationstart"),xv=Dr("transitionrun"),Ev=Dr("transitionstart"),Rv=Dr("transitioncancel"),Fu=Dr("transitionend"),qu=new Map,zo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");zo.push("scrollEnd");function yi(e,t){qu.set(e,t),Er(t,[e])}var Kn=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!==null&&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)},ci=[],ts=0,Io=0;function Zn(){for(var e=ts,t=Io=ts=0;t<e;){var i=ci[t];ci[t++]=null;var r=ci[t];ci[t++]=null;var d=ci[t];ci[t++]=null;var v=ci[t];if(ci[t++]=null,r!==null&&d!==null){var T=r.pending;T===null?d.next=d:(d.next=T.next,T.next=d),r.pending=d}v!==0&&Wu(i,d,v)}}function Qn(e,t,i,r){ci[ts++]=e,ci[ts++]=t,ci[ts++]=i,ci[ts++]=r,Io|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function No(e,t,i,r){return Qn(e,t,i,r),Jn(e)}function Lr(e,t){return Qn(e,null,null,t),Jn(e)}function Wu(e,t,i){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i);for(var d=!1,v=e.return;v!==null;)v.childLanes|=i,r=v.alternate,r!==null&&(r.childLanes|=i),v.tag===22&&(e=v.stateNode,e===null||e._visibility&1||(d=!0)),e=v,v=v.return;return e.tag===3?(v=e.stateNode,d&&t!==null&&(d=31-vt(i),e=v.hiddenUpdates,r=e[d],r===null?e[d]=[t]:r.push(t),t.lane=i|536870912),v):null}function Jn(e){if(50<fn)throw fn=0,Yl=null,Error(A(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var is={};function Av(e,t,i,r){this.tag=e,this.key=i,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 Qt(e,t,i,r){return new Av(e,t,i,r)}function Uo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var i=e.alternate;return i===null?(i=Qt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function $u(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ea(e,t,i,r,d,v){var T=0;if(r=e,typeof e=="function")Uo(e)&&(T=1);else if(typeof e=="string")T=kp(e,i,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=Qt(31,i,t,d),e.elementType=R,e.lanes=v,e;case _:return Tr(i.children,d,v,t);case n:T=8,d|=24;break;case o:return e=Qt(12,i,t,d|2),e.elementType=o,e.lanes=v,e;case E:return e=Qt(13,i,t,d),e.elementType=E,e.lanes=v,e;case b:return e=Qt(19,i,t,d),e.elementType=b,e.lanes=v,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case u:T=10;break e;case l:T=9;break e;case S:T=11;break e;case x:T=14;break e;case y:T=16,r=null;break e}T=29,i=Error(A(130,e===null?"null":typeof e,"")),r=null}return t=Qt(T,i,t,d),t.elementType=e,t.type=r,t.lanes=v,t}function Tr(e,t,i,r){return e=Qt(7,e,r,t),e.lanes=i,e}function jo(e,t,i){return e=Qt(6,e,null,t),e.lanes=i,e}function Gu(e){var t=Qt(18,null,null,0);return t.stateNode=e,t}function Po(e,t,i){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yu=new WeakMap;function ui(e,t){if(typeof e=="object"&&e!==null){var i=Yu.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Mt(t)},Yu.set(e,t),t)}return{value:e,source:t,stack:Mt(t)}}var rs=[],ss=0,ta=null,$s=0,hi=[],di=0,ir=null,Ri=1,Ai="";function Ni(e,t){rs[ss++]=$s,rs[ss++]=ta,ta=e,$s=t}function Vu(e,t,i){hi[di++]=Ri,hi[di++]=Ai,hi[di++]=ir,ir=e;var r=Ri;e=Ai;var d=32-vt(r)-1;r&=~(1<<d),i+=1;var v=32-vt(t)+d;if(30<v){var T=d-d%5;v=(r&(1<<T)-1).toString(32),r>>=T,d-=T,Ri=1<<32-vt(t)+d|i<<d|r,Ai=v+e}else Ri=1<<v|i<<d|r,Ai=e}function Fo(e){e.return!==null&&(Ni(e,1),Vu(e,1,0))}function qo(e){for(;e===ta;)ta=rs[--ss],rs[ss]=null,$s=rs[--ss],rs[ss]=null;for(;e===ir;)ir=hi[--di],hi[di]=null,Ai=hi[--di],hi[di]=null,Ri=hi[--di],hi[di]=null}function Xu(e,t){hi[di++]=Ri,hi[di++]=Ai,hi[di++]=ir,Ri=t.id,Ai=t.overflow,ir=e}var At=null,Je=null,Ie=!1,rr=null,fi=!1,Wo=Error(A(519));function sr(e){var t=Error(A(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gs(ui(t,e)),Wo}function Ku(e){var t=e.stateNode,i=e.type,r=e.memoizedProps;switch(t[Rt]=e,t[Pt]=r,i){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(i=0;i<gn.length;i++)Be(gn[i],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),cu(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),hu(t,r.value,r.defaultValue,r.children)}i=r.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||r.suppressHydrationWarning===!0||_f(t.textContent,i)?(r.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),r.onScroll!=null&&Be("scroll",t),r.onScrollEnd!=null&&Be("scrollend",t),r.onClick!=null&&(t.onclick=Hi),t=!0):t=!1,t||sr(e,!0)}function Zu(e){for(At=e.return;At;)switch(At.tag){case 5:case 31:case 13:fi=!1;return;case 27:case 3:fi=!0;return;default:At=At.return}}function ns(e){if(e!==At)return!1;if(!Ie)return Zu(e),Ie=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||lc(e.type,e.memoizedProps)),i=!i),i&&Je&&sr(e),Zu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));Je=wf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));Je=wf(e)}else t===27?(t=Je,mr(e.type)?(e=fc,fc=null,Je=e):Je=t):Je=At?gi(e.stateNode.nextSibling):null;return!0}function Mr(){Je=At=null,Ie=!1}function $o(){var e=rr;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),rr=null),e}function Gs(e){rr===null?rr=[e]:rr.push(e)}var Go=O(null),kr=null,Ui=null;function nr(e,t,i){Q(Go,t._currentValue),t._currentValue=i}function ji(e){e._currentValue=Go.current,U(Go)}function Yo(e,t,i){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===i)break;e=e.return}}function Vo(e,t,i,r){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var v=d.dependencies;if(v!==null){var T=d.child;v=v.firstContext;e:for(;v!==null;){var j=v;v=d;for(var Z=0;Z<t.length;Z++)if(j.context===t[Z]){v.lanes|=i,j=v.alternate,j!==null&&(j.lanes|=i),Yo(v.return,i,e),r||(T=null);break e}v=j.next}}else if(d.tag===18){if(T=d.return,T===null)throw Error(A(341));T.lanes|=i,v=T.alternate,v!==null&&(v.lanes|=i),Yo(T,i,e),T=null}else T=d.child;if(T!==null)T.return=d;else for(T=d;T!==null;){if(T===e){T=null;break}if(d=T.sibling,d!==null){d.return=T.return,T=d;break}T=T.return}d=T}}function as(e,t,i,r){e=null;for(var d=t,v=!1;d!==null;){if(!v){if((d.flags&524288)!==0)v=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var T=d.alternate;if(T===null)throw Error(A(387));if(T=T.memoizedProps,T!==null){var j=d.type;Zt(d.pendingProps.value,T.value)||(e!==null?e.push(j):e=[j])}}else if(d===K.current){if(T=d.alternate,T===null)throw Error(A(387));T.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(bn):e=[bn])}d=d.return}e!==null&&Vo(t,e,i,r),t.flags|=262144}function ia(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Or(e){kr=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return Qu(kr,e)}function ra(e,t){return kr===null&&Or(e),Qu(e,t)}function Qu(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ui===null){if(e===null)throw Error(A(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return i}var Dv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Lv=f.unstable_scheduleCallback,Tv=f.unstable_NormalPriority,ht={$$typeof:u,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xo(){return{controller:new Dv,data:new Map,refCount:0}}function Ys(e){e.refCount--,e.refCount===0&&Lv(Tv,function(){e.controller.abort()})}var Vs=null,Ko=0,os=0,ls=null;function Mv(e,t){if(Vs===null){var i=Vs=[];Ko=0,os=Jl(),ls={status:"pending",value:void 0,then:function(r){i.push(r)}}}return Ko++,t.then(Ju,Ju),t}function Ju(){if(--Ko===0&&Vs!==null){ls!==null&&(ls.status="fulfilled");var e=Vs;Vs=null,os=0,ls=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function kv(e,t){var i=[],r={status:"pending",value:null,reason:null,then:function(d){i.push(d)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var d=0;d<i.length;d++)(0,i[d])(t)},function(d){for(r.status="rejected",r.reason=d,d=0;d<i.length;d++)(0,i[d])(void 0)}),r}var eh=W.S;W.S=function(e,t){Id=we(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Mv(e,t),eh!==null&&eh(e,t)};var Br=O(null);function Zo(){var e=Br.current;return e!==null?e:Xe.pooledCache}function sa(e,t){t===null?Q(Br,Br.current):Q(Br,t.pool)}function th(){var e=Zo();return e===null?null:{parent:ht._currentValue,pool:e}}var cs=Error(A(460)),Qo=Error(A(474)),na=Error(A(542)),aa={then:function(){}};function ih(e){return e=e.status,e==="fulfilled"||e==="rejected"}function rh(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Hi,Hi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nh(e),e;default:if(typeof t.status=="string")t.then(Hi,Hi);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(A(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=r}},function(r){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nh(e),e}throw zr=t,cs}}function Hr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(zr=i,cs):i}}var zr=null;function sh(){if(zr===null)throw Error(A(459));var e=zr;return zr=null,e}function nh(e){if(e===cs||e===na)throw Error(A(483))}var us=null,Xs=0;function oa(e){var t=Xs;return Xs+=1,us===null&&(us=[]),rh(us,e,t)}function Ks(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function la(e,t){throw t.$$typeof===p?Error(A(525)):(e=Object.prototype.toString.call(t),Error(A(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ah(e){function t(te,J){if(e){var re=te.deletions;re===null?(te.deletions=[J],te.flags|=16):re.push(J)}}function i(te,J){if(!e)return null;for(;J!==null;)t(te,J),J=J.sibling;return null}function r(te){for(var J=new Map;te!==null;)te.key!==null?J.set(te.key,te):J.set(te.index,te),te=te.sibling;return J}function d(te,J){return te=Ii(te,J),te.index=0,te.sibling=null,te}function v(te,J,re){return te.index=re,e?(re=te.alternate,re!==null?(re=re.index,re<J?(te.flags|=67108866,J):re):(te.flags|=67108866,J)):(te.flags|=1048576,J)}function T(te){return e&&te.alternate===null&&(te.flags|=67108866),te}function j(te,J,re,ue){return J===null||J.tag!==6?(J=jo(re,te.mode,ue),J.return=te,J):(J=d(J,re),J.return=te,J)}function Z(te,J,re,ue){var be=re.type;return be===_?le(te,J,re.props.children,ue,re.key):J!==null&&(J.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===y&&Hr(be)===J.type)?(J=d(J,re.props),Ks(J,re),J.return=te,J):(J=ea(re.type,re.key,re.props,null,te.mode,ue),Ks(J,re),J.return=te,J)}function se(te,J,re,ue){return J===null||J.tag!==4||J.stateNode.containerInfo!==re.containerInfo||J.stateNode.implementation!==re.implementation?(J=Po(re,te.mode,ue),J.return=te,J):(J=d(J,re.children||[]),J.return=te,J)}function le(te,J,re,ue,be){return J===null||J.tag!==7?(J=Tr(re,te.mode,ue,be),J.return=te,J):(J=d(J,re),J.return=te,J)}function de(te,J,re){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=jo(""+J,te.mode,re),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case m:return re=ea(J.type,J.key,J.props,null,te.mode,re),Ks(re,J),re.return=te,re;case w:return J=Po(J,te.mode,re),J.return=te,J;case y:return J=Hr(J),de(te,J,re)}if(X(J)||M(J))return J=Tr(J,te.mode,re,null),J.return=te,J;if(typeof J.then=="function")return de(te,oa(J),re);if(J.$$typeof===u)return de(te,ra(te,J),re);la(te,J)}return null}function ae(te,J,re,ue){var be=J!==null?J.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return be!==null?null:j(te,J,""+re,ue);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case m:return re.key===be?Z(te,J,re,ue):null;case w:return re.key===be?se(te,J,re,ue):null;case y:return re=Hr(re),ae(te,J,re,ue)}if(X(re)||M(re))return be!==null?null:le(te,J,re,ue,null);if(typeof re.then=="function")return ae(te,J,oa(re),ue);if(re.$$typeof===u)return ae(te,J,ra(te,re),ue);la(te,re)}return null}function oe(te,J,re,ue,be){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return te=te.get(re)||null,j(J,te,""+ue,be);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case m:return te=te.get(ue.key===null?re:ue.key)||null,Z(J,te,ue,be);case w:return te=te.get(ue.key===null?re:ue.key)||null,se(J,te,ue,be);case y:return ue=Hr(ue),oe(te,J,re,ue,be)}if(X(ue)||M(ue))return te=te.get(re)||null,le(J,te,ue,be,null);if(typeof ue.then=="function")return oe(te,J,re,oa(ue),be);if(ue.$$typeof===u)return oe(te,J,re,ra(J,ue),be);la(J,ue)}return null}function pe(te,J,re,ue){for(var be=null,Ue=null,me=J,Me=J=0,ze=null;me!==null&&Me<re.length;Me++){me.index>Me?(ze=me,me=null):ze=me.sibling;var je=ae(te,me,re[Me],ue);if(je===null){me===null&&(me=ze);break}e&&me&&je.alternate===null&&t(te,me),J=v(je,J,Me),Ue===null?be=je:Ue.sibling=je,Ue=je,me=ze}if(Me===re.length)return i(te,me),Ie&&Ni(te,Me),be;if(me===null){for(;Me<re.length;Me++)me=de(te,re[Me],ue),me!==null&&(J=v(me,J,Me),Ue===null?be=me:Ue.sibling=me,Ue=me);return Ie&&Ni(te,Me),be}for(me=r(me);Me<re.length;Me++)ze=oe(me,te,Me,re[Me],ue),ze!==null&&(e&&ze.alternate!==null&&me.delete(ze.key===null?Me:ze.key),J=v(ze,J,Me),Ue===null?be=ze:Ue.sibling=ze,Ue=ze);return e&&me.forEach(function(wr){return t(te,wr)}),Ie&&Ni(te,Me),be}function Ce(te,J,re,ue){if(re==null)throw Error(A(151));for(var be=null,Ue=null,me=J,Me=J=0,ze=null,je=re.next();me!==null&&!je.done;Me++,je=re.next()){me.index>Me?(ze=me,me=null):ze=me.sibling;var wr=ae(te,me,je.value,ue);if(wr===null){me===null&&(me=ze);break}e&&me&&wr.alternate===null&&t(te,me),J=v(wr,J,Me),Ue===null?be=wr:Ue.sibling=wr,Ue=wr,me=ze}if(je.done)return i(te,me),Ie&&Ni(te,Me),be;if(me===null){for(;!je.done;Me++,je=re.next())je=de(te,je.value,ue),je!==null&&(J=v(je,J,Me),Ue===null?be=je:Ue.sibling=je,Ue=je);return Ie&&Ni(te,Me),be}for(me=r(me);!je.done;Me++,je=re.next())je=oe(me,te,Me,je.value,ue),je!==null&&(e&&je.alternate!==null&&me.delete(je.key===null?Me:je.key),J=v(je,J,Me),Ue===null?be=je:Ue.sibling=je,Ue=je);return e&&me.forEach(function(qp){return t(te,qp)}),Ie&&Ni(te,Me),be}function Ve(te,J,re,ue){if(typeof re=="object"&&re!==null&&re.type===_&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case m:e:{for(var be=re.key;J!==null;){if(J.key===be){if(be=re.type,be===_){if(J.tag===7){i(te,J.sibling),ue=d(J,re.props.children),ue.return=te,te=ue;break e}}else if(J.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===y&&Hr(be)===J.type){i(te,J.sibling),ue=d(J,re.props),Ks(ue,re),ue.return=te,te=ue;break e}i(te,J);break}else t(te,J);J=J.sibling}re.type===_?(ue=Tr(re.props.children,te.mode,ue,re.key),ue.return=te,te=ue):(ue=ea(re.type,re.key,re.props,null,te.mode,ue),Ks(ue,re),ue.return=te,te=ue)}return T(te);case w:e:{for(be=re.key;J!==null;){if(J.key===be)if(J.tag===4&&J.stateNode.containerInfo===re.containerInfo&&J.stateNode.implementation===re.implementation){i(te,J.sibling),ue=d(J,re.children||[]),ue.return=te,te=ue;break e}else{i(te,J);break}else t(te,J);J=J.sibling}ue=Po(re,te.mode,ue),ue.return=te,te=ue}return T(te);case y:return re=Hr(re),Ve(te,J,re,ue)}if(X(re))return pe(te,J,re,ue);if(M(re)){if(be=M(re),typeof be!="function")throw Error(A(150));return re=be.call(re),Ce(te,J,re,ue)}if(typeof re.then=="function")return Ve(te,J,oa(re),ue);if(re.$$typeof===u)return Ve(te,J,ra(te,re),ue);la(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,J!==null&&J.tag===6?(i(te,J.sibling),ue=d(J,re),ue.return=te,te=ue):(i(te,J),ue=jo(re,te.mode,ue),ue.return=te,te=ue),T(te)):i(te,J)}return function(te,J,re,ue){try{Xs=0;var be=Ve(te,J,re,ue);return us=null,be}catch(me){if(me===cs||me===na)throw me;var Ue=Qt(29,me,null,te.mode);return Ue.lanes=ue,Ue.return=te,Ue}finally{}}}var Ir=ah(!0),oh=ah(!1),ar=!1;function Jo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function el(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 or(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function lr(e,t,i){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Fe&2)!==0){var d=r.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),r.pending=t,t=Jn(e),Wu(e,null,i),t}return Qn(e,r,t,i),Jn(e)}function Zs(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Kt(e,i)}}function tl(e,t){var i=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,i===r)){var d=null,v=null;if(i=i.firstBaseUpdate,i!==null){do{var T={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};v===null?d=v=T:v=v.next=T,i=i.next}while(i!==null);v===null?d=v=t:v=v.next=t}else d=v=t;i={baseState:r.baseState,firstBaseUpdate:d,lastBaseUpdate:v,shared:r.shared,callbacks:r.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var il=!1;function Qs(){if(il){var e=ls;if(e!==null)throw e}}function Js(e,t,i,r){il=!1;var d=e.updateQueue;ar=!1;var v=d.firstBaseUpdate,T=d.lastBaseUpdate,j=d.shared.pending;if(j!==null){d.shared.pending=null;var Z=j,se=Z.next;Z.next=null,T===null?v=se:T.next=se,T=Z;var le=e.alternate;le!==null&&(le=le.updateQueue,j=le.lastBaseUpdate,j!==T&&(j===null?le.firstBaseUpdate=se:j.next=se,le.lastBaseUpdate=Z))}if(v!==null){var de=d.baseState;T=0,le=se=Z=null,j=v;do{var ae=j.lane&-536870913,oe=ae!==j.lane;if(oe?(He&ae)===ae:(r&ae)===ae){ae!==0&&ae===os&&(il=!0),le!==null&&(le=le.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var pe=e,Ce=j;ae=t;var Ve=i;switch(Ce.tag){case 1:if(pe=Ce.payload,typeof pe=="function"){de=pe.call(Ve,de,ae);break e}de=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Ce.payload,ae=typeof pe=="function"?pe.call(Ve,de,ae):pe,ae==null)break e;de=a({},de,ae);break e;case 2:ar=!0}}ae=j.callback,ae!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=d.callbacks,oe===null?d.callbacks=[ae]:oe.push(ae))}else oe={lane:ae,tag:j.tag,payload:j.payload,callback:j.callback,next:null},le===null?(se=le=oe,Z=de):le=le.next=oe,T|=ae;if(j=j.next,j===null){if(j=d.shared.pending,j===null)break;oe=j,j=oe.next,oe.next=null,d.lastBaseUpdate=oe,d.shared.pending=null}}while(!0);le===null&&(Z=de),d.baseState=Z,d.firstBaseUpdate=se,d.lastBaseUpdate=le,v===null&&(d.shared.lanes=0),fr|=T,e.lanes=T,e.memoizedState=de}}function lh(e,t){if(typeof e!="function")throw Error(A(191,e));e.call(t)}function ch(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)lh(i[e],t)}var hs=O(null),ca=O(0);function uh(e,t){e=Xi,Q(ca,e),Q(hs,t),Xi=e|t.baseLanes}function rl(){Q(ca,Xi),Q(hs,hs.current)}function sl(){Xi=ca.current,U(hs),U(ca)}var Jt=O(null),_i=null;function cr(e){var t=e.alternate;Q(ot,ot.current&1),Q(Jt,e),_i===null&&(t===null||hs.current!==null||t.memoizedState!==null)&&(_i=e)}function nl(e){Q(ot,ot.current),Q(Jt,e),_i===null&&(_i=e)}function hh(e){e.tag===22?(Q(ot,ot.current),Q(Jt,e),_i===null&&(_i=e)):ur()}function ur(){Q(ot,ot.current),Q(Jt,Jt.current)}function ei(e){U(Jt),_i===e&&(_i=null),U(ot)}var ot=O(0);function ua(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||hc(i)||dc(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Pi=0,Le=null,Ge=null,dt=null,ha=!1,ds=!1,Nr=!1,da=0,en=0,fs=null,Ov=0;function st(){throw Error(A(321))}function al(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Zt(e[i],t[i]))return!1;return!0}function ol(e,t,i,r,d,v){return Pi=v,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?Vh:Cl,Nr=!1,v=i(r,d),Nr=!1,ds&&(v=fh(t,i,r,d)),dh(e),v}function dh(e){W.H=sn;var t=Ge!==null&&Ge.next!==null;if(Pi=0,dt=Ge=Le=null,ha=!1,en=0,fs=null,t)throw Error(A(300));e===null||ft||(e=e.dependencies,e!==null&&ia(e)&&(ft=!0))}function fh(e,t,i,r){Le=e;var d=0;do{if(ds&&(fs=null),en=0,ds=!1,25<=d)throw Error(A(301));if(d+=1,dt=Ge=null,e.updateQueue!=null){var v=e.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}W.H=Xh,v=t(i,r)}while(ds);return v}function Bv(){var e=W.H,t=e.useState()[0];return t=typeof t.then=="function"?tn(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(Le.flags|=1024),t}function ll(){var e=da!==0;return da=0,e}function cl(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function ul(e){if(ha){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ha=!1}Pi=0,dt=Ge=Le=null,ds=!1,en=da=0,fs=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Le.memoizedState=dt=e:dt=dt.next=e,dt}function lt(){if(Ge===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=dt===null?Le.memoizedState:dt.next;if(t!==null)dt=t,Ge=e;else{if(e===null)throw Le.alternate===null?Error(A(467)):Error(A(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},dt===null?Le.memoizedState=dt=e:dt=dt.next=e}return dt}function fa(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tn(e){var t=en;return en+=1,fs===null&&(fs=[]),e=rh(fs,e,t),t=Le,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?Vh:Cl),e}function _a(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return tn(e);if(e.$$typeof===u)return Dt(e)}throw Error(A(438,String(e)))}function hl(e){var t=null,i=Le.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var r=Le.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=fa(),Le.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),r=0;r<e;r++)i[r]=L;return t.index++,i}function Fi(e,t){return typeof t=="function"?t(e):t}function ga(e){var t=lt();return dl(t,Ge,e)}function dl(e,t,i){var r=e.queue;if(r===null)throw Error(A(311));r.lastRenderedReducer=i;var d=e.baseQueue,v=r.pending;if(v!==null){if(d!==null){var T=d.next;d.next=v.next,v.next=T}t.baseQueue=d=v,r.pending=null}if(v=e.baseState,d===null)e.memoizedState=v;else{t=d.next;var j=T=null,Z=null,se=t,le=!1;do{var de=se.lane&-536870913;if(de!==se.lane?(He&de)===de:(Pi&de)===de){var ae=se.revertLane;if(ae===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),de===os&&(le=!0);else if((Pi&ae)===ae){se=se.next,ae===os&&(le=!0);continue}else de={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Z===null?(j=Z=de,T=v):Z=Z.next=de,Le.lanes|=ae,fr|=ae;de=se.action,Nr&&i(v,de),v=se.hasEagerState?se.eagerState:i(v,de)}else ae={lane:de,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Z===null?(j=Z=ae,T=v):Z=Z.next=ae,Le.lanes|=de,fr|=de;se=se.next}while(se!==null&&se!==t);if(Z===null?T=v:Z.next=j,!Zt(v,e.memoizedState)&&(ft=!0,le&&(i=ls,i!==null)))throw i;e.memoizedState=v,e.baseState=T,e.baseQueue=Z,r.lastRenderedState=v}return d===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function fl(e){var t=lt(),i=t.queue;if(i===null)throw Error(A(311));i.lastRenderedReducer=e;var r=i.dispatch,d=i.pending,v=t.memoizedState;if(d!==null){i.pending=null;var T=d=d.next;do v=e(v,T.action),T=T.next;while(T!==d);Zt(v,t.memoizedState)||(ft=!0),t.memoizedState=v,t.baseQueue===null&&(t.baseState=v),i.lastRenderedState=v}return[v,r]}function _h(e,t,i){var r=Le,d=lt(),v=Ie;if(v){if(i===void 0)throw Error(A(407));i=i()}else i=t();var T=!Zt((Ge||d).memoizedState,i);if(T&&(d.memoizedState=i,ft=!0),d=d.queue,vl(ph.bind(null,r,d,e),[e]),d.getSnapshot!==t||T||dt!==null&&dt.memoizedState.tag&1){if(r.flags|=2048,_s(9,{destroy:void 0},vh.bind(null,r,d,i,t),null),Xe===null)throw Error(A(349));v||(Pi&127)!==0||gh(r,t,i)}return i}function gh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Le.updateQueue,t===null?(t=fa(),Le.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function vh(e,t,i,r){t.value=i,t.getSnapshot=r,mh(t)&&Sh(e)}function ph(e,t,i){return i(function(){mh(t)&&Sh(e)})}function mh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Zt(e,i)}catch{return!0}}function Sh(e){var t=Lr(e,2);t!==null&&Yt(t,e,2)}function _l(e){var t=Ht();if(typeof e=="function"){var i=e;if(e=i(),Nr){Et(!0);try{i()}finally{Et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:e},t}function bh(e,t,i,r){return e.baseState=i,dl(e,Ge,typeof r=="function"?r:Fi)}function Hv(e,t,i,r,d){if(ma(e))throw Error(A(485));if(e=t.action,e!==null){var v={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){v.listeners.push(T)}};W.T!==null?i(!0):v.isTransition=!1,r(v),i=t.pending,i===null?(v.next=t.pending=v,yh(t,v)):(v.next=i.next,t.pending=i.next=v)}}function yh(e,t){var i=t.action,r=t.payload,d=e.state;if(t.isTransition){var v=W.T,T={};W.T=T;try{var j=i(d,r),Z=W.S;Z!==null&&Z(T,j),Ch(e,t,j)}catch(se){gl(e,t,se)}finally{v!==null&&T.types!==null&&(v.types=T.types),W.T=v}}else try{v=i(d,r),Ch(e,t,v)}catch(se){gl(e,t,se)}}function Ch(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(r){wh(e,t,r)},function(r){return gl(e,t,r)}):wh(e,t,i)}function wh(e,t,i){t.status="fulfilled",t.value=i,xh(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,yh(e,i)))}function gl(e,t,i){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=i,xh(t),t=t.next;while(t!==r)}e.action=null}function xh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Eh(e,t){return t}function Rh(e,t){if(Ie){var i=Xe.formState;if(i!==null){e:{var r=Le;if(Ie){if(Je){t:{for(var d=Je,v=fi;d.nodeType!==8;){if(!v){d=null;break t}if(d=gi(d.nextSibling),d===null){d=null;break t}}v=d.data,d=v==="F!"||v==="F"?d:null}if(d){Je=gi(d.nextSibling),r=d.data==="F!";break e}}sr(r)}r=!1}r&&(t=i[0])}}return i=Ht(),i.memoizedState=i.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eh,lastRenderedState:t},i.queue=r,i=$h.bind(null,Le,r),r.dispatch=i,r=_l(!1),v=yl.bind(null,Le,!1,r.queue),r=Ht(),d={state:t,dispatch:null,action:e,pending:null},r.queue=d,i=Hv.bind(null,Le,d,v,i),d.dispatch=i,r.memoizedState=e,[t,i,!1]}function Ah(e){var t=lt();return Dh(t,Ge,e)}function Dh(e,t,i){if(t=dl(e,t,Eh)[0],e=ga(Fi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=tn(t)}catch(T){throw T===cs?na:T}else r=t;t=lt();var d=t.queue,v=d.dispatch;return i!==t.memoizedState&&(Le.flags|=2048,_s(9,{destroy:void 0},zv.bind(null,d,i),null)),[r,v,e]}function zv(e,t){e.action=t}function Lh(e){var t=lt(),i=Ge;if(i!==null)return Dh(t,i,e);lt(),t=t.memoizedState,i=lt();var r=i.queue.dispatch;return i.memoizedState=e,[t,r,!1]}function _s(e,t,i,r){return e={tag:e,create:i,deps:r,inst:t,next:null},t=Le.updateQueue,t===null&&(t=fa(),Le.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(r=i.next,i.next=e,e.next=r,t.lastEffect=e),e}function Th(){return lt().memoizedState}function va(e,t,i,r){var d=Ht();Le.flags|=e,d.memoizedState=_s(1|t,{destroy:void 0},i,r===void 0?null:r)}function pa(e,t,i,r){var d=lt();r=r===void 0?null:r;var v=d.memoizedState.inst;Ge!==null&&r!==null&&al(r,Ge.memoizedState.deps)?d.memoizedState=_s(t,v,i,r):(Le.flags|=e,d.memoizedState=_s(1|t,v,i,r))}function Mh(e,t){va(8390656,8,e,t)}function vl(e,t){pa(2048,8,e,t)}function Iv(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=fa(),Le.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function kh(e){var t=lt().memoizedState;return Iv({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(A(440));return t.impl.apply(void 0,arguments)}}function Oh(e,t){return pa(4,2,e,t)}function Bh(e,t){return pa(4,4,e,t)}function Hh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zh(e,t,i){i=i!=null?i.concat([e]):null,pa(4,4,Hh.bind(null,t,e),i)}function pl(){}function Ih(e,t){var i=lt();t=t===void 0?null:t;var r=i.memoizedState;return t!==null&&al(t,r[1])?r[0]:(i.memoizedState=[e,t],e)}function Nh(e,t){var i=lt();t=t===void 0?null:t;var r=i.memoizedState;if(t!==null&&al(t,r[1]))return r[0];if(r=e(),Nr){Et(!0);try{e()}finally{Et(!1)}}return i.memoizedState=[r,t],r}function ml(e,t,i){return i===void 0||(Pi&1073741824)!==0&&(He&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Ud(),Le.lanes|=e,fr|=e,i)}function Uh(e,t,i,r){return Zt(i,t)?i:hs.current!==null?(e=ml(e,i,r),Zt(e,t)||(ft=!0),e):(Pi&42)===0||(Pi&1073741824)!==0&&(He&261930)===0?(ft=!0,e.memoizedState=i):(e=Ud(),Le.lanes|=e,fr|=e,t)}function jh(e,t,i,r,d){var v=$.p;$.p=v!==0&&8>v?v:8;var T=W.T,j={};W.T=j,yl(e,!1,t,i);try{var Z=d(),se=W.S;if(se!==null&&se(j,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var le=kv(Z,r);rn(e,t,le,ri(e))}else rn(e,t,r,ri(e))}catch(de){rn(e,t,{then:function(){},status:"rejected",reason:de},ri())}finally{$.p=v,T!==null&&j.types!==null&&(T.types=j.types),W.T=T}}function Nv(){}function Sl(e,t,i,r){if(e.tag!==5)throw Error(A(476));var d=Ph(e).queue;jh(e,d,t,Y,i===null?Nv:function(){return Fh(e),i(r)})}function Ph(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:Y},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Fh(e){var t=Ph(e);t.next===null&&(t=e.alternate.memoizedState),rn(e,t.next.queue,{},ri())}function bl(){return Dt(bn)}function qh(){return lt().memoizedState}function Wh(){return lt().memoizedState}function Uv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=ri();e=or(i);var r=lr(t,e,i);r!==null&&(Yt(r,t,i),Zs(r,t,i)),t={cache:Xo()},e.payload=t;return}t=t.return}}function jv(e,t,i){var r=ri();i={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ma(e)?Gh(t,i):(i=No(e,t,i,r),i!==null&&(Yt(i,e,r),Yh(i,t,r)))}function $h(e,t,i){var r=ri();rn(e,t,i,r)}function rn(e,t,i,r){var d={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(ma(e))Gh(t,d);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=t.lastRenderedReducer,v!==null))try{var T=t.lastRenderedState,j=v(T,i);if(d.hasEagerState=!0,d.eagerState=j,Zt(j,T))return Qn(e,t,d,0),Xe===null&&Zn(),!1}catch{}finally{}if(i=No(e,t,d,r),i!==null)return Yt(i,e,r),Yh(i,t,r),!0}return!1}function yl(e,t,i,r){if(r={lane:2,revertLane:Jl(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ma(e)){if(t)throw Error(A(479))}else t=No(e,i,r,2),t!==null&&Yt(t,e,2)}function ma(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Gh(e,t){ds=ha=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Yh(e,t,i){if((i&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Kt(e,i)}}var sn={readContext:Dt,use:_a,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};sn.useEffectEvent=st;var Vh={readContext:Dt,use:_a,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Mh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,va(4194308,4,Hh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return va(4194308,4,e,t)},useInsertionEffect:function(e,t){va(4,2,e,t)},useMemo:function(e,t){var i=Ht();t=t===void 0?null:t;var r=e();if(Nr){Et(!0);try{e()}finally{Et(!1)}}return i.memoizedState=[r,t],r},useReducer:function(e,t,i){var r=Ht();if(i!==void 0){var d=i(t);if(Nr){Et(!0);try{i(t)}finally{Et(!1)}}}else d=t;return r.memoizedState=r.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},r.queue=e,e=e.dispatch=jv.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=_l(e);var t=e.queue,i=$h.bind(null,Le,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:pl,useDeferredValue:function(e,t){var i=Ht();return ml(i,e,t)},useTransition:function(){var e=_l(!1);return e=jh.bind(null,Le,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var r=Le,d=Ht();if(Ie){if(i===void 0)throw Error(A(407));i=i()}else{if(i=t(),Xe===null)throw Error(A(349));(He&127)!==0||gh(r,t,i)}d.memoizedState=i;var v={value:i,getSnapshot:t};return d.queue=v,Mh(ph.bind(null,r,v,e),[e]),r.flags|=2048,_s(9,{destroy:void 0},vh.bind(null,r,v,i,t),null),i},useId:function(){var e=Ht(),t=Xe.identifierPrefix;if(Ie){var i=Ai,r=Ri;i=(r&~(1<<32-vt(r)-1)).toString(32)+i,t="_"+t+"R_"+i,i=da++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Ov++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:bl,useFormState:Rh,useActionState:Rh,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=yl.bind(null,Le,!0,i),i.dispatch=t,[e,t]},useMemoCache:hl,useCacheRefresh:function(){return Ht().memoizedState=Uv.bind(null,Le)},useEffectEvent:function(e){var t=Ht(),i={impl:e};return t.memoizedState=i,function(){if((Fe&2)!==0)throw Error(A(440));return i.impl.apply(void 0,arguments)}}},Cl={readContext:Dt,use:_a,useCallback:Ih,useContext:Dt,useEffect:vl,useImperativeHandle:zh,useInsertionEffect:Oh,useLayoutEffect:Bh,useMemo:Nh,useReducer:ga,useRef:Th,useState:function(){return ga(Fi)},useDebugValue:pl,useDeferredValue:function(e,t){var i=lt();return Uh(i,Ge.memoizedState,e,t)},useTransition:function(){var e=ga(Fi)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:tn(e),t]},useSyncExternalStore:_h,useId:qh,useHostTransitionStatus:bl,useFormState:Ah,useActionState:Ah,useOptimistic:function(e,t){var i=lt();return bh(i,Ge,e,t)},useMemoCache:hl,useCacheRefresh:Wh};Cl.useEffectEvent=kh;var Xh={readContext:Dt,use:_a,useCallback:Ih,useContext:Dt,useEffect:vl,useImperativeHandle:zh,useInsertionEffect:Oh,useLayoutEffect:Bh,useMemo:Nh,useReducer:fl,useRef:Th,useState:function(){return fl(Fi)},useDebugValue:pl,useDeferredValue:function(e,t){var i=lt();return Ge===null?ml(i,e,t):Uh(i,Ge.memoizedState,e,t)},useTransition:function(){var e=fl(Fi)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:tn(e),t]},useSyncExternalStore:_h,useId:qh,useHostTransitionStatus:bl,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,t){var i=lt();return Ge!==null?bh(i,Ge,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:hl,useCacheRefresh:Wh};Xh.useEffectEvent=kh;function wl(e,t,i,r){t=e.memoizedState,i=i(r,t),i=i==null?t:a({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var xl={enqueueSetState:function(e,t,i){e=e._reactInternals;var r=ri(),d=or(r);d.payload=t,i!=null&&(d.callback=i),t=lr(e,d,r),t!==null&&(Yt(t,e,r),Zs(t,e,r))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var r=ri(),d=or(r);d.tag=1,d.payload=t,i!=null&&(d.callback=i),t=lr(e,d,r),t!==null&&(Yt(t,e,r),Zs(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=ri(),r=or(i);r.tag=2,t!=null&&(r.callback=t),t=lr(e,r,i),t!==null&&(Yt(t,e,i),Zs(t,e,i))}};function Kh(e,t,i,r,d,v,T){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,v,T):t.prototype&&t.prototype.isPureReactComponent?!qs(i,r)||!qs(d,v):!0}function Zh(e,t,i,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,r),t.state!==e&&xl.enqueueReplaceState(t,t.state,null)}function Ur(e,t){var i=t;if("ref"in t){i={};for(var r in t)r!=="ref"&&(i[r]=t[r])}if(e=e.defaultProps){i===t&&(i=a({},i));for(var d in e)i[d]===void 0&&(i[d]=e[d])}return i}function Qh(e){Kn(e)}function Jh(e){console.error(e)}function ed(e){Kn(e)}function Sa(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function td(e,t,i){try{var r=e.onCaughtError;r(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function El(e,t,i){return i=or(i),i.tag=3,i.payload={element:null},i.callback=function(){Sa(e,t)},i}function id(e){return e=or(e),e.tag=3,e}function rd(e,t,i,r){var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var v=r.value;e.payload=function(){return d(v)},e.callback=function(){td(t,i,r)}}var T=i.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(e.callback=function(){td(t,i,r),typeof d!="function"&&(_r===null?_r=new Set([this]):_r.add(this));var j=r.stack;this.componentDidCatch(r.value,{componentStack:j!==null?j:""})})}function Pv(e,t,i,r,d){if(i.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=i.alternate,t!==null&&as(t,i,d,!0),i=Jt.current,i!==null){switch(i.tag){case 31:case 13:return _i===null?Ma():i.alternate===null&&nt===0&&(nt=3),i.flags&=-257,i.flags|=65536,i.lanes=d,r===aa?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([r]):t.add(r),Kl(e,r,d)),!1;case 22:return i.flags|=65536,r===aa?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([r]):i.add(r)),Kl(e,r,d)),!1}throw Error(A(435,i.tag))}return Kl(e,r,d),Ma(),!1}if(Ie)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,r!==Wo&&(e=Error(A(422),{cause:r}),Gs(ui(e,i)))):(r!==Wo&&(t=Error(A(423),{cause:r}),Gs(ui(t,i))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,r=ui(r,i),d=El(e.stateNode,r,d),tl(e,d),nt!==4&&(nt=2)),!1;var v=Error(A(520),{cause:r});if(v=ui(v,i),dn===null?dn=[v]:dn.push(v),nt!==4&&(nt=2),t===null)return!0;r=ui(r,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=d&-d,i.lanes|=e,e=El(i.stateNode,r,e),tl(i,e),!1;case 1:if(t=i.type,v=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(_r===null||!_r.has(v))))return i.flags|=65536,d&=-d,i.lanes|=d,d=id(d),rd(d,e,i,r),tl(i,d),!1}i=i.return}while(i!==null);return!1}var Rl=Error(A(461)),ft=!1;function Lt(e,t,i,r){t.child=e===null?oh(t,null,i,r):Ir(t,e.child,i,r)}function sd(e,t,i,r,d){i=i.render;var v=t.ref;if("ref"in r){var T={};for(var j in r)j!=="ref"&&(T[j]=r[j])}else T=r;return Or(t),r=ol(e,t,i,T,v,d),j=ll(),e!==null&&!ft?(cl(e,t,d),qi(e,t,d)):(Ie&&j&&Fo(t),t.flags|=1,Lt(e,t,r,d),t.child)}function nd(e,t,i,r,d){if(e===null){var v=i.type;return typeof v=="function"&&!Uo(v)&&v.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=v,ad(e,t,v,r,d)):(e=ea(i.type,null,r,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(v=e.child,!Bl(e,d)){var T=v.memoizedProps;if(i=i.compare,i=i!==null?i:qs,i(T,r)&&e.ref===t.ref)return qi(e,t,d)}return t.flags|=1,e=Ii(v,r),e.ref=t.ref,e.return=t,t.child=e}function ad(e,t,i,r,d){if(e!==null){var v=e.memoizedProps;if(qs(v,r)&&e.ref===t.ref)if(ft=!1,t.pendingProps=r=v,Bl(e,d))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,qi(e,t,d)}return Al(e,t,i,r,d)}function od(e,t,i,r){var d=r.children,v=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(v=v!==null?v.baseLanes|i:i,e!==null){for(r=t.child=e.child,d=0;r!==null;)d=d|r.lanes|r.childLanes,r=r.sibling;r=d&~v}else r=0,t.child=null;return ld(e,t,v,i,r)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&sa(t,v!==null?v.cachePool:null),v!==null?uh(t,v):rl(),hh(t);else return r=t.lanes=536870912,ld(e,t,v!==null?v.baseLanes|i:i,i,r)}else v!==null?(sa(t,v.cachePool),uh(t,v),ur(),t.memoizedState=null):(e!==null&&sa(t,null),rl(),ur());return Lt(e,t,d,i),t.child}function nn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ld(e,t,i,r,d){var v=Zo();return v=v===null?null:{parent:ht._currentValue,pool:v},t.memoizedState={baseLanes:i,cachePool:v},e!==null&&sa(t,null),rl(),hh(t),e!==null&&as(e,t,r,!0),t.childLanes=d,null}function ba(e,t){return t=Ca({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cd(e,t,i){return Ir(t,e.child,null,i),e=ba(t,t.pendingProps),e.flags|=2,ei(t),t.memoizedState=null,e}function Fv(e,t,i){var r=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(r.mode==="hidden")return e=ba(t,r),t.lanes=536870912,nn(null,e);if(nl(t),(e=Je)?(e=Cf(e,fi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ir!==null?{id:Ri,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},i=Gu(e),i.return=t,t.child=i,At=t,Je=null)):e=null,e===null)throw sr(t);return t.lanes=536870912,null}return ba(t,r)}var v=e.memoizedState;if(v!==null){var T=v.dehydrated;if(nl(t),d)if(t.flags&256)t.flags&=-257,t=cd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(A(558));else if(ft||as(e,t,i,!1),d=(i&e.childLanes)!==0,ft||d){if(r=Xe,r!==null&&(T=ni(r,i),T!==0&&T!==v.retryLane))throw v.retryLane=T,Lr(e,T),Yt(r,e,T),Rl;Ma(),t=cd(e,t,i)}else e=v.treeContext,Je=gi(T.nextSibling),At=t,Ie=!0,rr=null,fi=!1,e!==null&&Xu(t,e),t=ba(t,r),t.flags|=4096;return t}return e=Ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ya(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(A(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Al(e,t,i,r,d){return Or(t),i=ol(e,t,i,r,void 0,d),r=ll(),e!==null&&!ft?(cl(e,t,d),qi(e,t,d)):(Ie&&r&&Fo(t),t.flags|=1,Lt(e,t,i,d),t.child)}function ud(e,t,i,r,d,v){return Or(t),t.updateQueue=null,i=fh(t,r,i,d),dh(e),r=ll(),e!==null&&!ft?(cl(e,t,v),qi(e,t,v)):(Ie&&r&&Fo(t),t.flags|=1,Lt(e,t,i,v),t.child)}function hd(e,t,i,r,d){if(Or(t),t.stateNode===null){var v=is,T=i.contextType;typeof T=="object"&&T!==null&&(v=Dt(T)),v=new i(r,v),t.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=xl,t.stateNode=v,v._reactInternals=t,v=t.stateNode,v.props=r,v.state=t.memoizedState,v.refs={},Jo(t),T=i.contextType,v.context=typeof T=="object"&&T!==null?Dt(T):is,v.state=t.memoizedState,T=i.getDerivedStateFromProps,typeof T=="function"&&(wl(t,i,T,r),v.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(T=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),T!==v.state&&xl.enqueueReplaceState(v,v.state,null),Js(t,r,v,d),Qs(),v.state=t.memoizedState),typeof v.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){v=t.stateNode;var j=t.memoizedProps,Z=Ur(i,j);v.props=Z;var se=v.context,le=i.contextType;T=is,typeof le=="object"&&le!==null&&(T=Dt(le));var de=i.getDerivedStateFromProps;le=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,le||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(j||se!==T)&&Zh(t,v,r,T),ar=!1;var ae=t.memoizedState;v.state=ae,Js(t,r,v,d),Qs(),se=t.memoizedState,j||ae!==se||ar?(typeof de=="function"&&(wl(t,i,de,r),se=t.memoizedState),(Z=ar||Kh(t,i,Z,r,ae,se,T))?(le||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=se),v.props=r,v.state=se,v.context=T,r=Z):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{v=t.stateNode,el(e,t),T=t.memoizedProps,le=Ur(i,T),v.props=le,de=t.pendingProps,ae=v.context,se=i.contextType,Z=is,typeof se=="object"&&se!==null&&(Z=Dt(se)),j=i.getDerivedStateFromProps,(se=typeof j=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T!==de||ae!==Z)&&Zh(t,v,r,Z),ar=!1,ae=t.memoizedState,v.state=ae,Js(t,r,v,d),Qs();var oe=t.memoizedState;T!==de||ae!==oe||ar||e!==null&&e.dependencies!==null&&ia(e.dependencies)?(typeof j=="function"&&(wl(t,i,j,r),oe=t.memoizedState),(le=ar||Kh(t,i,le,r,ae,oe,Z)||e!==null&&e.dependencies!==null&&ia(e.dependencies))?(se||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(r,oe,Z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(r,oe,Z)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||T===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=oe),v.props=r,v.state=oe,v.context=Z,r=le):(typeof v.componentDidUpdate!="function"||T===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),r=!1)}return v=r,ya(e,t),r=(t.flags&128)!==0,v||r?(v=t.stateNode,i=r&&typeof i.getDerivedStateFromError!="function"?null:v.render(),t.flags|=1,e!==null&&r?(t.child=Ir(t,e.child,null,d),t.child=Ir(t,null,i,d)):Lt(e,t,i,d),t.memoizedState=v.state,e=t.child):e=qi(e,t,d),e}function dd(e,t,i,r){return Mr(),t.flags|=256,Lt(e,t,i,r),t.child}var Dl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ll(e){return{baseLanes:e,cachePool:th()}}function Tl(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=ii),e}function fd(e,t,i){var r=t.pendingProps,d=!1,v=(t.flags&128)!==0,T;if((T=v)||(T=e!==null&&e.memoizedState===null?!1:(ot.current&2)!==0),T&&(d=!0,t.flags&=-129),T=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(d?cr(t):ur(),(e=Je)?(e=Cf(e,fi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ir!==null?{id:Ri,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},i=Gu(e),i.return=t,t.child=i,At=t,Je=null)):e=null,e===null)throw sr(t);return dc(e)?t.lanes=32:t.lanes=536870912,null}var j=r.children;return r=r.fallback,d?(ur(),d=t.mode,j=Ca({mode:"hidden",children:j},d),r=Tr(r,d,i,null),j.return=t,r.return=t,j.sibling=r,t.child=j,r=t.child,r.memoizedState=Ll(i),r.childLanes=Tl(e,T,i),t.memoizedState=Dl,nn(null,r)):(cr(t),Ml(t,j))}var Z=e.memoizedState;if(Z!==null&&(j=Z.dehydrated,j!==null)){if(v)t.flags&256?(cr(t),t.flags&=-257,t=kl(e,t,i)):t.memoizedState!==null?(ur(),t.child=e.child,t.flags|=128,t=null):(ur(),j=r.fallback,d=t.mode,r=Ca({mode:"visible",children:r.children},d),j=Tr(j,d,i,null),j.flags|=2,r.return=t,j.return=t,r.sibling=j,t.child=r,Ir(t,e.child,null,i),r=t.child,r.memoizedState=Ll(i),r.childLanes=Tl(e,T,i),t.memoizedState=Dl,t=nn(null,r));else if(cr(t),dc(j)){if(T=j.nextSibling&&j.nextSibling.dataset,T)var se=T.dgst;T=se,r=Error(A(419)),r.stack="",r.digest=T,Gs({value:r,source:null,stack:null}),t=kl(e,t,i)}else if(ft||as(e,t,i,!1),T=(i&e.childLanes)!==0,ft||T){if(T=Xe,T!==null&&(r=ni(T,i),r!==0&&r!==Z.retryLane))throw Z.retryLane=r,Lr(e,r),Yt(T,e,r),Rl;hc(j)||Ma(),t=kl(e,t,i)}else hc(j)?(t.flags|=192,t.child=e.child,t=null):(e=Z.treeContext,Je=gi(j.nextSibling),At=t,Ie=!0,rr=null,fi=!1,e!==null&&Xu(t,e),t=Ml(t,r.children),t.flags|=4096);return t}return d?(ur(),j=r.fallback,d=t.mode,Z=e.child,se=Z.sibling,r=Ii(Z,{mode:"hidden",children:r.children}),r.subtreeFlags=Z.subtreeFlags&65011712,se!==null?j=Ii(se,j):(j=Tr(j,d,i,null),j.flags|=2),j.return=t,r.return=t,r.sibling=j,t.child=r,nn(null,r),r=t.child,j=e.child.memoizedState,j===null?j=Ll(i):(d=j.cachePool,d!==null?(Z=ht._currentValue,d=d.parent!==Z?{parent:Z,pool:Z}:d):d=th(),j={baseLanes:j.baseLanes|i,cachePool:d}),r.memoizedState=j,r.childLanes=Tl(e,T,i),t.memoizedState=Dl,nn(e.child,r)):(cr(t),i=e.child,e=i.sibling,i=Ii(i,{mode:"visible",children:r.children}),i.return=t,i.sibling=null,e!==null&&(T=t.deletions,T===null?(t.deletions=[e],t.flags|=16):T.push(e)),t.child=i,t.memoizedState=null,i)}function Ml(e,t){return t=Ca({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ca(e,t){return e=Qt(22,e,null,t),e.lanes=0,e}function kl(e,t,i){return Ir(t,e.child,null,i),e=Ml(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _d(e,t,i){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Yo(e.return,t,i)}function Ol(e,t,i,r,d,v){var T=e.memoizedState;T===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:i,tailMode:d,treeForkCount:v}:(T.isBackwards=t,T.rendering=null,T.renderingStartTime=0,T.last=r,T.tail=i,T.tailMode=d,T.treeForkCount=v)}function gd(e,t,i){var r=t.pendingProps,d=r.revealOrder,v=r.tail;r=r.children;var T=ot.current,j=(T&2)!==0;if(j?(T=T&1|2,t.flags|=128):T&=1,Q(ot,T),Lt(e,t,r,i),r=Ie?$s:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_d(e,i,t);else if(e.tag===19)_d(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(i=t.child,d=null;i!==null;)e=i.alternate,e!==null&&ua(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),Ol(t,!1,d,i,v,r);break;case"backwards":case"unstable_legacy-backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&ua(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}Ol(t,!0,i,null,v,r);break;case"together":Ol(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function qi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),fr|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(as(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(A(153));if(t.child!==null){for(e=t.child,i=Ii(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ii(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Bl(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ia(e)))}function qv(e,t,i){switch(t.tag){case 3:P(t,t.stateNode.containerInfo),nr(t,ht,e.memoizedState.cache),Mr();break;case 27:case 5:ie(t);break;case 4:P(t,t.stateNode.containerInfo);break;case 10:nr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,nl(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(cr(t),t.flags|=128,null):(i&t.child.childLanes)!==0?fd(e,t,i):(cr(t),e=qi(e,t,i),e!==null?e.sibling:null);cr(t);break;case 19:var d=(e.flags&128)!==0;if(r=(i&t.childLanes)!==0,r||(as(e,t,i,!1),r=(i&t.childLanes)!==0),d){if(r)return gd(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Q(ot,ot.current),r)break;return null;case 22:return t.lanes=0,od(e,t,i,t.pendingProps);case 24:nr(t,ht,e.memoizedState.cache)}return qi(e,t,i)}function vd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!Bl(e,i)&&(t.flags&128)===0)return ft=!1,qv(e,t,i);ft=(e.flags&131072)!==0}else ft=!1,Ie&&(t.flags&1048576)!==0&&Vu(t,$s,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Hr(t.elementType),t.type=e,typeof e=="function")Uo(e)?(r=Ur(e,r),t.tag=1,t=hd(null,t,e,r,i)):(t.tag=0,t=Al(null,t,e,r,i));else{if(e!=null){var d=e.$$typeof;if(d===S){t.tag=11,t=sd(null,t,e,r,i);break e}else if(d===x){t.tag=14,t=nd(null,t,e,r,i);break e}}throw t=G(e)||e,Error(A(306,t,""))}}return t;case 0:return Al(e,t,t.type,t.pendingProps,i);case 1:return r=t.type,d=Ur(r,t.pendingProps),hd(e,t,r,d,i);case 3:e:{if(P(t,t.stateNode.containerInfo),e===null)throw Error(A(387));r=t.pendingProps;var v=t.memoizedState;d=v.element,el(e,t),Js(t,r,null,i);var T=t.memoizedState;if(r=T.cache,nr(t,ht,r),r!==v.cache&&Vo(t,[ht],i,!0),Qs(),r=T.element,v.isDehydrated)if(v={element:r,isDehydrated:!1,cache:T.cache},t.updateQueue.baseState=v,t.memoizedState=v,t.flags&256){t=dd(e,t,r,i);break e}else if(r!==d){d=ui(Error(A(424)),t),Gs(d),t=dd(e,t,r,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Je=gi(e.firstChild),At=t,Ie=!0,rr=null,fi=!0,i=oh(t,null,r,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Mr(),r===d){t=qi(e,t,i);break e}Lt(e,t,r,i)}t=t.child}return t;case 26:return ya(e,t),e===null?(i=Df(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ie||(i=t.type,e=t.pendingProps,r=Na(ce.current).createElement(i),r[Rt]=t,r[Pt]=e,Tt(r,i,e),yt(r),t.stateNode=r):t.memoizedState=Df(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ie(t),e===null&&Ie&&(r=t.stateNode=Ef(t.type,t.pendingProps,ce.current),At=t,fi=!0,d=Je,mr(t.type)?(fc=d,Je=gi(r.firstChild)):Je=d),Lt(e,t,t.pendingProps.children,i),ya(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((d=r=Je)&&(r=Sp(r,t.type,t.pendingProps,fi),r!==null?(t.stateNode=r,At=t,Je=gi(r.firstChild),fi=!1,d=!0):d=!1),d||sr(t)),ie(t),d=t.type,v=t.pendingProps,T=e!==null?e.memoizedProps:null,r=v.children,lc(d,v)?r=null:T!==null&&lc(d,T)&&(t.flags|=32),t.memoizedState!==null&&(d=ol(e,t,Bv,null,null,i),bn._currentValue=d),ya(e,t),Lt(e,t,r,i),t.child;case 6:return e===null&&Ie&&((e=i=Je)&&(i=bp(i,t.pendingProps,fi),i!==null?(t.stateNode=i,At=t,Je=null,e=!0):e=!1),e||sr(t)),null;case 13:return fd(e,t,i);case 4:return P(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ir(t,null,r,i):Lt(e,t,r,i),t.child;case 11:return sd(e,t,t.type,t.pendingProps,i);case 7:return Lt(e,t,t.pendingProps,i),t.child;case 8:return Lt(e,t,t.pendingProps.children,i),t.child;case 12:return Lt(e,t,t.pendingProps.children,i),t.child;case 10:return r=t.pendingProps,nr(t,t.type,r.value),Lt(e,t,r.children,i),t.child;case 9:return d=t.type._context,r=t.pendingProps.children,Or(t),d=Dt(d),r=r(d),t.flags|=1,Lt(e,t,r,i),t.child;case 14:return nd(e,t,t.type,t.pendingProps,i);case 15:return ad(e,t,t.type,t.pendingProps,i);case 19:return gd(e,t,i);case 31:return Fv(e,t,i);case 22:return od(e,t,i,t.pendingProps);case 24:return Or(t),r=Dt(ht),e===null?(d=Zo(),d===null&&(d=Xe,v=Xo(),d.pooledCache=v,v.refCount++,v!==null&&(d.pooledCacheLanes|=i),d=v),t.memoizedState={parent:r,cache:d},Jo(t),nr(t,ht,d)):((e.lanes&i)!==0&&(el(e,t),Js(t,null,null,i),Qs()),d=e.memoizedState,v=t.memoizedState,d.parent!==r?(d={parent:r,cache:r},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),nr(t,ht,r)):(r=v.cache,nr(t,ht,r),r!==d.cache&&Vo(t,[ht],i,!0))),Lt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(A(156,t.tag))}function Wi(e){e.flags|=4}function Hl(e,t,i,r,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(qd())e.flags|=8192;else throw zr=aa,Qo}else e.flags&=-16777217}function pd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Of(t))if(qd())e.flags|=8192;else throw zr=aa,Qo}function wa(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?kt():536870912,e.lanes|=t,ms|=t)}function an(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,r=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,r|=d.subtreeFlags&65011712,r|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,r|=d.subtreeFlags,r|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=r,e.childLanes=i,t}function Wv(e,t,i){var r=t.pendingProps;switch(qo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return et(t),null;case 3:return i=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ji(ht),ne(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ns(t)?Wi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,$o())),et(t),null;case 26:var d=t.type,v=t.memoizedState;return e===null?(Wi(t),v!==null?(et(t),pd(t,v)):(et(t),Hl(t,d,null,r,i))):v?v!==e.memoizedState?(Wi(t),et(t),pd(t,v)):(et(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Wi(t),et(t),Hl(t,d,e,r,i)),null;case 27:if(_e(t),i=ce.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Wi(t);else{if(!r){if(t.stateNode===null)throw Error(A(166));return et(t),null}e=ee.current,ns(t)?Ku(t):(e=Ef(d,r,i),t.stateNode=e,Wi(t))}return et(t),null;case 5:if(_e(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Wi(t);else{if(!r){if(t.stateNode===null)throw Error(A(166));return et(t),null}if(v=ee.current,ns(t))Ku(t);else{var T=Na(ce.current);switch(v){case 1:v=T.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:v=T.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":v=T.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":v=T.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":v=T.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof r.is=="string"?T.createElement("select",{is:r.is}):T.createElement("select"),r.multiple?v.multiple=!0:r.size&&(v.size=r.size);break;default:v=typeof r.is=="string"?T.createElement(d,{is:r.is}):T.createElement(d)}}v[Rt]=t,v[Pt]=r;e:for(T=t.child;T!==null;){if(T.tag===5||T.tag===6)v.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===t)break e;for(;T.sibling===null;){if(T.return===null||T.return===t)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}t.stateNode=v;e:switch(Tt(v,d,r),d){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Wi(t)}}return et(t),Hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Wi(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(A(166));if(e=ce.current,ns(t)){if(e=t.stateNode,i=t.memoizedProps,r=null,d=At,d!==null)switch(d.tag){case 27:case 5:r=d.memoizedProps}e[Rt]=t,e=!!(e.nodeValue===i||r!==null&&r.suppressHydrationWarning===!0||_f(e.nodeValue,i)),e||sr(t,!0)}else e=Na(e).createTextNode(r),e[Rt]=t,t.stateNode=e}return et(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(r=ns(t),i!==null){if(e===null){if(!r)throw Error(A(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(557));e[Rt]=t}else Mr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),e=!1}else i=$o(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(ei(t),t):(ei(t),null);if((t.flags&128)!==0)throw Error(A(558))}return et(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ns(t),r!==null&&r.dehydrated!==null){if(e===null){if(!d)throw Error(A(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(A(317));d[Rt]=t}else Mr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),d=!1}else d=$o(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(ei(t),t):(ei(t),null)}return ei(t),(t.flags&128)!==0?(t.lanes=i,t):(i=r!==null,e=e!==null&&e.memoizedState!==null,i&&(r=t.child,d=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(d=r.alternate.memoizedState.cachePool.pool),v=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(v=r.memoizedState.cachePool.pool),v!==d&&(r.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),wa(t,t.updateQueue),et(t),null);case 4:return ne(),e===null&&rc(t.stateNode.containerInfo),et(t),null;case 10:return ji(t.type),et(t),null;case 19:if(U(ot),r=t.memoizedState,r===null)return et(t),null;if(d=(t.flags&128)!==0,v=r.rendering,v===null)if(d)an(r,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=ua(e),v!==null){for(t.flags|=128,an(r,!1),e=v.updateQueue,t.updateQueue=e,wa(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)$u(i,e),i=i.sibling;return Q(ot,ot.current&1|2),Ie&&Ni(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>Da&&(t.flags|=128,d=!0,an(r,!1),t.lanes=4194304)}else{if(!d)if(e=ua(v),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,wa(t,e),an(r,!0),r.tail===null&&r.tailMode==="hidden"&&!v.alternate&&!Ie)return et(t),null}else 2*we()-r.renderingStartTime>Da&&i!==536870912&&(t.flags|=128,d=!0,an(r,!1),t.lanes=4194304);r.isBackwards?(v.sibling=t.child,t.child=v):(e=r.last,e!==null?e.sibling=v:t.child=v,r.last=v)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,i=ot.current,Q(ot,d?i&1|2:i&1),Ie&&Ni(t,r.treeForkCount),e):(et(t),null);case 22:case 23:return ei(t),sl(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(i&536870912)!==0&&(t.flags&128)===0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),i=t.updateQueue,i!==null&&wa(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==i&&(t.flags|=2048),e!==null&&U(Br),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ji(ht),et(t),null;case 25:return null;case 30:return null}throw Error(A(156,t.tag))}function $v(e,t){switch(qo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ji(ht),ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(ei(t),t.alternate===null)throw Error(A(340));Mr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ei(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));Mr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(ot),null;case 4:return ne(),null;case 10:return ji(t.type),null;case 22:case 23:return ei(t),sl(),e!==null&&U(Br),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ji(ht),null;case 25:return null;default:return null}}function md(e,t){switch(qo(t),t.tag){case 3:ji(ht),ne();break;case 26:case 27:case 5:_e(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&ei(t);break;case 13:ei(t);break;case 19:U(ot);break;case 10:ji(t.type);break;case 22:case 23:ei(t),sl(),e!==null&&U(Br);break;case 24:ji(ht)}}function on(e,t){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var d=r.next;i=d;do{if((i.tag&e)===e){r=void 0;var v=i.create,T=i.inst;r=v(),T.destroy=r}i=i.next}while(i!==d)}}catch(j){$e(t,t.return,j)}}function hr(e,t,i){try{var r=t.updateQueue,d=r!==null?r.lastEffect:null;if(d!==null){var v=d.next;r=v;do{if((r.tag&e)===e){var T=r.inst,j=T.destroy;if(j!==void 0){T.destroy=void 0,d=t;var Z=i,se=j;try{se()}catch(le){$e(d,Z,le)}}}r=r.next}while(r!==v)}}catch(le){$e(t,t.return,le)}}function Sd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{ch(t,i)}catch(r){$e(e,e.return,r)}}}function bd(e,t,i){i.props=Ur(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(r){$e(e,t,r)}}function ln(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof i=="function"?e.refCleanup=i(r):i.current=r}}catch(d){$e(e,t,d)}}function Di(e,t){var i=e.ref,r=e.refCleanup;if(i!==null)if(typeof r=="function")try{r()}catch(d){$e(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){$e(e,t,d)}else i.current=null}function yd(e){var t=e.type,i=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&r.focus();break e;case"img":i.src?r.src=i.src:i.srcSet&&(r.srcset=i.srcSet)}}catch(d){$e(e,e.return,d)}}function zl(e,t,i){try{var r=e.stateNode;fp(r,e.type,i,t),r[Pt]=t}catch(d){$e(e,e.return,d)}}function Cd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mr(e.type)||e.tag===4}function Il(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cd(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&&mr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Nl(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Hi));else if(r!==4&&(r===27&&mr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Nl(e,t,i),e=e.sibling;e!==null;)Nl(e,t,i),e=e.sibling}function xa(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(r!==4&&(r===27&&mr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(xa(e,t,i),e=e.sibling;e!==null;)xa(e,t,i),e=e.sibling}function wd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var r=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);Tt(t,r,i),t[Rt]=e,t[Pt]=i}catch(v){$e(e,e.return,v)}}var $i=!1,_t=!1,Ul=!1,xd=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function Gv(e,t){if(e=e.containerInfo,ac=$a,e=zu(e),ko(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var d=r.anchorOffset,v=r.focusNode;r=r.focusOffset;try{i.nodeType,v.nodeType}catch{i=null;break e}var T=0,j=-1,Z=-1,se=0,le=0,de=e,ae=null;t:for(;;){for(var oe;de!==i||d!==0&&de.nodeType!==3||(j=T+d),de!==v||r!==0&&de.nodeType!==3||(Z=T+r),de.nodeType===3&&(T+=de.nodeValue.length),(oe=de.firstChild)!==null;)ae=de,de=oe;for(;;){if(de===e)break t;if(ae===i&&++se===d&&(j=T),ae===v&&++le===r&&(Z=T),(oe=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=oe}i=j===-1||Z===-1?null:{start:j,end:Z}}else i=null}i=i||{start:0,end:0}}else i=null;for(oc={focusedElem:e,selectionRange:i},$a=!1,Ct=t;Ct!==null;)if(t=Ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ct=e;else for(;Ct!==null;){switch(t=Ct,v=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)d=e[i],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&v!==null){e=void 0,i=t,d=v.memoizedProps,v=v.memoizedState,r=i.stateNode;try{var pe=Ur(i.type,d);e=r.getSnapshotBeforeUpdate(pe,v),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){$e(i,i.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)uc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":uc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(A(163))}if(e=t.sibling,e!==null){e.return=t.return,Ct=e;break}Ct=t.return}}function Ed(e,t,i){var r=i.flags;switch(i.tag){case 0:case 11:case 15:Yi(e,i),r&4&&on(5,i);break;case 1:if(Yi(e,i),r&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(T){$e(i,i.return,T)}else{var d=Ur(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(T){$e(i,i.return,T)}}r&64&&Sd(i),r&512&&ln(i,i.return);break;case 3:if(Yi(e,i),r&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{ch(e,t)}catch(T){$e(i,i.return,T)}}break;case 27:t===null&&r&4&&wd(i);case 26:case 5:Yi(e,i),t===null&&r&4&&yd(i),r&512&&ln(i,i.return);break;case 12:Yi(e,i);break;case 31:Yi(e,i),r&4&&Dd(e,i);break;case 13:Yi(e,i),r&4&&Ld(e,i),r&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=tp.bind(null,i),yp(e,i))));break;case 22:if(r=i.memoizedState!==null||$i,!r){t=t!==null&&t.memoizedState!==null||_t,d=$i;var v=_t;$i=r,(_t=t)&&!v?Vi(e,i,(i.subtreeFlags&8772)!==0):Yi(e,i),$i=d,_t=v}break;case 30:break;default:Yi(e,i)}}function Rd(e){var t=e.alternate;t!==null&&(e.alternate=null,Rd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&go(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 it=null,qt=!1;function Gi(e,t,i){for(i=i.child;i!==null;)Ad(e,t,i),i=i.sibling}function Ad(e,t,i){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(Xt,i)}catch{}switch(i.tag){case 26:_t||Di(i,t),Gi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:_t||Di(i,t);var r=it,d=qt;mr(i.type)&&(it=i.stateNode,qt=!1),Gi(e,t,i),pn(i.stateNode),it=r,qt=d;break;case 5:_t||Di(i,t);case 6:if(r=it,d=qt,it=null,Gi(e,t,i),it=r,qt=d,it!==null)if(qt)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(i.stateNode)}catch(v){$e(i,t,v)}else try{it.removeChild(i.stateNode)}catch(v){$e(i,t,v)}break;case 18:it!==null&&(qt?(e=it,bf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Rs(e)):bf(it,i.stateNode));break;case 4:r=it,d=qt,it=i.stateNode.containerInfo,qt=!0,Gi(e,t,i),it=r,qt=d;break;case 0:case 11:case 14:case 15:hr(2,i,t),_t||hr(4,i,t),Gi(e,t,i);break;case 1:_t||(Di(i,t),r=i.stateNode,typeof r.componentWillUnmount=="function"&&bd(i,t,r)),Gi(e,t,i);break;case 21:Gi(e,t,i);break;case 22:_t=(r=_t)||i.memoizedState!==null,Gi(e,t,i),_t=r;break;default:Gi(e,t,i)}}function Dd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rs(e)}catch(i){$e(t,t.return,i)}}}function Ld(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rs(e)}catch(i){$e(t,t.return,i)}}function Yv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new xd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new xd),t;default:throw Error(A(435,e.tag))}}function Ea(e,t){var i=Yv(e);t.forEach(function(r){if(!i.has(r)){i.add(r);var d=ip.bind(null,e,r);r.then(d,d)}})}function Wt(e,t){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var d=i[r],v=e,T=t,j=T;e:for(;j!==null;){switch(j.tag){case 27:if(mr(j.type)){it=j.stateNode,qt=!1;break e}break;case 5:it=j.stateNode,qt=!1;break e;case 3:case 4:it=j.stateNode.containerInfo,qt=!0;break e}j=j.return}if(it===null)throw Error(A(160));Ad(v,T,d),it=null,qt=!1,v=d.alternate,v!==null&&(v.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Td(t,e),t=t.sibling}var Ci=null;function Td(e,t){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Wt(t,e),$t(e),r&4&&(hr(3,e,e.return),on(3,e),hr(5,e,e.return));break;case 1:Wt(t,e),$t(e),r&512&&(_t||i===null||Di(i,i.return)),r&64&&$i&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?r:i.concat(r))));break;case 26:var d=Ci;if(Wt(t,e),$t(e),r&512&&(_t||i===null||Di(i,i.return)),r&4){var v=i!==null?i.memoizedState:null;if(r=e.memoizedState,i===null)if(r===null)if(e.stateNode===null){e:{r=e.type,i=e.memoizedProps,d=d.ownerDocument||d;t:switch(r){case"title":v=d.getElementsByTagName("title")[0],(!v||v[Bs]||v[Rt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=d.createElement(r),d.head.insertBefore(v,d.querySelector("head > title"))),Tt(v,r,i),v[Rt]=e,yt(v),r=v;break e;case"link":var T=Mf("link","href",d).get(r+(i.href||""));if(T){for(var j=0;j<T.length;j++)if(v=T[j],v.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&v.getAttribute("rel")===(i.rel==null?null:i.rel)&&v.getAttribute("title")===(i.title==null?null:i.title)&&v.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){T.splice(j,1);break t}}v=d.createElement(r),Tt(v,r,i),d.head.appendChild(v);break;case"meta":if(T=Mf("meta","content",d).get(r+(i.content||""))){for(j=0;j<T.length;j++)if(v=T[j],v.getAttribute("content")===(i.content==null?null:""+i.content)&&v.getAttribute("name")===(i.name==null?null:i.name)&&v.getAttribute("property")===(i.property==null?null:i.property)&&v.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&v.getAttribute("charset")===(i.charSet==null?null:i.charSet)){T.splice(j,1);break t}}v=d.createElement(r),Tt(v,r,i),d.head.appendChild(v);break;default:throw Error(A(468,r))}v[Rt]=e,yt(v),r=v}e.stateNode=r}else kf(d,e.type,e.stateNode);else e.stateNode=Tf(d,r,e.memoizedProps);else v!==r?(v===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):v.count--,r===null?kf(d,e.type,e.stateNode):Tf(d,r,e.memoizedProps)):r===null&&e.stateNode!==null&&zl(e,e.memoizedProps,i.memoizedProps)}break;case 27:Wt(t,e),$t(e),r&512&&(_t||i===null||Di(i,i.return)),i!==null&&r&4&&zl(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Wt(t,e),$t(e),r&512&&(_t||i===null||Di(i,i.return)),e.flags&32){d=e.stateNode;try{Xr(d,"")}catch(pe){$e(e,e.return,pe)}}r&4&&e.stateNode!=null&&(d=e.memoizedProps,zl(e,d,i!==null?i.memoizedProps:d)),r&1024&&(Ul=!0);break;case 6:if(Wt(t,e),$t(e),r&4){if(e.stateNode===null)throw Error(A(162));r=e.memoizedProps,i=e.stateNode;try{i.nodeValue=r}catch(pe){$e(e,e.return,pe)}}break;case 3:if(Pa=null,d=Ci,Ci=Ua(t.containerInfo),Wt(t,e),Ci=d,$t(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{Rs(t.containerInfo)}catch(pe){$e(e,e.return,pe)}Ul&&(Ul=!1,Md(e));break;case 4:r=Ci,Ci=Ua(e.stateNode.containerInfo),Wt(t,e),$t(e),Ci=r;break;case 12:Wt(t,e),$t(e);break;case 31:Wt(t,e),$t(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ea(e,r)));break;case 13:Wt(t,e),$t(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Aa=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ea(e,r)));break;case 22:d=e.memoizedState!==null;var Z=i!==null&&i.memoizedState!==null,se=$i,le=_t;if($i=se||d,_t=le||Z,Wt(t,e),_t=le,$i=se,$t(e),r&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(i===null||Z||$i||_t||jr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){Z=i=t;try{if(v=Z.stateNode,d)T=v.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{j=Z.stateNode;var de=Z.memoizedProps.style,ae=de!=null&&de.hasOwnProperty("display")?de.display:null;j.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(pe){$e(Z,Z.return,pe)}}}else if(t.tag===6){if(i===null){Z=t;try{Z.stateNode.nodeValue=d?"":Z.memoizedProps}catch(pe){$e(Z,Z.return,pe)}}}else if(t.tag===18){if(i===null){Z=t;try{var oe=Z.stateNode;d?yf(oe,!0):yf(Z.stateNode,!1)}catch(pe){$e(Z,Z.return,pe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(i=r.retryQueue,i!==null&&(r.retryQueue=null,Ea(e,i))));break;case 19:Wt(t,e),$t(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ea(e,r)));break;case 30:break;case 21:break;default:Wt(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{for(var i,r=e.return;r!==null;){if(Cd(r)){i=r;break}r=r.return}if(i==null)throw Error(A(160));switch(i.tag){case 27:var d=i.stateNode,v=Il(e);xa(e,v,d);break;case 5:var T=i.stateNode;i.flags&32&&(Xr(T,""),i.flags&=-33);var j=Il(e);xa(e,j,T);break;case 3:case 4:var Z=i.stateNode.containerInfo,se=Il(e);Nl(e,se,Z);break;default:throw Error(A(161))}}catch(le){$e(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Md(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Md(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Yi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ed(e,t.alternate,t),t=t.sibling}function jr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:hr(4,t,t.return),jr(t);break;case 1:Di(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&bd(t,t.return,i),jr(t);break;case 27:pn(t.stateNode);case 26:case 5:Di(t,t.return),jr(t);break;case 22:t.memoizedState===null&&jr(t);break;case 30:jr(t);break;default:jr(t)}e=e.sibling}}function Vi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,d=e,v=t,T=v.flags;switch(v.tag){case 0:case 11:case 15:Vi(d,v,i),on(4,v);break;case 1:if(Vi(d,v,i),r=v,d=r.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(se){$e(r,r.return,se)}if(r=v,d=r.updateQueue,d!==null){var j=r.stateNode;try{var Z=d.shared.hiddenCallbacks;if(Z!==null)for(d.shared.hiddenCallbacks=null,d=0;d<Z.length;d++)lh(Z[d],j)}catch(se){$e(r,r.return,se)}}i&&T&64&&Sd(v),ln(v,v.return);break;case 27:wd(v);case 26:case 5:Vi(d,v,i),i&&r===null&&T&4&&yd(v),ln(v,v.return);break;case 12:Vi(d,v,i);break;case 31:Vi(d,v,i),i&&T&4&&Dd(d,v);break;case 13:Vi(d,v,i),i&&T&4&&Ld(d,v);break;case 22:v.memoizedState===null&&Vi(d,v,i),ln(v,v.return);break;case 30:break;default:Vi(d,v,i)}t=t.sibling}}function jl(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Ys(i))}function Pl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ys(e))}function wi(e,t,i,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kd(e,t,i,r),t=t.sibling}function kd(e,t,i,r){var d=t.flags;switch(t.tag){case 0:case 11:case 15:wi(e,t,i,r),d&2048&&on(9,t);break;case 1:wi(e,t,i,r);break;case 3:wi(e,t,i,r),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ys(e)));break;case 12:if(d&2048){wi(e,t,i,r),e=t.stateNode;try{var v=t.memoizedProps,T=v.id,j=v.onPostCommit;typeof j=="function"&&j(T,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Z){$e(t,t.return,Z)}}else wi(e,t,i,r);break;case 31:wi(e,t,i,r);break;case 13:wi(e,t,i,r);break;case 23:break;case 22:v=t.stateNode,T=t.alternate,t.memoizedState!==null?v._visibility&2?wi(e,t,i,r):cn(e,t):v._visibility&2?wi(e,t,i,r):(v._visibility|=2,gs(e,t,i,r,(t.subtreeFlags&10256)!==0||!1)),d&2048&&jl(T,t);break;case 24:wi(e,t,i,r),d&2048&&Pl(t.alternate,t);break;default:wi(e,t,i,r)}}function gs(e,t,i,r,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var v=e,T=t,j=i,Z=r,se=T.flags;switch(T.tag){case 0:case 11:case 15:gs(v,T,j,Z,d),on(8,T);break;case 23:break;case 22:var le=T.stateNode;T.memoizedState!==null?le._visibility&2?gs(v,T,j,Z,d):cn(v,T):(le._visibility|=2,gs(v,T,j,Z,d)),d&&se&2048&&jl(T.alternate,T);break;case 24:gs(v,T,j,Z,d),d&&se&2048&&Pl(T.alternate,T);break;default:gs(v,T,j,Z,d)}t=t.sibling}}function cn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,r=t,d=r.flags;switch(r.tag){case 22:cn(i,r),d&2048&&jl(r.alternate,r);break;case 24:cn(i,r),d&2048&&Pl(r.alternate,r);break;default:cn(i,r)}t=t.sibling}}var un=8192;function vs(e,t,i){if(e.subtreeFlags&un)for(e=e.child;e!==null;)Od(e,t,i),e=e.sibling}function Od(e,t,i){switch(e.tag){case 26:vs(e,t,i),e.flags&un&&e.memoizedState!==null&&Op(i,Ci,e.memoizedState,e.memoizedProps);break;case 5:vs(e,t,i);break;case 3:case 4:var r=Ci;Ci=Ua(e.stateNode.containerInfo),vs(e,t,i),Ci=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=un,un=16777216,vs(e,t,i),un=r):vs(e,t,i));break;default:vs(e,t,i)}}function Bd(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 hn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];Ct=r,zd(r,e)}Bd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hd(e),e=e.sibling}function Hd(e){switch(e.tag){case 0:case 11:case 15:hn(e),e.flags&2048&&hr(9,e,e.return);break;case 3:hn(e);break;case 12:hn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ra(e)):hn(e);break;default:hn(e)}}function Ra(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];Ct=r,zd(r,e)}Bd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:hr(8,t,t.return),Ra(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Ra(t));break;default:Ra(t)}e=e.sibling}}function zd(e,t){for(;Ct!==null;){var i=Ct;switch(i.tag){case 0:case 11:case 15:hr(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var r=i.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ys(i.memoizedState.cache)}if(r=i.child,r!==null)r.return=i,Ct=r;else e:for(i=e;Ct!==null;){r=Ct;var d=r.sibling,v=r.return;if(Rd(r),r===i){Ct=null;break e}if(d!==null){d.return=v,Ct=d;break e}Ct=v}}}var Vv={getCacheForType:function(e){var t=Dt(ht),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Dt(ht).controller.signal}},Xv=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Xe=null,Oe=null,He=0,We=0,ti=null,dr=!1,ps=!1,Fl=!1,Xi=0,nt=0,fr=0,Pr=0,ql=0,ii=0,ms=0,dn=null,Gt=null,Wl=!1,Aa=0,Id=0,Da=1/0,La=null,_r=null,mt=0,gr=null,Ss=null,Ki=0,$l=0,Gl=null,Nd=null,fn=0,Yl=null;function ri(){return(Fe&2)!==0&&He!==0?He&-He:W.T!==null?Jl():bi()}function Ud(){if(ii===0)if((He&536870912)===0||Ie){var e=Mi;Mi<<=1,(Mi&3932160)===0&&(Mi=262144),ii=e}else ii=536870912;return e=Jt.current,e!==null&&(e.flags|=32),ii}function Yt(e,t,i){(e===Xe&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(bs(e,0),vr(e,He,ii,!1)),si(e,i),((Fe&2)===0||e!==Xe)&&(e===Xe&&((Fe&2)===0&&(Pr|=i),nt===4&&vr(e,He,ii,!1)),Li(e))}function jd(e,t,i){if((Fe&6)!==0)throw Error(A(327));var r=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Nt(e,t),d=r?Qv(e,t):Xl(e,t,!0),v=r;do{if(d===0){ps&&!r&&vr(e,t,0,!1);break}else{if(i=e.current.alternate,v&&!Kv(i)){d=Xl(e,t,!1),v=!1;continue}if(d===2){if(v=t,e.errorRecoveryDisabledLanes&v)var T=0;else T=e.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){t=T;e:{var j=e;d=dn;var Z=j.current.memoizedState.isDehydrated;if(Z&&(bs(j,T).flags|=256),T=Xl(j,T,!1),T!==2){if(Fl&&!Z){j.errorRecoveryDisabledLanes|=v,Pr|=v,d=4;break e}v=Gt,Gt=d,v!==null&&(Gt===null?Gt=v:Gt.push.apply(Gt,v))}d=T}if(v=!1,d!==2)continue}}if(d===1){bs(e,0),vr(e,t,0,!0);break}e:{switch(r=e,v=d,v){case 0:case 1:throw Error(A(345));case 4:if((t&4194048)!==t)break;case 6:vr(r,t,ii,!dr);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(A(329))}if((t&62914560)===t&&(d=Aa+300-we(),10<d)){if(vr(r,t,ii,!dr),bt(r,0,!0)!==0)break e;Ki=t,r.timeoutHandle=mf(Pd.bind(null,r,i,Gt,La,Wl,t,ii,Pr,ms,dr,v,"Throttled",-0,0),d);break e}Pd(r,i,Gt,La,Wl,t,ii,Pr,ms,dr,v,null,-0,0)}}break}while(!0);Li(e)}function Pd(e,t,i,r,d,v,T,j,Z,se,le,de,ae,oe){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hi},Od(t,v,de);var pe=(v&62914560)===v?Aa-we():(v&4194048)===v?Id-we():0;if(pe=Bp(de,pe),pe!==null){Ki=v,e.cancelPendingCommit=pe(Xd.bind(null,e,t,v,i,r,d,T,j,Z,le,de,null,ae,oe)),vr(e,v,T,!se);return}}Xd(e,t,v,i,r,d,T,j,Z)}function Kv(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var r=0;r<i.length;r++){var d=i[r],v=d.getSnapshot;d=d.value;try{if(!Zt(v(),d))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 vr(e,t,i,r){t&=~ql,t&=~Pr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var d=t;0<d;){var v=31-vt(d),T=1<<v;r[v]=-1,d&=~T}i!==0&&Si(e,i,t)}function Ta(){return(Fe&6)===0?(_n(0),!1):!0}function Vl(){if(Oe!==null){if(We===0)var e=Oe.return;else e=Oe,Ui=kr=null,ul(e),us=null,Xs=0,e=Oe;for(;e!==null;)md(e.alternate,e),e=e.return;Oe=null}}function bs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,vp(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Ki=0,Vl(),Xe=e,Oe=i=Ii(e.current,null),He=t,We=0,ti=null,dr=!1,ps=Nt(e,t),Fl=!1,ms=ii=ql=Pr=fr=nt=0,Gt=dn=null,Wl=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var d=31-vt(r),v=1<<d;t|=e[d],r&=~v}return Xi=t,Zn(),i}function Fd(e,t){Le=null,W.H=sn,t===cs||t===na?(t=sh(),We=3):t===Qo?(t=sh(),We=4):We=t===Rl?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ti=t,Oe===null&&(nt=1,Sa(e,ui(t,e.current)))}function qd(){var e=Jt.current;return e===null?!0:(He&4194048)===He?_i===null:(He&62914560)===He||(He&536870912)!==0?e===_i:!1}function Wd(){var e=W.H;return W.H=sn,e===null?sn:e}function $d(){var e=W.A;return W.A=Vv,e}function Ma(){nt=4,dr||(He&4194048)!==He&&Jt.current!==null||(ps=!0),(fr&134217727)===0&&(Pr&134217727)===0||Xe===null||vr(Xe,He,ii,!1)}function Xl(e,t,i){var r=Fe;Fe|=2;var d=Wd(),v=$d();(Xe!==e||He!==t)&&(La=null,bs(e,t)),t=!1;var T=nt;e:do try{if(We!==0&&Oe!==null){var j=Oe,Z=ti;switch(We){case 8:Vl(),T=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var se=We;if(We=0,ti=null,ys(e,j,Z,se),i&&ps){T=0;break e}break;default:se=We,We=0,ti=null,ys(e,j,Z,se)}}Zv(),T=nt;break}catch(le){Fd(e,le)}while(!0);return t&&e.shellSuspendCounter++,Ui=kr=null,Fe=r,W.H=d,W.A=v,Oe===null&&(Xe=null,He=0,Zn()),T}function Zv(){for(;Oe!==null;)Gd(Oe)}function Qv(e,t){var i=Fe;Fe|=2;var r=Wd(),d=$d();Xe!==e||He!==t?(La=null,Da=we()+500,bs(e,t)):ps=Nt(e,t);e:do try{if(We!==0&&Oe!==null){t=Oe;var v=ti;t:switch(We){case 1:We=0,ti=null,ys(e,t,v,1);break;case 2:case 9:if(ih(v)){We=0,ti=null,Yd(t);break}t=function(){We!==2&&We!==9||Xe!==e||(We=7),Li(e)},v.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:ih(v)?(We=0,ti=null,Yd(t)):(We=0,ti=null,ys(e,t,v,7));break;case 5:var T=null;switch(Oe.tag){case 26:T=Oe.memoizedState;case 5:case 27:var j=Oe;if(T?Of(T):j.stateNode.complete){We=0,ti=null;var Z=j.sibling;if(Z!==null)Oe=Z;else{var se=j.return;se!==null?(Oe=se,ka(se)):Oe=null}break t}}We=0,ti=null,ys(e,t,v,5);break;case 6:We=0,ti=null,ys(e,t,v,6);break;case 8:Vl(),nt=6;break e;default:throw Error(A(462))}}Jv();break}catch(le){Fd(e,le)}while(!0);return Ui=kr=null,W.H=r,W.A=d,Fe=i,Oe!==null?0:(Xe=null,He=0,Zn(),nt)}function Jv(){for(;Oe!==null&&!Ae();)Gd(Oe)}function Gd(e){var t=vd(e.alternate,e,Xi);e.memoizedProps=e.pendingProps,t===null?ka(e):Oe=t}function Yd(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=ud(i,t,t.pendingProps,t.type,void 0,He);break;case 11:t=ud(i,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:ul(t);default:md(i,t),t=Oe=$u(t,Xi),t=vd(i,t,Xi)}e.memoizedProps=e.pendingProps,t===null?ka(e):Oe=t}function ys(e,t,i,r){Ui=kr=null,ul(t),us=null,Xs=0;var d=t.return;try{if(Pv(e,d,t,i,He)){nt=1,Sa(e,ui(i,e.current)),Oe=null;return}}catch(v){if(d!==null)throw Oe=d,v;nt=1,Sa(e,ui(i,e.current)),Oe=null;return}t.flags&32768?(Ie||r===1?e=!0:ps||(He&536870912)!==0?e=!1:(dr=e=!0,(r===2||r===9||r===3||r===6)&&(r=Jt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Vd(t,e)):ka(t)}function ka(e){var t=e;do{if((t.flags&32768)!==0){Vd(t,dr);return}e=t.return;var i=Wv(t.alternate,t,Xi);if(i!==null){Oe=i;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);nt===0&&(nt=5)}function Vd(e,t){do{var i=$v(e.alternate,e);if(i!==null){i.flags&=32767,Oe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=i}while(e!==null);nt=6,Oe=null}function Xd(e,t,i,r,d,v,T,j,Z){e.cancelPendingCommit=null;do Oa();while(mt!==0);if((Fe&6)!==0)throw Error(A(327));if(t!==null){if(t===e.current)throw Error(A(177));if(v=t.lanes|t.childLanes,v|=Io,pt(e,i,v,T,j,Z),e===Xe&&(Oe=Xe=null,He=0),Ss=t,gr=e,Ki=i,$l=v,Gl=d,Nd=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,rp(Ze,function(){return ef(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=W.T,W.T=null,d=$.p,$.p=2,T=Fe,Fe|=4;try{Gv(e,t,i)}finally{Fe=T,$.p=d,W.T=r}}mt=1,Kd(),Zd(),Qd()}}function Kd(){if(mt===1){mt=0;var e=gr,t=Ss,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=W.T,W.T=null;var r=$.p;$.p=2;var d=Fe;Fe|=4;try{Td(t,e);var v=oc,T=zu(e.containerInfo),j=v.focusedElem,Z=v.selectionRange;if(T!==j&&j&&j.ownerDocument&&Hu(j.ownerDocument.documentElement,j)){if(Z!==null&&ko(j)){var se=Z.start,le=Z.end;if(le===void 0&&(le=se),"selectionStart"in j)j.selectionStart=se,j.selectionEnd=Math.min(le,j.value.length);else{var de=j.ownerDocument||document,ae=de&&de.defaultView||window;if(ae.getSelection){var oe=ae.getSelection(),pe=j.textContent.length,Ce=Math.min(Z.start,pe),Ve=Z.end===void 0?Ce:Math.min(Z.end,pe);!oe.extend&&Ce>Ve&&(T=Ve,Ve=Ce,Ce=T);var te=Bu(j,Ce),J=Bu(j,Ve);if(te&&J&&(oe.rangeCount!==1||oe.anchorNode!==te.node||oe.anchorOffset!==te.offset||oe.focusNode!==J.node||oe.focusOffset!==J.offset)){var re=de.createRange();re.setStart(te.node,te.offset),oe.removeAllRanges(),Ce>Ve?(oe.addRange(re),oe.extend(J.node,J.offset)):(re.setEnd(J.node,J.offset),oe.addRange(re))}}}}for(de=[],oe=j;oe=oe.parentNode;)oe.nodeType===1&&de.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<de.length;j++){var ue=de[j];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}$a=!!ac,oc=ac=null}finally{Fe=d,$.p=r,W.T=i}}e.current=t,mt=2}}function Zd(){if(mt===2){mt=0;var e=gr,t=Ss,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=W.T,W.T=null;var r=$.p;$.p=2;var d=Fe;Fe|=4;try{Ed(e,t.alternate,t)}finally{Fe=d,$.p=r,W.T=i}}mt=3}}function Qd(){if(mt===4||mt===3){mt=0,ge();var e=gr,t=Ss,i=Ki,r=Nd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?mt=5:(mt=0,Ss=gr=null,Jd(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(_r=null),Oi(i),t=t.stateNode,ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=W.T,d=$.p,$.p=2,W.T=null;try{for(var v=e.onRecoverableError,T=0;T<r.length;T++){var j=r[T];v(j.value,{componentStack:j.stack})}}finally{W.T=t,$.p=d}}(Ki&3)!==0&&Oa(),Li(e),d=e.pendingLanes,(i&261930)!==0&&(d&42)!==0?e===Yl?fn++:(fn=0,Yl=e):fn=0,_n(0)}}function Jd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ys(t)))}function Oa(){return Kd(),Zd(),Qd(),ef()}function ef(){if(mt!==5)return!1;var e=gr,t=$l;$l=0;var i=Oi(Ki),r=W.T,d=$.p;try{$.p=32>i?32:i,W.T=null,i=Gl,Gl=null;var v=gr,T=Ki;if(mt=0,Ss=gr=null,Ki=0,(Fe&6)!==0)throw Error(A(331));var j=Fe;if(Fe|=4,Hd(v.current),kd(v,v.current,T,i),Fe=j,_n(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(Xt,v)}catch{}return!0}finally{$.p=d,W.T=r,Jd(e,t)}}function tf(e,t,i){t=ui(i,t),t=El(e.stateNode,t,2),e=lr(e,t,2),e!==null&&(si(e,2),Li(e))}function $e(e,t,i){if(e.tag===3)tf(e,e,i);else for(;t!==null;){if(t.tag===3){tf(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(_r===null||!_r.has(r))){e=ui(i,e),i=id(2),r=lr(t,i,2),r!==null&&(rd(i,r,t,e),si(r,2),Li(r));break}}t=t.return}}function Kl(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new Xv;var d=new Set;r.set(t,d)}else d=r.get(t),d===void 0&&(d=new Set,r.set(t,d));d.has(i)||(Fl=!0,d.add(i),e=ep.bind(null,e,t,i),t.then(e,e))}function ep(e,t,i){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Xe===e&&(He&i)===i&&(nt===4||nt===3&&(He&62914560)===He&&300>we()-Aa?(Fe&2)===0&&bs(e,0):ql|=i,ms===He&&(ms=0)),Li(e)}function rf(e,t){t===0&&(t=kt()),e=Lr(e,t),e!==null&&(si(e,t),Li(e))}function tp(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),rf(e,i)}function ip(e,t){var i=0;switch(e.tag){case 31:case 13:var r=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(A(314))}r!==null&&r.delete(t),rf(e,i)}function rp(e,t){return xe(e,t)}var Ba=null,Cs=null,Zl=!1,Ha=!1,Ql=!1,pr=0;function Li(e){e!==Cs&&e.next===null&&(Cs===null?Ba=Cs=e:Cs=Cs.next=e),Ha=!0,Zl||(Zl=!0,np())}function _n(e,t){if(!Ql&&Ha){Ql=!0;do for(var i=!1,r=Ba;r!==null;){if(e!==0){var d=r.pendingLanes;if(d===0)var v=0;else{var T=r.suspendedLanes,j=r.pingedLanes;v=(1<<31-vt(42|e)+1)-1,v&=d&~(T&~j),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(i=!0,of(r,v))}else v=He,v=bt(r,r===Xe?v:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(v&3)===0||Nt(r,v)||(i=!0,of(r,v));r=r.next}while(i);Ql=!1}}function sp(){sf()}function sf(){Ha=Zl=!1;var e=0;pr!==0&&gp()&&(e=pr);for(var t=we(),i=null,r=Ba;r!==null;){var d=r.next,v=nf(r,t);v===0?(r.next=null,i===null?Ba=d:i.next=d,d===null&&(Cs=i)):(i=r,(e!==0||(v&3)!==0)&&(Ha=!0)),r=d}mt!==0&&mt!==5||_n(e),pr!==0&&(pr=0)}function nf(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,d=e.expirationTimes,v=e.pendingLanes&-62914561;0<v;){var T=31-vt(v),j=1<<T,Z=d[T];Z===-1?((j&i)===0||(j&r)!==0)&&(d[T]=Ut(j,t)):Z<=t&&(e.expiredLanes|=j),v&=~j}if(t=Xe,i=He,i=bt(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,i===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ee(r),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Nt(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(r!==null&&Ee(r),Oi(i)){case 2:case 8:i=gt;break;case 32:i=Ze;break;case 268435456:i=Qe;break;default:i=Ze}return r=af.bind(null,e),i=xe(i,r),e.callbackPriority=t,e.callbackNode=i,t}return r!==null&&r!==null&&Ee(r),e.callbackPriority=2,e.callbackNode=null,2}function af(e,t){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Oa()&&e.callbackNode!==i)return null;var r=He;return r=bt(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(jd(e,r,t),nf(e,we()),e.callbackNode!=null&&e.callbackNode===i?af.bind(null,e):null)}function of(e,t){if(Oa())return null;jd(e,t,!0)}function np(){pp(function(){(Fe&6)!==0?xe(qe,sp):sf()})}function Jl(){if(pr===0){var e=os;e===0&&(e=Ei,Ei<<=1,(Ei&261888)===0&&(Ei=256)),pr=e}return pr}function lf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qn(""+e)}function cf(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function ap(e,t,i,r,d){if(t==="submit"&&i&&i.stateNode===d){var v=lf((d[Pt]||null).action),T=r.submitter;T&&(t=(t=T[Pt]||null)?lf(t.formAction):T.getAttribute("formAction"),t!==null&&(v=t,T=null));var j=new Yn("action","action",null,r,d);e.push({event:j,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(pr!==0){var Z=T?cf(d,T):new FormData(d);Sl(i,{pending:!0,data:Z,method:d.method,action:v},null,Z)}}else typeof v=="function"&&(j.preventDefault(),Z=T?cf(d,T):new FormData(d),Sl(i,{pending:!0,data:Z,method:d.method,action:v},v,Z))},currentTarget:d}]})}}for(var ec=0;ec<zo.length;ec++){var tc=zo[ec],op=tc.toLowerCase(),lp=tc[0].toUpperCase()+tc.slice(1);yi(op,"on"+lp)}yi(Uu,"onAnimationEnd"),yi(ju,"onAnimationIteration"),yi(Pu,"onAnimationStart"),yi("dblclick","onDoubleClick"),yi("focusin","onFocus"),yi("focusout","onBlur"),yi(xv,"onTransitionRun"),yi(Ev,"onTransitionStart"),yi(Rv,"onTransitionCancel"),yi(Fu,"onTransitionEnd"),Yr("onMouseEnter",["mouseout","mouseover"]),Yr("onMouseLeave",["mouseout","mouseover"]),Yr("onPointerEnter",["pointerout","pointerover"]),Yr("onPointerLeave",["pointerout","pointerover"]),Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Er("onBeforeInput",["compositionend","keypress","textInput","paste"]),Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gn="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(" "),cp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gn));function uf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var r=e[i],d=r.event;r=r.listeners;e:{var v=void 0;if(t)for(var T=r.length-1;0<=T;T--){var j=r[T],Z=j.instance,se=j.currentTarget;if(j=j.listener,Z!==v&&d.isPropagationStopped())break e;v=j,d.currentTarget=se;try{v(d)}catch(le){Kn(le)}d.currentTarget=null,v=Z}else for(T=0;T<r.length;T++){if(j=r[T],Z=j.instance,se=j.currentTarget,j=j.listener,Z!==v&&d.isPropagationStopped())break e;v=j,d.currentTarget=se;try{v(d)}catch(le){Kn(le)}d.currentTarget=null,v=Z}}}}function Be(e,t){var i=t[_o];i===void 0&&(i=t[_o]=new Set);var r=e+"__bubble";i.has(r)||(hf(t,e,2,!1),i.add(r))}function ic(e,t,i){var r=0;t&&(r|=4),hf(i,e,r,t)}var za="_reactListening"+Math.random().toString(36).slice(2);function rc(e){if(!e[za]){e[za]=!0,ru.forEach(function(i){i!=="selectionchange"&&(cp.has(i)||ic(i,!1,e),ic(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[za]||(t[za]=!0,ic("selectionchange",!1,t))}}function hf(e,t,i,r){switch(jf(t)){case 2:var d=Ip;break;case 8:d=Np;break;default:d=mc}i=d.bind(null,t,i,e),d=void 0,!wo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),r?d!==void 0?e.addEventListener(t,i,{capture:!0,passive:d}):e.addEventListener(t,i,!0):d!==void 0?e.addEventListener(t,i,{passive:d}):e.addEventListener(t,i,!1)}function sc(e,t,i,r,d){var v=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var T=r.tag;if(T===3||T===4){var j=r.stateNode.containerInfo;if(j===d)break;if(T===4)for(T=r.return;T!==null;){var Z=T.tag;if((Z===3||Z===4)&&T.stateNode.containerInfo===d)return;T=T.return}for(;j!==null;){if(T=Wr(j),T===null)return;if(Z=T.tag,Z===5||Z===6||Z===26||Z===27){r=v=T;continue e}j=j.parentNode}}r=r.return}gu(function(){var se=v,le=yo(i),de=[];e:{var ae=qu.get(e);if(ae!==void 0){var oe=Yn,pe=e;switch(e){case"keypress":if($n(i)===0)break e;case"keydown":case"keyup":oe=iv;break;case"focusin":pe="focus",oe=Ao;break;case"focusout":pe="blur",oe=Ao;break;case"beforeblur":case"afterblur":oe=Ao;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=mu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Wg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=nv;break;case Uu:case ju:case Pu:oe=Yg;break;case Fu:oe=ov;break;case"scroll":case"scrollend":oe=Fg;break;case"wheel":oe=cv;break;case"copy":case"cut":case"paste":oe=Xg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=bu;break;case"toggle":case"beforetoggle":oe=hv}var Ce=(t&4)!==0,Ve=!Ce&&(e==="scroll"||e==="scrollend"),te=Ce?ae!==null?ae+"Capture":null:ae;Ce=[];for(var J=se,re;J!==null;){var ue=J;if(re=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||re===null||te===null||(ue=zs(J,te),ue!=null&&Ce.push(vn(J,ue,re))),Ve)break;J=J.return}0<Ce.length&&(ae=new oe(ae,pe,null,i,le),de.push({event:ae,listeners:Ce}))}}if((t&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",ae&&i!==bo&&(pe=i.relatedTarget||i.fromElement)&&(Wr(pe)||pe[qr]))break e;if((oe||ae)&&(ae=le.window===le?le:(ae=le.ownerDocument)?ae.defaultView||ae.parentWindow:window,oe?(pe=i.relatedTarget||i.toElement,oe=se,pe=pe?Wr(pe):null,pe!==null&&(Ve=N(pe),Ce=pe.tag,pe!==Ve||Ce!==5&&Ce!==27&&Ce!==6)&&(pe=null)):(oe=null,pe=se),oe!==pe)){if(Ce=mu,ue="onMouseLeave",te="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=bu,ue="onPointerLeave",te="onPointerEnter",J="pointer"),Ve=oe==null?ae:Hs(oe),re=pe==null?ae:Hs(pe),ae=new Ce(ue,J+"leave",oe,i,le),ae.target=Ve,ae.relatedTarget=re,ue=null,Wr(le)===se&&(Ce=new Ce(te,J+"enter",pe,i,le),Ce.target=re,Ce.relatedTarget=Ve,ue=Ce),Ve=ue,oe&&pe)t:{for(Ce=up,te=oe,J=pe,re=0,ue=te;ue;ue=Ce(ue))re++;ue=0;for(var be=J;be;be=Ce(be))ue++;for(;0<re-ue;)te=Ce(te),re--;for(;0<ue-re;)J=Ce(J),ue--;for(;re--;){if(te===J||J!==null&&te===J.alternate){Ce=te;break t}te=Ce(te),J=Ce(J)}Ce=null}else Ce=null;oe!==null&&df(de,ae,oe,Ce,!1),pe!==null&&Ve!==null&&df(de,Ve,pe,Ce,!0)}}e:{if(ae=se?Hs(se):window,oe=ae.nodeName&&ae.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ae.type==="file")var Ue=Du;else if(Ru(ae))if(Lu)Ue=yv;else{Ue=Sv;var me=mv}else oe=ae.nodeName,!oe||oe.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?se&&So(se.elementType)&&(Ue=Du):Ue=bv;if(Ue&&(Ue=Ue(e,se))){Au(de,Ue,i,le);break e}me&&me(e,ae,se),e==="focusout"&&se&&ae.type==="number"&&se.memoizedProps.value!=null&&mo(ae,"number",ae.value)}switch(me=se?Hs(se):window,e){case"focusin":(Ru(me)||me.contentEditable==="true")&&(Jr=me,Oo=se,Ws=null);break;case"focusout":Ws=Oo=Jr=null;break;case"mousedown":Bo=!0;break;case"contextmenu":case"mouseup":case"dragend":Bo=!1,Iu(de,i,le);break;case"selectionchange":if(wv)break;case"keydown":case"keyup":Iu(de,i,le)}var Me;if(Lo)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Qr?xu(e,i)&&(ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(yu&&i.locale!=="ko"&&(Qr||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Qr&&(Me=vu()):(tr=le,xo="value"in tr?tr.value:tr.textContent,Qr=!0)),me=Ia(se,ze),0<me.length&&(ze=new Su(ze,e,null,i,le),de.push({event:ze,listeners:me}),Me?ze.data=Me:(Me=Eu(i),Me!==null&&(ze.data=Me)))),(Me=fv?_v(e,i):gv(e,i))&&(ze=Ia(se,"onBeforeInput"),0<ze.length&&(me=new Su("onBeforeInput","beforeinput",null,i,le),de.push({event:me,listeners:ze}),me.data=Me)),ap(de,e,se,i,le)}uf(de,t)})}function vn(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Ia(e,t){for(var i=t+"Capture",r=[];e!==null;){var d=e,v=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||v===null||(d=zs(e,i),d!=null&&r.unshift(vn(e,d,v)),d=zs(e,t),d!=null&&r.push(vn(e,d,v))),e.tag===3)return r;e=e.return}return[]}function up(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function df(e,t,i,r,d){for(var v=t._reactName,T=[];i!==null&&i!==r;){var j=i,Z=j.alternate,se=j.stateNode;if(j=j.tag,Z!==null&&Z===r)break;j!==5&&j!==26&&j!==27||se===null||(Z=se,d?(se=zs(i,v),se!=null&&T.unshift(vn(i,se,Z))):d||(se=zs(i,v),se!=null&&T.push(vn(i,se,Z)))),i=i.return}T.length!==0&&e.push({event:t,listeners:T})}var hp=/\r\n?/g,dp=/\u0000|\uFFFD/g;function ff(e){return(typeof e=="string"?e:""+e).replace(hp,`
49
+ `).replace(dp,"")}function _f(e,t){return t=ff(t),ff(e)===t}function Ye(e,t,i,r,d,v){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Xr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Xr(e,""+r);break;case"className":Pn(e,"class",r);break;case"tabIndex":Pn(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Pn(e,i,r);break;case"style":fu(e,r,v);break;case"data":if(t!=="object"){Pn(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=qn(""+r),e.setAttribute(i,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(i==="formAction"?(t!=="input"&&Ye(e,t,"name",d.name,d,null),Ye(e,t,"formEncType",d.formEncType,d,null),Ye(e,t,"formMethod",d.formMethod,d,null),Ye(e,t,"formTarget",d.formTarget,d,null)):(Ye(e,t,"encType",d.encType,d,null),Ye(e,t,"method",d.method,d,null),Ye(e,t,"target",d.target,d,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=qn(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=Hi);break;case"onScroll":r!=null&&Be("scroll",e);break;case"onScrollEnd":r!=null&&Be("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(A(61));if(i=r.__html,i!=null){if(d.children!=null)throw Error(A(60));e.innerHTML=i}}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}i=qn(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);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(i,""+r):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":r===!0?e.setAttribute(i,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,r):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(i,r):e.removeAttribute(i);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(i):e.setAttribute(i,r);break;case"popover":Be("beforetoggle",e),Be("toggle",e),jn(e,"popover",r);break;case"xlinkActuate":Bi(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Bi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Bi(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Bi(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Bi(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Bi(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":jn(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=jg.get(i)||i,jn(e,i,r))}}function nc(e,t,i,r,d,v){switch(i){case"style":fu(e,r,v);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(A(61));if(i=r.__html,i!=null){if(d.children!=null)throw Error(A(60));e.innerHTML=i}}break;case"children":typeof r=="string"?Xr(e,r):(typeof r=="number"||typeof r=="bigint")&&Xr(e,""+r);break;case"onScroll":r!=null&&Be("scroll",e);break;case"onScrollEnd":r!=null&&Be("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!su.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(d=i.endsWith("Capture"),t=i.slice(2,d?i.length-7:void 0),v=e[Pt]||null,v=v!=null?v[i]:null,typeof v=="function"&&e.removeEventListener(t,v,d),typeof r=="function")){typeof v!="function"&&v!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,r,d);break e}i in e?e[i]=r:r===!0?e.setAttribute(i,""):jn(e,i,r)}}}function Tt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var r=!1,d=!1,v;for(v in i)if(i.hasOwnProperty(v)){var T=i[v];if(T!=null)switch(v){case"src":r=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:Ye(e,t,v,T,i,null)}}d&&Ye(e,t,"srcSet",i.srcSet,i,null),r&&Ye(e,t,"src",i.src,i,null);return;case"input":Be("invalid",e);var j=v=T=d=null,Z=null,se=null;for(r in i)if(i.hasOwnProperty(r)){var le=i[r];if(le!=null)switch(r){case"name":d=le;break;case"type":T=le;break;case"checked":Z=le;break;case"defaultChecked":se=le;break;case"value":v=le;break;case"defaultValue":j=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(A(137,t));break;default:Ye(e,t,r,le,i,null)}}cu(e,v,j,Z,se,T,d,!1);return;case"select":Be("invalid",e),r=T=v=null;for(d in i)if(i.hasOwnProperty(d)&&(j=i[d],j!=null))switch(d){case"value":v=j;break;case"defaultValue":T=j;break;case"multiple":r=j;default:Ye(e,t,d,j,i,null)}t=v,i=T,e.multiple=!!r,t!=null?Vr(e,!!r,t,!1):i!=null&&Vr(e,!!r,i,!0);return;case"textarea":Be("invalid",e),v=d=r=null;for(T in i)if(i.hasOwnProperty(T)&&(j=i[T],j!=null))switch(T){case"value":r=j;break;case"defaultValue":d=j;break;case"children":v=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(A(91));break;default:Ye(e,t,T,j,i,null)}hu(e,r,d,v);return;case"option":for(Z in i)if(i.hasOwnProperty(Z)&&(r=i[Z],r!=null))switch(Z){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ye(e,t,Z,r,i,null)}return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(r=0;r<gn.length;r++)Be(gn[r],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("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(se in i)if(i.hasOwnProperty(se)&&(r=i[se],r!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:Ye(e,t,se,r,i,null)}return;default:if(So(t)){for(le in i)i.hasOwnProperty(le)&&(r=i[le],r!==void 0&&nc(e,t,le,r,i,void 0));return}}for(j in i)i.hasOwnProperty(j)&&(r=i[j],r!=null&&Ye(e,t,j,r,i,null))}function fp(e,t,i,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,v=null,T=null,j=null,Z=null,se=null,le=null;for(oe in i){var de=i[oe];if(i.hasOwnProperty(oe)&&de!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":Z=de;default:r.hasOwnProperty(oe)||Ye(e,t,oe,null,r,de)}}for(var ae in r){var oe=r[ae];if(de=i[ae],r.hasOwnProperty(ae)&&(oe!=null||de!=null))switch(ae){case"type":v=oe;break;case"name":d=oe;break;case"checked":se=oe;break;case"defaultChecked":le=oe;break;case"value":T=oe;break;case"defaultValue":j=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(A(137,t));break;default:oe!==de&&Ye(e,t,ae,oe,r,de)}}po(e,T,j,Z,se,le,v,d);return;case"select":oe=T=j=ae=null;for(v in i)if(Z=i[v],i.hasOwnProperty(v)&&Z!=null)switch(v){case"value":break;case"multiple":oe=Z;default:r.hasOwnProperty(v)||Ye(e,t,v,null,r,Z)}for(d in r)if(v=r[d],Z=i[d],r.hasOwnProperty(d)&&(v!=null||Z!=null))switch(d){case"value":ae=v;break;case"defaultValue":j=v;break;case"multiple":T=v;default:v!==Z&&Ye(e,t,d,v,r,Z)}t=j,i=T,r=oe,ae!=null?Vr(e,!!i,ae,!1):!!r!=!!i&&(t!=null?Vr(e,!!i,t,!0):Vr(e,!!i,i?[]:"",!1));return;case"textarea":oe=ae=null;for(j in i)if(d=i[j],i.hasOwnProperty(j)&&d!=null&&!r.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Ye(e,t,j,null,r,d)}for(T in r)if(d=r[T],v=i[T],r.hasOwnProperty(T)&&(d!=null||v!=null))switch(T){case"value":ae=d;break;case"defaultValue":oe=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(A(91));break;default:d!==v&&Ye(e,t,T,d,r,v)}uu(e,ae,oe);return;case"option":for(var pe in i)if(ae=i[pe],i.hasOwnProperty(pe)&&ae!=null&&!r.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:Ye(e,t,pe,null,r,ae)}for(Z in r)if(ae=r[Z],oe=i[Z],r.hasOwnProperty(Z)&&ae!==oe&&(ae!=null||oe!=null))switch(Z){case"selected":e.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:Ye(e,t,Z,ae,r,oe)}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 Ce in i)ae=i[Ce],i.hasOwnProperty(Ce)&&ae!=null&&!r.hasOwnProperty(Ce)&&Ye(e,t,Ce,null,r,ae);for(se in r)if(ae=r[se],oe=i[se],r.hasOwnProperty(se)&&ae!==oe&&(ae!=null||oe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(A(137,t));break;default:Ye(e,t,se,ae,r,oe)}return;default:if(So(t)){for(var Ve in i)ae=i[Ve],i.hasOwnProperty(Ve)&&ae!==void 0&&!r.hasOwnProperty(Ve)&&nc(e,t,Ve,void 0,r,ae);for(le in r)ae=r[le],oe=i[le],!r.hasOwnProperty(le)||ae===oe||ae===void 0&&oe===void 0||nc(e,t,le,ae,r,oe);return}}for(var te in i)ae=i[te],i.hasOwnProperty(te)&&ae!=null&&!r.hasOwnProperty(te)&&Ye(e,t,te,null,r,ae);for(de in r)ae=r[de],oe=i[de],!r.hasOwnProperty(de)||ae===oe||ae==null&&oe==null||Ye(e,t,de,ae,r,oe)}function gf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _p(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),r=0;r<i.length;r++){var d=i[r],v=d.transferSize,T=d.initiatorType,j=d.duration;if(v&&j&&gf(T)){for(T=0,j=d.responseEnd,r+=1;r<i.length;r++){var Z=i[r],se=Z.startTime;if(se>j)break;var le=Z.transferSize,de=Z.initiatorType;le&&gf(de)&&(Z=Z.responseEnd,T+=le*(Z<j?1:(j-se)/(Z-se)))}if(--r,t+=8*(v+T)/(d.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 ac=null,oc=null;function Na(e){return e.nodeType===9?e:e.ownerDocument}function vf(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 pf(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 lc(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 cc=null;function gp(){var e=window.event;return e&&e.type==="popstate"?e===cc?!1:(cc=e,!0):(cc=null,!1)}var mf=typeof setTimeout=="function"?setTimeout:void 0,vp=typeof clearTimeout=="function"?clearTimeout:void 0,Sf=typeof Promise=="function"?Promise:void 0,pp=typeof queueMicrotask=="function"?queueMicrotask:typeof Sf<"u"?function(e){return Sf.resolve(null).then(e).catch(mp)}:mf;function mp(e){setTimeout(function(){throw e})}function mr(e){return e==="head"}function bf(e,t){var i=t,r=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"||i==="/&"){if(r===0){e.removeChild(d),Rs(t);return}r--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")r++;else if(i==="html")pn(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,pn(i);for(var v=i.firstChild;v;){var T=v.nextSibling,j=v.nodeName;v[Bs]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&v.rel.toLowerCase()==="stylesheet"||i.removeChild(v),v=T}}else i==="body"&&pn(e.ownerDocument.body);i=d}while(i);Rs(t)}function yf(e,t){var i=e;e=0;do{var r=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),r&&r.nodeType===8)if(i=r.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=r}while(i)}function uc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":uc(i),go(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Sp(e,t,i,r){for(;e.nodeType===1;){var d=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Bs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(v=e.getAttribute("rel"),v==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(v!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(v=e.getAttribute("src"),(v!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&v&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var v=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===v)return e}else return e;if(e=gi(e.nextSibling),e===null)break}return null}function bp(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=gi(e.nextSibling),e===null))return null;return e}function Cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gi(e.nextSibling),e===null))return null;return e}function hc(e){return e.data==="$?"||e.data==="$~"}function dc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yp(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var r=function(){t(),i.removeEventListener("DOMContentLoaded",r)};i.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function gi(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 fc=null;function wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return gi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function xf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Ef(e,t,i){switch(t=Na(i),e){case"html":if(e=t.documentElement,!e)throw Error(A(452));return e;case"head":if(e=t.head,!e)throw Error(A(453));return e;case"body":if(e=t.body,!e)throw Error(A(454));return e;default:throw Error(A(451))}}function pn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);go(e)}var vi=new Map,Rf=new Set;function Ua(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Zi=$.d;$.d={f:Cp,r:wp,D:xp,C:Ep,L:Rp,m:Ap,X:Lp,S:Dp,M:Tp};function Cp(){var e=Zi.f(),t=Ta();return e||t}function wp(e){var t=$r(e);t!==null&&t.tag===5&&t.type==="form"?Fh(t):Zi.r(e)}var ws=typeof document>"u"?null:document;function Af(e,t,i){var r=ws;if(r&&typeof t=="string"&&t){var d=li(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),Rf.has(d)||(Rf.add(d),e={rel:e,crossOrigin:i,href:t},r.querySelector(d)===null&&(t=r.createElement("link"),Tt(t,"link",e),yt(t),r.head.appendChild(t)))}}function xp(e){Zi.D(e),Af("dns-prefetch",e,null)}function Ep(e,t){Zi.C(e,t),Af("preconnect",e,t)}function Rp(e,t,i){Zi.L(e,t,i);var r=ws;if(r&&e&&t){var d='link[rel="preload"][as="'+li(t)+'"]';t==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+li(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+li(i.imageSizes)+'"]')):d+='[href="'+li(e)+'"]';var v=d;switch(t){case"style":v=xs(e);break;case"script":v=Es(e)}vi.has(v)||(e=a({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),vi.set(v,e),r.querySelector(d)!==null||t==="style"&&r.querySelector(mn(v))||t==="script"&&r.querySelector(Sn(v))||(t=r.createElement("link"),Tt(t,"link",e),yt(t),r.head.appendChild(t)))}}function Ap(e,t){Zi.m(e,t);var i=ws;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+li(r)+'"][href="'+li(e)+'"]',v=d;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Es(e)}if(!vi.has(v)&&(e=a({rel:"modulepreload",href:e},t),vi.set(v,e),i.querySelector(d)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Sn(v)))return}r=i.createElement("link"),Tt(r,"link",e),yt(r),i.head.appendChild(r)}}}function Dp(e,t,i){Zi.S(e,t,i);var r=ws;if(r&&e){var d=Gr(r).hoistableStyles,v=xs(e);t=t||"default";var T=d.get(v);if(!T){var j={loading:0,preload:null};if(T=r.querySelector(mn(v)))j.loading=5;else{e=a({rel:"stylesheet",href:e,"data-precedence":t},i),(i=vi.get(v))&&_c(e,i);var Z=T=r.createElement("link");yt(Z),Tt(Z,"link",e),Z._p=new Promise(function(se,le){Z.onload=se,Z.onerror=le}),Z.addEventListener("load",function(){j.loading|=1}),Z.addEventListener("error",function(){j.loading|=2}),j.loading|=4,ja(T,t,r)}T={type:"stylesheet",instance:T,count:1,state:j},d.set(v,T)}}}function Lp(e,t){Zi.X(e,t);var i=ws;if(i&&e){var r=Gr(i).hoistableScripts,d=Es(e),v=r.get(d);v||(v=i.querySelector(Sn(d)),v||(e=a({src:e,async:!0},t),(t=vi.get(d))&&gc(e,t),v=i.createElement("script"),yt(v),Tt(v,"link",e),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},r.set(d,v))}}function Tp(e,t){Zi.M(e,t);var i=ws;if(i&&e){var r=Gr(i).hoistableScripts,d=Es(e),v=r.get(d);v||(v=i.querySelector(Sn(d)),v||(e=a({src:e,async:!0,type:"module"},t),(t=vi.get(d))&&gc(e,t),v=i.createElement("script"),yt(v),Tt(v,"link",e),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},r.set(d,v))}}function Df(e,t,i,r){var d=(d=ce.current)?Ua(d):null;if(!d)throw Error(A(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=xs(i.href),i=Gr(d).hoistableStyles,r=i.get(t),r||(r={type:"style",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=xs(i.href);var v=Gr(d).hoistableStyles,T=v.get(e);if(T||(d=d.ownerDocument||d,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(e,T),(v=d.querySelector(mn(e)))&&!v._p&&(T.instance=v,T.state.loading=5),vi.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},vi.set(e,i),v||Mp(d,e,i,T.state))),t&&r===null)throw Error(A(528,""));return T}if(t&&r!==null)throw Error(A(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Es(i),i=Gr(d).hoistableScripts,r=i.get(t),r||(r={type:"script",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(A(444,e))}}function xs(e){return'href="'+li(e)+'"'}function mn(e){return'link[rel="stylesheet"]['+e+"]"}function Lf(e){return a({},e,{"data-precedence":e.precedence,precedence:null})}function Mp(e,t,i,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Tt(t,"link",i),yt(t),e.head.appendChild(t))}function Es(e){return'[src="'+li(e)+'"]'}function Sn(e){return"script[async]"+e}function Tf(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+li(i.href)+'"]');if(r)return t.instance=r,yt(r),r;var d=a({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),yt(r),Tt(r,"style",d),ja(r,i.precedence,e),t.instance=r;case"stylesheet":d=xs(i.href);var v=e.querySelector(mn(d));if(v)return t.state.loading|=4,t.instance=v,yt(v),v;r=Lf(i),(d=vi.get(d))&&_c(r,d),v=(e.ownerDocument||e).createElement("link"),yt(v);var T=v;return T._p=new Promise(function(j,Z){T.onload=j,T.onerror=Z}),Tt(v,"link",r),t.state.loading|=4,ja(v,i.precedence,e),t.instance=v;case"script":return v=Es(i.src),(d=e.querySelector(Sn(v)))?(t.instance=d,yt(d),d):(r=i,(d=vi.get(v))&&(r=a({},i),gc(r,d)),e=e.ownerDocument||e,d=e.createElement("script"),yt(d),Tt(d,"link",r),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(A(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,ja(r,i.precedence,e));return t.instance}function ja(e,t,i){for(var r=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=r.length?r[r.length-1]:null,v=d,T=0;T<r.length;T++){var j=r[T];if(j.dataset.precedence===t)v=j;else if(v!==d)break}v?v.parentNode.insertBefore(e,v.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function _c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function gc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Pa=null;function Mf(e,t,i){if(Pa===null){var r=new Map,d=Pa=new Map;d.set(i,r)}else d=Pa,r=d.get(i),r||(r=new Map,d.set(i,r));if(r.has(e))return r;for(r.set(e,null),i=i.getElementsByTagName(e),d=0;d<i.length;d++){var v=i[d];if(!(v[Bs]||v[Rt]||e==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var T=v.getAttribute(t)||"";T=e+T;var j=r.get(T);j?j.push(v):r.set(T,[v])}}return r}function kf(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function kp(e,t,i){if(i===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 Of(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Op(e,t,i,r){if(i.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var d=xs(r.href),v=t.querySelector(mn(d));if(v){t=v._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fa.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=v,yt(v);return}v=t.ownerDocument||t,r=Lf(r),(d=vi.get(d))&&_c(r,d),v=v.createElement("link"),yt(v);var T=v;T._p=new Promise(function(j,Z){T.onload=j,T.onerror=Z}),Tt(v,"link",r),i.instance=v}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Fa.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var vc=0;function Bp(e,t){return e.stylesheets&&e.count===0&&Wa(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var r=setTimeout(function(){if(e.stylesheets&&Wa(e,e.stylesheets),e.unsuspend){var v=e.unsuspend;e.unsuspend=null,v()}},6e4+t);0<e.imgBytes&&vc===0&&(vc=62500*_p());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Wa(e,e.stylesheets),e.unsuspend)){var v=e.unsuspend;e.unsuspend=null,v()}},(e.imgBytes>vc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(d)}}:null}function Fa(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wa(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var qa=null;function Wa(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,qa=new Map,t.forEach(Hp,e),qa=null,Fa.call(e))}function Hp(e,t){if(!(t.state.loading&4)){var i=qa.get(e);if(i)var r=i.get(null);else{i=new Map,qa.set(e,i);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<d.length;v++){var T=d[v];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(i.set(T.dataset.precedence,T),r=T)}r&&i.set(null,r)}d=t.instance,T=d.getAttribute("data-precedence"),v=i.get(T)||r,v===r&&i.set(null,d),i.set(T,d),this.count++,r=Fa.bind(this),d.addEventListener("load",r),d.addEventListener("error",r),v?v.parentNode.insertBefore(d,v.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var bn={$$typeof:u,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function zp(e,t,i,r,d,v,T,j,Z){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=jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jt(0),this.hiddenUpdates=jt(null),this.identifierPrefix=r,this.onUncaughtError=d,this.onCaughtError=v,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function Bf(e,t,i,r,d,v,T,j,Z,se,le,de){return e=new zp(e,t,i,T,Z,se,le,de,j),t=1,v===!0&&(t|=24),v=Qt(3,null,null,t),e.current=v,v.stateNode=e,t=Xo(),t.refCount++,e.pooledCache=t,t.refCount++,v.memoizedState={element:r,isDehydrated:i,cache:t},Jo(v),e}function Hf(e){return e?(e=is,e):is}function zf(e,t,i,r,d,v){d=Hf(d),r.context===null?r.context=d:r.pendingContext=d,r=or(t),r.payload={element:i},v=v===void 0?null:v,v!==null&&(r.callback=v),i=lr(e,r,t),i!==null&&(Yt(i,e,t),Zs(i,e,t))}function If(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function pc(e,t){If(e,t),(e=e.alternate)&&If(e,t)}function Nf(e){if(e.tag===13||e.tag===31){var t=Lr(e,67108864);t!==null&&Yt(t,e,67108864),pc(e,67108864)}}function Uf(e){if(e.tag===13||e.tag===31){var t=ri();t=ki(t);var i=Lr(e,t);i!==null&&Yt(i,e,t),pc(e,t)}}var $a=!0;function Ip(e,t,i,r){var d=W.T;W.T=null;var v=$.p;try{$.p=2,mc(e,t,i,r)}finally{$.p=v,W.T=d}}function Np(e,t,i,r){var d=W.T;W.T=null;var v=$.p;try{$.p=8,mc(e,t,i,r)}finally{$.p=v,W.T=d}}function mc(e,t,i,r){if($a){var d=Sc(r);if(d===null)sc(e,t,r,Ga,i),Pf(e,r);else if(jp(d,e,t,i,r))r.stopPropagation();else if(Pf(e,r),t&4&&-1<Up.indexOf(e)){for(;d!==null;){var v=$r(d);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var T=rt(v.pendingLanes);if(T!==0){var j=v;for(j.pendingLanes|=2,j.entangledLanes|=2;T;){var Z=1<<31-vt(T);j.entanglements[1]|=Z,T&=~Z}Li(v),(Fe&6)===0&&(Da=we()+500,_n(0))}}break;case 31:case 13:j=Lr(v,2),j!==null&&Yt(j,v,2),Ta(),pc(v,2)}if(v=Sc(r),v===null&&sc(e,t,r,Ga,i),v===d)break;d=v}d!==null&&r.stopPropagation()}else sc(e,t,r,null,i)}}function Sc(e){return e=yo(e),bc(e)}var Ga=null;function bc(e){if(Ga=null,e=Wr(e),e!==null){var t=N(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=z(t),e!==null)return e;e=null}else if(i===31){if(e=s(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ga=e,null}function jf(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"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ke()){case qe:return 2;case gt:return 8;case Ze:case ct:return 32;case Qe:return 268435456;default:return 32}default:return 32}}var yc=!1,Sr=null,br=null,yr=null,yn=new Map,Cn=new Map,Cr=[],Up="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 Pf(e,t){switch(e){case"focusin":case"focusout":Sr=null;break;case"dragenter":case"dragleave":br=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":yn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cn.delete(t.pointerId)}}function wn(e,t,i,r,d,v){return e===null||e.nativeEvent!==v?(e={blockedOn:t,domEventName:i,eventSystemFlags:r,nativeEvent:v,targetContainers:[d]},t!==null&&(t=$r(t),t!==null&&Nf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function jp(e,t,i,r,d){switch(t){case"focusin":return Sr=wn(Sr,e,t,i,r,d),!0;case"dragenter":return br=wn(br,e,t,i,r,d),!0;case"mouseover":return yr=wn(yr,e,t,i,r,d),!0;case"pointerover":var v=d.pointerId;return yn.set(v,wn(yn.get(v)||null,e,t,i,r,d)),!0;case"gotpointercapture":return v=d.pointerId,Cn.set(v,wn(Cn.get(v)||null,e,t,i,r,d)),!0}return!1}function Ff(e){var t=Wr(e.target);if(t!==null){var i=N(t);if(i!==null){if(t=i.tag,t===13){if(t=z(i),t!==null){e.blockedOn=t,er(e.priority,function(){Uf(i)});return}}else if(t===31){if(t=s(i),t!==null){e.blockedOn=t,er(e.priority,function(){Uf(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ya(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Sc(e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);bo=r,i.target.dispatchEvent(r),bo=null}else return t=$r(i),t!==null&&Nf(t),e.blockedOn=i,!1;t.shift()}return!0}function qf(e,t,i){Ya(e)&&i.delete(t)}function Pp(){yc=!1,Sr!==null&&Ya(Sr)&&(Sr=null),br!==null&&Ya(br)&&(br=null),yr!==null&&Ya(yr)&&(yr=null),yn.forEach(qf),Cn.forEach(qf)}function Va(e,t){e.blockedOn===t&&(e.blockedOn=null,yc||(yc=!0,f.unstable_scheduleCallback(f.unstable_NormalPriority,Pp)))}var Xa=null;function Wf(e){Xa!==e&&(Xa=e,f.unstable_scheduleCallback(f.unstable_NormalPriority,function(){Xa===e&&(Xa=null);for(var t=0;t<e.length;t+=3){var i=e[t],r=e[t+1],d=e[t+2];if(typeof r!="function"){if(bc(r||i)===null)continue;break}var v=$r(i);v!==null&&(e.splice(t,3),t-=3,Sl(v,{pending:!0,data:d,method:i.method,action:r},r,d))}}))}function Rs(e){function t(Z){return Va(Z,e)}Sr!==null&&Va(Sr,e),br!==null&&Va(br,e),yr!==null&&Va(yr,e),yn.forEach(t),Cn.forEach(t);for(var i=0;i<Cr.length;i++){var r=Cr[i];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cr.length&&(i=Cr[0],i.blockedOn===null);)Ff(i),i.blockedOn===null&&Cr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(r=0;r<i.length;r+=3){var d=i[r],v=i[r+1],T=d[Pt]||null;if(typeof v=="function")T||Wf(i);else if(T){var j=null;if(v&&v.hasAttribute("formAction")){if(d=v,T=v[Pt]||null)j=T.formAction;else if(bc(d)!==null)continue}else j=T.action;typeof j=="function"?i[r+1]=j:(i.splice(r,3),r-=3),Wf(i)}}}function $f(){function e(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(T){return d=T})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),r||setTimeout(i,20)}function i(){if(!r&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function Cc(e){this._internalRoot=e}Ka.prototype.render=Cc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(A(409));var i=t.current,r=ri();zf(i,r,e,t,null,null)},Ka.prototype.unmount=Cc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zf(e.current,2,null,e,null,null),Ta(),t[qr]=null}};function Ka(e){this._internalRoot=e}Ka.prototype.unstable_scheduleHydration=function(e){if(e){var t=bi();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Cr.length&&t!==0&&t<Cr[i].priority;i++);Cr.splice(i,0,e),i===0&&Ff(e)}};var Gf=C.version;if(Gf!=="19.2.4")throw Error(A(527,Gf,"19.2.4"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(A(188)):(e=Object.keys(e).join(","),Error(A(268,e)));return e=h(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Fp={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Za=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Za.isDisabled&&Za.supportsFiber)try{Xt=Za.inject(Fp),ut=Za}catch{}}return En.createRoot=function(e,t){if(!H(e))throw Error(A(299));var i=!1,r="",d=Qh,v=Jh,T=ed;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(v=t.onCaughtError),t.onRecoverableError!==void 0&&(T=t.onRecoverableError)),t=Bf(e,1,!1,null,null,i,r,null,d,v,T,$f),e[qr]=t.current,rc(e),new Cc(t)},En.hydrateRoot=function(e,t,i){if(!H(e))throw Error(A(299));var r=!1,d="",v=Qh,T=Jh,j=ed,Z=null;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(v=i.onUncaughtError),i.onCaughtError!==void 0&&(T=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError),i.formState!==void 0&&(Z=i.formState)),t=Bf(e,1,!0,t,i??null,r,d,Z,v,T,j,$f),t.context=Hf(null),i=t.current,r=ri(),r=ki(r),d=or(r),d.callback=null,lr(i,d,r),i=r,t.current.lanes=i,si(t,i),Li(t),e[qr]=t.current,rc(e),new Ka(t)},En.version="19.2.4",En}var i_;function Qp(){if(i_)return Ec.exports;i_=1;function f(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(C){console.error(C)}}return f(),Ec.exports=Zp(),Ec.exports}var Jp=Qp();const r_=f=>{let C;const D=new Set,A=(h,g)=>{const a=typeof h=="function"?h(C):h;if(!Object.is(a,C)){const p=C;C=g??(typeof a!="object"||a===null)?a:Object.assign({},C,a),D.forEach(m=>m(C,p))}},H=()=>C,s={setState:A,getState:H,getInitialState:()=>c,subscribe:h=>(D.add(h),()=>D.delete(h))},c=C=f(A,H,s);return s},e0=(f=>f?r_(f):r_),t0=f=>f;function i0(f,C=t0){const D=xt.useSyncExternalStore(f.subscribe,xt.useCallback(()=>C(f.getState()),[f,C]),xt.useCallback(()=>C(f.getInitialState()),[f,C]));return xt.useDebugValue(D),D}const s_=f=>{const C=e0(f),D=A=>i0(C,A);return Object.assign(D,C),D},P_=(f=>f?s_(f):s_),at=P_(f=>({isAuthenticated:!1,isCheckingAuth:!0,setAuthenticated:C=>f({isAuthenticated:C,isCheckingAuth:!1}),setCheckingAuth:C=>f({isCheckingAuth:C}),connectionStatus:"disconnected",instanceConnectionStatus:{},setConnectionStatus:C=>f({connectionStatus:C}),setInstanceConnectionStatus:(C,D)=>f(A=>({instanceConnectionStatus:{...A.instanceConnectionStatus,[C]:D}})),removeInstanceConnectionStatus:C=>f(D=>{const{[C]:A,...H}=D.instanceConnectionStatus;return{instanceConnectionStatus:H}}),sessionStatus:"idle",setSessionStatus:C=>f({sessionStatus:C}),cachedToken:null,setCachedToken:C=>f({cachedToken:C}),ipChangeInfo:null,setIpChangeInfo:C=>f({ipChangeInfo:C}),toastMessage:null,showToast:C=>f({toastMessage:C}),hideToast:()=>f({toastMessage:null})})),zn="/api";async function Qi(f){const C=await fetch(`${zn}/auth`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:f})});if(C.status===429)throw new Error("Too many attempts. Try again later.");return C.ok}async function r0(){const f=await fetch(`${zn}/status`,{credentials:"include"});if(f.status===401)throw new Error("Unauthorized");return f.json()}async function F_(){const f=await fetch(`${zn}/config`,{credentials:"include"});if(f.status===401)throw new Error("Unauthorized");if(!f.ok)throw new Error(`Config fetch failed: ${f.status}`);return f.json()}async function s0(f){const C=await fetch(`${zn}/config`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(f)});if(C.status===401)throw new Error("Unauthorized");return C.ok}async function n0(f,C){const D=await fetch(`${zn}/config/notifications/${f}/enabled`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({enabled:C})});if(D.status===401)throw new Error("Unauthorized");if(!D.ok){const A=await D.json().catch(()=>({}));throw new Error(A.error||`Failed to update channel status: ${D.status}`)}return D.json()}const Yc="claude_remote_token";function q_(f){sessionStorage.setItem(Yc,f)}function Ds(){return sessionStorage.getItem(Yc)}function W_(){sessionStorage.removeItem(Yc)}function a0(){const[f,C]=q.useState(null),[D,A]=q.useState(!1),H=at(c=>c.setAuthenticated),N=at(c=>c.setCachedToken),z=q.useCallback(async c=>{C(null),A(!0);try{await Qi(c)?(H(!0),N(c),q_(c)):C("Invalid token")}catch(h){C(h instanceof Error?h.message:"Authentication failed")}finally{A(!1)}},[H,N]),s=q.useCallback(()=>{H(!1),N(null),W_()},[H,N]);return{login:z,logout:s,error:f,loading:D}}function o0(){const[f,C]=q.useState(""),[D,A]=q.useState(!1),{login:H,error:N,loading:z}=a0();q.useEffect(()=>{const h=sessionStorage.getItem("prefill_token");h&&(C(h),sessionStorage.removeItem("prefill_token"))},[]);const s=h=>{h.preventDefault(),f.trim()&&H(f.trim())},c=h=>{h.key==="Enter"&&f.trim()&&H(f.trim())};return V.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"var(--bg-primary)"},children:V.jsxs("form",{onSubmit:s,autoComplete:"off",style:{width:"100%",maxWidth:400,display:"flex",flexDirection:"column",gap:16},children:[V.jsxs("div",{style:{textAlign:"center",marginBottom:8},children:[V.jsx("h1",{style:{fontSize:24,fontWeight:700,marginBottom:8},children:"Claude Code Remote"}),V.jsx("p",{style:{fontSize:14,color:"var(--text-secondary)"},children:"Enter the token shown on your PC terminal"})]}),V.jsxs("div",{style:{position:"relative"},children:[V.jsx("input",{type:"text",value:f,onChange:h=>C(h.target.value),onKeyDown:c,placeholder:"Paste token here…","aria-label":"Authentication token",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",style:{width:"100%",height:48,padding:"0 48px 0 16px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",fontSize:16,lineHeight:"48px",boxSizing:"border-box",WebkitTextSecurity:D?"none":"disc"}}),V.jsx("button",{type:"button",onClick:()=>A(!D),"aria-label":D?"Hide token":"Show token",style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",padding:8,cursor:"pointer",color:"var(--text-secondary)",display:"flex",alignItems:"center",justifyContent:"center"},children:D?V.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[V.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),V.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):V.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[V.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),V.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),N&&V.jsx("div",{style:{color:"var(--status-error)",fontSize:14,textAlign:"center"},children:N}),V.jsx("button",{type:"submit",disabled:z||!f.trim(),style:{height:48,borderRadius:8,background:f.trim()?"var(--status-running)":"var(--bg-tertiary)",color:f.trim()?"#fff":"var(--text-muted)",fontWeight:600,fontSize:16,transition:"background 0.15s",opacity:z?.7:1},children:z?"Authenticating…":"Connect"})]})})}const zt=P_(f=>({instances:[],activeInstanceId:null,currentHostOverride:null,setInstances:C=>f({instances:C}),setActiveInstanceId:C=>f({activeInstanceId:C}),setCurrentHostOverride:C=>f({currentHostOverride:C})})),l0=[{label:"Esc",data:"\x1B",enabled:!0},{label:"Enter",data:"\r",enabled:!0},{label:"Tab",data:" ",enabled:!0},{label:"↑",data:"\x1B[A",enabled:!0},{label:"↓",data:"\x1B[B",enabled:!0},{label:"←",data:"\x1B[D",enabled:!0},{label:"→",data:"\x1B[C",enabled:!0},{label:"S-Tab",data:"\x1B[Z",enabled:!0,desc:"Shift+Tab, 向前切换"}],c0=[{label:"/clear",command:"/clear",enabled:!0},{label:"/compact",command:"/compact",enabled:!0},{label:"/resume",command:"/resume",enabled:!0},{label:"/stats",command:"/stats",enabled:!0},{label:"/exit",command:"/exit",enabled:!0},{label:"/commit-commands:commit",command:"/commit-commands:commit",enabled:!0},{label:"/feature-dev:feature-dev",command:"/feature-dev:feature-dev",enabled:!0},{label:"/auto-doc",command:"/auto-doc",enabled:!0},{label:"/code-review-expert",command:"/code-review-expert",enabled:!0},{label:"/systematic-debugging",command:"/systematic-debugging",enabled:!0}],u0={dingtalk:{displayName:"DingTalk",icon:"dingtalk",description:"Send notifications to DingTalk group via robot webhook",helpUrl:"https://open.dingtalk.com/document/robots/custom-robot-access",implemented:!0},email:{displayName:"Email",icon:"email",description:"Send notifications via email",implemented:!1},slack:{displayName:"Slack",icon:"slack",description:"Send notifications to Slack channel via webhook",implemented:!1},wechat_work:{displayName:"WeChat",icon:"wechat-work",description:"Send notifications to WeChat via Server酱³",helpUrl:"https://sct.ftqq.com/sendkey",implemented:!0}},$_=/^https:\/\/oapi\.dingtalk\.com\/robot\/send\?access_token=/,G_=/^SCT[a-zA-Z0-9]{10,}$/,Y_=l0.map(({enabled:f,desc:C,...D})=>D),V_=c0.map(({enabled:f,desc:C,...D})=>D);function n_(f){return f.filter(C=>C.enabled).map(({enabled:C,desc:D,...A})=>A)}let X_=0;const Uc=new Set;function h0(f){return Uc.add(f),()=>Uc.delete(f)}function d0(){return X_}function K_(){X_++,Uc.forEach(f=>f())}function f0(){const[f,C]=q.useState(null),[D,A]=q.useState(null),[H,N]=q.useState(!0),z=q.useSyncExternalStore(h0,d0),s=q.useCallback(async()=>{N(!0);try{const a=await F_();C(a.config),A(a.configPath)}catch{C(null)}finally{N(!1)}},[]);q.useEffect(()=>{s()},[s,z]);const c=f!=null&&f.shortcuts?n_(f.shortcuts):Y_,h=f!=null&&f.commands?n_(f.commands):V_,g=q.useCallback(()=>{K_()},[]);return{shortcuts:c,commands:h,configPath:D,isLoading:H,reload:g}}var Rn=j_();function _0(){for(var f=arguments.length,C=new Array(f),D=0;D<f;D++)C[D]=arguments[D];return q.useMemo(()=>A=>{C.forEach(H=>H(A))},C)}const co=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ts(f){const C=Object.prototype.toString.call(f);return C==="[object Window]"||C==="[object global]"}function Vc(f){return"nodeType"in f}function Vt(f){var C,D;return f?Ts(f)?f:Vc(f)&&(C=(D=f.ownerDocument)==null?void 0:D.defaultView)!=null?C:window:window}function Xc(f){const{Document:C}=Vt(f);return f instanceof C}function In(f){return Ts(f)?!1:f instanceof Vt(f).HTMLElement}function Z_(f){return f instanceof Vt(f).SVGElement}function Ms(f){return f?Ts(f)?f.document:Vc(f)?Xc(f)?f:In(f)||Z_(f)?f.ownerDocument:document:document:document}const Ti=co?q.useLayoutEffect:q.useEffect;function Kc(f){const C=q.useRef(f);return Ti(()=>{C.current=f}),q.useCallback(function(){for(var D=arguments.length,A=new Array(D),H=0;H<D;H++)A[H]=arguments[H];return C.current==null?void 0:C.current(...A)},[])}function g0(){const f=q.useRef(null),C=q.useCallback((A,H)=>{f.current=setInterval(A,H)},[]),D=q.useCallback(()=>{f.current!==null&&(clearInterval(f.current),f.current=null)},[]);return[C,D]}function kn(f,C){C===void 0&&(C=[f]);const D=q.useRef(f);return Ti(()=>{D.current!==f&&(D.current=f)},C),D}function Nn(f,C){const D=q.useRef();return q.useMemo(()=>{const A=f(D.current);return D.current=A,A},[...C])}function no(f){const C=Kc(f),D=q.useRef(null),A=q.useCallback(H=>{H!==D.current&&(C==null||C(H,D.current)),D.current=H},[]);return[D,A]}function jc(f){const C=q.useRef();return q.useEffect(()=>{C.current=f},[f]),C.current}let Lc={};function Un(f,C){return q.useMemo(()=>{if(C)return C;const D=Lc[f]==null?0:Lc[f]+1;return Lc[f]=D,f+"-"+D},[f,C])}function Q_(f){return function(C){for(var D=arguments.length,A=new Array(D>1?D-1:0),H=1;H<D;H++)A[H-1]=arguments[H];return A.reduce((N,z)=>{const s=Object.entries(z);for(const[c,h]of s){const g=N[c];g!=null&&(N[c]=g+f*h)}return N},{...C})}}const As=Q_(1),On=Q_(-1);function v0(f){return"clientX"in f&&"clientY"in f}function Zc(f){if(!f)return!1;const{KeyboardEvent:C}=Vt(f.target);return C&&f instanceof C}function p0(f){if(!f)return!1;const{TouchEvent:C}=Vt(f.target);return C&&f instanceof C}function Pc(f){if(p0(f)){if(f.touches&&f.touches.length){const{clientX:C,clientY:D}=f.touches[0];return{x:C,y:D}}else if(f.changedTouches&&f.changedTouches.length){const{clientX:C,clientY:D}=f.changedTouches[0];return{x:C,y:D}}}return v0(f)?{x:f.clientX,y:f.clientY}:null}const Bn=Object.freeze({Translate:{toString(f){if(!f)return;const{x:C,y:D}=f;return"translate3d("+(C?Math.round(C):0)+"px, "+(D?Math.round(D):0)+"px, 0)"}},Scale:{toString(f){if(!f)return;const{scaleX:C,scaleY:D}=f;return"scaleX("+C+") scaleY("+D+")"}},Transform:{toString(f){if(f)return[Bn.Translate.toString(f),Bn.Scale.toString(f)].join(" ")}},Transition:{toString(f){let{property:C,duration:D,easing:A}=f;return C+" "+D+"ms "+A}}}),a_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function m0(f){return f.matches(a_)?f:f.querySelector(a_)}const S0={display:"none"};function b0(f){let{id:C,value:D}=f;return xt.createElement("div",{id:C,style:S0},D)}function y0(f){let{id:C,announcement:D,ariaLiveType:A="assertive"}=f;const H={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return xt.createElement("div",{id:C,style:H,role:"status","aria-live":A,"aria-atomic":!0},D)}function C0(){const[f,C]=q.useState("");return{announce:q.useCallback(A=>{A!=null&&C(A)},[]),announcement:f}}const J_=q.createContext(null);function w0(f){const C=q.useContext(J_);q.useEffect(()=>{if(!C)throw new Error("useDndMonitor must be used within a children of <DndContext>");return C(f)},[f,C])}function x0(){const[f]=q.useState(()=>new Set),C=q.useCallback(A=>(f.add(A),()=>f.delete(A)),[f]);return[q.useCallback(A=>{let{type:H,event:N}=A;f.forEach(z=>{var s;return(s=z[H])==null?void 0:s.call(z,N)})},[f]),C]}const E0={draggable:`
50
+ To pick up a draggable item, press the space bar.
51
+ While dragging, use the arrow keys to move the item.
52
+ Press space again to drop the item in its new position, or press escape to cancel.
53
+ `},R0={onDragStart(f){let{active:C}=f;return"Picked up draggable item "+C.id+"."},onDragOver(f){let{active:C,over:D}=f;return D?"Draggable item "+C.id+" was moved over droppable area "+D.id+".":"Draggable item "+C.id+" is no longer over a droppable area."},onDragEnd(f){let{active:C,over:D}=f;return D?"Draggable item "+C.id+" was dropped over droppable area "+D.id:"Draggable item "+C.id+" was dropped."},onDragCancel(f){let{active:C}=f;return"Dragging was cancelled. Draggable item "+C.id+" was dropped."}};function A0(f){let{announcements:C=R0,container:D,hiddenTextDescribedById:A,screenReaderInstructions:H=E0}=f;const{announce:N,announcement:z}=C0(),s=Un("DndLiveRegion"),[c,h]=q.useState(!1);if(q.useEffect(()=>{h(!0)},[]),w0(q.useMemo(()=>({onDragStart(a){let{active:p}=a;N(C.onDragStart({active:p}))},onDragMove(a){let{active:p,over:m}=a;C.onDragMove&&N(C.onDragMove({active:p,over:m}))},onDragOver(a){let{active:p,over:m}=a;N(C.onDragOver({active:p,over:m}))},onDragEnd(a){let{active:p,over:m}=a;N(C.onDragEnd({active:p,over:m}))},onDragCancel(a){let{active:p,over:m}=a;N(C.onDragCancel({active:p,over:m}))}}),[N,C])),!c)return null;const g=xt.createElement(xt.Fragment,null,xt.createElement(b0,{id:A,value:H.draggable}),xt.createElement(y0,{id:s,announcement:z}));return D?Rn.createPortal(g,D):g}var St;(function(f){f.DragStart="dragStart",f.DragMove="dragMove",f.DragEnd="dragEnd",f.DragCancel="dragCancel",f.DragOver="dragOver",f.RegisterDroppable="registerDroppable",f.SetDroppableDisabled="setDroppableDisabled",f.UnregisterDroppable="unregisterDroppable"})(St||(St={}));function ao(){}function o_(f,C){return q.useMemo(()=>({sensor:f,options:C??{}}),[f,C])}function D0(){for(var f=arguments.length,C=new Array(f),D=0;D<f;D++)C[D]=arguments[D];return q.useMemo(()=>[...C].filter(A=>A!=null),[...C])}const xi=Object.freeze({x:0,y:0});function eg(f,C){return Math.sqrt(Math.pow(f.x-C.x,2)+Math.pow(f.y-C.y,2))}function tg(f,C){let{data:{value:D}}=f,{data:{value:A}}=C;return D-A}function L0(f,C){let{data:{value:D}}=f,{data:{value:A}}=C;return A-D}function l_(f){let{left:C,top:D,height:A,width:H}=f;return[{x:C,y:D},{x:C+H,y:D},{x:C,y:D+A},{x:C+H,y:D+A}]}function ig(f,C){if(!f||f.length===0)return null;const[D]=f;return D[C]}function c_(f,C,D){return C===void 0&&(C=f.left),D===void 0&&(D=f.top),{x:C+f.width*.5,y:D+f.height*.5}}const rg=f=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=f;const H=c_(C,C.left,C.top),N=[];for(const z of A){const{id:s}=z,c=D.get(s);if(c){const h=eg(c_(c),H);N.push({id:s,data:{droppableContainer:z,value:h}})}}return N.sort(tg)},T0=f=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=f;const H=l_(C),N=[];for(const z of A){const{id:s}=z,c=D.get(s);if(c){const h=l_(c),g=H.reduce((p,m,w)=>p+eg(h[w],m),0),a=Number((g/4).toFixed(4));N.push({id:s,data:{droppableContainer:z,value:a}})}}return N.sort(tg)};function M0(f,C){const D=Math.max(C.top,f.top),A=Math.max(C.left,f.left),H=Math.min(C.left+C.width,f.left+f.width),N=Math.min(C.top+C.height,f.top+f.height),z=H-A,s=N-D;if(A<H&&D<N){const c=C.width*C.height,h=f.width*f.height,g=z*s,a=g/(c+h-g);return Number(a.toFixed(4))}return 0}const k0=f=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=f;const H=[];for(const N of A){const{id:z}=N,s=D.get(z);if(s){const c=M0(s,C);c>0&&H.push({id:z,data:{droppableContainer:N,value:c}})}}return H.sort(L0)};function O0(f,C,D){return{...f,scaleX:C&&D?C.width/D.width:1,scaleY:C&&D?C.height/D.height:1}}function sg(f,C){return f&&C?{x:f.left-C.left,y:f.top-C.top}:xi}function B0(f){return function(D){for(var A=arguments.length,H=new Array(A>1?A-1:0),N=1;N<A;N++)H[N-1]=arguments[N];return H.reduce((z,s)=>({...z,top:z.top+f*s.y,bottom:z.bottom+f*s.y,left:z.left+f*s.x,right:z.right+f*s.x}),{...D})}}const H0=B0(1);function z0(f){if(f.startsWith("matrix3d(")){const C=f.slice(9,-1).split(/, /);return{x:+C[12],y:+C[13],scaleX:+C[0],scaleY:+C[5]}}else if(f.startsWith("matrix(")){const C=f.slice(7,-1).split(/, /);return{x:+C[4],y:+C[5],scaleX:+C[0],scaleY:+C[3]}}return null}function I0(f,C,D){const A=z0(C);if(!A)return f;const{scaleX:H,scaleY:N,x:z,y:s}=A,c=f.left-z-(1-H)*parseFloat(D),h=f.top-s-(1-N)*parseFloat(D.slice(D.indexOf(" ")+1)),g=H?f.width/H:f.width,a=N?f.height/N:f.height;return{width:g,height:a,top:h,right:c+g,bottom:h+a,left:c}}const N0={ignoreTransform:!1};function ks(f,C){C===void 0&&(C=N0);let D=f.getBoundingClientRect();if(C.ignoreTransform){const{transform:h,transformOrigin:g}=Vt(f).getComputedStyle(f);h&&(D=I0(D,h,g))}const{top:A,left:H,width:N,height:z,bottom:s,right:c}=D;return{top:A,left:H,width:N,height:z,bottom:s,right:c}}function u_(f){return ks(f,{ignoreTransform:!0})}function U0(f){const C=f.innerWidth,D=f.innerHeight;return{top:0,left:0,right:C,bottom:D,width:C,height:D}}function j0(f,C){return C===void 0&&(C=Vt(f).getComputedStyle(f)),C.position==="fixed"}function P0(f,C){C===void 0&&(C=Vt(f).getComputedStyle(f));const D=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(H=>{const N=C[H];return typeof N=="string"?D.test(N):!1})}function uo(f,C){const D=[];function A(H){if(C!=null&&D.length>=C||!H)return D;if(Xc(H)&&H.scrollingElement!=null&&!D.includes(H.scrollingElement))return D.push(H.scrollingElement),D;if(!In(H)||Z_(H)||D.includes(H))return D;const N=Vt(f).getComputedStyle(H);return H!==f&&P0(H,N)&&D.push(H),j0(H,N)?D:A(H.parentNode)}return f?A(f):D}function ng(f){const[C]=uo(f,1);return C??null}function Tc(f){return!co||!f?null:Ts(f)?f:Vc(f)?Xc(f)||f===Ms(f).scrollingElement?window:In(f)?f:null:null}function ag(f){return Ts(f)?f.scrollX:f.scrollLeft}function og(f){return Ts(f)?f.scrollY:f.scrollTop}function Fc(f){return{x:ag(f),y:og(f)}}var wt;(function(f){f[f.Forward=1]="Forward",f[f.Backward=-1]="Backward"})(wt||(wt={}));function lg(f){return!co||!f?!1:f===document.scrollingElement}function cg(f){const C={x:0,y:0},D=lg(f)?{height:window.innerHeight,width:window.innerWidth}:{height:f.clientHeight,width:f.clientWidth},A={x:f.scrollWidth-D.width,y:f.scrollHeight-D.height},H=f.scrollTop<=C.y,N=f.scrollLeft<=C.x,z=f.scrollTop>=A.y,s=f.scrollLeft>=A.x;return{isTop:H,isLeft:N,isBottom:z,isRight:s,maxScroll:A,minScroll:C}}const F0={x:.2,y:.2};function q0(f,C,D,A,H){let{top:N,left:z,right:s,bottom:c}=D;A===void 0&&(A=10),H===void 0&&(H=F0);const{isTop:h,isBottom:g,isLeft:a,isRight:p}=cg(f),m={x:0,y:0},w={x:0,y:0},_={height:C.height*H.y,width:C.width*H.x};return!h&&N<=C.top+_.height?(m.y=wt.Backward,w.y=A*Math.abs((C.top+_.height-N)/_.height)):!g&&c>=C.bottom-_.height&&(m.y=wt.Forward,w.y=A*Math.abs((C.bottom-_.height-c)/_.height)),!p&&s>=C.right-_.width?(m.x=wt.Forward,w.x=A*Math.abs((C.right-_.width-s)/_.width)):!a&&z<=C.left+_.width&&(m.x=wt.Backward,w.x=A*Math.abs((C.left+_.width-z)/_.width)),{direction:m,speed:w}}function W0(f){if(f===document.scrollingElement){const{innerWidth:N,innerHeight:z}=window;return{top:0,left:0,right:N,bottom:z,width:N,height:z}}const{top:C,left:D,right:A,bottom:H}=f.getBoundingClientRect();return{top:C,left:D,right:A,bottom:H,width:f.clientWidth,height:f.clientHeight}}function ug(f){return f.reduce((C,D)=>As(C,Fc(D)),xi)}function $0(f){return f.reduce((C,D)=>C+ag(D),0)}function G0(f){return f.reduce((C,D)=>C+og(D),0)}function Y0(f,C){if(C===void 0&&(C=ks),!f)return;const{top:D,left:A,bottom:H,right:N}=C(f);ng(f)&&(H<=0||N<=0||D>=window.innerHeight||A>=window.innerWidth)&&f.scrollIntoView({block:"center",inline:"center"})}const V0=[["x",["left","right"],$0],["y",["top","bottom"],G0]];class Qc{constructor(C,D){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const A=uo(D),H=ug(A);this.rect={...C},this.width=C.width,this.height=C.height;for(const[N,z,s]of V0)for(const c of z)Object.defineProperty(this,c,{get:()=>{const h=s(A),g=H[N]-h;return this.rect[c]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Dn{constructor(C){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(D=>{var A;return(A=this.target)==null?void 0:A.removeEventListener(...D)})},this.target=C}add(C,D,A){var H;(H=this.target)==null||H.addEventListener(C,D,A),this.listeners.push([C,D,A])}}function X0(f){const{EventTarget:C}=Vt(f);return f instanceof C?f:Ms(f)}function Mc(f,C){const D=Math.abs(f.x),A=Math.abs(f.y);return typeof C=="number"?Math.sqrt(D**2+A**2)>C:"x"in C&&"y"in C?D>C.x&&A>C.y:"x"in C?D>C.x:"y"in C?A>C.y:!1}var mi;(function(f){f.Click="click",f.DragStart="dragstart",f.Keydown="keydown",f.ContextMenu="contextmenu",f.Resize="resize",f.SelectionChange="selectionchange",f.VisibilityChange="visibilitychange"})(mi||(mi={}));function h_(f){f.preventDefault()}function K0(f){f.stopPropagation()}var Ne;(function(f){f.Space="Space",f.Down="ArrowDown",f.Right="ArrowRight",f.Left="ArrowLeft",f.Up="ArrowUp",f.Esc="Escape",f.Enter="Enter",f.Tab="Tab"})(Ne||(Ne={}));const hg={start:[Ne.Space,Ne.Enter],cancel:[Ne.Esc],end:[Ne.Space,Ne.Enter,Ne.Tab]},Z0=(f,C)=>{let{currentCoordinates:D}=C;switch(f.code){case Ne.Right:return{...D,x:D.x+25};case Ne.Left:return{...D,x:D.x-25};case Ne.Down:return{...D,y:D.y+25};case Ne.Up:return{...D,y:D.y-25}}};class Jc{constructor(C){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=C;const{event:{target:D}}=C;this.props=C,this.listeners=new Dn(Ms(D)),this.windowListeners=new Dn(Vt(D)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(mi.Resize,this.handleCancel),this.windowListeners.add(mi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(mi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:C,onStart:D}=this.props,A=C.node.current;A&&Y0(A),D(xi)}handleKeyDown(C){if(Zc(C)){const{active:D,context:A,options:H}=this.props,{keyboardCodes:N=hg,coordinateGetter:z=Z0,scrollBehavior:s="smooth"}=H,{code:c}=C;if(N.end.includes(c)){this.handleEnd(C);return}if(N.cancel.includes(c)){this.handleCancel(C);return}const{collisionRect:h}=A.current,g=h?{x:h.left,y:h.top}:xi;this.referenceCoordinates||(this.referenceCoordinates=g);const a=z(C,{active:D,context:A.current,currentCoordinates:g});if(a){const p=On(a,g),m={x:0,y:0},{scrollableAncestors:w}=A.current;for(const _ of w){const n=C.code,{isTop:o,isRight:l,isLeft:u,isBottom:S,maxScroll:E,minScroll:b}=cg(_),x=W0(_),y={x:Math.min(n===Ne.Right?x.right-x.width/2:x.right,Math.max(n===Ne.Right?x.left:x.left+x.width/2,a.x)),y:Math.min(n===Ne.Down?x.bottom-x.height/2:x.bottom,Math.max(n===Ne.Down?x.top:x.top+x.height/2,a.y))},R=n===Ne.Right&&!l||n===Ne.Left&&!u,L=n===Ne.Down&&!S||n===Ne.Up&&!o;if(R&&y.x!==a.x){const I=_.scrollLeft+p.x,M=n===Ne.Right&&I<=E.x||n===Ne.Left&&I>=b.x;if(M&&!p.y){_.scrollTo({left:I,behavior:s});return}M?m.x=_.scrollLeft-I:m.x=n===Ne.Right?_.scrollLeft-E.x:_.scrollLeft-b.x,m.x&&_.scrollBy({left:-m.x,behavior:s});break}else if(L&&y.y!==a.y){const I=_.scrollTop+p.y,M=n===Ne.Down&&I<=E.y||n===Ne.Up&&I>=b.y;if(M&&!p.x){_.scrollTo({top:I,behavior:s});return}M?m.y=_.scrollTop-I:m.y=n===Ne.Down?_.scrollTop-E.y:_.scrollTop-b.y,m.y&&_.scrollBy({top:-m.y,behavior:s});break}}this.handleMove(C,As(On(a,this.referenceCoordinates),m))}}}handleMove(C,D){const{onMove:A}=this.props;C.preventDefault(),A(D)}handleEnd(C){const{onEnd:D}=this.props;C.preventDefault(),this.detach(),D()}handleCancel(C){const{onCancel:D}=this.props;C.preventDefault(),this.detach(),D()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Jc.activators=[{eventName:"onKeyDown",handler:(f,C,D)=>{let{keyboardCodes:A=hg,onActivation:H}=C,{active:N}=D;const{code:z}=f.nativeEvent;if(A.start.includes(z)){const s=N.activatorNode.current;return s&&f.target!==s?!1:(f.preventDefault(),H==null||H({event:f.nativeEvent}),!0)}return!1}}];function d_(f){return!!(f&&"distance"in f)}function f_(f){return!!(f&&"delay"in f)}class eu{constructor(C,D,A){var H;A===void 0&&(A=X0(C.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=C,this.events=D;const{event:N}=C,{target:z}=N;this.props=C,this.events=D,this.document=Ms(z),this.documentListeners=new Dn(this.document),this.listeners=new Dn(A),this.windowListeners=new Dn(Vt(z)),this.initialCoordinates=(H=Pc(N))!=null?H:xi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:C,props:{options:{activationConstraint:D,bypassActivationConstraint:A}}}=this;if(this.listeners.add(C.move.name,this.handleMove,{passive:!1}),this.listeners.add(C.end.name,this.handleEnd),C.cancel&&this.listeners.add(C.cancel.name,this.handleCancel),this.windowListeners.add(mi.Resize,this.handleCancel),this.windowListeners.add(mi.DragStart,h_),this.windowListeners.add(mi.VisibilityChange,this.handleCancel),this.windowListeners.add(mi.ContextMenu,h_),this.documentListeners.add(mi.Keydown,this.handleKeydown),D){if(A!=null&&A({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(f_(D)){this.timeoutId=setTimeout(this.handleStart,D.delay),this.handlePending(D);return}if(d_(D)){this.handlePending(D);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(C,D){const{active:A,onPending:H}=this.props;H(A,C,this.initialCoordinates,D)}handleStart(){const{initialCoordinates:C}=this,{onStart:D}=this.props;C&&(this.activated=!0,this.documentListeners.add(mi.Click,K0,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(mi.SelectionChange,this.removeTextSelection),D(C))}handleMove(C){var D;const{activated:A,initialCoordinates:H,props:N}=this,{onMove:z,options:{activationConstraint:s}}=N;if(!H)return;const c=(D=Pc(C))!=null?D:xi,h=On(H,c);if(!A&&s){if(d_(s)){if(s.tolerance!=null&&Mc(h,s.tolerance))return this.handleCancel();if(Mc(h,s.distance))return this.handleStart()}if(f_(s)&&Mc(h,s.tolerance))return this.handleCancel();this.handlePending(s,h);return}C.cancelable&&C.preventDefault(),z(c)}handleEnd(){const{onAbort:C,onEnd:D}=this.props;this.detach(),this.activated||C(this.props.active),D()}handleCancel(){const{onAbort:C,onCancel:D}=this.props;this.detach(),this.activated||C(this.props.active),D()}handleKeydown(C){C.code===Ne.Esc&&this.handleCancel()}removeTextSelection(){var C;(C=this.document.getSelection())==null||C.removeAllRanges()}}const Q0={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tu extends eu{constructor(C){const{event:D}=C,A=Ms(D.target);super(C,Q0,A)}}tu.activators=[{eventName:"onPointerDown",handler:(f,C)=>{let{nativeEvent:D}=f,{onActivation:A}=C;return!D.isPrimary||D.button!==0?!1:(A==null||A({event:D}),!0)}}];const J0={move:{name:"mousemove"},end:{name:"mouseup"}};var qc;(function(f){f[f.RightClick=2]="RightClick"})(qc||(qc={}));class e1 extends eu{constructor(C){super(C,J0,Ms(C.event.target))}}e1.activators=[{eventName:"onMouseDown",handler:(f,C)=>{let{nativeEvent:D}=f,{onActivation:A}=C;return D.button===qc.RightClick?!1:(A==null||A({event:D}),!0)}}];const kc={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class t1 extends eu{constructor(C){super(C,kc)}static setup(){return window.addEventListener(kc.move.name,C,{capture:!1,passive:!1}),function(){window.removeEventListener(kc.move.name,C)};function C(){}}}t1.activators=[{eventName:"onTouchStart",handler:(f,C)=>{let{nativeEvent:D}=f,{onActivation:A}=C;const{touches:H}=D;return H.length>1?!1:(A==null||A({event:D}),!0)}}];var Ln;(function(f){f[f.Pointer=0]="Pointer",f[f.DraggableRect=1]="DraggableRect"})(Ln||(Ln={}));var oo;(function(f){f[f.TreeOrder=0]="TreeOrder",f[f.ReversedTreeOrder=1]="ReversedTreeOrder"})(oo||(oo={}));function i1(f){let{acceleration:C,activator:D=Ln.Pointer,canScroll:A,draggingRect:H,enabled:N,interval:z=5,order:s=oo.TreeOrder,pointerCoordinates:c,scrollableAncestors:h,scrollableAncestorRects:g,delta:a,threshold:p}=f;const m=s1({delta:a,disabled:!N}),[w,_]=g0(),n=q.useRef({x:0,y:0}),o=q.useRef({x:0,y:0}),l=q.useMemo(()=>{switch(D){case Ln.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ln.DraggableRect:return H}},[D,H,c]),u=q.useRef(null),S=q.useCallback(()=>{const b=u.current;if(!b)return;const x=n.current.x*o.current.x,y=n.current.y*o.current.y;b.scrollBy(x,y)},[]),E=q.useMemo(()=>s===oo.TreeOrder?[...h].reverse():h,[s,h]);q.useEffect(()=>{if(!N||!h.length||!l){_();return}for(const b of E){if((A==null?void 0:A(b))===!1)continue;const x=h.indexOf(b),y=g[x];if(!y)continue;const{direction:R,speed:L}=q0(b,y,l,C,p);for(const I of["x","y"])m[I][R[I]]||(L[I]=0,R[I]=0);if(L.x>0||L.y>0){_(),u.current=b,w(S,z),n.current=L,o.current=R;return}}n.current={x:0,y:0},o.current={x:0,y:0},_()},[C,S,A,_,N,z,JSON.stringify(l),JSON.stringify(m),w,h,E,g,JSON.stringify(p)])}const r1={x:{[wt.Backward]:!1,[wt.Forward]:!1},y:{[wt.Backward]:!1,[wt.Forward]:!1}};function s1(f){let{delta:C,disabled:D}=f;const A=jc(C);return Nn(H=>{if(D||!A||!H)return r1;const N={x:Math.sign(C.x-A.x),y:Math.sign(C.y-A.y)};return{x:{[wt.Backward]:H.x[wt.Backward]||N.x===-1,[wt.Forward]:H.x[wt.Forward]||N.x===1},y:{[wt.Backward]:H.y[wt.Backward]||N.y===-1,[wt.Forward]:H.y[wt.Forward]||N.y===1}}},[D,C,A])}function n1(f,C){const D=C!=null?f.get(C):void 0,A=D?D.node.current:null;return Nn(H=>{var N;return C==null?null:(N=A??H)!=null?N:null},[A,C])}function a1(f,C){return q.useMemo(()=>f.reduce((D,A)=>{const{sensor:H}=A,N=H.activators.map(z=>({eventName:z.eventName,handler:C(z.handler,A)}));return[...D,...N]},[]),[f,C])}var Hn;(function(f){f[f.Always=0]="Always",f[f.BeforeDragging=1]="BeforeDragging",f[f.WhileDragging=2]="WhileDragging"})(Hn||(Hn={}));var Wc;(function(f){f.Optimized="optimized"})(Wc||(Wc={}));const __=new Map;function o1(f,C){let{dragging:D,dependencies:A,config:H}=C;const[N,z]=q.useState(null),{frequency:s,measure:c,strategy:h}=H,g=q.useRef(f),a=n(),p=kn(a),m=q.useCallback(function(o){o===void 0&&(o=[]),!p.current&&z(l=>l===null?o:l.concat(o.filter(u=>!l.includes(u))))},[p]),w=q.useRef(null),_=Nn(o=>{if(a&&!D)return __;if(!o||o===__||g.current!==f||N!=null){const l=new Map;for(let u of f){if(!u)continue;if(N&&N.length>0&&!N.includes(u.id)&&u.rect.current){l.set(u.id,u.rect.current);continue}const S=u.node.current,E=S?new Qc(c(S),S):null;u.rect.current=E,E&&l.set(u.id,E)}return l}return o},[f,N,D,a,c]);return q.useEffect(()=>{g.current=f},[f]),q.useEffect(()=>{a||m()},[D,a]),q.useEffect(()=>{N&&N.length>0&&z(null)},[JSON.stringify(N)]),q.useEffect(()=>{a||typeof s!="number"||w.current!==null||(w.current=setTimeout(()=>{m(),w.current=null},s))},[s,a,m,...A]),{droppableRects:_,measureDroppableContainers:m,measuringScheduled:N!=null};function n(){switch(h){case Hn.Always:return!1;case Hn.BeforeDragging:return D;default:return!D}}}function dg(f,C){return Nn(D=>f?D||(typeof C=="function"?C(f):f):null,[C,f])}function l1(f,C){return dg(f,C)}function c1(f){let{callback:C,disabled:D}=f;const A=Kc(C),H=q.useMemo(()=>{if(D||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:N}=window;return new N(A)},[A,D]);return q.useEffect(()=>()=>H==null?void 0:H.disconnect(),[H]),H}function ho(f){let{callback:C,disabled:D}=f;const A=Kc(C),H=q.useMemo(()=>{if(D||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:N}=window;return new N(A)},[D]);return q.useEffect(()=>()=>H==null?void 0:H.disconnect(),[H]),H}function u1(f){return new Qc(ks(f),f)}function g_(f,C,D){C===void 0&&(C=u1);const[A,H]=q.useState(null);function N(){H(c=>{if(!f)return null;if(f.isConnected===!1){var h;return(h=c??D)!=null?h:null}const g=C(f);return JSON.stringify(c)===JSON.stringify(g)?c:g})}const z=c1({callback(c){if(f)for(const h of c){const{type:g,target:a}=h;if(g==="childList"&&a instanceof HTMLElement&&a.contains(f)){N();break}}}}),s=ho({callback:N});return Ti(()=>{N(),f?(s==null||s.observe(f),z==null||z.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),z==null||z.disconnect())},[f]),A}function h1(f){const C=dg(f);return sg(f,C)}const v_=[];function d1(f){const C=q.useRef(f),D=Nn(A=>f?A&&A!==v_&&f&&C.current&&f.parentNode===C.current.parentNode?A:uo(f):v_,[f]);return q.useEffect(()=>{C.current=f},[f]),D}function f1(f){const[C,D]=q.useState(null),A=q.useRef(f),H=q.useCallback(N=>{const z=Tc(N.target);z&&D(s=>s?(s.set(z,Fc(z)),new Map(s)):null)},[]);return q.useEffect(()=>{const N=A.current;if(f!==N){z(N);const s=f.map(c=>{const h=Tc(c);return h?(h.addEventListener("scroll",H,{passive:!0}),[h,Fc(h)]):null}).filter(c=>c!=null);D(s.length?new Map(s):null),A.current=f}return()=>{z(f),z(N)};function z(s){s.forEach(c=>{const h=Tc(c);h==null||h.removeEventListener("scroll",H)})}},[H,f]),q.useMemo(()=>f.length?C?Array.from(C.values()).reduce((N,z)=>As(N,z),xi):ug(f):xi,[f,C])}function p_(f,C){C===void 0&&(C=[]);const D=q.useRef(null);return q.useEffect(()=>{D.current=null},C),q.useEffect(()=>{const A=f!==xi;A&&!D.current&&(D.current=f),!A&&D.current&&(D.current=null)},[f]),D.current?On(f,D.current):xi}function _1(f){q.useEffect(()=>{if(!co)return;const C=f.map(D=>{let{sensor:A}=D;return A.setup==null?void 0:A.setup()});return()=>{for(const D of C)D==null||D()}},f.map(C=>{let{sensor:D}=C;return D}))}function g1(f,C){return q.useMemo(()=>f.reduce((D,A)=>{let{eventName:H,handler:N}=A;return D[H]=z=>{N(z,C)},D},{}),[f,C])}function fg(f){return q.useMemo(()=>f?U0(f):null,[f])}const m_=[];function v1(f,C){C===void 0&&(C=ks);const[D]=f,A=fg(D?Vt(D):null),[H,N]=q.useState(m_);function z(){N(()=>f.length?f.map(c=>lg(c)?A:new Qc(C(c),c)):m_)}const s=ho({callback:z});return Ti(()=>{s==null||s.disconnect(),z(),f.forEach(c=>s==null?void 0:s.observe(c))},[f]),H}function p1(f){if(!f)return null;if(f.children.length>1)return f;const C=f.children[0];return In(C)?C:f}function m1(f){let{measure:C}=f;const[D,A]=q.useState(null),H=q.useCallback(h=>{for(const{target:g}of h)if(In(g)){A(a=>{const p=C(g);return a?{...a,width:p.width,height:p.height}:p});break}},[C]),N=ho({callback:H}),z=q.useCallback(h=>{const g=p1(h);N==null||N.disconnect(),g&&(N==null||N.observe(g)),A(g?C(g):null)},[C,N]),[s,c]=no(z);return q.useMemo(()=>({nodeRef:s,rect:D,setRef:c}),[D,s,c])}const S1=[{sensor:tu,options:{}},{sensor:Jc,options:{}}],b1={current:{}},ro={draggable:{measure:u_},droppable:{measure:u_,strategy:Hn.WhileDragging,frequency:Wc.Optimized},dragOverlay:{measure:ks}};class Tn extends Map{get(C){var D;return C!=null&&(D=super.get(C))!=null?D:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(C=>{let{disabled:D}=C;return!D})}getNodeFor(C){var D,A;return(D=(A=this.get(C))==null?void 0:A.node.current)!=null?D:void 0}}const y1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Tn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ao},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ro,measureDroppableContainers:ao,windowRect:null,measuringScheduled:!1},C1={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ao,draggableNodes:new Map,over:null,measureDroppableContainers:ao},fo=q.createContext(C1),_g=q.createContext(y1);function w1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Tn}}}function x1(f,C){switch(C.type){case St.DragStart:return{...f,draggable:{...f.draggable,initialCoordinates:C.initialCoordinates,active:C.active}};case St.DragMove:return f.draggable.active==null?f:{...f,draggable:{...f.draggable,translate:{x:C.coordinates.x-f.draggable.initialCoordinates.x,y:C.coordinates.y-f.draggable.initialCoordinates.y}}};case St.DragEnd:case St.DragCancel:return{...f,draggable:{...f.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case St.RegisterDroppable:{const{element:D}=C,{id:A}=D,H=new Tn(f.droppable.containers);return H.set(A,D),{...f,droppable:{...f.droppable,containers:H}}}case St.SetDroppableDisabled:{const{id:D,key:A,disabled:H}=C,N=f.droppable.containers.get(D);if(!N||A!==N.key)return f;const z=new Tn(f.droppable.containers);return z.set(D,{...N,disabled:H}),{...f,droppable:{...f.droppable,containers:z}}}case St.UnregisterDroppable:{const{id:D,key:A}=C,H=f.droppable.containers.get(D);if(!H||A!==H.key)return f;const N=new Tn(f.droppable.containers);return N.delete(D),{...f,droppable:{...f.droppable,containers:N}}}default:return f}}function E1(f){let{disabled:C}=f;const{active:D,activatorEvent:A,draggableNodes:H}=q.useContext(fo),N=jc(A),z=jc(D==null?void 0:D.id);return q.useEffect(()=>{if(!C&&!A&&N&&z!=null){if(!Zc(N)||document.activeElement===N.target)return;const s=H.get(z);if(!s)return;const{activatorNode:c,node:h}=s;if(!c.current&&!h.current)return;requestAnimationFrame(()=>{for(const g of[c.current,h.current]){if(!g)continue;const a=m0(g);if(a){a.focus();break}}})}},[A,C,H,z,N]),null}function R1(f,C){let{transform:D,...A}=C;return f!=null&&f.length?f.reduce((H,N)=>N({transform:H,...A}),D):D}function A1(f){return q.useMemo(()=>({draggable:{...ro.draggable,...f==null?void 0:f.draggable},droppable:{...ro.droppable,...f==null?void 0:f.droppable},dragOverlay:{...ro.dragOverlay,...f==null?void 0:f.dragOverlay}}),[f==null?void 0:f.draggable,f==null?void 0:f.droppable,f==null?void 0:f.dragOverlay])}function D1(f){let{activeNode:C,measure:D,initialRect:A,config:H=!0}=f;const N=q.useRef(!1),{x:z,y:s}=typeof H=="boolean"?{x:H,y:H}:H;Ti(()=>{if(!z&&!s||!C){N.current=!1;return}if(N.current||!A)return;const h=C==null?void 0:C.node.current;if(!h||h.isConnected===!1)return;const g=D(h),a=sg(g,A);if(z||(a.x=0),s||(a.y=0),N.current=!0,Math.abs(a.x)>0||Math.abs(a.y)>0){const p=ng(h);p&&p.scrollBy({top:a.y,left:a.x})}},[C,z,s,A,D])}const gg=q.createContext({...xi,scaleX:1,scaleY:1});var xr;(function(f){f[f.Uninitialized=0]="Uninitialized",f[f.Initializing=1]="Initializing",f[f.Initialized=2]="Initialized"})(xr||(xr={}));const vg=q.memo(function(C){var D,A,H,N;let{id:z,accessibility:s,autoScroll:c=!0,children:h,sensors:g=S1,collisionDetection:a=k0,measuring:p,modifiers:m,...w}=C;const _=q.useReducer(x1,void 0,w1),[n,o]=_,[l,u]=x0(),[S,E]=q.useState(xr.Uninitialized),b=S===xr.Initialized,{draggable:{active:x,nodes:y,translate:R},droppable:{containers:L}}=n,I=x!=null?y.get(x):null,M=q.useRef({initial:null,translated:null}),B=q.useMemo(()=>{var tt;return x!=null?{id:x,data:(tt=I==null?void 0:I.data)!=null?tt:b1,rect:M}:null},[x,I]),G=q.useRef(null),[X,W]=q.useState(null),[$,Y]=q.useState(null),k=kn(w,Object.values(w)),F=Un("DndDescribedBy",z),O=q.useMemo(()=>L.getEnabled(),[L]),U=A1(p),{droppableRects:Q,measureDroppableContainers:ee,measuringScheduled:he}=o1(O,{dragging:b,dependencies:[R.x,R.y],config:U.droppable}),ce=n1(y,x),K=q.useMemo(()=>$?Pc($):null,[$]),P=Mi(),ne=l1(ce,U.draggable.measure);D1({activeNode:x!=null?y.get(x):null,config:P.layoutShiftCompensation,initialRect:ne,measure:U.draggable.measure});const ie=g_(ce,U.draggable.measure,ne),_e=g_(ce?ce.parentElement:null),fe=q.useRef({activatorEvent:null,active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=L.getNodeFor((D=fe.current.over)==null?void 0:D.id),ve=m1({measure:U.dragOverlay.measure}),Te=(A=ve.nodeRef.current)!=null?A:ce,Pe=b?(H=ve.rect)!=null?H:ie:null,Se=!!(ve.nodeRef.current&&ve.rect),Mt=h1(Se?null:ie),It=fg(Te?Vt(Te):null),xe=d1(b?ye??ce:null),Ee=v1(xe),Ae=R1(m,{transform:{x:R.x-Mt.x,y:R.y-Mt.y,scaleX:1,scaleY:1},activatorEvent:$,active:B,activeNodeRect:ie,containerNodeRect:_e,draggingNodeRect:Pe,over:fe.current.over,overlayNodeRect:ve.rect,scrollableAncestors:xe,scrollableAncestorRects:Ee,windowRect:It}),ge=K?As(K,R):null,we=f1(xe),Ke=p_(we),qe=p_(we,[ie]),gt=As(Ae,Ke),Ze=Pe?H0(Pe,Ae):null,ct=B&&Ze?a({active:B,collisionRect:Ze,droppableRects:Q,droppableContainers:O,pointerCoordinates:ge}):null,Qe=ig(ct,"id"),[ke,De]=q.useState(null),Xt=Se?Ae:As(Ae,qe),ut=O0(Xt,(N=ke==null?void 0:ke.rect)!=null?N:null,ie),Et=q.useRef(null),vt=q.useCallback((tt,rt)=>{let{sensor:bt,options:Nt}=rt;if(G.current==null)return;const Ut=y.get(G.current);if(!Ut)return;const kt=tt.nativeEvent,jt=new bt({active:G.current,activeNode:Ut,event:kt,options:Nt,context:fe,onAbort(pt){if(!y.get(pt))return;const{onDragAbort:Kt}=k.current,ni={id:pt};Kt==null||Kt(ni),l({type:"onDragAbort",event:ni})},onPending(pt,Si,Kt,ni){if(!y.get(pt))return;const{onDragPending:Oi}=k.current,bi={id:pt,constraint:Si,initialCoordinates:Kt,offset:ni};Oi==null||Oi(bi),l({type:"onDragPending",event:bi})},onStart(pt){const Si=G.current;if(Si==null)return;const Kt=y.get(Si);if(!Kt)return;const{onDragStart:ni}=k.current,ki={activatorEvent:kt,active:{id:Si,data:Kt.data,rect:M}};Rn.unstable_batchedUpdates(()=>{ni==null||ni(ki),E(xr.Initializing),o({type:St.DragStart,initialCoordinates:pt,active:Si}),l({type:"onDragStart",event:ki}),W(Et.current),Y(kt)})},onMove(pt){o({type:St.DragMove,coordinates:pt})},onEnd:si(St.DragEnd),onCancel:si(St.DragCancel)});Et.current=jt;function si(pt){return async function(){const{active:Kt,collisions:ni,over:ki,scrollAdjustedTranslate:Oi}=fe.current;let bi=null;if(Kt&&Oi){const{cancelDrop:er}=k.current;bi={activatorEvent:kt,active:Kt,collisions:ni,delta:Oi,over:ki},pt===St.DragEnd&&typeof er=="function"&&await Promise.resolve(er(bi))&&(pt=St.DragCancel)}G.current=null,Rn.unstable_batchedUpdates(()=>{o({type:pt}),E(xr.Uninitialized),De(null),W(null),Y(null),Et.current=null;const er=pt===St.DragEnd?"onDragEnd":"onDragCancel";if(bi){const ai=k.current[er];ai==null||ai(bi),l({type:er,event:bi})}})}}},[y]),Ji=q.useCallback((tt,rt)=>(bt,Nt)=>{const Ut=bt.nativeEvent,kt=y.get(Nt);if(G.current!==null||!kt||Ut.dndKit||Ut.defaultPrevented)return;const jt={active:kt};tt(bt,rt.options,jt)===!0&&(Ut.dndKit={capturedBy:rt.sensor},G.current=Nt,vt(bt,rt))},[y,vt]),Fr=a1(g,Ji);_1(g),Ti(()=>{ie&&S===xr.Initializing&&E(xr.Initialized)},[ie,S]),q.useEffect(()=>{const{onDragMove:tt}=k.current,{active:rt,activatorEvent:bt,collisions:Nt,over:Ut}=fe.current;if(!rt||!bt)return;const kt={active:rt,activatorEvent:bt,collisions:Nt,delta:{x:gt.x,y:gt.y},over:Ut};Rn.unstable_batchedUpdates(()=>{tt==null||tt(kt),l({type:"onDragMove",event:kt})})},[gt.x,gt.y]),q.useEffect(()=>{const{active:tt,activatorEvent:rt,collisions:bt,droppableContainers:Nt,scrollAdjustedTranslate:Ut}=fe.current;if(!tt||G.current==null||!rt||!Ut)return;const{onDragOver:kt}=k.current,jt=Nt.get(Qe),si=jt&&jt.rect.current?{id:jt.id,rect:jt.rect.current,data:jt.data,disabled:jt.disabled}:null,pt={active:tt,activatorEvent:rt,collisions:bt,delta:{x:Ut.x,y:Ut.y},over:si};Rn.unstable_batchedUpdates(()=>{De(si),kt==null||kt(pt),l({type:"onDragOver",event:pt})})},[Qe]),Ti(()=>{fe.current={activatorEvent:$,active:B,activeNode:ce,collisionRect:Ze,collisions:ct,droppableRects:Q,draggableNodes:y,draggingNode:Te,draggingNodeRect:Pe,droppableContainers:L,over:ke,scrollableAncestors:xe,scrollAdjustedTranslate:gt},M.current={initial:Pe,translated:Ze}},[B,ce,ct,Ze,y,Te,Pe,Q,L,ke,xe,gt]),i1({...P,delta:R,draggingRect:Ze,pointerCoordinates:ge,scrollableAncestors:xe,scrollableAncestorRects:Ee});const Os=q.useMemo(()=>({active:B,activeNode:ce,activeNodeRect:ie,activatorEvent:$,collisions:ct,containerNodeRect:_e,dragOverlay:ve,draggableNodes:y,droppableContainers:L,droppableRects:Q,over:ke,measureDroppableContainers:ee,scrollableAncestors:xe,scrollableAncestorRects:Ee,measuringConfiguration:U,measuringScheduled:he,windowRect:It}),[B,ce,ie,$,ct,_e,ve,y,L,Q,ke,ee,xe,Ee,U,he,It]),Ei=q.useMemo(()=>({activatorEvent:$,activators:Fr,active:B,activeNodeRect:ie,ariaDescribedById:{draggable:F},dispatch:o,draggableNodes:y,over:ke,measureDroppableContainers:ee}),[$,Fr,B,ie,o,F,y,ke,ee]);return xt.createElement(J_.Provider,{value:u},xt.createElement(fo.Provider,{value:Ei},xt.createElement(_g.Provider,{value:Os},xt.createElement(gg.Provider,{value:ut},h)),xt.createElement(E1,{disabled:(s==null?void 0:s.restoreFocus)===!1})),xt.createElement(A0,{...s,hiddenTextDescribedById:F}));function Mi(){const tt=(X==null?void 0:X.autoScrollEnabled)===!1,rt=typeof c=="object"?c.enabled===!1:c===!1,bt=b&&!tt&&!rt;return typeof c=="object"?{...c,enabled:bt}:{enabled:bt}}}),L1=q.createContext(null),S_="button",T1="Draggable";function M1(f){let{id:C,data:D,disabled:A=!1,attributes:H}=f;const N=Un(T1),{activators:z,activatorEvent:s,active:c,activeNodeRect:h,ariaDescribedById:g,draggableNodes:a,over:p}=q.useContext(fo),{role:m=S_,roleDescription:w="draggable",tabIndex:_=0}=H??{},n=(c==null?void 0:c.id)===C,o=q.useContext(n?gg:L1),[l,u]=no(),[S,E]=no(),b=g1(z,C),x=kn(D);Ti(()=>(a.set(C,{id:C,key:N,node:l,activatorNode:S,data:x}),()=>{const R=a.get(C);R&&R.key===N&&a.delete(C)}),[a,C]);const y=q.useMemo(()=>({role:m,tabIndex:_,"aria-disabled":A,"aria-pressed":n&&m===S_?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[A,m,_,n,w,g.draggable]);return{active:c,activatorEvent:s,activeNodeRect:h,attributes:y,isDragging:n,listeners:A?void 0:b,node:l,over:p,setNodeRef:u,setActivatorNodeRef:E,transform:o}}function k1(){return q.useContext(_g)}const O1="Droppable",B1={timeout:25};function H1(f){let{data:C,disabled:D=!1,id:A,resizeObserverConfig:H}=f;const N=Un(O1),{active:z,dispatch:s,over:c,measureDroppableContainers:h}=q.useContext(fo),g=q.useRef({disabled:D}),a=q.useRef(!1),p=q.useRef(null),m=q.useRef(null),{disabled:w,updateMeasurementsFor:_,timeout:n}={...B1,...H},o=kn(_??A),l=q.useCallback(()=>{if(!a.current){a.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{h(Array.isArray(o.current)?o.current:[o.current]),m.current=null},n)},[n]),u=ho({callback:l,disabled:w||!z}),S=q.useCallback((y,R)=>{u&&(R&&(u.unobserve(R),a.current=!1),y&&u.observe(y))},[u]),[E,b]=no(S),x=kn(C);return q.useEffect(()=>{!u||!E.current||(u.disconnect(),a.current=!1,u.observe(E.current))},[E,u]),q.useEffect(()=>(s({type:St.RegisterDroppable,element:{id:A,key:N,disabled:D,node:E,rect:p,data:x}}),()=>s({type:St.UnregisterDroppable,key:N,id:A})),[A]),q.useEffect(()=>{D!==g.current.disabled&&(s({type:St.SetDroppableDisabled,id:A,key:N,disabled:D}),g.current.disabled=D)},[A,N,D,s]),{active:z,rect:p,isOver:(c==null?void 0:c.id)===A,node:E,over:c,setNodeRef:b}}function pg(f,C,D){const A=f.slice();return A.splice(D<0?A.length+D:D,0,A.splice(C,1)[0]),A}function z1(f,C){return f.reduce((D,A,H)=>{const N=C.get(A);return N&&(D[H]=N),D},Array(f.length))}function Qa(f){return f!==null&&f>=0}function I1(f,C){if(f===C)return!0;if(f.length!==C.length)return!1;for(let D=0;D<f.length;D++)if(f[D]!==C[D])return!1;return!0}function N1(f){return typeof f=="boolean"?{draggable:f,droppable:f}:f}const mg=f=>{let{rects:C,activeIndex:D,overIndex:A,index:H}=f;const N=pg(C,A,D),z=C[H],s=N[H];return!s||!z?null:{x:s.left-z.left,y:s.top-z.top,scaleX:s.width/z.width,scaleY:s.height/z.height}},Ja={scaleX:1,scaleY:1},Sg=f=>{var C;let{activeIndex:D,activeNodeRect:A,index:H,rects:N,overIndex:z}=f;const s=(C=N[D])!=null?C:A;if(!s)return null;if(H===D){const h=N[z];return h?{x:0,y:D<z?h.top+h.height-(s.top+s.height):h.top-s.top,...Ja}:null}const c=U1(N,H,D);return H>D&&H<=z?{x:0,y:-s.height-c,...Ja}:H<D&&H>=z?{x:0,y:s.height+c,...Ja}:{x:0,y:0,...Ja}};function U1(f,C,D){const A=f[C],H=f[C-1],N=f[C+1];return A?D<C?H?A.top-(H.top+H.height):N?N.top-(A.top+A.height):0:N?N.top-(A.top+A.height):H?A.top-(H.top+H.height):0:0}const bg="Sortable",yg=xt.createContext({activeIndex:-1,containerId:bg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:mg,disabled:{draggable:!1,droppable:!1}});function Cg(f){let{children:C,id:D,items:A,strategy:H=mg,disabled:N=!1}=f;const{active:z,dragOverlay:s,droppableRects:c,over:h,measureDroppableContainers:g}=k1(),a=Un(bg,D),p=s.rect!==null,m=q.useMemo(()=>A.map(b=>typeof b=="object"&&"id"in b?b.id:b),[A]),w=z!=null,_=z?m.indexOf(z.id):-1,n=h?m.indexOf(h.id):-1,o=q.useRef(m),l=!I1(m,o.current),u=n!==-1&&_===-1||l,S=N1(N);Ti(()=>{l&&w&&g(m)},[l,m,w,g]),q.useEffect(()=>{o.current=m},[m]);const E=q.useMemo(()=>({activeIndex:_,containerId:a,disabled:S,disableTransforms:u,items:m,overIndex:n,useDragOverlay:p,sortedRects:z1(m,c),strategy:H}),[_,a,S.draggable,S.droppable,u,m,n,c,p,H]);return xt.createElement(yg.Provider,{value:E},C)}const j1=f=>{let{id:C,items:D,activeIndex:A,overIndex:H}=f;return pg(D,A,H).indexOf(C)},P1=f=>{let{containerId:C,isSorting:D,wasDragging:A,index:H,items:N,newIndex:z,previousItems:s,previousContainerId:c,transition:h}=f;return!h||!A||s!==N&&H===z?!1:D?!0:z!==H&&C===c},F1={duration:200,easing:"ease"},wg="transform",q1=Bn.Transition.toString({property:wg,duration:0,easing:"linear"}),W1={roleDescription:"sortable"};function $1(f){let{disabled:C,index:D,node:A,rect:H}=f;const[N,z]=q.useState(null),s=q.useRef(D);return Ti(()=>{if(!C&&D!==s.current&&A.current){const c=H.current;if(c){const h=ks(A.current,{ignoreTransform:!0}),g={x:c.left-h.left,y:c.top-h.top,scaleX:c.width/h.width,scaleY:c.height/h.height};(g.x||g.y)&&z(g)}}D!==s.current&&(s.current=D)},[C,D,A,H]),q.useEffect(()=>{N&&z(null)},[N]),N}function G1(f){let{animateLayoutChanges:C=P1,attributes:D,disabled:A,data:H,getNewIndex:N=j1,id:z,strategy:s,resizeObserverConfig:c,transition:h=F1}=f;const{items:g,containerId:a,activeIndex:p,disabled:m,disableTransforms:w,sortedRects:_,overIndex:n,useDragOverlay:o,strategy:l}=q.useContext(yg),u=Y1(A,m),S=g.indexOf(z),E=q.useMemo(()=>({sortable:{containerId:a,index:S,items:g},...H}),[a,H,S,g]),b=q.useMemo(()=>g.slice(g.indexOf(z)),[g,z]),{rect:x,node:y,isOver:R,setNodeRef:L}=H1({id:z,data:E,disabled:u.droppable,resizeObserverConfig:{updateMeasurementsFor:b,...c}}),{active:I,activatorEvent:M,activeNodeRect:B,attributes:G,setNodeRef:X,listeners:W,isDragging:$,over:Y,setActivatorNodeRef:k,transform:F}=M1({id:z,data:E,attributes:{...W1,...D},disabled:u.draggable}),O=_0(L,X),U=!!I,Q=U&&!w&&Qa(p)&&Qa(n),ee=!o&&$,he=ee&&Q?F:null,K=Q?he??(s??l)({rects:_,activeNodeRect:B,activeIndex:p,overIndex:n,index:S}):null,P=Qa(p)&&Qa(n)?N({id:z,items:g,activeIndex:p,overIndex:n}):S,ne=I==null?void 0:I.id,ie=q.useRef({activeId:ne,items:g,newIndex:P,containerId:a}),_e=g!==ie.current.items,fe=C({active:I,containerId:a,isDragging:$,isSorting:U,id:z,index:S,items:g,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:h,wasDragging:ie.current.activeId!=null}),ye=$1({disabled:!fe,index:S,node:y,rect:x});return q.useEffect(()=>{U&&ie.current.newIndex!==P&&(ie.current.newIndex=P),a!==ie.current.containerId&&(ie.current.containerId=a),g!==ie.current.items&&(ie.current.items=g)},[U,P,a,g]),q.useEffect(()=>{if(ne===ie.current.activeId)return;if(ne&&!ie.current.activeId){ie.current.activeId=ne;return}const Te=setTimeout(()=>{ie.current.activeId=ne},50);return()=>clearTimeout(Te)},[ne]),{active:I,activeIndex:p,attributes:G,data:E,rect:x,index:S,newIndex:P,items:g,isOver:R,isSorting:U,isDragging:$,listeners:W,node:y,overIndex:n,over:Y,setNodeRef:O,setActivatorNodeRef:k,setDroppableNodeRef:L,setDraggableNodeRef:X,transform:ye??K,transition:ve()};function ve(){if(ye||_e&&ie.current.newIndex===S)return q1;if(!(ee&&!Zc(M)||!h)&&(U||fe))return Bn.Transition.toString({...h,property:wg})}}function Y1(f,C){var D,A;return typeof f=="boolean"?{draggable:f,droppable:!1}:{draggable:(D=f==null?void 0:f.draggable)!=null?D:C.draggable,droppable:(A=f==null?void 0:f.droppable)!=null?A:C.droppable}}function lo(f){if(!f)return!1;const C=f.data.current;return!!(C&&"sortable"in C&&typeof C.sortable=="object"&&"containerId"in C.sortable&&"items"in C.sortable&&"index"in C.sortable)}const V1=[Ne.Down,Ne.Right,Ne.Up,Ne.Left],X1=(f,C)=>{let{context:{active:D,collisionRect:A,droppableRects:H,droppableContainers:N,over:z,scrollableAncestors:s}}=C;if(V1.includes(f.code)){if(f.preventDefault(),!D||!A)return;const c=[];N.getEnabled().forEach(a=>{if(!a||a!=null&&a.disabled)return;const p=H.get(a.id);if(p)switch(f.code){case Ne.Down:A.top<p.top&&c.push(a);break;case Ne.Up:A.top>p.top&&c.push(a);break;case Ne.Left:A.left>p.left&&c.push(a);break;case Ne.Right:A.left<p.left&&c.push(a);break}});const h=T0({collisionRect:A,droppableRects:H,droppableContainers:c});let g=ig(h,"id");if(g===(z==null?void 0:z.id)&&h.length>1&&(g=h[1].id),g!=null){const a=N.get(D.id),p=N.get(g),m=p?H.get(p.id):null,w=p==null?void 0:p.node.current;if(w&&m&&a&&p){const n=uo(w).some((b,x)=>s[x]!==b),o=xg(a,p),l=K1(a,p),u=n||!o?{x:0,y:0}:{x:l?A.width-m.width:0,y:l?A.height-m.height:0},S={x:m.left,y:m.top};return u.x&&u.y?S:On(S,u)}}}};function xg(f,C){return!lo(f)||!lo(C)?!1:f.data.current.sortable.containerId===C.data.current.sortable.containerId}function K1(f,C){return!lo(f)||!lo(C)||!xg(f,C)?!1:f.data.current.sortable.index<C.data.current.sortable.index}function Eg(){var f;return((f=crypto.randomUUID)==null?void 0:f.call(crypto))??`id-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Rg({id:f,enabled:C,onToggle:D,onDelete:A,children:H,isExpandable:N,isExpanded:z,onToggleExpand:s,detailContent:c}){const{attributes:h,listeners:g,setNodeRef:a,transform:p,transition:m,isDragging:w}=G1({id:f}),_={transform:Bn.Transform.toString(p),opacity:w?.5:1};return V.jsxs("div",{ref:a,style:{..._,borderRadius:8,background:"var(--bg-tertiary)",overflow:"hidden"},children:[V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",minHeight:"var(--min-touch-target, 44px)",overflow:"hidden"},children:[V.jsx("div",{...h,...g,"aria-label":"Drag to reorder",style:{width:24,color:"var(--text-muted)",cursor:"grab",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,userSelect:"none",touchAction:"none"},children:"⋮⋮"}),V.jsx("button",{role:"switch","aria-checked":C,"aria-label":C?"Enabled, click to disable":"Disabled, click to enable",onClick:D,style:{width:32,height:20,borderRadius:10,border:"none",background:C?"var(--status-running)":"var(--bg-primary)",cursor:"pointer",position:"relative",flexShrink:0},children:V.jsx("span",{style:{position:"absolute",top:2,left:C?14:2,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 0.15s ease"}})}),H,N&&V.jsx("button",{"aria-label":z?"Collapse details":"Expand details","aria-expanded":z,onClick:s,style:{width:28,height:28,padding:0,borderRadius:6,border:"none",background:"transparent",color:"var(--text-muted)",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:V.jsx("span",{style:{display:"inline-block",transform:z?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s ease"},children:"▼"})}),V.jsx("button",{"aria-label":"Delete",onClick:A,style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",fontSize:18,flexShrink:0},children:"×"})]}),N&&z&&V.jsx("div",{style:{padding:"8px 16px 12px 68px",borderTop:"1px solid var(--border-color)",background:"var(--bg-secondary)"},children:c})]})}function Ag(){return D0(o_(tu,{activationConstraint:{distance:8}}),o_(Jc,{coordinateGetter:X1}))}const b_=f=>[...f].sort((C,D)=>Number(D.enabled)-Number(C.enabled));function Z1(f){if(["Control","Alt","Shift","Meta"].includes(f.key))return null;let C="",D="";if(f.ctrlKey||f.altKey||f.metaKey){const A=f.key.toUpperCase(),H=f.ctrlKey?"Ctrl":f.altKey?"Alt":"Meta";if(f.key.length===1)if(C=`${H}+${A}`,f.ctrlKey)D=String.fromCharCode(f.key.toUpperCase().charCodeAt(0)-64);else return null;else return null}else if(f.key.startsWith("Arrow")){const H={ArrowUp:{label:"↑",code:"A"},ArrowDown:{label:"↓",code:"B"},ArrowRight:{label:"→",code:"C"},ArrowLeft:{label:"←",code:"D"}}[f.key];if(H)C=H.label,D=`\x1B[${H.code}`;else return null}else if(f.key==="Escape")C="Esc",D="\x1B";else if(f.key==="Enter")C="Enter",D="\r";else if(f.key==="Tab")C=f.shiftKey?"Shift+Tab":"Tab",D=f.shiftKey?"\x1B[Z":" ";else if(f.key==="Backspace")C="Backspace",D="";else if(f.key==="Delete")C="Delete",D="\x1B[3~";else if(f.key==="Home")C="Home",D="\x1B[H";else if(f.key==="End")C="End",D="\x1B[F";else if(f.key==="PageUp")C="PageUp",D="\x1B[5~";else if(f.key==="PageDown")C="PageDown",D="\x1B[6~";else if(f.key.match(/^F([1-9]|1[0-2])$/)){const A={F1:"\x1BOP",F2:"\x1BOQ",F3:"\x1BOR",F4:"\x1BOS",F5:"\x1B[15~",F6:"\x1B[17~",F7:"\x1B[18~",F8:"\x1B[19~",F9:"\x1B[20~",F10:"\x1B[21~",F11:"\x1B[23~",F12:"\x1B[24~"};C=f.key,D=A[f.key]??""}else if(f.key.length===1)C=f.key.toUpperCase(),D=f.key;else return null;return{label:C,data:D}}function Q1({shortcuts:f,onChange:C}){const[D,A]=q.useState(null),H=Ag(),N=(g,a)=>{g.preventDefault(),g.stopPropagation();const p=Z1(g);if(p){const m=[...f];m[a]={...m[a],label:p.label,data:p.data},C(m),A(null)}},z=g=>{const a=[...f];a[g]={...a[g],enabled:!a[g].enabled},C(b_(a))},s=()=>{const g=[{label:"New",data:"",enabled:!0,_id:Eg()},...f];C(b_(g)),A(0)},c=g=>{const a=f.filter((p,m)=>m!==g);C(a)},h=g=>{const{active:a,over:p}=g;if(p&&a.id!==p.id){const m=f.findIndex(o=>o._id===a.id),w=f.findIndex(o=>o._id===p.id),_=[...f],[n]=_.splice(m,1);_.splice(w,0,n),C(_)}};return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[V.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"Shortcuts"}),V.jsx("button",{onClick:s,style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:"pointer"},children:"+ Add"})]}),f.length===0&&V.jsx("div",{style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"No shortcuts yet. Click the button above to add one."}),V.jsx(vg,{sensors:H,collisionDetection:rg,onDragEnd:h,children:V.jsx(Cg,{items:f.map(g=>g._id),strategy:Sg,children:f.map((g,a)=>V.jsx(Rg,{id:g._id,enabled:g.enabled,onToggle:()=>z(a),onDelete:()=>c(a),children:V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[V.jsx("input",{type:"text",value:g.label,readOnly:!0,autoComplete:"off",placeholder:"Press key to capture",onClick:()=>A(a),onKeyDown:p=>N(p,a),onBlur:()=>A(null),"aria-label":`Shortcut ${a+1}`,style:{flex:1,minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:D===a?"2px solid var(--status-running)":"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",textAlign:"center"}}),V.jsx("span",{title:g.data?g.data.replace(/\x1b/g,"ESC").replace(/\r/g,"CR").replace(/\t/g,"TAB"):"(not set)",style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",fontSize:11,color:"var(--text-muted)",fontFamily:"monospace",flexShrink:0,width:35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.data?g.data.replace(/\x1b/g,"ESC").replace(/\r/g,"CR").replace(/\t/g,"TAB"):"(not set)"})]})},g._id))})}),D!==null&&V.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",textAlign:"center",marginTop:4},children:"Press a key to capture…"})]})}const J1={width:"100%",padding:"10px 12px",borderRadius:6,fontSize:14,resize:"none",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap",lineHeight:"20px",boxSizing:"border-box"};function Ls(f){return{...J1,...f}}const y_=f=>[...f].sort((C,D)=>Number(D.enabled)-Number(C.enabled));function em({commands:f,onChange:C}){const[D,A]=q.useState(null),[H,N]=q.useState(""),[z,s]=q.useState(null),c=Ag(),h=o=>{A(o),N(f[o].command)},g=o=>{if(o<0){A(null),N("");return}let l=H.trim();if(!l){_(o);return}l.startsWith("/")||(l="/"+l);const u=[...f];u[o]={...u[o],label:l,command:l},C(u),A(null),N("")},a=o=>{const l=[...f];l[o]={...l[o],enabled:!l[o].enabled},C(y_(l))},p=o=>{const l=[...f];l[o]={...l[o],autoSend:!(l[o].autoSend??!0)},C(l)},m=o=>{s(l=>l===o?null:o)},w=()=>{const o=[{label:"/new",command:"/new",enabled:!0,autoSend:!0,_id:Eg()},...f];C(y_(o)),A(0),N("/new")},_=o=>{const l=f.filter((u,S)=>S!==o);C(l),z===o?s(null):z!==null&&z>o&&s(z-1)},n=o=>{const{active:l,over:u}=o;if(u&&l.id!==u.id){const S=f.findIndex(y=>y._id===l.id),E=f.findIndex(y=>y._id===u.id),b=[...f],[x]=b.splice(S,1);b.splice(E,0,x),C(b),z!==null&&(z===S?s(E):S<z&&E>=z?s(z-1):S>z&&E<=z&&s(z+1))}};return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[V.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"Commands"}),V.jsx("button",{onClick:w,style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:"pointer"},children:"+ Add"})]}),f.length===0&&V.jsx("div",{style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"No commands yet. Click the button above to add one."}),V.jsx(vg,{sensors:c,collisionDetection:rg,onDragEnd:n,children:V.jsx(Cg,{items:f.map(o=>o._id),strategy:Sg,children:f.map((o,l)=>V.jsx(Rg,{id:o._id,enabled:o.enabled,onToggle:()=>a(l),onDelete:()=>_(l),isExpandable:!0,isExpanded:z===l,onToggleExpand:()=>m(l),detailContent:V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[V.jsx("button",{role:"switch","aria-checked":o.autoSend??!0,"aria-label":o.autoSend??!0?"Auto-send is on, click to turn off":"Auto-send is off, click to turn on",onClick:()=>p(l),style:{width:36,height:22,borderRadius:11,border:"none",background:o.autoSend??!0?"var(--status-running)":"var(--bg-primary)",cursor:"pointer",position:"relative",flexShrink:0},children:V.jsx("span",{style:{position:"absolute",top:2,left:o.autoSend??!0?16:2,width:18,height:18,borderRadius:"50%",background:"#fff",transition:"left 0.15s ease"}})}),V.jsx("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Auto-send on click"})]}),children:D===l?V.jsx("textarea",{value:H,onChange:u=>N(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),g(l)),u.key==="Escape"&&(N(""),g(-1))},onBlur:()=>g(l),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Enter command…","aria-label":`Command ${l+1}`,style:Ls({flex:1,minWidth:0,height:36,padding:"0 12px",border:"2px solid var(--status-running)",background:"var(--bg-primary)",color:"var(--text-primary)",lineHeight:"36px"})}):V.jsx("button",{type:"button",onClick:()=>h(l),"aria-label":`Edit command ${o.label}`,style:{flex:1,minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,display:"flex",alignItems:"center",cursor:"pointer",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.label})},o._id))})}),V.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:8},children:"Tip: Commands are auto-prefixed with / (e.g., help → /help)"})]})}function tm({checked:f,onChange:C,disabled:D=!1,"aria-label":A}){return V.jsx("button",{type:"button",role:"switch","aria-checked":f,"aria-label":A,disabled:D,onClick:()=>!D&&C(!f),style:{position:"relative",width:"44px",height:"24px",borderRadius:"12px",border:"none",padding:0,cursor:D?"not-allowed":"pointer",background:f?"var(--status-running)":"var(--bg-tertiary)",opacity:D?.5:1,transition:"background 150ms ease-out",touchAction:"manipulation",WebkitTapHighlightColor:"transparent"},children:V.jsx("span",{style:{position:"absolute",top:"2px",left:f?"22px":"2px",width:"20px",height:"20px",borderRadius:"50%",background:"#ffffff",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.3)",transition:"left 150ms ease-out"}})})}function eo({channelType:f,status:C,isExpanded:D,onToggle:A,onEnabledChange:H,children:N}){const z=u0[f],s=(z==null?void 0:z.implemented)??!1,c=(C==null?void 0:C.configured)??!1,h=(C==null?void 0:C.enabled)??!0,g={dingtalk:"📱",email:"📧",slack:"💬",wechat_work:"💼"},a=p=>{p.stopPropagation()};return V.jsxs("div",{style:{border:"1px solid var(--border-color)",borderRadius:8,background:"var(--bg-tertiary)",overflow:"hidden",opacity:s?1:.6},children:[V.jsxs("button",{onClick:s?A:void 0,style:{width:"100%",padding:"16px",border:"none",background:D?"var(--bg-secondary)":"transparent",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:s?"pointer":"default",textAlign:"left"},children:[V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[V.jsx("span",{style:{fontSize:24},children:g[f]??"🔔"}),V.jsxs("div",{children:[V.jsxs("div",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",display:"flex",alignItems:"center",gap:8},children:[(z==null?void 0:z.displayName)??f,c&&V.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:h?"var(--status-running)":"var(--text-muted)"},title:h?"Enabled":"Disabled"})]}),V.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:2},children:(z==null?void 0:z.description)??""})]})]}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c&&H&&V.jsx("div",{onClick:a,children:V.jsx(tm,{checked:h,onChange:H,"aria-label":`Toggle ${(z==null?void 0:z.displayName)??f}`})}),!s&&V.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)",background:"var(--bg-secondary)",padding:"4px 10px",borderRadius:12},children:"Coming"}),s&&V.jsx("svg",{style:{width:16,height:16,transform:D?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:V.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),s&&D&&V.jsx("div",{style:{padding:"16px",borderTop:"1px solid var(--border-color)",background:"var(--bg-primary)"},children:N})]})}function im({webhookUrl:f,onChange:C,configured:D}){const[A,H]=q.useState(!1),N=f===""||$_.test(f),z=A&&!N&&f!=="";return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{children:[V.jsx("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8,color:"var(--text-primary)"},children:"Webhook URL"}),V.jsx("textarea",{autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",value:f,onChange:s=>{C(s.target.value)},onBlur:()=>H(!0),style:Ls({border:`1px solid ${z?"var(--status-error)":"var(--border-color)"}`,background:"var(--bg-secondary)",color:"var(--text-primary)"})}),z&&V.jsx("div",{style:{marginTop:6,fontSize:12,color:"var(--status-error)"},children:"Please enter a valid DingTalk Webhook URL starting with https://oapi.dingtalk.com/robot/send?access_token="})]}),D&&!f&&V.jsx("div",{style:{padding:10,background:"rgba(46, 204, 113, 0.1)",borderRadius:6,fontSize:13,color:"var(--status-running)"},children:"✓ Configured. Enter a new URL to update."}),V.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:V.jsx("a",{href:"https://open.dingtalk.com/document/robots/custom-robot-access",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--status-running)"},children:"How to get DingTalk group bot Webhook?"})})]})}function rm({sendKey:f,onChange:C,configured:D}){const[A,H]=q.useState(!1),N=f===""||G_.test(f),z=A&&!N&&f!=="";return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{children:[V.jsx("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8,color:"var(--text-primary)"},children:"SendKey"}),V.jsx("textarea",{autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"SCTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",value:f,onChange:s=>{C(s.target.value)},onBlur:()=>H(!0),style:Ls({border:`1px solid ${z?"var(--status-error)":"var(--border-color)"}`,background:"var(--bg-secondary)",color:"var(--text-primary)"})}),z&&V.jsx("div",{style:{marginTop:6,fontSize:12,color:"var(--status-error)"},children:"Please enter a valid SendKey (starts with SCT, at least 13 characters)"})]}),D&&!f&&V.jsx("div",{style:{padding:10,background:"rgba(46, 204, 113, 0.1)",borderRadius:6,fontSize:13,color:"var(--status-running)"},children:"✓ Configured. Enter a new SendKey to update."}),V.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:V.jsx("a",{href:"https://sct.ftqq.com/sendkey",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--status-running)"},children:"How to get SendKey?"})})]})}function sm({notificationStatus:f,dingtalkWebhookUrl:C,onDingtalkWebhookChange:D,wechatWorkSendKey:A,onWechatWorkSendKeyChange:H,onChannelEnabledChange:N}){var h,g,a,p;const[z,s]=q.useState("dingtalk"),c=m=>{s(w=>w===m?null:m)};return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsx("div",{style:{padding:12,background:"var(--bg-tertiary)",borderRadius:8,fontSize:13,color:"var(--text-secondary)"},children:"Configure notification channels to receive alerts when Claude needs your attention."}),V.jsx(eo,{channelType:"dingtalk",status:f==null?void 0:f.dingtalk,isExpanded:z==="dingtalk",onToggle:()=>c("dingtalk"),onEnabledChange:(h=f==null?void 0:f.dingtalk)!=null&&h.configured?m=>N==null?void 0:N("dingtalk",m):void 0,children:V.jsx(im,{webhookUrl:C,onChange:D,configured:(g=f==null?void 0:f.dingtalk)==null?void 0:g.configured})}),V.jsx(eo,{channelType:"wechat_work",status:f==null?void 0:f.wechat_work,isExpanded:z==="wechat_work",onToggle:()=>c("wechat_work"),onEnabledChange:(a=f==null?void 0:f.wechat_work)!=null&&a.configured?m=>N==null?void 0:N("wechat_work",m):void 0,children:V.jsx(rm,{sendKey:A,onChange:H,configured:(p=f==null?void 0:f.wechat_work)==null?void 0:p.configured})}),V.jsx(eo,{channelType:"email",status:f==null?void 0:f.email,isExpanded:z==="email",onToggle:()=>c("email")}),V.jsx(eo,{channelType:"slack",status:f==null?void 0:f.slack,isExpanded:z==="slack",onToggle:()=>c("slack")})]})}const nm=100,am=300;var I_;const An=typeof window<"u"&&((I_=window.matchMedia)==null?void 0:I_.call(window,"(prefers-reduced-motion: reduce)").matches),Oc=An?0:300;function Dg({isOpen:f,onClose:C,title:D,children:A,footer:H}){const[N,z]=q.useState(!1),[s,c]=q.useState(!1),[h,g]=q.useState(0),[a,p]=q.useState(!1),m=q.useRef(0),w=q.useRef(0);q.useEffect(()=>{if(f)z(!0),g(0),An?c(!0):requestAnimationFrame(()=>{requestAnimationFrame(()=>c(!0))});else if(N)if(c(!1),An)z(!1);else{const E=setTimeout(()=>z(!1),Oc);return()=>clearTimeout(E)}},[f,N]);const _=q.useCallback(E=>{p(!0),m.current=E,w.current=Date.now(),g(0)},[]),n=q.useCallback(E=>{if(!a)return;const b=E-m.current;b>0&&g(b)},[a]),o=q.useCallback(()=>{if(!a)return;const E=h,b=Date.now()-w.current,x=b>0?E/(b/1e3):0;E>nm||E>50&&x>am?C():g(0),p(!1)},[a,h,C]);if(!N)return null;const l=An||a?"none":`transform ${Oc}ms ease-out`,u=An?"none":`background ${Oc}ms ease-out`,S=a?`translateY(${h}px)`:s?"translateY(0)":"translateY(100%)";return V.jsx("div",{onClick:C,style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:s?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transition:u,display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:1e3},children:V.jsxs("div",{onClick:E=>E.stopPropagation(),style:{width:"100%",maxWidth:480,maxHeight:"calc(85vh - env(safe-area-inset-bottom, 0px))",borderRadius:"16px 16px 0 0",background:"var(--bg-secondary)",boxShadow:"0 -4px 24px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",transform:S,transition:l,paddingBottom:"var(--safe-bottom)"},children:[V.jsx("div",{style:{width:36,height:4,background:"var(--text-secondary)",opacity:.5,borderRadius:2,margin:"12px auto",flexShrink:0,cursor:"pointer"},onTouchStart:E=>_(E.touches[0].clientY),onTouchMove:E=>n(E.touches[0].clientY),onTouchEnd:o,onMouseDown:E=>_(E.clientY),onMouseMove:E=>a&&n(E.clientY),onMouseUp:o,onMouseLeave:o}),V.jsxs("div",{style:{padding:"0 20px 16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0},children:[V.jsx("h2",{style:{fontSize:18,fontWeight:600,margin:0},children:D}),V.jsx("button",{onClick:C,"aria-label":"Close",style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",fontSize:20,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"×"})]}),V.jsx("div",{style:{flex:1,overflow:"auto",overscrollBehavior:"contain",padding:"0 16px"},children:A}),H&&V.jsx("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--border-color)",flexShrink:0},children:H})]})})}function om({isOpen:f,onClose:C,onConfigSaved:D}){const[A,H]=q.useState("shortcuts"),[N,z]=q.useState([]),[s,c]=q.useState([]),[h,g]=q.useState(""),[a,p]=q.useState(""),[m,w]=q.useState({}),[_,n]=q.useState(!1),[o,l]=q.useState(null),[u,S]=q.useState(!1),E=q.useRef(0);function b(){return String(++E.current)}function x(I){return{...I,_id:b()}}q.useEffect(()=>{f&&y()},[f]);const y=async()=>{try{const{config:I}=await F_();if(I){z(I.shortcuts.map(B=>x(B))),c(I.commands.map(B=>x(B)));const M=I.notifications||{};w(M),g("")}else z(Y_.map(M=>x({...M,enabled:!0}))),c(V_.map(M=>x({...M,enabled:!0}))),w({}),g("")}catch(I){l("Failed to load configuration"),console.error(I)}},R=async(I,M)=>{const B=m;w(G=>({...G,[I]:{...G[I],configured:!0,enabled:M}}));try{await n0(I,M)}catch(G){w(B),console.error("Failed to update channel enabled status:",G),l("Failed to update channel status"),setTimeout(()=>l(null),2e3)}},L=async()=>{var I,M;n(!0),l(null),S(!1);try{const B={shortcuts:N.map(({_id:Y,...k})=>k),commands:s.map(({_id:Y,...k})=>k)},G={},X=h.trim();if(X){if(!$_.test(X)){l("Please enter a valid DingTalk Webhook URL (starting with https://oapi.dingtalk.com/robot/send?access_token=)"),n(!1);return}G.dingtalk={webhookUrl:X}}const W=a.trim();if(W){if(!G_.test(W)){l("Please enter a valid SendKey (starts with SCT, at least 13 characters)"),n(!1);return}G.wechat_work={sendKey:W}}if(Object.keys(G).length>0&&(B.notifications=G),await s0(B)){S(!0);const Y={...m};X&&(Y.dingtalk={...m==null?void 0:m.dingtalk,configured:!0,enabled:(I=m==null?void 0:m.dingtalk)==null?void 0:I.enabled},g("")),W&&(Y.wechat_work={...m==null?void 0:m.wechat_work,configured:!0,enabled:(M=m==null?void 0:m.wechat_work)==null?void 0:M.enabled},p("")),w(Y),D==null||D(),setTimeout(()=>S(!1),2e3)}else l("Failed to save")}catch(B){l("Failed to save"),console.error(B)}finally{n(!1)}};return V.jsxs(Dg,{isOpen:f,onClose:C,title:"Settings",footer:V.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[V.jsxs("div",{style:{fontSize:13},children:[o&&V.jsx("span",{style:{color:"var(--status-error)"},children:o}),u&&V.jsx("span",{style:{color:"var(--status-running)"},children:"Saved"})]}),V.jsxs("div",{style:{display:"flex",gap:8},children:[V.jsx("button",{onClick:C,style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"Cancel"}),V.jsx("button",{onClick:L,disabled:_,style:{padding:"8px 20px",borderRadius:6,border:"none",background:_?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:_?"default":"pointer",opacity:_?.7:1},children:_?"Saving…":"Save"})]})]}),children:[V.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border-color)",margin:"0 -16px",marginBottom:16},children:["shortcuts","commands","notifications"].map(I=>V.jsx("button",{onClick:()=>H(I),style:{flex:1,padding:"12px 16px",border:"none",background:"transparent",color:A===I?"var(--text-primary)":"var(--text-secondary)",borderBottom:A===I?"2px solid var(--status-running)":"2px solid transparent",cursor:"pointer",fontSize:14,fontWeight:A===I?600:400},children:I==="shortcuts"?"Shortcuts":I==="commands"?"Commands":"Notifications"},I))}),A==="shortcuts"?V.jsx(Q1,{shortcuts:N,onChange:z}):A==="commands"?V.jsx(em,{commands:s,onChange:c}):V.jsx(sm,{notificationStatus:m,dingtalkWebhookUrl:h,onDingtalkWebhookChange:g,wechatWorkSendKey:a,onWechatWorkSendKeyChange:p,onChannelEnabledChange:R})]})}const lm={idle:{color:"var(--status-idle)",label:"Idle"},running:{color:"var(--status-running)",label:"Running"},waiting_input:{color:"var(--status-waiting)",label:"Waiting Input"}},cm={connecting:{color:"var(--status-waiting)",label:"Connecting..."},connected:{color:"var(--status-idle)",label:"Connected"},disconnected:{color:"var(--status-error)",label:"Disconnected"}};function um(){const[f,C]=q.useState(!1),D=at(s=>s.sessionStatus),A=zt(s=>s.activeInstanceId),H=at(s=>A?s.instanceConnectionStatus[A]??"disconnected":s.connectionStatus),N=lm[D],z=cm[H];return V.jsxs(V.Fragment,{children:[V.jsxs("div",{style:{height:"var(--statusbar-height)",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",paddingTop:"var(--safe-top)",flexShrink:0},children:[V.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,overflow:"hidden",flex:"1 1 auto"},children:V.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:"Claude Remote"})}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[V.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:N.color,display:"inline-block"}}),V.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:N.label})]}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[V.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:z.color,display:"inline-block"}}),V.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:z.label})]}),V.jsx("button",{onClick:()=>C(!0),"aria-label":"Settings",style:{width:44,height:44,marginRight:-12,borderRadius:8,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22},children:"⚙"})]})]}),V.jsx(om,{isOpen:f,onClose:()=>C(!1),onConfigSaved:K_})]})}function hm({containerRef:f}){return V.jsx("div",{ref:f,style:{flex:1,overflow:"hidden",background:"var(--bg-primary)"}})}const dm=q.forwardRef(function({onSend:C,disabled:D,isKeyboardOpen:A},H){const[N,z]=q.useState(""),s=q.useRef(null);q.useImperativeHandle(H,()=>({setText:g=>{z(g)},focus:()=>{var g;return(g=s.current)==null?void 0:g.focus()}}),[]);const c=q.useCallback(()=>{const g=N.trim();C(g),z("")},[N,C]),h=q.useCallback(g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),c())},[c]);return V.jsx("div",{"data-testid":"input-bar",style:{height:"var(--inputbar-height)",background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",display:"flex",alignItems:"center",padding:"8px 12px",paddingBottom:A?"8px":"calc(8px + var(--safe-bottom))",transition:"padding-bottom 0.25s ease-out",gap:8,flexShrink:0},children:V.jsx("textarea",{ref:s,"data-testid":"command-input",value:N,onChange:g=>z(g.target.value),onKeyDown:h,disabled:D,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Enter command or number to select…","aria-label":"Command input",style:Ls({flex:1,height:40,borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:16,fontFamily:"inherit"})})})}),Lg={height:36,borderRadius:6,border:"none",background:"var(--bg-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},fm={...Lg,minWidth:44,flexShrink:0,color:"var(--text-primary)",fontSize:13,padding:"0 12px"},_m={...Lg,minWidth:60,flexShrink:0,color:"var(--text-secondary)",fontSize:12,whiteSpace:"nowrap",padding:"0 12px"};function to(){document.activeElement instanceof HTMLElement&&document.activeElement.blur()}function Bc(f,C,D){f.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),C(D);const A=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};requestAnimationFrame(A),setTimeout(A,0)}function gm({onShortcut:f,onCommandSelect:C,onCommandSend:D,visible:A=!0}){const{shortcuts:H,commands:N,isLoading:z}=f0();return!A||z?null:V.jsxs("div",{"data-testid":"command-picker",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",flexShrink:0},children:[V.jsx("div",{"data-testid":"shortcut-bar","data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:H.map(s=>V.jsx("button",{type:"button",className:"cmd-picker-btn",onClick:c=>Bc(c,f,s.data),onTouchStart:to,onMouseDown:c=>{c.preventDefault(),to()},style:fm,children:s.label},s.label))}),V.jsx("div",{"data-testid":"command-buttons","data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:N.map(s=>{const c=s.autoSend??!0;return V.jsx("button",{type:"button",className:"cmd-picker-btn",onClick:h=>{c?Bc(h,D,s.command):Bc(h,C,s.command+" ")},onTouchStart:to,onMouseDown:h=>{h.preventDefault(),to()},style:_m,children:s.label},s.label)})}),V.jsx("style",{children:`
54
+ [data-scrollable]::-webkit-scrollbar {
55
+ display: none;
56
+ }
57
+ @media (prefers-reduced-motion: no-preference) {
58
+ .cmd-picker-btn:hover {
59
+ filter: brightness(1.2);
60
+ }
61
+ .cmd-picker-btn:active {
62
+ transform: scale(0.95);
63
+ filter: brightness(0.9);
64
+ }
65
+ }
66
+ @media (prefers-reduced-motion: reduce) {
67
+ .cmd-picker-btn:hover {
68
+ filter: brightness(1.2);
69
+ }
70
+ .cmd-picker-btn:active {
71
+ filter: brightness(0.9);
72
+ }
73
+ }
74
+ `})]})}function vm(){const f=zt(D=>D.activeInstanceId),C=at(D=>f?D.instanceConnectionStatus[f]??"disconnected":D.connectionStatus);return C==="connected"?null:V.jsx("div",{style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:C==="connecting"?"var(--status-waiting)":"var(--status-error)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:C==="connecting"?"Connecting…":"Disconnected. Reconnecting…"})}function pm(){const f=at(H=>H.ipChangeInfo),C=at(H=>H.setIpChangeInfo);if(!f)return null;const D=()=>{navigator.clipboard.writeText(f.newUrl),C(null)},A=()=>{C(null)};return V.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top) + 8px)",left:"50%",transform:"translateX(-50%)",zIndex:100,maxWidth:"calc(100% - 32px)",background:"var(--status-waiting)",color:"#fff",borderRadius:"8px",padding:"12px 16px",fontSize:"14px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column",gap:"8px"},children:[V.jsx("div",{style:{fontWeight:500},children:"IP Address Changed"}),V.jsxs("div",{style:{fontSize:"13px",opacity:.9},children:[f.oldIp," → ",f.newIp]}),V.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"4px"},children:[V.jsx("button",{onClick:D,style:{flex:1,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Copy New URL"}),V.jsx("button",{onClick:A,style:{background:"transparent",border:"1px solid rgba(255,255,255,0.3)",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Close"})]})]})}async function $c(){const f=await fetch("/api/instances",{credentials:"include"});if(f.status===401){const C=Ds();if(console.log("[fetchInstances] got 401, cachedToken =",C?"exists":"null"),C)try{console.log("[fetchInstances] attempting re-authentication...");const D=await Qi(C);if(console.log("[fetchInstances] re-auth result:",D),D){const A=await fetch("/api/instances",{credentials:"include"});if(A.ok)return console.log("[fetchInstances] retry succeeded"),A.json()}}catch(D){console.log("[fetchInstances] re-auth error:",D)}throw new Error("Unauthorized")}if(!f.ok)throw new Error(`Failed to fetch instances: ${f.status}`);return f.json()}function mm(f,C){return`${window.location.protocol}//${f}:${C}`}function Sm(f,C){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${f}:${C}/ws`}async function Mn(f,C,D){const A=mm(f,C);return(await fetch(`${A}/api/auth`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:D})})).ok}async function Tg(f,C){const D=await fetch(f,C);if(D.status===401){const A=Ds();if(A)try{if(await Qi(A))return fetch(f,C)}catch{}}return D}async function bm(){const f=await Tg("/api/instances/config",{credentials:"include"});if(f.status===401)throw new Error("Unauthorized");if(!f.ok)throw new Error(`Failed to get instance config: ${f.status}`);return f.json()}async function ym(f){const C=await Tg("/api/instances/create",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(f)});if(C.status===401)throw new Error("Unauthorized");if(!C.ok){const D=await C.json().catch(()=>({error:"Unknown error"}));throw new Error(D.error||`Failed to create instance: ${C.status}`)}return C.json()}const Cm=100,wm=300;var N_;const io=typeof window<"u"&&((N_=window.matchMedia)==null?void 0:N_.call(window,"(prefers-reduced-motion: reduce)").matches),Hc=300;function C_({options:f,value:C,onChange:D,placeholder:A="Select…",disabled:H=!1,id:N,emptyMessage:z="No options available",triggerIcon:s,getDisplayLabel:c}){const[h,g]=q.useState(!1),[a,p]=q.useState(!1),[m,w]=q.useState(-1),[_,n]=q.useState(0),[o,l]=q.useState(!1),u=q.useRef(null),S=q.useRef(0),E=q.useRef(0),b=q.useMemo(()=>f.find($=>$.value===C)??null,[f,C]),x=q.useMemo(()=>c?c(C):(b==null?void 0:b.label)||A,[c,C,b,A]),y=q.useCallback(()=>{H||f.length===0||(g(!0),w(-1))},[H,f.length]),R=q.useCallback(()=>{p(!1),n(0),io?g(!1):setTimeout(()=>g(!1),Hc)},[]),L=q.useCallback($=>{l(!0),S.current=$,E.current=Date.now(),n(0)},[]),I=q.useCallback($=>{if(!o)return;const Y=$-S.current;Y>0&&n(Y)},[o]),M=q.useCallback(()=>{if(!o)return;const $=_,Y=Date.now()-E.current,k=Y>0?$/(Y/1e3):0;$>Cm||$>50&&k>wm?R():n(0),l(!1)},[o,_,R]),B=q.useCallback($=>{D($.value),R()},[D,R]);if(q.useEffect(()=>{if(h){const $=setTimeout(()=>{p(!0)},io?0:10);return()=>clearTimeout($)}},[h]),q.useCallback($=>{const Y=f.length;switch($.key){case"ArrowDown":$.preventDefault(),w(k=>k<Y-1?k+1:0);break;case"ArrowUp":$.preventDefault(),w(k=>k>0?k-1:Y-1);break;case"Enter":$.preventDefault(),m>=0&&m<Y&&B(f[m]);break;case"Escape":$.preventDefault(),R();break}},[f,m,B,R]),f.length===0)return V.jsx("div",{style:Bt.emptyState,children:z});const G=io||o?"none":`transform ${Hc}ms ease-out`,X=io?"none":`background ${Hc}ms ease-out`,W=o?`translateY(${_}px)`:a?"translateY(0)":"translateY(100%)";return V.jsxs(V.Fragment,{children:[V.jsxs("button",{ref:u,type:"button",onClick:y,onTouchStart:()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()},disabled:H,id:N,style:{...Bt.trigger,...H?Bt.triggerDisabled:{}},"aria-haspopup":"listbox","aria-expanded":h,children:[s,V.jsx("span",{style:Bt.triggerText,children:x}),V.jsx("span",{style:Bt.triggerArrow,children:"▼"})]}),h&&V.jsx("div",{onClick:R,style:{...Bt.overlay,background:a?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transition:X},children:V.jsxs("div",{"data-testid":"action-sheet-panel",onClick:$=>$.stopPropagation(),style:{...Bt.sheet,transform:W,transition:G},children:[V.jsx("div",{"data-testid":"drag-handle",style:Bt.handle,onTouchStart:$=>L($.touches[0].clientY),onTouchMove:$=>I($.touches[0].clientY),onTouchEnd:M,onMouseDown:$=>L($.clientY),onMouseMove:$=>o&&I($.clientY),onMouseUp:M,onMouseLeave:M}),V.jsx("div",{style:Bt.listContainer,role:"listbox",children:f.length===0?V.jsx("div",{style:Bt.emptyList,children:z}):f.map(($,Y)=>V.jsxs("div",{role:"option","aria-selected":m===Y,onClick:()=>B($),onMouseEnter:()=>w(Y),style:{...Bt.option,...m===Y?Bt.optionHighlighted:{},...C===$.value?Bt.optionSelected:{}},children:[$.icon,V.jsxs("span",{style:Bt.optionLabel,children:[$.label,$.description&&V.jsxs("span",{style:Bt.optionDescriptionInline,children:[" (",$.description,")"]})]}),C===$.value&&V.jsx(xm,{})]},Y))})]})})]})}function xm(){return V.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:Bt.checkIcon,children:V.jsx("path",{d:"M3 8L6.5 11.5L13 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Bt={emptyState:{padding:"10px 12px",borderRadius:8,background:"var(--bg-tertiary)",color:"var(--text-secondary)",fontSize:13},trigger:{width:"100%",padding:"10px 12px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:8,textAlign:"left",boxSizing:"border-box",transition:"border-color 0.15s ease"},triggerDisabled:{opacity:.6,cursor:"not-allowed"},triggerText:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)"},triggerArrow:{fontSize:10,color:"var(--text-secondary)",marginLeft:"auto"},overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:1100},sheet:{width:"100%",maxWidth:480,maxHeight:"calc(80vh - env(safe-area-inset-bottom, 0px))",borderRadius:"16px 16px 0 0",background:"var(--bg-secondary)",boxShadow:"0 -4px 24px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",paddingBottom:"var(--safe-bottom)"},handle:{width:36,height:4,background:"var(--text-secondary)",opacity:.5,borderRadius:2,margin:"12px auto",flexShrink:0},listContainer:{flex:"1 1 auto",overflow:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",padding:"8px 0"},emptyList:{padding:"32px 16px",textAlign:"center",color:"var(--text-secondary)",fontSize:14},option:{display:"flex",alignItems:"center",gap:10,padding:"10px 16px",cursor:"pointer",transition:"background-color 0.1s ease"},optionHighlighted:{background:"rgba(88, 166, 255, 0.15)"},optionSelected:{background:"rgba(88, 166, 255, 0.08)"},optionLabel:{flex:1,minWidth:0,color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},optionDescriptionInline:{color:"var(--text-secondary)",fontSize:12},checkIcon:{marginLeft:"auto",flexShrink:0,color:"var(--status-running)"}};var U_;const Em=typeof window<"u"&&((U_=window.matchMedia)==null?void 0:U_.call(window,"(prefers-reduced-motion: reduce)").matches);function w_({options:f,value:C,onChange:D,disabled:A=!1,"aria-label":H}){const N=q.useRef(null),z=q.useRef([]),[s,c]=q.useState({}),h=f.findIndex(m=>m.value===C);q.useEffect(()=>{const m=N.current,w=z.current[h],_=()=>{if(w&&m){const n=m.getBoundingClientRect(),o=w.getBoundingClientRect(),l=o.left-n.left+m.scrollLeft-3,u=o.width;c({transform:`translateX(${l}px)`,width:`${u}px`})}};return _(),m==null||m.addEventListener("scroll",_),()=>{m==null||m.removeEventListener("scroll",_)}},[h,f]);const g=m=>{A||D(m)},a=(m,w)=>{var n;if(A)return;let _=w;switch(m.key){case"ArrowLeft":m.preventDefault(),_=w>0?w-1:f.length-1;break;case"ArrowRight":m.preventDefault(),_=w<f.length-1?w+1:0;break;case"Home":m.preventDefault(),_=0;break;case"End":m.preventDefault(),_=f.length-1;break;default:return}D(f[_].value),(n=z.current[_])==null||n.focus()},p={role:"radiogroup","aria-label":H};return V.jsxs("div",{ref:N,style:{...pi.container,...A?pi.containerDisabled:{}},...p,children:[V.jsx("div",{style:{...pi.indicator,...s,...Em?{}:pi.indicatorAnimated,...h===-1?pi.indicatorHidden:{}},"aria-hidden":"true"}),f.map((m,w)=>{const _=w===h;return V.jsxs("button",{ref:n=>{z.current[w]=n},type:"button",role:"radio",title:m.title,"aria-checked":_,disabled:A,onClick:()=>g(m.value),onKeyDown:n=>a(n,w),style:{...pi.option,..._?pi.optionSelected:{}},children:[m.icon&&V.jsx("span",{style:pi.icon,children:m.icon}),V.jsx("span",{style:pi.labelWrapper,children:V.jsx("span",{style:pi.label,children:m.label})}),m.description&&V.jsx("span",{style:pi.descriptionWrapper,children:V.jsx("span",{style:pi.description,children:m.description})})]},String(m.value))})]})}const pi={container:{display:"flex",maxWidth:"100%",overflowX:"auto",background:"var(--bg-tertiary)",borderRadius:10,padding:3,position:"relative",gap:2,scrollbarWidth:"none",msOverflowStyle:"none"},containerDisabled:{opacity:.6,cursor:"not-allowed"},indicator:{position:"absolute",top:3,bottom:3,background:"var(--status-running)",borderRadius:7,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15)",zIndex:0},indicatorAnimated:{transition:"transform 0.2s ease, width 0.2s ease"},indicatorHidden:{opacity:0},option:{flexShrink:0,minWidth:80,minHeight:44,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",zIndex:1,color:"var(--text-secondary)",background:"transparent",border:"none",borderRadius:7,padding:"6px 8px",cursor:"pointer",transition:"color 0.15s ease",fontFamily:"var(--font-sans)",fontSize:14,lineHeight:1.2,overflow:"visible"},optionSelected:{color:"#fff",fontWeight:500},icon:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:2,flexShrink:0},labelWrapper:{textAlign:"center",maxWidth:"100%"},label:{whiteSpace:"nowrap"},descriptionWrapper:{textAlign:"center",maxWidth:"100%"},description:{fontSize:11,opacity:.8,marginTop:1,whiteSpace:"nowrap"}};function x_(f){const C=f.split("/").filter(Boolean);return C[C.length-1]||f}function Rm(f){const C=f.split("/").filter(Boolean);return C.length<=1?f:".../"+C[C.length-2]}function E_(){return V.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:[V.jsx("path",{d:"M2 4C2 3.44772 2.44772 3 3 3H6.17157C6.43678 3 6.69114 3.10536 6.87868 3.29289L7.58579 4H13C13.5523 4 14 4.44772 14 5V12C14 12.5523 13.5523 13 13 13H3C2.44772 13 2 12.5523 2 12V4Z",fill:"currentColor",opacity:"0.6"}),V.jsx("path",{d:"M2 5.5V12C2 12.5523 2.44772 13 3 13H13C13.5523 13 14 12.5523 14 12V5.5C14 5.22386 13.7761 5 13.5 5H2.5C2.22386 5 2 5.22386 2 5.5Z",fill:"currentColor"})]})}function R_(){return V.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:[V.jsx("path",{d:"M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),V.jsx("path",{d:"M12.9247 8.99999C12.9692 8.66999 13 8.33749 13 7.99999C13 7.66249 12.9692 7.32999 12.9247 6.99999L14.3622 5.91249C14.4872 5.81249 14.5197 5.63749 14.4372 5.48749L13.0622 3.01249C12.9797 2.86249 12.8122 2.81249 12.6622 2.86249L10.9247 3.51249C10.4247 3.13749 9.87468 2.82499 9.28718 2.58749L9.01218 0.787487C8.98718 0.624987 8.84968 0.499987 8.68718 0.499987H5.93718C5.77468 0.499987 5.63718 0.624987 5.61218 0.787487L5.33718 2.58749C4.74968 2.82499 4.19968 3.14999 3.69968 3.51249L1.96218 2.86249C1.81218 2.81249 1.64468 2.86249 1.56218 3.01249L0.187178 5.49999C0.099678 5.64999 0.137178 5.82499 0.262178 5.92499L1.69968 6.99999C1.65518 7.32999 1.62468 7.66249 1.62468 7.99999C1.62468 8.33749 1.65518 8.66999 1.69968 8.99999L0.262178 10.0875C0.137178 10.1875 0.104678 10.3625 0.187178 10.5125L1.56218 12.9875C1.64468 13.1375 1.81218 13.1875 1.96218 13.1375L3.69968 12.4875C4.19968 12.8625 4.74968 13.175 5.33718 13.4125L5.61218 15.2125C5.63718 15.375 5.77468 15.5 5.93718 15.5H8.68718C8.84968 15.5 8.98718 15.375 9.01218 15.2125L9.28718 13.4125C9.87468 13.175 10.4247 12.85 10.9247 12.4875L12.6622 13.1375C12.8122 13.1875 12.9797 13.1375 13.0622 12.9875L14.4372 10.5C14.5197 10.35 14.4872 10.175 14.3622 10.075L12.9247 8.99999ZM8 10.5C6.62468 10.5 5.49968 9.37499 5.49968 7.99999C5.49968 6.62499 6.62468 5.49999 8 5.49999C9.37532 5.49999 10.5003 6.62499 10.5003 7.99999C10.5003 9.37499 9.37532 10.5 8 10.5Z",fill:"currentColor",opacity:"0.8"})]})}function Am(){return V.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:V.jsx("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.5"})})}function Dm({isOpen:f,onClose:C,onSuccess:D,copySource:A}){const[H,N]=q.useState(null),[z,s]=q.useState(""),[c,h]=q.useState(""),[g,a]=q.useState(""),[p,m]=q.useState(""),[w,_]=q.useState(!1),[n,o]=q.useState(null),l=q.useRef(null),u=q.useMemo(()=>H?H.workspaces.map(M=>({value:M,label:x_(M),description:Rm(M),icon:V.jsx(E_,{})})):[],[H]),S=q.useMemo(()=>H?H.workspaces.map(M=>({value:M,label:x_(M)})):[],[H]),E=H?H.workspaces.length<=4:!1,b=q.useMemo(()=>{if(!H)return[];const M=[{value:"",label:"None",title:"No settings file"}];return H.settingsFiles.forEach(B=>{M.push({value:B.filename,label:B.displayName,title:`${B.directoryPath}/${B.filename}`})}),M},[H]),x=H?H.settingsFiles.length+1<=4:!1,y=q.useMemo(()=>{if(!H)return[];const M=[{value:"",label:"None",icon:V.jsx(Am,{})}];return H.settingsFiles.forEach(B=>{M.push({value:B.filename,label:B.displayName,description:B.directory,icon:V.jsx(R_,{})})}),M},[H]);q.useEffect(()=>{if(f&&(R(!!A),s(""),h(""),a(""),m(""),o(null),l.current=null,A&&(s(A.cwd),h(`${A.name}-copy`),A.claudeArgs&&A.claudeArgs.length>0))){const M=[...A.claudeArgs],B=M.indexOf("--settings");B!==-1&&B+1<M.length&&(l.current=M[B+1],M.splice(B,2)),m(M.join(" "))}},[f,A]),q.useEffect(()=>{if(H&&l.current){const M=H.settingsFiles.find(B=>`${B.directoryPath}/${B.filename}`===l.current);M&&a(M.filename),l.current=null}},[H]);const R=async M=>{try{const B=await bm();N(B),!M&&B.claudeArgs.length>0&&m(B.claudeArgs.join(" "))}catch(B){console.error("Failed to load instance config:",B),o("Failed to load configuration")}},L=async()=>{if(!z){o("Please select a working directory");return}_(!0),o(null);try{const M=[];if(g&&H){const G=H.settingsFiles.find(X=>X.filename===g);G&&M.push("--settings",`${G.directoryPath}/${G.filename}`)}p.trim()&&M.push(...p.trim().split(/\s+/).filter(Boolean)),await ym({cwd:z,name:c.trim()||void 0,claudeArgs:M.length>0?M:void 0});const B=c.trim()||z.split("/").pop()||"unknown";D(B),C()}catch(M){console.error("Failed to create instance:",M),o(M instanceof Error?M.message:"Failed to create instance")}finally{_(!1)}},I=H&&H.workspaces.length>0;return V.jsx(Dg,{isOpen:f,onClose:C,title:A?"Copy Instance":"Create New Instance",footer:V.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:8},children:[V.jsx("button",{onClick:C,style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"Cancel"}),V.jsx("button",{onClick:L,disabled:w||!I,style:{padding:"8px 20px",borderRadius:6,border:"none",background:w||!I?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:w||!I?"default":"pointer",opacity:w||!I?.7:1},children:w?A?"Copying…":"Creating…":A?"Copy":"Create"})]}),children:V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,paddingBottom:16},children:[V.jsxs("div",{children:[V.jsx("label",{htmlFor:"cwd-select",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Working Directory *"}),E?V.jsx(w_,{options:S,value:z,onChange:s,disabled:!I,"aria-label":"Working directory"}):V.jsx(C_,{id:"cwd-select",options:u,value:z||null,onChange:s,placeholder:"Select working directory…",emptyMessage:"No workspaces available",disabled:!I,triggerIcon:V.jsx(E_,{})}),!I&&V.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:6,opacity:.8},children:"Please configure workspaces in the config file first, or start an instance via CLI."})]}),V.jsxs("div",{children:[V.jsx("label",{htmlFor:"instance-name",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Instance Name (optional)"}),V.jsx("textarea",{id:"instance-name",value:c,onChange:M=>h(M.target.value),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Defaults to working directory name",style:Ls({borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)"})})]}),H&&H.settingsFiles.length>0&&V.jsxs("div",{children:[V.jsx("label",{htmlFor:"settings-select",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Settings File (optional)"}),x?V.jsx(w_,{options:b,value:g,onChange:a,"aria-label":"Settings file"}):V.jsx(C_,{id:"settings-select",options:y,value:g||null,onChange:a,placeholder:"None",triggerIcon:V.jsx(R_,{})}),V.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:4,opacity:.7},children:"Custom Claude settings from ~/.claude/ or ~/.claude-remote/settings/"})]}),V.jsxs("div",{children:[V.jsx("label",{htmlFor:"claude-args",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Claude Arguments (optional)"}),V.jsx("textarea",{id:"claude-args",value:p,onChange:M=>m(M.target.value),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"e.g., chat --model claude-sonnet-4-6",style:Ls({borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)"})}),V.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:4,opacity:.7},children:"Multiple arguments separated by spaces (quoted arguments with spaces not supported)"})]}),n&&V.jsx("div",{style:{padding:"10px 12px",borderRadius:8,background:"rgba(255, 59, 48, 0.1)",color:"var(--status-error)",fontSize:13},children:n})]})})}function A_(f,C,D=140,A=44){const H=window.innerWidth-D-8,N=window.innerHeight-A-8;return{x:Math.max(8,Math.min(f,H)),y:Math.max(8,Math.min(C,N))}}function Lm({onSwitch:f,onCopySuccess:C}){const D=zt(b=>b.instances),A=zt(b=>b.setInstances),H=zt(b=>b.activeInstanceId),[N,z]=q.useState(!1),[s,c]=q.useState(null),[h,g]=q.useState(null),[a,p]=q.useState({x:0,y:0}),m=q.useRef(null),w=q.useRef(!1);q.useEffect(()=>{const b=()=>{g(null)};if(h)return document.addEventListener("click",b),()=>document.removeEventListener("click",b)},[h]);const _=(b,x)=>{w.current=!1;const{clientX:y,clientY:R}=x.touches[0];m.current=setTimeout(()=>{w.current=!0,p(A_(y,R)),g(b)},500)},n=()=>{m.current&&(clearTimeout(m.current),m.current=null)},o=q.useCallback(b=>{if(w.current){w.current=!1;return}f(b)},[f]),l=(b,x)=>{x.preventDefault(),p(A_(x.clientX,x.clientY)),g(b)},u=()=>{h&&(c(h),z(!0),g(null))},S=async b=>{for(let y=0;y<5;y++){await new Promise(R=>setTimeout(R,1e3));try{const R=await $c();if([...R].filter(I=>I.name===b).sort((I,M)=>M.startedAt.localeCompare(I.startedAt))[0]){A(R),s&&C&&C(b);return}}catch(R){console.error("[InstanceTabs] Failed to fetch instances:",R)}}try{const y=await $c();A(y)}catch{}},E=()=>{z(!1),c(null)};return V.jsxs(V.Fragment,{children:[V.jsxs("div",{"data-testid":"instance-tabs",style:{display:"flex",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[V.jsx("div",{style:{display:"flex",overflowX:"auto",padding:"0 4px 0 16px",flex:1},children:D.map(b=>{const x=b.instanceId===H;return V.jsxs("button",{"data-testid":"instance-tab",onClick:()=>o(b.instanceId),onTouchStart:y=>_(b,y),onTouchEnd:n,onTouchMove:n,onContextMenu:y=>l(b,y),style:{padding:"8px 16px",background:"transparent",border:"none",borderBottom:x?"2px solid var(--accent-color, #007aff)":"2px solid transparent",color:x?"var(--text-primary)":"var(--text-secondary)",fontSize:13,fontWeight:x?600:400,cursor:"pointer",whiteSpace:"nowrap",flexShrink:0},children:[b.name,V.jsxs("span",{style:{marginLeft:6,fontSize:11,color:"var(--text-tertiary, var(--text-secondary))",opacity:.7},children:[":",b.port]})]},b.instanceId)})}),V.jsx("button",{onClick:()=>z(!0),"aria-label":"Create new instance",style:{width:44,height:44,padding:0,background:"transparent",border:"none",borderLeft:"1px solid var(--border-color)",color:"var(--text-secondary)",fontSize:22,fontWeight:600,cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:"+"})]}),h&&V.jsx("div",{onClick:b=>b.stopPropagation(),style:{position:"fixed",left:a.x,top:a.y,zIndex:1100,background:"var(--bg-secondary)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.3)",overflow:"hidden",minWidth:140},children:V.jsx("button",{onClick:u,style:{display:"block",width:"100%",padding:"12px 16px",background:"transparent",border:"none",color:"var(--text-primary)",fontSize:14,textAlign:"left",cursor:"pointer"},children:"Copy Instance"})}),V.jsx(Dm,{isOpen:N,onClose:E,onSuccess:S,copySource:s})]})}function Tm({visible:f,onClick:C}){const[D,A]=q.useState(!1);q.useEffect(()=>{f&&A(!0)},[f]);const H=()=>{f||A(!1)};return D?V.jsx("button",{className:`scroll-to-bottom-btn ${f?"visible":"hidden"}`,onClick:C,onAnimationEnd:H,"aria-label":"Jump to latest output",children:"↓"}):null}const D_="__default__",L_=[1e3,2e3,4e3,8e3,16e3,3e4];function Mm(f,C,D=D_){const A=q.useRef(null),H=q.useRef(0),N=q.useRef(void 0),z=q.useRef(f),s=q.useRef(0),c=q.useRef(!1),h=at(u=>u.setConnectionStatus),g=q.useRef(h),a=at(u=>u.setInstanceConnectionStatus),p=q.useRef(a),m=q.useCallback(u=>{D===D_&&g.current(u),p.current(D,u)},[D]);q.useEffect(()=>{z.current=f},[f]),q.useEffect(()=>{g.current=h},[h]),q.useEffect(()=>{p.current=a},[a]);const w=q.useRef(void 0),_=q.useCallback(u=>{const S=L_[Math.min(H.current,L_.length-1)];H.current++,N.current=setTimeout(()=>{var E;c.current||u!==s.current||(E=w.current)==null||E.call(w)},S)},[]),n=q.useCallback(async()=>{if(A.current&&A.current.readyState===WebSocket.OPEN)return;const u=C??`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;N.current&&(clearTimeout(N.current),N.current=void 0),c.current=!1;const S=++s.current;if(m("connecting"),C){const b=Ds();if(b)try{const x=new URL(C),y=Number(x.port||(x.protocol==="wss:"?"443":"80"));if(console.log("[useWebSocket] connecting to remote instance, authenticating first..."),!await Mn(x.hostname,y,b)){console.log("[useWebSocket] auth failed, will retry..."),_(S);return}console.log("[useWebSocket] auth successful, creating WebSocket...")}catch(x){console.log("[useWebSocket] auth error:",x),_(S);return}else console.log("[useWebSocket] no cached token for remote instance, connecting anyway...")}if(c.current||S!==s.current)return;const E=new WebSocket(u);A.current=E,E.onopen=()=>{c.current||S!==s.current||A.current!==E||(m("connected"),H.current=0)},E.onmessage=b=>{if(!(c.current||S!==s.current||A.current!==E))try{const x=JSON.parse(b.data);z.current(x)}catch{}},E.onclose=async()=>{if(c.current||S!==s.current||A.current!==E)return;A.current=null,m("disconnected");const b=Ds();if(console.log("[useWebSocket] onclose: cachedToken =",b?"exists":"null"),b)try{console.log("[useWebSocket] attempting re-authentication...");let x=!1;if(C){const y=new URL(C),R=Number(y.port||(y.protocol==="wss:"?"443":"80"));x=await Mn(y.hostname,R,b)}else x=await Qi(b);console.log("[useWebSocket] re-auth result:",x)}catch(x){console.log("[useWebSocket] re-auth error:",x)}_(S)},E.onerror=()=>{}},[_,m,C]);q.useEffect(()=>{w.current=n},[n]);const o=q.useCallback(u=>{var S;return((S=A.current)==null?void 0:S.readyState)===WebSocket.OPEN?(A.current.send(JSON.stringify(u)),!0):!1},[]),l=q.useCallback(()=>{c.current=!0,s.current++,N.current&&(clearTimeout(N.current),N.current=void 0);const u=A.current;A.current=null,u==null||u.close()},[]);return q.useEffect(()=>{const u=()=>{var S;(S=A.current)==null||S.close()};return window.addEventListener("offline",u),()=>{c.current=!0,s.current++,window.removeEventListener("offline",u),N.current&&(clearTimeout(N.current),N.current=void 0);const S=A.current;A.current=null,S==null||S.close()}},[]),{connect:n,disconnect:l,send:o}}var zc={exports:{}},T_;function km(){return T_||(T_=1,(function(f,C){(function(D,A){f.exports=A()})(globalThis,(()=>(()=>{var D={4567:function(z,s,c){var h=this&&this.__decorate||function(l,u,S,E){var b,x=arguments.length,y=x<3?u:E===null?E=Object.getOwnPropertyDescriptor(u,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(l,u,S,E);else for(var R=l.length-1;R>=0;R--)(b=l[R])&&(y=(x<3?b(y):x>3?b(u,S,y):b(u,S))||y);return x>3&&y&&Object.defineProperty(u,S,y),y},g=this&&this.__param||function(l,u){return function(S,E){u(S,E,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const a=c(9042),p=c(9924),m=c(844),w=c(4725),_=c(2585),n=c(3656);let o=s.AccessibilityManager=class extends m.Disposable{constructor(l,u,S,E){super(),this._terminal=l,this._coreBrowserService=S,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let b=0;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);if(this._topBoundaryFocusListener=b=>this._handleBoundaryFocus(b,0),this._bottomBoundaryFocusListener=b=>this._handleBoundaryFocus(b,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((b=>this._handleResize(b.rows)))),this.register(this._terminal.onRender((b=>this._refreshRows(b.start,b.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((b=>this._handleChar(b)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
75
+ `)))),this.register(this._terminal.onA11yTab((b=>this._handleTab(b)))),this.register(this._terminal.onKey((b=>this._handleKey(b.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(l){for(let u=0;u<l;u++)this._handleChar(" ")}_handleChar(l){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===`
76
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(l){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(l)||this._charsToConsume.push(l)}_refreshRows(l,u){this._liveRegionDebouncer.refresh(l,u,this._terminal.rows)}_renderRows(l,u){const S=this._terminal.buffer,E=S.lines.length.toString();for(let b=l;b<=u;b++){const x=S.lines.get(S.ydisp+b),y=[],R=(x==null?void 0:x.translateToString(!0,void 0,void 0,y))||"",L=(S.ydisp+b+1).toString(),I=this._rowElements[b];I&&(R.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=R,this._rowColumns.set(I,y)),I.setAttribute("aria-posinset",L),I.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(l,u){const S=l.target,E=this._rowElements[u===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(u===0?"1":`${this._terminal.buffer.lines.length}`)||l.relatedTarget!==E)return;let b,x;if(u===0?(b=S,x=this._rowElements.pop(),this._rowContainer.removeChild(x)):(b=this._rowElements.shift(),x=S,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),x.removeEventListener("focus",this._bottomBoundaryFocusListener),u===0){const y=this._createAccessibilityTreeNode();this._rowElements.unshift(y),this._rowContainer.insertAdjacentElement("afterbegin",y)}else{const y=this._createAccessibilityTreeNode();this._rowElements.push(y),this._rowContainer.appendChild(y)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(u===0?-1:1),this._rowElements[u===0?1:this._rowElements.length-2].focus(),l.preventDefault(),l.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const l=document.getSelection();if(!l)return;if(l.isCollapsed)return void(this._rowContainer.contains(l.anchorNode)&&this._terminal.clearSelection());if(!l.anchorNode||!l.focusNode)return void console.error("anchorNode and/or focusNode are null");let u={node:l.anchorNode,offset:l.anchorOffset},S={node:l.focusNode,offset:l.focusOffset};if((u.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||u.node===S.node&&u.offset>S.offset)&&([u,S]=[S,u]),u.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(u={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(u.node))return;const E=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:E,offset:((R=E.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(S.node))return;const b=({node:L,offset:I})=>{const M=L instanceof Text?L.parentNode:L;let B=parseInt(M==null?void 0:M.getAttribute("aria-posinset"),10)-1;if(isNaN(B))return console.warn("row is invalid. Race condition?"),null;const G=this._rowColumns.get(M);if(!G)return console.warn("columns is null. Race condition?"),null;let X=I<G.length?G[I]:G.slice(-1)[0]+1;return X>=this._terminal.cols&&(++B,X=0),{row:B,column:X}},x=b(u),y=b(S);if(x&&y){if(x.row>y.row||x.row===y.row&&x.column>=y.column)throw new Error("invalid range");this._terminal.select(x.column,x.row,(y.row-x.row)*this._terminal.cols-x.column+y.column)}}_handleResize(l){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let u=this._rowContainer.children.length;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);for(;this._rowElements.length>l;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const l=this._coreBrowserService.mainDocument.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let l=0;l<this._terminal.rows;l++)this._refreshRowDimensions(this._rowElements[l])}}_refreshRowDimensions(l){l.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=o=h([g(1,_.IInstantiationService),g(2,w.ICoreBrowserService),g(3,w.IRenderService)],o)},3614:(z,s)=>{function c(p){return p.replace(/\r?\n/g,"\r")}function h(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function g(p,m,w,_){p=h(p=c(p),w.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(p,!0),m.value=""}function a(p,m,w){const _=w.getBoundingClientRect(),n=p.clientX-_.left-10,o=p.clientY-_.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${n}px`,m.style.top=`${o}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=c,s.bracketTextForPaste=h,s.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},s.handlePasteEvent=function(p,m,w,_){p.stopPropagation(),p.clipboardData&&g(p.clipboardData.getData("text/plain"),m,w,_)},s.paste=g,s.moveTextAreaUnderMouseCursor=a,s.rightClickHandler=function(p,m,w,_,n){a(p,m,w),n&&_.rightClickSelect(p),m.value=_.selectionText,m.select()}},7239:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const h=c(1505);s.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(g,a,p){this._css.set(g,a,p)}getCss(g,a){return this._css.get(g,a)}setColor(g,a,p){this._color.set(g,a,p)}getColor(g,a){return this._color.get(g,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(c,h,g,a){c.addEventListener(h,g,a);let p=!1;return{dispose:()=>{p||(p=!0,c.removeEventListener(h,g,a))}}}},3551:function(z,s,c){var h=this&&this.__decorate||function(o,l,u,S){var E,b=arguments.length,x=b<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,u,S);else for(var y=o.length-1;y>=0;y--)(E=o[y])&&(x=(b<3?E(x):b>3?E(l,u,x):E(l,u))||x);return b>3&&x&&Object.defineProperty(l,u,x),x},g=this&&this.__param||function(o,l){return function(u,S){l(u,S,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const a=c(3656),p=c(8460),m=c(844),w=c(2585),_=c(4725);let n=s.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(o,l,u,S,E){super(),this._element=o,this._mouseService=l,this._renderService=u,this._bufferService=S,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var b;this._lastMouseEvent=void 0,(b=this._activeProviderReplies)==null||b.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(o){this._lastMouseEvent=o;const l=this._positionFromMouseEvent(o,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const u=o.composedPath();for(let S=0;S<u.length;S++){const E=u[S];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_handleHover(o){if(this._activeLine!==o.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(o,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,o)||(this._clearCurrentLink(),this._askForLink(o,!0))}_askForLink(o,l){var S,E;this._activeProviderReplies&&l||((S=this._activeProviderReplies)==null||S.forEach((b=>{b==null||b.forEach((x=>{x.link.dispose&&x.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=o.y);let u=!1;for(const[b,x]of this._linkProviderService.linkProviders.entries())l?(E=this._activeProviderReplies)!=null&&E.get(b)&&(u=this._checkLinkProviderResult(b,o,u)):x.provideLinks(o.y,(y=>{var L,I;if(this._isMouseOut)return;const R=y==null?void 0:y.map((M=>({link:M})));(L=this._activeProviderReplies)==null||L.set(b,R),u=this._checkLinkProviderResult(b,o,u),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(o.y,this._activeProviderReplies)}))}_removeIntersectingLinks(o,l){const u=new Set;for(let S=0;S<l.size;S++){const E=l.get(S);if(E)for(let b=0;b<E.length;b++){const x=E[b],y=x.link.range.start.y<o?0:x.link.range.start.x,R=x.link.range.end.y>o?this._bufferService.cols:x.link.range.end.x;for(let L=y;L<=R;L++){if(u.has(L)){E.splice(b--,1);break}u.add(L)}}}}_checkLinkProviderResult(o,l,u){var b;if(!this._activeProviderReplies)return u;const S=this._activeProviderReplies.get(o);let E=!1;for(let x=0;x<o;x++)this._activeProviderReplies.has(x)&&!this._activeProviderReplies.get(x)||(E=!0);if(!E&&S){const x=S.find((y=>this._linkAtPosition(y.link,l)));x&&(u=!0,this._handleNewLink(x))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!u)for(let x=0;x<this._activeProviderReplies.size;x++){const y=(b=this._activeProviderReplies.get(x))==null?void 0:b.find((R=>this._linkAtPosition(R.link,l)));if(y){u=!0,this._handleNewLink(y);break}}return u}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(o){if(!this._currentLink)return;const l=this._positionFromMouseEvent(o,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(o,this._currentLink.link.text)}_clearCurrentLink(o,l){this._currentLink&&this._lastMouseEvent&&(!o||!l||this._currentLink.link.range.start.y>=o&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(o){if(!this._lastMouseEvent)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(o.link,l)&&(this._currentLink=o,this._currentLink.state={decorations:{underline:o.link.decorations===void 0||o.link.decorations.underline,pointerCursor:o.link.decorations===void 0||o.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,o.link,this._lastMouseEvent),o.link.decorations={},Object.defineProperties(o.link.decorations,{pointerCursor:{get:()=>{var u,S;return(S=(u=this._currentLink)==null?void 0:u.state)==null?void 0:S.decorations.pointerCursor},set:u=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==u&&(this._currentLink.state.decorations.pointerCursor=u,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",u))}},underline:{get:()=>{var u,S;return(S=(u=this._currentLink)==null?void 0:u.state)==null?void 0:S.decorations.underline},set:u=>{var S,E,b;(S=this._currentLink)!=null&&S.state&&((b=(E=this._currentLink)==null?void 0:E.state)==null?void 0:b.decorations.underline)!==u&&(this._currentLink.state.decorations.underline=u,this._currentLink.state.isHovered&&this._fireUnderlineEvent(o.link,u))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((u=>{if(!this._currentLink)return;const S=u.start===0?0:u.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+u.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(S,E),this._lastMouseEvent)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}}))))}_linkHover(o,l,u){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&o.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(u,l.text)}_fireUnderlineEvent(o,l){const u=o.range,S=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(u.start.x-1,u.start.y-S-1,u.end.x,u.end.y-S-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(o,l,u){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&o.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(u,l.text)}_linkAtPosition(o,l){const u=o.range.start.y*this._bufferService.cols+o.range.start.x,S=o.range.end.y*this._bufferService.cols+o.range.end.x,E=l.y*this._bufferService.cols+l.x;return u<=E&&E<=S}_positionFromMouseEvent(o,l,u){const S=u.getCoords(o,l,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(o,l,u,S,E){return{x1:o,y1:l,x2:u,y2:S,cols:this._bufferService.cols,fg:E}}};s.Linkifier=n=h([g(1,_.IMouseService),g(2,_.IRenderService),g(3,w.IBufferService),g(4,_.ILinkProviderService)],n)},9042:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(z,s,c){var h=this&&this.__decorate||function(_,n,o,l){var u,S=arguments.length,E=S<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,n,o,l);else for(var b=_.length-1;b>=0;b--)(u=_[b])&&(E=(S<3?u(E):S>3?u(n,o,E):u(n,o))||E);return S>3&&E&&Object.defineProperty(n,o,E),E},g=this&&this.__param||function(_,n){return function(o,l){n(o,l,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const a=c(511),p=c(2585);let m=s.OscLinkProvider=class{constructor(_,n,o){this._bufferService=_,this._optionsService=n,this._oscLinkService=o}provideLinks(_,n){var R;const o=this._bufferService.buffer.lines.get(_-1);if(!o)return void n(void 0);const l=[],u=this._optionsService.rawOptions.linkHandler,S=new a.CellData,E=o.getTrimmedLength();let b=-1,x=-1,y=!1;for(let L=0;L<E;L++)if(x!==-1||o.hasContent(L)){if(o.loadCell(L,S),S.hasExtendedAttrs()&&S.extended.urlId){if(x===-1){x=L,b=S.extended.urlId;continue}y=S.extended.urlId!==b}else x!==-1&&(y=!0);if(y||x!==-1&&L===E-1){const I=(R=this._oscLinkService.getLinkData(b))==null?void 0:R.uri;if(I){const M={start:{x:x+1,y:_},end:{x:L+(y||L!==E-1?0:1),y:_}};let B=!1;if(!(u!=null&&u.allowNonHttpProtocols))try{const G=new URL(I);["http:","https:"].includes(G.protocol)||(B=!0)}catch{B=!0}B||l.push({text:I,range:M,activate:(G,X)=>u?u.activate(G,X,M):w(0,X),hover:(G,X)=>{var W;return(W=u==null?void 0:u.hover)==null?void 0:W.call(u,G,X,M)},leave:(G,X)=>{var W;return(W=u==null?void 0:u.leave)==null?void 0:W.call(u,G,X,M)}})}y=!1,S.hasExtendedAttrs()&&S.extended.urlId?(x=L,b=S.extended.urlId):(x=-1,b=-1)}}n(l)}};function w(_,n){if(confirm(`Do you want to navigate to ${n}?
77
+
78
+ WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=m=h([g(0,p.IBufferService),g(1,p.IOptionsService),g(2,p.IOscLinkService)],m)},6193:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const h=c(3614),g=c(3656),a=c(3551),p=c(9042),m=c(3730),w=c(1680),_=c(3107),n=c(5744),o=c(2950),l=c(1296),u=c(428),S=c(4269),E=c(5114),b=c(8934),x=c(3230),y=c(9312),R=c(4725),L=c(6731),I=c(8055),M=c(8969),B=c(8460),G=c(844),X=c(6114),W=c(8437),$=c(2584),Y=c(7399),k=c(5941),F=c(9074),O=c(2585),U=c(5435),Q=c(4567),ee=c(779);class he extends M.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(K={}){super(K),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new G.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(F.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,ne)=>this.refresh(P,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((P=>this._reportWindowsOptions(P)))),this.register(this._inputHandler.onColor((P=>this._handleColorEvent(P)))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((P=>this._afterResize(P.cols,P.rows)))),this.register((0,G.toDisposable)((()=>{var P,ne;this._customKeyEventHandler=void 0,(ne=(P=this.element)==null?void 0:P.parentNode)==null||ne.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const P of K){let ne,ie="";switch(P.index){case 256:ne="foreground",ie="10";break;case 257:ne="background",ie="11";break;case 258:ne="cursor",ie="12";break;default:ne="ansi",ie="4;"+P.index}switch(P.type){case 0:const _e=I.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${ie};${(0,k.toRgbString)(_e)}${$.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((fe=>fe.ansi[P.index]=I.channels.toColor(...P.color)));else{const fe=ne;this._themeService.modifyColors((ye=>ye[fe]=I.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const K=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(K);if(!P)return;const ne=Math.min(this.buffer.x,this.cols-1),ie=this._renderService.dimensions.css.cell.height,_e=P.getWidth(ne),fe=this._renderService.dimensions.css.cell.width*_e,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,ve=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ve+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=ie+"px",this.textarea.style.lineHeight=ie+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,h.copyHandler)(P,this._selectionService)})));const K=P=>(0,h.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,g.addDisposableDomListener)(this.element,"paste",K)),X.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,h.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,h.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,h.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var ne;if(!K)throw new Error("Terminal requires a parent element.");if(K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ne=this.element)==null?void 0:ne.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=K.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"),K.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(ie=>this.updateCursorStyle(ie)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),X.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,K.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(ie=>this._handleTextAreaFocus(ie)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(u.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(x.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ie=>this._onRender.fire(ie)))),this.onResize((ie=>this._renderService.resize(ie.cols,ie.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ie=>this.scrollLines(ie.amount,ie.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(y.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ie=>this.scrollLines(ie.amount,ie.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ie=>this._renderService.handleSelectionChanged(ie.start,ie.end,ie.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ie=>{this.textarea.value=ie,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ie=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(ie=>this._selectionService.handleMouseDown(ie)))),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(Q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ie=>this._handleScreenReaderModeOptionChange(ie)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ie=>{!this._overviewRulerRenderer&&ie&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,P=this.element;function ne(fe){const ye=K._mouseService.getMouseReportCoords(fe,K.screenElement);if(!ye)return!1;let ve,Te;switch(fe.overrideType||fe.type){case"mousemove":Te=32,fe.buttons===void 0?(ve=3,fe.button!==void 0&&(ve=fe.button<3?fe.button:3)):ve=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Te=0,ve=fe.button<3?fe.button:3;break;case"mousedown":Te=1,ve=fe.button<3?fe.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(fe)===!1||K.viewport.getLinesScrolled(fe)===0)return!1;Te=fe.deltaY<0?0:1,ve=4;break;default:return!1}return!(Te===void 0||ve===void 0||ve>4)&&K.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:ve,action:Te,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const ie={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:fe=>(ne(fe),fe.buttons||(this._document.removeEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.removeEventListener("mousemove",ie.mousedrag)),this.cancel(fe)),wheel:fe=>(ne(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&ne(fe)},mousemove:fe=>{fe.buttons||ne(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&fe?ie.mousemove||(P.addEventListener("mousemove",_e.mousemove),ie.mousemove=_e.mousemove):(P.removeEventListener("mousemove",ie.mousemove),ie.mousemove=null),16&fe?ie.wheel||(P.addEventListener("wheel",_e.wheel,{passive:!1}),ie.wheel=_e.wheel):(P.removeEventListener("wheel",ie.wheel),ie.wheel=null),2&fe?ie.mouseup||(ie.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",ie.mouseup),ie.mouseup=null),4&fe?ie.mousedrag||(ie.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",ie.mousedrag),ie.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(P,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return ne(fe),ie.mouseup&&this._document.addEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.addEventListener("mousemove",ie.mousedrag),this.cancel(fe)}))),this.register((0,g.addDisposableDomListener)(P,"wheel",(fe=>{if(!ie.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(fe);if(ye===0)return;const ve=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Te="";for(let Pe=0;Pe<Math.abs(ye);Pe++)Te+=ve;return this.coreService.triggerDataEvent(Te,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(P,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(P,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(K,P){var ne;(ne=this._renderService)==null||ne.refreshRows(K,P)}updateCursorStyle(K){var P;(P=this._selectionService)!=null&&P.shouldColumnSelect(K)?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(K,P,ne=0){var ie;ne===1?(super.scrollLines(K,P,ne),this.refresh(0,this.rows-1)):(ie=this.viewport)==null||ie.scrollLines(K)}paste(K){(0,h.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,P,ne){this._selectionService.setSelection(K,P,ne)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,P){var ne;(ne=this._selectionService)==null||ne.selectLines(K,P)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!P&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,Y.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),ne.type===3||ne.type===2){const ie=this.rows-1;return this.scrollLines(ne.type===2?-ie:ie),this.cancel(K,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(ne.cancel&&this.cancel(K,!0),!ne.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==$.C0.ETX&&ne.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,P){const ne=K.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||K.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||K.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?ne:ne&&(!P.keyCode||P.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)P=K.charCode;else if(K.which===null||K.which===void 0)P=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;P=K.which}return!(!P||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=K.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(K),!0}return!1}resize(K,P){K!==this.cols||P!==this.rows?super.resize(K,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,P){var ne,ie;(ne=this._charSizeService)==null||ne.measure(),(ie=this.viewport)==null||ie.syncScrollArea(!0)}clear(){var K;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 P=1;P<this.rows;P++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var P,ne;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),(P=this._selectionService)==null||P.reset(),this._decorationService.reset(),(ne=this.viewport)==null||ne.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case U.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${ne};${P}t`);break;case U.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ie=this._renderService.dimensions.css.cell.width.toFixed(0),_e=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${_e};${ie}t`)}}cancel(K,P){if(this.options.cancelEvents||P)return K.preventDefault(),K.stopPropagation(),!1}}s.Terminal=he},9924:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,g){this._rowCount=g,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=a-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(z,s,c){var h=this&&this.__decorate||function(o,l,u,S){var E,b=arguments.length,x=b<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,u,S);else for(var y=o.length-1;y>=0;y--)(E=o[y])&&(x=(b<3?E(x):b>3?E(l,u,x):E(l,u))||x);return b>3&&x&&Object.defineProperty(l,u,x),x},g=this&&this.__param||function(o,l){return function(u,S){l(u,S,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const a=c(3656),p=c(4725),m=c(8460),w=c(844),_=c(2585);let n=s.Viewport=class extends w.Disposable{constructor(o,l,u,S,E,b,x,y){super(),this._viewportElement=o,this._scrollArea=l,this._bufferService=u,this._optionsService=S,this._charSizeService=E,this._renderService=b,this._coreBrowserService=x,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(y.colors),this.register(y.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(o){this._viewportElement.style.backgroundColor=o.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(o){if(o)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const o=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==o&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=o),this._refreshAnimationFrame=null}syncScrollArea(o=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(o)}_handleScroll(o){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const o=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(o*(this._smoothScrollState.target-this._smoothScrollState.origin)),o<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(o,l){const u=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&u<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const l=this._getPixelsScrolled(o);return l!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(o,l))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=o*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!1})}_getPixelsScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let l=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(o,l){var y;let u,S="";const E=[],b=l??this._bufferService.buffer.lines.length,x=this._bufferService.buffer.lines;for(let R=o;R<b;R++){const L=x.get(R);if(!L)continue;const I=(y=x.get(R+1))==null?void 0:y.isWrapped;if(S+=L.translateToString(!I),!I||R===x.length-1){const M=document.createElement("div");M.textContent=S,E.push(M),S.length>0&&(u=M),S=""}}return{bufferElements:E,cursorElement:u}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let l=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(o,l){const u=this._optionsService.rawOptions.fastScrollModifier;return u==="alt"&&l.altKey||u==="ctrl"&&l.ctrlKey||u==="shift"&&l.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(o){this._lastTouchY=o.touches[0].pageY}handleTouchMove(o){const l=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(o,l))}};s.Viewport=n=h([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,p.ICharSizeService),g(5,p.IRenderService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],n)},3107:function(z,s,c){var h=this&&this.__decorate||function(_,n,o,l){var u,S=arguments.length,E=S<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,n,o,l);else for(var b=_.length-1;b>=0;b--)(u=_[b])&&(E=(S<3?u(E):S>3?u(n,o,E):u(n,o))||E);return S>3&&E&&Object.defineProperty(n,o,E),E},g=this&&this.__param||function(_,n){return function(o,l){n(o,l,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const a=c(4725),p=c(844),m=c(2585);let w=s.BufferDecorationRenderer=class extends p.Disposable{constructor(_,n,o,l,u){super(),this._screenElement=_,this._bufferService=n,this._coreBrowserService=o,this._decorationService=l,this._renderService=u,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((S=>this._removeDecoration(S)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var l;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((l=_==null?void 0:_.options)==null?void 0:l.layer)==="top"),n.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const o=_.options.x??0;return o&&o>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(_,n),n}_refreshStyle(_){const n=_.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let o=this._decorationElements.get(_);o||(o=this._createElement(_),_.element=o,this._decorationElements.set(_,o),this._container.appendChild(o),_.onDispose((()=>{this._decorationElements.delete(_),o.remove()}))),o.style.top=n*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(o)}}_refreshXPosition(_,n=_.element){if(!n)return;const o=_.options.x??0;(_.options.anchor||"left")==="right"?n.style.right=o?o*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=o?o*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var n;(n=this._decorationElements.get(_))==null||n.remove(),this._decorationElements.delete(_),_.dispose()}};s.BufferDecorationRenderer=w=h([g(1,m.IBufferService),g(2,a.ICoreBrowserService),g(3,m.IDecorationService),g(4,a.IRenderService)],w)},5871:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,g){return h>=c.startBufferLine-this._linePadding[g||"full"]&&h<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(z,s,c){var h=this&&this.__decorate||function(u,S,E,b){var x,y=arguments.length,R=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,E):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(u,S,E,b);else for(var L=u.length-1;L>=0;L--)(x=u[L])&&(R=(y<3?x(R):y>3?x(S,E,R):x(S,E))||R);return y>3&&R&&Object.defineProperty(S,E,R),R},g=this&&this.__param||function(u,S){return function(E,b){S(E,b,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const a=c(5871),p=c(4725),m=c(844),w=c(2585),_={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let l=s.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(u,S,E,b,x,y,R){var I;super(),this._viewportElement=u,this._screenElement=S,this._bufferService=E,this._decorationService=b,this._renderService=x,this._optionsService=y,this._coreBrowserService=R,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var M;(M=this._canvas)==null||M.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const u=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=u,n.center=S,n.right=u,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=n.left,o.right=n.left+n.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const u=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(u,12),6)*this._coreBrowserService.dpr);_.left=S,_.center=S,_.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const u=this._colorZoneStore.zones;for(const S of u)S.position!=="full"&&this._renderColorZone(S);for(const S of u)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(u){this._ctx.fillStyle=u.color,this._ctx.fillRect(o[u.position||"full"],Math.round((this._canvas.height-1)*(u.startBufferLine/this._bufferService.buffers.active.lines.length)-_[u.position||"full"]/2),n[u.position||"full"],Math.round((this._canvas.height-1)*((u.endBufferLine-u.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[u.position||"full"]))}_queueRefresh(u,S){this._shouldUpdateDimensions=u||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=l=h([g(2,w.IBufferService),g(3,w.IDecorationService),g(4,p.IRenderService),g(5,w.IOptionsService),g(6,p.ICoreBrowserService)],l)},2950:function(z,s,c){var h=this&&this.__decorate||function(_,n,o,l){var u,S=arguments.length,E=S<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,n,o,l);else for(var b=_.length-1;b>=0;b--)(u=_[b])&&(E=(S<3?u(E):S>3?u(n,o,E):u(n,o))||E);return S>3&&E&&Object.defineProperty(n,o,E),E},g=this&&this.__param||function(_,n){return function(o,l){n(o,l,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const a=c(4725),p=c(2585),m=c(2584);let w=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,n,o,l,u,S){this._textarea=_,this._compositionView=n,this._bufferService=o,this._optionsService=l,this._coreService=u,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),o.length>0&&this._coreService.triggerDataEvent(o,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,o=n.replace(_,"");this._dataAlreadySent=o,n.length>_.length?this._coreService.triggerDataEvent(o,!0):n.length<_.length?this._coreService.triggerDataEvent(`${m.C0.DEL}`,!0):n.length===_.length&&n!==_&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,u=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=u+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=o+"px",this._compositionView.style.lineHeight=o+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=u+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=w=h([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,p.ICoreService),g(5,a.IRenderService)],w)},9806:(z,s)=>{function c(h,g,a){const p=a.getBoundingClientRect(),m=h.getComputedStyle(a),w=parseInt(m.getPropertyValue("padding-left")),_=parseInt(m.getPropertyValue("padding-top"));return[g.clientX-p.left-w,g.clientY-p.top-_]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=c,s.getCoords=function(h,g,a,p,m,w,_,n,o){if(!w)return;const l=c(h,g,a);return l?(l[0]=Math.ceil((l[0]+(o?_/2:0))/_),l[1]=Math.ceil(l[1]/n),l[0]=Math.min(Math.max(l[0],1),p+(o?1:0)),l[1]=Math.min(Math.max(l[1],1),m),l):void 0}},9504:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const h=c(2584);function g(n,o,l,u){const S=n-a(n,l),E=o-a(o,l),b=Math.abs(S-E)-(function(x,y,R){let L=0;const I=x-a(x,R),M=y-a(y,R);for(let B=0;B<Math.abs(I-M);B++){const G=p(x,y)==="A"?-1:1,X=R.buffer.lines.get(I+G*B);X!=null&&X.isWrapped&&L++}return L})(n,o,l);return _(b,w(p(n,o),u))}function a(n,o){let l=0,u=o.buffer.lines.get(n),S=u==null?void 0:u.isWrapped;for(;S&&n>=0&&n<o.rows;)l++,u=o.buffer.lines.get(--n),S=u==null?void 0:u.isWrapped;return l}function p(n,o){return n>o?"A":"B"}function m(n,o,l,u,S,E){let b=n,x=o,y="";for(;b!==l||x!==u;)b+=S?1:-1,S&&b>E.cols-1?(y+=E.buffer.translateBufferLineToString(x,!1,n,b),b=0,n=0,x++):!S&&b<0&&(y+=E.buffer.translateBufferLineToString(x,!1,0,n+1),b=E.cols-1,n=b,x--);return y+E.buffer.translateBufferLineToString(x,!1,n,b)}function w(n,o){const l=o?"O":"[";return h.C0.ESC+l+n}function _(n,o){n=Math.floor(n);let l="";for(let u=0;u<n;u++)l+=o;return l}s.moveToCellSequence=function(n,o,l,u){const S=l.buffer.x,E=l.buffer.y;if(!l.buffer.hasScrollback)return(function(y,R,L,I,M,B){return g(R,I,M,B).length===0?"":_(m(y,R,y,R-a(R,M),!1,M).length,w("D",B))})(S,E,0,o,l,u)+g(E,o,l,u)+(function(y,R,L,I,M,B){let G;G=g(R,I,M,B).length>0?I-a(I,M):R;const X=I,W=(function($,Y,k,F,O,U){let Q;return Q=g(k,F,O,U).length>0?F-a(F,O):Y,$<k&&Q<=F||$>=k&&Q<F?"C":"D"})(y,R,L,I,M,B);return _(m(y,G,L,X,W==="C",M).length,w(W,B))})(S,E,n,o,l,u);let b;if(E===o)return b=S>n?"D":"C",_(Math.abs(S-n),w(b,u));b=E>o?"D":"C";const x=Math.abs(E-o);return _((function(y,R){return R.cols-y})(E>o?n:S,l)+(x-1)*l.cols+1+((E>o?S:n)-1),w(b,u))}},1296:function(z,s,c){var h=this&&this.__decorate||function(B,G,X,W){var $,Y=arguments.length,k=Y<3?G:W===null?W=Object.getOwnPropertyDescriptor(G,X):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(B,G,X,W);else for(var F=B.length-1;F>=0;F--)($=B[F])&&(k=(Y<3?$(k):Y>3?$(G,X,k):$(G,X))||k);return Y>3&&k&&Object.defineProperty(G,X,k),k},g=this&&this.__param||function(B,G){return function(X,W){G(X,W,B)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const a=c(3787),p=c(2550),m=c(2223),w=c(6171),_=c(6052),n=c(4725),o=c(8055),l=c(8460),u=c(844),S=c(2585),E="xterm-dom-renderer-owner-",b="xterm-rows",x="xterm-fg-",y="xterm-bg-",R="xterm-focus",L="xterm-selection";let I=1,M=s.DomRenderer=class extends u.Disposable{constructor(B,G,X,W,$,Y,k,F,O,U,Q,ee,he){super(),this._terminal=B,this._document=G,this._element=X,this._screenElement=W,this._viewportElement=$,this._helperContainer=Y,this._linkifier2=k,this._charSizeService=O,this._optionsService=U,this._bufferService=Q,this._coreBrowserService=ee,this._themeService=he,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),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(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ce=>this._injectCss(ce)))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ce=>this._handleLinkHover(ce)))),this.register(this._linkifier2.onHideLinkUnderline((ce=>this._handleLinkLeave(ce)))),this.register((0,u.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const B=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*B,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*B),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/B),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/B),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const G=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=G,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(B){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let G=`${this._terminalSelector} .${b} { color: ${B.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;G+=`${this._terminalSelector} .${b} .xterm-dim { color: ${o.color.multiplyOpacity(B.foreground,.5).css};}`,G+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const X=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;G+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,G+=`@keyframes ${W} { 50% { box-shadow: none; }}`,G+=`@keyframes ${$} { 0% { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css}; } 50% { background-color: inherit; color: ${B.cursor.css}; }}`,G+=`${this._terminalSelector} .${b}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${b}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${b}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${B.cursor.css} !important; color: ${B.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${B.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${B.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${B.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,G+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${B.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${B.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,k]of B.ansi.entries())G+=`${this._terminalSelector} .${x}${Y} { color: ${k.css}; }${this._terminalSelector} .${x}${Y}.xterm-dim { color: ${o.color.multiplyOpacity(k,.5).css}; }${this._terminalSelector} .${y}${Y} { background-color: ${k.css}; }`;G+=`${this._terminalSelector} .${x}${m.INVERTED_DEFAULT_COLOR} { color: ${o.color.opaque(B.background).css}; }${this._terminalSelector} .${x}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${o.color.multiplyOpacity(o.color.opaque(B.background),.5).css}; }${this._terminalSelector} .${y}${m.INVERTED_DEFAULT_COLOR} { background-color: ${B.foreground.css}; }`,this._themeStyleElement.textContent=G}_setDefaultSpacing(){const B=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${B}px`,this._rowFactory.defaultSpacing=B}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(B,G){for(let X=this._rowElements.length;X<=G;X++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>G;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(B,G){this._refreshRowElements(B,G),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(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(B,G,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(B,G,X),this.renderRows(0,this._bufferService.rows-1),!B||!G)return;this._selectionRenderModel.update(this._terminal,B,G,X);const W=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,k=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||k<0)return;const F=this._document.createDocumentFragment();if(X){const O=B[0]>G[0];F.appendChild(this._createSelectionElement(Y,O?G[0]:B[0],O?B[0]:G[0],k-Y+1))}else{const O=W===Y?B[0]:0,U=Y===$?G[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(Y,O,U));const Q=k-Y-1;if(F.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,Q)),Y!==k){const ee=$===k?G[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(k,0,ee))}}this._selectionContainer.appendChild(F)}_createSelectionElement(B,G,X,W=1){const $=this._document.createElement("div"),Y=G*this.dimensions.css.cell.width;let k=this.dimensions.css.cell.width*(X-G);return Y+k>this.dimensions.css.canvas.width&&(k=this.dimensions.css.canvas.width-Y),$.style.height=W*this.dimensions.css.cell.height+"px",$.style.top=B*this.dimensions.css.cell.height+"px",$.style.left=`${Y}px`,$.style.width=`${k}px`,$}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const B of this._rowElements)B.replaceChildren()}renderRows(B,G){const X=this._bufferService.buffer,W=X.ybase+X.y,$=Math.min(X.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,k=this._optionsService.rawOptions.cursorStyle,F=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=B;O<=G;O++){const U=O+X.ydisp,Q=this._rowElements[O],ee=X.lines.get(U);if(!Q||!ee)break;Q.replaceChildren(...this._rowFactory.createRow(ee,U,U===W,k,F,$,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!0)}_handleLinkLeave(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!1)}_setCellUnderline(B,G,X,W,$,Y){X<0&&(B=0),W<0&&(G=0);const k=this._bufferService.rows-1;X=Math.max(Math.min(X,k),0),W=Math.max(Math.min(W,k),0),$=Math.min($,this._bufferService.cols);const F=this._bufferService.buffer,O=F.ybase+F.y,U=Math.min(F.x,$-1),Q=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let ce=X;ce<=W;++ce){const K=ce+F.ydisp,P=this._rowElements[ce],ne=F.lines.get(K);if(!P||!ne)break;P.replaceChildren(...this._rowFactory.createRow(ne,K,K===O,ee,he,U,Q,this.dimensions.css.cell.width,this._widthCache,Y?ce===X?B:0:-1,Y?(ce===W?G:$)-1:-1))}}};s.DomRenderer=M=h([g(7,S.IInstantiationService),g(8,n.ICharSizeService),g(9,S.IOptionsService),g(10,S.IBufferService),g(11,n.ICoreBrowserService),g(12,n.IThemeService)],M)},3787:function(z,s,c){var h=this&&this.__decorate||function(b,x,y,R){var L,I=arguments.length,M=I<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,y):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,x,y,R);else for(var B=b.length-1;B>=0;B--)(L=b[B])&&(M=(I<3?L(M):I>3?L(x,y,M):L(x,y))||M);return I>3&&M&&Object.defineProperty(x,y,M),M},g=this&&this.__param||function(b,x){return function(y,R){x(y,R,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const a=c(2223),p=c(643),m=c(511),w=c(2585),_=c(8055),n=c(4725),o=c(4269),l=c(6171),u=c(3734);let S=s.DomRendererRowFactory=class{constructor(b,x,y,R,L,I,M){this._document=b,this._characterJoinerService=x,this._optionsService=y,this._coreBrowserService=R,this._coreService=L,this._decorationService=I,this._themeService=M,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,x,y){this._selectionStart=b,this._selectionEnd=x,this._columnSelectMode=y}createRow(b,x,y,R,L,I,M,B,G,X,W){const $=[],Y=this._characterJoinerService.getJoinedCharacters(x),k=this._themeService.colors;let F,O=b.getNoBgTrimmedLength();y&&O<I+1&&(O=I+1);let U=0,Q="",ee=0,he=0,ce=0,K=!1,P=0,ne=!1,ie=0;const _e=[],fe=X!==-1&&W!==-1;for(let ye=0;ye<O;ye++){b.loadCell(ye,this._workCell);let ve=this._workCell.getWidth();if(ve===0)continue;let Te=!1,Pe=ye,Se=this._workCell;if(Y.length>0&&ye===Y[0][0]){Te=!0;const De=Y.shift();Se=new o.JoinedCellData(this._workCell,b.translateToString(!0,De[0],De[1]),De[1]-De[0]),Pe=De[1]-1,ve=Se.getWidth()}const Mt=this._isCellInSelection(ye,x),It=y&&ye===I,xe=fe&&ye>=X&&ye<=W;let Ee=!1;this._decorationService.forEachDecorationAtCell(ye,x,void 0,(De=>{Ee=!0}));let Ae=Se.getChars()||p.WHITESPACE_CELL_CHAR;if(Ae===" "&&(Se.isUnderline()||Se.isOverline())&&(Ae=" "),ie=ve*B-G.get(Ae,Se.isBold(),Se.isItalic()),F){if(U&&(Mt&&ne||!Mt&&!ne&&Se.bg===ee)&&(Mt&&ne&&k.selectionForeground||Se.fg===he)&&Se.extended.ext===ce&&xe===K&&ie===P&&!It&&!Te&&!Ee){Se.isInvisible()?Q+=p.WHITESPACE_CELL_CHAR:Q+=Ae,U++;continue}U&&(F.textContent=Q),F=this._document.createElement("span"),U=0,Q=""}else F=this._document.createElement("span");if(ee=Se.bg,he=Se.fg,ce=Se.extended.ext,K=xe,P=ie,ne=Mt,Te&&I>=ye&&I<=Pe&&(I=ye),!this._coreService.isCursorHidden&&It&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)M&&_e.push("xterm-cursor-blink"),_e.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(Se.isBold()&&_e.push("xterm-bold"),Se.isItalic()&&_e.push("xterm-italic"),Se.isDim()&&_e.push("xterm-dim"),Q=Se.isInvisible()?p.WHITESPACE_CELL_CHAR:Se.getChars()||p.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(_e.push(`xterm-underline-${Se.extended.underlineStyle}`),Q===" "&&(Q=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())F.style.textDecorationColor=`rgb(${u.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let De=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&De<8&&(De+=8),F.style.textDecorationColor=k.ansi[De].css}Se.isOverline()&&(_e.push("xterm-overline"),Q===" "&&(Q=" ")),Se.isStrikethrough()&&_e.push("xterm-strikethrough"),xe&&(F.style.textDecoration="underline");let ge=Se.getFgColor(),we=Se.getFgColorMode(),Ke=Se.getBgColor(),qe=Se.getBgColorMode();const gt=!!Se.isInverse();if(gt){const De=ge;ge=Ke,Ke=De;const Xt=we;we=qe,qe=Xt}let Ze,ct,Qe,ke=!1;switch(this._decorationService.forEachDecorationAtCell(ye,x,void 0,(De=>{De.options.layer!=="top"&&ke||(De.backgroundColorRGB&&(qe=50331648,Ke=De.backgroundColorRGB.rgba>>8&16777215,Ze=De.backgroundColorRGB),De.foregroundColorRGB&&(we=50331648,ge=De.foregroundColorRGB.rgba>>8&16777215,ct=De.foregroundColorRGB),ke=De.options.layer==="top")})),!ke&&Mt&&(Ze=this._coreBrowserService.isFocused?k.selectionBackgroundOpaque:k.selectionInactiveBackgroundOpaque,Ke=Ze.rgba>>8&16777215,qe=50331648,ke=!0,k.selectionForeground&&(we=50331648,ge=k.selectionForeground.rgba>>8&16777215,ct=k.selectionForeground)),ke&&_e.push("xterm-decoration-top"),qe){case 16777216:case 33554432:Qe=k.ansi[Ke],_e.push(`xterm-bg-${Ke}`);break;case 50331648:Qe=_.channels.toColor(Ke>>16,Ke>>8&255,255&Ke),this._addStyle(F,`background-color:#${E((Ke>>>0).toString(16),"0",6)}`);break;default:gt?(Qe=k.foreground,_e.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):Qe=k.background}switch(Ze||Se.isDim()&&(Ze=_.color.multiplyOpacity(Qe,.5)),we){case 16777216:case 33554432:Se.isBold()&&ge<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ge+=8),this._applyMinimumContrast(F,Qe,k.ansi[ge],Se,Ze,void 0)||_e.push(`xterm-fg-${ge}`);break;case 50331648:const De=_.channels.toColor(ge>>16&255,ge>>8&255,255&ge);this._applyMinimumContrast(F,Qe,De,Se,Ze,ct)||this._addStyle(F,`color:#${E(ge.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(F,Qe,k.foreground,Se,Ze,ct)||gt&&_e.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}_e.length&&(F.className=_e.join(" "),_e.length=0),It||Te||Ee?F.textContent=Q:U++,ie!==this.defaultSpacing&&(F.style.letterSpacing=`${ie}px`),$.push(F),ye=Pe}return F&&U&&(F.textContent=Q),$}_applyMinimumContrast(b,x,y,R,L,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const M=this._getContrastCache(R);let B;if(L||I||(B=M.getColor(x.rgba,y.rgba)),B===void 0){const G=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);B=_.color.ensureContrastRatio(L||x,I||y,G),M.setColor((L||x).rgba,(I||y).rgba,B??null)}return!!B&&(this._addStyle(b,`color:${B.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,x){b.setAttribute("style",`${b.getAttribute("style")||""}${x};`)}_isCellInSelection(b,x){const y=this._selectionStart,R=this._selectionEnd;return!(!y||!R)&&(this._columnSelectMode?y[0]<=R[0]?b>=y[0]&&x>=y[1]&&b<R[0]&&x<=R[1]:b<y[0]&&x>=y[1]&&b>=R[0]&&x<=R[1]:x>y[1]&&x<R[1]||y[1]===R[1]&&x===y[1]&&b>=y[0]&&b<R[0]||y[1]<R[1]&&x===R[1]&&b<R[0]||y[1]<R[1]&&x===y[1]&&b>=y[0])}};function E(b,x,y){for(;b.length<y;)b=x+b;return b}s.DomRendererRowFactory=S=h([g(1,n.ICharacterJoinerService),g(2,w.IOptionsService),g(3,n.ICoreBrowserService),g(4,w.ICoreService),g(5,w.IDecorationService),g(6,n.IThemeService)],S)},2550:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const g=c.createElement("span");g.classList.add("xterm-char-measure-element");const a=c.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";const p=c.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[g,a,p,m],this._container.appendChild(g),this._container.appendChild(a),this._container.appendChild(p),this._container.appendChild(m),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,g,a){c===this._font&&h===this._fontSize&&g===this._weight&&a===this._weightBold||(this._font=c,this._fontSize=h,this._weight=g,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(c,h,g){let a=0;if(!h&&!g&&c.length===1&&(a=c.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];const w=this._measure(c,0);return w>0&&(this._flat[a]=w),w}let p=c;h&&(p+="B"),g&&(p+="I");let m=this._holey.get(p);if(m===void 0){let w=0;h&&(w|=1),g&&(w|=2),m=this._measure(c,w),m>0&&this._holey.set(p,m)}return m}_measure(c,h){const g=this._measureElements[h];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(z,s)=>{function c(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},s.isPowerlineGlyph=c,s.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},s.isEmoji=h,s.allowRescaling=function(g,a,p,m){return a===1&&p>Math.ceil(1.5*m)&&g!==void 0&&g>255&&!h(g)&&!c(g)&&!(function(w){return 57344<=w&&w<=63743})(g)},s.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(a){return 9472<=a&&a<=9631})(g)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(g,a,p=0){return(g-(2*Math.round(a)-p))%(2*Math.round(a))}},6052:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,a,p,m=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const w=g.buffers.active.ydisp,_=a[1]-w,n=p[1]-w,o=Math.max(_,0),l=Math.min(n,g.rows-1);o>=g.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=_,this.viewportEndRow=n,this.viewportCappedStartRow=o,this.viewportCappedEndRow=l,this.startCol=a[0],this.endCol=p[0])}isCellSelected(g,a,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}s.createSelectionRenderModel=function(){return new c}},456:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(z,s,c){var h=this&&this.__decorate||function(l,u,S,E){var b,x=arguments.length,y=x<3?u:E===null?E=Object.getOwnPropertyDescriptor(u,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(l,u,S,E);else for(var R=l.length-1;R>=0;R--)(b=l[R])&&(y=(x<3?b(y):x>3?b(u,S,y):b(u,S))||y);return x>3&&y&&Object.defineProperty(u,S,y),y},g=this&&this.__param||function(l,u){return function(S,E){u(S,E,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const a=c(2585),p=c(8460),m=c(844);let w=s.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,u,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new o(this._optionsService))}catch{this._measureStrategy=this.register(new n(l,u,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};s.CharSizeService=w=h([g(2,a.IOptionsService)],w);class _ extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(u,S){u!==void 0&&u>0&&S!==void 0&&S>0&&(this._result.width=u,this._result.height=S)}}class n extends _{constructor(u,S,E){super(),this._document=u,this._parentElement=S,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class o extends _{constructor(u){super(),this._optionsService=u,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const u=this._ctx.measureText("W");return this._validateAndSet(u.width,u.fontBoundingBoxAscent+u.fontBoundingBoxDescent),this._result}}},4269:function(z,s,c){var h=this&&this.__decorate||function(o,l,u,S){var E,b=arguments.length,x=b<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,u,S);else for(var y=o.length-1;y>=0;y--)(E=o[y])&&(x=(b<3?E(x):b>3?E(l,u,x):E(l,u))||x);return b>3&&x&&Object.defineProperty(l,u,x),x},g=this&&this.__param||function(o,l){return function(u,S){l(u,S,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const a=c(3734),p=c(643),m=c(511),w=c(2585);class _ extends a.AttributeData{constructor(l,u,S){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=u,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=_;let n=s.CharacterJoinerService=class Mg{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(l){const u={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(u),u.id}deregister(l){for(let u=0;u<this._characterJoiners.length;u++)if(this._characterJoiners[u].id===l)return this._characterJoiners.splice(u,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const u=this._bufferService.buffer.lines.get(l);if(!u||u.length===0)return[];const S=[],E=u.translateToString(!0);let b=0,x=0,y=0,R=u.getFg(0),L=u.getBg(0);for(let I=0;I<u.getTrimmedLength();I++)if(u.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==L){if(I-b>1){const M=this._getJoinedRanges(E,y,x,u,b);for(let B=0;B<M.length;B++)S.push(M[B])}b=I,y=x,R=this._workCell.fg,L=this._workCell.bg}x+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const I=this._getJoinedRanges(E,y,x,u,b);for(let M=0;M<I.length;M++)S.push(I[M])}return S}_getJoinedRanges(l,u,S,E,b){const x=l.substring(u,S);let y=[];try{y=this._characterJoiners[0].handler(x)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const L=this._characterJoiners[R].handler(x);for(let I=0;I<L.length;I++)Mg._mergeRanges(y,L[I])}catch(L){console.error(L)}return this._stringRangesToCellRanges(y,E,b),y}_stringRangesToCellRanges(l,u,S){let E=0,b=!1,x=0,y=l[E];if(y){for(let R=S;R<this._bufferService.cols;R++){const L=u.getWidth(R),I=u.getString(R).length||p.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!b&&y[0]<=x&&(y[0]=R,b=!0),y[1]<=x){if(y[1]=R,y=l[++E],!y)break;y[0]<=x?(y[0]=R,b=!0):b=!1}x+=I}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(l,u){let S=!1;for(let E=0;E<l.length;E++){const b=l[E];if(S){if(u[1]<=b[0])return l[E-1][1]=u[1],l;if(u[1]<=b[1])return l[E-1][1]=Math.max(u[1],b[1]),l.splice(E,1),l;l.splice(E,1),E--}else{if(u[1]<=b[0])return l.splice(E,0,u),l;if(u[1]<=b[1])return b[0]=Math.min(u[0],b[0]),l;u[0]<b[1]&&(b[0]=Math.min(u[0],b[0]),S=!0)}}return S?l[l.length-1][1]=u[1]:l.push(u),l}};s.CharacterJoinerService=n=h([g(0,w.IBufferService)],n)},5114:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const h=c(844),g=c(8460),a=c(3656);class p extends h.Disposable{constructor(_,n,o){super(),this._textarea=_,this._window=n,this.mainDocument=o,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((l=>this._screenDprMonitor.setWindow(l)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,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}}s.CoreBrowserService=p;class m extends h.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const h=c(844);class g extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}s.LinkProviderService=g},8934:function(z,s,c){var h=this&&this.__decorate||function(w,_,n,o){var l,u=arguments.length,S=u<3?_:o===null?o=Object.getOwnPropertyDescriptor(_,n):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,_,n,o);else for(var E=w.length-1;E>=0;E--)(l=w[E])&&(S=(u<3?l(S):u>3?l(_,n,S):l(_,n))||S);return u>3&&S&&Object.defineProperty(_,n,S),S},g=this&&this.__param||function(w,_){return function(n,o){_(n,o,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const a=c(4725),p=c(9806);let m=s.MouseService=class{constructor(w,_){this._renderService=w,this._charSizeService=_}getCoords(w,_,n,o,l){return(0,p.getCoords)(window,w,_,n,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(w,_){const n=(0,p.getCoordsRelativeToElement)(window,w,_);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])}}};s.MouseService=m=h([g(0,a.IRenderService),g(1,a.ICharSizeService)],m)},3230:function(z,s,c){var h=this&&this.__decorate||function(l,u,S,E){var b,x=arguments.length,y=x<3?u:E===null?E=Object.getOwnPropertyDescriptor(u,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(l,u,S,E);else for(var R=l.length-1;R>=0;R--)(b=l[R])&&(y=(x<3?b(y):x>3?b(u,S,y):b(u,S))||y);return x>3&&y&&Object.defineProperty(u,S,y),y},g=this&&this.__param||function(l,u){return function(S,E){u(S,E,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const a=c(6193),p=c(4725),m=c(8460),w=c(844),_=c(7226),n=c(2585);let o=s.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(l,u,S,E,b,x,y,R){super(),this._rowCount=l,this._charSizeService=E,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((L,I)=>this._renderRows(L,I)),y),this.register(this._renderDebouncer),this.register(y.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(x.onResize((()=>this._fullRefresh()))),this.register(x.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(b.onDecorationRegistered((()=>this._fullRefresh()))),this.register(b.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(x.cols,x.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(x.buffer.y,x.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(y.window,u),this.register(y.onWindowChange((L=>this._registerIntersectionObserver(L,u))))}_registerIntersectionObserver(l,u){if("IntersectionObserver"in l){const S=new l.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});S.observe(u),this._observerDisposable.value=(0,w.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(l){this._isPaused=l.isIntersecting===void 0?l.intersectionRatio===0:!l.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(l,u,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,u,this._rowCount))}_renderRows(l,u){this._renderer.value&&(l=Math.min(l,this._rowCount-1),u=Math.min(u,this._rowCount-1),this._renderer.value.renderRows(l,u),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:l,end:u}),this._onRender.fire({start:l,end:u}),this._isNextRenderRedrawOnly=!0)}resize(l,u){this._rowCount=u,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(l){this._renderer.value=l,this._renderer.value&&(this._renderer.value.onRequestRedraw((u=>this.refreshRows(u.start,u.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(l){return this._renderDebouncer.addRefreshCallback(l)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var l,u;this._renderer.value&&((u=(l=this._renderer.value).clearTextureAtlas)==null||u.call(l),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(l,u){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(l,u)})):this._renderer.value.handleResize(l,u),this._fullRefresh())}handleCharSizeChanged(){var l;(l=this._renderer.value)==null||l.handleCharSizeChanged()}handleBlur(){var l;(l=this._renderer.value)==null||l.handleBlur()}handleFocus(){var l;(l=this._renderer.value)==null||l.handleFocus()}handleSelectionChanged(l,u,S){var E;this._selectionState.start=l,this._selectionState.end=u,this._selectionState.columnSelectMode=S,(E=this._renderer.value)==null||E.handleSelectionChanged(l,u,S)}handleCursorMove(){var l;(l=this._renderer.value)==null||l.handleCursorMove()}clear(){var l;(l=this._renderer.value)==null||l.clear()}};s.RenderService=o=h([g(2,n.IOptionsService),g(3,p.ICharSizeService),g(4,n.IDecorationService),g(5,n.IBufferService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],o)},9312:function(z,s,c){var h=this&&this.__decorate||function(y,R,L,I){var M,B=arguments.length,G=B<3?R:I===null?I=Object.getOwnPropertyDescriptor(R,L):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(y,R,L,I);else for(var X=y.length-1;X>=0;X--)(M=y[X])&&(G=(B<3?M(G):B>3?M(R,L,G):M(R,L))||G);return B>3&&G&&Object.defineProperty(R,L,G),G},g=this&&this.__param||function(y,R){return function(L,I){R(L,I,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const a=c(9806),p=c(9504),m=c(456),w=c(4725),_=c(8460),n=c(844),o=c(6114),l=c(4841),u=c(511),S=c(2585),E=" ",b=new RegExp(E,"g");let x=s.SelectionService=class extends n.Disposable{constructor(y,R,L,I,M,B,G,X,W){super(),this._element=y,this._screenElement=R,this._linkifier=L,this._bufferService=I,this._coreService=M,this._mouseService=B,this._optionsService=G,this._renderService=X,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new u.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=$=>this._handleMouseMove($),this._mouseUpListener=$=>this._handleMouseUp($),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim(($=>this._handleTrim($))),this.register(this._bufferService.buffers.onBufferActivate(($=>this._handleBufferActivate($)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!y||!R||y[0]===R[0]&&y[1]===R[1])}get selectionText(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!y||!R)return"";const L=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(y[0]===R[0])return"";const M=y[0]<R[0]?y[0]:R[0],B=y[0]<R[0]?R[0]:y[0];for(let G=y[1];G<=R[1];G++){const X=L.translateBufferLineToString(G,!0,M,B);I.push(X)}}else{const M=y[1]===R[1]?R[0]:void 0;I.push(L.translateBufferLineToString(y[1],!0,y[0],M));for(let B=y[1]+1;B<=R[1]-1;B++){const G=L.lines.get(B),X=L.translateBufferLineToString(B,!0);G!=null&&G.isWrapped?I[I.length-1]+=X:I.push(X)}if(y[1]!==R[1]){const B=L.lines.get(R[1]),G=L.translateBufferLineToString(R[1],!0,0,R[0]);B&&B.isWrapped?I[I.length-1]+=G:I.push(G)}}return I.map((M=>M.replace(b," "))).join(o.isWindows?`\r
79
+ `:`
80
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),o.isLinux&&y&&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(y){const R=this._getMouseBufferCoords(y),L=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(L&&I&&R)&&this._areCoordsInSelection(R,L,I)}isCellInSelection(y,R){const L=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!L||!I)&&this._areCoordsInSelection([y,R],L,I)}_areCoordsInSelection(y,R,L){return y[1]>R[1]&&y[1]<L[1]||R[1]===L[1]&&y[1]===R[1]&&y[0]>=R[0]&&y[0]<L[0]||R[1]<L[1]&&y[1]===L[1]&&y[0]<L[0]||R[1]<L[1]&&y[1]===R[1]&&y[0]>=R[0]}_selectWordAtCursor(y,R){var M,B;const L=(B=(M=this._linkifier.currentLink)==null?void 0:M.link)==null?void 0:B.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(y);return!!I&&(this._selectWordAt(I,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,R){this._model.clearSelection(),y=Math.max(y,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const R=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(y){let R=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=L?0:(R>L&&(R-=L),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(y){return o.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const R=this._getMouseBufferCoords(y);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(y){return y.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const I=L.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const R=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const I=(0,p.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,L=!(!y||!R||y[0]===R[0]&&y[1]===R[1]);L?y&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,R,L)):this._oldHasSelection&&this._fireOnSelectionChange(y,R,L)}_fireOnSelectionChange(y,R,L){this._oldSelectionStart=y,this._oldSelectionEnd=R,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(y,R){let L=R;for(let I=0;R>=I;I++){const M=y.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:M>1&&R!==I&&(L+=M-1)}return L}setSelection(y,R,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,R],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,R,L=!0,I=!0){if(y[0]>=this._bufferService.cols)return;const M=this._bufferService.buffer,B=M.lines.get(y[1]);if(!B)return;const G=M.translateBufferLineToString(y[1],!1);let X=this._convertViewportColToCharacterIndex(B,y[0]),W=X;const $=y[0]-X;let Y=0,k=0,F=0,O=0;if(G.charAt(X)===" "){for(;X>0&&G.charAt(X-1)===" ";)X--;for(;W<G.length&&G.charAt(W+1)===" ";)W++}else{let ee=y[0],he=y[0];B.getWidth(ee)===0&&(Y++,ee--),B.getWidth(he)===2&&(k++,he++);const ce=B.getString(he).length;for(ce>1&&(O+=ce-1,W+=ce-1);ee>0&&X>0&&!this._isCharWordSeparator(B.loadCell(ee-1,this._workCell));){B.loadCell(ee-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,ee--):K>1&&(F+=K-1,X-=K-1),X--,ee--}for(;he<B.length&&W+1<G.length&&!this._isCharWordSeparator(B.loadCell(he+1,this._workCell));){B.loadCell(he+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(k++,he++):K>1&&(O+=K-1,W+=K-1),W++,he++}}W++;let U=X+$-Y+F,Q=Math.min(this._bufferService.cols,W-X+Y+k-F-O);if(R||G.slice(X,W).trim()!==""){if(L&&U===0&&B.getCodePoint(0)!==32){const ee=M.lines.get(y[1]-1);if(ee&&B.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(he){const ce=this._bufferService.cols-he.start;U-=ce,Q+=ce}}}if(I&&U+Q===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const ee=M.lines.get(y[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const he=this._getWordAt([0,y[1]+1],!1,!1,!0);he&&(Q+=he.length)}}return{start:U,length:Q}}}_selectWordAt(y,R){const L=this._getWordAt(y,R);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[L.start,y[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(y){const R=this._getWordAt(y,!0);if(R){let L=y[1];for(;R.start<0;)R.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,L]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const R=this._bufferService.buffer.getWrappedRangeForLine(y),L={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols)}};s.SelectionService=x=h([g(3,S.IBufferService),g(4,S.ICoreService),g(5,w.IMouseService),g(6,S.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],x)},4725:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const h=c(8343);s.ICharSizeService=(0,h.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),s.IMouseService=(0,h.createDecorator)("MouseService"),s.IRenderService=(0,h.createDecorator)("RenderService"),s.ISelectionService=(0,h.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,h.createDecorator)("ThemeService"),s.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(z,s,c){var h=this&&this.__decorate||function(x,y,R,L){var I,M=arguments.length,B=M<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(x,y,R,L);else for(var G=x.length-1;G>=0;G--)(I=x[G])&&(B=(M<3?I(B):M>3?I(y,R,B):I(y,R))||B);return M>3&&B&&Object.defineProperty(y,R,B),B},g=this&&this.__param||function(x,y){return function(R,L){y(R,L,x)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const a=c(7239),p=c(8055),m=c(8460),w=c(844),_=c(2585),n=p.css.toColor("#ffffff"),o=p.css.toColor("#000000"),l=p.css.toColor("#ffffff"),u=p.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const x=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let R=0;R<216;R++){const L=y[R/36%6|0],I=y[R/6%6|0],M=y[R%6];x.push({css:p.channels.toCss(L,I,M),rgba:p.channels.toRgba(L,I,M)})}for(let R=0;R<24;R++){const L=8+10*R;x.push({css:p.channels.toCss(L,L,L),rgba:p.channels.toRgba(L,L,L)})}return x})());let E=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(x){super(),this._optionsService=x,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:o,cursor:l,cursorAccent:u,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:p.color.blend(o,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:p.color.blend(o,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(x={}){const y=this._colors;if(y.foreground=b(x.foreground,n),y.background=b(x.background,o),y.cursor=b(x.cursor,l),y.cursorAccent=b(x.cursorAccent,u),y.selectionBackgroundTransparent=b(x.selectionBackground,S),y.selectionBackgroundOpaque=p.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=b(x.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=p.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=x.selectionForeground?b(x.selectionForeground,p.NULL_COLOR):void 0,y.selectionForeground===p.NULL_COLOR&&(y.selectionForeground=void 0),p.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=p.color.opacity(y.selectionBackgroundTransparent,.3)),p.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=p.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=s.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=b(x.black,s.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=b(x.red,s.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=b(x.green,s.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=b(x.yellow,s.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=b(x.blue,s.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=b(x.magenta,s.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=b(x.cyan,s.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=b(x.white,s.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=b(x.brightBlack,s.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=b(x.brightRed,s.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=b(x.brightGreen,s.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=b(x.brightYellow,s.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=b(x.brightBlue,s.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=b(x.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=b(x.brightCyan,s.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=b(x.brightWhite,s.DEFAULT_ANSI_COLORS[15]),x.extendedAnsi){const R=Math.min(y.ansi.length-16,x.extendedAnsi.length);for(let L=0;L<R;L++)y.ansi[L+16]=b(x.extendedAnsi[L],s.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(x){this._restoreColor(x),this._onChangeColors.fire(this.colors)}_restoreColor(x){if(x!==void 0)switch(x){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[x]=this._restoreColors.ansi[x]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(x){x(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function b(x,y){if(x!==void 0)try{return p.css.toColor(x)}catch{}return y}s.ThemeService=E=h([g(0,_.IOptionsService)],E)},6349:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const h=c(8460),g=c(844);class a extends g.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const w=new Array(m);for(let _=0;_<Math.min(m,this.length);_++)w[_]=this._array[this._getCyclicIndex(_)];this._array=w,this._maxLength=m,this._startIndex=0}get length(){return this._length}set length(m){if(m>this._length)for(let w=this._length;w<m;w++)this._array[w]=void 0;this._length=m}get(m){return this._array[this._getCyclicIndex(m)]}set(m,w){this._array[this._getCyclicIndex(m)]=w}push(m){this._array[this._getCyclicIndex(this._length)]=m,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(m,w,..._){if(w){for(let n=m;n<this._length-w;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+w)];this._length-=w,this.onDeleteEmitter.fire({index:m,amount:w})}for(let n=this._length-1;n>=m;n--)this._array[this._getCyclicIndex(n+_.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<_.length;n++)this._array[this._getCyclicIndex(m+n)]=_[n];if(_.length&&this.onInsertEmitter.fire({index:m,amount:_.length}),this._length+_.length>this._maxLength){const n=this._length+_.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=_.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,w,_){if(!(w<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let o=w-1;o>=0;o--)this.set(m+o+_,this.get(m+o));const n=m+w+_-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<w;n++)this.set(m+n+_,this.get(m+n))}}_getCyclicIndex(m){return(this._startIndex+m)%this._maxLength}}s.CircularList=a},1439:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function c(h,g=5){if(typeof h!="object")return h;const a=Array.isArray(h)?[]:{};for(const p in h)a[p]=g<=1?h[p]:h[p]&&c(h[p],g-1);return a}},8055:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let c=0,h=0,g=0,a=0;var p,m,w,_,n;function o(u){const S=u.toString(16);return S.length<2?"0"+S:S}function l(u,S){return u<S?(S+.05)/(u+.05):(u+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(u){u.toCss=function(S,E,b,x){return x!==void 0?`#${o(S)}${o(E)}${o(b)}${o(x)}`:`#${o(S)}${o(E)}${o(b)}`},u.toRgba=function(S,E,b,x=255){return(S<<24|E<<16|b<<8|x)>>>0},u.toColor=function(S,E,b,x){return{css:u.toCss(S,E,b,x),rgba:u.toRgba(S,E,b,x)}}})(p||(s.channels=p={})),(function(u){function S(E,b){return a=Math.round(255*b),[c,h,g]=n.toChannels(E.rgba),{css:p.toCss(c,h,g,a),rgba:p.toRgba(c,h,g,a)}}u.blend=function(E,b){if(a=(255&b.rgba)/255,a===1)return{css:b.css,rgba:b.rgba};const x=b.rgba>>24&255,y=b.rgba>>16&255,R=b.rgba>>8&255,L=E.rgba>>24&255,I=E.rgba>>16&255,M=E.rgba>>8&255;return c=L+Math.round((x-L)*a),h=I+Math.round((y-I)*a),g=M+Math.round((R-M)*a),{css:p.toCss(c,h,g),rgba:p.toRgba(c,h,g)}},u.isOpaque=function(E){return(255&E.rgba)==255},u.ensureContrastRatio=function(E,b,x){const y=n.ensureContrastRatio(E.rgba,b.rgba,x);if(y)return p.toColor(y>>24&255,y>>16&255,y>>8&255)},u.opaque=function(E){const b=(255|E.rgba)>>>0;return[c,h,g]=n.toChannels(b),{css:p.toCss(c,h,g),rgba:b}},u.opacity=S,u.multiplyOpacity=function(E,b){return a=255&E.rgba,S(E,a*b/255)},u.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(s.color=m={})),(function(u){let S,E;try{const b=document.createElement("canvas");b.width=1,b.height=1;const x=b.getContext("2d",{willReadFrequently:!0});x&&(S=x,S.globalCompositeOperation="copy",E=S.createLinearGradient(0,0,1,1))}catch{}u.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return c=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),g=parseInt(b.slice(3,4).repeat(2),16),p.toColor(c,h,g);case 5:return c=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),g=parseInt(b.slice(3,4).repeat(2),16),a=parseInt(b.slice(4,5).repeat(2),16),p.toColor(c,h,g,a);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const x=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(x)return c=parseInt(x[1]),h=parseInt(x[2]),g=parseInt(x[3]),a=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),p.toColor(c,h,g,a);if(!S||!E)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=E,S.fillStyle=b,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[c,h,g,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(c,h,g,a),css:b}}})(w||(s.css=w={})),(function(u){function S(E,b,x){const y=E/255,R=b/255,L=x/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}u.relativeLuminance=function(E){return S(E>>16&255,E>>8&255,255&E)},u.relativeLuminance2=S})(_||(s.rgb=_={})),(function(u){function S(b,x,y){const R=b>>24&255,L=b>>16&255,I=b>>8&255;let M=x>>24&255,B=x>>16&255,G=x>>8&255,X=l(_.relativeLuminance2(M,B,G),_.relativeLuminance2(R,L,I));for(;X<y&&(M>0||B>0||G>0);)M-=Math.max(0,Math.ceil(.1*M)),B-=Math.max(0,Math.ceil(.1*B)),G-=Math.max(0,Math.ceil(.1*G)),X=l(_.relativeLuminance2(M,B,G),_.relativeLuminance2(R,L,I));return(M<<24|B<<16|G<<8|255)>>>0}function E(b,x,y){const R=b>>24&255,L=b>>16&255,I=b>>8&255;let M=x>>24&255,B=x>>16&255,G=x>>8&255,X=l(_.relativeLuminance2(M,B,G),_.relativeLuminance2(R,L,I));for(;X<y&&(M<255||B<255||G<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),B=Math.min(255,B+Math.ceil(.1*(255-B))),G=Math.min(255,G+Math.ceil(.1*(255-G))),X=l(_.relativeLuminance2(M,B,G),_.relativeLuminance2(R,L,I));return(M<<24|B<<16|G<<8|255)>>>0}u.blend=function(b,x){if(a=(255&x)/255,a===1)return x;const y=x>>24&255,R=x>>16&255,L=x>>8&255,I=b>>24&255,M=b>>16&255,B=b>>8&255;return c=I+Math.round((y-I)*a),h=M+Math.round((R-M)*a),g=B+Math.round((L-B)*a),p.toRgba(c,h,g)},u.ensureContrastRatio=function(b,x,y){const R=_.relativeLuminance(b>>8),L=_.relativeLuminance(x>>8);if(l(R,L)<y){if(L<R){const B=S(b,x,y),G=l(R,_.relativeLuminance(B>>8));if(G<y){const X=E(b,x,y);return G>l(R,_.relativeLuminance(X>>8))?B:X}return B}const I=E(b,x,y),M=l(R,_.relativeLuminance(I>>8));if(M<y){const B=S(b,x,y);return M>l(R,_.relativeLuminance(B>>8))?I:B}return I}},u.reduceLuminance=S,u.increaseLuminance=E,u.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}})(n||(s.rgba=n={})),s.toPaddedHex=o,s.contrastRatio=l},8969:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const h=c(844),g=c(2585),a=c(4348),p=c(7866),m=c(744),w=c(7302),_=c(6975),n=c(8460),o=c(1753),l=c(1480),u=c(7994),S=c(9282),E=c(5435),b=c(5981),x=c(2660);let y=!1;class R extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((I=>{var M;(M=this._onScrollApi)==null||M.fire(I.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(I){for(const M in I)this.optionsService.options[M]=I[M]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new w.OptionsService(I)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(u.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(x.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new b.WriteBuffer(((M,B)=>this._inputHandler.parse(M,B)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,M){this._writeBuffer.write(I,M)}writeSync(I,M){this._logService.logLevel<=g.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(I,M)}input(I,M=!0){this.coreService.triggerDataEvent(I,M)}resize(I,M){isNaN(I)||isNaN(M)||(I=Math.max(I,m.MINIMUM_COLS),M=Math.max(M,m.MINIMUM_ROWS),this._bufferService.resize(I,M))}scroll(I,M=!1){this._bufferService.scroll(I,M)}scrollLines(I,M,B){this._bufferService.scrollLines(I,M,B)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const M=I-this._bufferService.buffer.ydisp;M!==0&&this.scrollLines(M)}registerEscHandler(I,M){return this._inputHandler.registerEscHandler(I,M)}registerDcsHandler(I,M){return this._inputHandler.registerDcsHandler(I,M)}registerCsiHandler(I,M){return this._inputHandler.registerCsiHandler(I,M)}registerOscHandler(I,M){return this._inputHandler.registerOscHandler(I,M)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const M=this.optionsService.rawOptions.windowsPty;M&&M.buildNumber!==void 0&&M.buildNumber!==void 0?I=M.backend==="conpty"&&M.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const M of I)M.dispose()}))}}}s.CoreTerminal=R},8460:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const g=[];for(let a=0;a<this._listeners.length;a++)g.push(this._listeners[a]);for(let a=0;a<g.length;a++)g[a].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,h){return c((g=>h.fire(g)))},s.runAndSubscribe=function(c,h){return h(void 0),c((g=>h(g)))}},5435:function(z,s,c){var h=this&&this.__decorate||function(Y,k,F,O){var U,Q=arguments.length,ee=Q<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,F):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(Y,k,F,O);else for(var he=Y.length-1;he>=0;he--)(U=Y[he])&&(ee=(Q<3?U(ee):Q>3?U(k,F,ee):U(k,F))||ee);return Q>3&&ee&&Object.defineProperty(k,F,ee),ee},g=this&&this.__param||function(Y,k){return function(F,O){k(F,O,Y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const a=c(2584),p=c(7116),m=c(2015),w=c(844),_=c(482),n=c(8437),o=c(8460),l=c(643),u=c(511),S=c(3734),E=c(2585),b=c(1480),x=c(6242),y=c(6351),R=c(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function M(Y,k){if(Y>24)return k.setWinLines||!1;switch(Y){case 1:return!!k.restoreWin;case 2:return!!k.minimizeWin;case 3:return!!k.setWinPosition;case 4:return!!k.setWinSizePixels;case 5:return!!k.raiseWin;case 6:return!!k.lowerWin;case 7:return!!k.refreshWin;case 8:return!!k.setWinSizeChars;case 9:return!!k.maximizeWin;case 10:return!!k.fullscreenWin;case 11:return!!k.getWinState;case 13:return!!k.getWinPosition;case 14:return!!k.getWinSizePixels;case 15:return!!k.getScreenSizePixels;case 16:return!!k.getCellSizePixels;case 18:return!!k.getWinSizeChars;case 19:return!!k.getScreenSizeChars;case 20:return!!k.getIconTitle;case 21:return!!k.getWinTitle;case 22:return!!k.pushTitle;case 23:return!!k.popTitle;case 24:return!!k.setWinLines}return!1}var B;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(B||(s.WindowsOptionsReportType=B={}));let G=0;class X extends w.Disposable{getAttrData(){return this._curAttrData}constructor(k,F,O,U,Q,ee,he,ce,K=new m.EscapeSequenceParser){super(),this._bufferService=k,this._charsetService=F,this._coreService=O,this._logService=U,this._optionsService=Q,this._oscLinkService=ee,this._coreMouseService=he,this._unicodeService=ce,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new u.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:ne.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,ne,ie)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:ne,data:ie})})),this._parser.setDcsHandlerFallback(((P,ne,ie)=>{ne==="HOOK"&&(ie=ie.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:ne,payload:ie})})),this._parser.setPrintHandler(((P,ne,ie)=>this.print(P,ne,ie))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new x.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new x.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new x.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new x.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new x.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new x.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new x.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new x.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new x.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new x.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new x.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new x.OscHandler((P=>this.restoreCursorColor(P)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const P in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler(((P,ne)=>this.requestStatusString(P,ne))))}_preserveStack(k,F,O,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=k,this._parseStack.cursorStartY=F,this._parseStack.decodedLength=O,this._parseStack.position=U}_logSlowResolvingAsync(k){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([k,new Promise(((F,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((F=>{if(F!=="#SLOW_TIMEOUT")throw F;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(k,F){let O,U=this._activeBuffer.x,Q=this._activeBuffer.y,ee=0;const he=this._parseStack.paused;if(he){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,F))return this._logSlowResolvingAsync(O),O;U=this._parseStack.cursorStartX,Q=this._parseStack.cursorStartY,this._parseStack.paused=!1,k.length>I&&(ee=this._parseStack.position+I)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof k=="string"?` "${k}"`:` "${Array.prototype.map.call(k,(P=>String.fromCharCode(P))).join("")}"`),typeof k=="string"?k.split("").map((P=>P.charCodeAt(0))):k),this._parseBuffer.length<k.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(k.length,I))),he||this._dirtyRowTracker.clearRange(),k.length>I)for(let P=ee;P<k.length;P+=I){const ne=P+I<k.length?P+I:k.length,ie=typeof k=="string"?this._stringDecoder.decode(k.substring(P,ne),this._parseBuffer):this._utf8Decoder.decode(k.subarray(P,ne),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ie))return this._preserveStack(U,Q,ie,P),this._logSlowResolvingAsync(O),O}else if(!he){const P=typeof k=="string"?this._stringDecoder.decode(k,this._parseBuffer):this._utf8Decoder.decode(k,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,P))return this._preserveStack(U,Q,P,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===U&&this._activeBuffer.y===Q||this._onCursorMove.fire();const ce=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(ce,this._bufferService.rows-1))}print(k,F,O){let U,Q;const ee=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,ce=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,ne=this._curAttrData;let ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-F>0&&ie.getWidth(this._activeBuffer.x-1)===2&&ie.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let _e=this._parser.precedingJoinState;for(let fe=F;fe<O;++fe){if(U=k[fe],U<127&&ee){const Pe=ee[String.fromCharCode(U)];Pe&&(U=Pe.charCodeAt(0))}const ye=this._unicodeService.charProperties(U,_e);Q=b.UnicodeService.extractWidth(ye);const ve=b.UnicodeService.extractShouldJoin(ye),Te=ve?b.UnicodeService.extractWidth(_e):0;if(_e=ye,he&&this._onA11yChar.fire((0,_.stringFromCodePoint)(U)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Q-Te>ce){if(K){const Pe=ie;let Se=this._activeBuffer.x-Te;for(this._activeBuffer.x=Te,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),ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Te>0&&ie instanceof n.BufferLine&&ie.copyCellsFrom(Pe,Se,0,Te,!1);Se<ce;)Pe.setCellFromCodepoint(Se++,0,1,ne)}else if(this._activeBuffer.x=ce-1,Q===2)continue}if(ve&&this._activeBuffer.x){const Pe=ie.getWidth(this._activeBuffer.x-1)?1:2;ie.addCodepointToCell(this._activeBuffer.x-Pe,U,Q);for(let Se=Q-Te;--Se>=0;)ie.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(P&&(ie.insertCells(this._activeBuffer.x,Q-Te,this._activeBuffer.getNullCell(ne)),ie.getWidth(ce-1)===2&&ie.setCellFromCodepoint(ce-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,ne)),ie.setCellFromCodepoint(this._activeBuffer.x++,U,Q,ne),Q>0)for(;--Q;)ie.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=_e,this._activeBuffer.x<ce&&O-F>0&&ie.getWidth(this._activeBuffer.x)===0&&!ie.hasContent(this._activeBuffer.x)&&ie.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(k,F){return k.final!=="t"||k.prefix||k.intermediates?this._parser.registerCsiHandler(k,F):this._parser.registerCsiHandler(k,(O=>!M(O.params[0],this._optionsService.rawOptions.windowOptions)||F(O)))}registerDcsHandler(k,F){return this._parser.registerDcsHandler(k,new y.DcsHandler(F))}registerEscHandler(k,F){return this._parser.registerEscHandler(k,F)}registerOscHandler(k,F){return this._parser.registerOscHandler(k,new x.OscHandler(F))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var k;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&&((k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&k.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);F.hasWidth(this._activeBuffer.x)&&!F.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const k=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-k),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(k=this._bufferService.cols-1){this._activeBuffer.x=Math.min(k,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(k,F){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=k,this._activeBuffer.y=this._activeBuffer.scrollTop+F):(this._activeBuffer.x=k,this._activeBuffer.y=F),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(k,F){this._restrictCursor(),this._setCursor(this._activeBuffer.x+k,this._activeBuffer.y+F)}cursorUp(k){const F=this._activeBuffer.y-this._activeBuffer.scrollTop;return F>=0?this._moveCursor(0,-Math.min(F,k.params[0]||1)):this._moveCursor(0,-(k.params[0]||1)),!0}cursorDown(k){const F=this._activeBuffer.scrollBottom-this._activeBuffer.y;return F>=0?this._moveCursor(0,Math.min(F,k.params[0]||1)):this._moveCursor(0,k.params[0]||1),!0}cursorForward(k){return this._moveCursor(k.params[0]||1,0),!0}cursorBackward(k){return this._moveCursor(-(k.params[0]||1),0),!0}cursorNextLine(k){return this.cursorDown(k),this._activeBuffer.x=0,!0}cursorPrecedingLine(k){return this.cursorUp(k),this._activeBuffer.x=0,!0}cursorCharAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(k){return this._setCursor(k.length>=2?(k.params[1]||1)-1:0,(k.params[0]||1)-1),!0}charPosAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(k){return this._moveCursor(k.params[0]||1,0),!0}linePosAbsolute(k){return this._setCursor(this._activeBuffer.x,(k.params[0]||1)-1),!0}vPositionRelative(k){return this._moveCursor(0,k.params[0]||1),!0}hVPosition(k){return this.cursorPosition(k),!0}tabClear(k){const F=k.params[0];return F===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:F===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=k.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=k.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(k){const F=k.params[0];return F===1&&(this._curAttrData.bg|=536870912),F!==2&&F!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(k,F,O,U=!1,Q=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);ee.replaceCells(F,O,this._activeBuffer.getNullCell(this._eraseAttrData()),Q),U&&(ee.isWrapped=!1)}_resetBufferLine(k,F=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),F),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+k),O.isWrapped=!1)}eraseInDisplay(k,F=!1){let O;switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);O<this._bufferService.rows;O++)this._resetBufferLine(O,F);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,F),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,F);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,F);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(k,F=!1){switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,F);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,F)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(k){this._restrictCursor();let F=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Q=this._bufferService.rows-1+this._activeBuffer.ybase-U+1;for(;F--;)this._activeBuffer.lines.splice(Q-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(k){this._restrictCursor();let F=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let U;for(U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-U;F--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(U,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(k){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.insertCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(k){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.deleteCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(k){let F=k.params[0]||1;for(;F--;)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(k){let F=k.params[0]||1;for(;F--;)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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=k.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);U.deleteCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=k.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);U.insertCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=k.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);U.insertCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=k.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);U.deleteCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(k){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(k.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(k){const F=this._parser.precedingJoinState;if(!F)return!0;const O=k.params[0]||1,U=b.UnicodeService.extractWidth(F),Q=this._activeBuffer.x-U,ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Q),he=new Uint32Array(ee.length*O);let ce=0;for(let P=0;P<ee.length;){const ne=ee.codePointAt(P)||0;he[ce++]=ne,P+=ne>65535?2:1}let K=ce;for(let P=1;P<O;++P)he.copyWithin(K,0,ce),K+=ce;return this.print(he,0,K),!0}sendDeviceAttributesPrimary(k){return k.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(k){return k.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(k.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0}_is(k){return(this._optionsService.rawOptions.termName+"").indexOf(k)===0}setMode(k){for(let F=0;F<k.length;F++)switch(k.params[F]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(k){for(let F=0;F<k.length;F++)switch(k.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(k){for(let F=0;F<k.length;F++)switch(k.params[F]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(k){for(let F=0;F<k.length;F++)switch(k.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),k.params[F]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(k,F){const O=this._coreService.decPrivateModes,{activeProtocol:U,activeEncoding:Q}=this._coreMouseService,ee=this._coreService,{buffers:he,cols:ce}=this._bufferService,{active:K,alt:P}=he,ne=this._optionsService.rawOptions,ie=ve=>ve?1:2,_e=k.params[0];return fe=_e,ye=F?_e===2?4:_e===4?ie(ee.modes.insertMode):_e===12?3:_e===20?ie(ne.convertEol):0:_e===1?ie(O.applicationCursorKeys):_e===3?ne.windowOptions.setWinLines?ce===80?2:ce===132?1:0:0:_e===6?ie(O.origin):_e===7?ie(O.wraparound):_e===8?3:_e===9?ie(U==="X10"):_e===12?ie(ne.cursorBlink):_e===25?ie(!ee.isCursorHidden):_e===45?ie(O.reverseWraparound):_e===66?ie(O.applicationKeypad):_e===67?4:_e===1e3?ie(U==="VT200"):_e===1002?ie(U==="DRAG"):_e===1003?ie(U==="ANY"):_e===1004?ie(O.sendFocus):_e===1005?4:_e===1006?ie(Q==="SGR"):_e===1015?4:_e===1016?ie(Q==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?ie(K===P):_e===2004?ie(O.bracketedPasteMode):0,ee.triggerDataEvent(`${a.C0.ESC}[${F?"":"?"}${fe};${ye}$y`),!0;var fe,ye}_updateAttrColor(k,F,O,U,Q){return F===2?(k|=50331648,k&=-16777216,k|=S.AttributeData.fromColorRGB([O,U,Q])):F===5&&(k&=-50331904,k|=33554432|255&O),k}_extractColor(k,F,O){const U=[0,0,-1,0,0,0];let Q=0,ee=0;do{if(U[ee+Q]=k.params[F+ee],k.hasSubParams(F+ee)){const he=k.getSubParams(F+ee);let ce=0;do U[1]===5&&(Q=1),U[ee+ce+1+Q]=he[ce];while(++ce<he.length&&ce+ee+1+Q<U.length);break}if(U[1]===5&&ee+Q>=2||U[1]===2&&ee+Q>=5)break;U[1]&&(Q=1)}while(++ee+F<k.length&&ee+Q<U.length);for(let he=2;he<U.length;++he)U[he]===-1&&(U[he]=0);switch(U[0]){case 38:O.fg=this._updateAttrColor(O.fg,U[1],U[3],U[4],U[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,U[1],U[3],U[4],U[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,U[1],U[3],U[4],U[5])}return ee}_processUnderline(k,F){F.extended=F.extended.clone(),(!~k||k>5)&&(k=1),F.extended.underlineStyle=k,F.fg|=268435456,k===0&&(F.fg&=-268435457),F.updateExtended()}_processSGR0(k){k.fg=n.DEFAULT_ATTR_DATA.fg,k.bg=n.DEFAULT_ATTR_DATA.bg,k.extended=k.extended.clone(),k.extended.underlineStyle=0,k.extended.underlineColor&=-67108864,k.updateExtended()}charAttributes(k){if(k.length===1&&k.params[0]===0)return this._processSGR0(this._curAttrData),!0;const F=k.length;let O;const U=this._curAttrData;for(let Q=0;Q<F;Q++)O=k.params[Q],O>=30&&O<=37?(U.fg&=-50331904,U.fg|=16777216|O-30):O>=40&&O<=47?(U.bg&=-50331904,U.bg|=16777216|O-40):O>=90&&O<=97?(U.fg&=-50331904,U.fg|=16777224|O-90):O>=100&&O<=107?(U.bg&=-50331904,U.bg|=16777224|O-100):O===0?this._processSGR0(U):O===1?U.fg|=134217728:O===3?U.bg|=67108864:O===4?(U.fg|=268435456,this._processUnderline(k.hasSubParams(Q)?k.getSubParams(Q)[0]:1,U)):O===5?U.fg|=536870912:O===7?U.fg|=67108864:O===8?U.fg|=1073741824:O===9?U.fg|=2147483648:O===2?U.bg|=134217728:O===21?this._processUnderline(2,U):O===22?(U.fg&=-134217729,U.bg&=-134217729):O===23?U.bg&=-67108865:O===24?(U.fg&=-268435457,this._processUnderline(0,U)):O===25?U.fg&=-536870913:O===27?U.fg&=-67108865:O===28?U.fg&=-1073741825:O===29?U.fg&=2147483647:O===39?(U.fg&=-67108864,U.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):O===49?(U.bg&=-67108864,U.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?Q+=this._extractColor(k,Q,U):O===53?U.bg|=1073741824:O===55?U.bg&=-1073741825:O===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):O===100?(U.fg&=-67108864,U.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(k){switch(k.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:const F=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${F};${O}R`)}return!0}deviceStatusPrivate(k){if(k.params[0]===6){const F=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${F};${O}R`)}return!0}softReset(k){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(k){const F=k.params[0]||1;switch(F){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=F%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(k){const F=k.params[0]||1;let O;return(k.length<2||(O=k.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>F&&(this._activeBuffer.scrollTop=F-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(k){if(!M(k.params[0],this._optionsService.rawOptions.windowOptions))return!0;const F=k.length>1?k.params[1]:0;switch(k.params[0]){case 14:F!==2&&this._onRequestWindowsOptionsReport.fire(B.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(B.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:F!==0&&F!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),F!==0&&F!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:F!==0&&F!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),F!==0&&F!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(k){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(k){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(k){return this._windowTitle=k,this._onTitleChange.fire(k),!0}setIconName(k){return this._iconName=k,!0}setOrReportIndexedColor(k){const F=[],O=k.split(";");for(;O.length>1;){const U=O.shift(),Q=O.shift();if(/^\d+$/.exec(U)){const ee=parseInt(U);if($(ee))if(Q==="?")F.push({type:0,index:ee});else{const he=(0,R.parseColor)(Q);he&&F.push({type:1,index:ee,color:he})}}}return F.length&&this._onColor.fire(F),!0}setHyperlink(k){const F=k.split(";");return!(F.length<2)&&(F[1]?this._createHyperlink(F[0],F[1]):!F[0]&&this._finishHyperlink())}_createHyperlink(k,F){this._getCurrentLinkId()&&this._finishHyperlink();const O=k.split(":");let U;const Q=O.findIndex((ee=>ee.startsWith("id=")));return Q!==-1&&(U=O[Q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:F}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(k,F){const O=k.split(";");for(let U=0;U<O.length&&!(F>=this._specialColors.length);++U,++F)if(O[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[F]}]);else{const Q=(0,R.parseColor)(O[U]);Q&&this._onColor.fire([{type:1,index:this._specialColors[F],color:Q}])}return!0}setOrReportFgColor(k){return this._setOrReportSpecialColor(k,0)}setOrReportBgColor(k){return this._setOrReportSpecialColor(k,1)}setOrReportCursorColor(k){return this._setOrReportSpecialColor(k,2)}restoreIndexedColor(k){if(!k)return this._onColor.fire([{type:2}]),!0;const F=[],O=k.split(";");for(let U=0;U<O.length;++U)if(/^\d+$/.exec(O[U])){const Q=parseInt(O[U]);$(Q)&&F.push({type:2,index:Q})}return F.length&&this._onColor.fire(F),!0}restoreFgColor(k){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(k){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(k){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,p.DEFAULT_CHARSET),!0}selectCharset(k){return k.length!==2?(this.selectDefaultCharset(),!0):(k[0]==="/"||this._charsetService.setgCharset(L[k[0]],p.CHARSETS[k[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const k=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,k,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=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(k){return this._charsetService.setgLevel(k),!0}screenAlignmentPattern(){const k=new u.CellData;k.content=4194373,k.fg=this._curAttrData.fg,k.bg=this._curAttrData.bg,this._setCursor(0,0);for(let F=0;F<this._bufferService.rows;++F){const O=this._activeBuffer.ybase+this._activeBuffer.y+F,U=this._activeBuffer.lines.get(O);U&&(U.fill(k),U.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(k,F){const O=this._bufferService.buffer,U=this._optionsService.rawOptions;return(Q=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${Q}${a.C0.ESC}\\`),!0))(k==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:k==='"p'?'P1$r61;1"p':k==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:k==="m"?"P1$r0m":k===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(k,F){this._dirtyRowTracker.markRangeDirty(k,F)}}s.InputHandler=X;let W=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,k){Y>k&&(G=Y,Y=k,k=G),Y<this.start&&(this.start=Y),k>this.end&&(this.end=k)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function $(Y){return 0<=Y&&Y<256}W=h([g(0,E.IBufferService)],W)},844:(z,s)=>{function c(h){for(const g of h)g.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=c,s.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,a,p){this._data[g]||(this._data[g]={}),this._data[g][a]=p}get(g,a){return this._data[g]?this._data[g][a]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(h,g,a,p,m){this._data.get(h,g)||this._data.set(h,g,new c),this._data.get(h,g).set(a,p,m)}get(h,g,a,p){var m;return(m=this._data.get(h,g))==null?void 0:m.get(a,p)}clear(){this._data.clear()}}},6114:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const c=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=c.includes("Firefox"),s.isLegacyEdge=c.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(c),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad=h==="iPad",s.isIphone=h==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(c)},6106:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let c=0;s.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const g=this._getKey(h);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,g){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let g=0,a=this._array.length-1;for(;a>=g;){let p=g+a>>1;const m=this._getKey(this._array[p]);if(m>h)a=p-1;else{if(!(m<h)){for(;p>0&&this._getKey(this._array[p-1])===h;)p--;return p}g=p+1}}return g}}},7226:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(m){this._idleCallback=void 0;let w=0,_=0,n=m.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),_=Math.max(w,_),o=m.timeRemaining(),1.5*_>o)return n-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-w))}ms`),void this._start();n=o}this.clear()}}class a extends g{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const w=Date.now()+m;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=a,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const h=c(643);s.updateWindowsModeWrappedState=function(g){const a=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=a==null?void 0:a.get(g.cols-1),m=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);m&&p&&(m.isWrapped=p[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&p[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new c;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=h},9092:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const h=c(6349),g=c(7226),a=c(3734),p=c(8437),m=c(4634),w=c(511),_=c(643),n=c(4863),o=c(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(l,u,S){this._hasScrollback=l,this._optionsService=u,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,u){return new p.BufferLine(this._bufferService.cols,this.getNullCell(l),u)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const u=l+this._optionsService.rawOptions.scrollback;return u>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:u}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=p.DEFAULT_ATTR_DATA);let u=this._rows;for(;u--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,u){const S=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const b=this._getCorrectBufferLength(u);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<l)for(let y=0;y<this.lines.length;y++)E+=+this.lines.get(y).resize(l,S);let x=0;if(this._rows<u)for(let y=this._rows;y<u;y++)this.lines.length<u+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(l,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+x+1?(this.ybase--,x++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(l,S)));else for(let y=this._rows;y>u;y--)this.lines.length>u+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const y=this.lines.length-b;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=b}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,u-1),x&&(this.y+=x),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=u-1,this._isReflowEnabled&&(this._reflow(l,u),this._cols>l))for(let x=0;x<this.lines.length;x++)E+=+this.lines.get(x).resize(l,S);this._cols=l,this._rows=u,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let u=0;for(;this._memoryCleanupPosition<this.lines.length;)if(u+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),u>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,u){this._cols!==l&&(l>this._cols?this._reflowLarger(l,u):this._reflowSmaller(l,u))}_reflowLarger(l,u){const S=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(S.length>0){const E=(0,m.reflowLargerCreateNewLayout)(this.lines,S);(0,m.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(l,u,E.countRemoved)}}_reflowLargerAdjustViewport(l,u,S){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let b=S;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<u&&this.lines.push(new p.BufferLine(l,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(l,u){const S=this.getNullCell(p.DEFAULT_ATTR_DATA),E=[];let b=0;for(let x=this.lines.length-1;x>=0;x--){let y=this.lines.get(x);if(!y||!y.isWrapped&&y.getTrimmedLength()<=l)continue;const R=[y];for(;y.isWrapped&&x>0;)y=this.lines.get(--x),R.unshift(y);const L=this.ybase+this.y;if(L>=x&&L<x+R.length)continue;const I=R[R.length-1].getTrimmedLength(),M=(0,m.reflowSmallerGetNewLineLengths)(R,this._cols,l),B=M.length-R.length;let G;G=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const X=[];for(let O=0;O<B;O++){const U=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);X.push(U)}X.length>0&&(E.push({start:x+R.length+b,newLines:X}),b+=X.length),R.push(...X);let W=M.length-1,$=M[W];$===0&&(W--,$=M[W]);let Y=R.length-B-1,k=I;for(;Y>=0;){const O=Math.min(k,$);if(R[W]===void 0)break;if(R[W].copyCellsFrom(R[Y],k-O,$-O,O,!0),$-=O,$===0&&(W--,$=M[W]),k-=O,k===0){Y--;const U=Math.max(Y,0);k=(0,m.getWrappedLineTrimmedLength)(R,U,this._cols)}}for(let O=0;O<R.length;O++)M[O]<l&&R[O].setCell(M[O],S);let F=B-G;for(;F-- >0;)this.ybase===0?this.y<u-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-u&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+u-1)}if(E.length>0){const x=[],y=[];for(let W=0;W<this.lines.length;W++)y.push(this.lines.get(W));const R=this.lines.length;let L=R-1,I=0,M=E[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let B=0;for(let W=Math.min(this.lines.maxLength-1,R+b-1);W>=0;W--)if(M&&M.start>L+B){for(let $=M.newLines.length-1;$>=0;$--)this.lines.set(W--,M.newLines[$]);W++,x.push({index:L+1,amount:M.newLines.length}),B+=M.newLines.length,M=E[++I]}else this.lines.set(W,y[L--]);let G=0;for(let W=x.length-1;W>=0;W--)x[W].index+=G,this.lines.onInsertEmitter.fire(x[W]),G+=x[W].amount;const X=Math.max(0,R+b-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(l,u,S=0,E){const b=this.lines.get(l);return b?b.translateToString(u,S,E):""}getWrappedRangeForLine(l){let u=l,S=l;for(;u>0&&this.lines.get(u).isWrapped;)u--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:u,last:S}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let u=0;u<this.markers.length;u++)this.markers[u].line===l&&(this.markers[u].dispose(),this.markers.splice(u--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const u=new n.Marker(l);return this.markers.push(u),u.register(this.lines.onTrim((S=>{u.line-=S,u.line<0&&u.dispose()}))),u.register(this.lines.onInsert((S=>{u.line>=S.index&&(u.line+=S.amount)}))),u.register(this.lines.onDelete((S=>{u.line>=S.index&&u.line<S.index+S.amount&&u.dispose(),u.line>S.index&&(u.line-=S.amount)}))),u.register(u.onDispose((()=>this._removeMarker(u)))),u}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const h=c(3734),g=c(511),a=c(643),p=c(482);s.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let m=0;class w{constructor(n,o,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const u=o||g.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let S=0;S<n;++S)this.setCell(S,u);this.length=n}get(n){const o=this._data[3*n+0],l=2097151&o;return[this._data[3*n+1],2097152&o?this._combined[n]:l?(0,p.stringFromCodePoint)(l):"",o>>22,2097152&o?this._combined[n].charCodeAt(this._combined[n].length-1):l]}set(n,o){this._data[3*n+1]=o[a.CHAR_DATA_ATTR_INDEX],o[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=o[1],this._data[3*n+0]=2097152|n|o[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=o[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const o=this._data[3*n+0];return 2097152&o?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&o}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const o=this._data[3*n+0];return 2097152&o?this._combined[n]:2097151&o?(0,p.stringFromCodePoint)(2097151&o):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,o){return m=3*n,o.content=this._data[m+0],o.fg=this._data[m+1],o.bg=this._data[m+2],2097152&o.content&&(o.combinedData=this._combined[n]),268435456&o.bg&&(o.extended=this._extendedAttrs[n]),o}setCell(n,o){2097152&o.content&&(this._combined[n]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[n]=o.extended),this._data[3*n+0]=o.content,this._data[3*n+1]=o.fg,this._data[3*n+2]=o.bg}setCellFromCodepoint(n,o,l,u){268435456&u.bg&&(this._extendedAttrs[n]=u.extended),this._data[3*n+0]=o|l<<22,this._data[3*n+1]=u.fg,this._data[3*n+2]=u.bg}addCodepointToCell(n,o,l){let u=this._data[3*n+0];2097152&u?this._combined[n]+=(0,p.stringFromCodePoint)(o):2097151&u?(this._combined[n]=(0,p.stringFromCodePoint)(2097151&u)+(0,p.stringFromCodePoint)(o),u&=-2097152,u|=2097152):u=o|4194304,l&&(u&=-12582913,u|=l<<22),this._data[3*n+0]=u}insertCells(n,o,l){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,l),o<this.length-n){const u=new g.CellData;for(let S=this.length-n-o-1;S>=0;--S)this.setCell(n+o+S,this.loadCell(n+S,u));for(let S=0;S<o;++S)this.setCell(n+S,l)}else for(let u=n;u<this.length;++u)this.setCell(u,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(n,o,l){if(n%=this.length,o<this.length-n){const u=new g.CellData;for(let S=0;S<this.length-n-o;++S)this.setCell(n+S,this.loadCell(n+o+S,u));for(let S=this.length-o;S<this.length;++S)this.setCell(S,l)}else for(let u=n;u<this.length;++u)this.setCell(u,l);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,l),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,l)}replaceCells(n,o,l,u=!1){if(u)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,l),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodepoint(o,0,1,l);n<o&&n<this.length;)this.isProtected(n)||this.setCell(n,l),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,l),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o,0,1,l);n<o&&n<this.length;)this.setCell(n++,l)}resize(n,o){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const u=new Uint32Array(l);u.set(this._data),this._data=u}for(let u=this.length;u<n;++u)this.setCell(u,o)}else{this._data=this._data.subarray(0,l);const u=Object.keys(this._combined);for(let E=0;E<u.length;E++){const b=parseInt(u[E],10);b>=n&&delete this._combined[b]}const S=Object.keys(this._extendedAttrs);for(let E=0;E<S.length;E++){const b=parseInt(S[E],10);b>=n&&delete this._extendedAttrs[b]}}return this.length=n,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,o=!1){if(o)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,n);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const o in n._combined)this._combined[o]=n._combined[o];this._extendedAttrs={};for(const o in n._extendedAttrs)this._extendedAttrs[o]=n._extendedAttrs[o];this.isWrapped=n.isWrapped}clone(){const n=new w(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const o in this._combined)n._combined[o]=this._combined[o];for(const o in this._extendedAttrs)n._extendedAttrs[o]=this._extendedAttrs[o];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,o,l,u,S){const E=n._data;if(S)for(let x=u-1;x>=0;x--){for(let y=0;y<3;y++)this._data[3*(l+x)+y]=E[3*(o+x)+y];268435456&E[3*(o+x)+2]&&(this._extendedAttrs[l+x]=n._extendedAttrs[o+x])}else for(let x=0;x<u;x++){for(let y=0;y<3;y++)this._data[3*(l+x)+y]=E[3*(o+x)+y];268435456&E[3*(o+x)+2]&&(this._extendedAttrs[l+x]=n._extendedAttrs[o+x])}const b=Object.keys(n._combined);for(let x=0;x<b.length;x++){const y=parseInt(b[x],10);y>=o&&(this._combined[y-o+l]=n._combined[y])}}translateToString(n,o,l,u){o=o??0,l=l??this.length,n&&(l=Math.min(l,this.getTrimmedLength())),u&&(u.length=0);let S="";for(;o<l;){const E=this._data[3*o+0],b=2097151&E,x=2097152&E?this._combined[o]:b?(0,p.stringFromCodePoint)(b):a.WHITESPACE_CELL_CHAR;if(S+=x,u)for(let y=0;y<x.length;++y)u.push(o);o+=E>>22||1}return u&&u.push(o),S}}s.BufferLine=w},4841:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(z,s)=>{function c(h,g,a){if(g===h.length-1)return h[g].getTrimmedLength();const p=!h[g].hasContent(a-1)&&h[g].getWidth(a-1)===1,m=h[g+1].getWidth(0)===2;return p&&m?a-1:a}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(h,g,a,p,m){const w=[];for(let _=0;_<h.length-1;_++){let n=_,o=h.get(++n);if(!o.isWrapped)continue;const l=[h.get(_)];for(;n<h.length&&o.isWrapped;)l.push(o),o=h.get(++n);if(p>=_&&p<n){_+=l.length-1;continue}let u=0,S=c(l,u,g),E=1,b=0;for(;E<l.length;){const y=c(l,E,g),R=y-b,L=a-S,I=Math.min(R,L);l[u].copyCellsFrom(l[E],b,S,I,!1),S+=I,S===a&&(u++,S=0),b+=I,b===y&&(E++,b=0),S===0&&u!==0&&l[u-1].getWidth(a-1)===2&&(l[u].copyCellsFrom(l[u-1],a-1,S++,1,!1),l[u-1].setCell(a-1,m))}l[u].replaceCells(S,a,m);let x=0;for(let y=l.length-1;y>0&&(y>u||l[y].getTrimmedLength()===0);y--)x++;x>0&&(w.push(_+l.length-x),w.push(x)),_+=l.length-1}return w},s.reflowLargerCreateNewLayout=function(h,g){const a=[];let p=0,m=g[p],w=0;for(let _=0;_<h.length;_++)if(m===_){const n=g[++p];h.onDeleteEmitter.fire({index:_-w,amount:n}),_+=n-1,w+=n,m=g[++p]}else a.push(_);return{layout:a,countRemoved:w}},s.reflowLargerApplyNewLayout=function(h,g){const a=[];for(let p=0;p<g.length;p++)a.push(h.get(g[p]));for(let p=0;p<a.length;p++)h.set(p,a[p]);h.length=g.length},s.reflowSmallerGetNewLineLengths=function(h,g,a){const p=[],m=h.map(((o,l)=>c(h,l,g))).reduce(((o,l)=>o+l));let w=0,_=0,n=0;for(;n<m;){if(m-n<a){p.push(m-n);break}w+=a;const o=c(h,_,g);w>o&&(w-=o,_++);const l=h[_].getWidth(w-1)===2;l&&w--;const u=l?a-1:a;p.push(u),n+=u}return p},s.getWrappedLineTrimmedLength=c},5295:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const h=c(8460),g=c(844),a=c(9092);class p extends g.Disposable{constructor(w,_){super(),this._optionsService=w,this._bufferService=_,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,_){this._normal.resize(w,_),this._alt.resize(w,_),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}s.BufferSet=p},511:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=c(482),g=c(643),a=c(3734);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const _=new p;return _.setFromCharData(w),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const n=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const o=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(n-55296)+o-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},643:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const h=c(8460),g=c(844);class a{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}s.Marker=a,a._nextId=1},7116:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(z,s)=>{var c,h,g;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(a){a.NUL="\0",a.SOH="",a.STX="",a.ETX="",a.EOT="",a.ENQ="",a.ACK="",a.BEL="\x07",a.BS="\b",a.HT=" ",a.LF=`
81
+ `,a.VT="\v",a.FF="\f",a.CR="\r",a.SO="",a.SI="",a.DLE="",a.DC1="",a.DC2="",a.DC3="",a.DC4="",a.NAK="",a.SYN="",a.ETB="",a.CAN="",a.EM="",a.SUB="",a.ESC="\x1B",a.FS="",a.GS="",a.RS="",a.US="",a.SP=" ",a.DEL=""})(c||(s.C0=c={})),(function(a){a.PAD="€",a.HOP="",a.BPH="‚",a.NBH="ƒ",a.IND="„",a.NEL="…",a.SSA="†",a.ESA="‡",a.HTS="ˆ",a.HTJ="‰",a.VTS="Š",a.PLD="‹",a.PLU="Œ",a.RI="",a.SS2="Ž",a.SS3="",a.DCS="",a.PU1="‘",a.PU2="’",a.STS="“",a.CCH="”",a.MW="•",a.SPA="–",a.EPA="—",a.SOS="˜",a.SGCI="™",a.SCI="š",a.CSI="›",a.ST="œ",a.OSC="",a.PM="ž",a.APC="Ÿ"})(h||(s.C1=h={})),(function(a){a.ST=`${c.ESC}\\`})(g||(s.C1_ESCAPED=g={}))},7399:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const h=c(2584),g={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:["'",'"']};s.evaluateKeyboardEvent=function(a,p,m,w){const _={type:0,cancel:!1,key:void 0},n=(a.shiftKey?1:0)|(a.altKey?2:0)|(a.ctrlKey?4:0)|(a.metaKey?8:0);switch(a.keyCode){case 0:a.key==="UIKeyInputUpArrow"?_.key=p?h.C0.ESC+"OA":h.C0.ESC+"[A":a.key==="UIKeyInputLeftArrow"?_.key=p?h.C0.ESC+"OD":h.C0.ESC+"[D":a.key==="UIKeyInputRightArrow"?_.key=p?h.C0.ESC+"OC":h.C0.ESC+"[C":a.key==="UIKeyInputDownArrow"&&(_.key=p?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:_.key=a.ctrlKey?"\b":h.C0.DEL,a.altKey&&(_.key=h.C0.ESC+_.key);break;case 9:if(a.shiftKey){_.key=h.C0.ESC+"[Z";break}_.key=h.C0.HT,_.cancel=!0;break;case 13:_.key=a.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,_.cancel=!0;break;case 27:_.key=h.C0.ESC,a.altKey&&(_.key=h.C0.ESC+h.C0.ESC),_.cancel=!0;break;case 37:if(a.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"D",_.key===h.C0.ESC+"[1;3D"&&(_.key=h.C0.ESC+(m?"b":"[1;5D"))):_.key=p?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(a.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"C",_.key===h.C0.ESC+"[1;3C"&&(_.key=h.C0.ESC+(m?"f":"[1;5C"))):_.key=p?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(a.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"A",m||_.key!==h.C0.ESC+"[1;3A"||(_.key=h.C0.ESC+"[1;5A")):_.key=p?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(a.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"B",m||_.key!==h.C0.ESC+"[1;3B"||(_.key=h.C0.ESC+"[1;5B")):_.key=p?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(_.key=h.C0.ESC+"[2~");break;case 46:_.key=n?h.C0.ESC+"[3;"+(n+1)+"~":h.C0.ESC+"[3~";break;case 36:_.key=n?h.C0.ESC+"[1;"+(n+1)+"H":p?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:_.key=n?h.C0.ESC+"[1;"+(n+1)+"F":p?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:a.shiftKey?_.type=2:a.ctrlKey?_.key=h.C0.ESC+"[5;"+(n+1)+"~":_.key=h.C0.ESC+"[5~";break;case 34:a.shiftKey?_.type=3:a.ctrlKey?_.key=h.C0.ESC+"[6;"+(n+1)+"~":_.key=h.C0.ESC+"[6~";break;case 112:_.key=n?h.C0.ESC+"[1;"+(n+1)+"P":h.C0.ESC+"OP";break;case 113:_.key=n?h.C0.ESC+"[1;"+(n+1)+"Q":h.C0.ESC+"OQ";break;case 114:_.key=n?h.C0.ESC+"[1;"+(n+1)+"R":h.C0.ESC+"OR";break;case 115:_.key=n?h.C0.ESC+"[1;"+(n+1)+"S":h.C0.ESC+"OS";break;case 116:_.key=n?h.C0.ESC+"[15;"+(n+1)+"~":h.C0.ESC+"[15~";break;case 117:_.key=n?h.C0.ESC+"[17;"+(n+1)+"~":h.C0.ESC+"[17~";break;case 118:_.key=n?h.C0.ESC+"[18;"+(n+1)+"~":h.C0.ESC+"[18~";break;case 119:_.key=n?h.C0.ESC+"[19;"+(n+1)+"~":h.C0.ESC+"[19~";break;case 120:_.key=n?h.C0.ESC+"[20;"+(n+1)+"~":h.C0.ESC+"[20~";break;case 121:_.key=n?h.C0.ESC+"[21;"+(n+1)+"~":h.C0.ESC+"[21~";break;case 122:_.key=n?h.C0.ESC+"[23;"+(n+1)+"~":h.C0.ESC+"[23~";break;case 123:_.key=n?h.C0.ESC+"[24;"+(n+1)+"~":h.C0.ESC+"[24~";break;default:if(!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)if(m&&!w||!a.altKey||a.metaKey)!m||a.altKey||a.ctrlKey||a.shiftKey||!a.metaKey?a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.keyCode>=48&&a.key.length===1?_.key=a.key:a.key&&a.ctrlKey&&(a.key==="_"&&(_.key=h.C0.US),a.key==="@"&&(_.key=h.C0.NUL)):a.keyCode===65&&(_.type=1);else{const o=g[a.keyCode],l=o==null?void 0:o[a.shiftKey?1:0];if(l)_.key=h.C0.ESC+l;else if(a.keyCode>=65&&a.keyCode<=90){const u=a.ctrlKey?a.keyCode-64:a.keyCode+32;let S=String.fromCharCode(u);a.shiftKey&&(S=S.toUpperCase()),_.key=h.C0.ESC+S}else if(a.keyCode===32)_.key=h.C0.ESC+(a.ctrlKey?h.C0.NUL:" ");else if(a.key==="Dead"&&a.code.startsWith("Key")){let u=a.code.slice(3,4);a.shiftKey||(u=u.toLowerCase()),_.key=h.C0.ESC+u,_.cancel=!0}}else a.keyCode>=65&&a.keyCode<=90?_.key=String.fromCharCode(a.keyCode-64):a.keyCode===32?_.key=h.C0.NUL:a.keyCode>=51&&a.keyCode<=55?_.key=String.fromCharCode(a.keyCode-51+27):a.keyCode===56?_.key=h.C0.DEL:a.keyCode===219?_.key=h.C0.ESC:a.keyCode===220?_.key=h.C0.FS:a.keyCode===221&&(_.key=h.C0.GS)}return _}},482:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},s.utf32ToString=function(c,h=0,g=c.length){let a="";for(let p=h;p<g;++p){let m=c[p];m>65535?(m-=65536,a+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):a+=String.fromCharCode(m)}return a},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const g=c.length;if(!g)return 0;let a=0,p=0;if(this._interim){const m=c.charCodeAt(p++);56320<=m&&m<=57343?h[a++]=1024*(this._interim-55296)+m-56320+65536:(h[a++]=this._interim,h[a++]=m),this._interim=0}for(let m=p;m<g;++m){const w=c.charCodeAt(m);if(55296<=w&&w<=56319){if(++m>=g)return this._interim=w,a;const _=c.charCodeAt(m);56320<=_&&_<=57343?h[a++]=1024*(w-55296)+_-56320+65536:(h[a++]=w,h[a++]=_)}else w!==65279&&(h[a++]=w)}return a}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const g=c.length;if(!g)return 0;let a,p,m,w,_=0,n=0,o=0;if(this.interim[0]){let S=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let b,x=0;for(;(b=63&this.interim[++x])&&x<4;)E<<=6,E|=b;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=y-x;for(;o<R;){if(o>=g)return 0;if(b=c[o++],(192&b)!=128){o--,S=!0;break}this.interim[x++]=b,E<<=6,E|=63&b}S||(y===2?E<128?o--:h[_++]=E:y===3?E<2048||E>=55296&&E<=57343||E===65279||(h[_++]=E):E<65536||E>1114111||(h[_++]=E)),this.interim.fill(0)}const l=g-4;let u=o;for(;u<g;){for(;!(!(u<l)||128&(a=c[u])||128&(p=c[u+1])||128&(m=c[u+2])||128&(w=c[u+3]));)h[_++]=a,h[_++]=p,h[_++]=m,h[_++]=w,u+=4;if(a=c[u++],a<128)h[_++]=a;else if((224&a)==192){if(u>=g)return this.interim[0]=a,_;if(p=c[u++],(192&p)!=128){u--;continue}if(n=(31&a)<<6|63&p,n<128){u--;continue}h[_++]=n}else if((240&a)==224){if(u>=g)return this.interim[0]=a,_;if(p=c[u++],(192&p)!=128){u--;continue}if(u>=g)return this.interim[0]=a,this.interim[1]=p,_;if(m=c[u++],(192&m)!=128){u--;continue}if(n=(15&a)<<12|(63&p)<<6|63&m,n<2048||n>=55296&&n<=57343||n===65279)continue;h[_++]=n}else if((248&a)==240){if(u>=g)return this.interim[0]=a,_;if(p=c[u++],(192&p)!=128){u--;continue}if(u>=g)return this.interim[0]=a,this.interim[1]=p,_;if(m=c[u++],(192&m)!=128){u--;continue}if(u>=g)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=m,_;if(w=c[u++],(192&w)!=128){u--;continue}if(n=(7&a)<<18|(63&p)<<12|(63&m)<<6|63&w,n<65536||n>1114111)continue;h[_++]=n}}return _}}},225:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const h=c(1480),g=[[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]],a=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;s.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<g.length;++m)p.fill(0,g[m][0],g[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(w,_){let n,o=0,l=_.length-1;if(w<_[0][0]||w>_[l][1])return!1;for(;l>=o;)if(n=o+l>>1,w>_[n][1])o=n+1;else{if(!(w<_[n][0]))return!0;l=n-1}return!1})(m,a)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,w){let _=this.wcwidth(m),n=_===0&&w!==0;if(n){const o=h.UnicodeService.extractWidth(w);o===0?n=!1:o>_&&(_=o)}return h.UnicodeService.createPropertyValue(0,_,n)}}},5981:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const h=c(8460),g=c(844);class a extends g.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(w)}_innerWrite(m=0,w=!0){const _=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],o=this._action(n,w);if(o){const u=S=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(_,S);return void o.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(u)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=a},5941:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function g(a,p){const m=a.toString(16),w=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}s.parseColor=function(a){if(!a)return;let p=a.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=c.exec(p);if(m){const w=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/w*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/w*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/w*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),h.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,w=[0,0,0];for(let _=0;_<3;++_){const n=parseInt(p.slice(m*_,m*_+m),16);w[_]=m===1?n<<4:m===2?n:m===3?n>>4:n>>8}return w}},s.toRgbString=function(a,p=16){const[m,w,_]=a;return`rgb:${g(m,p)}/${g(w,p)}/${g(_,p)}`}},5770:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const h=c(482),g=c(8742),a=c(5770),p=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(w,_){this._handlers[w]===void 0&&(this._handlers[w]=[]);const n=this._handlers[w];return n.push(_),{dispose:()=>{const o=n.indexOf(_);o!==-1&&n.splice(o,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(w,_){if(this.reset(),this._ident=w,this._active=this._handlers[w]||p,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(w,_,n){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(w,_,n);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(w,_,n))}unhook(w,_=!0){if(this._active.length){let n=!1,o=this._active.length-1,l=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,n=_,l=this._stack.fallThrough,this._stack.paused=!1),!l&&n===!1){for(;o>=0&&(n=this._active[o].unhook(w),n!==!0);o--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,n;o--}for(;o>=0;o--)if(n=this._active[o].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",w);this._active=p,this._ident=0}};const m=new g.Params;m.addParam(0),s.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=m,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():m,this._data="",this._hitLimit=!1}put(w,_,n){this._hitLimit||(this._data+=(0,h.utf32ToString)(w,_,n),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let _=!1;if(this._hitLimit)_=!1;else if(w&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((n=>(this._params=m,this._data="",this._hitLimit=!1,n)));return this._params=m,this._data="",this._hitLimit=!1,_}}},2015:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const h=c(844),g=c(8742),a=c(6242),p=c(6351);class m{constructor(o){this.table=new Uint8Array(o)}setDefault(o,l){this.table.fill(o<<4|l)}add(o,l,u,S){this.table[l<<8|o]=u<<4|S}addMany(o,l,u,S){for(let E=0;E<o.length;E++)this.table[l<<8|o[E]]=u<<4|S}}s.TransitionTable=m;const w=160;s.VT500_TRANSITION_TABLE=(function(){const n=new m(4095),o=Array.apply(null,Array(256)).map(((x,y)=>y)),l=(x,y)=>o.slice(x,y),u=l(32,127),S=l(0,24);S.push(25),S.push.apply(S,l(28,32));const E=l(0,14);let b;for(b in n.setDefault(1,0),n.addMany(u,0,2,0),E)n.addMany([24,26,153,154],b,3,0),n.addMany(l(128,144),b,3,0),n.addMany(l(144,152),b,3,0),n.add(156,b,0,0),n.add(27,b,11,1),n.add(157,b,4,8),n.addMany([152,158,159],b,0,7),n.add(155,b,11,3),n.add(144,b,11,9);return n.addMany(S,0,3,0),n.addMany(S,1,3,1),n.add(127,1,0,1),n.addMany(S,8,0,8),n.addMany(S,3,3,3),n.add(127,3,0,3),n.addMany(S,4,3,4),n.add(127,4,0,4),n.addMany(S,6,3,6),n.addMany(S,5,3,5),n.add(127,5,0,5),n.addMany(S,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(u,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(l(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(u,7,0,7),n.addMany(S,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(l(64,127),3,7,0),n.addMany(l(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(l(48,60),4,8,4),n.addMany(l(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(l(32,64),6,0,6),n.add(127,6,0,6),n.addMany(l(64,127),6,0,0),n.addMany(l(32,48),3,9,5),n.addMany(l(32,48),5,9,5),n.addMany(l(48,64),5,0,6),n.addMany(l(64,127),5,7,0),n.addMany(l(32,48),4,9,5),n.addMany(l(32,48),1,9,2),n.addMany(l(32,48),2,9,2),n.addMany(l(48,127),2,10,0),n.addMany(l(48,80),1,10,0),n.addMany(l(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(l(96,127),1,10,0),n.add(80,1,11,9),n.addMany(S,9,0,9),n.add(127,9,0,9),n.addMany(l(28,32),9,0,9),n.addMany(l(32,48),9,9,12),n.addMany(l(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(S,11,0,11),n.addMany(l(32,128),11,0,11),n.addMany(l(28,32),11,0,11),n.addMany(S,10,0,10),n.add(127,10,0,10),n.addMany(l(28,32),10,0,10),n.addMany(l(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(l(32,48),10,9,12),n.addMany(S,12,0,12),n.add(127,12,0,12),n.addMany(l(28,32),12,0,12),n.addMany(l(32,48),12,9,12),n.addMany(l(48,64),12,0,11),n.addMany(l(64,127),12,12,13),n.addMany(l(64,127),10,12,13),n.addMany(l(64,127),9,12,13),n.addMany(S,13,13,13),n.addMany(u,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(w,0,2,0),n.add(w,8,5,8),n.add(w,6,0,6),n.add(w,11,0,11),n.add(w,13,13,13),n})();class _ extends h.Disposable{constructor(o=s.VT500_TRANSITION_TABLE){super(),this._transitions=o,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(l,u,S)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,u)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(o,l=[64,126]){let u=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(u=o.prefix.charCodeAt(0),u&&60>u||u>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<o.intermediates.length;++E){const b=o.intermediates.charCodeAt(E);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");u<<=8,u|=b}}if(o.final.length!==1)throw new Error("final must be a single byte");const S=o.final.charCodeAt(0);if(l[0]>S||S>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return u<<=8,u|=S,u}identToString(o){const l=[];for(;o;)l.push(String.fromCharCode(255&o)),o>>=8;return l.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,l){const u=this._identifier(o,[48,126]);this._escHandlers[u]===void 0&&(this._escHandlers[u]=[]);const S=this._escHandlers[u];return S.push(l),{dispose:()=>{const E=S.indexOf(l);E!==-1&&S.splice(E,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,l){this._executeHandlers[o.charCodeAt(0)]=l}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,l){const u=this._identifier(o);this._csiHandlers[u]===void 0&&(this._csiHandlers[u]=[]);const S=this._csiHandlers[u];return S.push(l),{dispose:()=>{const E=S.indexOf(l);E!==-1&&S.splice(E,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,l){return this._dcsParser.registerHandler(this._identifier(o),l)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,l){return this._oscParser.registerHandler(o,l)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}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(o,l,u,S,E){this._parseStack.state=o,this._parseStack.handlers=l,this._parseStack.handlerPos=u,this._parseStack.transition=S,this._parseStack.chunkPos=E}parse(o,l,u){let S,E=0,b=0,x=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,x=this._parseStack.chunkPos+1;else{if(u===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(u===!1&&R>-1){for(;R>=0&&(S=y[R](this._params),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 4:if(u===!1&&R>-1){for(;R>=0&&(S=y[R](),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 6:if(E=o[this._parseStack.chunkPos],S=this._dcsParser.unhook(E!==24&&E!==26,u),S)return S;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=o[this._parseStack.chunkPos],S=this._oscParser.end(E!==24&&E!==26,u),S)return S;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,x=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=x;y<l;++y){switch(E=o[y],b=this._transitions.table[this.currentState<<8|(E<160?E:w)],b>>4){case 2:for(let B=y+1;;++B){if(B>=l||(E=o[B])<32||E>126&&E<w){this._printHandler(o,y,B),y=B-1;break}if(++B>=l||(E=o[B])<32||E>126&&E<w){this._printHandler(o,y,B),y=B-1;break}if(++B>=l||(E=o[B])<32||E>126&&E<w){this._printHandler(o,y,B),y=B-1;break}if(++B>=l||(E=o[B])<32||E>126&&E<w){this._printHandler(o,y,B),y=B-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|E];let L=R?R.length-1:-1;for(;L>=0&&(S=R[L](this._params),S!==!0);L--)if(S instanceof Promise)return this._preserveStack(3,R,L,b,y),S;L<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++y<l&&(E=o[y])>47&&E<60);y--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const I=this._escHandlers[this._collect<<8|E];let M=I?I.length-1:-1;for(;M>=0&&(S=I[M](),S!==!0);M--)if(S instanceof Promise)return this._preserveStack(4,I,M,b,y),S;M<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let B=y+1;;++B)if(B>=l||(E=o[B])===24||E===26||E===27||E>127&&E<w){this._dcsParser.put(o,y,B),y=B-1;break}break;case 14:if(S=this._dcsParser.unhook(E!==24&&E!==26),S)return this._preserveStack(6,[],0,b,y),S;E===27&&(b|=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 B=y+1;;B++)if(B>=l||(E=o[B])<32||E>127&&E<w){this._oscParser.put(o,y,B),y=B-1;break}break;case 6:if(S=this._oscParser.end(E!==24&&E!==26),S)return this._preserveStack(5,[],0,b,y),S;E===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&b}}}s.EscapeSequenceParser=_},6242:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const h=c(5770),g=c(482),a=[];s.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const w=this._handlers[p];return w.push(m),{dispose:()=>{const _=w.indexOf(m);_!==-1&&w.splice(_,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,w){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(p,m,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,m,w))}start(){this.reset(),this._state=1}put(p,m,w){if(this._state!==3){if(this._state===1)for(;m<w;){const _=p[m++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&w-m>0&&this._put(p,m,w)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,_=this._active.length-1,n=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,w=m,n=this._stack.fallThrough,this._stack.paused=!1),!n&&w===!1){for(;_>=0&&(w=this._active[_].end(p),w!==!0);_--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,w;_--}for(;_>=0;_--)if(w=this._active[_].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",p);this._active=a,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,m,w),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,m}}},8742:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const c=2147483647;class h{static fromArray(a){const p=new h;if(!a.length)return p;for(let m=Array.isArray(a[0])?1:0;m<a.length;++m){const w=a[m];if(Array.isArray(w))for(let _=0;_<w.length;++_)p.addSubParam(w[_]);else p.addParam(w)}return p}constructor(a=32,p=32){if(this.maxLength=a,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(a),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const a=new h(this.maxLength,this.maxSubParamsLength);return a.params.set(this.params),a.length=this.length,a._subParams.set(this._subParams),a._subParamsLength=this._subParamsLength,a._subParamsIdx.set(this._subParamsIdx),a._rejectDigits=this._rejectDigits,a._rejectSubDigits=this._rejectSubDigits,a._digitIsSub=this._digitIsSub,a}toArray(){const a=[];for(let p=0;p<this.length;++p){a.push(this.params[p]);const m=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-m>0&&a.push(Array.prototype.slice.call(this._subParams,m,w))}return a}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(a){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=a>c?c:a}}addSubParam(a){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=a>c?c:a,this._subParamsIdx[this.length-1]++}}hasSubParams(a){return(255&this._subParamsIdx[a])-(this._subParamsIdx[a]>>8)>0}getSubParams(a){const p=this._subParamsIdx[a]>>8,m=255&this._subParamsIdx[a];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const a={};for(let p=0;p<this.length;++p){const m=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-m>0&&(a[p]=this._subParams.slice(m,w))}return a}addDigit(a){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,w=m[p-1];m[p-1]=~w?Math.min(10*w+a,c):a}}s.Params=h},5741:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const g={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(g),h.dispose=()=>this._wrappedAddonDispose(g),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){h=g;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const h=c(3785),g=c(511);s.BufferApiView=class{constructor(a,p){this._buffer=a,this.type=p}init(a){return this._buffer=a,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(a){const p=this._buffer.lines.get(a);if(p)return new h.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const h=c(511);s.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,a){if(!(g<0||g>=this._line.length))return a?(this._line.loadCell(g,a),a):this._line.loadCell(g,new h.CellData)}translateToString(g,a,p){return this._line.translateToString(g,a,p)}}},8285:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const h=c(8771),g=c(8460),a=c(844);class p extends a.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=p},7975:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(g=>h(g.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((g,a)=>h(g,a.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(z,s,c){var h=this&&this.__decorate||function(n,o,l,u){var S,E=arguments.length,b=E<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,u);else for(var x=n.length-1;x>=0;x--)(S=n[x])&&(b=(E<3?S(b):E>3?S(o,l,b):S(o,l))||b);return E>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,u){o(l,u,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const a=c(8460),p=c(844),m=c(5295),w=c(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let _=s.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(n,this))}resize(n,o){this.cols=n,this.rows=o,this.buffers.resize(n,o),this._onResize.fire({cols:n,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,o=!1){const l=this.buffer;let u;u=this._cachedBlankLine,u&&u.length===this.cols&&u.getFg(0)===n.fg&&u.getBg(0)===n.bg||(u=l.getBlankLine(n,o),this._cachedBlankLine=u),u.isWrapped=o;const S=l.ybase+l.scrollTop,E=l.ybase+l.scrollBottom;if(l.scrollTop===0){const b=l.lines.isFull;E===l.lines.length-1?b?l.lines.recycle().copyFrom(u):l.lines.push(u.clone()):l.lines.splice(E+1,0,u.clone()),b?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const b=E-S+1;l.lines.shiftElements(S+1,b-1,-1),l.lines.set(E,u.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(n,o,l){const u=this.buffer;if(n<0){if(u.ydisp===0)return;this.isUserScrolling=!0}else n+u.ydisp>=u.ybase&&(this.isUserScrolling=!1);const S=u.ydisp;u.ydisp=Math.max(Math.min(u.ydisp+n,u.ybase),0),S!==u.ydisp&&(o||this._onScroll.fire(u.ydisp))}};s.BufferService=_=h([g(0,w.IOptionsService)],_)},7994:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(z,s,c){var h=this&&this.__decorate||function(u,S,E,b){var x,y=arguments.length,R=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,E):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(u,S,E,b);else for(var L=u.length-1;L>=0;L--)(x=u[L])&&(R=(y<3?x(R):y>3?x(S,E,R):x(S,E))||R);return y>3&&R&&Object.defineProperty(S,E,R),R},g=this&&this.__param||function(u,S){return function(E,b){S(E,b,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const a=c(2585),p=c(8460),m=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:u=>u.button!==4&&u.action===1&&(u.ctrl=!1,u.alt=!1,u.shift=!1,!0)},VT200:{events:19,restrict:u=>u.action!==32},DRAG:{events:23,restrict:u=>u.action!==32||u.button!==3},ANY:{events:31,restrict:u=>!0}};function _(u,S){let E=(u.ctrl?16:0)|(u.shift?4:0)|(u.alt?8:0);return u.button===4?(E|=64,E|=u.action):(E|=3&u.button,4&u.button&&(E|=64),8&u.button&&(E|=128),u.action===32?E|=32:u.action!==0||S||(E|=3)),E}const n=String.fromCharCode,o={DEFAULT:u=>{const S=[_(u,!1)+32,u.col+32,u.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${n(S[0])}${n(S[1])}${n(S[2])}`},SGR:u=>{const S=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${_(u,!0)};${u.col};${u.row}${S}`},SGR_PIXELS:u=>{const S=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${_(u,!0)};${u.x};${u.y}${S}`}};let l=s.CoreMouseService=class extends m.Disposable{constructor(u,S){super(),this._bufferService=u,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(w))this.addProtocol(E,w[E]);for(const E of Object.keys(o))this.addEncoding(E,o[E]);this.reset()}addProtocol(u,S){this._protocols[u]=S}addEncoding(u,S){this._encodings[u]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(u){if(!this._protocols[u])throw new Error(`unknown protocol "${u}"`);this._activeProtocol=u,this._onProtocolChange.fire(this._protocols[u].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(u){if(!this._encodings[u])throw new Error(`unknown encoding "${u}"`);this._activeEncoding=u}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(u){if(u.col<0||u.col>=this._bufferService.cols||u.row<0||u.row>=this._bufferService.rows||u.button===4&&u.action===32||u.button===3&&u.action!==32||u.button!==4&&(u.action===2||u.action===3)||(u.col++,u.row++,u.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,u,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(u))return!1;const S=this._encodings[this._activeEncoding](u);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=u,!0}explainEvents(u){return{down:!!(1&u),up:!!(2&u),drag:!!(4&u),move:!!(8&u),wheel:!!(16&u)}}_equalEvents(u,S,E){if(E){if(u.x!==S.x||u.y!==S.y)return!1}else if(u.col!==S.col||u.row!==S.row)return!1;return u.button===S.button&&u.action===S.action&&u.ctrl===S.ctrl&&u.alt===S.alt&&u.shift===S.shift}};s.CoreMouseService=l=h([g(0,a.IBufferService),g(1,a.ICoreService)],l)},6975:function(z,s,c){var h=this&&this.__decorate||function(l,u,S,E){var b,x=arguments.length,y=x<3?u:E===null?E=Object.getOwnPropertyDescriptor(u,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(l,u,S,E);else for(var R=l.length-1;R>=0;R--)(b=l[R])&&(y=(x<3?b(y):x>3?b(u,S,y):b(u,S))||y);return x>3&&y&&Object.defineProperty(u,S,y),y},g=this&&this.__param||function(l,u){return function(S,E){u(S,E,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const a=c(1439),p=c(8460),m=c(844),w=c(2585),_=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=s.CoreService=class extends m.Disposable{constructor(l,u,S){super(),this._bufferService=l,this._logService=u,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(_),this.decPrivateModes=(0,a.clone)(n)}reset(){this.modes=(0,a.clone)(_),this.decPrivateModes=(0,a.clone)(n)}triggerDataEvent(l,u=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;u&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),u&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,(()=>l.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,(()=>l.split("").map((u=>u.charCodeAt(0))))),this._onBinary.fire(l))}};s.CoreService=o=h([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],o)},9074:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const h=c(8055),g=c(8460),a=c(844),p=c(6106);let m=0,w=0;class _ extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((l=>l==null?void 0:l.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(l){if(l.marker.isDisposed)return;const u=new n(l);if(u){const S=u.marker.onDispose((()=>u.dispose()));u.onDispose((()=>{u&&(this._decorations.delete(u)&&this._onDecorationRemoved.fire(u),S.dispose())})),this._decorations.insert(u),this._onDecorationRegistered.fire(u)}return u}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,u,S){let E=0,b=0;for(const x of this._decorations.getKeyIterator(u))E=x.options.x??0,b=E+(x.options.width??1),l>=E&&l<b&&(!S||(x.options.layer??"bottom")===S)&&(yield x)}forEachDecorationAtCell(l,u,S,E){this._decorations.forEachByKey(u,(b=>{m=b.options.x??0,w=m+(b.options.width??1),l>=m&&l<w&&(!S||(b.options.layer??"bottom")===S)&&E(b)}))}}s.DecorationService=_;class n extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const h=c(2585),g=c(8343);class a{constructor(...m){this._entries=new Map;for(const[w,_]of m)this.set(w,_)}set(m,w){const _=this._entries.get(m);return this._entries.set(m,w),_}forEach(m){for(const[w,_]of this._entries.entries())m(w,_)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}s.ServiceCollection=a,s.InstantiationService=class{constructor(){this._services=new a,this._services.set(h.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const w=(0,g.getServiceDependencies)(p).sort(((o,l)=>o.index-l.index)),_=[];for(const o of w){const l=this._services.get(o.id);if(!l)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${o.id}.`);_.push(l)}const n=w.length>0?w[0].index:m.length;if(m.length!==n)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${n+1} conflicts with ${m.length} static arguments`);return new p(...m,..._)}}},7866:function(z,s,c){var h=this&&this.__decorate||function(n,o,l,u){var S,E=arguments.length,b=E<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,u);else for(var x=n.length-1;x>=0;x--)(S=n[x])&&(b=(E<3?S(b):E>3?S(o,l,b):S(o,l))||b);return E>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,u){o(l,u,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const a=c(844),p=c(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,_=s.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let o=0;o<n.length;o++)typeof n[o]=="function"&&(n[o]=n[o]())}_log(n,o,l){this._evalLazyOptionalParams(l),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...l)}trace(n,...o){var l;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,n,o)}debug(n,...o){var l;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,n,o)}info(n,...o){var l;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,n,o)}warn(n,...o){var l;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,n,o)}error(n,...o){var l;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,n,o)}};s.LogService=_=h([g(0,p.IOptionsService)],_),s.setTraceLogger=function(n){w=n},s.traceCall=function(n,o,l){if(typeof l.value!="function")throw new Error("not supported");const u=l.value;l.value=function(...S){if(w.logLevel!==p.LogLevelEnum.TRACE)return u.apply(this,S);w.trace(`GlyphRenderer#${u.name}(${S.map((b=>JSON.stringify(b))).join(", ")})`);const E=u.apply(this,S);return w.trace(`GlyphRenderer#${u.name} return`,E),E}}},7302:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const h=c(8460),g=c(844),a=c(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:a.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends g.Disposable{constructor(_){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...s.DEFAULT_OPTIONS};for(const o in _)if(o in n)try{const l=_[o];n[o]=this._sanitizeAndValidateOption(o,l)}catch(l){console.error(l)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(_,n){return this.onOptionChange((o=>{o===_&&n(this.rawOptions[_])}))}onMultipleOptionChange(_,n){return this.onOptionChange((o=>{_.indexOf(o)!==-1&&n()}))}_setupOptions(){const _=o=>{if(!(o in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},n=(o,l)=>{if(!(o in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);l=this._sanitizeAndValidateOption(o,l),this.rawOptions[o]!==l&&(this.rawOptions[o]=l,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const l={get:_.bind(this,o),set:n.bind(this,o)};Object.defineProperty(this.options,o,l)}}_sanitizeAndValidateOption(_,n){switch(_){case"cursorStyle":if(n||(n=s.DEFAULT_OPTIONS[_]),!(function(o){return o==="block"||o==="underline"||o==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${_}`);break;case"wordSeparator":n||(n=s.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=p.includes(n)?n:s.DEFAULT_OPTIONS[_];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${_} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${_} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}s.OptionsService=m},2660:function(z,s,c){var h=this&&this.__decorate||function(m,w,_,n){var o,l=arguments.length,u=l<3?w:n===null?n=Object.getOwnPropertyDescriptor(w,_):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(m,w,_,n);else for(var S=m.length-1;S>=0;S--)(o=m[S])&&(u=(l<3?o(u):l>3?o(w,_,u):o(w,_))||u);return l>3&&u&&Object.defineProperty(w,_,u),u},g=this&&this.__param||function(m,w){return function(_,n){w(_,n,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const a=c(2585);let p=s.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const w=this._bufferService.buffer;if(m.id===void 0){const S=w.addMarker(w.ybase+w.y),E={data:m,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(E,S))),this._dataByLinkId.set(E.id,E),E.id}const _=m,n=this._getEntryIdKey(_),o=this._entriesWithId.get(n);if(o)return this.addLineToLink(o.id,w.ybase+w.y),o.id;const l=w.addMarker(w.ybase+w.y),u={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(u,l))),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(m,w){const _=this._dataByLinkId.get(m);if(_&&_.lines.every((n=>n.line!==w))){const n=this._bufferService.buffer.addMarker(w);_.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(_,n)))}}getLinkData(m){var w;return(w=this._dataByLinkId.get(m))==null?void 0:w.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,w){const _=m.lines.indexOf(w);_!==-1&&(m.lines.splice(_,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};s.OscLinkService=p=h([g(0,a.IBufferService)],p)},8343:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",h="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[h]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const a=function(p,m,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,n,o){n[c]===n?n[h].push({id:_,index:o}):(n[h]=[{id:_,index:o}],n[c]=n)})(a,p,w)};return a.toString=()=>g,s.serviceRegistry.set(g,a),a}},2585:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=c(8343);var g;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(g||(s.LogLevelEnum=g={})),s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=c(8460),g=c(225);class a{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,w,_=!1){return(16777215&m)<<3|(3&w)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const m=new g.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let w=0,_=0;const n=m.length;for(let o=0;o<n;++o){let l=m.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=n)return w+this.wcwidth(l);const E=m.charCodeAt(o);56320<=E&&E<=57343?l=1024*(l-55296)+E-56320+65536:w+=this.wcwidth(E)}const u=this.charProperties(l,_);let S=a.extractWidth(u);a.extractShouldJoin(u)&&(S-=a.extractWidth(_)),w+=S,_=u}return w}charProperties(m,w){return this._activeProvider.charProperties(m,w)}}s.UnicodeService=a}},A={};function H(z){var s=A[z];if(s!==void 0)return s.exports;var c=A[z]={exports:{}};return D[z].call(c.exports,c,c.exports,H),c.exports}var N={};return(()=>{var z=N;Object.defineProperty(z,"__esModule",{value:!0}),z.Terminal=void 0;const s=H(9042),c=H(3236),h=H(844),g=H(5741),a=H(8285),p=H(7975),m=H(7090),w=["cols","rows"];class _ extends h.Disposable{constructor(o){super(),this._core=this.register(new c.Terminal(o)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const l=S=>this._core.options[S],u=(S,E)=>{this._checkReadonlyOptions(S),this._core.options[S]=E};for(const S in this._core.options){const E={get:l.bind(this,S),set:u.bind(this,S)};Object.defineProperty(this._publicOptions,S,E)}}_checkReadonlyOptions(o){if(w.includes(o))throw new Error(`Option "${o}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const l in o)this._publicOptions[l]=o[l]}blur(){this._core.blur()}focus(){this._core.focus()}input(o,l=!0){this._core.input(o,l)}resize(o,l){this._verifyIntegers(o,l),this._core.resize(o,l)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}attachCustomWheelEventHandler(o){this._core.attachCustomWheelEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){return this._checkProposedApi(),this._verifyPositiveIntegers(o.x??0,o.width??0,o.height??0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,l,u){this._verifyIntegers(o,l,u),this._core.select(o,l,u)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,l){this._verifyIntegers(o,l),this._core.selectLines(o,l)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,l){this._core.write(o,l)}writeln(o,l){this._core.write(o),this._core.write(`\r
82
+ `,l)}paste(o){this._core.paste(o)}refresh(o,l){this._verifyIntegers(o,l),this._core.refresh(o,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return s}_verifyIntegers(...o){for(const l of o)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const l of o)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}z.Terminal=_})(),N})()))})(zc)),zc.exports}var Om=km(),Ic={exports:{}},M_;function Bm(){return M_||(M_=1,(function(f,C){(function(D,A){f.exports=A()})(self,(()=>(()=>{var D={};return(()=>{var A=D;Object.defineProperty(A,"__esModule",{value:!0}),A.FitAddon=void 0,A.FitAddon=class{activate(H){this._terminal=H}dispose(){}fit(){const H=this.proposeDimensions();if(!H||!this._terminal||isNaN(H.cols)||isNaN(H.rows))return;const N=this._terminal._core;this._terminal.rows===H.rows&&this._terminal.cols===H.cols||(N._renderService.clear(),this._terminal.resize(H.cols,H.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const H=this._terminal._core,N=H._renderService.dimensions;if(N.css.cell.width===0||N.css.cell.height===0)return;const z=this._terminal.options.scrollback===0?0:H.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(s.getPropertyValue("height")),h=Math.max(0,parseInt(s.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),a=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=h-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-z;return{cols:Math.max(2,Math.floor(p/N.css.cell.width)),rows:Math.max(1,Math.floor(a/N.css.cell.height))}}}})(),D})()))})(Ic)),Ic.exports}var Hm=Bm(),Nc={exports:{}},k_;function zm(){return k_||(k_=1,(function(f,C){(function(D,A){f.exports=A()})(self,(()=>(()=>{var D={965:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GlyphRenderer=void 0;const h=c(374),g=c(509),a=c(855),p=c(859),m=c(381),w=11,_=w*Float32Array.BYTES_PER_ELEMENT;let n,o=0,l=0,u=0;class S extends p.Disposable{constructor(b,x,y,R){super(),this._terminal=b,this._gl=x,this._dimensions=y,this._optionsService=R,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const L=this._gl;g.TextureAtlas.maxAtlasPages===void 0&&(g.TextureAtlas.maxAtlasPages=Math.min(32,(0,h.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_IMAGE_UNITS))),g.TextureAtlas.maxTextureSize=(0,h.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_SIZE))),this._program=(0,h.throwIfFalsy)((0,m.createProgram)(L,`#version 300 es
83
+ layout (location = 0) in vec2 a_unitquad;
84
+ layout (location = 1) in vec2 a_cellpos;
85
+ layout (location = 2) in vec2 a_offset;
86
+ layout (location = 3) in vec2 a_size;
87
+ layout (location = 4) in float a_texpage;
88
+ layout (location = 5) in vec2 a_texcoord;
89
+ layout (location = 6) in vec2 a_texsize;
90
+
91
+ uniform mat4 u_projection;
92
+ uniform vec2 u_resolution;
93
+
94
+ out vec2 v_texcoord;
95
+ flat out int v_texpage;
96
+
97
+ void main() {
98
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
99
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
100
+ v_texpage = int(a_texpage);
101
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
102
+ }`,(function(W){let $="";for(let Y=1;Y<W;Y++)$+=` else if (v_texpage == ${Y}) { outColor = texture(u_texture[${Y}], v_texcoord); }`;return`#version 300 es
103
+ precision lowp float;
104
+
105
+ in vec2 v_texcoord;
106
+ flat in int v_texpage;
107
+
108
+ uniform sampler2D u_texture[${W}];
109
+
110
+ out vec4 outColor;
111
+
112
+ void main() {
113
+ if (v_texpage == 0) {
114
+ outColor = texture(u_texture[0], v_texcoord);
115
+ } ${$}
116
+ }`})(g.TextureAtlas.maxAtlasPages))),this.register((0,p.toDisposable)((()=>L.deleteProgram(this._program)))),this._projectionLocation=(0,h.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,h.throwIfFalsy)(L.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,h.throwIfFalsy)(L.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=L.createVertexArray(),L.bindVertexArray(this._vertexArrayObject);const I=new Float32Array([0,0,1,0,0,1,1,1]),M=L.createBuffer();this.register((0,p.toDisposable)((()=>L.deleteBuffer(M)))),L.bindBuffer(L.ARRAY_BUFFER,M),L.bufferData(L.ARRAY_BUFFER,I,L.STATIC_DRAW),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const B=new Uint8Array([0,1,2,3]),G=L.createBuffer();this.register((0,p.toDisposable)((()=>L.deleteBuffer(G)))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,G),L.bufferData(L.ELEMENT_ARRAY_BUFFER,B,L.STATIC_DRAW),this._attributesBuffer=(0,h.throwIfFalsy)(L.createBuffer()),this.register((0,p.toDisposable)((()=>L.deleteBuffer(this._attributesBuffer)))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,2,L.FLOAT,!1,_,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,_,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,_,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,_,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,_,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,_,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const X=new Int32Array(g.TextureAtlas.maxAtlasPages);for(let W=0;W<g.TextureAtlas.maxAtlasPages;W++)X[W]=W;L.uniform1iv(this._textureLocation,X),L.uniformMatrix4fv(this._projectionLocation,!1,m.PROJECTION_MATRIX),this._atlasTextures=[];for(let W=0;W<g.TextureAtlas.maxAtlasPages;W++){const $=new m.GLTexture((0,h.throwIfFalsy)(L.createTexture()));this.register((0,p.toDisposable)((()=>L.deleteTexture($.texture)))),L.activeTexture(L.TEXTURE0+W),L.bindTexture(L.TEXTURE_2D,$.texture),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texImage2D(L.TEXTURE_2D,0,L.RGBA,1,1,0,L.RGBA,L.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[W]=$}L.enable(L.BLEND),L.blendFunc(L.SRC_ALPHA,L.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(b,x,y,R,L,I,M,B,G){this._updateCell(this._vertices.attributes,b,x,y,R,L,I,M,B,G)}_updateCell(b,x,y,R,L,I,M,B,G,X){o=(y*this._terminal.cols+x)*w,R!==a.NULL_CELL_CODE&&R!==void 0?this._atlas&&(n=B&&B.length>1?this._atlas.getRasterizedGlyphCombinedChar(B,L,I,M,!1):this._atlas.getRasterizedGlyph(R,L,I,M,!1),l=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),L!==X&&n.offset.x>l?(u=n.offset.x-l,b[o]=-(n.offset.x-u)+this._dimensions.device.char.left,b[o+1]=-n.offset.y+this._dimensions.device.char.top,b[o+2]=(n.size.x-u)/this._dimensions.device.canvas.width,b[o+3]=n.size.y/this._dimensions.device.canvas.height,b[o+4]=n.texturePage,b[o+5]=n.texturePositionClipSpace.x+u/this._atlas.pages[n.texturePage].canvas.width,b[o+6]=n.texturePositionClipSpace.y,b[o+7]=n.sizeClipSpace.x-u/this._atlas.pages[n.texturePage].canvas.width,b[o+8]=n.sizeClipSpace.y):(b[o]=-n.offset.x+this._dimensions.device.char.left,b[o+1]=-n.offset.y+this._dimensions.device.char.top,b[o+2]=n.size.x/this._dimensions.device.canvas.width,b[o+3]=n.size.y/this._dimensions.device.canvas.height,b[o+4]=n.texturePage,b[o+5]=n.texturePositionClipSpace.x,b[o+6]=n.texturePositionClipSpace.y,b[o+7]=n.sizeClipSpace.x,b[o+8]=n.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,h.allowRescaling)(R,G,n.size.x,this._dimensions.device.cell.width)&&(b[o+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):b.fill(0,o,o+w-1-2)}clear(){const b=this._terminal,x=b.cols*b.rows*w;this._vertices.count!==x?this._vertices.attributes=new Float32Array(x):this._vertices.attributes.fill(0);let y=0;for(;y<this._vertices.attributesBuffers.length;y++)this._vertices.count!==x?this._vertices.attributesBuffers[y]=new Float32Array(x):this._vertices.attributesBuffers[y].fill(0);this._vertices.count=x,y=0;for(let R=0;R<b.rows;R++)for(let L=0;L<b.cols;L++)this._vertices.attributes[y+9]=L/b.cols,this._vertices.attributes[y+10]=R/b.rows,y+=w}handleResize(){const b=this._gl;b.useProgram(this._program),b.viewport(0,0,b.canvas.width,b.canvas.height),b.uniform2f(this._resolutionLocation,b.canvas.width,b.canvas.height),this.clear()}render(b){if(!this._atlas)return;const x=this._gl;x.useProgram(this._program),x.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const y=this._vertices.attributesBuffers[this._activeBuffer];let R=0;for(let L=0;L<b.lineLengths.length;L++){const I=L*this._terminal.cols*w,M=this._vertices.attributes.subarray(I,I+b.lineLengths[L]*w);y.set(M,R),R+=M.length}x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.bufferData(x.ARRAY_BUFFER,y.subarray(0,R),x.STREAM_DRAW);for(let L=0;L<this._atlas.pages.length;L++)this._atlas.pages[L].version!==this._atlasTextures[L].version&&this._bindAtlasPageTexture(x,this._atlas,L);x.drawElementsInstanced(x.TRIANGLE_STRIP,4,x.UNSIGNED_BYTE,0,R/w)}setAtlas(b){this._atlas=b;for(const x of this._atlasTextures)x.version=-1}_bindAtlasPageTexture(b,x,y){b.activeTexture(b.TEXTURE0+y),b.bindTexture(b.TEXTURE_2D,this._atlasTextures[y].texture),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,x.pages[y].canvas),b.generateMipmap(b.TEXTURE_2D),this._atlasTextures[y].version=x.pages[y].version}setDimensions(b){this._dimensions=b}}s.GlyphRenderer=S},742:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RectangleRenderer=void 0;const h=c(374),g=c(859),a=c(310),p=c(381),m=8*Float32Array.BYTES_PER_ELEMENT;class w{constructor(){this.attributes=new Float32Array(160),this.count=0}}let _=0,n=0,o=0,l=0,u=0,S=0,E=0;class b extends g.Disposable{constructor(y,R,L,I){super(),this._terminal=y,this._gl=R,this._dimensions=L,this._themeService=I,this._vertices=new w,this._verticesCursor=new w;const M=this._gl;this._program=(0,h.throwIfFalsy)((0,p.createProgram)(M,`#version 300 es
117
+ layout (location = 0) in vec2 a_position;
118
+ layout (location = 1) in vec2 a_size;
119
+ layout (location = 2) in vec4 a_color;
120
+ layout (location = 3) in vec2 a_unitquad;
121
+
122
+ uniform mat4 u_projection;
123
+
124
+ out vec4 v_color;
125
+
126
+ void main() {
127
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
128
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
129
+ v_color = a_color;
130
+ }`,`#version 300 es
131
+ precision lowp float;
132
+
133
+ in vec4 v_color;
134
+
135
+ out vec4 outColor;
136
+
137
+ void main() {
138
+ outColor = v_color;
139
+ }`)),this.register((0,g.toDisposable)((()=>M.deleteProgram(this._program)))),this._projectionLocation=(0,h.throwIfFalsy)(M.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=M.createVertexArray(),M.bindVertexArray(this._vertexArrayObject);const B=new Float32Array([0,0,1,0,0,1,1,1]),G=M.createBuffer();this.register((0,g.toDisposable)((()=>M.deleteBuffer(G)))),M.bindBuffer(M.ARRAY_BUFFER,G),M.bufferData(M.ARRAY_BUFFER,B,M.STATIC_DRAW),M.enableVertexAttribArray(3),M.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const X=new Uint8Array([0,1,2,3]),W=M.createBuffer();this.register((0,g.toDisposable)((()=>M.deleteBuffer(W)))),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,W),M.bufferData(M.ELEMENT_ARRAY_BUFFER,X,M.STATIC_DRAW),this._attributesBuffer=(0,h.throwIfFalsy)(M.createBuffer()),this.register((0,g.toDisposable)((()=>M.deleteBuffer(this._attributesBuffer)))),M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.enableVertexAttribArray(0),M.vertexAttribPointer(0,2,M.FLOAT,!1,m,0),M.vertexAttribDivisor(0,1),M.enableVertexAttribArray(1),M.vertexAttribPointer(1,2,M.FLOAT,!1,m,2*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(1,1),M.enableVertexAttribArray(2),M.vertexAttribPointer(2,4,M.FLOAT,!1,m,4*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(2,1),this._updateCachedColors(I.colors),this.register(this._themeService.onChangeColors(($=>{this._updateCachedColors($),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(y){const R=this._gl;R.useProgram(this._program),R.bindVertexArray(this._vertexArrayObject),R.uniformMatrix4fv(this._projectionLocation,!1,p.PROJECTION_MATRIX),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.bufferData(R.ARRAY_BUFFER,y.attributes,R.DYNAMIC_DRAW),R.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,R.UNSIGNED_BYTE,0,y.count)}handleResize(){this._updateViewportRectangle()}setDimensions(y){this._dimensions=y}_updateCachedColors(y){this._bgFloat=this._colorToFloat32Array(y.background),this._cursorFloat=this._colorToFloat32Array(y.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(y){const R=this._terminal,L=this._vertices;let I,M,B,G,X,W,$,Y,k,F,O,U=1;for(I=0;I<R.rows;I++){for(B=-1,G=0,X=0,W=!1,M=0;M<R.cols;M++)$=(I*R.cols+M)*a.RENDER_MODEL_INDICIES_PER_CELL,Y=y.cells[$+a.RENDER_MODEL_BG_OFFSET],k=y.cells[$+a.RENDER_MODEL_FG_OFFSET],F=!!(67108864&k),(Y!==G||k!==X&&(W||F))&&((G!==0||W&&X!==0)&&(O=8*U++,this._updateRectangle(L,O,X,G,B,M,I)),B=M,G=Y,X=k,W=F);(G!==0||W&&X!==0)&&(O=8*U++,this._updateRectangle(L,O,X,G,B,R.cols,I))}L.count=U}updateCursor(y){const R=this._verticesCursor,L=y.cursor;if(!L||L.style==="block")return void(R.count=0);let I,M=0;L.style!=="bar"&&L.style!=="outline"||(I=8*M++,this._addRectangleFloat(R.attributes,I,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.style==="bar"?L.dpr*L.cursorWidth:L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.style!=="underline"&&L.style!=="outline"||(I=8*M++,this._addRectangleFloat(R.attributes,I,L.x*this._dimensions.device.cell.width,(L.y+1)*this._dimensions.device.cell.height-L.dpr,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat)),L.style==="outline"&&(I=8*M++,this._addRectangleFloat(R.attributes,I,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat),I=8*M++,this._addRectangleFloat(R.attributes,I,(L.x+L.width)*this._dimensions.device.cell.width-L.dpr,L.y*this._dimensions.device.cell.height,L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),R.count=M}_updateRectangle(y,R,L,I,M,B,G){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:_=(16777215&L)<<8;break;default:_=this._themeService.colors.foreground.rgba}else switch(50331648&I){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:_=(16777215&I)<<8;break;default:_=this._themeService.colors.background.rgba}y.attributes.length<R+4&&(y.attributes=(0,p.expandFloat32Array)(y.attributes,this._terminal.rows*this._terminal.cols*8)),n=M*this._dimensions.device.cell.width,o=G*this._dimensions.device.cell.height,l=(_>>24&255)/255,u=(_>>16&255)/255,S=(_>>8&255)/255,E=1,this._addRectangle(y.attributes,R,n,o,(B-M)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,l,u,S,E)}_addRectangle(y,R,L,I,M,B,G,X,W,$){y[R]=L/this._dimensions.device.canvas.width,y[R+1]=I/this._dimensions.device.canvas.height,y[R+2]=M/this._dimensions.device.canvas.width,y[R+3]=B/this._dimensions.device.canvas.height,y[R+4]=G,y[R+5]=X,y[R+6]=W,y[R+7]=$}_addRectangleFloat(y,R,L,I,M,B,G){y[R]=L/this._dimensions.device.canvas.width,y[R+1]=I/this._dimensions.device.canvas.height,y[R+2]=M/this._dimensions.device.canvas.width,y[R+3]=B/this._dimensions.device.canvas.height,y[R+4]=G[0],y[R+5]=G[1],y[R+6]=G[2],y[R+7]=G[3]}_colorToFloat32Array(y){return new Float32Array([(y.rgba>>24&255)/255,(y.rgba>>16&255)/255,(y.rgba>>8&255)/255,(255&y.rgba)/255])}}s.RectangleRenderer=b},310:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const h=c(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,h.createSelectionRenderModel)()}resize(g,a){const p=g*a*s.RENDER_MODEL_INDICIES_PER_CELL;p!==this.cells.length&&(this.cells=new Uint32Array(p),this.lineLengths=new Uint32Array(a))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const h=c(820),g=c(274),a=c(627),p=c(457),m=c(56),w=c(374),_=c(345),n=c(859),o=c(147),l=c(782),u=c(855),S=c(965),E=c(742),b=c(310),x=c(733);class y extends n.Disposable{constructor(M,B,G,X,W,$,Y,k,F){super(),this._terminal=M,this._characterJoinerService=B,this._charSizeService=G,this._coreBrowserService=X,this._coreService=W,this._decorationService=$,this._optionsService=Y,this._themeService=k,this._cursorBlinkStateManager=new n.MutableDisposable,this._charAtlasDisposable=this.register(new n.MutableDisposable),this._observerDisposable=this.register(new n.MutableDisposable),this._model=new b.RenderModel,this._workCell=new l.CellData,this._workCell2=new l.CellData,this._rectangleRenderer=this.register(new n.MutableDisposable),this._glyphRenderer=this.register(new n.MutableDisposable),this._onChangeTextureAtlas=this.register(new _.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new _.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new _.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new _.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new g.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new x.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,Y,this._themeService)],this.dimensions=(0,w.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(Y.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const O={antialias:!1,depth:!1,preserveDrawingBuffer:F};if(this._gl=this._canvas.getContext("webgl2",O),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextlost",(U=>{console.log("webglcontextlost event received"),U.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(U)}),3e3)}))),this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextrestored",(U=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,a.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,m.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((U,Q)=>this._setCanvasDevicePixelDimensions(U,Q))),this.register(this._coreBrowserService.onWindowChange((U=>{this._observerDisposable.value=(0,m.observeDevicePixelDimensions)(this._canvas,U,((Q,ee)=>this._setCanvasDevicePixelDimensions(Q,ee)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,n.toDisposable)((()=>{var U;for(const Q of this._renderLayers)Q.dispose();(U=this._canvas.parentElement)==null||U.removeChild(this._canvas),(0,a.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var M;return(M=this._charAtlas)==null?void 0:M.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(M,B){var G,X,W,$;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const Y of this._renderLayers)Y.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(G=this._rectangleRenderer.value)==null||G.setDimensions(this.dimensions),(X=this._rectangleRenderer.value)==null||X.handleResize(),(W=this._glyphRenderer.value)==null||W.setDimensions(this.dimensions),($=this._glyphRenderer.value)==null||$.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var M;for(const B of this._renderLayers)B.handleBlur(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.pause(),this._requestRedrawViewport()}handleFocus(){var M;for(const B of this._renderLayers)B.handleFocus(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.resume(),this._requestRedrawViewport()}handleSelectionChanged(M,B,G){for(const X of this._renderLayers)X.handleSelectionChanged(this._terminal,M,B,G);this._model.selection.update(this._core,M,B,G),this._requestRedrawViewport()}handleCursorMove(){var M;for(const B of this._renderLayers)B.handleCursorMove(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new E.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new S.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var B;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const M=(0,a.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==M&&(this._onChangeTextureAtlas.fire(M.pages[0].canvas),this._charAtlasDisposable.value=(0,n.getDisposeArrayDisposable)([(0,_.forwardEvent)(M.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,_.forwardEvent)(M.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=M,this._charAtlas.warmUp(),(B=this._glyphRenderer.value)==null||B.setAtlas(this._charAtlas)}_clearModel(M){var B;this._model.clear(),M&&((B=this._glyphRenderer.value)==null||B.clear())}clearTextureAtlas(){var M;(M=this._charAtlas)==null||M.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var M;this._clearModel(!0);for(const B of this._renderLayers)B.reset(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(M){return-1}deregisterCharacterJoiner(M){return!1}renderRows(M,B){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const G of this._renderLayers)G.handleGridChanged(this._terminal,M,B);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(M,B),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new p.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(M,B){const G=this._core;let X,W,$,Y,k,F,O,U,Q,ee,he,ce,K,P,ne=this._workCell;M=L(M,G.rows-1,0),B=L(B,G.rows-1,0);const ie=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,_e=ie-G.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,G.cols-1);let ye=-1;const ve=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Te=!1;for(W=M;W<=B;W++)for($=W+G.buffer.ydisp,Y=G.buffer.lines.get($),this._model.lineLengths[W]=0,k=this._characterJoinerService.getJoinedCharacters($),K=0;K<G.cols;K++)if(X=this._cellColorResolver.result.bg,Y.loadCell(K,ne),K===0&&(X=this._cellColorResolver.result.bg),F=!1,O=K,k.length>0&&K===k[0][0]&&(F=!0,U=k.shift(),ne=new R(ne,Y.translateToString(!0,U[0],U[1]),U[1]-U[0]),O=U[1]-1),Q=ne.getChars(),ee=ne.getCode(),ce=(W*G.cols+K)*b.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ne,K,$,this.dimensions.device.cell.width),ve&&$===ie&&(K===fe&&(this._model.cursor={x:fe,y:_e,width:ne.getWidth(),style:this._coreBrowserService.isFocused?G.options.cursorStyle||"block":G.options.cursorInactiveStyle,cursorWidth:G.options.cursorWidth,dpr:this._devicePixelRatio},ye=fe+ne.getWidth()-1),K>=fe&&K<=ye&&(this._coreBrowserService.isFocused&&(G.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&G.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),ee!==u.NULL_CELL_CODE&&(this._model.lineLengths[W]=K+1),(this._model.cells[ce]!==ee||this._model.cells[ce+b.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[ce+b.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[ce+b.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Te=!0,Q.length>1&&(ee|=b.COMBINED_CHAR_BIT_MASK),this._model.cells[ce]=ee,this._model.cells[ce+b.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[ce+b.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[ce+b.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,he=ne.getWidth(),this._glyphRenderer.value.updateCell(K,W,ee,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Q,he,X),F))for(ne=this._workCell,K++;K<O;K++)P=(W*G.cols+K)*b.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(K,W,u.NULL_CELL_CODE,0,0,0,u.NULL_CELL_CHAR,0,0),this._model.cells[P]=u.NULL_CELL_CODE,this._model.cells[P+b.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[P+b.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[P+b.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Te&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(M,B){this._canvas.width===M&&this._canvas.height===B||(this._canvas.width=M,this._canvas.height=B,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const M=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:M,end:M})}}s.WebglRenderer=y;class R extends o.AttributeData{constructor(M,B,G){super(),this.content=0,this.combinedData="",this.fg=M.fg,this.bg=M.bg,this.combinedData=B,this._width=G}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(M){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function L(I,M,B=0){return Math.max(Math.min(I,M),B)}s.JoinedCellData=R},381:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const h=c(374);function g(a,p,m){const w=(0,h.throwIfFalsy)(a.createShader(p));if(a.shaderSource(w,m),a.compileShader(w),a.getShaderParameter(w,a.COMPILE_STATUS))return w;console.error(a.getShaderInfoLog(w)),a.deleteShader(w)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(a,p,m){const w=(0,h.throwIfFalsy)(a.createProgram());if(a.attachShader(w,(0,h.throwIfFalsy)(g(a,a.VERTEX_SHADER,p))),a.attachShader(w,(0,h.throwIfFalsy)(g(a,a.FRAGMENT_SHADER,m))),a.linkProgram(w),a.getProgramParameter(w,a.LINK_STATUS))return w;console.error(a.getProgramInfoLog(w)),a.deleteProgram(w)},s.createShader=g,s.expandFloat32Array=function(a,p){const m=Math.min(2*a.length,p),w=new Float32Array(m);for(let _=0;_<a.length;_++)w[_]=a[_];return w},s.GLTexture=class{constructor(a){this.texture=a,this.version=-1}}},592:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const h=c(627),g=c(237),a=c(374),p=c(859);class m extends p.Disposable{constructor(_,n,o,l,u,S,E,b){super(),this._container=n,this._alpha=u,this._coreBrowserService=S,this._optionsService=E,this._themeService=b,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${o}-layer`),this._canvas.style.zIndex=l.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((x=>{this._refreshCharAtlas(_,x),this.reset(_)}))),this.register((0,p.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,a.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(_){}handleFocus(_){}handleCursorMove(_){}handleGridChanged(_,n,o){}handleSelectionChanged(_,n,o,l=!1){}_setTransparency(_,n){if(n===this._alpha)return;const o=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,o),this._refreshCharAtlas(_,this._themeService.colors),this.handleGridChanged(_,0,_.rows-1)}_refreshCharAtlas(_,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,h.acquireTextureAtlas)(_,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(_,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(_,this._themeService.colors)}_fillBottomLineAtCells(_,n,o=1){this._ctx.fillRect(_*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,o*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(_,n,o,l){this._alpha?this._ctx.clearRect(_*this._deviceCellWidth,n*this._deviceCellHeight,o*this._deviceCellWidth,l*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(_*this._deviceCellWidth,n*this._deviceCellHeight,o*this._deviceCellWidth,l*this._deviceCellHeight))}_fillCharTrueColor(_,n,o,l){this._ctx.font=this._getFont(_,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(o,l,n.getWidth()),this._ctx.fillText(n.getChars(),o*this._deviceCellWidth+this._deviceCharLeft,l*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(_,n,o){this._ctx.beginPath(),this._ctx.rect(_*this._deviceCellWidth,n*this._deviceCellHeight,o*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(_,n,o){return`${o?"italic":""} ${n?_.options.fontWeightBold:_.options.fontWeight} ${_.options.fontSize*this._coreBrowserService.dpr}px ${_.options.fontFamily}`}}s.BaseRenderLayer=m},733:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const h=c(197),g=c(237),a=c(592);class p extends a.BaseRenderLayer{constructor(w,_,n,o,l,u,S){super(n,w,"link",_,!0,l,u,S),this.register(o.onShowLinkUnderline((E=>this._handleShowLinkUnderline(E)))),this.register(o.onHideLinkUnderline((E=>this._handleHideLinkUnderline(E))))}resize(w,_){super.resize(w,_),this._state=void 0}reset(w){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const w=this._state.y2-this._state.y1-1;w>0&&this._clearCells(0,this._state.y1+1,this._state.cols,w),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(w){if(w.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:w.fg!==void 0&&(0,h.is256Color)(w.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[w.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,w.y1===w.y2)this._fillBottomLineAtCells(w.x1,w.y1,w.x2-w.x1);else{this._fillBottomLineAtCells(w.x1,w.y1,w.cols-w.x1);for(let _=w.y1+1;_<w.y2;_++)this._fillBottomLineAtCells(0,_,w.cols);this._fillBottomLineAtCells(0,w.y2,w.x2)}this._state=w}_handleHideLinkUnderline(w){this._clearCurrentLink()}}s.LinkRenderLayer=p},820:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(c,h,g,a){c.addEventListener(h,g,a);let p=!1;return{dispose:()=>{p||(p=!0,c.removeEventListener(h,g,a))}}}},274:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const h=c(855),g=c(160),a=c(374);let p,m=0,w=0,_=!1,n=!1,o=!1,l=0;s.CellColorResolver=class{constructor(u,S,E,b,x,y){this._terminal=u,this._optionService=S,this._selectionRenderModel=E,this._decorationService=b,this._coreBrowserService=x,this._themeService=y,this.result={fg:0,bg:0,ext:0}}resolve(u,S,E,b){if(this.result.bg=u.bg,this.result.fg=u.fg,this.result.ext=268435456&u.bg?u.extended.ext:0,w=0,m=0,n=!1,_=!1,o=!1,p=this._themeService.colors,l=0,u.getCode()!==h.NULL_CELL_CODE&&u.extended.underlineStyle===4){const x=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));l=S*b%(2*Math.round(x))}if(this._decorationService.forEachDecorationAtCell(S,E,"bottom",(x=>{x.backgroundColorRGB&&(w=x.backgroundColorRGB.rgba>>8&16777215,n=!0),x.foregroundColorRGB&&(m=x.foregroundColorRGB.rgba>>8&16777215,_=!0)})),o=this._selectionRenderModel.isCellSelected(this._terminal,S,E),o){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}w=g.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else w=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(n=!0,p.selectionForeground&&(m=p.selectionForeground.rgba>>8&16777215,_=!0),(0,a.treatGlyphAsBackgroundColor)(u.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)m=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:m=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:m=(16777215&this.result.fg)<<8|255;break;default:m=this._themeService.colors.foreground.rgba}m=g.rgba.blend(m,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}_=!0}}this._decorationService.forEachDecorationAtCell(S,E,"top",(x=>{x.backgroundColorRGB&&(w=x.backgroundColorRGB.rgba>>8&16777215,n=!0),x.foregroundColorRGB&&(m=x.foregroundColorRGB.rgba>>8&16777215,_=!0)})),n&&(w=o?-16777216&u.bg&-134217729|w|50331648:-16777216&u.bg|w|50331648),_&&(m=-16777216&u.fg&-67108865|m|50331648),67108864&this.result.fg&&(n&&!_&&(m=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,_=!0),!n&&_&&(w=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,n=!0)),p=void 0,this.result.bg=n?w:this.result.bg,this.result.fg=_?m:this.result.fg,this.result.ext&=536870911,this.result.ext|=l<<29&3758096384}}},627:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const h=c(509),g=c(197),a=[];s.acquireTextureAtlas=function(p,m,w,_,n,o,l,u){const S=(0,g.generateConfig)(_,n,o,l,m,w,u);for(let x=0;x<a.length;x++){const y=a[x],R=y.ownedBy.indexOf(p);if(R>=0){if((0,g.configEquals)(y.config,S))return y.atlas;y.ownedBy.length===1?(y.atlas.dispose(),a.splice(x,1)):y.ownedBy.splice(R,1);break}}for(let x=0;x<a.length;x++){const y=a[x];if((0,g.configEquals)(y.config,S))return y.ownedBy.push(p),y.atlas}const E=p._core,b={atlas:new h.TextureAtlas(document,S,E.unicodeService),config:S,ownedBy:[p]};return a.push(b),b.atlas},s.removeTerminalFromCache=function(p){for(let m=0;m<a.length;m++){const w=a[m].ownedBy.indexOf(p);if(w!==-1){a[m].ownedBy.length===1?(a[m].atlas.dispose(),a.splice(m,1)):a[m].ownedBy.splice(w,1);break}}}},197:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const h=c(160);s.generateConfig=function(g,a,p,m,w,_,n){const o={foreground:_.foreground,background:_.background,cursor:h.NULL_COLOR,cursorAccent:h.NULL_COLOR,selectionForeground:h.NULL_COLOR,selectionBackgroundTransparent:h.NULL_COLOR,selectionBackgroundOpaque:h.NULL_COLOR,selectionInactiveBackgroundTransparent:h.NULL_COLOR,selectionInactiveBackgroundOpaque:h.NULL_COLOR,ansi:_.ansi.slice(),contrastCache:_.contrastCache,halfContrastCache:_.halfContrastCache};return{customGlyphs:w.customGlyphs,devicePixelRatio:n,letterSpacing:w.letterSpacing,lineHeight:w.lineHeight,deviceCellWidth:g,deviceCellHeight:a,deviceCharWidth:p,deviceCharHeight:m,fontFamily:w.fontFamily,fontSize:w.fontSize,fontWeight:w.fontWeight,fontWeightBold:w.fontWeightBold,allowTransparency:w.allowTransparency,drawBoldTextInBrightColors:w.drawBoldTextInBrightColors,minimumContrastRatio:w.minimumContrastRatio,colors:o}},s.configEquals=function(g,a){for(let p=0;p<g.colors.ansi.length;p++)if(g.colors.ansi[p].rgba!==a.colors.ansi[p].rgba)return!1;return g.devicePixelRatio===a.devicePixelRatio&&g.customGlyphs===a.customGlyphs&&g.lineHeight===a.lineHeight&&g.letterSpacing===a.letterSpacing&&g.fontFamily===a.fontFamily&&g.fontSize===a.fontSize&&g.fontWeight===a.fontWeight&&g.fontWeightBold===a.fontWeightBold&&g.allowTransparency===a.allowTransparency&&g.deviceCharWidth===a.deviceCharWidth&&g.deviceCharHeight===a.deviceCharHeight&&g.drawBoldTextInBrightColors===a.drawBoldTextInBrightColors&&g.minimumContrastRatio===a.minimumContrastRatio&&g.colors.foreground.rgba===a.colors.foreground.rgba&&g.colors.background.rgba===a.colors.background.rgba},s.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const h=c(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},457:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(c=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const h=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,h>0)return void this._restartInterval(h)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const h=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(h)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),c)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const h=c(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const g={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(_,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(_,n)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╒":{1:(_,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(_,n)=>`M${.5-_},1 L${.5-_},.5 L1,.5 M${.5+_},.5 L${.5+_},1`},"╔":{1:(_,n)=>`M1,${.5-n} L${.5-_},${.5-n} L${.5-_},1 M1,${.5+n} L${.5+_},${.5+n} L${.5+_},1`},"╕":{1:(_,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(_,n)=>`M${.5+_},1 L${.5+_},.5 L0,.5 M${.5-_},.5 L${.5-_},1`},"╗":{1:(_,n)=>`M0,${.5+n} L${.5-_},${.5+n} L${.5-_},1 M0,${.5-n} L${.5+_},${.5-n} L${.5+_},1`},"╘":{1:(_,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(_,n)=>`M1,.5 L${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╚":{1:(_,n)=>`M1,${.5-n} L${.5+_},${.5-n} L${.5+_},0 M1,${.5+n} L${.5-_},${.5+n} L${.5-_},0`},"╛":{1:(_,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(_,n)=>`M0,.5 L${.5+_},.5 L${.5+_},0 M${.5-_},.5 L${.5-_},0`},"╝":{1:(_,n)=>`M0,${.5-n} L${.5-_},${.5-n} L${.5-_},0 M0,${.5+n} L${.5+_},${.5+n} L${.5+_},0`},"╞":{1:(_,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(_,n)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1 M${.5+_},.5 L1,.5`},"╠":{1:(_,n)=>`M${.5-_},0 L${.5-_},1 M1,${.5+n} L${.5+_},${.5+n} L${.5+_},1 M1,${.5-n} L${.5+_},${.5-n} L${.5+_},0`},"╡":{1:(_,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(_,n)=>`M0,.5 L${.5-_},.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╣":{1:(_,n)=>`M${.5+_},0 L${.5+_},1 M0,${.5+n} L${.5-_},${.5+n} L${.5-_},1 M0,${.5-n} L${.5-_},${.5-n} L${.5-_},0`},"╤":{1:(_,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(_,n)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},1 M${.5+_},.5 L${.5+_},1`},"╦":{1:(_,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-_},${.5+n} L${.5-_},1 M1,${.5+n} L${.5+_},${.5+n} L${.5+_},1`},"╧":{1:(_,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(_,n)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╩":{1:(_,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-_},${.5-n} L${.5-_},0 M1,${.5-n} L${.5+_},${.5-n} L${.5+_},0`},"╪":{1:(_,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(_,n)=>`M0,.5 L1,.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╬":{1:(_,n)=>`M0,${.5+n} L${.5-_},${.5+n} L${.5-_},1 M1,${.5+n} L${.5+_},${.5+n} L${.5+_},1 M0,${.5-n} L${.5-_},${.5-n} L${.5-_},0 M1,${.5-n} L${.5+_},${.5-n} L${.5+_},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(_,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(_,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(_,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(_,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(_,n,o,l,u,S,E,b){const x=s.blockElementDefinitions[n];if(x)return(function(I,M,B,G,X,W){for(let $=0;$<M.length;$++){const Y=M[$],k=X/8,F=W/8;I.fillRect(B+Y.x*k,G+Y.y*F,Y.w*k,Y.h*F)}})(_,x,o,l,u,S),!0;const y=g[n];if(y)return(function(I,M,B,G,X,W){let $=a.get(M);$||($=new Map,a.set(M,$));const Y=I.fillStyle;if(typeof Y!="string")throw new Error(`Unexpected fillStyle type "${Y}"`);let k=$.get(Y);if(!k){const F=M[0].length,O=M.length,U=I.canvas.ownerDocument.createElement("canvas");U.width=F,U.height=O;const Q=(0,h.throwIfFalsy)(U.getContext("2d")),ee=new ImageData(F,O);let he,ce,K,P;if(Y.startsWith("#"))he=parseInt(Y.slice(1,3),16),ce=parseInt(Y.slice(3,5),16),K=parseInt(Y.slice(5,7),16),P=Y.length>7&&parseInt(Y.slice(7,9),16)||1;else{if(!Y.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${Y}" when drawing pattern glyph`);[he,ce,K,P]=Y.substring(5,Y.length-1).split(",").map((ne=>parseFloat(ne)))}for(let ne=0;ne<O;ne++)for(let ie=0;ie<F;ie++)ee.data[4*(ne*F+ie)]=he,ee.data[4*(ne*F+ie)+1]=ce,ee.data[4*(ne*F+ie)+2]=K,ee.data[4*(ne*F+ie)+3]=M[ne][ie]*(255*P);Q.putImageData(ee,0,0),k=(0,h.throwIfFalsy)(I.createPattern(U,null)),$.set(Y,k)}I.fillStyle=k,I.fillRect(B,G,X,W)})(_,y,o,l,u,S),!0;const R=s.boxDrawingDefinitions[n];if(R)return(function(I,M,B,G,X,W,$){I.strokeStyle=I.fillStyle;for(const[Y,k]of Object.entries(M)){let F;I.beginPath(),I.lineWidth=$*Number.parseInt(Y),F=typeof k=="function"?k(.15,.15/W*X):k;for(const O of F.split(" ")){const U=O[0],Q=m[U];if(!Q){console.error(`Could not find drawing instructions for "${U}"`);continue}const ee=O.substring(1).split(",");ee[0]&&ee[1]&&Q(I,w(ee,X,W,B,G,!0,$))}I.stroke(),I.closePath()}})(_,R,o,l,u,S,b),!0;const L=s.powerlineDefinitions[n];return!!L&&((function(I,M,B,G,X,W,$,Y){const k=new Path2D;k.rect(B,G,X,W),I.clip(k),I.beginPath();const F=$/12;I.lineWidth=Y*F;for(const O of M.d.split(" ")){const U=O[0],Q=m[U];if(!Q){console.error(`Could not find drawing instructions for "${U}"`);continue}const ee=O.substring(1).split(",");ee[0]&&ee[1]&&Q(I,w(ee,X,W,B,G,!1,Y,(M.leftPadding??0)*(F/2),(M.rightPadding??0)*(F/2)))}M.type===1?(I.strokeStyle=I.fillStyle,I.stroke()):I.fill(),I.closePath()})(_,L,o,l,u,S,E,b),!0)};const a=new Map;function p(_,n,o=0){return Math.max(Math.min(_,n),o)}const m={C:(_,n)=>_.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(_,n)=>_.lineTo(n[0],n[1]),M:(_,n)=>_.moveTo(n[0],n[1])};function w(_,n,o,l,u,S,E,b=0,x=0){const y=_.map((R=>parseFloat(R)||parseInt(R)));if(y.length<2)throw new Error("Too few arguments for instruction");for(let R=0;R<y.length;R+=2)y[R]*=n-b*E-x*E,S&&y[R]!==0&&(y[R]=p(Math.round(y[R]+.5)-.5,n,0)),y[R]+=l+b*E;for(let R=1;R<y.length;R+=2)y[R]*=o,S&&y[R]!==0&&(y[R]=p(Math.round(y[R]+.5)-.5,o,0)),y[R]+=u;return y}},56:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const h=c(859);s.observeDevicePixelDimensions=function(g,a,p){let m=new a.ResizeObserver((w=>{const _=w.find((l=>l.target===g));if(!_)return;if(!("devicePixelContentBoxSize"in _))return m==null||m.disconnect(),void(m=void 0);const n=_.devicePixelContentBoxSize[0].inlineSize,o=_.devicePixelContentBoxSize[0].blockSize;n>0&&o>0&&p(n,o)}));try{m.observe(g,{box:["device-pixel-content-box"]})}catch{m.disconnect(),m=void 0}return(0,h.toDisposable)((()=>m==null?void 0:m.disconnect()))}},374:(z,s)=>{function c(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},s.isPowerlineGlyph=c,s.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},s.isEmoji=h,s.allowRescaling=function(g,a,p,m){return a===1&&p>Math.ceil(1.5*m)&&g!==void 0&&g>255&&!h(g)&&!c(g)&&!(function(w){return 57344<=w&&w<=63743})(g)},s.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(a){return 9472<=a&&a<=9631})(g)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(g,a,p=0){return(g-(2*Math.round(a)-p))%(2*Math.round(a))}},296:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,a,p,m=!1){if(this.selectionStart=a,this.selectionEnd=p,!a||!p||a[0]===p[0]&&a[1]===p[1])return void this.clear();const w=g.buffers.active.ydisp,_=a[1]-w,n=p[1]-w,o=Math.max(_,0),l=Math.min(n,g.rows-1);o>=g.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=_,this.viewportEndRow=n,this.viewportCappedStartRow=o,this.viewportCappedEndRow=l,this.startCol=a[0],this.endCol=p[0])}isCellSelected(g,a,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&p>=this.viewportCappedStartRow&&a<this.endCol&&p<=this.viewportCappedEndRow:a<this.startCol&&p>=this.viewportCappedStartRow&&a>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&a>=this.startCol)}}s.createSelectionRenderModel=function(){return new c}},509:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const h=c(237),g=c(860),a=c(374),p=c(160),m=c(345),w=c(485),_=c(385),n=c(147),o=c(855),l={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let u;class S{get pages(){return this._pages}constructor(R,L,I){this._document=R,this._config=L,this._unicodeService=I,this._didWarmUp=!1,this._cacheMap=new w.FourKeyMap,this._cacheMapCombined=new w.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new n.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new m.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new m.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=x(R,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const R of this.pages)R.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const R=new _.IdleTaskQueue;for(let L=33;L<126;L++)R.enqueue((()=>{if(!this._cacheMap.get(L,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT)){const I=this._drawToCache(L,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT);this._cacheMap.set(L,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT,I)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const R of this._pages)R.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const L=this._pages.filter(($=>2*$.canvas.width<=(S.maxTextureSize||4096))).sort((($,Y)=>Y.canvas.width!==$.canvas.width?Y.canvas.width-$.canvas.width:Y.percentageUsed-$.percentageUsed));let I=-1,M=0;for(let $=0;$<L.length;$++)if(L[$].canvas.width!==M)I=$,M=L[$].canvas.width;else if($-I==3)break;const B=L.slice(I,I+4),G=B.map(($=>$.glyphs[0].texturePage)).sort((($,Y)=>$>Y?1:-1)),X=this.pages.length-B.length,W=this._mergePages(B,X);W.version++;for(let $=G.length-1;$>=0;$--)this._deletePage(G[$]);this.pages.push(W),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(W.canvas)}const R=new E(this._document,this._textureSize);return this._pages.push(R),this._activePages.push(R),this._onAddTextureAtlasCanvas.fire(R.canvas),R}_mergePages(R,L){const I=2*R[0].canvas.width,M=new E(this._document,I,R);for(const[B,G]of R.entries()){const X=B*G.canvas.width%I,W=Math.floor(B/2)*G.canvas.height;M.ctx.drawImage(G.canvas,X,W);for(const Y of G.glyphs)Y.texturePage=L,Y.sizeClipSpace.x=Y.size.x/I,Y.sizeClipSpace.y=Y.size.y/I,Y.texturePosition.x+=X,Y.texturePosition.y+=W,Y.texturePositionClipSpace.x=Y.texturePosition.x/I,Y.texturePositionClipSpace.y=Y.texturePosition.y/I;this._onRemoveTextureAtlasCanvas.fire(G.canvas);const $=this._activePages.indexOf(G);$!==-1&&this._activePages.splice($,1)}return M}_deletePage(R){this._pages.splice(R,1);for(let L=R;L<this._pages.length;L++){const I=this._pages[L];for(const M of I.glyphs)M.texturePage--;I.version++}}getRasterizedGlyphCombinedChar(R,L,I,M,B){return this._getFromCacheMap(this._cacheMapCombined,R,L,I,M,B)}getRasterizedGlyph(R,L,I,M,B){return this._getFromCacheMap(this._cacheMap,R,L,I,M,B)}_getFromCacheMap(R,L,I,M,B,G=!1){return u=R.get(L,I,M,B),u||(u=this._drawToCache(L,I,M,B,G),R.set(L,I,M,B,u)),u}_getColorFromAnsiIndex(R){if(R>=this._config.colors.ansi.length)throw new Error("No color found for idx "+R);return this._config.colors.ansi[R]}_getBackgroundColor(R,L,I,M){if(this._config.allowTransparency)return p.NULL_COLOR;let B;switch(R){case 16777216:case 33554432:B=this._getColorFromAnsiIndex(L);break;case 50331648:const G=n.AttributeData.toColorRGB(L);B=p.channels.toColor(G[0],G[1],G[2]);break;default:B=I?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return B}_getForegroundColor(R,L,I,M,B,G,X,W,$,Y){const k=this._getMinimumContrastColor(R,L,I,M,B,G,X,$,W,Y);if(k)return k;let F;switch(B){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&$&&G<8&&(G+=8),F=this._getColorFromAnsiIndex(G);break;case 50331648:const O=n.AttributeData.toColorRGB(G);F=p.channels.toColor(O[0],O[1],O[2]);break;default:F=X?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(F=p.color.opaque(F)),W&&(F=p.color.multiplyOpacity(F,h.DIM_OPACITY)),F}_resolveBackgroundRgba(R,L,I){switch(R){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return I?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(R,L,I,M){switch(R){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&M&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return I?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(R,L,I,M,B,G,X,W,$,Y){if(this._config.minimumContrastRatio===1||Y)return;const k=this._getContrastCache($),F=k.getColor(R,M);if(F!==void 0)return F||void 0;const O=this._resolveBackgroundRgba(L,I,X),U=this._resolveForegroundRgba(B,G,X,W),Q=p.rgba.ensureContrastRatio(O,U,this._config.minimumContrastRatio/($?2:1));if(!Q)return void k.setColor(R,M,null);const ee=p.channels.toColor(Q>>24&255,Q>>16&255,Q>>8&255);return k.setColor(R,M,ee),ee}_getContrastCache(R){return R?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(R,L,I,M,B=!1){const G=typeof R=="number"?String.fromCharCode(R):R,X=Math.min(this._config.deviceCellWidth*Math.max(G.length,2)+4,this._textureSize);this._tmpCanvas.width<X&&(this._tmpCanvas.width=X);const W=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<W&&(this._tmpCanvas.height=W),this._tmpCtx.save(),this._workAttributeData.fg=I,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=M,this._workAttributeData.isInvisible())return l;const $=!!this._workAttributeData.isBold(),Y=!!this._workAttributeData.isInverse(),k=!!this._workAttributeData.isDim(),F=!!this._workAttributeData.isItalic(),O=!!this._workAttributeData.isUnderline(),U=!!this._workAttributeData.isStrikethrough(),Q=!!this._workAttributeData.isOverline();let ee=this._workAttributeData.getFgColor(),he=this._workAttributeData.getFgColorMode(),ce=this._workAttributeData.getBgColor(),K=this._workAttributeData.getBgColorMode();if(Y){const ge=ee;ee=ce,ce=ge;const we=he;he=K,K=we}const P=this._getBackgroundColor(K,ce,Y,k);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=P.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ne=$?this._config.fontWeightBold:this._config.fontWeight,ie=F?"italic":"";this._tmpCtx.font=`${ie} ${ne} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=h.TEXT_BASELINE;const _e=G.length===1&&(0,a.isPowerlineGlyph)(G.charCodeAt(0)),fe=G.length===1&&(0,a.isRestrictedPowerlineGlyph)(G.charCodeAt(0)),ye=this._getForegroundColor(L,K,ce,I,he,ee,Y,k,$,(0,a.treatGlyphAsBackgroundColor)(G.charCodeAt(0)));this._tmpCtx.fillStyle=ye.css;const ve=fe?0:4;let Te=!1;this._config.customGlyphs!==!1&&(Te=(0,g.tryDrawCustomChar)(this._tmpCtx,G,ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Pe,Se=!_e;if(Pe=typeof R=="number"?this._unicodeService.wcwidth(R):this._unicodeService.getStringCellWidth(R),O){this._tmpCtx.save();const ge=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=ge%2==1?.5:0;if(this._tmpCtx.lineWidth=ge,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Se=!1,this._tmpCtx.strokeStyle=`rgb(${n.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Se=!1;let Qe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Qe<8&&(Qe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Qe).css}this._tmpCtx.beginPath();const Ke=ve,qe=Math.ceil(ve+this._config.deviceCharHeight)-we-(B?2*ge:0),gt=qe+ge,Ze=qe+2*ge;let ct=this._workAttributeData.getUnderlineVariantOffset();for(let Qe=0;Qe<Pe;Qe++){this._tmpCtx.save();const ke=Ke+Qe*this._config.deviceCellWidth,De=Ke+(Qe+1)*this._config.deviceCellWidth,Xt=ke+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(De,qe),this._tmpCtx.moveTo(ke,Ze),this._tmpCtx.lineTo(De,Ze);break;case 3:const ut=ge<=1?Ze:Math.ceil(ve+this._config.deviceCharHeight-ge/2)-we,Et=ge<=1?qe:Math.ceil(ve+this._config.deviceCharHeight+ge/2)-we,vt=new Path2D;vt.rect(ke,qe,this._config.deviceCellWidth,Ze-qe),this._tmpCtx.clip(vt),this._tmpCtx.moveTo(ke-this._config.deviceCellWidth/2,gt),this._tmpCtx.bezierCurveTo(ke-this._config.deviceCellWidth/2,Et,ke,Et,ke,gt),this._tmpCtx.bezierCurveTo(ke,ut,Xt,ut,Xt,gt),this._tmpCtx.bezierCurveTo(Xt,Et,De,Et,De,gt),this._tmpCtx.bezierCurveTo(De,ut,De+this._config.deviceCellWidth/2,ut,De+this._config.deviceCellWidth/2,gt);break;case 4:const Ji=ct===0?0:ct>=ge?2*ge-ct:ge-ct;ct>=ge||Ji===0?(this._tmpCtx.setLineDash([Math.round(ge),Math.round(ge)]),this._tmpCtx.moveTo(ke+Ji,qe),this._tmpCtx.lineTo(De,qe)):(this._tmpCtx.setLineDash([Math.round(ge),Math.round(ge)]),this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(ke+Ji,qe),this._tmpCtx.moveTo(ke+Ji+ge,qe),this._tmpCtx.lineTo(De,qe)),ct=(0,a.computeNextVariantOffset)(De-ke,ge,ct);break;case 5:const Fr=.6,Os=.3,Ei=De-ke,Mi=Math.floor(Fr*Ei),tt=Math.floor(Os*Ei),rt=Ei-Mi-tt;this._tmpCtx.setLineDash([Mi,tt,rt]),this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(De,qe);break;default:this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(De,qe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Te&&this._config.fontSize>=12&&!this._config.allowTransparency&&G!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Qe=this._tmpCtx.measureText(G);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Qe&&Qe.actualBoundingBoxDescent>0){this._tmpCtx.save();const ke=new Path2D;ke.rect(Ke,qe-Math.ceil(ge/2),this._config.deviceCellWidth*Pe,Ze-qe+Math.ceil(ge/2)),this._tmpCtx.clip(ke),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=P.css,this._tmpCtx.strokeText(G,ve,ve+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Q){const ge=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=ge%2==1?.5:0;this._tmpCtx.lineWidth=ge,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ve,ve+we),this._tmpCtx.lineTo(ve+this._config.deviceCharWidth*Pe,ve+we),this._tmpCtx.stroke()}if(Te||this._tmpCtx.fillText(G,ve,ve+this._config.deviceCharHeight),G==="_"&&!this._config.allowTransparency){let ge=b(this._tmpCtx.getImageData(ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight),P,ye,Se);if(ge)for(let we=1;we<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=P.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(G,ve,ve+this._config.deviceCharHeight-we),ge=b(this._tmpCtx.getImageData(ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight),P,ye,Se),ge);we++);}if(U){const ge=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),we=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ge,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ve,ve+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.lineTo(ve+this._config.deviceCharWidth*Pe,ve+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.stroke()}this._tmpCtx.restore();const Mt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let It;if(It=this._config.allowTransparency?(function(ge){for(let we=0;we<ge.data.length;we+=4)if(ge.data[we+3]>0)return!1;return!0})(Mt):b(Mt,P,ye,Se),It)return l;const xe=this._findGlyphBoundingBox(Mt,this._workBoundingBox,X,fe,Te,ve);let Ee,Ae;for(;;){if(this._activePages.length===0){const ge=this._createNewPage();Ee=ge,Ae=ge.currentRow,Ae.height=xe.size.y;break}Ee=this._activePages[this._activePages.length-1],Ae=Ee.currentRow;for(const ge of this._activePages)xe.size.y<=ge.currentRow.height&&(Ee=ge,Ae=ge.currentRow);for(let ge=this._activePages.length-1;ge>=0;ge--)for(const we of this._activePages[ge].fixedRows)we.height<=Ae.height&&xe.size.y<=we.height&&(Ee=this._activePages[ge],Ae=we);if(Ae.y+xe.size.y>=Ee.canvas.height||Ae.height>xe.size.y+2){let ge=!1;if(Ee.currentRow.y+Ee.currentRow.height+xe.size.y>=Ee.canvas.height){let we;for(const Ke of this._activePages)if(Ke.currentRow.y+Ke.currentRow.height+xe.size.y<Ke.canvas.height){we=Ke;break}if(we)Ee=we;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&Ae.y+xe.size.y<=Ee.canvas.height&&Ae.height>=xe.size.y&&Ae.x+xe.size.x<=Ee.canvas.width)ge=!0;else{const Ke=this._createNewPage();Ee=Ke,Ae=Ke.currentRow,Ae.height=xe.size.y,ge=!0}}ge||(Ee.currentRow.height>0&&Ee.fixedRows.push(Ee.currentRow),Ae={x:0,y:Ee.currentRow.y+Ee.currentRow.height,height:xe.size.y},Ee.fixedRows.push(Ae),Ee.currentRow={x:0,y:Ae.y+Ae.height,height:0})}if(Ae.x+xe.size.x<=Ee.canvas.width)break;Ae===Ee.currentRow?(Ae.x=0,Ae.y+=Ae.height,Ae.height=0):Ee.fixedRows.splice(Ee.fixedRows.indexOf(Ae),1)}return xe.texturePage=this._pages.indexOf(Ee),xe.texturePosition.x=Ae.x,xe.texturePosition.y=Ae.y,xe.texturePositionClipSpace.x=Ae.x/Ee.canvas.width,xe.texturePositionClipSpace.y=Ae.y/Ee.canvas.height,xe.sizeClipSpace.x/=Ee.canvas.width,xe.sizeClipSpace.y/=Ee.canvas.height,Ae.height=Math.max(Ae.height,xe.size.y),Ae.x+=xe.size.x,Ee.ctx.putImageData(Mt,xe.texturePosition.x-this._workBoundingBox.left,xe.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,xe.size.x,xe.size.y),Ee.addGlyph(xe),Ee.version++,xe}_findGlyphBoundingBox(R,L,I,M,B,G){L.top=0;const X=M?this._config.deviceCellHeight:this._tmpCanvas.height,W=M?this._config.deviceCellWidth:I;let $=!1;for(let Y=0;Y<X;Y++){for(let k=0;k<W;k++){const F=Y*this._tmpCanvas.width*4+4*k+3;if(R.data[F]!==0){L.top=Y,$=!0;break}}if($)break}L.left=0,$=!1;for(let Y=0;Y<G+W;Y++){for(let k=0;k<X;k++){const F=k*this._tmpCanvas.width*4+4*Y+3;if(R.data[F]!==0){L.left=Y,$=!0;break}}if($)break}L.right=W,$=!1;for(let Y=G+W-1;Y>=G;Y--){for(let k=0;k<X;k++){const F=k*this._tmpCanvas.width*4+4*Y+3;if(R.data[F]!==0){L.right=Y,$=!0;break}}if($)break}L.bottom=X,$=!1;for(let Y=X-1;Y>=0;Y--){for(let k=0;k<W;k++){const F=Y*this._tmpCanvas.width*4+4*k+3;if(R.data[F]!==0){L.bottom=Y,$=!0;break}}if($)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+G+(M||B?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+G+(M||B?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=S;class E{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(R){this._glyphs.push(R),this._usedPixels+=R.size.x*R.size.y}constructor(R,L,I){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],I)for(const M of I)this._glyphs.push(...M.glyphs),this._usedPixels+=M._usedPixels;this.canvas=x(R,L,L),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function b(y,R,L,I){const M=R.rgba>>>24,B=R.rgba>>>16&255,G=R.rgba>>>8&255,X=L.rgba>>>24,W=L.rgba>>>16&255,$=L.rgba>>>8&255,Y=Math.floor((Math.abs(M-X)+Math.abs(B-W)+Math.abs(G-$))/12);let k=!0;for(let F=0;F<y.data.length;F+=4)y.data[F]===M&&y.data[F+1]===B&&y.data[F+2]===G||I&&Math.abs(y.data[F]-M)+Math.abs(y.data[F+1]-B)+Math.abs(y.data[F+2]-G)<Y?y.data[F+3]=0:k=!1;return k}function x(y,R,L){const I=y.createElement("canvas");return I.width=R,I.height=L,I}},160:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let c=0,h=0,g=0,a=0;var p,m,w,_,n;function o(u){const S=u.toString(16);return S.length<2?"0"+S:S}function l(u,S){return u<S?(S+.05)/(u+.05):(u+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(u){u.toCss=function(S,E,b,x){return x!==void 0?`#${o(S)}${o(E)}${o(b)}${o(x)}`:`#${o(S)}${o(E)}${o(b)}`},u.toRgba=function(S,E,b,x=255){return(S<<24|E<<16|b<<8|x)>>>0},u.toColor=function(S,E,b,x){return{css:u.toCss(S,E,b,x),rgba:u.toRgba(S,E,b,x)}}})(p||(s.channels=p={})),(function(u){function S(E,b){return a=Math.round(255*b),[c,h,g]=n.toChannels(E.rgba),{css:p.toCss(c,h,g,a),rgba:p.toRgba(c,h,g,a)}}u.blend=function(E,b){if(a=(255&b.rgba)/255,a===1)return{css:b.css,rgba:b.rgba};const x=b.rgba>>24&255,y=b.rgba>>16&255,R=b.rgba>>8&255,L=E.rgba>>24&255,I=E.rgba>>16&255,M=E.rgba>>8&255;return c=L+Math.round((x-L)*a),h=I+Math.round((y-I)*a),g=M+Math.round((R-M)*a),{css:p.toCss(c,h,g),rgba:p.toRgba(c,h,g)}},u.isOpaque=function(E){return(255&E.rgba)==255},u.ensureContrastRatio=function(E,b,x){const y=n.ensureContrastRatio(E.rgba,b.rgba,x);if(y)return p.toColor(y>>24&255,y>>16&255,y>>8&255)},u.opaque=function(E){const b=(255|E.rgba)>>>0;return[c,h,g]=n.toChannels(b),{css:p.toCss(c,h,g),rgba:b}},u.opacity=S,u.multiplyOpacity=function(E,b){return a=255&E.rgba,S(E,a*b/255)},u.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(m||(s.color=m={})),(function(u){let S,E;try{const b=document.createElement("canvas");b.width=1,b.height=1;const x=b.getContext("2d",{willReadFrequently:!0});x&&(S=x,S.globalCompositeOperation="copy",E=S.createLinearGradient(0,0,1,1))}catch{}u.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return c=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),g=parseInt(b.slice(3,4).repeat(2),16),p.toColor(c,h,g);case 5:return c=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),g=parseInt(b.slice(3,4).repeat(2),16),a=parseInt(b.slice(4,5).repeat(2),16),p.toColor(c,h,g,a);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const x=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(x)return c=parseInt(x[1]),h=parseInt(x[2]),g=parseInt(x[3]),a=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),p.toColor(c,h,g,a);if(!S||!E)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=E,S.fillStyle=b,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[c,h,g,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(c,h,g,a),css:b}}})(w||(s.css=w={})),(function(u){function S(E,b,x){const y=E/255,R=b/255,L=x/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}u.relativeLuminance=function(E){return S(E>>16&255,E>>8&255,255&E)},u.relativeLuminance2=S})(_||(s.rgb=_={})),(function(u){function S(b,x,y){const R=b>>24&255,L=b>>16&255,I=b>>8&255;let M=x>>24&255,B=x>>16&255,G=x>>8&255,X=l(_.relativeLuminance2(M,B,G),_.relativeLuminance2(R,L,I));for(;X<y&&(M>0||B>0||G>0);)M-=Math.max(0,Math.ceil(.1*M)),B-=Math.max(0,Math.ceil(.1*B)),G-=Math.max(0,Math.ceil(.1*G)),X=l(_.relativeLuminance2(M,B,G),_.relativeLuminance2(R,L,I));return(M<<24|B<<16|G<<8|255)>>>0}function E(b,x,y){const R=b>>24&255,L=b>>16&255,I=b>>8&255;let M=x>>24&255,B=x>>16&255,G=x>>8&255,X=l(_.relativeLuminance2(M,B,G),_.relativeLuminance2(R,L,I));for(;X<y&&(M<255||B<255||G<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),B=Math.min(255,B+Math.ceil(.1*(255-B))),G=Math.min(255,G+Math.ceil(.1*(255-G))),X=l(_.relativeLuminance2(M,B,G),_.relativeLuminance2(R,L,I));return(M<<24|B<<16|G<<8|255)>>>0}u.blend=function(b,x){if(a=(255&x)/255,a===1)return x;const y=x>>24&255,R=x>>16&255,L=x>>8&255,I=b>>24&255,M=b>>16&255,B=b>>8&255;return c=I+Math.round((y-I)*a),h=M+Math.round((R-M)*a),g=B+Math.round((L-B)*a),p.toRgba(c,h,g)},u.ensureContrastRatio=function(b,x,y){const R=_.relativeLuminance(b>>8),L=_.relativeLuminance(x>>8);if(l(R,L)<y){if(L<R){const B=S(b,x,y),G=l(R,_.relativeLuminance(B>>8));if(G<y){const X=E(b,x,y);return G>l(R,_.relativeLuminance(X>>8))?B:X}return B}const I=E(b,x,y),M=l(R,_.relativeLuminance(I>>8));if(M<y){const B=S(b,x,y);return M>l(R,_.relativeLuminance(B>>8))?I:B}return I}},u.reduceLuminance=S,u.increaseLuminance=E,u.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}})(n||(s.rgba=n={})),s.toPaddedHex=o,s.contrastRatio=l},345:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const g=[];for(let a=0;a<this._listeners.length;a++)g.push(this._listeners[a]);for(let a=0;a<g.length;a++)g[a].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,h){return c((g=>h.fire(g)))},s.runAndSubscribe=function(c,h){return h(void 0),c((g=>h(g)))}},859:(z,s)=>{function c(h){for(const g of h)g.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=c,s.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},485:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,a,p){this._data[g]||(this._data[g]={}),this._data[g][a]=p}get(g,a){return this._data[g]?this._data[g][a]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(h,g,a,p,m){this._data.get(h,g)||this._data.set(h,g,new c),this._data.get(h,g).set(a,p,m)}get(h,g,a,p){var m;return(m=this._data.get(h,g))==null?void 0:m.get(a,p)}clear(){this._data.clear()}}},399:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const c=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=c.includes("Firefox"),s.isLegacyEdge=c.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(c),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad=h==="iPad",s.isIphone=h==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(c)},385:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=c(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(m){this._idleCallback=void 0;let w=0,_=0,n=m.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),_=Math.max(w,_),o=m.timeRemaining(),1.5*_>o)return n-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-w))}ms`),void this._start();n=o}this.clear()}}class a extends g{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const w=Date.now()+m;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=a,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:a,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new c;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,p=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=p}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=h},782:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=c(133),g=c(855),a=c(147);class p extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const _=new p;return _.setFromCharData(w),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const n=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const o=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(n-55296)+o-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},855:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},s.utf32ToString=function(c,h=0,g=c.length){let a="";for(let p=h;p<g;++p){let m=c[p];m>65535?(m-=65536,a+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):a+=String.fromCharCode(m)}return a},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const g=c.length;if(!g)return 0;let a=0,p=0;if(this._interim){const m=c.charCodeAt(p++);56320<=m&&m<=57343?h[a++]=1024*(this._interim-55296)+m-56320+65536:(h[a++]=this._interim,h[a++]=m),this._interim=0}for(let m=p;m<g;++m){const w=c.charCodeAt(m);if(55296<=w&&w<=56319){if(++m>=g)return this._interim=w,a;const _=c.charCodeAt(m);56320<=_&&_<=57343?h[a++]=1024*(w-55296)+_-56320+65536:(h[a++]=w,h[a++]=_)}else w!==65279&&(h[a++]=w)}return a}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const g=c.length;if(!g)return 0;let a,p,m,w,_=0,n=0,o=0;if(this.interim[0]){let S=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let b,x=0;for(;(b=63&this.interim[++x])&&x<4;)E<<=6,E|=b;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=y-x;for(;o<R;){if(o>=g)return 0;if(b=c[o++],(192&b)!=128){o--,S=!0;break}this.interim[x++]=b,E<<=6,E|=63&b}S||(y===2?E<128?o--:h[_++]=E:y===3?E<2048||E>=55296&&E<=57343||E===65279||(h[_++]=E):E<65536||E>1114111||(h[_++]=E)),this.interim.fill(0)}const l=g-4;let u=o;for(;u<g;){for(;!(!(u<l)||128&(a=c[u])||128&(p=c[u+1])||128&(m=c[u+2])||128&(w=c[u+3]));)h[_++]=a,h[_++]=p,h[_++]=m,h[_++]=w,u+=4;if(a=c[u++],a<128)h[_++]=a;else if((224&a)==192){if(u>=g)return this.interim[0]=a,_;if(p=c[u++],(192&p)!=128){u--;continue}if(n=(31&a)<<6|63&p,n<128){u--;continue}h[_++]=n}else if((240&a)==224){if(u>=g)return this.interim[0]=a,_;if(p=c[u++],(192&p)!=128){u--;continue}if(u>=g)return this.interim[0]=a,this.interim[1]=p,_;if(m=c[u++],(192&m)!=128){u--;continue}if(n=(15&a)<<12|(63&p)<<6|63&m,n<2048||n>=55296&&n<=57343||n===65279)continue;h[_++]=n}else if((248&a)==240){if(u>=g)return this.interim[0]=a,_;if(p=c[u++],(192&p)!=128){u--;continue}if(u>=g)return this.interim[0]=a,this.interim[1]=p,_;if(m=c[u++],(192&m)!=128){u--;continue}if(u>=g)return this.interim[0]=a,this.interim[1]=p,this.interim[2]=m,_;if(w=c[u++],(192&w)!=128){u--;continue}if(n=(7&a)<<18|(63&p)<<12|(63&m)<<6|63&w,n<65536||n>1114111)continue;h[_++]=n}}return _}}},776:function(z,s,c){var h=this&&this.__decorate||function(n,o,l,u){var S,E=arguments.length,b=E<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,l):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,u);else for(var x=n.length-1;x>=0;x--)(S=n[x])&&(b=(E<3?S(b):E>3?S(o,l,b):S(o,l))||b);return E>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,u){o(l,u,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const a=c(859),p=c(97),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,_=s.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let o=0;o<n.length;o++)typeof n[o]=="function"&&(n[o]=n[o]())}_log(n,o,l){this._evalLazyOptionalParams(l),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...l)}trace(n,...o){var l;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,n,o)}debug(n,...o){var l;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,n,o)}info(n,...o){var l;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,n,o)}warn(n,...o){var l;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,n,o)}error(n,...o){var l;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,n,o)}};s.LogService=_=h([g(0,p.IOptionsService)],_),s.setTraceLogger=function(n){w=n},s.traceCall=function(n,o,l){if(typeof l.value!="function")throw new Error("not supported");const u=l.value;l.value=function(...S){if(w.logLevel!==p.LogLevelEnum.TRACE)return u.apply(this,S);w.trace(`GlyphRenderer#${u.name}(${S.map((b=>JSON.stringify(b))).join(", ")})`);const E=u.apply(this,S);return w.trace(`GlyphRenderer#${u.name} return`,E),E}}},726:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",h="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[h]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const a=function(p,m,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,n,o){n[c]===n?n[h].push({id:_,index:o}):(n[h]=[{id:_,index:o}],n[c]=n)})(a,p,w)};return a.toString=()=>g,s.serviceRegistry.set(g,a),a}},97:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=c(726);var g;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(g||(s.LogLevelEnum=g={})),s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")}},A={};function H(z){var s=A[z];if(s!==void 0)return s.exports;var c=A[z]={exports:{}};return D[z].call(c.exports,c,c.exports,H),c.exports}var N={};return(()=>{var z=N;Object.defineProperty(z,"__esModule",{value:!0}),z.WebglAddon=void 0;const s=H(345),c=H(859),h=H(399),g=H(666),a=H(776);class p extends c.Disposable{constructor(w){if(h.isSafari&&(0,h.getSafariVersion)()<16){const _={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",_))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=w,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(w){const _=w._core;if(!w.element)return void this.register(_.onWillOpen((()=>this.activate(w))));this._terminal=w;const n=_.coreService,o=_.optionsService,l=_,u=l._renderService,S=l._characterJoinerService,E=l._charSizeService,b=l._coreBrowserService,x=l._decorationService,y=l._logService,R=l._themeService;(0,a.setTraceLogger)(y),this._renderer=this.register(new g.WebglRenderer(w,S,E,b,n,x,o,R,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),u.setRenderer(this._renderer),this.register((0,c.toDisposable)((()=>{const L=this._terminal._core._renderService;L.setRenderer(this._terminal._core._createRenderer()),L.handleResize(w.cols,w.rows)})))}get textureAtlas(){var w;return(w=this._renderer)==null?void 0:w.textureAtlas}clearTextureAtlas(){var w;(w=this._renderer)==null||w.clearTextureAtlas()}}z.WebglAddon=p})(),N})()))})(Nc)),Nc.exports}var Im=zm(),so={exports:{}},Nm=so.exports,O_;function Um(){return O_||(O_=1,(function(f,C){(function(D,A){f.exports=A()})(Nm,(()=>(()=>{var D={433:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const h=c(938),g=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],a=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],p=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],m=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let w;function _(n,o){let l,u=0,S=o.length-1;if(n<o[0][0]||n>o[S][1])return!1;for(;S>=u;)if(l=u+S>>1,n>o[l][1])u=l+1;else{if(!(n<o[l][0]))return!0;S=l-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160);for(let n=0;n<g.length;++n)w.fill(0,g[n][0],g[n][1]+1);for(let n=0;n<p.length;++n)w.fill(2,p[n][0],p[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?w[n]:_(n,a)?0:_(n,m)?2:1}charProperties(n,o){let l=this.wcwidth(n),u=l===0&&o!==0;if(u){const S=h.UnicodeService.extractWidth(o);S===0?u=!1:S>l&&(l=S)}return h.UnicodeService.createPropertyValue(0,l,u)}}},345:(z,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const g=[];for(let a=0;a<this._listeners.length;a++)g.push(this._listeners[a]);for(let a=0;a<g.length;a++)g[a].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,h){return c((g=>h.fire(g)))},s.runAndSubscribe=function(c,h){return h(void 0),c((g=>h(g)))}},490:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const h=c(938),g=[[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]],a=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;s.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<g.length;++m)p.fill(0,g[m][0],g[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(w,_){let n,o=0,l=_.length-1;if(w<_[0][0]||w>_[l][1])return!1;for(;l>=o;)if(n=o+l>>1,w>_[n][1])o=n+1;else{if(!(w<_[n][0]))return!0;l=n-1}return!1})(m,a)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,w){let _=this.wcwidth(m),n=_===0&&w!==0;if(n){const o=h.UnicodeService.extractWidth(w);o===0?n=!1:o>_&&(_=o)}return h.UnicodeService.createPropertyValue(0,_,n)}}},938:(z,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=c(345),g=c(490);class a{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,w,_=!1){return(16777215&m)<<3|(3&w)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const m=new g.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let w=0,_=0;const n=m.length;for(let o=0;o<n;++o){let l=m.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=n)return w+this.wcwidth(l);const E=m.charCodeAt(o);56320<=E&&E<=57343?l=1024*(l-55296)+E-56320+65536:w+=this.wcwidth(E)}const u=this.charProperties(l,_);let S=a.extractWidth(u);a.extractShouldJoin(u)&&(S-=a.extractWidth(_)),w+=S,_=u}return w}charProperties(m,w){return this._activeProvider.charProperties(m,w)}}s.UnicodeService=a}},A={};function H(z){var s=A[z];if(s!==void 0)return s.exports;var c=A[z]={exports:{}};return D[z](c,c.exports,H),c.exports}var N={};return(()=>{var z=N;Object.defineProperty(z,"__esModule",{value:!0}),z.Unicode11Addon=void 0;const s=H(433);z.Unicode11Addon=class{activate(c){c.unicode.register(new s.UnicodeV11)}dispose(){}}})(),N})()))})(so)),so.exports}var jm=Um();const Pm=16,Fm=256*1024,B_=50;function qm(f,C){const D=q.useRef(null),A=q.useRef(null),H=q.useRef(null),N=q.useRef(C);N.current=C;const z=q.useRef([]),s=q.useRef(0),c=q.useRef(null),h=q.useRef(null),g=q.useRef(null),a=q.useRef(0),p=q.useRef(null),m=q.useRef(null),w=q.useRef(null),_=q.useRef(!0),n=q.useRef(!0),[o,l]=q.useState(!1),u=q.useRef(null),S=q.useRef(0),E=q.useRef(0),b=q.useRef(0),x=2e3,y=50;q.useEffect(()=>{if(!f.current)return;const W=()=>{if(!D.current||z.current.length===0)return;const U=z.current.join("");z.current=[],s.current=0,D.current.write(U)};g.current=W;const $=(U,Q)=>{const ee=w.current;if(ee&&ee.cols===U&&ee.rows===Q)return;const ce=Date.now()-a.current,K=()=>{var ne;a.current=Date.now(),((ne=N.current)==null?void 0:ne.call(N,U,Q))!==!1&&(w.current={cols:U,rows:Q})};if(ce>=B_){K();return}m.current={cols:U,rows:Q},p.current||(p.current=setTimeout(()=>{var ne;p.current=null;const P=m.current;m.current=null,P&&(a.current=Date.now(),((ne=N.current)==null?void 0:ne.call(N,P.cols,P.rows))!==!1&&(w.current={cols:P.cols,rows:P.rows}))},B_-ce))},Y=new Om.Terminal({disableStdin:!0,fontSize:14,fontFamily:"'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace",theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#e6edf3",selectionBackground:"#264f78",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},scrollback:1e4}),k=new Hm.FitAddon;Y.loadAddon(k);try{const U=new jm.Unicode11Addon;Y.loadAddon(U),Y.unicode.activeVersion="11"}catch{}Y.open(f.current);try{const U=new Im.WebglAddon;Y.loadAddon(U),U.onContextLoss(()=>{U.dispose()})}catch{}k.fit(),requestAnimationFrame(()=>{D.current&&$(D.current.cols,D.current.rows)}),D.current=Y,A.current=k,b.current=Y.buffer.active.viewportY;const F=(U,Q)=>{k.fit(),$(Y.cols,Y.rows)};H.current=F;const O=new ResizeObserver(()=>{k.fit(),$(Y.cols,Y.rows)});return O.observe(f.current),Y.onScroll(()=>{const U=Date.now();if(U-E.current<y)return;const Q=Y.buffer.active,ee=Q.viewportY,he=ee===Q.length-Y.rows;b.current-ee>0&&!he&&(u.current="up",S.current=U,_.current=!1),b.current=ee,n.current=he,he&&(u.current=null,_.current=!0),l(!_.current&&!he)}),()=>{O.disconnect(),p.current&&(clearTimeout(p.current),p.current=null),c.current!==null&&(cancelAnimationFrame(c.current),c.current=null),h.current&&(clearTimeout(h.current),h.current=null),W(),Y.dispose(),D.current=null,A.current=null,H.current=null,g.current=null}},[f]);const R=q.useCallback(()=>{const W=D.current;if(!W)return;const $=Date.now(),Y=u.current==="up"&&$-S.current<x;if(_.current&&!Y){E.current=Date.now(),W.scrollToBottom(),b.current=W.buffer.active.viewportY;return}const k=W.buffer.active,F=k.viewportY===k.length-W.rows;F!==n.current&&(n.current=F,l(!F))},[]),L=q.useCallback((W,$)=>{var Y;if(!W){$==null||$();return}if(z.current.push(W),s.current+=W.length,s.current>=Fm){(Y=g.current)==null||Y.call(g),R(),$==null||$();return}c.current===null&&(c.current=requestAnimationFrame(()=>{var k;c.current=null,h.current&&(clearTimeout(h.current),h.current=null),(k=g.current)==null||k.call(g),R()})),h.current||(h.current=setTimeout(()=>{var k;h.current=null,(k=g.current)==null||k.call(g),R()},Pm)),$==null||$()},[]),I=q.useCallback(()=>{var W;(W=D.current)==null||W.clear()},[]),M=q.useCallback(()=>{var W;(W=D.current)==null||W.reset()},[]),B=q.useCallback(()=>{const W=D.current;W&&(E.current=Date.now(),W.scrollToBottom(),b.current=W.buffer.active.viewportY)},[]),G=q.useCallback(W=>{_.current=W,W&&(u.current=null,l(!1))},[]),X=q.useCallback((W,$)=>{var Y;(Y=H.current)==null||Y.call(H,W,$)},[]);return{write:L,clear:I,reset:M,scrollToBottom:B,setAutoFollow:G,showScrollHint:o,adaptToPtyCols:X,terminal:D}}function Wm(){const[f,C]=q.useState(0),[D,A]=q.useState(!1),H=q.useRef(null),N=q.useCallback(()=>{const h=document.activeElement;if((h==null?void 0:h.tagName)!=="INPUT"&&(h==null?void 0:h.tagName)!=="TEXTAREA")return!1;const g=window.visualViewport;return g?h.getBoundingClientRect().bottom>g.height+g.offsetTop-10:!1},[]),z=q.useCallback(()=>{const h=window.visualViewport;if(!h){C(0),A(!1);return}const g=N();A(g),C(g?h.offsetTop:0)},[N]),s=q.useCallback(()=>{if(!window.visualViewport)return;const g=N();A(g),g||C(0)},[N]),c=q.useCallback(()=>{H.current&&clearTimeout(H.current),H.current=setTimeout(z,0)},[z]);return q.useEffect(()=>{const h=window.visualViewport;if(h)return C(0),h.addEventListener("resize",c),h.addEventListener("scroll",c),document.addEventListener("focusin",s,!0),document.addEventListener("focusout",s,!0),()=>{h.removeEventListener("resize",c),h.removeEventListener("scroll",c),document.removeEventListener("focusin",s,!0),document.removeEventListener("focusout",s,!0),H.current&&clearTimeout(H.current)}},[c,s]),{offsetTop:f,needsCompensation:D}}function $m(f){const C="=".repeat((4-f.length%4)%4),D=(f+C).replace(/-/g,"+").replace(/_/g,"/"),A=atob(D),H=new Uint8Array(A.length);for(let N=0;N<A.length;N++)H[N]=A.charCodeAt(N);return H}function Gm(){const f=q.useRef(!1);q.useEffect(()=>{if(!f.current){if(f.current=!0,!("serviceWorker"in navigator)||!("PushManager"in window)){console.log("[Push] Service Worker or PushManager not supported");return}(async()=>{try{console.log("[Push] Registering service worker...");const C=await navigator.serviceWorker.register("/sw.js");console.log("[Push] Service worker registered:",C.scope);const D=await C.pushManager.getSubscription();if(D){console.log("[Push] Already subscribed, endpoint:",D.endpoint);return}console.log("[Push] Fetching VAPID key from server...");let A="";for(let c=0;c<8;c++){const h=await fetch("/api/push/vapid-key",{credentials:"include"});if(h.ok){const g=await h.json();if(g!=null&&g.vapidPublicKey){A=g.vapidPublicKey,console.log("[Push] Got VAPID key:",A.substring(0,20)+"...");break}}else console.log("[Push] VAPID key fetch failed, attempt",c+1,"status:",h.status);await new Promise(g=>setTimeout(g,Math.min(300*(c+1),1500)))}if(!A){console.warn("[Push] Failed to get VAPID key after retries");return}console.log("[Push] Requesting notification permission...");const H=await Notification.requestPermission();if(console.log("[Push] Permission result:",H),H!=="granted"){console.warn("[Push] Notification permission not granted");return}console.log("[Push] Creating push subscription...");const N=await C.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:$m(A)});console.log("[Push] Subscription created:",N.endpoint);const z=N.toJSON();console.log("[Push] Sending subscription to server...");const s=await fetch("/api/push/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({endpoint:z.endpoint,keys:z.keys})});s.ok?console.log("[Push] Subscription sent to server successfully"):console.error("[Push] Failed to send subscription, status:",s.status)}catch(C){console.error("[Push] Setup failed:",C)}})()}},[])}function Ym(){const f=q.useRef("default"),C=q.useRef(null);q.useEffect(()=>{"Notification"in window&&(f.current=Notification.permission)},[]);const D=q.useCallback(async()=>{if(!("Notification"in window))return console.log("[useLocalNotification] Notification API not supported"),!1;if(Notification.permission==="granted")return f.current="granted",!0;if(Notification.permission==="denied")return console.log("[useLocalNotification] Notification permission denied"),!1;const H=await Notification.requestPermission();return f.current=H,H==="granted"},[]);return{showNotification:q.useCallback(async H=>{if(H.tag&&H.tag===C.current)return console.log("[useLocalNotification] Skipping duplicate notification with tag:",H.tag),!1;if(f.current!=="granted"&&!await D())return console.log("[useLocalNotification] Permission not granted, cannot show notification"),!1;try{const N=new Notification(H.title,{body:H.body,tag:H.tag,icon:"/favicon.ico"});return N.onclick=()=>{window.focus(),N.close()},H.tag&&(C.current=H.tag),console.log("[useLocalNotification] Notification shown:",H.title),!0}catch(N){return console.error("[useLocalNotification] Failed to show notification:",N),!1}},[D]),requestPermission:D}}const Vm=5e3;function Xm(){const f=zt(H=>H.setInstances),C=zt(H=>H.setActiveInstanceId),D=zt(H=>H.activeInstanceId),A=q.useRef(!1);return q.useEffect(()=>{let H,N=!1;const z=async()=>{try{const s=await $c();if(N)return;if(f(s),!A.current&&s.length>0&&(A.current=!0,!zt.getState().activeInstanceId)){const h=s.find(g=>g.isCurrent);h&&C(h.instanceId)}}catch{}};return z(),H=setInterval(z,Vm),()=>{N=!0,H&&clearInterval(H)}},[f,C]),{activeInstanceId:D}}function Km({wsUrl:f,instanceId:C,showCommandPicker:D,isKeyboardOpen:A,onIpChanged:H}){const N=q.useRef(null),z=q.useRef(null),s=at(X=>X.setSessionStatus),c=at(X=>X.setIpChangeInfo),h=at(X=>X.setInstanceConnectionStatus),{showNotification:g}=Ym(),a=q.useRef(null),p=q.useRef((X,W)=>{}),m=q.useRef(()=>{}),w=q.useRef(()=>{}),_=q.useRef((X,W)=>{}),n=q.useCallback(X=>{switch(X.type){case"terminal_output":p.current(X.data);break;case"history_sync":m.current(),_.current(0,0),p.current(X.data),s(X.status),w.current();break;case"terminal_resize":X.cols&&X.cols>0&&_.current(X.cols,X.rows);break;case"status_update":s(X.status),X.status==="waiting_input"&&g({title:"Claude Code 需要输入",body:X.detail??"Claude 正在等待你的输入",tag:"claude-waiting-input",renotify:!1});break;case"session_ended":s("idle"),C&&h(C,"disconnected");break;case"error":p.current(`\r
140
+ \x1B[31m[Error] ${X.message}\x1B[0m\r
141
+ `);break;case"heartbeat":break;case"ip_changed":c({oldIp:X.oldIp,newIp:X.newIp,newUrl:X.newUrl}),H==null||H(X.newIp);break}},[s,c,H,g]),{connect:o,send:l}=Mm(n,f,C);a.current=l;const{write:u,reset:S,scrollToBottom:E,setAutoFollow:b,showScrollHint:x,adaptToPtyCols:y}=qm(N,q.useCallback((X,W)=>{var $;return(($=a.current)==null?void 0:$.call(a,{type:"resize",cols:X,rows:W}))??!1},[]));p.current=u,m.current=S,w.current=E,_.current=y;const R=q.useRef(!1);q.useEffect(()=>{R.current||(R.current=!0,o())},[o]);const L=q.useCallback(X=>{X?(l({type:"user_input",data:X}),setTimeout(()=>{l({type:"user_input",data:"\r"})},0)):l({type:"user_input",data:"\r"})},[l]),I=q.useCallback(X=>{l({type:"user_input",data:X})},[l]),M=q.useCallback(X=>{var W;(W=z.current)==null||W.setText(X)},[]),B=q.useCallback(X=>{l({type:"user_input",data:X}),l({type:"user_input",data:"\r"})},[l]),G=q.useCallback(()=>{E(),b(!0)},[E,b]);return V.jsxs(V.Fragment,{children:[V.jsx(vm,{}),V.jsx(pm,{}),V.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[V.jsx(hm,{containerRef:N}),V.jsx(Tm,{visible:x,onClick:G})]}),V.jsx(gm,{onShortcut:I,onCommandSelect:M,onCommandSend:B,visible:D}),V.jsx(dm,{ref:z,onSend:L,isKeyboardOpen:A})]})}function Zm(f,C,D){const A=f.filter(N=>N.instanceId!==C).sort((N,z)=>N.port-z.port);if(A.length===0)return[];if(D===void 0)return A;const H=A.findIndex(N=>N.port>D);return H===-1?A:[...A.slice(H),...A.slice(0,H)]}function Qm(){const{offsetTop:f,needsCompensation:C}=Wm(),D=C&&f>0,A=!D;Gm(),Xm();const H=zt(x=>x.instances),N=zt(x=>x.activeInstanceId),z=zt(x=>x.setActiveInstanceId),s=zt(x=>x.currentHostOverride),c=zt(x=>x.setCurrentHostOverride),h=at(x=>x.cachedToken),g=at(x=>x.instanceConnectionStatus),a=at(x=>x.toastMessage),p=at(x=>x.showToast),m=at(x=>x.hideToast),w=q.useRef(!1),_=q.useRef(null),n=q.useRef(void 0),o=H.find(x=>x.instanceId===N);o==null||o.isCurrent;const l=q.useMemo(()=>{if(o)return o.isCurrent?s??o.host:o.host},[o,s]),u=o&&l?Sm(l,o.port):void 0;q.useEffect(()=>{(o==null?void 0:o.port)!==void 0&&(n.current=o.port)},[o]),q.useEffect(()=>{o!=null&&o.isCurrent||c(null)},[o,c]),q.useEffect(()=>{if(!N)return;const x=!o,y=g[N]==="disconnected";if(!(x||y)||w.current||_.current===N)return;const L=(o==null?void 0:o.port)??n.current,I=Zm(H,N,L);if(I.length===0)return;w.current=!0,_.current=N,(async()=>{for(const B of I){if(h)try{if(B.isCurrent)await Qi(h);else if(!await Mn(B.host,B.port,h))continue}catch{continue}z(B.instanceId),p(`已切换到 ${B.port}`);break}w.current=!1})()},[o,N,h,g,H,z,p]),q.useEffect(()=>{if(!a)return;const x=setTimeout(()=>m(),3e3);return()=>clearTimeout(x)},[a,m]);const S=q.useCallback(async x=>{const y=H.find(R=>R.instanceId===x);if(y){if(h)try{y.isCurrent?await Qi(h):await Mn(y.host,y.port,h)}catch{}c(null),z(x)}},[H,h,z,c]),E=q.useCallback(x=>{c(x)},[c]),b=q.useCallback(async x=>{const R=[...zt.getState().instances].filter(L=>L.name===x).sort((L,I)=>I.startedAt.localeCompare(L.startedAt))[0];if(!R){p("Instance created, but switch failed");return}if(h)try{R.isCurrent?await Qi(h):await Mn(R.host,R.port,h)}catch{}c(null),z(R.instanceId),p(`Created and switched to ${x}`)},[h,z,c,p]);return V.jsxs("div",{"data-testid":"console-page",style:{position:"fixed",top:0,left:0,right:0,height:"100dvh",transform:C?`translateY(-${f}px)`:"none",transition:"transform 0.25s ease-out",willChange:C?"transform":"auto",display:"flex",flexDirection:"column"},children:[V.jsx(um,{}),V.jsx(Lm,{onSwitch:S,onCopySuccess:b}),V.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:V.jsx(Km,{wsUrl:u,instanceId:N??void 0,showCommandPicker:A,isKeyboardOpen:D,onIpChanged:o!=null&&o.isCurrent?E:void 0},`${N??"default"}:${l??"none"}`)}),a&&V.jsx("div",{className:"app-toast",role:"status","aria-live":"polite",children:a})]})}const H_=[{id:"add-instance",target:'button[aria-label="Create new instance"]',title:"Start Here",description:"Tap + to create a new Claude Code session. Each instance runs independently.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:16},{id:"instance-tabs",target:'[data-testid="instance-tabs"]',title:"Switch Sessions",description:"Tap any tab to switch between different Claude sessions.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:8},{id:"clone-instance",target:'[data-testid="instance-tab"]',title:"Clone Sessions",description:"Long press a tab to clone it with all settings. Perfect for backup or testing.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:8},{id:"shortcut-bar",target:'[data-testid="shortcut-bar"]',title:"Quick Keys",description:"Send Ctrl+C, Tab, Enter etc. instantly without typing.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"command-buttons",target:'[data-testid="command-buttons"]',title:"One-Tap Commands",description:"Run preset commands with a single tap.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"input-bar",target:'[data-testid="command-input"]',title:"Chat with Claude",description:"Type your message or command here. Claude Code will respond in real-time.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"settings-button",target:'button[aria-label="Settings"]',title:"Customize",description:"Adjust shortcuts, commands, and preferences.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:16}],z_="claude_remote_spotlight_done";function Jm(){const[f,C]=q.useState(!1),[D,A]=q.useState(0),[H,N]=q.useState(null),[z,s]=q.useState(!0),c=q.useRef(null),h=H_[D]??null,g=H_.length,a=q.useCallback(o=>{const l=document.querySelector(o.target);if(!l)return null;const u=l.getBoundingClientRect(),S=document.querySelector('[data-testid="console-page"]'),E=S?window.getComputedStyle(S):null,b=E==null?void 0:E.transform;let x=0;if(b&&b!=="none"){const y=b.match(/matrix\([^,]+,[^,]+,[^,]+,[^,]+,[^,]+,([^)]+)\)/);y&&(x=parseFloat(y[1]))}return{left:u.left,top:u.top-x,width:u.width,height:u.height}},[]),p=q.useCallback(()=>{if(!h)return;const o=a(h);N(o)},[h,a]);q.useEffect(()=>{localStorage.getItem(z_)||C(!0)},[]),q.useEffect(()=>{if(!f||!h)return;const o=document.querySelector(h.target);o&&o.scrollIntoView({behavior:"smooth",block:"center"});const l=setTimeout(()=>{const u=a(h);u?(N(u),s(!1)):D<g-1?A(D+1):m()},100);return()=>clearTimeout(l)},[f,D,h,a,g]),q.useEffect(()=>{if(!f||!h)return;const o=document.querySelector(h.target);if(!o)return;const l=o.style.outline,u=o.style.outlineOffset,S=o.style.position,E=o.style.zIndex;return o.style.outline="2px solid var(--status-running)",o.style.outlineOffset="2px",window.getComputedStyle(o).position==="static"&&(o.style.position="relative"),o.style.zIndex="2001",()=>{o.style.outline=l,o.style.outlineOffset=u,o.style.position=S,o.style.zIndex=E}},[f,h]),q.useEffect(()=>{if(!f)return;const o=()=>{c.current&&clearTimeout(c.current),c.current=window.setTimeout(()=>{p()},100)};return window.addEventListener("resize",o),window.visualViewport&&window.visualViewport.addEventListener("resize",o),()=>{window.removeEventListener("resize",o),window.visualViewport&&window.visualViewport.removeEventListener("resize",o),c.current&&clearTimeout(c.current)}},[f,p]);const m=q.useCallback(()=>{localStorage.setItem(z_,"true"),C(!1),s(!0),N(null)},[]),w=q.useCallback(()=>{D<g-1?A(D+1):m()},[D,g,m]),_=q.useCallback(()=>{D>0&&A(D-1)},[D]),n=q.useCallback(()=>{m()},[m]);return{visible:f,currentStep:D,totalSteps:g,step:h,targetRect:H,isLoading:z,handleNext:w,handlePrev:_,handleSkip:n,recalculate:p}}const kg=q.createContext(null);function eS({children:f}){const C=Jm();return V.jsx(kg.Provider,{value:C,children:f})}function tS(){const f=q.useContext(kg);if(!f)throw new Error("useSpotlightContext must be used within a SpotlightProvider");return f}function iS(){const{visible:f,currentStep:C,totalSteps:D,step:A,targetRect:H,isLoading:N,handleNext:z,handlePrev:s,handleSkip:c}=tS(),h=q.useRef(null),g=q.useRef(null),a=q.useCallback(M=>{switch(M.key){case"ArrowRight":case"ArrowDown":M.preventDefault(),z();break;case"ArrowLeft":case"ArrowUp":M.preventDefault(),s();break;case"Escape":M.preventDefault(),c();break;case"Enter":case" ":M.preventDefault(),z();break}},[z,s,c]);if(q.useEffect(()=>{if(f){g.current=document.activeElement;const M=setTimeout(()=>{var B;(B=h.current)==null||B.focus()},100);return()=>clearTimeout(M)}else g.current&&g.current.focus()},[f]),!f||!A||!H)return null;const p=A.spotlightPadding??4;A.spotlightRadius;const m=C===D-1,w=C===0,_=H.left-p,n=H.top-p,o=H.width+p*2,l=H.height+p*2,u=140,S=n,E=window.innerHeight-(n+l);let b=A.tooltipPosition;A.tooltipPosition==="bottom"&&E<u&&S>=u?b="top":A.tooltipPosition==="top"&&S<u&&E>=u&&(b="bottom");const x=b==="bottom"?n+l+12:n-12,y=Math.min(x,window.innerHeight-u-16),R=280,L=Math.max(16,Math.min(window.innerWidth-R-16,_)),I=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;return V.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":`Guide step ${C+1} of ${D}: ${A.title}`,tabIndex:-1,onKeyDown:a,style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:2e3,cursor:"pointer",WebkitTapHighlightColor:"transparent"},onClick:M=>{M.target.closest("[data-spotlight-tooltip]")||z()},children:[V.jsx("div",{style:{position:"absolute",inset:0,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.75)",pointerEvents:"none"}}),V.jsxs("div",{"data-spotlight-tooltip":!0,style:{position:"absolute",left:L,top:Math.max(16,y),transform:b==="top"?"translateY(-100%)":"none",maxWidth:R,padding:"12px 16px",borderRadius:12,background:"var(--bg-secondary)",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.3)",pointerEvents:"auto",animation:I?"none":"spotlight-tooltip-enter 0.3s ease-out"},children:[V.jsx("div",{style:{position:"absolute",left:Math.max(16,Math.min(R-28,_+o/2-L-6)),[b==="top"?"bottom":"top"]:-6,width:12,height:12,background:"var(--bg-secondary)",transform:b==="top"?"translateY(50%) rotate(45deg)":"translateY(-50%) rotate(45deg)"}}),V.jsxs("div",{style:{position:"relative",zIndex:1},children:[V.jsx("div",{style:{fontSize:16,fontWeight:600,marginBottom:4,color:"var(--text-primary)"},children:A.title}),V.jsx("div",{style:{fontSize:13,lineHeight:1.5,color:"var(--text-secondary)"},children:A.description}),V.jsxs("div",{style:{marginTop:12,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[V.jsx("div",{style:{display:"flex",gap:6},children:Array.from({length:D}).map((M,B)=>V.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:B===C?"var(--status-running)":B<C?"var(--status-idle)":"var(--border-color)"}},B))}),V.jsxs("div",{style:{display:"flex",gap:8},children:[V.jsx("button",{onClick:M=>{M.stopPropagation(),c()},style:{padding:"6px 12px",borderRadius:6,border:"none",background:"transparent",color:"var(--text-muted)",fontSize:13,cursor:"pointer"},children:"Skip"}),!w&&V.jsx("button",{onClick:M=>{M.stopPropagation(),s()},style:{padding:"6px 14px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:13,cursor:"pointer"},children:"Prev"}),V.jsx("button",{onClick:M=>{M.stopPropagation(),z()},style:{padding:"6px 16px",borderRadius:6,border:"none",background:"var(--status-running)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:m?"Done":"Next"})]})]})]})]}),V.jsx("style",{children:`
142
+ @keyframes spotlight-tooltip-enter {
143
+ from {
144
+ opacity: 0;
145
+ transform: translateY(8px);
146
+ }
147
+ to {
148
+ opacity: 1;
149
+ transform: translateY(0);
150
+ }
151
+ }
152
+ `})]})}function rS(){const C=new URLSearchParams(window.location.search).get("token");if(C){const D=window.location.pathname+window.location.hash;window.history.replaceState({},"",D)}return C}function sS(){const f=at(N=>N.isAuthenticated),C=at(N=>N.isCheckingAuth),D=at(N=>N.setAuthenticated),A=at(N=>N.setCheckingAuth),H=at(N=>N.setCachedToken);return q.useEffect(()=>{const N=rS();if(N){Qi(N).then(z=>{z?(D(!0),H(N),q_(N)):(sessionStorage.setItem("prefill_token",N),A(!1))}).catch(()=>{sessionStorage.setItem("prefill_token",N),A(!1)});return}r0().then(()=>{D(!0);const z=Ds();z&&H(z)}).catch(async()=>{const z=Ds();if(z)try{if(await Qi(z)){D(!0),H(z);return}}catch{}A(!1),W_(),H(null)})},[D,A,H]),C?V.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-primary)",color:"var(--text-secondary)"},children:"Checking session…"}):f?V.jsxs(eS,{children:[V.jsx(Qm,{}),V.jsx(iS,{})]}):V.jsx(o0,{})}Jp.createRoot(document.getElementById("root")).render(V.jsx(q.StrictMode,{children:V.jsx(sS,{})}));