@jinn-network/client 0.1.5 → 0.1.6-canary.0b4ff7f9

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 (326) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/dist/adapters/mech/adapter.js +7 -7
  3. package/dist/adapters/mech/adapter.js.map +1 -1
  4. package/dist/adapters/mech/ipfs-pinfile.d.ts +22 -0
  5. package/dist/adapters/mech/ipfs-pinfile.js +54 -0
  6. package/dist/adapters/mech/ipfs-pinfile.js.map +1 -0
  7. package/dist/adapters/mech/ipfs.d.ts +1 -0
  8. package/dist/adapters/mech/ipfs.js +24 -1
  9. package/dist/adapters/mech/ipfs.js.map +1 -1
  10. package/dist/api/bootstrap-endpoint.js +2 -0
  11. package/dist/api/bootstrap-endpoint.js.map +1 -1
  12. package/dist/api/discovery-endpoint.d.ts +18 -0
  13. package/dist/api/discovery-endpoint.js +65 -0
  14. package/dist/api/discovery-endpoint.js.map +1 -0
  15. package/dist/api/fleet-build.d.ts +7 -0
  16. package/dist/api/fleet-build.js +6 -1
  17. package/dist/api/fleet-build.js.map +1 -1
  18. package/dist/api/harness-readiness-endpoint.d.ts +13 -0
  19. package/dist/api/harness-readiness-endpoint.js +15 -0
  20. package/dist/api/harness-readiness-endpoint.js.map +1 -0
  21. package/dist/api/hermes-doctor-endpoint.d.ts +26 -0
  22. package/dist/api/hermes-doctor-endpoint.js +29 -0
  23. package/dist/api/hermes-doctor-endpoint.js.map +1 -0
  24. package/dist/api/server.d.ts +21 -0
  25. package/dist/api/server.js +22 -0
  26. package/dist/api/server.js.map +1 -1
  27. package/dist/build-info.json +4 -4
  28. package/dist/build-meta.json +1 -1
  29. package/dist/cli/commands/create.d.ts +5 -3
  30. package/dist/cli/commands/create.js +101 -36
  31. package/dist/cli/commands/create.js.map +1 -1
  32. package/dist/cli/commands/solver-nets.d.ts +19 -0
  33. package/dist/cli/commands/solver-nets.js +140 -2
  34. package/dist/cli/commands/solver-nets.js.map +1 -1
  35. package/dist/cli/commands/solver-plugins-publish.d.ts +31 -0
  36. package/dist/cli/commands/solver-plugins-publish.js +169 -0
  37. package/dist/cli/commands/solver-plugins-publish.js.map +1 -0
  38. package/dist/cli/commands/solver-plugins-revoke.d.ts +15 -0
  39. package/dist/cli/commands/solver-plugins-revoke.js +91 -0
  40. package/dist/cli/commands/solver-plugins-revoke.js.map +1 -0
  41. package/dist/cli/commands/solver-plugins.d.ts +50 -6
  42. package/dist/cli/commands/solver-plugins.js +205 -68
  43. package/dist/cli/commands/solver-plugins.js.map +1 -1
  44. package/dist/config.d.ts +27 -0
  45. package/dist/config.js +24 -0
  46. package/dist/config.js.map +1 -1
  47. package/dist/conformance/checks/hash-signature.js +6 -2
  48. package/dist/conformance/checks/hash-signature.js.map +1 -1
  49. package/dist/conformance/checks/payload.js +4 -2
  50. package/dist/conformance/checks/payload.js.map +1 -1
  51. package/dist/conformance/checks/verdict.d.ts +10 -10
  52. package/dist/conformance/checks/verdict.js +16 -15
  53. package/dist/conformance/checks/verdict.js.map +1 -1
  54. package/dist/conformance/harness.d.ts +1 -1
  55. package/dist/conformance/harness.js +16 -9
  56. package/dist/conformance/harness.js.map +1 -1
  57. package/dist/conformance/types.d.ts +10 -3
  58. package/dist/conformance/types.js.map +1 -1
  59. package/dist/corpus/acquire.d.ts +1 -3
  60. package/dist/corpus/acquire.js.map +1 -1
  61. package/dist/corpus/envelope-projection.d.ts +1 -1
  62. package/dist/corpus/envelope-projection.js +14 -7
  63. package/dist/corpus/envelope-projection.js.map +1 -1
  64. package/dist/corpus/index.d.ts +2 -1
  65. package/dist/corpus/index.js.map +1 -1
  66. package/dist/corpus/prediction-brier-scoreboard-report.js +1 -1
  67. package/dist/corpus/prediction-brier-scoreboard-report.js.map +1 -1
  68. package/dist/corpus/prediction-brier-scoreboard.js +3 -1
  69. package/dist/corpus/prediction-brier-scoreboard.js.map +1 -1
  70. package/dist/corpus/types.d.ts +2 -2
  71. package/dist/daemon/daemon.d.ts +17 -1
  72. package/dist/daemon/daemon.js +15 -0
  73. package/dist/daemon/daemon.js.map +1 -1
  74. package/dist/daemon/freeze-fence.js +6 -3
  75. package/dist/daemon/freeze-fence.js.map +1 -1
  76. package/dist/daemon/readiness-gate.d.ts +30 -0
  77. package/dist/daemon/readiness-gate.js +31 -0
  78. package/dist/daemon/readiness-gate.js.map +1 -0
  79. package/dist/dashboard/assets/{index-D_NMfDfV.css → index-B4sTrvQD.css} +1 -1
  80. package/dist/dashboard/assets/index-C5j0ZJWS.js +140 -0
  81. package/dist/dashboard/index.html +2 -2
  82. package/dist/discovery/http.js +121 -0
  83. package/dist/discovery/http.js.map +1 -1
  84. package/dist/discovery/onchain.js +11 -0
  85. package/dist/discovery/onchain.js.map +1 -1
  86. package/dist/discovery/types.d.ts +112 -0
  87. package/dist/discovery/types.js.map +1 -1
  88. package/dist/discovery/with-fallback.js +9 -0
  89. package/dist/discovery/with-fallback.js.map +1 -1
  90. package/dist/earning/agent-wallet-binding.d.ts +20 -1
  91. package/dist/earning/agent-wallet-binding.js +54 -16
  92. package/dist/earning/agent-wallet-binding.js.map +1 -1
  93. package/dist/earning/bootstrap.d.ts +55 -0
  94. package/dist/earning/bootstrap.js +376 -20
  95. package/dist/earning/bootstrap.js.map +1 -1
  96. package/dist/earning/store.js +48 -1
  97. package/dist/earning/store.js.map +1 -1
  98. package/dist/earning/types.d.ts +30 -0
  99. package/dist/earning/types.js +37 -0
  100. package/dist/earning/types.js.map +1 -1
  101. package/dist/erc8004/abis.d.ts +64 -0
  102. package/dist/erc8004/abis.js +48 -0
  103. package/dist/erc8004/abis.js.map +1 -1
  104. package/dist/erc8004/plugin-registry.d.ts +102 -0
  105. package/dist/erc8004/plugin-registry.js +165 -0
  106. package/dist/erc8004/plugin-registry.js.map +1 -0
  107. package/dist/harnesses/engine/engine.js +15 -3
  108. package/dist/harnesses/engine/engine.js.map +1 -1
  109. package/dist/harnesses/engine/envelope-assembly.d.ts +2 -2
  110. package/dist/harnesses/engine/envelope-assembly.js +4 -2
  111. package/dist/harnesses/engine/envelope-assembly.js.map +1 -1
  112. package/dist/harnesses/freeze.d.ts +4 -1
  113. package/dist/harnesses/freeze.js +12 -2
  114. package/dist/harnesses/freeze.js.map +1 -1
  115. package/dist/harnesses/impls/claude-mcp-prediction/index.d.ts +4 -1
  116. package/dist/harnesses/impls/claude-mcp-prediction/index.js +7 -2
  117. package/dist/harnesses/impls/claude-mcp-prediction/index.js.map +1 -1
  118. package/dist/harnesses/impls/claude-mcp-prediction-apy/index.d.ts +4 -1
  119. package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js +7 -2
  120. package/dist/harnesses/impls/claude-mcp-prediction-apy/index.js.map +1 -1
  121. package/dist/harnesses/impls/evaluation-context.d.ts +15 -4
  122. package/dist/harnesses/impls/evaluation-context.js +24 -8
  123. package/dist/harnesses/impls/evaluation-context.js.map +1 -1
  124. package/dist/harnesses/impls/hermes-agent/adapter.d.ts +34 -0
  125. package/dist/harnesses/impls/hermes-agent/adapter.js +184 -0
  126. package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -0
  127. package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +18 -0
  128. package/dist/harnesses/impls/hermes-agent/bootstrap.js +231 -0
  129. package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -0
  130. package/dist/harnesses/impls/hermes-agent/config-builder.d.ts +49 -0
  131. package/dist/harnesses/impls/hermes-agent/config-builder.js +104 -0
  132. package/dist/harnesses/impls/hermes-agent/config-builder.js.map +1 -0
  133. package/dist/harnesses/impls/hermes-agent/harness.d.ts +30 -0
  134. package/dist/harnesses/impls/hermes-agent/harness.js +52 -0
  135. package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -0
  136. package/dist/harnesses/impls/hermes-agent/index.d.ts +5 -0
  137. package/dist/harnesses/impls/hermes-agent/index.js +7 -0
  138. package/dist/harnesses/impls/hermes-agent/index.js.map +1 -0
  139. package/dist/harnesses/impls/hermes-agent/prompt.d.ts +15 -0
  140. package/dist/harnesses/impls/hermes-agent/prompt.js +37 -0
  141. package/dist/harnesses/impls/hermes-agent/prompt.js.map +1 -0
  142. package/dist/harnesses/impls/index.d.ts +6 -0
  143. package/dist/harnesses/impls/index.js +17 -4
  144. package/dist/harnesses/impls/index.js.map +1 -1
  145. package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -0
  146. package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-code.js +13 -34
  147. package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -0
  148. package/dist/harnesses/impls/learner/adapters/codex-workspace.js.map +1 -0
  149. package/dist/harnesses/impls/{claude-code-learner → learner}/harness.d.ts +9 -3
  150. package/dist/harnesses/impls/{claude-code-learner → learner}/harness.js +24 -1
  151. package/dist/harnesses/impls/learner/harness.js.map +1 -0
  152. package/dist/harnesses/impls/{claude-code-learner → learner}/harvest.js +15 -3
  153. package/dist/harnesses/impls/learner/harvest.js.map +1 -0
  154. package/dist/harnesses/impls/{claude-code-learner → learner}/index.d.ts +5 -5
  155. package/dist/harnesses/impls/{claude-code-learner → learner}/index.js +4 -4
  156. package/dist/harnesses/impls/learner/index.js.map +1 -0
  157. package/dist/harnesses/impls/{claude-code-learner → learner}/plugin-path.d.ts +4 -4
  158. package/dist/harnesses/impls/{claude-code-learner → learner}/plugin-path.js +7 -7
  159. package/dist/harnesses/impls/learner/plugin-path.js.map +1 -0
  160. package/dist/harnesses/impls/{claude-code-learner → learner}/restoration-patch.js +3 -1
  161. package/dist/harnesses/impls/learner/restoration-patch.js.map +1 -0
  162. package/dist/harnesses/impls/learner/test-utils/fake-plugin-outputs.js.map +1 -0
  163. package/dist/harnesses/impls/learner/test-utils/noop-adapter.js.map +1 -0
  164. package/dist/harnesses/impls/{claude-code-learner → learner}/types.d.ts +12 -2
  165. package/dist/harnesses/impls/learner/types.js.map +1 -0
  166. package/dist/harnesses/impls/portfolio-v0-evaluator/index.js +13 -12
  167. package/dist/harnesses/impls/portfolio-v0-evaluator/index.js.map +1 -1
  168. package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js +7 -7
  169. package/dist/harnesses/impls/prediction-apy-v0-evaluator/index.js.map +1 -1
  170. package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.d.ts +3 -3
  171. package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js +7 -6
  172. package/dist/harnesses/impls/prediction-apy-v0-evaluator/parse-submission.js.map +1 -1
  173. package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js +1 -1
  174. package/dist/harnesses/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -1
  175. package/dist/harnesses/impls/prediction-v0-evaluator/index.js +11 -10
  176. package/dist/harnesses/impls/prediction-v0-evaluator/index.js.map +1 -1
  177. package/dist/harnesses/impls/prediction-v1-evaluator/index.js +11 -10
  178. package/dist/harnesses/impls/prediction-v1-evaluator/index.js.map +1 -1
  179. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.d.ts +1 -0
  180. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +10 -2
  181. package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
  182. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.d.ts +24 -5
  183. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +104 -4
  184. package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
  185. package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.d.ts +9 -0
  186. package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +25 -1
  187. package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
  188. package/dist/harnesses/names.d.ts +1 -0
  189. package/dist/harnesses/names.js +3 -0
  190. package/dist/harnesses/names.js.map +1 -1
  191. package/dist/harnesses/readiness-registry.d.ts +48 -0
  192. package/dist/harnesses/readiness-registry.js +136 -0
  193. package/dist/harnesses/readiness-registry.js.map +1 -0
  194. package/dist/harnesses/types.d.ts +7 -0
  195. package/dist/main.d.ts +14 -0
  196. package/dist/main.js +70 -35
  197. package/dist/main.js.map +1 -1
  198. package/dist/mcp/server.js +14 -13
  199. package/dist/mcp/server.js.map +1 -1
  200. package/dist/preflight/claude-auth.d.ts +18 -0
  201. package/dist/preflight/claude-auth.js +38 -0
  202. package/dist/preflight/claude-auth.js.map +1 -1
  203. package/dist/scripts/donation-consumption-acceptance.js +1 -1
  204. package/dist/scripts/donation-consumption-acceptance.js.map +1 -1
  205. package/dist/scripts/swe-rebench-v2-known-bad.json +12 -0
  206. package/dist/scripts/swe-rebench-v2-seed-pool.json +26 -0
  207. package/dist/solver-types/_swe-rebench-v2-substrate.d.ts +52 -0
  208. package/dist/solver-types/_swe-rebench-v2-substrate.js +76 -0
  209. package/dist/solver-types/_swe-rebench-v2-substrate.js.map +1 -0
  210. package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +38 -12
  211. package/dist/solver-types/_swe-rebench-v2-validated-pool.js +136 -27
  212. package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
  213. package/dist/solver-types/swe-rebench-v2-auto.d.ts +6 -0
  214. package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
  215. package/dist/solver-types/swe-rebench-v2.d.ts +1 -0
  216. package/dist/solver-types/swe-rebench-v2.js +19 -6
  217. package/dist/solver-types/swe-rebench-v2.js.map +1 -1
  218. package/dist/store/store.js +12 -4
  219. package/dist/store/store.js.map +1 -1
  220. package/dist/templates/plugins/runtime-plugin/.mcp.json.tmpl +8 -0
  221. package/dist/templates/plugins/runtime-plugin/README.md.tmpl +30 -0
  222. package/dist/templates/plugins/runtime-plugin/gitignore.tmpl +3 -0
  223. package/dist/templates/plugins/runtime-plugin/jinn.plugin.json.tmpl +21 -0
  224. package/dist/templates/plugins/runtime-plugin/mcp/server.mjs.tmpl +33 -0
  225. package/dist/templates/plugins/runtime-plugin/package.json.tmpl +15 -0
  226. package/dist/templates/plugins/runtime-plugin/test/plugin.test.ts.tmpl +35 -0
  227. package/dist/templates/plugins/runtime-plugin/tsconfig.json.tmpl +11 -0
  228. package/dist/templates/plugins/solver-type-plugin/README.md.tmpl +35 -0
  229. package/dist/templates/plugins/solver-type-plugin/gitignore.tmpl +3 -0
  230. package/dist/templates/plugins/solver-type-plugin/jinn.plugin.json.tmpl +11 -0
  231. package/dist/templates/plugins/solver-type-plugin/package.json.tmpl +15 -0
  232. package/dist/templates/plugins/solver-type-plugin/skills/example/SKILL.md.tmpl +10 -0
  233. package/dist/templates/plugins/solver-type-plugin/test/plugin.test.ts.tmpl +25 -0
  234. package/dist/templates/plugins/solver-type-plugin/tsconfig.json.tmpl +11 -0
  235. package/dist/types/envelope.d.ts +28 -21
  236. package/dist/types/envelope.js +8 -3
  237. package/dist/types/envelope.js.map +1 -1
  238. package/dist/types/payloads/index.d.ts +2 -2
  239. package/dist/types/payloads/index.js +13 -12
  240. package/dist/types/payloads/index.js.map +1 -1
  241. package/dist/types/payloads/portfolio-v0.d.ts +60 -10
  242. package/dist/types/payloads/portfolio-v0.js +16 -6
  243. package/dist/types/payloads/portfolio-v0.js.map +1 -1
  244. package/dist/types/payloads/prediction-apy-v0.d.ts +52 -10
  245. package/dist/types/payloads/prediction-apy-v0.js +16 -6
  246. package/dist/types/payloads/prediction-apy-v0.js.map +1 -1
  247. package/dist/types/payloads/prediction-v0.d.ts +49 -10
  248. package/dist/types/payloads/prediction-v0.js +16 -6
  249. package/dist/types/payloads/prediction-v0.js.map +1 -1
  250. package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.d.ts +45 -6
  251. package/dist/vendor/@jinn-network/sdk/dist/payloads/prediction-v1.js +16 -6
  252. package/dist/x402/handler.js +51 -20
  253. package/dist/x402/handler.js.map +1 -1
  254. package/package.json +8 -3
  255. package/plugins/swe-rebench-v2-diffmin/.claude-plugin/plugin.json +5 -0
  256. package/plugins/swe-rebench-v2-diffmin/.mcp.json +8 -0
  257. package/plugins/swe-rebench-v2-diffmin/README.md +69 -0
  258. package/plugins/swe-rebench-v2-diffmin/jinn.plugin.json +12 -0
  259. package/plugins/swe-rebench-v2-diffmin/mcp/diff-stats-server.mjs +72 -0
  260. package/plugins/swe-rebench-v2-diffmin/mcp/diff-stats.mjs +48 -0
  261. package/plugins/swe-rebench-v2-diffmin/package.json +19 -0
  262. package/plugins/swe-rebench-v2-diffmin/skills/diffmin/SKILL.md +116 -0
  263. package/plugins/swe-rebench-v2-diffmin/skills/test-map/SKILL.md +126 -0
  264. package/plugins/swe-rebench-v2-diffmin/test/diff-stats.test.ts +62 -0
  265. package/plugins/swe-rebench-v2-diffmin/test/manifest.test.ts +53 -0
  266. package/plugins/swe-rebench-v2-diffmin/tsconfig.json +12 -0
  267. package/plugins/swe-rebench-v2-runtime/README.md +13 -0
  268. package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +7 -3
  269. package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +6 -17
  270. package/templates/plugins/runtime-plugin/.mcp.json.tmpl +8 -0
  271. package/templates/plugins/runtime-plugin/README.md.tmpl +30 -0
  272. package/templates/plugins/runtime-plugin/gitignore.tmpl +3 -0
  273. package/templates/plugins/runtime-plugin/jinn.plugin.json.tmpl +21 -0
  274. package/templates/plugins/runtime-plugin/mcp/server.mjs.tmpl +33 -0
  275. package/templates/plugins/runtime-plugin/package.json.tmpl +15 -0
  276. package/templates/plugins/runtime-plugin/test/plugin.test.ts.tmpl +35 -0
  277. package/templates/plugins/runtime-plugin/tsconfig.json.tmpl +11 -0
  278. package/templates/plugins/solver-type-plugin/README.md.tmpl +35 -0
  279. package/templates/plugins/solver-type-plugin/gitignore.tmpl +3 -0
  280. package/templates/plugins/solver-type-plugin/jinn.plugin.json.tmpl +11 -0
  281. package/templates/plugins/solver-type-plugin/package.json.tmpl +15 -0
  282. package/templates/plugins/solver-type-plugin/skills/example/SKILL.md.tmpl +10 -0
  283. package/templates/plugins/solver-type-plugin/test/plugin.test.ts.tmpl +25 -0
  284. package/templates/plugins/solver-type-plugin/tsconfig.json.tmpl +11 -0
  285. package/dist/dashboard/assets/index-BjtltOGc.js +0 -76
  286. package/dist/harnesses/impls/claude-code-learner/adapters/claude-code.js.map +0 -1
  287. package/dist/harnesses/impls/claude-code-learner/adapters/codex-code.js.map +0 -1
  288. package/dist/harnesses/impls/claude-code-learner/adapters/codex-workspace.js.map +0 -1
  289. package/dist/harnesses/impls/claude-code-learner/harness.js.map +0 -1
  290. package/dist/harnesses/impls/claude-code-learner/harvest.js.map +0 -1
  291. package/dist/harnesses/impls/claude-code-learner/index.js.map +0 -1
  292. package/dist/harnesses/impls/claude-code-learner/plugin-path.js.map +0 -1
  293. package/dist/harnesses/impls/claude-code-learner/restoration-patch.js.map +0 -1
  294. package/dist/harnesses/impls/claude-code-learner/test-utils/fake-plugin-outputs.js.map +0 -1
  295. package/dist/harnesses/impls/claude-code-learner/test-utils/noop-adapter.js.map +0 -1
  296. package/dist/harnesses/impls/claude-code-learner/types.js.map +0 -1
  297. package/dist/preflight/claude-required.d.ts +0 -8
  298. package/dist/preflight/claude-required.js +0 -17
  299. package/dist/preflight/claude-required.js.map +0 -1
  300. /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/claude-code.d.ts +0 -0
  301. /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/claude-code.js +0 -0
  302. /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-code.d.ts +0 -0
  303. /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-workspace.d.ts +0 -0
  304. /package/dist/harnesses/impls/{claude-code-learner → learner}/adapters/codex-workspace.js +0 -0
  305. /package/dist/harnesses/impls/{claude-code-learner → learner}/harvest.d.ts +0 -0
  306. /package/dist/harnesses/impls/{claude-code-learner → learner}/restoration-patch.d.ts +0 -0
  307. /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/fake-plugin-outputs.d.ts +0 -0
  308. /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/fake-plugin-outputs.js +0 -0
  309. /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/noop-adapter.d.ts +0 -0
  310. /package/dist/harnesses/impls/{claude-code-learner → learner}/test-utils/noop-adapter.js +0 -0
  311. /package/dist/harnesses/impls/{claude-code-learner → learner}/types.js +0 -0
  312. /package/plugins/{claude-code-learner → learner}/.claude-plugin/plugin.json +0 -0
  313. /package/plugins/{claude-code-learner → learner}/.codex-plugin/plugin.json +0 -0
  314. /package/plugins/{claude-code-learner → learner}/AGENTS.md +0 -0
  315. /package/plugins/{claude-code-learner → learner}/CLAUDE.md +0 -0
  316. /package/plugins/{claude-code-learner → learner}/README.md +0 -0
  317. /package/plugins/{claude-code-learner → learner}/hooks/hooks.json +0 -0
  318. /package/plugins/{claude-code-learner → learner}/hooks/session-start +0 -0
  319. /package/plugins/{claude-code-learner → learner}/skills/learn/SKILL.md +0 -0
  320. /package/plugins/{claude-code-learner → learner}/skills/learn/analyst-prompt.md +0 -0
  321. /package/plugins/{claude-code-learner → learner}/skills/learn/consolidator-prompt.md +0 -0
  322. /package/plugins/{claude-code-learner → learner}/skills/learn/explorer-prompt.md +0 -0
  323. /package/plugins/{claude-code-learner → learner}/skills/learn/planner-prompt.md +0 -0
  324. /package/plugins/{claude-code-learner → learner}/skills/learn/promoter-prompt.md +0 -0
  325. /package/plugins/{claude-code-learner → learner}/skills/learn/step-worker-prompt.md +0 -0
  326. /package/plugins/{claude-code-learner → learner}/skills/learn/strategist-prompt.md +0 -0
@@ -0,0 +1,140 @@
1
+ var Bu=e=>{throw TypeError(e)};var wa=(e,t,r)=>t.has(e)||Bu("Cannot "+r);var A=(e,t,r)=>(wa(e,t,"read from private field"),r?r.call(e):t.get(e)),Z=(e,t,r)=>t.has(e)?Bu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),V=(e,t,r,n)=>(wa(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ne=(e,t,r)=>(wa(e,t,"access private method"),r);var Pi=(e,t,r,n)=>({set _(s){V(e,t,s,r)},get _(){return A(e,t,n)}});function xv(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const c=Object.getOwnPropertyDescriptor(n,s);c&&Object.defineProperty(e,s,c.get?c:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const g of c.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&n(g)}).observe(document,{childList:!0,subtree:!0});function r(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function n(s){if(s.ep)return;s.ep=!0;const c=r(s);fetch(s.href,c)}})();function Sv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var af={exports:{}},ea={},lf={exports:{}},ie={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 ki=Symbol.for("react.element"),bv=Symbol.for("react.portal"),wv=Symbol.for("react.fragment"),Cv=Symbol.for("react.strict_mode"),kv=Symbol.for("react.profiler"),Ev=Symbol.for("react.provider"),jv=Symbol.for("react.context"),Rv=Symbol.for("react.forward_ref"),Tv=Symbol.for("react.suspense"),Dv=Symbol.for("react.memo"),Lv=Symbol.for("react.lazy"),Au=Symbol.iterator;function Mv(e){return e===null||typeof e!="object"?null:(e=Au&&e[Au]||e["@@iterator"],typeof e=="function"?e:null)}var cf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},uf=Object.assign,df={};function ps(e,t,r){this.props=e,this.context=t,this.refs=df,this.updater=r||cf}ps.prototype.isReactComponent={};ps.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ps.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function hf(){}hf.prototype=ps.prototype;function jc(e,t,r){this.props=e,this.context=t,this.refs=df,this.updater=r||cf}var Rc=jc.prototype=new hf;Rc.constructor=jc;uf(Rc,ps.prototype);Rc.isPureReactComponent=!0;var Iu=Array.isArray,ff=Object.prototype.hasOwnProperty,Tc={current:null},pf={key:!0,ref:!0,__self:!0,__source:!0};function gf(e,t,r){var n,s={},c=null,g=null;if(t!=null)for(n in t.ref!==void 0&&(g=t.ref),t.key!==void 0&&(c=""+t.key),t)ff.call(t,n)&&!pf.hasOwnProperty(n)&&(s[n]=t[n]);var o=arguments.length-2;if(o===1)s.children=r;else if(1<o){for(var a=Array(o),f=0;f<o;f++)a[f]=arguments[f+2];s.children=a}if(e&&e.defaultProps)for(n in o=e.defaultProps,o)s[n]===void 0&&(s[n]=o[n]);return{$$typeof:ki,type:e,key:c,ref:g,props:s,_owner:Tc.current}}function Pv(e,t){return{$$typeof:ki,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Dc(e){return typeof e=="object"&&e!==null&&e.$$typeof===ki}function Bv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ou=/\/+/g;function Ca(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Bv(""+e.key):t.toString(36)}function lo(e,t,r,n,s){var c=typeof e;(c==="undefined"||c==="boolean")&&(e=null);var g=!1;if(e===null)g=!0;else switch(c){case"string":case"number":g=!0;break;case"object":switch(e.$$typeof){case ki:case bv:g=!0}}if(g)return g=e,s=s(g),e=n===""?"."+Ca(g,0):n,Iu(s)?(r="",e!=null&&(r=e.replace(Ou,"$&/")+"/"),lo(s,t,r,"",function(f){return f})):s!=null&&(Dc(s)&&(s=Pv(s,r+(!s.key||g&&g.key===s.key?"":(""+s.key).replace(Ou,"$&/")+"/")+e)),t.push(s)),1;if(g=0,n=n===""?".":n+":",Iu(e))for(var o=0;o<e.length;o++){c=e[o];var a=n+Ca(c,o);g+=lo(c,t,r,a,s)}else if(a=Mv(e),typeof a=="function")for(e=a.call(e),o=0;!(c=e.next()).done;)c=c.value,a=n+Ca(c,o++),g+=lo(c,t,r,a,s);else if(c==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return g}function Bi(e,t,r){if(e==null)return e;var n=[],s=0;return lo(e,n,"","",function(c){return t.call(r,c,s++)}),n}function Av(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qe={current:null},co={transition:null},Iv={ReactCurrentDispatcher:qe,ReactCurrentBatchConfig:co,ReactCurrentOwner:Tc};function vf(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:Bi,forEach:function(e,t,r){Bi(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Bi(e,function(){t++}),t},toArray:function(e){return Bi(e,function(t){return t})||[]},only:function(e){if(!Dc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=ps;ie.Fragment=wv;ie.Profiler=kv;ie.PureComponent=jc;ie.StrictMode=Cv;ie.Suspense=Tv;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Iv;ie.act=vf;ie.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=uf({},e.props),s=e.key,c=e.ref,g=e._owner;if(t!=null){if(t.ref!==void 0&&(c=t.ref,g=Tc.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(a in t)ff.call(t,a)&&!pf.hasOwnProperty(a)&&(n[a]=t[a]===void 0&&o!==void 0?o[a]:t[a])}var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){o=Array(a);for(var f=0;f<a;f++)o[f]=arguments[f+2];n.children=o}return{$$typeof:ki,type:e.type,key:s,ref:c,props:n,_owner:g}};ie.createContext=function(e){return e={$$typeof:jv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ev,_context:e},e.Consumer=e};ie.createElement=gf;ie.createFactory=function(e){var t=gf.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:Rv,render:e}};ie.isValidElement=Dc;ie.lazy=function(e){return{$$typeof:Lv,_payload:{_status:-1,_result:e},_init:Av}};ie.memo=function(e,t){return{$$typeof:Dv,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=co.transition;co.transition={};try{e()}finally{co.transition=t}};ie.unstable_act=vf;ie.useCallback=function(e,t){return qe.current.useCallback(e,t)};ie.useContext=function(e){return qe.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return qe.current.useDeferredValue(e)};ie.useEffect=function(e,t){return qe.current.useEffect(e,t)};ie.useId=function(){return qe.current.useId()};ie.useImperativeHandle=function(e,t,r){return qe.current.useImperativeHandle(e,t,r)};ie.useInsertionEffect=function(e,t){return qe.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return qe.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return qe.current.useMemo(e,t)};ie.useReducer=function(e,t,r){return qe.current.useReducer(e,t,r)};ie.useRef=function(e){return qe.current.useRef(e)};ie.useState=function(e){return qe.current.useState(e)};ie.useSyncExternalStore=function(e,t,r){return qe.current.useSyncExternalStore(e,t,r)};ie.useTransition=function(){return qe.current.useTransition()};ie.version="18.3.1";lf.exports=ie;var N=lf.exports;const mf=Sv(N),Ov=xv({__proto__:null,default:mf},[N]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 Fv=N,Nv=Symbol.for("react.element"),Hv=Symbol.for("react.fragment"),zv=Object.prototype.hasOwnProperty,$v=Fv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Wv={key:!0,ref:!0,__self:!0,__source:!0};function _f(e,t,r){var n,s={},c=null,g=null;r!==void 0&&(c=""+r),t.key!==void 0&&(c=""+t.key),t.ref!==void 0&&(g=t.ref);for(n in t)zv.call(t,n)&&!Wv.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:Nv,type:e,key:c,ref:g,props:s,_owner:$v.current}}ea.Fragment=Hv;ea.jsx=_f;ea.jsxs=_f;af.exports=ea;var i=af.exports,ul={},yf={exports:{}},ut={},xf={exports:{}},Sf={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its 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
+ */(function(e){function t(j,D){var M=j.length;j.push(D);e:for(;0<M;){var I=M-1>>>1,U=j[I];if(0<s(U,D))j[I]=D,j[M]=U,M=I;else break e}}function r(j){return j.length===0?null:j[0]}function n(j){if(j.length===0)return null;var D=j[0],M=j.pop();if(M!==D){j[0]=M;e:for(var I=0,U=j.length,K=U>>>1;I<K;){var Y=2*(I+1)-1,X=j[Y],le=Y+1,R=j[le];if(0>s(X,M))le<U&&0>s(R,X)?(j[I]=R,j[le]=M,I=le):(j[I]=X,j[Y]=M,I=Y);else if(le<U&&0>s(R,M))j[I]=R,j[le]=M,I=le;else break e}}return D}function s(j,D){var M=j.sortIndex-D.sortIndex;return M!==0?M:j.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var g=Date,o=g.now();e.unstable_now=function(){return g.now()-o}}var a=[],f=[],_=1,p=null,m=3,x=!1,w=!1,y=!1,d=typeof setTimeout=="function"?setTimeout:null,u=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(j){for(var D=r(f);D!==null;){if(D.callback===null)n(f);else if(D.startTime<=j)n(f),D.sortIndex=D.expirationTime,t(a,D);else break;D=r(f)}}function v(j){if(y=!1,h(j),!w)if(r(a)!==null)w=!0,F(b);else{var D=r(f);D!==null&&z(v,D.startTime-j)}}function b(j,D){w=!1,y&&(y=!1,u(S),S=-1),x=!0;var M=m;try{for(h(D),p=r(a);p!==null&&(!(p.expirationTime>D)||j&&!P());){var I=p.callback;if(typeof I=="function"){p.callback=null,m=p.priorityLevel;var U=I(p.expirationTime<=D);D=e.unstable_now(),typeof U=="function"?p.callback=U:p===r(a)&&n(a),h(D)}else n(a);p=r(a)}if(p!==null)var K=!0;else{var Y=r(f);Y!==null&&z(v,Y.startTime-D),K=!1}return K}finally{p=null,m=M,x=!1}}var C=!1,E=null,S=-1,k=5,T=-1;function P(){return!(e.unstable_now()-T<k)}function L(){if(E!==null){var j=e.unstable_now();T=j;var D=!0;try{D=E(!0,j)}finally{D?B():(C=!1,E=null)}}else C=!1}var B;if(typeof l=="function")B=function(){l(L)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,O=$.port2;$.port1.onmessage=L,B=function(){O.postMessage(null)}}else B=function(){d(L,0)};function F(j){E=j,C||(C=!0,B())}function z(j,D){S=d(function(){j(e.unstable_now())},D)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){w||x||(w=!0,F(b))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(j){switch(m){case 1:case 2:case 3:var D=3;break;default:D=m}var M=m;m=D;try{return j()}finally{m=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,D){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var M=m;m=j;try{return D()}finally{m=M}},e.unstable_scheduleCallback=function(j,D,M){var I=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?I+M:I):M=I,j){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=M+U,j={id:_++,callback:D,priorityLevel:j,startTime:M,expirationTime:U,sortIndex:-1},M>I?(j.sortIndex=M,t(f,j),r(a)===null&&j===r(f)&&(y?(u(S),S=-1):y=!0,z(v,M-I))):(j.sortIndex=U,t(a,j),w||x||(w=!0,F(b))),j},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(j){var D=m;return function(){var M=m;m=D;try{return j.apply(this,arguments)}finally{m=M}}}})(Sf);xf.exports=Sf;var Uv=xf.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its 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 Jv=N,ct=Uv;function q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var bf=new Set,ei={};function mn(e,t){os(e,t),os(e+"Capture",t)}function os(e,t){for(ei[e]=t,e=0;e<t.length;e++)bf.add(t[e])}var nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dl=Object.prototype.hasOwnProperty,qv=/^[: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]*$/,Fu={},Nu={};function Kv(e){return dl.call(Nu,e)?!0:dl.call(Fu,e)?!1:qv.test(e)?Nu[e]=!0:(Fu[e]=!0,!1)}function Vv(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Qv(e,t,r,n){if(t===null||typeof t>"u"||Vv(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ke(e,t,r,n,s,c,g){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=g}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ae[e]=new Ke(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ae[t]=new Ke(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ae[e]=new Ke(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ae[e]=new Ke(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ae[e]=new Ke(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ae[e]=new Ke(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ae[e]=new Ke(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ae[e]=new Ke(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ae[e]=new Ke(e,5,!1,e.toLowerCase(),null,!1,!1)});var Lc=/[\-:]([a-z])/g;function Mc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Lc,Mc);Ae[t]=new Ke(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Lc,Mc);Ae[t]=new Ke(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Lc,Mc);Ae[t]=new Ke(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ae[e]=new Ke(e,1,!1,e.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new Ke("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ae[e]=new Ke(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pc(e,t,r,n){var s=Ae.hasOwnProperty(t)?Ae[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Qv(t,r,s,n)&&(r=null),n||s===null?Kv(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var ar=Jv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ai=Symbol.for("react.element"),En=Symbol.for("react.portal"),jn=Symbol.for("react.fragment"),Bc=Symbol.for("react.strict_mode"),hl=Symbol.for("react.profiler"),wf=Symbol.for("react.provider"),Cf=Symbol.for("react.context"),Ac=Symbol.for("react.forward_ref"),fl=Symbol.for("react.suspense"),pl=Symbol.for("react.suspense_list"),Ic=Symbol.for("react.memo"),hr=Symbol.for("react.lazy"),kf=Symbol.for("react.offscreen"),Hu=Symbol.iterator;function ks(e){return e===null||typeof e!="object"?null:(e=Hu&&e[Hu]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Object.assign,ka;function Ns(e){if(ka===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);ka=t&&t[1]||""}return`
34
+ `+ka+e}var Ea=!1;function ja(e,t){if(!e||Ea)return"";Ea=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var n=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){n=f}e.call(t.prototype)}else{try{throw Error()}catch(f){n=f}e()}}catch(f){if(f&&n&&typeof f.stack=="string"){for(var s=f.stack.split(`
35
+ `),c=n.stack.split(`
36
+ `),g=s.length-1,o=c.length-1;1<=g&&0<=o&&s[g]!==c[o];)o--;for(;1<=g&&0<=o;g--,o--)if(s[g]!==c[o]){if(g!==1||o!==1)do if(g--,o--,0>o||s[g]!==c[o]){var a=`
37
+ `+s[g].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=g&&0<=o);break}}}finally{Ea=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ns(e):""}function Gv(e){switch(e.tag){case 5:return Ns(e.type);case 16:return Ns("Lazy");case 13:return Ns("Suspense");case 19:return Ns("SuspenseList");case 0:case 2:case 15:return e=ja(e.type,!1),e;case 11:return e=ja(e.type.render,!1),e;case 1:return e=ja(e.type,!0),e;default:return""}}function gl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case jn:return"Fragment";case En:return"Portal";case hl:return"Profiler";case Bc:return"StrictMode";case fl:return"Suspense";case pl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Cf:return(e.displayName||"Context")+".Consumer";case wf:return(e._context.displayName||"Context")+".Provider";case Ac:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ic:return t=e.displayName||null,t!==null?t:gl(e.type)||"Memo";case hr:t=e._payload,e=e._init;try{return gl(e(t))}catch{}}return null}function Xv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return gl(t);case 8:return t===Bc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Or(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ef(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Yv(e){var t=Ef(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,c=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(g){n=""+g,c.call(this,g)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(g){n=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ii(e){e._valueTracker||(e._valueTracker=Yv(e))}function jf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Ef(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function wo(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}}function vl(e,t){var r=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function zu(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Or(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Rf(e,t){t=t.checked,t!=null&&Pc(e,"checked",t,!1)}function ml(e,t){Rf(e,t);var r=Or(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?_l(e,t.type,r):t.hasOwnProperty("defaultValue")&&_l(e,t.type,Or(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $u(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function _l(e,t,r){(t!=="number"||wo(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Hs=Array.isArray;function Nn(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Or(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function yl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(q(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wu(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(q(92));if(Hs(r)){if(1<r.length)throw Error(q(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Or(r)}}function Tf(e,t){var r=Or(t.value),n=Or(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Uu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Df(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function xl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Df(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Oi,Lf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Oi=Oi||document.createElement("div"),Oi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Oi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ti(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Js={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zv=["Webkit","ms","Moz","O"];Object.keys(Js).forEach(function(e){Zv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Js[t]=Js[e]})});function Mf(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Js.hasOwnProperty(e)&&Js[e]?(""+t).trim():t+"px"}function Pf(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Mf(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var em=xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Sl(e,t){if(t){if(em[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(q(62))}}function bl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 wl=null;function Oc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cl=null,Hn=null,zn=null;function Ju(e){if(e=Ri(e)){if(typeof Cl!="function")throw Error(q(280));var t=e.stateNode;t&&(t=ia(t),Cl(e.stateNode,e.type,t))}}function Bf(e){Hn?zn?zn.push(e):zn=[e]:Hn=e}function Af(){if(Hn){var e=Hn,t=zn;if(zn=Hn=null,Ju(e),t)for(e=0;e<t.length;e++)Ju(t[e])}}function If(e,t){return e(t)}function Of(){}var Ra=!1;function Ff(e,t,r){if(Ra)return e(t,r);Ra=!0;try{return If(e,t,r)}finally{Ra=!1,(Hn!==null||zn!==null)&&(Of(),Af())}}function ri(e,t){var r=e.stateNode;if(r===null)return null;var n=ia(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(q(231,t,typeof r));return r}var kl=!1;if(nr)try{var Es={};Object.defineProperty(Es,"passive",{get:function(){kl=!0}}),window.addEventListener("test",Es,Es),window.removeEventListener("test",Es,Es)}catch{kl=!1}function tm(e,t,r,n,s,c,g,o,a){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(_){this.onError(_)}}var qs=!1,Co=null,ko=!1,El=null,rm={onError:function(e){qs=!0,Co=e}};function nm(e,t,r,n,s,c,g,o,a){qs=!1,Co=null,tm.apply(rm,arguments)}function sm(e,t,r,n,s,c,g,o,a){if(nm.apply(this,arguments),qs){if(qs){var f=Co;qs=!1,Co=null}else throw Error(q(198));ko||(ko=!0,El=f)}}function _n(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Nf(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 qu(e){if(_n(e)!==e)throw Error(q(188))}function im(e){var t=e.alternate;if(!t){if(t=_n(e),t===null)throw Error(q(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var c=s.alternate;if(c===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===r)return qu(s),e;if(c===n)return qu(s),t;c=c.sibling}throw Error(q(188))}if(r.return!==n.return)r=s,n=c;else{for(var g=!1,o=s.child;o;){if(o===r){g=!0,r=s,n=c;break}if(o===n){g=!0,n=s,r=c;break}o=o.sibling}if(!g){for(o=c.child;o;){if(o===r){g=!0,r=c,n=s;break}if(o===n){g=!0,n=c,r=s;break}o=o.sibling}if(!g)throw Error(q(189))}}if(r.alternate!==n)throw Error(q(190))}if(r.tag!==3)throw Error(q(188));return r.stateNode.current===r?e:t}function Hf(e){return e=im(e),e!==null?zf(e):null}function zf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=zf(e);if(t!==null)return t;e=e.sibling}return null}var $f=ct.unstable_scheduleCallback,Ku=ct.unstable_cancelCallback,om=ct.unstable_shouldYield,am=ct.unstable_requestPaint,we=ct.unstable_now,lm=ct.unstable_getCurrentPriorityLevel,Fc=ct.unstable_ImmediatePriority,Wf=ct.unstable_UserBlockingPriority,Eo=ct.unstable_NormalPriority,cm=ct.unstable_LowPriority,Uf=ct.unstable_IdlePriority,ta=null,zt=null;function um(e){if(zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(ta,e,void 0,(e.current.flags&128)===128)}catch{}}var Tt=Math.clz32?Math.clz32:fm,dm=Math.log,hm=Math.LN2;function fm(e){return e>>>=0,e===0?32:31-(dm(e)/hm|0)|0}var Fi=64,Ni=4194304;function zs(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function jo(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,c=e.pingedLanes,g=r&268435455;if(g!==0){var o=g&~s;o!==0?n=zs(o):(c&=g,c!==0&&(n=zs(c)))}else g=r&~s,g!==0?n=zs(g):c!==0&&(n=zs(c));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,c=t&-t,s>=c||s===16&&(c&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Tt(t),s=1<<r,n|=e[r],t&=~s;return n}function pm(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gm(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes;0<c;){var g=31-Tt(c),o=1<<g,a=s[g];a===-1?(!(o&r)||o&n)&&(s[g]=pm(o,t)):a<=t&&(e.expiredLanes|=o),c&=~o}}function jl(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Jf(){var e=Fi;return Fi<<=1,!(Fi&4194240)&&(Fi=64),e}function Ta(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ei(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=r}function vm(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-Tt(r),c=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~c}}function Nc(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Tt(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var he=0;function qf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Kf,Hc,Vf,Qf,Gf,Rl=!1,Hi=[],Rr=null,Tr=null,Dr=null,ni=new Map,si=new Map,pr=[],mm="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 submit".split(" ");function Vu(e,t){switch(e){case"focusin":case"focusout":Rr=null;break;case"dragenter":case"dragleave":Tr=null;break;case"mouseover":case"mouseout":Dr=null;break;case"pointerover":case"pointerout":ni.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":si.delete(t.pointerId)}}function js(e,t,r,n,s,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:c,targetContainers:[s]},t!==null&&(t=Ri(t),t!==null&&Hc(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function _m(e,t,r,n,s){switch(t){case"focusin":return Rr=js(Rr,e,t,r,n,s),!0;case"dragenter":return Tr=js(Tr,e,t,r,n,s),!0;case"mouseover":return Dr=js(Dr,e,t,r,n,s),!0;case"pointerover":var c=s.pointerId;return ni.set(c,js(ni.get(c)||null,e,t,r,n,s)),!0;case"gotpointercapture":return c=s.pointerId,si.set(c,js(si.get(c)||null,e,t,r,n,s)),!0}return!1}function Xf(e){var t=Kr(e.target);if(t!==null){var r=_n(t);if(r!==null){if(t=r.tag,t===13){if(t=Nf(r),t!==null){e.blockedOn=t,Gf(e.priority,function(){Vf(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Tl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);wl=n,r.target.dispatchEvent(n),wl=null}else return t=Ri(r),t!==null&&Hc(t),e.blockedOn=r,!1;t.shift()}return!0}function Qu(e,t,r){uo(e)&&r.delete(t)}function ym(){Rl=!1,Rr!==null&&uo(Rr)&&(Rr=null),Tr!==null&&uo(Tr)&&(Tr=null),Dr!==null&&uo(Dr)&&(Dr=null),ni.forEach(Qu),si.forEach(Qu)}function Rs(e,t){e.blockedOn===t&&(e.blockedOn=null,Rl||(Rl=!0,ct.unstable_scheduleCallback(ct.unstable_NormalPriority,ym)))}function ii(e){function t(s){return Rs(s,e)}if(0<Hi.length){Rs(Hi[0],e);for(var r=1;r<Hi.length;r++){var n=Hi[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Rr!==null&&Rs(Rr,e),Tr!==null&&Rs(Tr,e),Dr!==null&&Rs(Dr,e),ni.forEach(t),si.forEach(t),r=0;r<pr.length;r++)n=pr[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<pr.length&&(r=pr[0],r.blockedOn===null);)Xf(r),r.blockedOn===null&&pr.shift()}var $n=ar.ReactCurrentBatchConfig,Ro=!0;function xm(e,t,r,n){var s=he,c=$n.transition;$n.transition=null;try{he=1,zc(e,t,r,n)}finally{he=s,$n.transition=c}}function Sm(e,t,r,n){var s=he,c=$n.transition;$n.transition=null;try{he=4,zc(e,t,r,n)}finally{he=s,$n.transition=c}}function zc(e,t,r,n){if(Ro){var s=Tl(e,t,r,n);if(s===null)Na(e,t,n,To,r),Vu(e,n);else if(_m(s,e,t,r,n))n.stopPropagation();else if(Vu(e,n),t&4&&-1<mm.indexOf(e)){for(;s!==null;){var c=Ri(s);if(c!==null&&Kf(c),c=Tl(e,t,r,n),c===null&&Na(e,t,n,To,r),c===s)break;s=c}s!==null&&n.stopPropagation()}else Na(e,t,n,null,r)}}var To=null;function Tl(e,t,r,n){if(To=null,e=Oc(n),e=Kr(e),e!==null)if(t=_n(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Nf(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return To=e,null}function Yf(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(lm()){case Fc:return 1;case Wf:return 4;case Eo:case cm:return 16;case Uf:return 536870912;default:return 16}default:return 16}}var kr=null,$c=null,ho=null;function Zf(){if(ho)return ho;var e,t=$c,r=t.length,n,s="value"in kr?kr.value:kr.textContent,c=s.length;for(e=0;e<r&&t[e]===s[e];e++);var g=r-e;for(n=1;n<=g&&t[r-n]===s[c-n];n++);return ho=s.slice(e,1<n?1-n:void 0)}function fo(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 zi(){return!0}function Gu(){return!1}function dt(e){function t(r,n,s,c,g){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=c,this.target=g,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(c):c[o]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?zi:Gu,this.isPropagationStopped=Gu,this}return xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=zi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=zi)},persist:function(){},isPersistent:zi}),t}var gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wc=dt(gs),ji=xe({},gs,{view:0,detail:0}),bm=dt(ji),Da,La,Ts,ra=xe({},ji,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uc,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!==Ts&&(Ts&&e.type==="mousemove"?(Da=e.screenX-Ts.screenX,La=e.screenY-Ts.screenY):La=Da=0,Ts=e),Da)},movementY:function(e){return"movementY"in e?e.movementY:La}}),Xu=dt(ra),wm=xe({},ra,{dataTransfer:0}),Cm=dt(wm),km=xe({},ji,{relatedTarget:0}),Ma=dt(km),Em=xe({},gs,{animationName:0,elapsedTime:0,pseudoElement:0}),jm=dt(Em),Rm=xe({},gs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Tm=dt(Rm),Dm=xe({},gs,{data:0}),Yu=dt(Dm),Lm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mm={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"},Pm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Pm[e])?!!t[e]:!1}function Uc(){return Bm}var Am=xe({},ji,{key:function(e){if(e.key){var t=Lm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uc,charCode:function(e){return e.type==="keypress"?fo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Im=dt(Am),Om=xe({},ra,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zu=dt(Om),Fm=xe({},ji,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uc}),Nm=dt(Fm),Hm=xe({},gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),zm=dt(Hm),$m=xe({},ra,{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}),Wm=dt($m),Um=[9,13,27,32],Jc=nr&&"CompositionEvent"in window,Ks=null;nr&&"documentMode"in document&&(Ks=document.documentMode);var Jm=nr&&"TextEvent"in window&&!Ks,ep=nr&&(!Jc||Ks&&8<Ks&&11>=Ks),ed=" ",td=!1;function tp(e,t){switch(e){case"keyup":return Um.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rn=!1;function qm(e,t){switch(e){case"compositionend":return rp(t);case"keypress":return t.which!==32?null:(td=!0,ed);case"textInput":return e=t.data,e===ed&&td?null:e;default:return null}}function Km(e,t){if(Rn)return e==="compositionend"||!Jc&&tp(e,t)?(e=Zf(),ho=$c=kr=null,Rn=!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 ep&&t.locale!=="ko"?null:t.data;default:return null}}var Vm={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 rd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Vm[e.type]:t==="textarea"}function np(e,t,r,n){Bf(n),t=Do(t,"onChange"),0<t.length&&(r=new Wc("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Vs=null,oi=null;function Qm(e){pp(e,0)}function na(e){var t=Ln(e);if(jf(t))return e}function Gm(e,t){if(e==="change")return t}var sp=!1;if(nr){var Pa;if(nr){var Ba="oninput"in document;if(!Ba){var nd=document.createElement("div");nd.setAttribute("oninput","return;"),Ba=typeof nd.oninput=="function"}Pa=Ba}else Pa=!1;sp=Pa&&(!document.documentMode||9<document.documentMode)}function sd(){Vs&&(Vs.detachEvent("onpropertychange",ip),oi=Vs=null)}function ip(e){if(e.propertyName==="value"&&na(oi)){var t=[];np(t,oi,e,Oc(e)),Ff(Qm,t)}}function Xm(e,t,r){e==="focusin"?(sd(),Vs=t,oi=r,Vs.attachEvent("onpropertychange",ip)):e==="focusout"&&sd()}function Ym(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return na(oi)}function Zm(e,t){if(e==="click")return na(t)}function e_(e,t){if(e==="input"||e==="change")return na(t)}function t_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mt=typeof Object.is=="function"?Object.is:t_;function ai(e,t){if(Mt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!dl.call(t,s)||!Mt(e[s],t[s]))return!1}return!0}function id(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function od(e,t){var r=id(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=id(r)}}function op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?op(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ap(){for(var e=window,t=wo();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=wo(e.document)}return t}function qc(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")}function r_(e){var t=ap(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&op(r.ownerDocument.documentElement,r)){if(n!==null&&qc(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,c=Math.min(n.start,s);n=n.end===void 0?c:Math.min(n.end,s),!e.extend&&c>n&&(s=n,n=c,c=s),s=od(r,c);var g=od(r,n);s&&g&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==g.node||e.focusOffset!==g.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),c>n?(e.addRange(t),e.extend(g.node,g.offset)):(t.setEnd(g.node,g.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var n_=nr&&"documentMode"in document&&11>=document.documentMode,Tn=null,Dl=null,Qs=null,Ll=!1;function ad(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ll||Tn==null||Tn!==wo(n)||(n=Tn,"selectionStart"in n&&qc(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Qs&&ai(Qs,n)||(Qs=n,n=Do(Dl,"onSelect"),0<n.length&&(t=new Wc("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Tn)))}function $i(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Dn={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionend:$i("Transition","TransitionEnd")},Aa={},lp={};nr&&(lp=document.createElement("div").style,"AnimationEvent"in window||(delete Dn.animationend.animation,delete Dn.animationiteration.animation,delete Dn.animationstart.animation),"TransitionEvent"in window||delete Dn.transitionend.transition);function sa(e){if(Aa[e])return Aa[e];if(!Dn[e])return e;var t=Dn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in lp)return Aa[e]=t[r];return e}var cp=sa("animationend"),up=sa("animationiteration"),dp=sa("animationstart"),hp=sa("transitionend"),fp=new Map,ld="abort auxClick 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(" ");function Nr(e,t){fp.set(e,t),mn(t,[e])}for(var Ia=0;Ia<ld.length;Ia++){var Oa=ld[Ia],s_=Oa.toLowerCase(),i_=Oa[0].toUpperCase()+Oa.slice(1);Nr(s_,"on"+i_)}Nr(cp,"onAnimationEnd");Nr(up,"onAnimationIteration");Nr(dp,"onAnimationStart");Nr("dblclick","onDoubleClick");Nr("focusin","onFocus");Nr("focusout","onBlur");Nr(hp,"onTransitionEnd");os("onMouseEnter",["mouseout","mouseover"]);os("onMouseLeave",["mouseout","mouseover"]);os("onPointerEnter",["pointerout","pointerover"]);os("onPointerLeave",["pointerout","pointerover"]);mn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));mn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));mn("onBeforeInput",["compositionend","keypress","textInput","paste"]);mn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));mn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));mn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $s="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(" "),o_=new Set("cancel close invalid load scroll toggle".split(" ").concat($s));function cd(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,sm(n,t,void 0,e),e.currentTarget=null}function pp(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var c=void 0;if(t)for(var g=n.length-1;0<=g;g--){var o=n[g],a=o.instance,f=o.currentTarget;if(o=o.listener,a!==c&&s.isPropagationStopped())break e;cd(s,o,f),c=a}else for(g=0;g<n.length;g++){if(o=n[g],a=o.instance,f=o.currentTarget,o=o.listener,a!==c&&s.isPropagationStopped())break e;cd(s,o,f),c=a}}}if(ko)throw e=El,ko=!1,El=null,e}function pe(e,t){var r=t[Il];r===void 0&&(r=t[Il]=new Set);var n=e+"__bubble";r.has(n)||(gp(t,e,2,!1),r.add(n))}function Fa(e,t,r){var n=0;t&&(n|=4),gp(r,e,n,t)}var Wi="_reactListening"+Math.random().toString(36).slice(2);function li(e){if(!e[Wi]){e[Wi]=!0,bf.forEach(function(r){r!=="selectionchange"&&(o_.has(r)||Fa(r,!1,e),Fa(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wi]||(t[Wi]=!0,Fa("selectionchange",!1,t))}}function gp(e,t,r,n){switch(Yf(t)){case 1:var s=xm;break;case 4:s=Sm;break;default:s=zc}r=s.bind(null,t,r,e),s=void 0,!kl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Na(e,t,r,n,s){var c=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var g=n.tag;if(g===3||g===4){var o=n.stateNode.containerInfo;if(o===s||o.nodeType===8&&o.parentNode===s)break;if(g===4)for(g=n.return;g!==null;){var a=g.tag;if((a===3||a===4)&&(a=g.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;g=g.return}for(;o!==null;){if(g=Kr(o),g===null)return;if(a=g.tag,a===5||a===6){n=c=g;continue e}o=o.parentNode}}n=n.return}Ff(function(){var f=c,_=Oc(r),p=[];e:{var m=fp.get(e);if(m!==void 0){var x=Wc,w=e;switch(e){case"keypress":if(fo(r)===0)break e;case"keydown":case"keyup":x=Im;break;case"focusin":w="focus",x=Ma;break;case"focusout":w="blur",x=Ma;break;case"beforeblur":case"afterblur":x=Ma;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=Xu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=Cm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=Nm;break;case cp:case up:case dp:x=jm;break;case hp:x=zm;break;case"scroll":x=bm;break;case"wheel":x=Wm;break;case"copy":case"cut":case"paste":x=Tm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Zu}var y=(t&4)!==0,d=!y&&e==="scroll",u=y?m!==null?m+"Capture":null:m;y=[];for(var l=f,h;l!==null;){h=l;var v=h.stateNode;if(h.tag===5&&v!==null&&(h=v,u!==null&&(v=ri(l,u),v!=null&&y.push(ci(l,v,h)))),d)break;l=l.return}0<y.length&&(m=new x(m,w,null,r,_),p.push({event:m,listeners:y}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",m&&r!==wl&&(w=r.relatedTarget||r.fromElement)&&(Kr(w)||w[sr]))break e;if((x||m)&&(m=_.window===_?_:(m=_.ownerDocument)?m.defaultView||m.parentWindow:window,x?(w=r.relatedTarget||r.toElement,x=f,w=w?Kr(w):null,w!==null&&(d=_n(w),w!==d||w.tag!==5&&w.tag!==6)&&(w=null)):(x=null,w=f),x!==w)){if(y=Xu,v="onMouseLeave",u="onMouseEnter",l="mouse",(e==="pointerout"||e==="pointerover")&&(y=Zu,v="onPointerLeave",u="onPointerEnter",l="pointer"),d=x==null?m:Ln(x),h=w==null?m:Ln(w),m=new y(v,l+"leave",x,r,_),m.target=d,m.relatedTarget=h,v=null,Kr(_)===f&&(y=new y(u,l+"enter",w,r,_),y.target=h,y.relatedTarget=d,v=y),d=v,x&&w)t:{for(y=x,u=w,l=0,h=y;h;h=wn(h))l++;for(h=0,v=u;v;v=wn(v))h++;for(;0<l-h;)y=wn(y),l--;for(;0<h-l;)u=wn(u),h--;for(;l--;){if(y===u||u!==null&&y===u.alternate)break t;y=wn(y),u=wn(u)}y=null}else y=null;x!==null&&ud(p,m,x,y,!1),w!==null&&d!==null&&ud(p,d,w,y,!0)}}e:{if(m=f?Ln(f):window,x=m.nodeName&&m.nodeName.toLowerCase(),x==="select"||x==="input"&&m.type==="file")var b=Gm;else if(rd(m))if(sp)b=e_;else{b=Ym;var C=Xm}else(x=m.nodeName)&&x.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(b=Zm);if(b&&(b=b(e,f))){np(p,b,r,_);break e}C&&C(e,m,f),e==="focusout"&&(C=m._wrapperState)&&C.controlled&&m.type==="number"&&_l(m,"number",m.value)}switch(C=f?Ln(f):window,e){case"focusin":(rd(C)||C.contentEditable==="true")&&(Tn=C,Dl=f,Qs=null);break;case"focusout":Qs=Dl=Tn=null;break;case"mousedown":Ll=!0;break;case"contextmenu":case"mouseup":case"dragend":Ll=!1,ad(p,r,_);break;case"selectionchange":if(n_)break;case"keydown":case"keyup":ad(p,r,_)}var E;if(Jc)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Rn?tp(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(ep&&r.locale!=="ko"&&(Rn||S!=="onCompositionStart"?S==="onCompositionEnd"&&Rn&&(E=Zf()):(kr=_,$c="value"in kr?kr.value:kr.textContent,Rn=!0)),C=Do(f,S),0<C.length&&(S=new Yu(S,e,null,r,_),p.push({event:S,listeners:C}),E?S.data=E:(E=rp(r),E!==null&&(S.data=E)))),(E=Jm?qm(e,r):Km(e,r))&&(f=Do(f,"onBeforeInput"),0<f.length&&(_=new Yu("onBeforeInput","beforeinput",null,r,_),p.push({event:_,listeners:f}),_.data=E))}pp(p,t)})}function ci(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Do(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,c=s.stateNode;s.tag===5&&c!==null&&(s=c,c=ri(e,r),c!=null&&n.unshift(ci(e,c,s)),c=ri(e,t),c!=null&&n.push(ci(e,c,s))),e=e.return}return n}function wn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ud(e,t,r,n,s){for(var c=t._reactName,g=[];r!==null&&r!==n;){var o=r,a=o.alternate,f=o.stateNode;if(a!==null&&a===n)break;o.tag===5&&f!==null&&(o=f,s?(a=ri(r,c),a!=null&&g.unshift(ci(r,a,o))):s||(a=ri(r,c),a!=null&&g.push(ci(r,a,o)))),r=r.return}g.length!==0&&e.push({event:t,listeners:g})}var a_=/\r\n?/g,l_=/\u0000|\uFFFD/g;function dd(e){return(typeof e=="string"?e:""+e).replace(a_,`
38
+ `).replace(l_,"")}function Ui(e,t,r){if(t=dd(t),dd(e)!==t&&r)throw Error(q(425))}function Lo(){}var Ml=null,Pl=null;function Bl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Al=typeof setTimeout=="function"?setTimeout:void 0,c_=typeof clearTimeout=="function"?clearTimeout:void 0,hd=typeof Promise=="function"?Promise:void 0,u_=typeof queueMicrotask=="function"?queueMicrotask:typeof hd<"u"?function(e){return hd.resolve(null).then(e).catch(d_)}:Al;function d_(e){setTimeout(function(){throw e})}function Ha(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),ii(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);ii(t)}function Lr(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==="$?")break;if(t==="/$")return null}}return e}function fd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var vs=Math.random().toString(36).slice(2),Nt="__reactFiber$"+vs,ui="__reactProps$"+vs,sr="__reactContainer$"+vs,Il="__reactEvents$"+vs,h_="__reactListeners$"+vs,f_="__reactHandles$"+vs;function Kr(e){var t=e[Nt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[sr]||r[Nt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=fd(e);e!==null;){if(r=e[Nt])return r;e=fd(e)}return t}e=r,r=e.parentNode}return null}function Ri(e){return e=e[Nt]||e[sr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ln(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(q(33))}function ia(e){return e[ui]||null}var Ol=[],Mn=-1;function Hr(e){return{current:e}}function ge(e){0>Mn||(e.current=Ol[Mn],Ol[Mn]=null,Mn--)}function fe(e,t){Mn++,Ol[Mn]=e.current,e.current=t}var Fr={},He=Hr(Fr),et=Hr(!1),dn=Fr;function as(e,t){var r=e.type.contextTypes;if(!r)return Fr;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},c;for(c in r)s[c]=t[c];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function tt(e){return e=e.childContextTypes,e!=null}function Mo(){ge(et),ge(He)}function pd(e,t,r){if(He.current!==Fr)throw Error(q(168));fe(He,t),fe(et,r)}function vp(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(q(108,Xv(e)||"Unknown",s));return xe({},r,n)}function Po(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Fr,dn=He.current,fe(He,e),fe(et,et.current),!0}function gd(e,t,r){var n=e.stateNode;if(!n)throw Error(q(169));r?(e=vp(e,t,dn),n.__reactInternalMemoizedMergedChildContext=e,ge(et),ge(He),fe(He,e)):ge(et),fe(et,r)}var Jt=null,oa=!1,za=!1;function mp(e){Jt===null?Jt=[e]:Jt.push(e)}function p_(e){oa=!0,mp(e)}function zr(){if(!za&&Jt!==null){za=!0;var e=0,t=he;try{var r=Jt;for(he=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Jt=null,oa=!1}catch(s){throw Jt!==null&&(Jt=Jt.slice(e+1)),$f(Fc,zr),s}finally{he=t,za=!1}}return null}var Pn=[],Bn=0,Bo=null,Ao=0,gt=[],vt=0,hn=null,Yt=1,Zt="";function Wr(e,t){Pn[Bn++]=Ao,Pn[Bn++]=Bo,Bo=e,Ao=t}function _p(e,t,r){gt[vt++]=Yt,gt[vt++]=Zt,gt[vt++]=hn,hn=e;var n=Yt;e=Zt;var s=32-Tt(n)-1;n&=~(1<<s),r+=1;var c=32-Tt(t)+s;if(30<c){var g=s-s%5;c=(n&(1<<g)-1).toString(32),n>>=g,s-=g,Yt=1<<32-Tt(t)+s|r<<s|n,Zt=c+e}else Yt=1<<c|r<<s|n,Zt=e}function Kc(e){e.return!==null&&(Wr(e,1),_p(e,1,0))}function Vc(e){for(;e===Bo;)Bo=Pn[--Bn],Pn[Bn]=null,Ao=Pn[--Bn],Pn[Bn]=null;for(;e===hn;)hn=gt[--vt],gt[vt]=null,Zt=gt[--vt],gt[vt]=null,Yt=gt[--vt],gt[vt]=null}var lt=null,at=null,ve=!1,Rt=null;function yp(e,t){var r=yt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function vd(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,lt=e,at=Lr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,lt=e,at=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=hn!==null?{id:Yt,overflow:Zt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=yt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,lt=e,at=null,!0):!1;default:return!1}}function Fl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Nl(e){if(ve){var t=at;if(t){var r=t;if(!vd(e,t)){if(Fl(e))throw Error(q(418));t=Lr(r.nextSibling);var n=lt;t&&vd(e,t)?yp(n,r):(e.flags=e.flags&-4097|2,ve=!1,lt=e)}}else{if(Fl(e))throw Error(q(418));e.flags=e.flags&-4097|2,ve=!1,lt=e}}}function md(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;lt=e}function Ji(e){if(e!==lt)return!1;if(!ve)return md(e),ve=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Bl(e.type,e.memoizedProps)),t&&(t=at)){if(Fl(e))throw xp(),Error(q(418));for(;t;)yp(e,t),t=Lr(t.nextSibling)}if(md(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){at=Lr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}at=null}}else at=lt?Lr(e.stateNode.nextSibling):null;return!0}function xp(){for(var e=at;e;)e=Lr(e.nextSibling)}function ls(){at=lt=null,ve=!1}function Qc(e){Rt===null?Rt=[e]:Rt.push(e)}var g_=ar.ReactCurrentBatchConfig;function Ds(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(q(309));var n=r.stateNode}if(!n)throw Error(q(147,e));var s=n,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(g){var o=s.refs;g===null?delete o[c]:o[c]=g},t._stringRef=c,t)}if(typeof e!="string")throw Error(q(284));if(!r._owner)throw Error(q(290,e))}return e}function qi(e,t){throw e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function _d(e){var t=e._init;return t(e._payload)}function Sp(e){function t(u,l){if(e){var h=u.deletions;h===null?(u.deletions=[l],u.flags|=16):h.push(l)}}function r(u,l){if(!e)return null;for(;l!==null;)t(u,l),l=l.sibling;return null}function n(u,l){for(u=new Map;l!==null;)l.key!==null?u.set(l.key,l):u.set(l.index,l),l=l.sibling;return u}function s(u,l){return u=Ar(u,l),u.index=0,u.sibling=null,u}function c(u,l,h){return u.index=h,e?(h=u.alternate,h!==null?(h=h.index,h<l?(u.flags|=2,l):h):(u.flags|=2,l)):(u.flags|=1048576,l)}function g(u){return e&&u.alternate===null&&(u.flags|=2),u}function o(u,l,h,v){return l===null||l.tag!==6?(l=Va(h,u.mode,v),l.return=u,l):(l=s(l,h),l.return=u,l)}function a(u,l,h,v){var b=h.type;return b===jn?_(u,l,h.props.children,v,h.key):l!==null&&(l.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===hr&&_d(b)===l.type)?(v=s(l,h.props),v.ref=Ds(u,l,h),v.return=u,v):(v=xo(h.type,h.key,h.props,null,u.mode,v),v.ref=Ds(u,l,h),v.return=u,v)}function f(u,l,h,v){return l===null||l.tag!==4||l.stateNode.containerInfo!==h.containerInfo||l.stateNode.implementation!==h.implementation?(l=Qa(h,u.mode,v),l.return=u,l):(l=s(l,h.children||[]),l.return=u,l)}function _(u,l,h,v,b){return l===null||l.tag!==7?(l=cn(h,u.mode,v,b),l.return=u,l):(l=s(l,h),l.return=u,l)}function p(u,l,h){if(typeof l=="string"&&l!==""||typeof l=="number")return l=Va(""+l,u.mode,h),l.return=u,l;if(typeof l=="object"&&l!==null){switch(l.$$typeof){case Ai:return h=xo(l.type,l.key,l.props,null,u.mode,h),h.ref=Ds(u,null,l),h.return=u,h;case En:return l=Qa(l,u.mode,h),l.return=u,l;case hr:var v=l._init;return p(u,v(l._payload),h)}if(Hs(l)||ks(l))return l=cn(l,u.mode,h,null),l.return=u,l;qi(u,l)}return null}function m(u,l,h,v){var b=l!==null?l.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return b!==null?null:o(u,l,""+h,v);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Ai:return h.key===b?a(u,l,h,v):null;case En:return h.key===b?f(u,l,h,v):null;case hr:return b=h._init,m(u,l,b(h._payload),v)}if(Hs(h)||ks(h))return b!==null?null:_(u,l,h,v,null);qi(u,h)}return null}function x(u,l,h,v,b){if(typeof v=="string"&&v!==""||typeof v=="number")return u=u.get(h)||null,o(l,u,""+v,b);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ai:return u=u.get(v.key===null?h:v.key)||null,a(l,u,v,b);case En:return u=u.get(v.key===null?h:v.key)||null,f(l,u,v,b);case hr:var C=v._init;return x(u,l,h,C(v._payload),b)}if(Hs(v)||ks(v))return u=u.get(h)||null,_(l,u,v,b,null);qi(l,v)}return null}function w(u,l,h,v){for(var b=null,C=null,E=l,S=l=0,k=null;E!==null&&S<h.length;S++){E.index>S?(k=E,E=null):k=E.sibling;var T=m(u,E,h[S],v);if(T===null){E===null&&(E=k);break}e&&E&&T.alternate===null&&t(u,E),l=c(T,l,S),C===null?b=T:C.sibling=T,C=T,E=k}if(S===h.length)return r(u,E),ve&&Wr(u,S),b;if(E===null){for(;S<h.length;S++)E=p(u,h[S],v),E!==null&&(l=c(E,l,S),C===null?b=E:C.sibling=E,C=E);return ve&&Wr(u,S),b}for(E=n(u,E);S<h.length;S++)k=x(E,u,S,h[S],v),k!==null&&(e&&k.alternate!==null&&E.delete(k.key===null?S:k.key),l=c(k,l,S),C===null?b=k:C.sibling=k,C=k);return e&&E.forEach(function(P){return t(u,P)}),ve&&Wr(u,S),b}function y(u,l,h,v){var b=ks(h);if(typeof b!="function")throw Error(q(150));if(h=b.call(h),h==null)throw Error(q(151));for(var C=b=null,E=l,S=l=0,k=null,T=h.next();E!==null&&!T.done;S++,T=h.next()){E.index>S?(k=E,E=null):k=E.sibling;var P=m(u,E,T.value,v);if(P===null){E===null&&(E=k);break}e&&E&&P.alternate===null&&t(u,E),l=c(P,l,S),C===null?b=P:C.sibling=P,C=P,E=k}if(T.done)return r(u,E),ve&&Wr(u,S),b;if(E===null){for(;!T.done;S++,T=h.next())T=p(u,T.value,v),T!==null&&(l=c(T,l,S),C===null?b=T:C.sibling=T,C=T);return ve&&Wr(u,S),b}for(E=n(u,E);!T.done;S++,T=h.next())T=x(E,u,S,T.value,v),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?S:T.key),l=c(T,l,S),C===null?b=T:C.sibling=T,C=T);return e&&E.forEach(function(L){return t(u,L)}),ve&&Wr(u,S),b}function d(u,l,h,v){if(typeof h=="object"&&h!==null&&h.type===jn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Ai:e:{for(var b=h.key,C=l;C!==null;){if(C.key===b){if(b=h.type,b===jn){if(C.tag===7){r(u,C.sibling),l=s(C,h.props.children),l.return=u,u=l;break e}}else if(C.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===hr&&_d(b)===C.type){r(u,C.sibling),l=s(C,h.props),l.ref=Ds(u,C,h),l.return=u,u=l;break e}r(u,C);break}else t(u,C);C=C.sibling}h.type===jn?(l=cn(h.props.children,u.mode,v,h.key),l.return=u,u=l):(v=xo(h.type,h.key,h.props,null,u.mode,v),v.ref=Ds(u,l,h),v.return=u,u=v)}return g(u);case En:e:{for(C=h.key;l!==null;){if(l.key===C)if(l.tag===4&&l.stateNode.containerInfo===h.containerInfo&&l.stateNode.implementation===h.implementation){r(u,l.sibling),l=s(l,h.children||[]),l.return=u,u=l;break e}else{r(u,l);break}else t(u,l);l=l.sibling}l=Qa(h,u.mode,v),l.return=u,u=l}return g(u);case hr:return C=h._init,d(u,l,C(h._payload),v)}if(Hs(h))return w(u,l,h,v);if(ks(h))return y(u,l,h,v);qi(u,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,l!==null&&l.tag===6?(r(u,l.sibling),l=s(l,h),l.return=u,u=l):(r(u,l),l=Va(h,u.mode,v),l.return=u,u=l),g(u)):r(u,l)}return d}var cs=Sp(!0),bp=Sp(!1),Io=Hr(null),Oo=null,An=null,Gc=null;function Xc(){Gc=An=Oo=null}function Yc(e){var t=Io.current;ge(Io),e._currentValue=t}function Hl(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Wn(e,t){Oo=e,Gc=An=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ze=!0),e.firstContext=null)}function St(e){var t=e._currentValue;if(Gc!==e)if(e={context:e,memoizedValue:t,next:null},An===null){if(Oo===null)throw Error(q(308));An=e,Oo.dependencies={lanes:0,firstContext:e}}else An=An.next=e;return t}var Vr=null;function Zc(e){Vr===null?Vr=[e]:Vr.push(e)}function wp(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Zc(t)):(r.next=s.next,s.next=r),t.interleaved=r,ir(e,n)}function ir(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var fr=!1;function eu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function er(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Mr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ae&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,ir(e,r)}return s=n.interleaved,s===null?(t.next=t,Zc(n)):(t.next=s.next,s.next=t),n.interleaved=t,ir(e,r)}function po(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Nc(e,r)}}function yd(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var g={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};c===null?s=c=g:c=c.next=g,r=r.next}while(r!==null);c===null?s=c=t:c=c.next=t}else s=c=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Fo(e,t,r,n){var s=e.updateQueue;fr=!1;var c=s.firstBaseUpdate,g=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var a=o,f=a.next;a.next=null,g===null?c=f:g.next=f,g=a;var _=e.alternate;_!==null&&(_=_.updateQueue,o=_.lastBaseUpdate,o!==g&&(o===null?_.firstBaseUpdate=f:o.next=f,_.lastBaseUpdate=a))}if(c!==null){var p=s.baseState;g=0,_=f=a=null,o=c;do{var m=o.lane,x=o.eventTime;if((n&m)===m){_!==null&&(_=_.next={eventTime:x,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var w=e,y=o;switch(m=t,x=r,y.tag){case 1:if(w=y.payload,typeof w=="function"){p=w.call(x,p,m);break e}p=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=y.payload,m=typeof w=="function"?w.call(x,p,m):w,m==null)break e;p=xe({},p,m);break e;case 2:fr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[o]:m.push(o))}else x={eventTime:x,lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},_===null?(f=_=x,a=p):_=_.next=x,g|=m;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;m=o,o=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(_===null&&(a=p),s.baseState=a,s.firstBaseUpdate=f,s.lastBaseUpdate=_,t=s.shared.interleaved,t!==null){s=t;do g|=s.lane,s=s.next;while(s!==t)}else c===null&&(s.shared.lanes=0);pn|=g,e.lanes=g,e.memoizedState=p}}function xd(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(q(191,s));s.call(n)}}}var Ti={},$t=Hr(Ti),di=Hr(Ti),hi=Hr(Ti);function Qr(e){if(e===Ti)throw Error(q(174));return e}function tu(e,t){switch(fe(hi,t),fe(di,e),fe($t,Ti),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:xl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=xl(t,e)}ge($t),fe($t,t)}function us(){ge($t),ge(di),ge(hi)}function kp(e){Qr(hi.current);var t=Qr($t.current),r=xl(t,e.type);t!==r&&(fe(di,e),fe($t,r))}function ru(e){di.current===e&&(ge($t),ge(di))}var _e=Hr(0);function No(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var $a=[];function nu(){for(var e=0;e<$a.length;e++)$a[e]._workInProgressVersionPrimary=null;$a.length=0}var go=ar.ReactCurrentDispatcher,Wa=ar.ReactCurrentBatchConfig,fn=0,ye=null,ke=null,Te=null,Ho=!1,Gs=!1,fi=0,v_=0;function Ie(){throw Error(q(321))}function su(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Mt(e[r],t[r]))return!1;return!0}function iu(e,t,r,n,s,c){if(fn=c,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,go.current=e===null||e.memoizedState===null?x_:S_,e=r(n,s),Gs){c=0;do{if(Gs=!1,fi=0,25<=c)throw Error(q(301));c+=1,Te=ke=null,t.updateQueue=null,go.current=b_,e=r(n,s)}while(Gs)}if(go.current=zo,t=ke!==null&&ke.next!==null,fn=0,Te=ke=ye=null,Ho=!1,t)throw Error(q(300));return e}function ou(){var e=fi!==0;return fi=0,e}function At(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Te===null?ye.memoizedState=Te=e:Te=Te.next=e,Te}function bt(){if(ke===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var t=Te===null?ye.memoizedState:Te.next;if(t!==null)Te=t,ke=e;else{if(e===null)throw Error(q(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},Te===null?ye.memoizedState=Te=e:Te=Te.next=e}return Te}function pi(e,t){return typeof t=="function"?t(e):t}function Ua(e){var t=bt(),r=t.queue;if(r===null)throw Error(q(311));r.lastRenderedReducer=e;var n=ke,s=n.baseQueue,c=r.pending;if(c!==null){if(s!==null){var g=s.next;s.next=c.next,c.next=g}n.baseQueue=s=c,r.pending=null}if(s!==null){c=s.next,n=n.baseState;var o=g=null,a=null,f=c;do{var _=f.lane;if((fn&_)===_)a!==null&&(a=a.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),n=f.hasEagerState?f.eagerState:e(n,f.action);else{var p={lane:_,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};a===null?(o=a=p,g=n):a=a.next=p,ye.lanes|=_,pn|=_}f=f.next}while(f!==null&&f!==c);a===null?g=n:a.next=o,Mt(n,t.memoizedState)||(Ze=!0),t.memoizedState=n,t.baseState=g,t.baseQueue=a,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do c=s.lane,ye.lanes|=c,pn|=c,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ja(e){var t=bt(),r=t.queue;if(r===null)throw Error(q(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,c=t.memoizedState;if(s!==null){r.pending=null;var g=s=s.next;do c=e(c,g.action),g=g.next;while(g!==s);Mt(c,t.memoizedState)||(Ze=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),r.lastRenderedState=c}return[c,n]}function Ep(){}function jp(e,t){var r=ye,n=bt(),s=t(),c=!Mt(n.memoizedState,s);if(c&&(n.memoizedState=s,Ze=!0),n=n.queue,au(Dp.bind(null,r,n,e),[e]),n.getSnapshot!==t||c||Te!==null&&Te.memoizedState.tag&1){if(r.flags|=2048,gi(9,Tp.bind(null,r,n,s,t),void 0,null),De===null)throw Error(q(349));fn&30||Rp(r,t,s)}return s}function Rp(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Tp(e,t,r,n){t.value=r,t.getSnapshot=n,Lp(t)&&Mp(e)}function Dp(e,t,r){return r(function(){Lp(t)&&Mp(e)})}function Lp(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Mt(e,r)}catch{return!0}}function Mp(e){var t=ir(e,1);t!==null&&Dt(t,e,1,-1)}function Sd(e){var t=At();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pi,lastRenderedState:e},t.queue=e,e=e.dispatch=y_.bind(null,ye,e),[t.memoizedState,e]}function gi(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Pp(){return bt().memoizedState}function vo(e,t,r,n){var s=At();ye.flags|=e,s.memoizedState=gi(1|t,r,void 0,n===void 0?null:n)}function aa(e,t,r,n){var s=bt();n=n===void 0?null:n;var c=void 0;if(ke!==null){var g=ke.memoizedState;if(c=g.destroy,n!==null&&su(n,g.deps)){s.memoizedState=gi(t,r,c,n);return}}ye.flags|=e,s.memoizedState=gi(1|t,r,c,n)}function bd(e,t){return vo(8390656,8,e,t)}function au(e,t){return aa(2048,8,e,t)}function Bp(e,t){return aa(4,2,e,t)}function Ap(e,t){return aa(4,4,e,t)}function Ip(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Op(e,t,r){return r=r!=null?r.concat([e]):null,aa(4,4,Ip.bind(null,t,e),r)}function lu(){}function Fp(e,t){var r=bt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&su(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Np(e,t){var r=bt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&su(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Hp(e,t,r){return fn&21?(Mt(r,t)||(r=Jf(),ye.lanes|=r,pn|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ze=!0),e.memoizedState=r)}function m_(e,t){var r=he;he=r!==0&&4>r?r:4,e(!0);var n=Wa.transition;Wa.transition={};try{e(!1),t()}finally{he=r,Wa.transition=n}}function zp(){return bt().memoizedState}function __(e,t,r){var n=Br(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},$p(e))Wp(t,r);else if(r=wp(e,t,r,n),r!==null){var s=Je();Dt(r,e,n,s),Up(r,t,n)}}function y_(e,t,r){var n=Br(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if($p(e))Wp(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var g=t.lastRenderedState,o=c(g,r);if(s.hasEagerState=!0,s.eagerState=o,Mt(o,g)){var a=t.interleaved;a===null?(s.next=s,Zc(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}r=wp(e,t,s,n),r!==null&&(s=Je(),Dt(r,e,n,s),Up(r,t,n))}}function $p(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function Wp(e,t){Gs=Ho=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Up(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Nc(e,r)}}var zo={readContext:St,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useInsertionEffect:Ie,useLayoutEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useMutableSource:Ie,useSyncExternalStore:Ie,useId:Ie,unstable_isNewReconciler:!1},x_={readContext:St,useCallback:function(e,t){return At().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:bd,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,vo(4194308,4,Ip.bind(null,t,e),r)},useLayoutEffect:function(e,t){return vo(4194308,4,e,t)},useInsertionEffect:function(e,t){return vo(4,2,e,t)},useMemo:function(e,t){var r=At();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=At();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=__.bind(null,ye,e),[n.memoizedState,e]},useRef:function(e){var t=At();return e={current:e},t.memoizedState=e},useState:Sd,useDebugValue:lu,useDeferredValue:function(e){return At().memoizedState=e},useTransition:function(){var e=Sd(!1),t=e[0];return e=m_.bind(null,e[1]),At().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ye,s=At();if(ve){if(r===void 0)throw Error(q(407));r=r()}else{if(r=t(),De===null)throw Error(q(349));fn&30||Rp(n,t,r)}s.memoizedState=r;var c={value:r,getSnapshot:t};return s.queue=c,bd(Dp.bind(null,n,c,e),[e]),n.flags|=2048,gi(9,Tp.bind(null,n,c,r,t),void 0,null),r},useId:function(){var e=At(),t=De.identifierPrefix;if(ve){var r=Zt,n=Yt;r=(n&~(1<<32-Tt(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=fi++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=v_++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},S_={readContext:St,useCallback:Fp,useContext:St,useEffect:au,useImperativeHandle:Op,useInsertionEffect:Bp,useLayoutEffect:Ap,useMemo:Np,useReducer:Ua,useRef:Pp,useState:function(){return Ua(pi)},useDebugValue:lu,useDeferredValue:function(e){var t=bt();return Hp(t,ke.memoizedState,e)},useTransition:function(){var e=Ua(pi)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Ep,useSyncExternalStore:jp,useId:zp,unstable_isNewReconciler:!1},b_={readContext:St,useCallback:Fp,useContext:St,useEffect:au,useImperativeHandle:Op,useInsertionEffect:Bp,useLayoutEffect:Ap,useMemo:Np,useReducer:Ja,useRef:Pp,useState:function(){return Ja(pi)},useDebugValue:lu,useDeferredValue:function(e){var t=bt();return ke===null?t.memoizedState=e:Hp(t,ke.memoizedState,e)},useTransition:function(){var e=Ja(pi)[0],t=bt().memoizedState;return[e,t]},useMutableSource:Ep,useSyncExternalStore:jp,useId:zp,unstable_isNewReconciler:!1};function kt(e,t){if(e&&e.defaultProps){t=xe({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function zl(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:xe({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var la={isMounted:function(e){return(e=e._reactInternals)?_n(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Je(),s=Br(e),c=er(n,s);c.payload=t,r!=null&&(c.callback=r),t=Mr(e,c,s),t!==null&&(Dt(t,e,s,n),po(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Je(),s=Br(e),c=er(n,s);c.tag=1,c.payload=t,r!=null&&(c.callback=r),t=Mr(e,c,s),t!==null&&(Dt(t,e,s,n),po(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Je(),n=Br(e),s=er(r,n);s.tag=2,t!=null&&(s.callback=t),t=Mr(e,s,n),t!==null&&(Dt(t,e,n,r),po(t,e,n))}};function wd(e,t,r,n,s,c,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,c,g):t.prototype&&t.prototype.isPureReactComponent?!ai(r,n)||!ai(s,c):!0}function Jp(e,t,r){var n=!1,s=Fr,c=t.contextType;return typeof c=="object"&&c!==null?c=St(c):(s=tt(t)?dn:He.current,n=t.contextTypes,c=(n=n!=null)?as(e,s):Fr),t=new t(r,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=la,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=c),t}function Cd(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&la.enqueueReplaceState(t,t.state,null)}function $l(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},eu(e);var c=t.contextType;typeof c=="object"&&c!==null?s.context=St(c):(c=tt(t)?dn:He.current,s.context=as(e,c)),s.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(zl(e,t,c,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&la.enqueueReplaceState(s,s.state,null),Fo(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ds(e,t){try{var r="",n=t;do r+=Gv(n),n=n.return;while(n);var s=r}catch(c){s=`
39
+ Error generating stack: `+c.message+`
40
+ `+c.stack}return{value:e,source:t,stack:s,digest:null}}function qa(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Wl(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var w_=typeof WeakMap=="function"?WeakMap:Map;function qp(e,t,r){r=er(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Wo||(Wo=!0,Zl=n),Wl(e,t)},r}function Kp(e,t,r){r=er(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Wl(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(r.callback=function(){Wl(e,t),typeof n!="function"&&(Pr===null?Pr=new Set([this]):Pr.add(this));var g=t.stack;this.componentDidCatch(t.value,{componentStack:g!==null?g:""})}),r}function kd(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new w_;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=O_.bind(null,e,t,r),t.then(e,e))}function Ed(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function jd(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=er(-1,1),t.tag=2,Mr(r,t,1))),r.lanes|=1),e)}var C_=ar.ReactCurrentOwner,Ze=!1;function $e(e,t,r,n){t.child=e===null?bp(t,null,r,n):cs(t,e.child,r,n)}function Rd(e,t,r,n,s){r=r.render;var c=t.ref;return Wn(t,s),n=iu(e,t,r,n,c,s),r=ou(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,or(e,t,s)):(ve&&r&&Kc(t),t.flags|=1,$e(e,t,n,s),t.child)}function Td(e,t,r,n,s){if(e===null){var c=r.type;return typeof c=="function"&&!vu(c)&&c.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=c,Vp(e,t,c,n,s)):(e=xo(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!(e.lanes&s)){var g=c.memoizedProps;if(r=r.compare,r=r!==null?r:ai,r(g,n)&&e.ref===t.ref)return or(e,t,s)}return t.flags|=1,e=Ar(c,n),e.ref=t.ref,e.return=t,t.child=e}function Vp(e,t,r,n,s){if(e!==null){var c=e.memoizedProps;if(ai(c,n)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=n=c,(e.lanes&s)!==0)e.flags&131072&&(Ze=!0);else return t.lanes=e.lanes,or(e,t,s)}return Ul(e,t,r,n,s)}function Qp(e,t,r){var n=t.pendingProps,s=n.children,c=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(On,nt),nt|=r;else{if(!(r&1073741824))return e=c!==null?c.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(On,nt),nt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=c!==null?c.baseLanes:r,fe(On,nt),nt|=n}else c!==null?(n=c.baseLanes|r,t.memoizedState=null):n=r,fe(On,nt),nt|=n;return $e(e,t,s,r),t.child}function Gp(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ul(e,t,r,n,s){var c=tt(r)?dn:He.current;return c=as(t,c),Wn(t,s),r=iu(e,t,r,n,c,s),n=ou(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,or(e,t,s)):(ve&&n&&Kc(t),t.flags|=1,$e(e,t,r,s),t.child)}function Dd(e,t,r,n,s){if(tt(r)){var c=!0;Po(t)}else c=!1;if(Wn(t,s),t.stateNode===null)mo(e,t),Jp(t,r,n),$l(t,r,n,s),n=!0;else if(e===null){var g=t.stateNode,o=t.memoizedProps;g.props=o;var a=g.context,f=r.contextType;typeof f=="object"&&f!==null?f=St(f):(f=tt(r)?dn:He.current,f=as(t,f));var _=r.getDerivedStateFromProps,p=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function";p||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(o!==n||a!==f)&&Cd(t,g,n,f),fr=!1;var m=t.memoizedState;g.state=m,Fo(t,n,g,s),a=t.memoizedState,o!==n||m!==a||et.current||fr?(typeof _=="function"&&(zl(t,r,_,n),a=t.memoizedState),(o=fr||wd(t,r,o,n,m,a,f))?(p||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(t.flags|=4194308)):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=a),g.props=n,g.state=a,g.context=f,n=o):(typeof g.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{g=t.stateNode,Cp(e,t),o=t.memoizedProps,f=t.type===t.elementType?o:kt(t.type,o),g.props=f,p=t.pendingProps,m=g.context,a=r.contextType,typeof a=="object"&&a!==null?a=St(a):(a=tt(r)?dn:He.current,a=as(t,a));var x=r.getDerivedStateFromProps;(_=typeof x=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(o!==p||m!==a)&&Cd(t,g,n,a),fr=!1,m=t.memoizedState,g.state=m,Fo(t,n,g,s);var w=t.memoizedState;o!==p||m!==w||et.current||fr?(typeof x=="function"&&(zl(t,r,x,n),w=t.memoizedState),(f=fr||wd(t,r,f,n,m,w,a)||!1)?(_||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(n,w,a),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(n,w,a)),typeof g.componentDidUpdate=="function"&&(t.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof g.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=w),g.props=n,g.state=w,g.context=a,n=f):(typeof g.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return Jl(e,t,r,n,c,s)}function Jl(e,t,r,n,s,c){Gp(e,t);var g=(t.flags&128)!==0;if(!n&&!g)return s&&gd(t,r,!1),or(e,t,c);n=t.stateNode,C_.current=t;var o=g&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&g?(t.child=cs(t,e.child,null,c),t.child=cs(t,null,o,c)):$e(e,t,o,c),t.memoizedState=n.state,s&&gd(t,r,!0),t.child}function Xp(e){var t=e.stateNode;t.pendingContext?pd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&pd(e,t.context,!1),tu(e,t.containerInfo)}function Ld(e,t,r,n,s){return ls(),Qc(s),t.flags|=256,$e(e,t,r,n),t.child}var ql={dehydrated:null,treeContext:null,retryLane:0};function Kl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Yp(e,t,r){var n=t.pendingProps,s=_e.current,c=!1,g=(t.flags&128)!==0,o;if((o=g)||(o=e!==null&&e.memoizedState===null?!1:(s&2)!==0),o?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),fe(_e,s&1),e===null)return Nl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(g=n.children,e=n.fallback,c?(n=t.mode,c=t.child,g={mode:"hidden",children:g},!(n&1)&&c!==null?(c.childLanes=0,c.pendingProps=g):c=da(g,n,0,null),e=cn(e,n,r,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=Kl(r),t.memoizedState=ql,e):cu(t,g));if(s=e.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return k_(e,t,g,n,o,s,r);if(c){c=n.fallback,g=t.mode,s=e.child,o=s.sibling;var a={mode:"hidden",children:n.children};return!(g&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=a,t.deletions=null):(n=Ar(s,a),n.subtreeFlags=s.subtreeFlags&14680064),o!==null?c=Ar(o,c):(c=cn(c,g,r,null),c.flags|=2),c.return=t,n.return=t,n.sibling=c,t.child=n,n=c,c=t.child,g=e.child.memoizedState,g=g===null?Kl(r):{baseLanes:g.baseLanes|r,cachePool:null,transitions:g.transitions},c.memoizedState=g,c.childLanes=e.childLanes&~r,t.memoizedState=ql,n}return c=e.child,e=c.sibling,n=Ar(c,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function cu(e,t){return t=da({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ki(e,t,r,n){return n!==null&&Qc(n),cs(t,e.child,null,r),e=cu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function k_(e,t,r,n,s,c,g){if(r)return t.flags&256?(t.flags&=-257,n=qa(Error(q(422))),Ki(e,t,g,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=n.fallback,s=t.mode,n=da({mode:"visible",children:n.children},s,0,null),c=cn(c,s,g,null),c.flags|=2,n.return=t,c.return=t,n.sibling=c,t.child=n,t.mode&1&&cs(t,e.child,null,g),t.child.memoizedState=Kl(g),t.memoizedState=ql,c);if(!(t.mode&1))return Ki(e,t,g,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var o=n.dgst;return n=o,c=Error(q(419)),n=qa(c,n,void 0),Ki(e,t,g,n)}if(o=(g&e.childLanes)!==0,Ze||o){if(n=De,n!==null){switch(g&-g){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|g)?0:s,s!==0&&s!==c.retryLane&&(c.retryLane=s,ir(e,s),Dt(n,e,s,-1))}return gu(),n=qa(Error(q(421))),Ki(e,t,g,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=F_.bind(null,e),s._reactRetry=t,null):(e=c.treeContext,at=Lr(s.nextSibling),lt=t,ve=!0,Rt=null,e!==null&&(gt[vt++]=Yt,gt[vt++]=Zt,gt[vt++]=hn,Yt=e.id,Zt=e.overflow,hn=t),t=cu(t,n.children),t.flags|=4096,t)}function Md(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Hl(e.return,t,r)}function Ka(e,t,r,n,s){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=n,c.tail=r,c.tailMode=s)}function Zp(e,t,r){var n=t.pendingProps,s=n.revealOrder,c=n.tail;if($e(e,t,n.children,r),n=_e.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Md(e,r,t);else if(e.tag===19)Md(e,r,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}n&=1}if(fe(_e,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&No(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Ka(t,!1,s,r,c);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&No(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Ka(t,!0,r,null,c);break;case"together":Ka(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function mo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function or(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),pn|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,r=Ar(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ar(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function E_(e,t,r){switch(t.tag){case 3:Xp(t),ls();break;case 5:kp(t);break;case 1:tt(t.type)&&Po(t);break;case 4:tu(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;fe(Io,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(fe(_e,_e.current&1),t.flags|=128,null):r&t.child.childLanes?Yp(e,t,r):(fe(_e,_e.current&1),e=or(e,t,r),e!==null?e.sibling:null);fe(_e,_e.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Zp(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),fe(_e,_e.current),n)break;return null;case 22:case 23:return t.lanes=0,Qp(e,t,r)}return or(e,t,r)}var eg,Vl,tg,rg;eg=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Vl=function(){};tg=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,Qr($t.current);var c=null;switch(r){case"input":s=vl(e,s),n=vl(e,n),c=[];break;case"select":s=xe({},s,{value:void 0}),n=xe({},n,{value:void 0}),c=[];break;case"textarea":s=yl(e,s),n=yl(e,n),c=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Lo)}Sl(r,n);var g;r=null;for(f in s)if(!n.hasOwnProperty(f)&&s.hasOwnProperty(f)&&s[f]!=null)if(f==="style"){var o=s[f];for(g in o)o.hasOwnProperty(g)&&(r||(r={}),r[g]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(ei.hasOwnProperty(f)?c||(c=[]):(c=c||[]).push(f,null));for(f in n){var a=n[f];if(o=s!=null?s[f]:void 0,n.hasOwnProperty(f)&&a!==o&&(a!=null||o!=null))if(f==="style")if(o){for(g in o)!o.hasOwnProperty(g)||a&&a.hasOwnProperty(g)||(r||(r={}),r[g]="");for(g in a)a.hasOwnProperty(g)&&o[g]!==a[g]&&(r||(r={}),r[g]=a[g])}else r||(c||(c=[]),c.push(f,r)),r=a;else f==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,o=o?o.__html:void 0,a!=null&&o!==a&&(c=c||[]).push(f,a)):f==="children"?typeof a!="string"&&typeof a!="number"||(c=c||[]).push(f,""+a):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(ei.hasOwnProperty(f)?(a!=null&&f==="onScroll"&&pe("scroll",e),c||o===a||(c=[])):(c=c||[]).push(f,a))}r&&(c=c||[]).push("style",r);var f=c;(t.updateQueue=f)&&(t.flags|=4)}};rg=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ls(e,t){if(!ve)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Oe(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function j_(e,t,r){var n=t.pendingProps;switch(Vc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return tt(t.type)&&Mo(),Oe(t),null;case 3:return n=t.stateNode,us(),ge(et),ge(He),nu(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ji(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Rt!==null&&(rc(Rt),Rt=null))),Vl(e,t),Oe(t),null;case 5:ru(t);var s=Qr(hi.current);if(r=t.type,e!==null&&t.stateNode!=null)tg(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(q(166));return Oe(t),null}if(e=Qr($t.current),Ji(t)){n=t.stateNode,r=t.type;var c=t.memoizedProps;switch(n[Nt]=t,n[ui]=c,e=(t.mode&1)!==0,r){case"dialog":pe("cancel",n),pe("close",n);break;case"iframe":case"object":case"embed":pe("load",n);break;case"video":case"audio":for(s=0;s<$s.length;s++)pe($s[s],n);break;case"source":pe("error",n);break;case"img":case"image":case"link":pe("error",n),pe("load",n);break;case"details":pe("toggle",n);break;case"input":zu(n,c),pe("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!c.multiple},pe("invalid",n);break;case"textarea":Wu(n,c),pe("invalid",n)}Sl(r,c),s=null;for(var g in c)if(c.hasOwnProperty(g)){var o=c[g];g==="children"?typeof o=="string"?n.textContent!==o&&(c.suppressHydrationWarning!==!0&&Ui(n.textContent,o,e),s=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(c.suppressHydrationWarning!==!0&&Ui(n.textContent,o,e),s=["children",""+o]):ei.hasOwnProperty(g)&&o!=null&&g==="onScroll"&&pe("scroll",n)}switch(r){case"input":Ii(n),$u(n,c,!0);break;case"textarea":Ii(n),Uu(n);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(n.onclick=Lo)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{g=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Df(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=g.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=g.createElement(r,{is:n.is}):(e=g.createElement(r),r==="select"&&(g=e,n.multiple?g.multiple=!0:n.size&&(g.size=n.size))):e=g.createElementNS(e,r),e[Nt]=t,e[ui]=n,eg(e,t,!1,!1),t.stateNode=e;e:{switch(g=bl(r,n),r){case"dialog":pe("cancel",e),pe("close",e),s=n;break;case"iframe":case"object":case"embed":pe("load",e),s=n;break;case"video":case"audio":for(s=0;s<$s.length;s++)pe($s[s],e);s=n;break;case"source":pe("error",e),s=n;break;case"img":case"image":case"link":pe("error",e),pe("load",e),s=n;break;case"details":pe("toggle",e),s=n;break;case"input":zu(e,n),s=vl(e,n),pe("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=xe({},n,{value:void 0}),pe("invalid",e);break;case"textarea":Wu(e,n),s=yl(e,n),pe("invalid",e);break;default:s=n}Sl(r,s),o=s;for(c in o)if(o.hasOwnProperty(c)){var a=o[c];c==="style"?Pf(e,a):c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Lf(e,a)):c==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&ti(e,a):typeof a=="number"&&ti(e,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ei.hasOwnProperty(c)?a!=null&&c==="onScroll"&&pe("scroll",e):a!=null&&Pc(e,c,a,g))}switch(r){case"input":Ii(e),$u(e,n,!1);break;case"textarea":Ii(e),Uu(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Or(n.value));break;case"select":e.multiple=!!n.multiple,c=n.value,c!=null?Nn(e,!!n.multiple,c,!1):n.defaultValue!=null&&Nn(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Lo)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Oe(t),null;case 6:if(e&&t.stateNode!=null)rg(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(q(166));if(r=Qr(hi.current),Qr($t.current),Ji(t)){if(n=t.stateNode,r=t.memoizedProps,n[Nt]=t,(c=n.nodeValue!==r)&&(e=lt,e!==null))switch(e.tag){case 3:Ui(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ui(n.nodeValue,r,(e.mode&1)!==0)}c&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Nt]=t,t.stateNode=n}return Oe(t),null;case 13:if(ge(_e),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ve&&at!==null&&t.mode&1&&!(t.flags&128))xp(),ls(),t.flags|=98560,c=!1;else if(c=Ji(t),n!==null&&n.dehydrated!==null){if(e===null){if(!c)throw Error(q(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(q(317));c[Nt]=t}else ls(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oe(t),c=!1}else Rt!==null&&(rc(Rt),Rt=null),c=!0;if(!c)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||_e.current&1?je===0&&(je=3):gu())),t.updateQueue!==null&&(t.flags|=4),Oe(t),null);case 4:return us(),Vl(e,t),e===null&&li(t.stateNode.containerInfo),Oe(t),null;case 10:return Yc(t.type._context),Oe(t),null;case 17:return tt(t.type)&&Mo(),Oe(t),null;case 19:if(ge(_e),c=t.memoizedState,c===null)return Oe(t),null;if(n=(t.flags&128)!==0,g=c.rendering,g===null)if(n)Ls(c,!1);else{if(je!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(g=No(e),g!==null){for(t.flags|=128,Ls(c,!1),n=g.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)c=r,e=n,c.flags&=14680066,g=c.alternate,g===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=g.childLanes,c.lanes=g.lanes,c.child=g.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=g.memoizedProps,c.memoizedState=g.memoizedState,c.updateQueue=g.updateQueue,c.type=g.type,e=g.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return fe(_e,_e.current&1|2),t.child}e=e.sibling}c.tail!==null&&we()>hs&&(t.flags|=128,n=!0,Ls(c,!1),t.lanes=4194304)}else{if(!n)if(e=No(g),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ls(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!ve)return Oe(t),null}else 2*we()-c.renderingStartTime>hs&&r!==1073741824&&(t.flags|=128,n=!0,Ls(c,!1),t.lanes=4194304);c.isBackwards?(g.sibling=t.child,t.child=g):(r=c.last,r!==null?r.sibling=g:t.child=g,c.last=g)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=we(),t.sibling=null,r=_e.current,fe(_e,n?r&1|2:r&1),t):(Oe(t),null);case 22:case 23:return pu(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?nt&1073741824&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),null;case 24:return null;case 25:return null}throw Error(q(156,t.tag))}function R_(e,t){switch(Vc(t),t.tag){case 1:return tt(t.type)&&Mo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return us(),ge(et),ge(He),nu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ru(t),null;case 13:if(ge(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ge(_e),null;case 4:return us(),null;case 10:return Yc(t.type._context),null;case 22:case 23:return pu(),null;case 24:return null;default:return null}}var Vi=!1,Ne=!1,T_=typeof WeakSet=="function"?WeakSet:Set,G=null;function In(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){be(e,t,n)}else r.current=null}function Ql(e,t,r){try{r()}catch(n){be(e,t,n)}}var Pd=!1;function D_(e,t){if(Ml=Ro,e=ap(),qc(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,c=n.focusNode;n=n.focusOffset;try{r.nodeType,c.nodeType}catch{r=null;break e}var g=0,o=-1,a=-1,f=0,_=0,p=e,m=null;t:for(;;){for(var x;p!==r||s!==0&&p.nodeType!==3||(o=g+s),p!==c||n!==0&&p.nodeType!==3||(a=g+n),p.nodeType===3&&(g+=p.nodeValue.length),(x=p.firstChild)!==null;)m=p,p=x;for(;;){if(p===e)break t;if(m===r&&++f===s&&(o=g),m===c&&++_===n&&(a=g),(x=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=x}r=o===-1||a===-1?null:{start:o,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(Pl={focusedElem:e,selectionRange:r},Ro=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var y=w.memoizedProps,d=w.memoizedState,u=t.stateNode,l=u.getSnapshotBeforeUpdate(t.elementType===t.type?y:kt(t.type,y),d);u.__reactInternalSnapshotBeforeUpdate=l}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(v){be(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=Pd,Pd=!1,w}function Xs(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var c=s.destroy;s.destroy=void 0,c!==void 0&&Ql(t,r,c)}s=s.next}while(s!==n)}}function ca(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Gl(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function ng(e){var t=e.alternate;t!==null&&(e.alternate=null,ng(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nt],delete t[ui],delete t[Il],delete t[h_],delete t[f_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sg(e){return e.tag===5||e.tag===3||e.tag===4}function Bd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sg(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.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 Xl(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Lo));else if(n!==4&&(e=e.child,e!==null))for(Xl(e,t,r),e=e.sibling;e!==null;)Xl(e,t,r),e=e.sibling}function Yl(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Yl(e,t,r),e=e.sibling;e!==null;)Yl(e,t,r),e=e.sibling}var Me=null,jt=!1;function ur(e,t,r){for(r=r.child;r!==null;)ig(e,t,r),r=r.sibling}function ig(e,t,r){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(ta,r)}catch{}switch(r.tag){case 5:Ne||In(r,t);case 6:var n=Me,s=jt;Me=null,ur(e,t,r),Me=n,jt=s,Me!==null&&(jt?(e=Me,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Me.removeChild(r.stateNode));break;case 18:Me!==null&&(jt?(e=Me,r=r.stateNode,e.nodeType===8?Ha(e.parentNode,r):e.nodeType===1&&Ha(e,r),ii(e)):Ha(Me,r.stateNode));break;case 4:n=Me,s=jt,Me=r.stateNode.containerInfo,jt=!0,ur(e,t,r),Me=n,jt=s;break;case 0:case 11:case 14:case 15:if(!Ne&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var c=s,g=c.destroy;c=c.tag,g!==void 0&&(c&2||c&4)&&Ql(r,t,g),s=s.next}while(s!==n)}ur(e,t,r);break;case 1:if(!Ne&&(In(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){be(r,t,o)}ur(e,t,r);break;case 21:ur(e,t,r);break;case 22:r.mode&1?(Ne=(n=Ne)||r.memoizedState!==null,ur(e,t,r),Ne=n):ur(e,t,r);break;default:ur(e,t,r)}}function Ad(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new T_),t.forEach(function(n){var s=N_.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Ct(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var c=e,g=t,o=g;e:for(;o!==null;){switch(o.tag){case 5:Me=o.stateNode,jt=!1;break e;case 3:Me=o.stateNode.containerInfo,jt=!0;break e;case 4:Me=o.stateNode.containerInfo,jt=!0;break e}o=o.return}if(Me===null)throw Error(q(160));ig(c,g,s),Me=null,jt=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(f){be(s,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)og(t,e),t=t.sibling}function og(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ct(t,e),Bt(e),n&4){try{Xs(3,e,e.return),ca(3,e)}catch(y){be(e,e.return,y)}try{Xs(5,e,e.return)}catch(y){be(e,e.return,y)}}break;case 1:Ct(t,e),Bt(e),n&512&&r!==null&&In(r,r.return);break;case 5:if(Ct(t,e),Bt(e),n&512&&r!==null&&In(r,r.return),e.flags&32){var s=e.stateNode;try{ti(s,"")}catch(y){be(e,e.return,y)}}if(n&4&&(s=e.stateNode,s!=null)){var c=e.memoizedProps,g=r!==null?r.memoizedProps:c,o=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{o==="input"&&c.type==="radio"&&c.name!=null&&Rf(s,c),bl(o,g);var f=bl(o,c);for(g=0;g<a.length;g+=2){var _=a[g],p=a[g+1];_==="style"?Pf(s,p):_==="dangerouslySetInnerHTML"?Lf(s,p):_==="children"?ti(s,p):Pc(s,_,p,f)}switch(o){case"input":ml(s,c);break;case"textarea":Tf(s,c);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!c.multiple;var x=c.value;x!=null?Nn(s,!!c.multiple,x,!1):m!==!!c.multiple&&(c.defaultValue!=null?Nn(s,!!c.multiple,c.defaultValue,!0):Nn(s,!!c.multiple,c.multiple?[]:"",!1))}s[ui]=c}catch(y){be(e,e.return,y)}}break;case 6:if(Ct(t,e),Bt(e),n&4){if(e.stateNode===null)throw Error(q(162));s=e.stateNode,c=e.memoizedProps;try{s.nodeValue=c}catch(y){be(e,e.return,y)}}break;case 3:if(Ct(t,e),Bt(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ii(t.containerInfo)}catch(y){be(e,e.return,y)}break;case 4:Ct(t,e),Bt(e);break;case 13:Ct(t,e),Bt(e),s=e.child,s.flags&8192&&(c=s.memoizedState!==null,s.stateNode.isHidden=c,!c||s.alternate!==null&&s.alternate.memoizedState!==null||(hu=we())),n&4&&Ad(e);break;case 22:if(_=r!==null&&r.memoizedState!==null,e.mode&1?(Ne=(f=Ne)||_,Ct(t,e),Ne=f):Ct(t,e),Bt(e),n&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!_&&e.mode&1)for(G=e,_=e.child;_!==null;){for(p=G=_;G!==null;){switch(m=G,x=m.child,m.tag){case 0:case 11:case 14:case 15:Xs(4,m,m.return);break;case 1:In(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){n=m,r=m.return;try{t=n,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(y){be(n,r,y)}}break;case 5:In(m,m.return);break;case 22:if(m.memoizedState!==null){Od(p);continue}}x!==null?(x.return=m,G=x):Od(p)}_=_.sibling}e:for(_=null,p=e;;){if(p.tag===5){if(_===null){_=p;try{s=p.stateNode,f?(c=s.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(o=p.stateNode,a=p.memoizedProps.style,g=a!=null&&a.hasOwnProperty("display")?a.display:null,o.style.display=Mf("display",g))}catch(y){be(e,e.return,y)}}}else if(p.tag===6){if(_===null)try{p.stateNode.nodeValue=f?"":p.memoizedProps}catch(y){be(e,e.return,y)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;_===p&&(_=null),p=p.return}_===p&&(_=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Ct(t,e),Bt(e),n&4&&Ad(e);break;case 21:break;default:Ct(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(sg(r)){var n=r;break e}r=r.return}throw Error(q(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(ti(s,""),n.flags&=-33);var c=Bd(e);Yl(e,c,s);break;case 3:case 4:var g=n.stateNode.containerInfo,o=Bd(e);Xl(e,o,g);break;default:throw Error(q(161))}}catch(a){be(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function L_(e,t,r){G=e,ag(e)}function ag(e,t,r){for(var n=(e.mode&1)!==0;G!==null;){var s=G,c=s.child;if(s.tag===22&&n){var g=s.memoizedState!==null||Vi;if(!g){var o=s.alternate,a=o!==null&&o.memoizedState!==null||Ne;o=Vi;var f=Ne;if(Vi=g,(Ne=a)&&!f)for(G=s;G!==null;)g=G,a=g.child,g.tag===22&&g.memoizedState!==null?Fd(s):a!==null?(a.return=g,G=a):Fd(s);for(;c!==null;)G=c,ag(c),c=c.sibling;G=s,Vi=o,Ne=f}Id(e)}else s.subtreeFlags&8772&&c!==null?(c.return=s,G=c):Id(e)}}function Id(e){for(;G!==null;){var t=G;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ne||ca(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Ne)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:kt(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&xd(t,c,n);break;case 3:var g=t.updateQueue;if(g!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}xd(t,g,r)}break;case 5:var o=t.stateNode;if(r===null&&t.flags&4){r=o;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var _=f.memoizedState;if(_!==null){var p=_.dehydrated;p!==null&&ii(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}Ne||t.flags&512&&Gl(t)}catch(m){be(t,t.return,m)}}if(t===e){G=null;break}if(r=t.sibling,r!==null){r.return=t.return,G=r;break}G=t.return}}function Od(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var r=t.sibling;if(r!==null){r.return=t.return,G=r;break}G=t.return}}function Fd(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ca(4,t)}catch(a){be(t,r,a)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(a){be(t,s,a)}}var c=t.return;try{Gl(t)}catch(a){be(t,c,a)}break;case 5:var g=t.return;try{Gl(t)}catch(a){be(t,g,a)}}}catch(a){be(t,t.return,a)}if(t===e){G=null;break}var o=t.sibling;if(o!==null){o.return=t.return,G=o;break}G=t.return}}var M_=Math.ceil,$o=ar.ReactCurrentDispatcher,uu=ar.ReactCurrentOwner,xt=ar.ReactCurrentBatchConfig,ae=0,De=null,Ce=null,Be=0,nt=0,On=Hr(0),je=0,vi=null,pn=0,ua=0,du=0,Ys=null,Ye=null,hu=0,hs=1/0,Ut=null,Wo=!1,Zl=null,Pr=null,Qi=!1,Er=null,Uo=0,Zs=0,ec=null,_o=-1,yo=0;function Je(){return ae&6?we():_o!==-1?_o:_o=we()}function Br(e){return e.mode&1?ae&2&&Be!==0?Be&-Be:g_.transition!==null?(yo===0&&(yo=Jf()),yo):(e=he,e!==0||(e=window.event,e=e===void 0?16:Yf(e.type)),e):1}function Dt(e,t,r,n){if(50<Zs)throw Zs=0,ec=null,Error(q(185));Ei(e,r,n),(!(ae&2)||e!==De)&&(e===De&&(!(ae&2)&&(ua|=r),je===4&&gr(e,Be)),rt(e,n),r===1&&ae===0&&!(t.mode&1)&&(hs=we()+500,oa&&zr()))}function rt(e,t){var r=e.callbackNode;gm(e,t);var n=jo(e,e===De?Be:0);if(n===0)r!==null&&Ku(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Ku(r),t===1)e.tag===0?p_(Nd.bind(null,e)):mp(Nd.bind(null,e)),u_(function(){!(ae&6)&&zr()}),r=null;else{switch(qf(n)){case 1:r=Fc;break;case 4:r=Wf;break;case 16:r=Eo;break;case 536870912:r=Uf;break;default:r=Eo}r=gg(r,lg.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function lg(e,t){if(_o=-1,yo=0,ae&6)throw Error(q(327));var r=e.callbackNode;if(Un()&&e.callbackNode!==r)return null;var n=jo(e,e===De?Be:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Jo(e,n);else{t=n;var s=ae;ae|=2;var c=ug();(De!==e||Be!==t)&&(Ut=null,hs=we()+500,ln(e,t));do try{A_();break}catch(o){cg(e,o)}while(!0);Xc(),$o.current=c,ae=s,Ce!==null?t=0:(De=null,Be=0,t=je)}if(t!==0){if(t===2&&(s=jl(e),s!==0&&(n=s,t=tc(e,s))),t===1)throw r=vi,ln(e,0),gr(e,n),rt(e,we()),r;if(t===6)gr(e,n);else{if(s=e.current.alternate,!(n&30)&&!P_(s)&&(t=Jo(e,n),t===2&&(c=jl(e),c!==0&&(n=c,t=tc(e,c))),t===1))throw r=vi,ln(e,0),gr(e,n),rt(e,we()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(q(345));case 2:Ur(e,Ye,Ut);break;case 3:if(gr(e,n),(n&130023424)===n&&(t=hu+500-we(),10<t)){if(jo(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Je(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Al(Ur.bind(null,e,Ye,Ut),t);break}Ur(e,Ye,Ut);break;case 4:if(gr(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var g=31-Tt(n);c=1<<g,g=t[g],g>s&&(s=g),n&=~c}if(n=s,n=we()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*M_(n/1960))-n,10<n){e.timeoutHandle=Al(Ur.bind(null,e,Ye,Ut),n);break}Ur(e,Ye,Ut);break;case 5:Ur(e,Ye,Ut);break;default:throw Error(q(329))}}}return rt(e,we()),e.callbackNode===r?lg.bind(null,e):null}function tc(e,t){var r=Ys;return e.current.memoizedState.isDehydrated&&(ln(e,t).flags|=256),e=Jo(e,t),e!==2&&(t=Ye,Ye=r,t!==null&&rc(t)),e}function rc(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function P_(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],c=s.getSnapshot;s=s.value;try{if(!Mt(c(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 gr(e,t){for(t&=~du,t&=~ua,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Tt(t),n=1<<r;e[r]=-1,t&=~n}}function Nd(e){if(ae&6)throw Error(q(327));Un();var t=jo(e,0);if(!(t&1))return rt(e,we()),null;var r=Jo(e,t);if(e.tag!==0&&r===2){var n=jl(e);n!==0&&(t=n,r=tc(e,n))}if(r===1)throw r=vi,ln(e,0),gr(e,t),rt(e,we()),r;if(r===6)throw Error(q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ur(e,Ye,Ut),rt(e,we()),null}function fu(e,t){var r=ae;ae|=1;try{return e(t)}finally{ae=r,ae===0&&(hs=we()+500,oa&&zr())}}function gn(e){Er!==null&&Er.tag===0&&!(ae&6)&&Un();var t=ae;ae|=1;var r=xt.transition,n=he;try{if(xt.transition=null,he=1,e)return e()}finally{he=n,xt.transition=r,ae=t,!(ae&6)&&zr()}}function pu(){nt=On.current,ge(On)}function ln(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,c_(r)),Ce!==null)for(r=Ce.return;r!==null;){var n=r;switch(Vc(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Mo();break;case 3:us(),ge(et),ge(He),nu();break;case 5:ru(n);break;case 4:us();break;case 13:ge(_e);break;case 19:ge(_e);break;case 10:Yc(n.type._context);break;case 22:case 23:pu()}r=r.return}if(De=e,Ce=e=Ar(e.current,null),Be=nt=t,je=0,vi=null,du=ua=pn=0,Ye=Ys=null,Vr!==null){for(t=0;t<Vr.length;t++)if(r=Vr[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,c=r.pending;if(c!==null){var g=c.next;c.next=s,n.next=g}r.pending=n}Vr=null}return e}function cg(e,t){do{var r=Ce;try{if(Xc(),go.current=zo,Ho){for(var n=ye.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Ho=!1}if(fn=0,Te=ke=ye=null,Gs=!1,fi=0,uu.current=null,r===null||r.return===null){je=1,vi=t,Ce=null;break}e:{var c=e,g=r.return,o=r,a=t;if(t=Be,o.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var f=a,_=o,p=_.tag;if(!(_.mode&1)&&(p===0||p===11||p===15)){var m=_.alternate;m?(_.updateQueue=m.updateQueue,_.memoizedState=m.memoizedState,_.lanes=m.lanes):(_.updateQueue=null,_.memoizedState=null)}var x=Ed(g);if(x!==null){x.flags&=-257,jd(x,g,o,c,t),x.mode&1&&kd(c,f,t),t=x,a=f;var w=t.updateQueue;if(w===null){var y=new Set;y.add(a),t.updateQueue=y}else w.add(a);break e}else{if(!(t&1)){kd(c,f,t),gu();break e}a=Error(q(426))}}else if(ve&&o.mode&1){var d=Ed(g);if(d!==null){!(d.flags&65536)&&(d.flags|=256),jd(d,g,o,c,t),Qc(ds(a,o));break e}}c=a=ds(a,o),je!==4&&(je=2),Ys===null?Ys=[c]:Ys.push(c),c=g;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var u=qp(c,a,t);yd(c,u);break e;case 1:o=a;var l=c.type,h=c.stateNode;if(!(c.flags&128)&&(typeof l.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Pr===null||!Pr.has(h)))){c.flags|=65536,t&=-t,c.lanes|=t;var v=Kp(c,o,t);yd(c,v);break e}}c=c.return}while(c!==null)}hg(r)}catch(b){t=b,Ce===r&&r!==null&&(Ce=r=r.return);continue}break}while(!0)}function ug(){var e=$o.current;return $o.current=zo,e===null?zo:e}function gu(){(je===0||je===3||je===2)&&(je=4),De===null||!(pn&268435455)&&!(ua&268435455)||gr(De,Be)}function Jo(e,t){var r=ae;ae|=2;var n=ug();(De!==e||Be!==t)&&(Ut=null,ln(e,t));do try{B_();break}catch(s){cg(e,s)}while(!0);if(Xc(),ae=r,$o.current=n,Ce!==null)throw Error(q(261));return De=null,Be=0,je}function B_(){for(;Ce!==null;)dg(Ce)}function A_(){for(;Ce!==null&&!om();)dg(Ce)}function dg(e){var t=pg(e.alternate,e,nt);e.memoizedProps=e.pendingProps,t===null?hg(e):Ce=t,uu.current=null}function hg(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=R_(r,t),r!==null){r.flags&=32767,Ce=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{je=6,Ce=null;return}}else if(r=j_(r,t,nt),r!==null){Ce=r;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);je===0&&(je=5)}function Ur(e,t,r){var n=he,s=xt.transition;try{xt.transition=null,he=1,I_(e,t,r,n)}finally{xt.transition=s,he=n}return null}function I_(e,t,r,n){do Un();while(Er!==null);if(ae&6)throw Error(q(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(q(177));e.callbackNode=null,e.callbackPriority=0;var c=r.lanes|r.childLanes;if(vm(e,c),e===De&&(Ce=De=null,Be=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Qi||(Qi=!0,gg(Eo,function(){return Un(),null})),c=(r.flags&15990)!==0,r.subtreeFlags&15990||c){c=xt.transition,xt.transition=null;var g=he;he=1;var o=ae;ae|=4,uu.current=null,D_(e,r),og(r,e),r_(Pl),Ro=!!Ml,Pl=Ml=null,e.current=r,L_(r),am(),ae=o,he=g,xt.transition=c}else e.current=r;if(Qi&&(Qi=!1,Er=e,Uo=s),c=e.pendingLanes,c===0&&(Pr=null),um(r.stateNode),rt(e,we()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(Wo)throw Wo=!1,e=Zl,Zl=null,e;return Uo&1&&e.tag!==0&&Un(),c=e.pendingLanes,c&1?e===ec?Zs++:(Zs=0,ec=e):Zs=0,zr(),null}function Un(){if(Er!==null){var e=qf(Uo),t=xt.transition,r=he;try{if(xt.transition=null,he=16>e?16:e,Er===null)var n=!1;else{if(e=Er,Er=null,Uo=0,ae&6)throw Error(q(331));var s=ae;for(ae|=4,G=e.current;G!==null;){var c=G,g=c.child;if(G.flags&16){var o=c.deletions;if(o!==null){for(var a=0;a<o.length;a++){var f=o[a];for(G=f;G!==null;){var _=G;switch(_.tag){case 0:case 11:case 15:Xs(8,_,c)}var p=_.child;if(p!==null)p.return=_,G=p;else for(;G!==null;){_=G;var m=_.sibling,x=_.return;if(ng(_),_===f){G=null;break}if(m!==null){m.return=x,G=m;break}G=x}}}var w=c.alternate;if(w!==null){var y=w.child;if(y!==null){w.child=null;do{var d=y.sibling;y.sibling=null,y=d}while(y!==null)}}G=c}}if(c.subtreeFlags&2064&&g!==null)g.return=c,G=g;else e:for(;G!==null;){if(c=G,c.flags&2048)switch(c.tag){case 0:case 11:case 15:Xs(9,c,c.return)}var u=c.sibling;if(u!==null){u.return=c.return,G=u;break e}G=c.return}}var l=e.current;for(G=l;G!==null;){g=G;var h=g.child;if(g.subtreeFlags&2064&&h!==null)h.return=g,G=h;else e:for(g=l;G!==null;){if(o=G,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:ca(9,o)}}catch(b){be(o,o.return,b)}if(o===g){G=null;break e}var v=o.sibling;if(v!==null){v.return=o.return,G=v;break e}G=o.return}}if(ae=s,zr(),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(ta,e)}catch{}n=!0}return n}finally{he=r,xt.transition=t}}return!1}function Hd(e,t,r){t=ds(r,t),t=qp(e,t,1),e=Mr(e,t,1),t=Je(),e!==null&&(Ei(e,1,t),rt(e,t))}function be(e,t,r){if(e.tag===3)Hd(e,e,r);else for(;t!==null;){if(t.tag===3){Hd(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Pr===null||!Pr.has(n))){e=ds(r,e),e=Kp(t,e,1),t=Mr(t,e,1),e=Je(),t!==null&&(Ei(t,1,e),rt(t,e));break}}t=t.return}}function O_(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Je(),e.pingedLanes|=e.suspendedLanes&r,De===e&&(Be&r)===r&&(je===4||je===3&&(Be&130023424)===Be&&500>we()-hu?ln(e,0):du|=r),rt(e,t)}function fg(e,t){t===0&&(e.mode&1?(t=Ni,Ni<<=1,!(Ni&130023424)&&(Ni=4194304)):t=1);var r=Je();e=ir(e,t),e!==null&&(Ei(e,t,r),rt(e,r))}function F_(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),fg(e,r)}function N_(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(q(314))}n!==null&&n.delete(t),fg(e,r)}var pg;pg=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||et.current)Ze=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ze=!1,E_(e,t,r);Ze=!!(e.flags&131072)}else Ze=!1,ve&&t.flags&1048576&&_p(t,Ao,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;mo(e,t),e=t.pendingProps;var s=as(t,He.current);Wn(t,r),s=iu(null,t,n,e,s,r);var c=ou();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tt(n)?(c=!0,Po(t)):c=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,eu(t),s.updater=la,t.stateNode=s,s._reactInternals=t,$l(t,n,e,r),t=Jl(null,t,n,!0,c,r)):(t.tag=0,ve&&c&&Kc(t),$e(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(mo(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=z_(n),e=kt(n,e),s){case 0:t=Ul(null,t,n,e,r);break e;case 1:t=Dd(null,t,n,e,r);break e;case 11:t=Rd(null,t,n,e,r);break e;case 14:t=Td(null,t,n,kt(n.type,e),r);break e}throw Error(q(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:kt(n,s),Ul(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:kt(n,s),Dd(e,t,n,s,r);case 3:e:{if(Xp(t),e===null)throw Error(q(387));n=t.pendingProps,c=t.memoizedState,s=c.element,Cp(e,t),Fo(t,n,null,r);var g=t.memoizedState;if(n=g.element,c.isDehydrated)if(c={element:n,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){s=ds(Error(q(423)),t),t=Ld(e,t,n,r,s);break e}else if(n!==s){s=ds(Error(q(424)),t),t=Ld(e,t,n,r,s);break e}else for(at=Lr(t.stateNode.containerInfo.firstChild),lt=t,ve=!0,Rt=null,r=bp(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ls(),n===s){t=or(e,t,r);break e}$e(e,t,n,r)}t=t.child}return t;case 5:return kp(t),e===null&&Nl(t),n=t.type,s=t.pendingProps,c=e!==null?e.memoizedProps:null,g=s.children,Bl(n,s)?g=null:c!==null&&Bl(n,c)&&(t.flags|=32),Gp(e,t),$e(e,t,g,r),t.child;case 6:return e===null&&Nl(t),null;case 13:return Yp(e,t,r);case 4:return tu(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=cs(t,null,n,r):$e(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:kt(n,s),Rd(e,t,n,s,r);case 7:return $e(e,t,t.pendingProps,r),t.child;case 8:return $e(e,t,t.pendingProps.children,r),t.child;case 12:return $e(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,c=t.memoizedProps,g=s.value,fe(Io,n._currentValue),n._currentValue=g,c!==null)if(Mt(c.value,g)){if(c.children===s.children&&!et.current){t=or(e,t,r);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var o=c.dependencies;if(o!==null){g=c.child;for(var a=o.firstContext;a!==null;){if(a.context===n){if(c.tag===1){a=er(-1,r&-r),a.tag=2;var f=c.updateQueue;if(f!==null){f=f.shared;var _=f.pending;_===null?a.next=a:(a.next=_.next,_.next=a),f.pending=a}}c.lanes|=r,a=c.alternate,a!==null&&(a.lanes|=r),Hl(c.return,r,t),o.lanes|=r;break}a=a.next}}else if(c.tag===10)g=c.type===t.type?null:c.child;else if(c.tag===18){if(g=c.return,g===null)throw Error(q(341));g.lanes|=r,o=g.alternate,o!==null&&(o.lanes|=r),Hl(g,r,t),g=c.sibling}else g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===t){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}$e(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Wn(t,r),s=St(s),n=n(s),t.flags|=1,$e(e,t,n,r),t.child;case 14:return n=t.type,s=kt(n,t.pendingProps),s=kt(n.type,s),Td(e,t,n,s,r);case 15:return Vp(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:kt(n,s),mo(e,t),t.tag=1,tt(n)?(e=!0,Po(t)):e=!1,Wn(t,r),Jp(t,n,s),$l(t,n,s,r),Jl(null,t,n,!0,e,r);case 19:return Zp(e,t,r);case 22:return Qp(e,t,r)}throw Error(q(156,t.tag))};function gg(e,t){return $f(e,t)}function H_(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,r,n){return new H_(e,t,r,n)}function vu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function z_(e){if(typeof e=="function")return vu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ac)return 11;if(e===Ic)return 14}return 2}function Ar(e,t){var r=e.alternate;return r===null?(r=yt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function xo(e,t,r,n,s,c){var g=2;if(n=e,typeof e=="function")vu(e)&&(g=1);else if(typeof e=="string")g=5;else e:switch(e){case jn:return cn(r.children,s,c,t);case Bc:g=8,s|=8;break;case hl:return e=yt(12,r,t,s|2),e.elementType=hl,e.lanes=c,e;case fl:return e=yt(13,r,t,s),e.elementType=fl,e.lanes=c,e;case pl:return e=yt(19,r,t,s),e.elementType=pl,e.lanes=c,e;case kf:return da(r,s,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case wf:g=10;break e;case Cf:g=9;break e;case Ac:g=11;break e;case Ic:g=14;break e;case hr:g=16,n=null;break e}throw Error(q(130,e==null?e:typeof e,""))}return t=yt(g,r,t,s),t.elementType=e,t.type=n,t.lanes=c,t}function cn(e,t,r,n){return e=yt(7,e,n,t),e.lanes=r,e}function da(e,t,r,n){return e=yt(22,e,n,t),e.elementType=kf,e.lanes=r,e.stateNode={isHidden:!1},e}function Va(e,t,r){return e=yt(6,e,null,t),e.lanes=r,e}function Qa(e,t,r){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $_(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ta(0),this.expirationTimes=Ta(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ta(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function mu(e,t,r,n,s,c,g,o,a){return e=new $_(e,t,r,o,a),t===1?(t=1,c===!0&&(t|=8)):t=0,c=yt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},eu(c),e}function W_(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:En,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function vg(e){if(!e)return Fr;e=e._reactInternals;e:{if(_n(e)!==e||e.tag!==1)throw Error(q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(q(171))}if(e.tag===1){var r=e.type;if(tt(r))return vp(e,r,t)}return t}function mg(e,t,r,n,s,c,g,o,a){return e=mu(r,n,!0,e,s,c,g,o,a),e.context=vg(null),r=e.current,n=Je(),s=Br(r),c=er(n,s),c.callback=t??null,Mr(r,c,s),e.current.lanes=s,Ei(e,s,n),rt(e,n),e}function ha(e,t,r,n){var s=t.current,c=Je(),g=Br(s);return r=vg(r),t.context===null?t.context=r:t.pendingContext=r,t=er(c,g),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Mr(s,t,g),e!==null&&(Dt(e,s,g,c),po(e,s,g)),g}function qo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function zd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function _u(e,t){zd(e,t),(e=e.alternate)&&zd(e,t)}function U_(){return null}var _g=typeof reportError=="function"?reportError:function(e){console.error(e)};function yu(e){this._internalRoot=e}fa.prototype.render=yu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));ha(e,t,null,null)};fa.prototype.unmount=yu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gn(function(){ha(null,e,null,null)}),t[sr]=null}};function fa(e){this._internalRoot=e}fa.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qf();e={blockedOn:null,target:e,priority:t};for(var r=0;r<pr.length&&t!==0&&t<pr[r].priority;r++);pr.splice(r,0,e),r===0&&Xf(e)}};function xu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function pa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function $d(){}function J_(e,t,r,n,s){if(s){if(typeof n=="function"){var c=n;n=function(){var f=qo(g);c.call(f)}}var g=mg(t,n,e,0,null,!1,!1,"",$d);return e._reactRootContainer=g,e[sr]=g.current,li(e.nodeType===8?e.parentNode:e),gn(),g}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var o=n;n=function(){var f=qo(a);o.call(f)}}var a=mu(e,0,!1,null,null,!1,!1,"",$d);return e._reactRootContainer=a,e[sr]=a.current,li(e.nodeType===8?e.parentNode:e),gn(function(){ha(t,a,r,n)}),a}function ga(e,t,r,n,s){var c=r._reactRootContainer;if(c){var g=c;if(typeof s=="function"){var o=s;s=function(){var a=qo(g);o.call(a)}}ha(t,g,e,s)}else g=J_(r,t,e,s,n);return qo(g)}Kf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=zs(t.pendingLanes);r!==0&&(Nc(t,r|1),rt(t,we()),!(ae&6)&&(hs=we()+500,zr()))}break;case 13:gn(function(){var n=ir(e,1);if(n!==null){var s=Je();Dt(n,e,1,s)}}),_u(e,1)}};Hc=function(e){if(e.tag===13){var t=ir(e,134217728);if(t!==null){var r=Je();Dt(t,e,134217728,r)}_u(e,134217728)}};Vf=function(e){if(e.tag===13){var t=Br(e),r=ir(e,t);if(r!==null){var n=Je();Dt(r,e,t,n)}_u(e,t)}};Qf=function(){return he};Gf=function(e,t){var r=he;try{return he=e,t()}finally{he=r}};Cl=function(e,t,r){switch(t){case"input":if(ml(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=ia(n);if(!s)throw Error(q(90));jf(n),ml(n,s)}}}break;case"textarea":Tf(e,r);break;case"select":t=r.value,t!=null&&Nn(e,!!r.multiple,t,!1)}};If=fu;Of=gn;var q_={usingClientEntryPoint:!1,Events:[Ri,Ln,ia,Bf,Af,fu]},Ms={findFiberByHostInstance:Kr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},K_={bundleType:Ms.bundleType,version:Ms.version,rendererPackageName:Ms.rendererPackageName,rendererConfig:Ms.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ar.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hf(e),e===null?null:e.stateNode},findFiberByHostInstance:Ms.findFiberByHostInstance||U_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gi.isDisabled&&Gi.supportsFiber)try{ta=Gi.inject(K_),zt=Gi}catch{}}ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q_;ut.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xu(t))throw Error(q(200));return W_(e,t,null,r)};ut.createRoot=function(e,t){if(!xu(e))throw Error(q(299));var r=!1,n="",s=_g;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=mu(e,1,!1,null,null,r,!1,n,s),e[sr]=t.current,li(e.nodeType===8?e.parentNode:e),new yu(t)};ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=Hf(t),e=e===null?null:e.stateNode,e};ut.flushSync=function(e){return gn(e)};ut.hydrate=function(e,t,r){if(!pa(t))throw Error(q(200));return ga(null,e,t,!0,r)};ut.hydrateRoot=function(e,t,r){if(!xu(e))throw Error(q(405));var n=r!=null&&r.hydratedSources||null,s=!1,c="",g=_g;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),t=mg(t,null,e,1,r??null,s,!1,c,g),e[sr]=t.current,li(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new fa(t)};ut.render=function(e,t,r){if(!pa(t))throw Error(q(200));return ga(null,e,t,!1,r)};ut.unmountComponentAtNode=function(e){if(!pa(e))throw Error(q(40));return e._reactRootContainer?(gn(function(){ga(null,null,e,!1,function(){e._reactRootContainer=null,e[sr]=null})}),!0):!1};ut.unstable_batchedUpdates=fu;ut.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!pa(r))throw Error(q(200));if(e==null||e._reactInternals===void 0)throw Error(q(38));return ga(e,t,r,!1,n)};ut.version="18.3.1-next-f1338f8080-20240426";function yg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yg)}catch(e){console.error(e)}}yg(),yf.exports=ut;var V_=yf.exports,Wd=V_;ul.createRoot=Wd.createRoot,ul.hydrateRoot=Wd.hydrateRoot;var ms=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Yr,vr,Kn,Qh,Q_=(Qh=class extends ms{constructor(){super();Z(this,Yr);Z(this,vr);Z(this,Kn);V(this,Kn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){A(this,vr)||this.setEventListener(A(this,Kn))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,vr))==null||t.call(this),V(this,vr,void 0))}setEventListener(t){var r;V(this,Kn,t),(r=A(this,vr))==null||r.call(this),V(this,vr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){A(this,Yr)!==t&&(V(this,Yr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof A(this,Yr)=="boolean"?A(this,Yr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Yr=new WeakMap,vr=new WeakMap,Kn=new WeakMap,Qh),Su=new Q_,G_={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},mr,Ec,Gh,X_=(Gh=class{constructor(){Z(this,mr,G_);Z(this,Ec,!1)}setTimeoutProvider(e){V(this,mr,e)}setTimeout(e,t){return A(this,mr).setTimeout(e,t)}clearTimeout(e){A(this,mr).clearTimeout(e)}setInterval(e,t){return A(this,mr).setInterval(e,t)}clearInterval(e){A(this,mr).clearInterval(e)}},mr=new WeakMap,Ec=new WeakMap,Gh),Gr=new X_;function Y_(e){setTimeout(e,0)}var Z_=typeof window>"u"||"Deno"in globalThis;function We(){}function ey(e,t){return typeof e=="function"?e(t):e}function nc(e){return typeof e=="number"&&e>=0&&e!==1/0}function xg(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ir(e,t){return typeof e=="function"?e(t):e}function it(e,t){return typeof e=="function"?e(t):e}function Ud(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:c,queryKey:g,stale:o}=e;if(g){if(n){if(t.queryHash!==bu(g,t.options))return!1}else if(!mi(t.queryKey,g))return!1}if(r!=="all"){const a=t.isActive();if(r==="active"&&!a||r==="inactive"&&a)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||c&&!c(t))}function Jd(e,t){const{exact:r,status:n,predicate:s,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(r){if(vn(t.options.mutationKey)!==vn(c))return!1}else if(!mi(t.options.mutationKey,c))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function bu(e,t){return((t==null?void 0:t.queryKeyHashFn)||vn)(e)}function vn(e){return JSON.stringify(e,(t,r)=>sc(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function mi(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>mi(e[r],t[r])):!1}var ty=Object.prototype.hasOwnProperty;function Sg(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=qd(e)&&qd(t);if(!n&&!(sc(e)&&sc(t)))return t;const c=(n?e:Object.keys(e)).length,g=n?t:Object.keys(t),o=g.length,a=n?new Array(o):{};let f=0;for(let _=0;_<o;_++){const p=n?_:g[_],m=e[p],x=t[p];if(m===x){a[p]=m,(n?_<c:ty.call(e,p))&&f++;continue}if(m===null||x===null||typeof m!="object"||typeof x!="object"){a[p]=x;continue}const w=Sg(m,x,r+1);a[p]=w,w===m&&f++}return c===o&&f===c?e:a}function Ko(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function qd(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function sc(e){if(!Kd(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Kd(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Kd(e){return Object.prototype.toString.call(e)==="[object Object]"}function ry(e){return new Promise(t=>{Gr.setTimeout(t,e)})}function ic(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Sg(e,t):t}function ny(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function sy(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var wu=Symbol();function bg(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===wu?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Cu(e,t){return typeof e=="function"?e(...t):!!e}function iy(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var _i=(()=>{let e=()=>Z_;return{isServer(){return e()},setIsServer(t){e=t}}})();function oc(){let e,t;const r=new Promise((s,c)=>{e=s,t=c});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var oy=Y_;function ay(){let e=[],t=0,r=o=>{o()},n=o=>{o()},s=oy;const c=o=>{t?e.push(o):s(()=>{r(o)})},g=()=>{const o=e;e=[],o.length&&s(()=>{n(()=>{o.forEach(a=>{r(a)})})})};return{batch:o=>{let a;t++;try{a=o()}finally{t--,t||g()}return a},batchCalls:o=>(...a)=>{c(()=>{o(...a)})},schedule:c,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{s=o}}}var Ee=ay(),Vn,_r,Qn,Xh,ly=(Xh=class extends ms{constructor(){super();Z(this,Vn,!0);Z(this,_r);Z(this,Qn);V(this,Qn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){A(this,_r)||this.setEventListener(A(this,Qn))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,_r))==null||t.call(this),V(this,_r,void 0))}setEventListener(t){var r;V(this,Qn,t),(r=A(this,_r))==null||r.call(this),V(this,_r,t(this.setOnline.bind(this)))}setOnline(t){A(this,Vn)!==t&&(V(this,Vn,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return A(this,Vn)}},Vn=new WeakMap,_r=new WeakMap,Qn=new WeakMap,Xh),Vo=new ly;function cy(e){return Math.min(1e3*2**e,3e4)}function wg(e){return(e??"online")==="online"?Vo.isOnline():!0}var ac=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Cg(e){let t=!1,r=0,n;const s=oc(),c=()=>s.status!=="pending",g=y=>{var d;if(!c()){const u=new ac(y);m(u),(d=e.onCancel)==null||d.call(e,u)}},o=()=>{t=!0},a=()=>{t=!1},f=()=>Su.isFocused()&&(e.networkMode==="always"||Vo.isOnline())&&e.canRun(),_=()=>wg(e.networkMode)&&e.canRun(),p=y=>{c()||(n==null||n(),s.resolve(y))},m=y=>{c()||(n==null||n(),s.reject(y))},x=()=>new Promise(y=>{var d;n=u=>{(c()||f())&&y(u)},(d=e.onPause)==null||d.call(e)}).then(()=>{var y;n=void 0,c()||(y=e.onContinue)==null||y.call(e)}),w=()=>{if(c())return;let y;const d=r===0?e.initialPromise:void 0;try{y=d??e.fn()}catch(u){y=Promise.reject(u)}Promise.resolve(y).then(p).catch(u=>{var C;if(c())return;const l=e.retry??(_i.isServer()?0:3),h=e.retryDelay??cy,v=typeof h=="function"?h(r,u):h,b=l===!0||typeof l=="number"&&r<l||typeof l=="function"&&l(r,u);if(t||!b){m(u);return}r++,(C=e.onFail)==null||C.call(e,r,u),ry(v).then(()=>f()?void 0:x()).then(()=>{t?m(u):w()})})};return{promise:s,status:()=>s.status,cancel:g,continue:()=>(n==null||n(),s),cancelRetry:o,continueRetry:a,canStart:_,start:()=>(_()?w():x().then(w),s)}}var Zr,Yh,kg=(Yh=class{constructor(){Z(this,Zr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nc(this.gcTime)&&V(this,Zr,Gr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_i.isServer()?1/0:5*60*1e3))}clearGcTimeout(){A(this,Zr)!==void 0&&(Gr.clearTimeout(A(this,Zr)),V(this,Zr,void 0))}},Zr=new WeakMap,Yh);function uy(e){return{onFetch:(t,r)=>{var _,p,m,x,w;const n=t.options,s=(m=(p=(_=t.fetchOptions)==null?void 0:_.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,c=((x=t.state.data)==null?void 0:x.pages)||[],g=((w=t.state.data)==null?void 0:w.pageParams)||[];let o={pages:[],pageParams:[]},a=0;const f=async()=>{let y=!1;const d=h=>{iy(h,()=>t.signal,()=>y=!0)},u=bg(t.options,t.fetchOptions),l=async(h,v,b)=>{if(y)return Promise.reject(t.signal.reason);if(v==null&&h.pages.length)return Promise.resolve(h);const E=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:v,direction:b?"backward":"forward",meta:t.options.meta};return d(P),P})(),S=await u(E),{maxPages:k}=t.options,T=b?sy:ny;return{pages:T(h.pages,S,k),pageParams:T(h.pageParams,v,k)}};if(s&&c.length){const h=s==="backward",v=h?dy:Vd,b={pages:c,pageParams:g},C=v(n,b);o=await l(b,C,h)}else{const h=e??c.length;do{const v=a===0?g[0]??n.initialPageParam:Vd(n,o);if(a>0&&v==null)break;o=await l(o,v),a++}while(a<h)}return o};t.options.persister?t.fetchFn=()=>{var y,d;return(d=(y=t.options).persister)==null?void 0:d.call(y,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=f}}}function Vd(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function dy(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Gn,en,Xn,pt,tn,Re,xi,rn,st,Eg,Wt,Zh,hy=(Zh=class extends kg{constructor(t){super();Z(this,st);Z(this,Gn);Z(this,en);Z(this,Xn);Z(this,pt);Z(this,tn);Z(this,Re);Z(this,xi);Z(this,rn);V(this,rn,!1),V(this,xi,t.defaultOptions),this.setOptions(t.options),this.observers=[],V(this,tn,t.client),V(this,pt,A(this,tn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,V(this,en,Gd(this.options)),this.state=t.state??A(this,en),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return A(this,Gn)}get promise(){var t;return(t=A(this,Re))==null?void 0:t.promise}setOptions(t){if(this.options={...A(this,xi),...t},t!=null&&t._type&&V(this,Gn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Gd(this.options);r.data!==void 0&&(this.setState(Qd(r.data,r.dataUpdatedAt)),V(this,en,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,pt).remove(this)}setData(t,r){const n=ic(this.state.data,t,this.options);return ne(this,st,Wt).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){ne(this,st,Wt).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=A(this,Re))==null?void 0:n.promise;return(s=A(this,Re))==null||s.cancel(t),r?r.then(We).catch(We):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return A(this,en)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>it(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===wu||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ir(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!xg(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,Re))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,Re))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),A(this,pt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(A(this,Re)&&(A(this,rn)||ne(this,st,Eg).call(this)?A(this,Re).cancel({revert:!0}):A(this,Re).cancelRetry()),this.scheduleGc()),A(this,pt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ne(this,st,Wt).call(this,{type:"invalidate"})}async fetch(t,r){var f,_,p,m,x,w,y,d,u,l,h;if(this.state.fetchStatus!=="idle"&&((f=A(this,Re))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(A(this,Re))return A(this,Re).continueRetry(),A(this,Re).promise}if(t&&this.setOptions(t),!this.options.queryFn){const v=this.observers.find(b=>b.options.queryFn);v&&this.setOptions(v.options)}const n=new AbortController,s=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(V(this,rn,!0),n.signal)})},c=()=>{const v=bg(this.options,r),C=(()=>{const E={client:A(this,tn),queryKey:this.queryKey,meta:this.meta};return s(E),E})();return V(this,rn,!1),this.options.persister?this.options.persister(v,C,this):v(C)},o=(()=>{const v={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:A(this,tn),state:this.state,fetchFn:c};return s(v),v})(),a=A(this,Gn)==="infinite"?uy(this.options.pages):this.options.behavior;a==null||a.onFetch(o,this),V(this,Xn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((_=o.fetchOptions)==null?void 0:_.meta))&&ne(this,st,Wt).call(this,{type:"fetch",meta:(p=o.fetchOptions)==null?void 0:p.meta}),V(this,Re,Cg({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,onCancel:v=>{v instanceof ac&&v.revert&&this.setState({...A(this,Xn),fetchStatus:"idle"}),n.abort()},onFail:(v,b)=>{ne(this,st,Wt).call(this,{type:"failed",failureCount:v,error:b})},onPause:()=>{ne(this,st,Wt).call(this,{type:"pause"})},onContinue:()=>{ne(this,st,Wt).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const v=await A(this,Re).start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),(x=(m=A(this,pt).config).onSuccess)==null||x.call(m,v,this),(y=(w=A(this,pt).config).onSettled)==null||y.call(w,v,this.state.error,this),v}catch(v){if(v instanceof ac){if(v.silent)return A(this,Re).promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw ne(this,st,Wt).call(this,{type:"error",error:v}),(u=(d=A(this,pt).config).onError)==null||u.call(d,v,this),(h=(l=A(this,pt).config).onSettled)==null||h.call(l,this.state.data,v,this),v}finally{this.scheduleGc()}}},Gn=new WeakMap,en=new WeakMap,Xn=new WeakMap,pt=new WeakMap,tn=new WeakMap,Re=new WeakMap,xi=new WeakMap,rn=new WeakMap,st=new WeakSet,Eg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Wt=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...jg(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Qd(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return V(this,Xn,t.manual?s:void 0),s;case"error":const c=t.error;return{...n,error:c,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ee.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),A(this,pt).notify({query:this,type:"updated",action:t})})},Zh);function jg(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wg(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Qd(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Gd(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ge,oe,Si,ze,nn,Yn,Vt,yr,bi,Zn,es,sn,on,xr,ts,ue,Ws,lc,cc,uc,dc,hc,fc,pc,Rg,ef,fy=(ef=class extends ms{constructor(t,r){super();Z(this,ue);Z(this,Ge);Z(this,oe);Z(this,Si);Z(this,ze);Z(this,nn);Z(this,Yn);Z(this,Vt);Z(this,yr);Z(this,bi);Z(this,Zn);Z(this,es);Z(this,sn);Z(this,on);Z(this,xr);Z(this,ts,new Set);this.options=r,V(this,Ge,t),V(this,yr,null),V(this,Vt,oc()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(A(this,oe).addObserver(this),Xd(A(this,oe),this.options)?ne(this,ue,Ws).call(this):this.updateResult(),ne(this,ue,dc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gc(A(this,oe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gc(A(this,oe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ne(this,ue,hc).call(this),ne(this,ue,fc).call(this),A(this,oe).removeObserver(this)}setOptions(t){const r=this.options,n=A(this,oe);if(this.options=A(this,Ge).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof it(this.options.enabled,A(this,oe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ne(this,ue,pc).call(this),A(this,oe).setOptions(this.options),r._defaulted&&!Ko(this.options,r)&&A(this,Ge).getQueryCache().notify({type:"observerOptionsUpdated",query:A(this,oe),observer:this});const s=this.hasListeners();s&&Yd(A(this,oe),n,this.options,r)&&ne(this,ue,Ws).call(this),this.updateResult(),s&&(A(this,oe)!==n||it(this.options.enabled,A(this,oe))!==it(r.enabled,A(this,oe))||Ir(this.options.staleTime,A(this,oe))!==Ir(r.staleTime,A(this,oe)))&&ne(this,ue,lc).call(this);const c=ne(this,ue,cc).call(this);s&&(A(this,oe)!==n||it(this.options.enabled,A(this,oe))!==it(r.enabled,A(this,oe))||c!==A(this,xr))&&ne(this,ue,uc).call(this,c)}getOptimisticResult(t){const r=A(this,Ge).getQueryCache().build(A(this,Ge),t),n=this.createResult(r,t);return gy(this,n)&&(V(this,ze,n),V(this,Yn,this.options),V(this,nn,A(this,oe).state)),n}getCurrentResult(){return A(this,ze)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&A(this,Vt).status==="pending"&&A(this,Vt).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){A(this,ts).add(t)}getCurrentQuery(){return A(this,oe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=A(this,Ge).defaultQueryOptions(t),n=A(this,Ge).getQueryCache().build(A(this,Ge),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ne(this,ue,Ws).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),A(this,ze)))}createResult(t,r){var k;const n=A(this,oe),s=this.options,c=A(this,ze),g=A(this,nn),o=A(this,Yn),f=t!==n?t.state:A(this,Si),{state:_}=t;let p={..._},m=!1,x;if(r._optimisticResults){const T=this.hasListeners(),P=!T&&Xd(t,r),L=T&&Yd(t,n,r,s);(P||L)&&(p={...p,...jg(_.data,t.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:y,status:d}=p;x=p.data;let u=!1;if(r.placeholderData!==void 0&&x===void 0&&d==="pending"){let T;c!=null&&c.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData)?(T=c.data,u=!0):T=typeof r.placeholderData=="function"?r.placeholderData((k=A(this,es))==null?void 0:k.state.data,A(this,es)):r.placeholderData,T!==void 0&&(d="success",x=ic(c==null?void 0:c.data,T,r),m=!0)}if(r.select&&x!==void 0&&!u)if(c&&x===(g==null?void 0:g.data)&&r.select===A(this,bi))x=A(this,Zn);else try{V(this,bi,r.select),x=r.select(x),x=ic(c==null?void 0:c.data,x,r),V(this,Zn,x),V(this,yr,null)}catch(T){V(this,yr,T)}A(this,yr)&&(w=A(this,yr),x=A(this,Zn),y=Date.now(),d="error");const l=p.fetchStatus==="fetching",h=d==="pending",v=d==="error",b=h&&l,C=x!==void 0,S={status:d,fetchStatus:p.fetchStatus,isPending:h,isSuccess:d==="success",isError:v,isInitialLoading:b,isLoading:b,data:x,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:y,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:l,isRefetching:l&&!h,isLoadingError:v&&!C,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:v&&C,isStale:ku(t,r),refetch:this.refetch,promise:A(this,Vt),isEnabled:it(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const T=S.data!==void 0,P=S.status==="error"&&!T,L=O=>{P?O.reject(S.error):T&&O.resolve(S.data)},B=()=>{const O=V(this,Vt,S.promise=oc());L(O)},$=A(this,Vt);switch($.status){case"pending":t.queryHash===n.queryHash&&L($);break;case"fulfilled":(P||S.data!==$.value)&&B();break;case"rejected":(!P||S.error!==$.reason)&&B();break}}return S}updateResult(){const t=A(this,ze),r=this.createResult(A(this,oe),this.options);if(V(this,nn,A(this,oe).state),V(this,Yn,this.options),A(this,nn).data!==void 0&&V(this,es,A(this,oe)),Ko(r,t))return;V(this,ze,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,c=typeof s=="function"?s():s;if(c==="all"||!c&&!A(this,ts).size)return!0;const g=new Set(c??A(this,ts));return this.options.throwOnError&&g.add("error"),Object.keys(A(this,ze)).some(o=>{const a=o;return A(this,ze)[a]!==t[a]&&g.has(a)})};ne(this,ue,Rg).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ne(this,ue,dc).call(this)}},Ge=new WeakMap,oe=new WeakMap,Si=new WeakMap,ze=new WeakMap,nn=new WeakMap,Yn=new WeakMap,Vt=new WeakMap,yr=new WeakMap,bi=new WeakMap,Zn=new WeakMap,es=new WeakMap,sn=new WeakMap,on=new WeakMap,xr=new WeakMap,ts=new WeakMap,ue=new WeakSet,Ws=function(t){ne(this,ue,pc).call(this);let r=A(this,oe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(We)),r},lc=function(){ne(this,ue,hc).call(this);const t=Ir(this.options.staleTime,A(this,oe));if(_i.isServer()||A(this,ze).isStale||!nc(t))return;const n=xg(A(this,ze).dataUpdatedAt,t)+1;V(this,sn,Gr.setTimeout(()=>{A(this,ze).isStale||this.updateResult()},n))},cc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(A(this,oe)):this.options.refetchInterval)??!1},uc=function(t){ne(this,ue,fc).call(this),V(this,xr,t),!(_i.isServer()||it(this.options.enabled,A(this,oe))===!1||!nc(A(this,xr))||A(this,xr)===0)&&V(this,on,Gr.setInterval(()=>{(this.options.refetchIntervalInBackground||Su.isFocused())&&ne(this,ue,Ws).call(this)},A(this,xr)))},dc=function(){ne(this,ue,lc).call(this),ne(this,ue,uc).call(this,ne(this,ue,cc).call(this))},hc=function(){A(this,sn)!==void 0&&(Gr.clearTimeout(A(this,sn)),V(this,sn,void 0))},fc=function(){A(this,on)!==void 0&&(Gr.clearInterval(A(this,on)),V(this,on,void 0))},pc=function(){const t=A(this,Ge).getQueryCache().build(A(this,Ge),this.options);if(t===A(this,oe))return;const r=A(this,oe);V(this,oe,t),V(this,Si,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Rg=function(t){Ee.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(A(this,ze))}),A(this,Ge).getQueryCache().notify({query:A(this,oe),type:"observerResultsUpdated"})})},ef);function py(e,t){return it(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&it(t.retryOnMount,e)===!1)}function Xd(e,t){return py(e,t)||e.state.data!==void 0&&gc(e,t,t.refetchOnMount)}function gc(e,t,r){if(it(t.enabled,e)!==!1&&Ir(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&ku(e,t)}return!1}function Yd(e,t,r,n){return(e!==t||it(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&ku(e,r)}function ku(e,t){return it(t.enabled,e)!==!1&&e.isStaleByTime(Ir(t.staleTime,e))}function gy(e,t){return!Ko(e.getCurrentResult(),t)}var wi,It,Fe,an,Ot,dr,tf,vy=(tf=class extends kg{constructor(t){super();Z(this,Ot);Z(this,wi);Z(this,It);Z(this,Fe);Z(this,an);V(this,wi,t.client),this.mutationId=t.mutationId,V(this,Fe,t.mutationCache),V(this,It,[]),this.state=t.state||Tg(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){A(this,It).includes(t)||(A(this,It).push(t),this.clearGcTimeout(),A(this,Fe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){V(this,It,A(this,It).filter(r=>r!==t)),this.scheduleGc(),A(this,Fe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){A(this,It).length||(this.state.status==="pending"?this.scheduleGc():A(this,Fe).remove(this))}continue(){var t;return((t=A(this,an))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var g,o,a,f,_,p,m,x,w,y,d,u,l,h,v,b,C,E;const r=()=>{ne(this,Ot,dr).call(this,{type:"continue"})},n={client:A(this,wi),meta:this.options.meta,mutationKey:this.options.mutationKey};V(this,an,Cg({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(S,k)=>{ne(this,Ot,dr).call(this,{type:"failed",failureCount:S,error:k})},onPause:()=>{ne(this,Ot,dr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,Fe).canRun(this)}));const s=this.state.status==="pending",c=!A(this,an).canStart();try{if(s)r();else{ne(this,Ot,dr).call(this,{type:"pending",variables:t,isPaused:c}),A(this,Fe).config.onMutate&&await A(this,Fe).config.onMutate(t,this,n);const k=await((o=(g=this.options).onMutate)==null?void 0:o.call(g,t,n));k!==this.state.context&&ne(this,Ot,dr).call(this,{type:"pending",context:k,variables:t,isPaused:c})}const S=await A(this,an).start();return await((f=(a=A(this,Fe).config).onSuccess)==null?void 0:f.call(a,S,t,this.state.context,this,n)),await((p=(_=this.options).onSuccess)==null?void 0:p.call(_,S,t,this.state.context,n)),await((x=(m=A(this,Fe).config).onSettled)==null?void 0:x.call(m,S,null,this.state.variables,this.state.context,this,n)),await((y=(w=this.options).onSettled)==null?void 0:y.call(w,S,null,t,this.state.context,n)),ne(this,Ot,dr).call(this,{type:"success",data:S}),S}catch(S){try{await((u=(d=A(this,Fe).config).onError)==null?void 0:u.call(d,S,t,this.state.context,this,n))}catch(k){Promise.reject(k)}try{await((h=(l=this.options).onError)==null?void 0:h.call(l,S,t,this.state.context,n))}catch(k){Promise.reject(k)}try{await((b=(v=A(this,Fe).config).onSettled)==null?void 0:b.call(v,void 0,S,this.state.variables,this.state.context,this,n))}catch(k){Promise.reject(k)}try{await((E=(C=this.options).onSettled)==null?void 0:E.call(C,void 0,S,t,this.state.context,n))}catch(k){Promise.reject(k)}throw ne(this,Ot,dr).call(this,{type:"error",error:S}),S}finally{A(this,Fe).runNext(this)}}},wi=new WeakMap,It=new WeakMap,Fe=new WeakMap,an=new WeakMap,Ot=new WeakSet,dr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ee.batch(()=>{A(this,It).forEach(n=>{n.onMutationUpdate(t)}),A(this,Fe).notify({mutation:this,type:"updated",action:t})})},tf);function Tg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qt,Et,Ci,rf,my=(rf=class extends ms{constructor(t={}){super();Z(this,Qt);Z(this,Et);Z(this,Ci);this.config=t,V(this,Qt,new Set),V(this,Et,new Map),V(this,Ci,0)}build(t,r,n){const s=new vy({client:t,mutationCache:this,mutationId:++Pi(this,Ci)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){A(this,Qt).add(t);const r=Xi(t);if(typeof r=="string"){const n=A(this,Et).get(r);n?n.push(t):A(this,Et).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(A(this,Qt).delete(t)){const r=Xi(t);if(typeof r=="string"){const n=A(this,Et).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&A(this,Et).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Xi(t);if(typeof r=="string"){const n=A(this,Et).get(r),s=n==null?void 0:n.find(c=>c.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Xi(t);if(typeof r=="string"){const s=(n=A(this,Et).get(r))==null?void 0:n.find(c=>c!==t&&c.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ee.batch(()=>{A(this,Qt).forEach(t=>{this.notify({type:"removed",mutation:t})}),A(this,Qt).clear(),A(this,Et).clear()})}getAll(){return Array.from(A(this,Qt))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Jd(r,n))}findAll(t={}){return this.getAll().filter(r=>Jd(t,r))}notify(t){Ee.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ee.batch(()=>Promise.all(t.map(r=>r.continue().catch(We))))}},Qt=new WeakMap,Et=new WeakMap,Ci=new WeakMap,rf);function Xi(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Gt,Sr,Xe,Xt,rr,So,vc,nf,_y=(nf=class extends ms{constructor(r,n){super();Z(this,rr);Z(this,Gt);Z(this,Sr);Z(this,Xe);Z(this,Xt);V(this,Gt,r),this.setOptions(n),this.bindMethods(),ne(this,rr,So).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=A(this,Gt).defaultMutationOptions(r),Ko(this.options,n)||A(this,Gt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:A(this,Xe),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&vn(n.mutationKey)!==vn(this.options.mutationKey)?this.reset():((s=A(this,Xe))==null?void 0:s.state.status)==="pending"&&A(this,Xe).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=A(this,Xe))==null||r.removeObserver(this)}onMutationUpdate(r){ne(this,rr,So).call(this),ne(this,rr,vc).call(this,r)}getCurrentResult(){return A(this,Sr)}reset(){var r;(r=A(this,Xe))==null||r.removeObserver(this),V(this,Xe,void 0),ne(this,rr,So).call(this),ne(this,rr,vc).call(this)}mutate(r,n){var s;return V(this,Xt,n),(s=A(this,Xe))==null||s.removeObserver(this),V(this,Xe,A(this,Gt).getMutationCache().build(A(this,Gt),this.options)),A(this,Xe).addObserver(this),A(this,Xe).execute(r)}},Gt=new WeakMap,Sr=new WeakMap,Xe=new WeakMap,Xt=new WeakMap,rr=new WeakSet,So=function(){var n;const r=((n=A(this,Xe))==null?void 0:n.state)??Tg();V(this,Sr,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},vc=function(r){Ee.batch(()=>{var n,s,c,g,o,a,f,_;if(A(this,Xt)&&this.hasListeners()){const p=A(this,Sr).variables,m=A(this,Sr).context,x={client:A(this,Gt),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(s=(n=A(this,Xt)).onSuccess)==null||s.call(n,r.data,p,m,x)}catch(w){Promise.reject(w)}try{(g=(c=A(this,Xt)).onSettled)==null||g.call(c,r.data,null,p,m,x)}catch(w){Promise.reject(w)}}else if((r==null?void 0:r.type)==="error"){try{(a=(o=A(this,Xt)).onError)==null||a.call(o,r.error,p,m,x)}catch(w){Promise.reject(w)}try{(_=(f=A(this,Xt)).onSettled)==null||_.call(f,void 0,r.error,p,m,x)}catch(w){Promise.reject(w)}}}this.listeners.forEach(p=>{p(A(this,Sr))})})},nf),Ft,sf,yy=(sf=class extends ms{constructor(t={}){super();Z(this,Ft);this.config=t,V(this,Ft,new Map)}build(t,r,n){const s=r.queryKey,c=r.queryHash??bu(s,r);let g=this.get(c);return g||(g=new hy({client:t,queryKey:s,queryHash:c,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(g)),g}add(t){A(this,Ft).has(t.queryHash)||(A(this,Ft).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=A(this,Ft).get(t.queryHash);r&&(t.destroy(),r===t&&A(this,Ft).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ee.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return A(this,Ft).get(t)}getAll(){return[...A(this,Ft).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Ud(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Ud(t,n)):r}notify(t){Ee.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ee.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ee.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ft=new WeakMap,sf),Se,br,wr,rs,ns,Cr,ss,is,of,xy=(of=class{constructor(e={}){Z(this,Se);Z(this,br);Z(this,wr);Z(this,rs);Z(this,ns);Z(this,Cr);Z(this,ss);Z(this,is);V(this,Se,e.queryCache||new yy),V(this,br,e.mutationCache||new my),V(this,wr,e.defaultOptions||{}),V(this,rs,new Map),V(this,ns,new Map),V(this,Cr,0)}mount(){Pi(this,Cr)._++,A(this,Cr)===1&&(V(this,ss,Su.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,Se).onFocus())})),V(this,is,Vo.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,Se).onOnline())})))}unmount(){var e,t;Pi(this,Cr)._--,A(this,Cr)===0&&((e=A(this,ss))==null||e.call(this),V(this,ss,void 0),(t=A(this,is))==null||t.call(this),V(this,is,void 0))}isFetching(e){return A(this,Se).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return A(this,br).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,Se).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=A(this,Se).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ir(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return A(this,Se).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=A(this,Se).get(n.queryHash),c=s==null?void 0:s.state.data,g=ey(t,c);if(g!==void 0)return A(this,Se).build(this,n).setData(g,{...r,manual:!0})}setQueriesData(e,t,r){return Ee.batch(()=>A(this,Se).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,Se).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=A(this,Se);Ee.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=A(this,Se);return Ee.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Ee.batch(()=>A(this,Se).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(We).catch(We)}invalidateQueries(e,t={}){return Ee.batch(()=>(A(this,Se).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Ee.batch(()=>A(this,Se).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let c=s.fetch(void 0,r);return r.throwOnError||(c=c.catch(We)),s.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(n).then(We)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=A(this,Se).build(this,t);return r.isStaleByTime(Ir(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(We).catch(We)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(We).catch(We)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Vo.isOnline()?A(this,br).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,Se)}getMutationCache(){return A(this,br)}getDefaultOptions(){return A(this,wr)}setDefaultOptions(e){V(this,wr,e)}setQueryDefaults(e,t){A(this,rs).set(vn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...A(this,rs).values()],r={};return t.forEach(n=>{mi(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){A(this,ns).set(vn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...A(this,ns).values()],r={};return t.forEach(n=>{mi(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...A(this,wr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bu(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===wu&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...A(this,wr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){A(this,Se).clear(),A(this,br).clear()}},Se=new WeakMap,br=new WeakMap,wr=new WeakMap,rs=new WeakMap,ns=new WeakMap,Cr=new WeakMap,ss=new WeakMap,is=new WeakMap,of),Dg=N.createContext(void 0),yn=e=>{const t=N.useContext(Dg);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Sy=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Dg.Provider,{value:e,children:t})),Lg=N.createContext(!1),by=()=>N.useContext(Lg);Lg.Provider;function wy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Cy=N.createContext(wy()),ky=()=>N.useContext(Cy),Ey=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Cu(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},jy=e=>{N.useEffect(()=>{e.clearReset()},[e])},Ry=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Cu(r,[e.error,n])),Ty=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Dy=(e,t)=>e.isLoading&&e.isFetching&&!t,Ly=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Zd=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function My(e,t,r){var m,x,w,y;const n=by(),s=ky(),c=yn(),g=c.defaultQueryOptions(e);(x=(m=c.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||x.call(m,g);const o=c.getQueryCache().get(g.queryHash);g._optimisticResults=n?"isRestoring":"optimistic",Ty(g),Ey(g,s,o),jy(s);const a=!c.getQueryCache().get(g.queryHash),[f]=N.useState(()=>new t(c,g)),_=f.getOptimisticResult(g),p=!n&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(d=>{const u=p?f.subscribe(Ee.batchCalls(d)):We;return f.updateResult(),u},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setOptions(g)},[g,f]),Ly(g,_))throw Zd(g,f,s);if(Ry({result:_,errorResetBoundary:s,throwOnError:g.throwOnError,query:o,suspense:g.suspense}))throw _.error;if((y=(w=c.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||y.call(w,g,_),g.experimental_prefetchInRender&&!_i.isServer()&&Dy(_,n)){const d=a?Zd(g,f,s):o==null?void 0:o.promise;d==null||d.catch(We).finally(()=>{f.updateResult()})}return g.notifyOnChangeProps?_:f.trackResult(_)}function ce(e,t){return My(e,fy)}function tr(e,t){const r=yn(),[n]=N.useState(()=>new _y(r,e));N.useEffect(()=>{n.setOptions(e)},[n,e]);const s=N.useSyncExternalStore(N.useCallback(g=>n.subscribe(Ee.batchCalls(g)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),c=N.useCallback((g,o)=>{n.mutate(g,o).catch(We)},[n]);if(s.error&&Cu(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}function Py(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,s,c,g=[],o="",a=e.split("/");for(a[0]||a.shift();s=a.shift();)r=s[0],r==="*"?(g.push(r),o+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=s.indexOf("?",1),c=s.indexOf(".",1),g.push(s.substring(1,~n?n:~c?c:s.length)),o+=~n&&!~c?"(?:/([^/]+?))?":"/([^/]+?)",~c&&(o+=(~n?"?":"")+"\\"+s.substring(c))):o+="/"+s;return{keys:g,pattern:new RegExp("^"+o+(t?"(?=$|/)":"/?$"),"i")}}var Mg={exports:{}},Pg={};/**
41
+ * @license React
42
+ * use-sync-external-store-shim.production.js
43
+ *
44
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var fs=N;function By(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ay=typeof Object.is=="function"?Object.is:By,Iy=fs.useState,Oy=fs.useEffect,Fy=fs.useLayoutEffect,Ny=fs.useDebugValue;function Hy(e,t){var r=t(),n=Iy({inst:{value:r,getSnapshot:t}}),s=n[0].inst,c=n[1];return Fy(function(){s.value=r,s.getSnapshot=t,Ga(s)&&c({inst:s})},[e,r,t]),Oy(function(){return Ga(s)&&c({inst:s}),e(function(){Ga(s)&&c({inst:s})})},[e]),Ny(r),r}function Ga(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ay(e,r)}catch{return!0}}function zy(e,t){return t()}var $y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?zy:Hy;Pg.useSyncExternalStore=fs.useSyncExternalStore!==void 0?fs.useSyncExternalStore:$y;Mg.exports=Pg;var Wy=Mg.exports;const Uy=Ov.useInsertionEffect,Jy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bg=Jy?N.useLayoutEffect:N.useEffect,qy=Uy||Bg,Eu=e=>{const t=N.useRef([e,(...r)=>t[0](...r)]).current;return qy(()=>{t[0]=e}),t[1]},Ky="popstate",ju="pushState",Ru="replaceState",Vy="hashchange",eh=[Ky,ju,Ru,Vy],Qy=e=>{for(const t of eh)addEventListener(t,e);return()=>{for(const t of eh)removeEventListener(t,e)}},Ag=(e,t)=>Wy.useSyncExternalStore(Qy,e,t),th=()=>location.search,Gy=({ssrSearch:e}={})=>Ag(th,e!=null?()=>e:th),rh=()=>location.pathname,Xy=({ssrPath:e}={})=>Ag(rh,e!=null?()=>e:rh),Yy=(e,{replace:t=!1,state:r=null}={})=>history[t?Ru:ju](r,"",e),Zy=(e={})=>[Xy(e),Yy],nh=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[nh]>"u"){for(const e of[ju,Ru]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),r}}Object.defineProperty(window,nh,{value:!0})}const e0=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",Ig=(e="")=>e==="/"?"":e,t0=(e,t)=>e[0]==="~"?e.slice(1):Ig(t)+e,r0=(e="",t)=>e0(sh(Ig(e)),sh(t)),sh=e=>{try{return decodeURI(e)}catch{return e}},Og={hook:Zy,searchHook:Gy,parser:Py,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},Fg=N.createContext(Og),_s=()=>N.useContext(Fg),Ng={},Hg=N.createContext(Ng),Tu=()=>N.useContext(Hg),Di=e=>{const[t,r]=e.hook(e);return[r0(e.base,t),Eu((n,s)=>e.aroundNav(r,t0(n,e.base),s))]},Li=()=>Di(_s()),zg=(e,t,r,n)=>{const{pattern:s,keys:c}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),g=s.exec(r)||[],[o,...a]=g;return o!==void 0?[!0,(()=>{const f=c!==!1?Object.fromEntries(c.map((p,m)=>[p,a[m]])):g.groups;let _={...a};return f&&Object.assign(_,f),_})(),...n?[o]:[]]:[!1,null]},$g=({children:e,...t})=>{var _,p,m;const r=_s(),n=t.hook?Og:r;let s=n;const[c,g=t.ssrSearch??""]=((_=t.ssrPath)==null?void 0:_.split("?"))??[];c&&(t.ssrSearch=g,t.ssrPath=c),t.hrefs=t.hrefs??((p=t.hook)==null?void 0:p.hrefs),t.searchHook=t.searchHook??((m=t.hook)==null?void 0:m.searchHook);let o=N.useRef({}),a=o.current,f=a;for(let x in n){const w=x==="base"?n[x]+(t[x]??""):t[x]??n[x];a===f&&w!==f[x]&&(o.current=f={...f}),f[x]=w,(w!==n[x]||w!==s[x])&&(s=f)}return N.createElement(Fg.Provider,{value:s,children:e})},ih=({children:e,component:t},r)=>t?N.createElement(t,{params:r}):typeof e=="function"?e(r):e,n0=e=>{let t=N.useRef(Ng);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([n,s])=>s!==r[n])?e:r},ft=({path:e,nest:t,match:r,...n})=>{const s=_s(),[c]=Di(s),[g,o,a]=r??zg(s.parser,e,c,t),f=n0({...Tu(),...o});if(!g)return null;const _=a?N.createElement($g,{base:a},ih(n,f)):ih(n,f);return N.createElement(Hg.Provider,{value:f,children:_})},wt=N.forwardRef((e,t)=>{const r=_s(),[n,s]=Di(r),{to:c="",href:g=c,onClick:o,asChild:a,children:f,className:_,replace:p,state:m,transition:x,...w}=e,y=Eu(u=>{u.ctrlKey||u.metaKey||u.altKey||u.shiftKey||u.button!==0||(o==null||o(u),u.defaultPrevented||(u.preventDefault(),s(g,e)))}),d=r.hrefs(g[0]==="~"?g.slice(1):r.base+g,r);return a&&N.isValidElement(f)?N.cloneElement(f,{onClick:y,href:d}):N.createElement("a",{...w,onClick:y,href:d,className:_!=null&&_.call?_(n===g):_,children:f,ref:t})}),Wg=e=>Array.isArray(e)?e.flatMap(t=>Wg(t&&t.type===N.Fragment?t.props.children:t)):[e],s0=({children:e,location:t})=>{const r=_s(),[n]=Di(r);for(const s of Wg(e)){let c=0;if(N.isValidElement(s)&&(c=zg(r.parser,s.props.path,t||n,s.props.nest))[0])return N.cloneElement(s,{match:c})}return null},mc=e=>{const{to:t,href:r=t}=e,n=_s(),[,s]=Di(n),c=Eu(()=>s(t||r,e)),{ssrContext:g}=n;return Bg(()=>{c()},[]),g&&(g.redirectTo=t),null};async function i0(e){if(!(e.headers.get("content-type")??"").includes("application/json"))return null;try{const r=await e.json();if(typeof r!="object"||r===null)return null;const n=r;return{error:typeof n.error=="string"?n.error:void 0,message:typeof n.message=="string"?n.message:void 0}}catch{return null}}async function te(e,t){const r=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json",...(t==null?void 0:t.headers)??{}},...t});if(!r.ok){const n=await i0(r),s=(n==null?void 0:n.message)??(n==null?void 0:n.error),c=new Error(s?`${r.status} ${r.statusText}: ${s} on ${e}`:`${r.status} ${r.statusText} on ${e}`);throw c.status=r.status,c.code=n==null?void 0:n.error,c}return r.json()}const ee={getStatus:()=>te("/v1/status"),getBootstrap:()=>te("/v1/bootstrap"),getRecentEvents:(e,t=100)=>{const r=new URLSearchParams;return e&&e.length>0&&r.set("kinds",e.join(",")),r.set("limit",String(t)),te(`/v1/events/recent?${r.toString()}`)},getClaudeAuth:()=>te("/v1/auth/claude"),installClaudeCode:()=>te("/v1/setup/claude/install",{method:"POST"}),signInClaude:()=>te("/v1/auth/claude/spawn",{method:"POST"}),triggerDrip:()=>te("/v1/setup/drip",{method:"POST"}),changeKeystorePassword:(e,t)=>te("/v1/setup/change-password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({current:e,next:t})}),claimRewards:()=>te("/api/admin/claim-rewards",{method:"POST"}),restartDaemon:()=>te("/api/admin/restart",{method:"POST"}),getSolverNets:()=>te("/v1/solvernets"),updateSolverNet:(e,t)=>te(`/v1/setup/solvernets/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),updateNetwork:e=>te("/v1/setup/network",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),retryAgentBinding:e=>te("/v1/setup/agent-binding/retry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),updateHarnessMode:e=>te("/v1/setup/harness",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:e})}),hermesDoctor:()=>te("/api/hermes/doctor"),fetchLauncherStatus:()=>te("/v1/launcher/status"),fetchLauncherTasks:(e={})=>{const t=new URLSearchParams;e.cursor&&t.set("cursor",e.cursor),e.limit!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return te(`/v1/launcher/tasks${r?`?${r}`:""}`)},patchLauncherSolverNet:(e,t)=>te(`/v1/launcher/solvernets/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),solvernets:{listDrafts:()=>te("/v1/solvernets/drafts"),getDraft:e=>te(`/v1/solvernets/drafts/${encodeURIComponent(e)}`),createDraft:e=>te("/v1/solvernets/drafts",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),updateDraft:(e,t)=>te(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),deleteDraft:e=>te(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"DELETE"}),launch:e=>te(`/v1/solvernets/drafts/${encodeURIComponent(e)}/launch`,{method:"POST"}),transitionLifecycle:(e,t)=>te(`/v1/solvernets/launched/${encodeURIComponent(e)}/lifecycle`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})}),updateGeneratorConfig:(e,t)=>te(`/v1/solvernets/launched/${encodeURIComponent(e)}/generator-config`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),get:e=>te(`/v1/solvernets/launched/${encodeURIComponent(e)}`),listLaunched:e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status);const r=t.toString();return te(`/v1/solvernets/launched${r?`?${r}`:""}`)},listRegistry:e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.refresh&&t.set("refresh","1");const r=t.toString();return te(`/v1/solvernets/registry${r?`?${r}`:""}`)},getManifest:e=>te(`/v1/solvernets/registry/${encodeURIComponent(e)}`)},operator:{listArtifacts:(e={})=>{const t=new URLSearchParams;e.source&&t.set("source",e.source),e.artifactType&&t.set("artifactType",e.artifactType),e.limit!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return te(`/v1/operator/execution-data${r?`?${r}`:""}`)},updatePricing:e=>te("/v1/operator/pricing",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),join:(e,t)=>te(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),leave:e=>te(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"DELETE"}),listJoined:()=>te("/v1/operator/joined")},captures:{listPending:()=>te("/api/captures/pending"),get:e=>te(`/api/captures/${encodeURIComponent(e)}`),approve:e=>te(`/api/captures/${encodeURIComponent(e)}/approve`,{method:"POST"}),skip:e=>te(`/api/captures/${encodeURIComponent(e)}/skip`,{method:"POST"}),trustRepo:(e,t)=>te("/api/captures/trust-repos",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({repoRemoteUrl:e,trusted:t})})},discovery:{listPluginPublications:e=>{const t=new URLSearchParams;e!=null&&e.solverType&&t.set("solverType",e.solverType),e!=null&&e.builderAgentId&&t.set("builderAgentId",e.builderAgentId),(e==null?void 0:e.includeRevoked)!==void 0&&t.set("includeRevoked",String(e.includeRevoked));const r=t.toString();return te(`/v1/discovery/plugin-publications${r?`?${r}`:""}`)},listBuilderArtifacts:(e,t)=>{const r=new URLSearchParams({builderAgentId:e});return t!==void 0&&r.set("limit",String(t)),te(`/v1/discovery/builder-artifacts?${r.toString()}`)},getPluginScores:(e,t)=>{const r=new URLSearchParams({cid:e});return t!==void 0&&r.set("limit",String(t)),te(`/v1/discovery/plugin-scores?${r.toString()}`)}}};async function o0(){const e=new URL(window.location.href),t=e.searchParams.get("k");if(t){try{await fetch(`/auth/handshake?k=${encodeURIComponent(t)}`,{credentials:"same-origin"})}catch{}e.searchParams.delete("k"),window.history.replaceState({},"",e.toString())}}function a0(e){const[t,r]=N.useState([]),[n,s]=N.useState(!1);return N.useEffect(()=>{const c="",g=new EventSource(`/v1/events${c}`,{withCredentials:!0});return g.onopen=()=>s(!0),g.onerror=()=>s(!1),g.onmessage=o=>{try{const a=JSON.parse(o.data);r(f=>[...f.slice(-499),a])}catch{}},()=>{g.close()}},[e==null?void 0:e.join(",")]),{events:t,connected:n}}function l0({headline:e}){const[t,r]=N.useState(!1),{events:n}=a0(),s=n.length>0?n[n.length-1]:null;return i.jsx("div",{className:"min-h-screen flex items-center justify-center px-10 py-16",style:{background:"var(--bg)",color:"var(--fg)"},children:i.jsxs("div",{className:"max-w-xl w-full flex flex-col gap-6",children:[i.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Jinn · starting up"}),i.jsxs("h1",{className:"j-display",style:{fontSize:"64px",lineHeight:1.05},children:[e,"."]}),i.jsx("p",{className:"j-mono text-sm",style:{color:"var(--fg-muted)",minHeight:"1.5em"},children:s?c0(s):"The daemon is booting. This usually takes a second."}),i.jsx("button",{type:"button",onClick:()=>r(c=>!c),className:"j-label hover:opacity-80 self-start",style:{color:"var(--fg-dim)"},children:t?"Hide details":"Show details"}),t&&i.jsxs("div",{className:"j-mono text-xs max-h-64 overflow-y-auto px-3 py-2",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)"},children:[n.length===0&&i.jsx("div",{style:{color:"var(--fg-dim)"},children:"no events yet"}),n.slice().reverse().map(c=>i.jsxs("div",{className:"grid grid-cols-[68px_84px_1fr] gap-3 py-0.5",children:[i.jsx("span",{style:{color:"var(--fg-dim)"},children:c.ts.slice(11,19)}),i.jsx("span",{style:{color:c.kind==="error"?"var(--break-red)":c.kind==="system"?"var(--accent-sky)":"var(--fg-dim)"},children:c.kind}),i.jsx("span",{style:{color:"var(--fg)"},children:c.message})]},c.id))]})]})})}function c0(e){return e.kind==="error"?`Error: ${e.message}`:e.message}function u0({address:e,minimumWei:t,chainExplorerBase:r}){var h;const[n,s]=N.useState(!1),[c,g]=N.useState(null),[o,a]=N.useState(0),[f,_]=N.useState({state:"idle"});N.useEffect(()=>{if(c===null)return;a(Math.max(0,Math.floor((Date.now()-c)/1e3)));const v=window.setInterval(()=>{a(Math.max(0,Math.floor((Date.now()-c)/1e3)))},1e3);return()=>window.clearInterval(v)},[c]);const p=async()=>{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)},m=async()=>{var v;g(Date.now()),a(0),_({state:"requesting"});try{const b=await ee.triggerDrip();g(null),b.ok?_({state:"sent",txHash:b.txHash??((v=b.txHashes)==null?void 0:v.at(-1)),txHashes:b.txHashes,attempts:b.attempts,balanceWei:b.balanceWei,targetWei:b.targetWei}):b.rateLimited||b.reason&&/rate|claimed|429/i.test(b.reason)?_({state:"rate_limited",reason:b.reason??"faucet rate-limited"}):_({state:"failed",reason:b.reason??"faucet funding failed"})}catch(b){g(null),_({state:"failed",reason:b instanceof Error?b.message:"drip failed"})}},x=v=>{if(!v)return"unknown";try{const b=Number(BigInt(v))/1e18;return`${b.toFixed(b<.001?4:3)} ETH`}catch{return`${v} wei`}},w=x(t),y=N.useMemo(()=>f.state!=="requesting"?0:Math.min(92,Math.max(8,Math.round(o/60*92))),[f.state,o]),d=f.state==="sent"?((h=f.txHashes)==null?void 0:h.length)??f.attempts??(f.txHash?1:0):0,u=f.state==="sent"&&f.balanceWei!==void 0&&f.targetWei!==void 0&&(()=>{try{return BigInt(f.balanceWei)>=BigInt(f.targetWei)}catch{return!1}})(),l=f.state==="sent"&&!u;return i.jsxs("div",{className:"px-6 py-5 flex flex-col gap-4",style:{border:"1px solid var(--accent-gold)",background:"rgba(220, 184, 102, 0.04)",borderRadius:"var(--radius-2)"},children:[i.jsxs("div",{className:"flex items-baseline justify-between",children:[i.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Action needed · fund the master EOA"}),i.jsx("span",{className:"j-mono text-[10px]",style:{color:"var(--fg-dim)"},children:"auto-detected on chain"})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"j-mono text-xs break-all",style:{color:"var(--fg)"},children:e}),i.jsxs("span",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:["send at least ",w," so the daemon can pay gas for setup, or use the testnet faucet."]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx("button",{onClick:m,type:"button",disabled:f.state==="requesting"||u,className:"px-3 py-1.5 j-label hover:opacity-90 disabled:opacity-50",style:{background:"var(--accent-gold)",color:"var(--bg)",borderRadius:"var(--radius-1)"},children:f.state==="requesting"?"Funding...":u?"Faucet funded":l?"Fund more":"Fund from faucet"}),i.jsx("button",{onClick:p,type:"button",className:"px-3 py-1.5 j-label hover:opacity-90",style:{border:"1px solid var(--border-strong)",color:"var(--fg)",borderRadius:"var(--radius-1)",background:"transparent"},children:n?"Copied":"Copy address"}),i.jsx("a",{href:`${r}/address/${e}`,target:"_blank",rel:"noopener noreferrer",className:"px-3 py-1.5 j-label hover:opacity-90",style:{border:"1px solid var(--border)",color:"var(--fg-muted)",borderRadius:"var(--radius-1)"},children:"View on explorer"})]}),f.state==="sent"&&i.jsxs("p",{className:"j-mono text-[11px]",style:{color:u?"var(--vow-green)":"var(--accent-gold)"},children:[u?"Faucet funding complete":"Faucet funding partial",d>0?` (${d} drip${d===1?"":"s"})`:"",".",f.balanceWei&&f.targetWei?` Balance ${x(f.balanceWei)} / target ${x(f.targetWei)}.`:"",l?' Click "Fund more" to top up.':"",f.txHash&&i.jsxs(i.Fragment,{children:[" ",i.jsx("a",{href:`${r}/tx/${f.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--accent-sky)"},children:"view latest tx"})]})]}),f.state==="requesting"&&i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("div",{className:"h-1.5 overflow-hidden",style:{background:"var(--bg-sunken)",borderRadius:"999px"},children:i.jsx("div",{className:"h-full transition-all",style:{width:`${y}%`,background:"var(--accent-gold)",borderRadius:"999px"}})}),i.jsxs("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-muted)"},children:["Requesting faucet drips for ",d0(e),". Elapsed ",o,"s; this can take about a minute on a fresh wallet."]})]}),f.state==="rate_limited"&&i.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--wane)"},children:"Faucet rate-limited. Send manually or wait before trying again."}),f.state==="failed"&&i.jsx("p",{className:"j-mono text-[11px]",style:{color:"var(--break-red)"},children:f.reason})]})}const d0=e=>`${e.slice(0,6)}…${e.slice(-4)}`;var Ug={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={4567:function(g,o,a){var f=this&&this.__decorate||function(h,v,b,C){var E,S=arguments.length,k=S<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,b):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,v,b,C);else for(var T=h.length-1;T>=0;T--)(E=h[T])&&(k=(S<3?E(k):S>3?E(v,b,k):E(v,b))||k);return S>3&&k&&Object.defineProperty(v,b,k),k},_=this&&this.__param||function(h,v){return function(b,C){v(b,C,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const p=a(9042),m=a(6114),x=a(9924),w=a(844),y=a(5596),d=a(4725),u=a(3656);let l=o.AccessibilityManager=class extends w.Disposable{constructor(h,v){super(),this._terminal=h,this._renderService=v,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.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=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new x.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(`
49
+ `))),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._screenDprMonitor=new y.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,u.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,w.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(h){for(let v=0;v<h;v++)this._handleChar(" ")}_handleChar(h){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==h&&(this._charsToAnnounce+=h):this._charsToAnnounce+=h,h===`
50
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)),m.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,m.isMac&&this._liveRegion.remove()}_handleKey(h){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(h)||this._charsToConsume.push(h)}_refreshRows(h,v){this._liveRegionDebouncer.refresh(h,v,this._terminal.rows)}_renderRows(h,v){const b=this._terminal.buffer,C=b.lines.length.toString();for(let E=h;E<=v;E++){const S=b.translateBufferLineToString(b.ydisp+E,!0),k=(b.ydisp+E+1).toString(),T=this._rowElements[E];T&&(S.length===0?T.innerText=" ":T.textContent=S,T.setAttribute("aria-posinset",k),T.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(h,v){const b=h.target,C=this._rowElements[v===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||h.relatedTarget!==C)return;let E,S;if(v===0?(E=b,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(E=this._rowElements.shift(),S=b,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),h.preventDefault(),h.stopImmediatePropagation()}_handleResize(h){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);for(;this._rowElements.length>h;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const h=document.createElement("div");return h.setAttribute("role","listitem"),h.tabIndex=-1,this._refreshRowDimensions(h),h}_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 h=0;h<this._terminal.rows;h++)this._refreshRowDimensions(this._rowElements[h])}}_refreshRowDimensions(h){h.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=l=f([_(1,d.IRenderService)],l)},3614:(g,o)=>{function a(m){return m.replace(/\r?\n/g,"\r")}function f(m,x){return x?"\x1B[200~"+m+"\x1B[201~":m}function _(m,x,w,y){m=f(m=a(m),w.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(m,!0),x.value=""}function p(m,x,w){const y=w.getBoundingClientRect(),d=m.clientX-y.left-10,u=m.clientY-y.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${d}px`,x.style.top=`${u}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=a,o.bracketTextForPaste=f,o.copyHandler=function(m,x){m.clipboardData&&m.clipboardData.setData("text/plain",x.selectionText),m.preventDefault()},o.handlePasteEvent=function(m,x,w,y){m.stopPropagation(),m.clipboardData&&_(m.clipboardData.getData("text/plain"),x,w,y)},o.paste=_,o.moveTextAreaUnderMouseCursor=p,o.rightClickHandler=function(m,x,w,y,d){p(m,x,w),d&&y.rightClickSelect(m),x.value=y.selectionText,x.select()}},7239:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=a(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(_,p,m){this._css.set(_,p,m)}getCss(_,p){return this._css.get(_,p)}setColor(_,p,m){this._color.set(_,p,m)}getColor(_,p){return this._color.get(_,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(a,f,_,p){a.addEventListener(f,_,p);let m=!1;return{dispose:()=>{m||(m=!0,a.removeEventListener(f,_,p))}}}},6465:function(g,o,a){var f=this&&this.__decorate||function(d,u,l,h){var v,b=arguments.length,C=b<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,l,h);else for(var E=d.length-1;E>=0;E--)(v=d[E])&&(C=(b<3?v(C):b>3?v(u,l,C):v(u,l))||C);return b>3&&C&&Object.defineProperty(u,l,C),C},_=this&&this.__param||function(d,u){return function(l,h){u(l,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier2=void 0;const p=a(3656),m=a(8460),x=a(844),w=a(2585);let y=o.Linkifier2=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(d){super(),this._bufferService=d,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(d){return this._linkProviders.push(d),{dispose:()=>{const u=this._linkProviders.indexOf(d);u!==-1&&this._linkProviders.splice(u,1)}}}attachToDom(d,u,l){this._element=d,this._mouseService=u,this._renderService=l,this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(d){if(this._lastMouseEvent=d,!this._element||!this._mouseService)return;const u=this._positionFromMouseEvent(d,this._element,this._mouseService);if(!u)return;this._isMouseOut=!1;const l=d.composedPath();for(let h=0;h<l.length;h++){const v=l[h];if(v.classList.contains("xterm"))break;if(v.classList.contains("xterm-hover"))return}this._lastBufferCell&&u.x===this._lastBufferCell.x&&u.y===this._lastBufferCell.y||(this._handleHover(u),this._lastBufferCell=u)}_handleHover(d){if(this._activeLine!==d.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(d,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,d)||(this._clearCurrentLink(),this._askForLink(d,!0))}_askForLink(d,u){var l,h;this._activeProviderReplies&&u||((l=this._activeProviderReplies)===null||l===void 0||l.forEach(b=>{b==null||b.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=d.y);let v=!1;for(const[b,C]of this._linkProviders.entries())u?!((h=this._activeProviderReplies)===null||h===void 0)&&h.get(b)&&(v=this._checkLinkProviderResult(b,d,v)):C.provideLinks(d.y,E=>{var S,k;if(this._isMouseOut)return;const T=E==null?void 0:E.map(P=>({link:P}));(S=this._activeProviderReplies)===null||S===void 0||S.set(b,T),v=this._checkLinkProviderResult(b,d,v),((k=this._activeProviderReplies)===null||k===void 0?void 0:k.size)===this._linkProviders.length&&this._removeIntersectingLinks(d.y,this._activeProviderReplies)})}_removeIntersectingLinks(d,u){const l=new Set;for(let h=0;h<u.size;h++){const v=u.get(h);if(v)for(let b=0;b<v.length;b++){const C=v[b],E=C.link.range.start.y<d?0:C.link.range.start.x,S=C.link.range.end.y>d?this._bufferService.cols:C.link.range.end.x;for(let k=E;k<=S;k++){if(l.has(k)){v.splice(b--,1);break}l.add(k)}}}}_checkLinkProviderResult(d,u,l){var h;if(!this._activeProviderReplies)return l;const v=this._activeProviderReplies.get(d);let b=!1;for(let C=0;C<d;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(b=!0);if(!b&&v){const C=v.find(E=>this._linkAtPosition(E.link,u));C&&(l=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviders.length&&!l)for(let C=0;C<this._activeProviderReplies.size;C++){const E=(h=this._activeProviderReplies.get(C))===null||h===void 0?void 0:h.find(S=>this._linkAtPosition(S.link,u));if(E){l=!0,this._handleNewLink(E);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(d){if(!this._element||!this._mouseService||!this._currentLink)return;const u=this._positionFromMouseEvent(d,this._element,this._mouseService);u&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,u)&&this._currentLink.link.activate(d,this._currentLink.link.text)}_clearCurrentLink(d,u){this._element&&this._currentLink&&this._lastMouseEvent&&(!d||!u||this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=u)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(d){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._linkAtPosition(d.link,u)&&(this._currentLink=d,this._currentLink.state={decorations:{underline:d.link.decorations===void 0||d.link.decorations.underline,pointerCursor:d.link.decorations===void 0||d.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,d.link,this._lastMouseEvent),d.link.decorations={},Object.defineProperties(d.link.decorations,{pointerCursor:{get:()=>{var l,h;return(h=(l=this._currentLink)===null||l===void 0?void 0:l.state)===null||h===void 0?void 0:h.decorations.pointerCursor},set:l=>{var h,v;!((h=this._currentLink)===null||h===void 0)&&h.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&((v=this._element)===null||v===void 0||v.classList.toggle("xterm-cursor-pointer",l)))}},underline:{get:()=>{var l,h;return(h=(l=this._currentLink)===null||l===void 0?void 0:l.state)===null||h===void 0?void 0:h.decorations.underline},set:l=>{var h,v,b;!((h=this._currentLink)===null||h===void 0)&&h.state&&((b=(v=this._currentLink)===null||v===void 0?void 0:v.state)===null||b===void 0?void 0:b.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(d.link,l))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(l=>{if(!this._currentLink)return;const h=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=v&&(this._clearCurrentLink(h,v),this._lastMouseEvent&&this._element)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}})))}_linkHover(d,u,l){var h;!((h=this._currentLink)===null||h===void 0)&&h.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!0),this._currentLink.state.decorations.pointerCursor&&d.classList.add("xterm-cursor-pointer")),u.hover&&u.hover(l,u.text)}_fireUnderlineEvent(d,u){const l=d.range,h=this._bufferService.buffer.ydisp,v=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-h-1,l.end.x,l.end.y-h-1,void 0);(u?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(v)}_linkLeave(d,u,l){var h;!((h=this._currentLink)===null||h===void 0)&&h.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(u,!1),this._currentLink.state.decorations.pointerCursor&&d.classList.remove("xterm-cursor-pointer")),u.leave&&u.leave(l,u.text)}_linkAtPosition(d,u){const l=d.range.start.y*this._bufferService.cols+d.range.start.x,h=d.range.end.y*this._bufferService.cols+d.range.end.x,v=u.y*this._bufferService.cols+u.x;return l<=v&&v<=h}_positionFromMouseEvent(d,u,l){const h=l.getCoords(d,u,this._bufferService.cols,this._bufferService.rows);if(h)return{x:h[0],y:h[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(d,u,l,h,v){return{x1:d,y1:u,x2:l,y2:h,cols:this._bufferService.cols,fg:v}}};o.Linkifier2=y=f([_(0,w.IBufferService)],y)},9042:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(g,o,a){var f=this&&this.__decorate||function(y,d,u,l){var h,v=arguments.length,b=v<3?d:l===null?l=Object.getOwnPropertyDescriptor(d,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(y,d,u,l);else for(var C=y.length-1;C>=0;C--)(h=y[C])&&(b=(v<3?h(b):v>3?h(d,u,b):h(d,u))||b);return v>3&&b&&Object.defineProperty(d,u,b),b},_=this&&this.__param||function(y,d){return function(u,l){d(u,l,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const p=a(511),m=a(2585);let x=o.OscLinkProvider=class{constructor(y,d,u){this._bufferService=y,this._optionsService=d,this._oscLinkService=u}provideLinks(y,d){var u;const l=this._bufferService.buffer.lines.get(y-1);if(!l)return void d(void 0);const h=[],v=this._optionsService.rawOptions.linkHandler,b=new p.CellData,C=l.getTrimmedLength();let E=-1,S=-1,k=!1;for(let T=0;T<C;T++)if(S!==-1||l.hasContent(T)){if(l.loadCell(T,b),b.hasExtendedAttrs()&&b.extended.urlId){if(S===-1){S=T,E=b.extended.urlId;continue}k=b.extended.urlId!==E}else S!==-1&&(k=!0);if(k||S!==-1&&T===C-1){const P=(u=this._oscLinkService.getLinkData(E))===null||u===void 0?void 0:u.uri;if(P){const L={start:{x:S+1,y},end:{x:T+(k||T!==C-1?0:1),y}};let B=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const $=new URL(P);["http:","https:"].includes($.protocol)||(B=!0)}catch{B=!0}B||h.push({text:P,range:L,activate:($,O)=>v?v.activate($,O,L):w(0,O),hover:($,O)=>{var F;return(F=v==null?void 0:v.hover)===null||F===void 0?void 0:F.call(v,$,O,L)},leave:($,O)=>{var F;return(F=v==null?void 0:v.leave)===null||F===void 0?void 0:F.call(v,$,O,L)}})}k=!1,b.hasExtendedAttrs()&&b.extended.urlId?(S=T,E=b.extended.urlId):(S=-1,E=-1)}}d(h)}};function w(y,d){if(confirm(`Do you want to navigate to ${d}?
51
+
52
+ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=x=f([_(0,m.IBufferService),_(1,m.IOptionsService),_(2,m.IOscLinkService)],x)},6193:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(a,f){this._parentWindow=a,this._renderCallback=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,f,_){this._rowCount=_,a=a!==void 0?a:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._parentWindow.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 a=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ScreenDprMonitor=void 0;const f=a(844);class _ extends f.Disposable{constructor(m){super(),this._parentWindow=m,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,f.toDisposable)(()=>{this.clearListener()}))}setListener(m){this._listener&&this.clearListener(),this._listener=m,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)===null||m===void 0||m.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}o.ScreenDprMonitor=_},3236:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=a(3614),_=a(3656),p=a(6465),m=a(9042),x=a(3730),w=a(1680),y=a(3107),d=a(5744),u=a(2950),l=a(1296),h=a(428),v=a(4269),b=a(5114),C=a(8934),E=a(3230),S=a(9312),k=a(4725),T=a(6731),P=a(8055),L=a(8969),B=a(8460),$=a(844),O=a(6114),F=a(8437),z=a(2584),j=a(7399),D=a(5941),M=a(9074),I=a(2585),U=a(5435),K=a(4567),Y=typeof window<"u"?window.document:null;class X extends L.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(R={}){super(R),this.browser=O,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.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.linkifier2=this.register(this._instantiationService.createInstance(p.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((H,J)=>this.refresh(H,J))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(H=>this._reportWindowsOptions(H))),this.register(this._inputHandler.onColor(H=>this._handleColorEvent(H))),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(H=>this._afterResize(H.cols,H.rows))),this.register((0,$.toDisposable)(()=>{var H,J;this._customKeyEventHandler=void 0,(J=(H=this.element)===null||H===void 0?void 0:H.parentNode)===null||J===void 0||J.removeChild(this.element)}))}_handleColorEvent(R){if(this._themeService)for(const H of R){let J,W="";switch(H.index){case 256:J="foreground",W="10";break;case 257:J="background",W="11";break;case 258:J="cursor",W="12";break;default:J="ansi",W="4;"+H.index}switch(H.type){case 0:const re=P.color.toColorRGB(J==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[J]);this.coreService.triggerDataEvent(`${z.C0.ESC}]${W};${(0,D.toRgbString)(re)}${z.C1_ESCAPED.ST}`);break;case 1:if(J==="ansi")this._themeService.modifyColors(Q=>Q.ansi[H.index]=P.rgba.toColor(...H.color));else{const Q=J;this._themeService.modifyColors(de=>de[Q]=P.rgba.toColor(...H.color))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(R){R?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(R){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[I"),this.updateCursorStyle(R),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var R;return(R=this.textarea)===null||R===void 0?void 0:R.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.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 R=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(R);if(!H)return;const J=Math.min(this.buffer.x,this.cols-1),W=this._renderService.dimensions.css.cell.height,re=H.getWidth(J),Q=this._renderService.dimensions.css.cell.width*re,de=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=J*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=de+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=W+"px",this.textarea.style.lineHeight=W+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",H=>{this.hasSelection()&&(0,f.copyHandler)(H,this._selectionService)}));const R=H=>(0,f.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",R)),this.register((0,_.addDisposableDomListener)(this.element,"paste",R)),O.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",H=>{H.button===2&&(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",H=>{(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),O.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",H=>{H.button===1&&(0,f.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",R=>this._keyUp(R),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",R=>this._keyDown(R),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",R=>this._keyPress(R),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",R=>this._compositionHelper.compositionupdate(R))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",R=>this._inputEvent(R),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(R){var H;if(!R)throw new Error("Terminal requires a parent element.");R.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=R.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),R.appendChild(this.element);const J=Y.createDocumentFragment();this._viewportElement=Y.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),J.appendChild(this._viewportElement),this._viewportScrollArea=Y.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=Y.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=Y.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),J.appendChild(this.screenElement),this.textarea=Y.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),O.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._instantiationService.createInstance(b.CoreBrowserService,this.textarea,(H=this._document.defaultView)!==null&&H!==void 0?H:window),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",W=>this._handleTextAreaFocus(W))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(v.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(W=>this._onRender.fire(W))),this.onResize(W=>this._renderService.resize(W.cols,W.rows)),this._compositionView=Y.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(J);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(W=>this.scrollLines(W.amount,W.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(S.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(W=>this.scrollLines(W.amount,W.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(W=>this._renderService.handleSelectionChanged(W.start,W.end,W.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(W=>{this.textarea.value=W,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(W=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",W=>this._selectionService.handleMouseDown(W))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",W=>this._handleScreenReaderModeOptionChange(W))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",W=>{!this._overviewRulerRenderer&&W&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.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.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const R=this,H=this.element;function J(Q){const de=R._mouseService.getMouseReportCoords(Q,R.screenElement);if(!de)return!1;let Le,Ve;switch(Q.overrideType||Q.type){case"mousemove":Ve=32,Q.buttons===void 0?(Le=3,Q.button!==void 0&&(Le=Q.button<3?Q.button:3)):Le=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":Ve=0,Le=Q.button<3?Q.button:3;break;case"mousedown":Ve=1,Le=Q.button<3?Q.button:3;break;case"wheel":if(R.viewport.getLinesScrolled(Q)===0)return!1;Ve=Q.deltaY<0?0:1,Le=4;break;default:return!1}return!(Ve===void 0||Le===void 0||Le>4)&&R.coreMouseService.triggerMouseEvent({col:de.col,row:de.row,x:de.x,y:de.y,button:Le,action:Ve,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}const W={mouseup:null,wheel:null,mousedrag:null,mousemove:null},re={mouseup:Q=>(J(Q),Q.buttons||(this._document.removeEventListener("mouseup",W.mouseup),W.mousedrag&&this._document.removeEventListener("mousemove",W.mousedrag)),this.cancel(Q)),wheel:Q=>(J(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&J(Q)},mousemove:Q=>{Q.buttons||J(Q)}};this.register(this.coreMouseService.onProtocolChange(Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),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&Q?W.mousemove||(H.addEventListener("mousemove",re.mousemove),W.mousemove=re.mousemove):(H.removeEventListener("mousemove",W.mousemove),W.mousemove=null),16&Q?W.wheel||(H.addEventListener("wheel",re.wheel,{passive:!1}),W.wheel=re.wheel):(H.removeEventListener("wheel",W.wheel),W.wheel=null),2&Q?W.mouseup||(H.addEventListener("mouseup",re.mouseup),W.mouseup=re.mouseup):(this._document.removeEventListener("mouseup",W.mouseup),H.removeEventListener("mouseup",W.mouseup),W.mouseup=null),4&Q?W.mousedrag||(W.mousedrag=re.mousedrag):(this._document.removeEventListener("mousemove",W.mousedrag),W.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(H,"mousedown",Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return J(Q),W.mouseup&&this._document.addEventListener("mouseup",W.mouseup),W.mousedrag&&this._document.addEventListener("mousemove",W.mousedrag),this.cancel(Q)})),this.register((0,_.addDisposableDomListener)(H,"wheel",Q=>{if(!W.wheel){if(!this.buffer.hasScrollback){const de=this.viewport.getLinesScrolled(Q);if(de===0)return;const Le=z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B");let Ve="";for(let bn=0;bn<Math.abs(de);bn++)Ve+=Le;return this.coreService.triggerDataEvent(Ve,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}},{passive:!1})),this.register((0,_.addDisposableDomListener)(H,"touchstart",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)},{passive:!0})),this.register((0,_.addDisposableDomListener)(H,"touchmove",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)},{passive:!1}))}refresh(R,H){var J;(J=this._renderService)===null||J===void 0||J.refreshRows(R,H)}updateCursorStyle(R){var H;!((H=this._selectionService)===null||H===void 0)&&H.shouldColumnSelect(R)?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(R,H,J=0){var W;J===1?(super.scrollLines(R,H,J),this.refresh(0,this.rows-1)):(W=this.viewport)===null||W===void 0||W.scrollLines(R)}paste(R){(0,f.paste)(R,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(R){this._customKeyEventHandler=R}registerLinkProvider(R){return this.linkifier2.registerLinkProvider(R)}registerCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(R);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(R){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(R)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(R){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+R)}registerDecoration(R){return this._decorationService.registerDecoration(R)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(R,H,J){this._selectionService.setSelection(R,H,J)}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 R;(R=this._selectionService)===null||R===void 0||R.clearSelection()}selectAll(){var R;(R=this._selectionService)===null||R===void 0||R.selectAll()}selectLines(R,H){var J;(J=this._selectionService)===null||J===void 0||J.selectLines(R,H)}_keyDown(R){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&R.altKey;if(!H&&!this._compositionHelper.keydown(R))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||R.key!=="Dead"&&R.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const J=(0,j.evaluateKeyboardEvent)(R,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(R),J.type===3||J.type===2){const W=this.rows-1;return this.scrollLines(J.type===2?-W:W),this.cancel(R,!0)}return J.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,R)||(J.cancel&&this.cancel(R,!0),!J.key||!!(R.key&&!R.ctrlKey&&!R.altKey&&!R.metaKey&&R.key.length===1&&R.key.charCodeAt(0)>=65&&R.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(J.key!==z.C0.ETX&&J.key!==z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:J.key,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(J.key,!0),!this.optionsService.rawOptions.screenReaderMode||R.altKey||R.ctrlKey?this.cancel(R,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(R,H){const J=R.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||R.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||R.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?J:J&&(!H.keyCode||H.keyCode>47)}_keyUp(R){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1||(function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18}(R)||this.focus(),this.updateCursorStyle(R),this._keyPressHandled=!1)}_keyPress(R){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(R)===!1)return!1;if(this.cancel(R),R.charCode)H=R.charCode;else if(R.which===null||R.which===void 0)H=R.keyCode;else{if(R.which===0||R.charCode===0)return!1;H=R.which}return!(!H||(R.altKey||R.ctrlKey||R.metaKey)&&!this._isThirdLevelShift(this.browser,R)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:R}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(R){if(R.data&&R.inputType==="insertText"&&(!R.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=R.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(R),!0}return!1}resize(R,H){R!==this.cols||H!==this.rows?super.resize(R,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(R,H){var J,W;(J=this._charSizeService)===null||J===void 0||J.measure(),(W=this.viewport)===null||W===void 0||W.syncScrollArea(!0)}clear(){var R;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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(R=this.viewport)===null||R===void 0||R.reset(),this.refresh(0,this.rows-1)}}reset(){var R,H;this.options.rows=this.rows,this.options.cols=this.cols;const J=this._customKeyEventHandler;this._setup(),super.reset(),(R=this._selectionService)===null||R===void 0||R.reset(),this._decorationService.reset(),(H=this.viewport)===null||H===void 0||H.reset(),this._customKeyEventHandler=J,this.refresh(0,this.rows-1)}clearTextureAtlas(){var R;(R=this._renderService)===null||R===void 0||R.clearTextureAtlas()}_reportFocus(){var R;!((R=this.element)===null||R===void 0)&&R.classList.contains("focus")?this.coreService.triggerDataEvent(z.C0.ESC+"[I"):this.coreService.triggerDataEvent(z.C0.ESC+"[O")}_reportWindowsOptions(R){if(this._renderService)switch(R){case U.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),J=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[4;${J};${H}t`);break;case U.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const W=this._renderService.dimensions.css.cell.width.toFixed(0),re=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[6;${re};${W}t`)}}cancel(R,H){if(this.options.cancelEvents||H)return R.preventDefault(),R.stopPropagation(),!1}}o.Terminal=X},9924:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(a,f=1e3){this._renderCallback=a,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,f,_){this._rowCount=_,a=a!==void 0?a:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=p-this._lastRefreshMs,x=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,f)}}},1680:function(g,o,a){var f=this&&this.__decorate||function(u,l,h,v){var b,C=arguments.length,E=C<3?l:v===null?v=Object.getOwnPropertyDescriptor(l,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(u,l,h,v);else for(var S=u.length-1;S>=0;S--)(b=u[S])&&(E=(C<3?b(E):C>3?b(l,h,E):b(l,h))||E);return C>3&&E&&Object.defineProperty(l,h,E),E},_=this&&this.__param||function(u,l){return function(h,v){l(h,v,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const p=a(3656),m=a(4725),x=a(8460),w=a(844),y=a(2585);let d=o.Viewport=class extends w.Disposable{constructor(u,l,h,v,b,C,E,S){super(),this._viewportElement=u,this._scrollArea=l,this._bufferService=h,this._optionsService=v,this._charSizeService=b,this._renderService=C,this._coreBrowserService=E,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 x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(k=>this._handleThemeChange(k))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.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(u){if(u)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._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){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 u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<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(u,l){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&h<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const l=this._getPixelsScrolled(u);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(u,l))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=u*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:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let l=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(u,l){var h;let v,b="";const C=[],E=l??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let k=u;k<E;k++){const T=S.get(k);if(!T)continue;const P=(h=S.get(k+1))===null||h===void 0?void 0:h.isWrapped;if(b+=T.translateToString(!P),!P||k===S.length-1){const L=document.createElement("div");L.textContent=b,C.push(L),b.length>0&&(v=L),b=""}}return{bufferElements:C,cursorElement:v}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let l=this._applyScrollModifier(u.deltaY,u);return u.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):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(u,l){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&l.altKey||h==="ctrl"&&l.ctrlKey||h==="shift"&&l.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const l=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(u,l))}};o.Viewport=d=f([_(2,y.IBufferService),_(3,y.IOptionsService),_(4,m.ICharSizeService),_(5,m.IRenderService),_(6,m.ICoreBrowserService),_(7,m.IThemeService)],d)},3107:function(g,o,a){var f=this&&this.__decorate||function(d,u,l,h){var v,b=arguments.length,C=b<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,l,h);else for(var E=d.length-1;E>=0;E--)(v=d[E])&&(C=(b<3?v(C):b>3?v(u,l,C):v(u,l))||C);return b>3&&C&&Object.defineProperty(u,l,C),C},_=this&&this.__param||function(d,u){return function(l,h){u(l,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const p=a(3656),m=a(4725),x=a(844),w=a(2585);let y=o.BufferDecorationRenderer=class extends x.Disposable{constructor(d,u,l,h){super(),this._screenElement=d,this._bufferService=u,this._decorationService=l,this._renderService=h,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((0,p.addDisposableDomListener)(window,"resize",()=>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(v=>this._removeDecoration(v))),this.register((0,x.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 d of this._decorationService.decorations)this._renderDecoration(d);this._dimensionsChanged=!1}_renderDecoration(d){this._refreshStyle(d),this._dimensionsChanged&&this._refreshXPosition(d)}_createElement(d){var u,l;const h=document.createElement("div");h.classList.add("xterm-decoration"),h.classList.toggle("xterm-decoration-top-layer",((u=d==null?void 0:d.options)===null||u===void 0?void 0:u.layer)==="top"),h.style.width=`${Math.round((d.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(d.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=(d.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=(l=d.options.x)!==null&&l!==void 0?l:0;return v&&v>this._bufferService.cols&&(h.style.display="none"),this._refreshXPosition(d,h),h}_refreshStyle(d){const u=d.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)d.element&&(d.element.style.display="none",d.onRenderEmitter.fire(d.element));else{let l=this._decorationElements.get(d);l||(l=this._createElement(d),d.element=l,this._decorationElements.set(d,l),this._container.appendChild(l),d.onDispose(()=>{this._decorationElements.delete(d),l.remove()})),l.style.top=u*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",d.onRenderEmitter.fire(l)}}_refreshXPosition(d,u=d.element){var l;if(!u)return;const h=(l=d.options.x)!==null&&l!==void 0?l:0;(d.options.anchor||"left")==="right"?u.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(d){var u;(u=this._decorationElements.get(d))===null||u===void 0||u.remove(),this._decorationElements.delete(d),d.dispose()}};o.BufferDecorationRenderer=y=f([_(1,w.IBufferService),_(2,w.IDecorationService),_(3,m.IRenderService)],y)},5871:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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(a){if(a.options.overviewRulerOptions){for(const f of this._zones)if(f.color===a.options.overviewRulerOptions.color&&f.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,a.marker.line))return;if(this._lineAdjacentToZone(f,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(f,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,f){return f>=a.startBufferLine&&f<=a.endBufferLine}_lineAdjacentToZone(a,f,_){return f>=a.startBufferLine-this._linePadding[_||"full"]&&f<=a.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(a,f){a.startBufferLine=Math.min(a.startBufferLine,f),a.endBufferLine=Math.max(a.endBufferLine,f)}}},5744:function(g,o,a){var f=this&&this.__decorate||function(v,b,C,E){var S,k=arguments.length,T=k<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(v,b,C,E);else for(var P=v.length-1;P>=0;P--)(S=v[P])&&(T=(k<3?S(T):k>3?S(b,C,T):S(b,C))||T);return k>3&&T&&Object.defineProperty(b,C,T),T},_=this&&this.__param||function(v,b){return function(C,E){b(C,E,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const p=a(5871),m=a(3656),x=a(4725),w=a(844),y=a(2585),d={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let h=o.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,b,C,E,S,k,T){var P;super(),this._viewportElement=v,this._screenElement=b,this._bufferService=C,this._decorationService=E,this._renderService=S,this._optionsService=k,this._coreBrowseService=T,this._colorZoneStore=new p.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(P=this._viewportElement.parentElement)===null||P===void 0||P.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,w.toDisposable)(()=>{var B;(B=this._canvas)===null||B===void 0||B.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((0,m.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const v=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=v,u.center=b,u.right=v,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=u.left,l.right=u.left+u.center}_refreshDrawHeightConstants(){d.full=Math.round(2*this._coreBrowseService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowseService.dpr);d.left=b,d.center=b,d.right=b}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*d.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.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 b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const b of v)b.position!=="full"&&this._renderColorZone(b);for(const b of v)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(l[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-d[v.position||"full"]/2),u[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+d[v.position||"full"]))}_queueRefresh(v,b){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=h=f([_(2,y.IBufferService),_(3,y.IDecorationService),_(4,x.IRenderService),_(5,y.IOptionsService),_(6,x.ICoreBrowserService)],h)},2950:function(g,o,a){var f=this&&this.__decorate||function(y,d,u,l){var h,v=arguments.length,b=v<3?d:l===null?l=Object.getOwnPropertyDescriptor(d,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(y,d,u,l);else for(var C=y.length-1;C>=0;C--)(h=y[C])&&(b=(v<3?h(b):v>3?h(d,u,b):h(d,u))||b);return v>3&&b&&Object.defineProperty(d,u,b),b},_=this&&this.__param||function(y,d){return function(u,l){d(u,l,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const p=a(4725),m=a(2585),x=a(2584);let w=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,d,u,l,h,v){this._textarea=y,this._compositionView=d,this._bufferService=u,this._optionsService=l,this._coreService=h,this._renderService=v,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(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}},0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const d=this._textarea.value,u=d.replace(y,"");this._dataAlreadySent=u,d.length>y.length?this._coreService.triggerDataEvent(u,!0):d.length<y.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):d.length===y.length&&d!==y&&this._coreService.triggerDataEvent(d,!0)}},0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const v=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(v.width,1)+"px",this._textarea.style.height=Math.max(v.height,1)+"px",this._textarea.style.lineHeight=v.height+"px"}y||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=w=f([_(2,m.IBufferService),_(3,m.IOptionsService),_(4,m.ICoreService),_(5,p.IRenderService)],w)},9806:(g,o)=>{function a(f,_,p){const m=p.getBoundingClientRect(),x=f.getComputedStyle(p),w=parseInt(x.getPropertyValue("padding-left")),y=parseInt(x.getPropertyValue("padding-top"));return[_.clientX-m.left-w,_.clientY-m.top-y]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=a,o.getCoords=function(f,_,p,m,x,w,y,d,u){if(!w)return;const l=a(f,_,p);return l?(l[0]=Math.ceil((l[0]+(u?y/2:0))/y),l[1]=Math.ceil(l[1]/d),l[0]=Math.min(Math.max(l[0],1),m+(u?1:0)),l[1]=Math.min(Math.max(l[1],1),x),l):void 0}},9504:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=a(2584);function _(d,u,l,h){const v=d-p(d,l),b=u-p(u,l),C=Math.abs(v-b)-function(E,S,k){let T=0;const P=E-p(E,k),L=S-p(S,k);for(let B=0;B<Math.abs(P-L);B++){const $=m(E,S)==="A"?-1:1,O=k.buffer.lines.get(P+$*B);O!=null&&O.isWrapped&&T++}return T}(d,u,l);return y(C,w(m(d,u),h))}function p(d,u){let l=0,h=u.buffer.lines.get(d),v=h==null?void 0:h.isWrapped;for(;v&&d>=0&&d<u.rows;)l++,h=u.buffer.lines.get(--d),v=h==null?void 0:h.isWrapped;return l}function m(d,u){return d>u?"A":"B"}function x(d,u,l,h,v,b){let C=d,E=u,S="";for(;C!==l||E!==h;)C+=v?1:-1,v&&C>b.cols-1?(S+=b.buffer.translateBufferLineToString(E,!1,d,C),C=0,d=0,E++):!v&&C<0&&(S+=b.buffer.translateBufferLineToString(E,!1,0,d+1),C=b.cols-1,d=C,E--);return S+b.buffer.translateBufferLineToString(E,!1,d,C)}function w(d,u){const l=u?"O":"[";return f.C0.ESC+l+d}function y(d,u){d=Math.floor(d);let l="";for(let h=0;h<d;h++)l+=u;return l}o.moveToCellSequence=function(d,u,l,h){const v=l.buffer.x,b=l.buffer.y;if(!l.buffer.hasScrollback)return function(S,k,T,P,L,B){return _(k,P,L,B).length===0?"":y(x(S,k,S,k-p(k,L),!1,L).length,w("D",B))}(v,b,0,u,l,h)+_(b,u,l,h)+function(S,k,T,P,L,B){let $;$=_(k,P,L,B).length>0?P-p(P,L):k;const O=P,F=function(z,j,D,M,I,U){let K;return K=_(D,M,I,U).length>0?M-p(M,I):j,z<D&&K<=M||z>=D&&K<M?"C":"D"}(S,k,T,P,L,B);return y(x(S,$,T,O,F==="C",L).length,w(F,B))}(v,b,d,u,l,h);let C;if(b===u)return C=v>d?"D":"C",y(Math.abs(v-d),w(C,h));C=b>u?"D":"C";const E=Math.abs(b-u);return y(function(S,k){return k.cols-S}(b>u?d:v,l)+(E-1)*l.cols+1+((b>u?v:d)-1),w(C,h))}},1296:function(g,o,a){var f=this&&this.__decorate||function(L,B,$,O){var F,z=arguments.length,j=z<3?B:O===null?O=Object.getOwnPropertyDescriptor(B,$):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(L,B,$,O);else for(var D=L.length-1;D>=0;D--)(F=L[D])&&(j=(z<3?F(j):z>3?F(B,$,j):F(B,$))||j);return z>3&&j&&Object.defineProperty(B,$,j),j},_=this&&this.__param||function(L,B){return function($,O){B($,O,L)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const p=a(3787),m=a(2550),x=a(2223),w=a(6171),y=a(4725),d=a(8055),u=a(8460),l=a(844),h=a(2585),v="xterm-dom-renderer-owner-",b="xterm-rows",C="xterm-fg-",E="xterm-bg-",S="xterm-focus",k="xterm-selection";let T=1,P=o.DomRenderer=class extends l.Disposable{constructor(L,B,$,O,F,z,j,D,M,I){super(),this._element=L,this._screenElement=B,this._viewportElement=$,this._linkifier2=O,this._charSizeService=z,this._optionsService=j,this._bufferService=D,this._coreBrowserService=M,this._themeService=I,this._terminalClass=T++,this._rowElements=[],this.onRequestRedraw=this.register(new u.EventEmitter).event,this._rowContainer=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=document.createElement("div"),this._selectionContainer.classList.add(k),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(U=>this._injectCss(U))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(v+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(U=>this._handleLinkHover(U))),this.register(this._linkifier2.onHideLinkUnderline(U=>this._handleLinkLeave(U))),this.register((0,l.toDisposable)(()=>{this._element.classList.remove(v+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new m.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const L=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*L,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*L),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/L),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/L),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const B=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,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(L){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${b} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${b} .xterm-dim { color: ${d.color.multiplyOpacity(L.foreground,.5).css};}`,B+=`${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;}`,B+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",B+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css}; } 50% { background-color: inherit; color: ${L.cursor.css}; }}`,B+=`${this._terminalSelector} .${b}.${S} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${b}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${k} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${k} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${k} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;for(const[$,O]of L.ansi.entries())B+=`${this._terminalSelector} .${C}${$} { color: ${O.css}; }${this._terminalSelector} .${C}${$}.xterm-dim { color: ${d.color.multiplyOpacity(O,.5).css}; }${this._terminalSelector} .${E}${$} { background-color: ${O.css}; }`;B+=`${this._terminalSelector} .${C}${x.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(L.background).css}; }${this._terminalSelector} .${C}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(L.background),.5).css}; }${this._terminalSelector} .${E}${x.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){const L=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${L}px`,this._rowFactory.defaultSpacing=L}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(L,B){for(let $=this._rowElements.length;$<=B;$++){const O=document.createElement("div");this._rowContainer.appendChild(O),this._rowElements.push(O)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(L,B){this._refreshRowElements(L,B),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(L,B,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(L,B,$),this.renderRows(0,this._bufferService.rows-1),!L||!B)return;const O=L[1]-this._bufferService.buffer.ydisp,F=B[1]-this._bufferService.buffer.ydisp,z=Math.max(O,0),j=Math.min(F,this._bufferService.rows-1);if(z>=this._bufferService.rows||j<0)return;const D=document.createDocumentFragment();if($){const M=L[0]>B[0];D.appendChild(this._createSelectionElement(z,M?B[0]:L[0],M?L[0]:B[0],j-z+1))}else{const M=O===z?L[0]:0,I=z===F?B[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(z,M,I));const U=j-z-1;if(D.appendChild(this._createSelectionElement(z+1,0,this._bufferService.cols,U)),z!==j){const K=F===j?B[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(j,0,K))}}this._selectionContainer.appendChild(D)}_createSelectionElement(L,B,$,O=1){const F=document.createElement("div");return F.style.height=O*this.dimensions.css.cell.height+"px",F.style.top=L*this.dimensions.css.cell.height+"px",F.style.left=B*this.dimensions.css.cell.width+"px",F.style.width=this.dimensions.css.cell.width*($-B)+"px",F}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 L of this._rowElements)L.replaceChildren()}renderRows(L,B){const $=this._bufferService.buffer,O=$.ybase+$.y,F=Math.min($.x,this._bufferService.cols-1),z=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=L;M<=B;M++){const I=M+$.ydisp,U=this._rowElements[M],K=$.lines.get(I);if(!U||!K)break;U.replaceChildren(...this._rowFactory.createRow(K,I,I===O,j,D,F,z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${v}${this._terminalClass}`}_handleLinkHover(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!0)}_handleLinkLeave(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!1)}_setCellUnderline(L,B,$,O,F,z){$<0&&(L=0),O<0&&(B=0);const j=this._bufferService.rows-1;$=Math.max(Math.min($,j),0),O=Math.max(Math.min(O,j),0),F=Math.min(F,this._bufferService.cols);const D=this._bufferService.buffer,M=D.ybase+D.y,I=Math.min(D.x,F-1),U=this._optionsService.rawOptions.cursorBlink,K=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let X=$;X<=O;++X){const le=X+D.ydisp,R=this._rowElements[X],H=D.lines.get(le);if(!R||!H)break;R.replaceChildren(...this._rowFactory.createRow(H,le,le===M,K,Y,I,U,this.dimensions.css.cell.width,this._widthCache,z?X===$?L:0:-1,z?(X===O?B:F)-1:-1))}}};o.DomRenderer=P=f([_(4,h.IInstantiationService),_(5,y.ICharSizeService),_(6,h.IOptionsService),_(7,h.IBufferService),_(8,y.ICoreBrowserService),_(9,y.IThemeService)],P)},3787:function(g,o,a){var f=this&&this.__decorate||function(C,E,S,k){var T,P=arguments.length,L=P<3?E:k===null?k=Object.getOwnPropertyDescriptor(E,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(C,E,S,k);else for(var B=C.length-1;B>=0;B--)(T=C[B])&&(L=(P<3?T(L):P>3?T(E,S,L):T(E,S))||L);return P>3&&L&&Object.defineProperty(E,S,L),L},_=this&&this.__param||function(C,E){return function(S,k){E(S,k,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const p=a(2223),m=a(643),x=a(511),w=a(2585),y=a(8055),d=a(4725),u=a(4269),l=a(6171),h=a(3734);let v=o.DomRendererRowFactory=class{constructor(C,E,S,k,T,P,L){this._document=C,this._characterJoinerService=E,this._optionsService=S,this._coreBrowserService=k,this._coreService=T,this._decorationService=P,this._themeService=L,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,E,S){this._selectionStart=C,this._selectionEnd=E,this._columnSelectMode=S}createRow(C,E,S,k,T,P,L,B,$,O,F){const z=[],j=this._characterJoinerService.getJoinedCharacters(E),D=this._themeService.colors;let M,I=C.getNoBgTrimmedLength();S&&I<P+1&&(I=P+1);let U=0,K="",Y=0,X=0,le=0,R=!1,H=0,J=!1,W=0;const re=[],Q=O!==-1&&F!==-1;for(let de=0;de<I;de++){C.loadCell(de,this._workCell);let Le=this._workCell.getWidth();if(Le===0)continue;let Ve=!1,bn=de,se=this._workCell;if(j.length>0&&de===j[0][0]){Ve=!0;const me=j.shift();se=new u.JoinedCellData(this._workCell,C.translateToString(!0,me[0],me[1]),me[1]-me[0]),bn=me[1]-1,Le=se.getWidth()}const Ss=this._isCellInSelection(de,E),_a=S&&de===P,ya=Q&&de>=O&&de<=F;let xa=!1;this._decorationService.forEachDecorationAtCell(de,E,void 0,me=>{xa=!0});let Mi=se.getChars()||m.WHITESPACE_CELL_CHAR;if(Mi===" "&&(se.isUnderline()||se.isOverline())&&(Mi=" "),W=Le*B-$.get(Mi,se.isBold(),se.isItalic()),M){if(U&&(Ss&&J||!Ss&&!J&&se.bg===Y)&&(Ss&&J&&D.selectionForeground||se.fg===X)&&se.extended.ext===le&&ya===R&&W===H&&!_a&&!Ve&&!xa){K+=Mi,U++;continue}U&&(M.textContent=K),M=this._document.createElement("span"),U=0,K=""}else M=this._document.createElement("span");if(Y=se.bg,X=se.fg,le=se.extended.ext,R=ya,H=W,J=Ss,Ve&&P>=de&&P<=bn&&(P=de),!this._coreService.isCursorHidden&&_a){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&re.push("xterm-cursor-blink"),re.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":re.push("xterm-cursor-outline");break;case"block":re.push("xterm-cursor-block");break;case"bar":re.push("xterm-cursor-bar");break;case"underline":re.push("xterm-cursor-underline")}}if(se.isBold()&&re.push("xterm-bold"),se.isItalic()&&re.push("xterm-italic"),se.isDim()&&re.push("xterm-dim"),K=se.isInvisible()?m.WHITESPACE_CELL_CHAR:se.getChars()||m.WHITESPACE_CELL_CHAR,se.isUnderline()&&(re.push(`xterm-underline-${se.extended.underlineStyle}`),K===" "&&(K=" "),!se.isUnderlineColorDefault()))if(se.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(se.getUnderlineColor()).join(",")})`;else{let me=se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&se.isBold()&&me<8&&(me+=8),M.style.textDecorationColor=D.ansi[me].css}se.isOverline()&&(re.push("xterm-overline"),K===" "&&(K=" ")),se.isStrikethrough()&&re.push("xterm-strikethrough"),ya&&(M.style.textDecoration="underline");let ht=se.getFgColor(),bs=se.getFgColorMode(),Pt=se.getBgColor(),ws=se.getBgColorMode();const Sa=!!se.isInverse();if(Sa){const me=ht;ht=Pt,Pt=me;const yv=bs;bs=ws,ws=yv}let lr,ba,cr,Cs=!1;switch(this._decorationService.forEachDecorationAtCell(de,E,void 0,me=>{me.options.layer!=="top"&&Cs||(me.backgroundColorRGB&&(ws=50331648,Pt=me.backgroundColorRGB.rgba>>8&16777215,lr=me.backgroundColorRGB),me.foregroundColorRGB&&(bs=50331648,ht=me.foregroundColorRGB.rgba>>8&16777215,ba=me.foregroundColorRGB),Cs=me.options.layer==="top")}),!Cs&&Ss&&(lr=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,Pt=lr.rgba>>8&16777215,ws=50331648,Cs=!0,D.selectionForeground&&(bs=50331648,ht=D.selectionForeground.rgba>>8&16777215,ba=D.selectionForeground)),Cs&&re.push("xterm-decoration-top"),ws){case 16777216:case 33554432:cr=D.ansi[Pt],re.push(`xterm-bg-${Pt}`);break;case 50331648:cr=y.rgba.toColor(Pt>>16,Pt>>8&255,255&Pt),this._addStyle(M,`background-color:#${b((Pt>>>0).toString(16),"0",6)}`);break;default:Sa?(cr=D.foreground,re.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):cr=D.background}switch(lr||se.isDim()&&(lr=y.color.multiplyOpacity(cr,.5)),bs){case 16777216:case 33554432:se.isBold()&&ht<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ht+=8),this._applyMinimumContrast(M,cr,D.ansi[ht],se,lr,void 0)||re.push(`xterm-fg-${ht}`);break;case 50331648:const me=y.rgba.toColor(ht>>16&255,ht>>8&255,255&ht);this._applyMinimumContrast(M,cr,me,se,lr,ba)||this._addStyle(M,`color:#${b(ht.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,cr,D.foreground,se,lr,void 0)||Sa&&re.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}re.length&&(M.className=re.join(" "),re.length=0),_a||Ve||xa?M.textContent=K:U++,W!==this.defaultSpacing&&(M.style.letterSpacing=`${W}px`),z.push(M),de=bn}return M&&U&&(M.textContent=K),z}_applyMinimumContrast(C,E,S,k,T,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.excludeFromContrastRatioDemands)(k.getCode()))return!1;const L=this._getContrastCache(k);let B;if(T||P||(B=L.getColor(E.rgba,S.rgba)),B===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);B=y.color.ensureContrastRatio(T||E,P||S,$),L.setColor((T||E).rgba,(P||S).rgba,B??null)}return!!B&&(this._addStyle(C,`color:${B.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,E){C.setAttribute("style",`${C.getAttribute("style")||""}${E};`)}_isCellInSelection(C,E){const S=this._selectionStart,k=this._selectionEnd;return!(!S||!k)&&(this._columnSelectMode?S[0]<=k[0]?C>=S[0]&&E>=S[1]&&C<k[0]&&E<=k[1]:C<S[0]&&E>=S[1]&&C>=k[0]&&E<=k[1]:E>S[1]&&E<k[1]||S[1]===k[1]&&E===S[1]&&C>=S[0]&&C<k[0]||S[1]<k[1]&&E===k[1]&&C<k[0]||S[1]<k[1]&&E===S[1]&&C>=S[0])}};function b(C,E,S){for(;C.length<S;)C=E+C;return C}o.DomRendererRowFactory=v=f([_(1,d.ICharacterJoinerService),_(2,w.IOptionsService),_(3,d.ICoreBrowserService),_(4,w.ICoreService),_(5,w.IDecorationService),_(6,d.IThemeService)],v)},2550:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const f=a.createElement("span"),_=a.createElement("span");_.style.fontWeight="bold";const p=a.createElement("span");p.style.fontStyle="italic";const m=a.createElement("span");m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[f,_,p,m],this._container.appendChild(f),this._container.appendChild(_),this._container.appendChild(p),this._container.appendChild(m),a.body.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(a,f,_,p){a===this._font&&f===this._fontSize&&_===this._weight&&p===this._weightBold||(this._font=a,this._fontSize=f,this._weight=_,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(a,f,_){let p=0;if(!f&&!_&&a.length===1&&(p=a.charCodeAt(0))<256)return this._flat[p]!==-9999?this._flat[p]:this._flat[p]=this._measure(a,0);let m=a;f&&(m+="B"),_&&(m+="I");let x=this._holey.get(m);if(x===void 0){let w=0;f&&(w|=1),_&&(w|=2),x=this._measure(a,w),this._holey.set(m,x)}return x}_measure(a,f){const _=this._measureElements[f];return _.textContent=a.repeat(32),_.offsetWidth/32}}},2223:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=a(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(g,o)=>{function a(f){return 57508<=f&&f<=57558}Object.defineProperty(o,"__esModule",{value:!0}),o.createRenderDimensions=o.excludeFromContrastRatioDemands=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},o.isPowerlineGlyph=a,o.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},o.excludeFromContrastRatioDemands=function(f){return a(f)||function(_){return 9472<=_&&_<=9631}(f)},o.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}}}}},456:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(a){this._bufferService=a,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 a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,f=this.selectionEnd;return!(!a||!f)&&(a[1]>f[1]||a[1]===f[1]&&a[0]>f[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(g,o,a){var f=this&&this.__decorate||function(d,u,l,h){var v,b=arguments.length,C=b<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,l,h);else for(var E=d.length-1;E>=0;E--)(v=d[E])&&(C=(b<3?v(C):b>3?v(u,l,C):v(u,l))||C);return b>3&&C&&Object.defineProperty(u,l,C),C},_=this&&this.__param||function(d,u){return function(l,h){u(l,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const p=a(2585),m=a(8460),x=a(844);let w=o.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,u,l){super(),this._optionsService=l,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new y(d,u,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};o.CharSizeService=w=f([_(2,p.IOptionsService)],w);class y{constructor(u,l,h){this._document=u,this._parentElement=l,this._optionsService=h,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const u={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return u.width!==0&&u.height!==0&&(this._result.width=u.width/32,this._result.height=Math.ceil(u.height)),this._result}}},4269:function(g,o,a){var f=this&&this.__decorate||function(u,l,h,v){var b,C=arguments.length,E=C<3?l:v===null?v=Object.getOwnPropertyDescriptor(l,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(u,l,h,v);else for(var S=u.length-1;S>=0;S--)(b=u[S])&&(E=(C<3?b(E):C>3?b(l,h,E):b(l,h))||E);return C>3&&E&&Object.defineProperty(l,h,E),E},_=this&&this.__param||function(u,l){return function(h,v){l(h,v,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const p=a(3734),m=a(643),x=a(511),w=a(2585);class y extends p.AttributeData{constructor(l,h,v){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=h,this._width=v}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()]}}o.JoinedCellData=y;let d=o.CharacterJoinerService=class Jg{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(l){const h={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(h),h.id}deregister(l){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===l)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(l);if(!h||h.length===0)return[];const v=[],b=h.translateToString(!0);let C=0,E=0,S=0,k=h.getFg(0),T=h.getBg(0);for(let P=0;P<h.getTrimmedLength();P++)if(h.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==T){if(P-C>1){const L=this._getJoinedRanges(b,S,E,h,C);for(let B=0;B<L.length;B++)v.push(L[B])}C=P,S=E,k=this._workCell.fg,T=this._workCell.bg}E+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const P=this._getJoinedRanges(b,S,E,h,C);for(let L=0;L<P.length;L++)v.push(P[L])}return v}_getJoinedRanges(l,h,v,b,C){const E=l.substring(h,v);let S=[];try{S=this._characterJoiners[0].handler(E)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const T=this._characterJoiners[k].handler(E);for(let P=0;P<T.length;P++)Jg._mergeRanges(S,T[P])}catch(T){console.error(T)}return this._stringRangesToCellRanges(S,b,C),S}_stringRangesToCellRanges(l,h,v){let b=0,C=!1,E=0,S=l[b];if(S){for(let k=v;k<this._bufferService.cols;k++){const T=h.getWidth(k),P=h.getString(k).length||m.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!C&&S[0]<=E&&(S[0]=k,C=!0),S[1]<=E){if(S[1]=k,S=l[++b],!S)break;S[0]<=E?(S[0]=k,C=!0):C=!1}E+=P}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(l,h){let v=!1;for(let b=0;b<l.length;b++){const C=l[b];if(v){if(h[1]<=C[0])return l[b-1][1]=h[1],l;if(h[1]<=C[1])return l[b-1][1]=Math.max(h[1],C[1]),l.splice(b,1),l;l.splice(b,1),b--}else{if(h[1]<=C[0])return l.splice(b,0,h),l;if(h[1]<=C[1])return C[0]=Math.min(h[0],C[0]),l;h[0]<C[1]&&(C[0]=Math.min(h[0],C[0]),v=!0)}}return v?l[l.length-1][1]=h[1]:l.push(h),l}};o.CharacterJoinerService=d=f([_(0,w.IBufferService)],d)},5114:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0,o.CoreBrowserService=class{constructor(a,f){this._textarea=a,this.window=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(g,o,a){var f=this&&this.__decorate||function(w,y,d,u){var l,h=arguments.length,v=h<3?y:u===null?u=Object.getOwnPropertyDescriptor(y,d):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(w,y,d,u);else for(var b=w.length-1;b>=0;b--)(l=w[b])&&(v=(h<3?l(v):h>3?l(y,d,v):l(y,d))||v);return h>3&&v&&Object.defineProperty(y,d,v),v},_=this&&this.__param||function(w,y){return function(d,u){y(d,u,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const p=a(4725),m=a(9806);let x=o.MouseService=class{constructor(w,y){this._renderService=w,this._charSizeService=y}getCoords(w,y,d,u,l){return(0,m.getCoords)(window,w,y,d,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(w,y){const d=(0,m.getCoordsRelativeToElement)(window,w,y);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};o.MouseService=x=f([_(0,p.IRenderService),_(1,p.ICharSizeService)],x)},3230:function(g,o,a){var f=this&&this.__decorate||function(v,b,C,E){var S,k=arguments.length,T=k<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,C):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(v,b,C,E);else for(var P=v.length-1;P>=0;P--)(S=v[P])&&(T=(k<3?S(T):k>3?S(b,C,T):S(b,C))||T);return k>3&&T&&Object.defineProperty(b,C,T),T},_=this&&this.__param||function(v,b){return function(C,E){b(C,E,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const p=a(3656),m=a(6193),x=a(5596),w=a(4725),y=a(8460),d=a(844),u=a(7226),l=a(2585);let h=o.RenderService=class extends d.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,b,C,E,S,k,T,P){if(super(),this._rowCount=v,this._charSizeService=E,this._renderer=this.register(new d.MutableDisposable),this._pausedResizeTask=new u.DebouncedIdleTask,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 y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer(T.window,(L,B)=>this._renderRows(L,B)),this.register(this._renderDebouncer),this._screenDprMonitor=new x.ScreenDprMonitor(T.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var L;return(L=this._renderer.value)===null||L===void 0?void 0:L.clear()})),this.register(C.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()})),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register((0,p.addDisposableDomListener)(T.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(P.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in T.window){const L=new T.window.IntersectionObserver(B=>this._handleIntersectionChange(B[B.length-1]),{threshold:0});L.observe(b),this.register({dispose:()=>L.disconnect()})}}_handleIntersectionChange(v){this._isPaused=v.isIntersecting===void 0?v.intersectionRatio===0:!v.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(v,b,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,b,this._rowCount))}_renderRows(v,b){this._renderer.value&&(v=Math.min(v,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(v,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:v,end:b}),this._onRender.fire({start:v,end:b}),this._isNextRenderRedrawOnly=!0)}resize(v,b){this._rowCount=b,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(v){this._renderer.value=v,this._renderer.value.onRequestRedraw(b=>this.refreshRows(b.start,b.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(v){return this._renderDebouncer.addRefreshCallback(v)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var v,b;this._renderer.value&&((b=(v=this._renderer.value).clearTextureAtlas)===null||b===void 0||b.call(v),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(v,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(v,b)):this._renderer.value.handleResize(v,b),this._fullRefresh())}handleCharSizeChanged(){var v;(v=this._renderer.value)===null||v===void 0||v.handleCharSizeChanged()}handleBlur(){var v;(v=this._renderer.value)===null||v===void 0||v.handleBlur()}handleFocus(){var v;(v=this._renderer.value)===null||v===void 0||v.handleFocus()}handleSelectionChanged(v,b,C){var E;this._selectionState.start=v,this._selectionState.end=b,this._selectionState.columnSelectMode=C,(E=this._renderer.value)===null||E===void 0||E.handleSelectionChanged(v,b,C)}handleCursorMove(){var v;(v=this._renderer.value)===null||v===void 0||v.handleCursorMove()}clear(){var v;(v=this._renderer.value)===null||v===void 0||v.clear()}};o.RenderService=h=f([_(2,l.IOptionsService),_(3,w.ICharSizeService),_(4,l.IDecorationService),_(5,l.IBufferService),_(6,w.ICoreBrowserService),_(7,w.IThemeService)],h)},9312:function(g,o,a){var f=this&&this.__decorate||function(S,k,T,P){var L,B=arguments.length,$=B<3?k:P===null?P=Object.getOwnPropertyDescriptor(k,T):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(S,k,T,P);else for(var O=S.length-1;O>=0;O--)(L=S[O])&&($=(B<3?L($):B>3?L(k,T,$):L(k,T))||$);return B>3&&$&&Object.defineProperty(k,T,$),$},_=this&&this.__param||function(S,k){return function(T,P){k(T,P,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const p=a(9806),m=a(9504),x=a(456),w=a(4725),y=a(8460),d=a(844),u=a(6114),l=a(4841),h=a(511),v=a(2585),b=" ",C=new RegExp(b,"g");let E=o.SelectionService=class extends d.Disposable{constructor(S,k,T,P,L,B,$,O,F){super(),this._element=S,this._screenElement=k,this._linkifier=T,this._bufferService=P,this._coreService=L,this._mouseService=B,this._optionsService=$,this._renderService=O,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=z=>this._handleMouseMove(z),this._mouseUpListener=z=>this._handleMouseUp(z),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(z=>this._handleTrim(z)),this.register(this._bufferService.buffers.onBufferActivate(z=>this._handleBufferActivate(z))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.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 S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!S||!k||S[0]===k[0]&&S[1]===k[1])}get selectionText(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!S||!k)return"";const T=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(S[0]===k[0])return"";const L=S[0]<k[0]?S[0]:k[0],B=S[0]<k[0]?k[0]:S[0];for(let $=S[1];$<=k[1];$++){const O=T.translateBufferLineToString($,!0,L,B);P.push(O)}}else{const L=S[1]===k[1]?k[0]:void 0;P.push(T.translateBufferLineToString(S[1],!0,S[0],L));for(let B=S[1]+1;B<=k[1]-1;B++){const $=T.lines.get(B),O=T.translateBufferLineToString(B,!0);$!=null&&$.isWrapped?P[P.length-1]+=O:P.push(O)}if(S[1]!==k[1]){const B=T.lines.get(k[1]),$=T.translateBufferLineToString(k[1],!0,0,k[0]);B&&B.isWrapped?P[P.length-1]+=$:P.push($)}}return P.map(L=>L.replace(C," ")).join(u.isWindows?`\r
53
+ `:`
54
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),u.isLinux&&S&&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(S){const k=this._getMouseBufferCoords(S),T=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(T&&P&&k)&&this._areCoordsInSelection(k,T,P)}isCellInSelection(S,k){const T=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!T||!P)&&this._areCoordsInSelection([S,k],T,P)}_areCoordsInSelection(S,k,T){return S[1]>k[1]&&S[1]<T[1]||k[1]===T[1]&&S[1]===k[1]&&S[0]>=k[0]&&S[0]<T[0]||k[1]<T[1]&&S[1]===T[1]&&S[0]<T[0]||k[1]<T[1]&&S[1]===k[1]&&S[0]>=k[0]}_selectWordAtCursor(S,k){var T,P;const L=(P=(T=this._linkifier.currentLink)===null||T===void 0?void 0:T.link)===null||P===void 0?void 0:P.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 B=this._getMouseBufferCoords(S);return!!B&&(this._selectWordAt(B,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,k){this._model.clearSelection(),S=Math.max(S,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const k=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(S){let k=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=T?0:(k>T&&(k-=T),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(S){return u.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const k=this._getMouseBufferCoords(S);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(S){return S.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!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(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const P=T.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const k=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const P=(0,m.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,T=!(!S||!k||S[0]===k[0]&&S[1]===k[1]);T?S&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,k,T)):this._oldHasSelection&&this._fireOnSelectionChange(S,k,T)}_fireOnSelectionChange(S,k,T){this._oldSelectionStart=S,this._oldSelectionEnd=k,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(S,k){let T=k;for(let P=0;k>=P;P++){const L=S.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:L>1&&k!==P&&(T+=L-1)}return T}setSelection(S,k,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,k],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,k,T=!0,P=!0){if(S[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,B=L.lines.get(S[1]);if(!B)return;const $=L.translateBufferLineToString(S[1],!1);let O=this._convertViewportColToCharacterIndex(B,S[0]),F=O;const z=S[0]-O;let j=0,D=0,M=0,I=0;if($.charAt(O)===" "){for(;O>0&&$.charAt(O-1)===" ";)O--;for(;F<$.length&&$.charAt(F+1)===" ";)F++}else{let Y=S[0],X=S[0];B.getWidth(Y)===0&&(j++,Y--),B.getWidth(X)===2&&(D++,X++);const le=B.getString(X).length;for(le>1&&(I+=le-1,F+=le-1);Y>0&&O>0&&!this._isCharWordSeparator(B.loadCell(Y-1,this._workCell));){B.loadCell(Y-1,this._workCell);const R=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,Y--):R>1&&(M+=R-1,O-=R-1),O--,Y--}for(;X<B.length&&F+1<$.length&&!this._isCharWordSeparator(B.loadCell(X+1,this._workCell));){B.loadCell(X+1,this._workCell);const R=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,X++):R>1&&(I+=R-1,F+=R-1),F++,X++}}F++;let U=O+z-j+M,K=Math.min(this._bufferService.cols,F-O+j+D-M-I);if(k||$.slice(O,F).trim()!==""){if(T&&U===0&&B.getCodePoint(0)!==32){const Y=L.lines.get(S[1]-1);if(Y&&B.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const X=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(X){const le=this._bufferService.cols-X.start;U-=le,K+=le}}}if(P&&U+K===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const Y=L.lines.get(S[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const X=this._getWordAt([0,S[1]+1],!1,!1,!0);X&&(K+=X.length)}}return{start:U,length:K}}}_selectWordAt(S,k){const T=this._getWordAt(S,k);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[T.start,S[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(S){const k=this._getWordAt(S,!0);if(k){let T=S[1];for(;k.start<0;)k.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,T]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const k=this._bufferService.buffer.getWrappedRangeForLine(S),T={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(T,this._bufferService.cols)}};o.SelectionService=E=f([_(3,v.IBufferService),_(4,v.ICoreService),_(5,w.IMouseService),_(6,v.IOptionsService),_(7,w.IRenderService),_(8,w.ICoreBrowserService)],E)},4725:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=a(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService")},6731:function(g,o,a){var f=this&&this.__decorate||function(E,S,k,T){var P,L=arguments.length,B=L<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(E,S,k,T);else for(var $=E.length-1;$>=0;$--)(P=E[$])&&(B=(L<3?P(B):L>3?P(S,k,B):P(S,k))||B);return L>3&&B&&Object.defineProperty(S,k,B),B},_=this&&this.__param||function(E,S){return function(k,T){S(k,T,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const p=a(7239),m=a(8055),x=a(8460),w=a(844),y=a(2585),d=m.css.toColor("#ffffff"),u=m.css.toColor("#000000"),l=m.css.toColor("#ffffff"),h=m.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let k=0;k<216;k++){const T=S[k/36%6|0],P=S[k/6%6|0],L=S[k%6];E.push({css:m.channels.toCss(T,P,L),rgba:m.channels.toRgba(T,P,L)})}for(let k=0;k<24;k++){const T=8+10*k;E.push({css:m.channels.toCss(T,T,T),rgba:m.channels.toRgba(T,T,T)})}return E})());let b=o.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:u,cursor:l,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:m.color.blend(u,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:m.color.blend(u,v),ansi:o.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(E={}){const S=this._colors;if(S.foreground=C(E.foreground,d),S.background=C(E.background,u),S.cursor=C(E.cursor,l),S.cursorAccent=C(E.cursorAccent,h),S.selectionBackgroundTransparent=C(E.selectionBackground,v),S.selectionBackgroundOpaque=m.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=C(E.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=m.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=E.selectionForeground?C(E.selectionForeground,m.NULL_COLOR):void 0,S.selectionForeground===m.NULL_COLOR&&(S.selectionForeground=void 0),m.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=m.color.opacity(S.selectionBackgroundTransparent,.3)),m.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=m.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=o.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=C(E.black,o.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=C(E.red,o.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=C(E.green,o.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=C(E.yellow,o.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=C(E.blue,o.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=C(E.magenta,o.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=C(E.cyan,o.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=C(E.white,o.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=C(E.brightBlack,o.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=C(E.brightRed,o.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=C(E.brightGreen,o.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=C(E.brightYellow,o.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=C(E.brightBlue,o.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=C(E.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=C(E.brightCyan,o.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=C(E.brightWhite,o.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const k=Math.min(S.ansi.length-16,E.extendedAnsi.length);for(let T=0;T<k;T++)S.ansi[T+16]=C(E.extendedAnsi[T],o.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[E]=this._restoreColors.ansi[E]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(E){E(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function C(E,S){if(E!==void 0)try{return m.css.toColor(E)}catch{}return S}o.ThemeService=b=f([_(0,y.IOptionsService)],b)},6349:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=a(8460),_=a(844);class p extends _.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(x){if(this._maxLength===x)return;const w=new Array(x);for(let y=0;y<Math.min(x,this.length);y++)w[y]=this._array[this._getCyclicIndex(y)];this._array=w,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let w=this._length;w<x;w++)this._array[w]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,w){this._array[this._getCyclicIndex(x)]=w}push(x){this._array[this._getCyclicIndex(this._length)]=x,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(x,w,...y){if(w){for(let d=x;d<this._length-w;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+w)];this._length-=w,this.onDeleteEmitter.fire({index:x,amount:w})}for(let d=this._length-1;d>=x;d--)this._array[this._getCyclicIndex(d+y.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<y.length;d++)this._array[this._getCyclicIndex(x+d)]=y[d];if(y.length&&this.onInsertEmitter.fire({index:x,amount:y.length}),this._length+y.length>this._maxLength){const d=this._length+y.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=y.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,w,y){if(!(w<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let u=w-1;u>=0;u--)this.set(x+u+y,this.get(x+u));const d=x+w+y-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<w;d++)this.set(x+d+y,this.get(x+d))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}o.CircularList=p},1439:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function a(f,_=5){if(typeof f!="object")return f;const p=Array.isArray(f)?[]:{};for(const m in f)p[m]=_<=1?f[m]:f[m]&&a(f[m],_-1);return p}},8055:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;const f=a(6114);let _=0,p=0,m=0,x=0;var w,y,d,u,l;function h(b){const C=b.toString(16);return C.length<2?"0"+C:C}function v(b,C){return b<C?(C+.05)/(b+.05):(b+.05)/(C+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(b){b.toCss=function(C,E,S,k){return k!==void 0?`#${h(C)}${h(E)}${h(S)}${h(k)}`:`#${h(C)}${h(E)}${h(S)}`},b.toRgba=function(C,E,S,k=255){return(C<<24|E<<16|S<<8|k)>>>0}}(w||(o.channels=w={})),function(b){function C(E,S){return x=Math.round(255*S),[_,p,m]=l.toChannels(E.rgba),{css:w.toCss(_,p,m,x),rgba:w.toRgba(_,p,m,x)}}b.blend=function(E,S){if(x=(255&S.rgba)/255,x===1)return{css:S.css,rgba:S.rgba};const k=S.rgba>>24&255,T=S.rgba>>16&255,P=S.rgba>>8&255,L=E.rgba>>24&255,B=E.rgba>>16&255,$=E.rgba>>8&255;return _=L+Math.round((k-L)*x),p=B+Math.round((T-B)*x),m=$+Math.round((P-$)*x),{css:w.toCss(_,p,m),rgba:w.toRgba(_,p,m)}},b.isOpaque=function(E){return(255&E.rgba)==255},b.ensureContrastRatio=function(E,S,k){const T=l.ensureContrastRatio(E.rgba,S.rgba,k);if(T)return l.toColor(T>>24&255,T>>16&255,T>>8&255)},b.opaque=function(E){const S=(255|E.rgba)>>>0;return[_,p,m]=l.toChannels(S),{css:w.toCss(_,p,m),rgba:S}},b.opacity=C,b.multiplyOpacity=function(E,S){return x=255&E.rgba,C(E,x*S/255)},b.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(y||(o.color=y={})),function(b){let C,E;if(!f.isNode){const S=document.createElement("canvas");S.width=1,S.height=1;const k=S.getContext("2d",{willReadFrequently:!0});k&&(C=k,C.globalCompositeOperation="copy",E=C.createLinearGradient(0,0,1,1))}b.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return _=parseInt(S.slice(1,2).repeat(2),16),p=parseInt(S.slice(2,3).repeat(2),16),m=parseInt(S.slice(3,4).repeat(2),16),l.toColor(_,p,m);case 5:return _=parseInt(S.slice(1,2).repeat(2),16),p=parseInt(S.slice(2,3).repeat(2),16),m=parseInt(S.slice(3,4).repeat(2),16),x=parseInt(S.slice(4,5).repeat(2),16),l.toColor(_,p,m,x);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const k=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return _=parseInt(k[1]),p=parseInt(k[2]),m=parseInt(k[3]),x=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),l.toColor(_,p,m,x);if(!C||!E)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=E,C.fillStyle=S,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[_,p,m,x]=C.getImageData(0,0,1,1).data,x!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:w.toRgba(_,p,m,x),css:S}}}(d||(o.css=d={})),function(b){function C(E,S,k){const T=E/255,P=S/255,L=k/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}b.relativeLuminance=function(E){return C(E>>16&255,E>>8&255,255&E)},b.relativeLuminance2=C}(u||(o.rgb=u={})),function(b){function C(S,k,T){const P=S>>24&255,L=S>>16&255,B=S>>8&255;let $=k>>24&255,O=k>>16&255,F=k>>8&255,z=v(u.relativeLuminance2($,O,F),u.relativeLuminance2(P,L,B));for(;z<T&&($>0||O>0||F>0);)$-=Math.max(0,Math.ceil(.1*$)),O-=Math.max(0,Math.ceil(.1*O)),F-=Math.max(0,Math.ceil(.1*F)),z=v(u.relativeLuminance2($,O,F),u.relativeLuminance2(P,L,B));return($<<24|O<<16|F<<8|255)>>>0}function E(S,k,T){const P=S>>24&255,L=S>>16&255,B=S>>8&255;let $=k>>24&255,O=k>>16&255,F=k>>8&255,z=v(u.relativeLuminance2($,O,F),u.relativeLuminance2(P,L,B));for(;z<T&&($<255||O<255||F<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),O=Math.min(255,O+Math.ceil(.1*(255-O))),F=Math.min(255,F+Math.ceil(.1*(255-F))),z=v(u.relativeLuminance2($,O,F),u.relativeLuminance2(P,L,B));return($<<24|O<<16|F<<8|255)>>>0}b.ensureContrastRatio=function(S,k,T){const P=u.relativeLuminance(S>>8),L=u.relativeLuminance(k>>8);if(v(P,L)<T){if(L<P){const O=C(S,k,T),F=v(P,u.relativeLuminance(O>>8));if(F<T){const z=E(S,k,T);return F>v(P,u.relativeLuminance(z>>8))?O:z}return O}const B=E(S,k,T),$=v(P,u.relativeLuminance(B>>8));if($<T){const O=C(S,k,T);return $>v(P,u.relativeLuminance(O>>8))?B:O}return B}},b.reduceLuminance=C,b.increaseLuminance=E,b.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]},b.toColor=function(S,k,T,P){return{css:w.toCss(S,k,T,P),rgba:w.toRgba(S,k,T,P)}}}(l||(o.rgba=l={})),o.toPaddedHex=h,o.contrastRatio=v},8969:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=a(844),_=a(2585),p=a(4348),m=a(7866),x=a(744),w=a(7302),y=a(6975),d=a(8460),u=a(1753),l=a(1480),h=a(7994),v=a(9282),b=a(5435),C=a(5981),E=a(2660);let S=!1;class k extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event(P=>{var L;(L=this._onScrollApi)===null||L===void 0||L.fire(P.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(P){for(const L in P)this.optionsService.options[L]=P[L]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new w.OptionsService(P)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new b.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.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(L=>{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(L=>{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 C.WriteBuffer((L,B)=>this._inputHandler.parse(L,B))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,L){this._writeBuffer.write(P,L)}writeSync(P,L){this._logService.logLevel<=_.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(P,L)}resize(P,L){isNaN(P)||isNaN(L)||(P=Math.max(P,x.MINIMUM_COLS),L=Math.max(L,x.MINIMUM_ROWS),this._bufferService.resize(P,L))}scroll(P,L=!1){this._bufferService.scroll(P,L)}scrollLines(P,L,B){this._bufferService.scrollLines(P,L,B)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const L=P-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(P,L){return this._inputHandler.registerEscHandler(P,L)}registerDcsHandler(P,L){return this._inputHandler.registerDcsHandler(P,L)}registerCsiHandler(P,L){return this._inputHandler.registerCsiHandler(P,L)}registerOscHandler(P,L){return this._inputHandler.registerOscHandler(P,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?P=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const L of P)L.dispose()})}}}o.CoreTerminal=k},8460:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===a)return void this._listeners.splice(f,1)}}})),this._event}fire(a,f){const _=[];for(let p=0;p<this._listeners.length;p++)_.push(this._listeners[p]);for(let p=0;p<_.length;p++)_[p].call(void 0,a,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(a,f){return a(_=>f.fire(_))}},5435:function(g,o,a){var f=this&&this.__decorate||function(z,j,D,M){var I,U=arguments.length,K=U<3?j:M===null?M=Object.getOwnPropertyDescriptor(j,D):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(z,j,D,M);else for(var Y=z.length-1;Y>=0;Y--)(I=z[Y])&&(K=(U<3?I(K):U>3?I(j,D,K):I(j,D))||K);return U>3&&K&&Object.defineProperty(j,D,K),K},_=this&&this.__param||function(z,j){return function(D,M){j(D,M,z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const p=a(2584),m=a(7116),x=a(2015),w=a(844),y=a(482),d=a(8437),u=a(8460),l=a(643),h=a(511),v=a(3734),b=a(2585),C=a(6242),E=a(6351),S=a(5941),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2},T=131072;function P(z,j){if(z>24)return j.setWinLines||!1;switch(z){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var L;(function(z){z[z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",z[z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(L||(o.WindowsOptionsReportType=L={}));let B=0;class $ extends w.Disposable{getAttrData(){return this._curAttrData}constructor(j,D,M,I,U,K,Y,X,le=new x.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=D,this._coreService=M,this._logService=I,this._optionsService=U,this._oscLinkService=K,this._coreMouseService=Y,this._unicodeService=X,this._parser=le,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.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 O(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._parser.setCsiHandlerFallback((R,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:H.toArray()})}),this._parser.setEscHandlerFallback(R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})}),this._parser.setExecuteHandlerFallback(R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})}),this._parser.setOscHandlerFallback((R,H,J)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:H,data:J})}),this._parser.setDcsHandlerFallback((R,H,J)=>{H==="HOOK"&&(J=J.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:H,payload:J})}),this._parser.setPrintHandler((R,H,J)=>this.print(R,H,J)),this._parser.registerCsiHandler({final:"@"},R=>this.insertChars(R)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},R=>this.scrollLeft(R)),this._parser.registerCsiHandler({final:"A"},R=>this.cursorUp(R)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},R=>this.scrollRight(R)),this._parser.registerCsiHandler({final:"B"},R=>this.cursorDown(R)),this._parser.registerCsiHandler({final:"C"},R=>this.cursorForward(R)),this._parser.registerCsiHandler({final:"D"},R=>this.cursorBackward(R)),this._parser.registerCsiHandler({final:"E"},R=>this.cursorNextLine(R)),this._parser.registerCsiHandler({final:"F"},R=>this.cursorPrecedingLine(R)),this._parser.registerCsiHandler({final:"G"},R=>this.cursorCharAbsolute(R)),this._parser.registerCsiHandler({final:"H"},R=>this.cursorPosition(R)),this._parser.registerCsiHandler({final:"I"},R=>this.cursorForwardTab(R)),this._parser.registerCsiHandler({final:"J"},R=>this.eraseInDisplay(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},R=>this.eraseInDisplay(R,!0)),this._parser.registerCsiHandler({final:"K"},R=>this.eraseInLine(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},R=>this.eraseInLine(R,!0)),this._parser.registerCsiHandler({final:"L"},R=>this.insertLines(R)),this._parser.registerCsiHandler({final:"M"},R=>this.deleteLines(R)),this._parser.registerCsiHandler({final:"P"},R=>this.deleteChars(R)),this._parser.registerCsiHandler({final:"S"},R=>this.scrollUp(R)),this._parser.registerCsiHandler({final:"T"},R=>this.scrollDown(R)),this._parser.registerCsiHandler({final:"X"},R=>this.eraseChars(R)),this._parser.registerCsiHandler({final:"Z"},R=>this.cursorBackwardTab(R)),this._parser.registerCsiHandler({final:"`"},R=>this.charPosAbsolute(R)),this._parser.registerCsiHandler({final:"a"},R=>this.hPositionRelative(R)),this._parser.registerCsiHandler({final:"b"},R=>this.repeatPrecedingCharacter(R)),this._parser.registerCsiHandler({final:"c"},R=>this.sendDeviceAttributesPrimary(R)),this._parser.registerCsiHandler({prefix:">",final:"c"},R=>this.sendDeviceAttributesSecondary(R)),this._parser.registerCsiHandler({final:"d"},R=>this.linePosAbsolute(R)),this._parser.registerCsiHandler({final:"e"},R=>this.vPositionRelative(R)),this._parser.registerCsiHandler({final:"f"},R=>this.hVPosition(R)),this._parser.registerCsiHandler({final:"g"},R=>this.tabClear(R)),this._parser.registerCsiHandler({final:"h"},R=>this.setMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"h"},R=>this.setModePrivate(R)),this._parser.registerCsiHandler({final:"l"},R=>this.resetMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"l"},R=>this.resetModePrivate(R)),this._parser.registerCsiHandler({final:"m"},R=>this.charAttributes(R)),this._parser.registerCsiHandler({final:"n"},R=>this.deviceStatus(R)),this._parser.registerCsiHandler({prefix:"?",final:"n"},R=>this.deviceStatusPrivate(R)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},R=>this.softReset(R)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},R=>this.setCursorStyle(R)),this._parser.registerCsiHandler({final:"r"},R=>this.setScrollRegion(R)),this._parser.registerCsiHandler({final:"s"},R=>this.saveCursor(R)),this._parser.registerCsiHandler({final:"t"},R=>this.windowOptions(R)),this._parser.registerCsiHandler({final:"u"},R=>this.restoreCursor(R)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},R=>this.insertColumns(R)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},R=>this.deleteColumns(R)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},R=>this.selectProtected(R)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},R=>this.requestMode(R,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},R=>this.requestMode(R,!1)),this._parser.setExecuteHandler(p.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(p.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(p.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(p.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(p.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(p.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(p.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(p.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(p.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(p.C1.IND,()=>this.index()),this._parser.setExecuteHandler(p.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(p.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new C.OscHandler(R=>(this.setTitle(R),this.setIconName(R),!0))),this._parser.registerOscHandler(1,new C.OscHandler(R=>this.setIconName(R))),this._parser.registerOscHandler(2,new C.OscHandler(R=>this.setTitle(R))),this._parser.registerOscHandler(4,new C.OscHandler(R=>this.setOrReportIndexedColor(R))),this._parser.registerOscHandler(8,new C.OscHandler(R=>this.setHyperlink(R))),this._parser.registerOscHandler(10,new C.OscHandler(R=>this.setOrReportFgColor(R))),this._parser.registerOscHandler(11,new C.OscHandler(R=>this.setOrReportBgColor(R))),this._parser.registerOscHandler(12,new C.OscHandler(R=>this.setOrReportCursorColor(R))),this._parser.registerOscHandler(104,new C.OscHandler(R=>this.restoreIndexedColor(R))),this._parser.registerOscHandler(110,new C.OscHandler(R=>this.restoreFgColor(R))),this._parser.registerOscHandler(111,new C.OscHandler(R=>this.restoreBgColor(R))),this._parser.registerOscHandler(112,new C.OscHandler(R=>this.restoreCursorColor(R))),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 R in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},()=>this.selectCharset("("+R)),this._parser.registerEscHandler({intermediates:")",final:R},()=>this.selectCharset(")"+R)),this._parser.registerEscHandler({intermediates:"*",final:R},()=>this.selectCharset("*"+R)),this._parser.registerEscHandler({intermediates:"+",final:R},()=>this.selectCharset("+"+R)),this._parser.registerEscHandler({intermediates:"-",final:R},()=>this.selectCharset("-"+R)),this._parser.registerEscHandler({intermediates:".",final:R},()=>this.selectCharset("."+R)),this._parser.registerEscHandler({intermediates:"/",final:R},()=>this.selectCharset("/"+R));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(R=>(this._logService.error("Parsing error: ",R),R)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler((R,H)=>this.requestStatusString(R,H)))}_preserveStack(j,D,M,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=M,this._parseStack.position=I}_logSlowResolvingAsync(j){this._logService.logLevel<=b.LogLevelEnum.WARN&&Promise.race([j,new Promise((D,M)=>setTimeout(()=>M("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,D){let M,I=this._activeBuffer.x,U=this._activeBuffer.y,K=0;const Y=this._parseStack.paused;if(Y){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(M),M;I=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>T&&(K=this._parseStack.position+T)}if(this._logService.logLevel<=b.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,X=>String.fromCharCode(X)).join("")}"`),typeof j=="string"?j.split("").map(X=>X.charCodeAt(0)):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<T&&(this._parseBuffer=new Uint32Array(Math.min(j.length,T))),Y||this._dirtyRowTracker.clearRange(),j.length>T)for(let X=K;X<j.length;X+=T){const le=X+T<j.length?X+T:j.length,R=typeof j=="string"?this._stringDecoder.decode(j.substring(X,le),this._parseBuffer):this._utf8Decoder.decode(j.subarray(X,le),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,R))return this._preserveStack(I,U,R,X),this._logSlowResolvingAsync(M),M}else if(!Y){const X=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,X))return this._preserveStack(I,U,X,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===I&&this._activeBuffer.y===U||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(j,D,M){let I,U;const K=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,X=this._bufferService.cols,le=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,H=this._curAttrData;let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-D>0&&J.getWidth(this._activeBuffer.x-1)===2&&J.setCellFromCodePoint(this._activeBuffer.x-1,0,1,H.fg,H.bg,H.extended);for(let W=D;W<M;++W){if(I=j[W],U=this._unicodeService.wcwidth(I),I<127&&K){const re=K[String.fromCharCode(I)];re&&(I=re.charCodeAt(0))}if(Y&&this._onA11yChar.fire((0,y.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),U||!this._activeBuffer.x){if(this._activeBuffer.x+U-1>=X){if(le){for(;this._activeBuffer.x<X;)J.setCellFromCodePoint(this._activeBuffer.x++,0,1,H.fg,H.bg,H.extended);this._activeBuffer.x=0,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),J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=X-1,U===2)continue}if(R&&(J.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(H),H),J.getWidth(X-1)===2&&J.setCellFromCodePoint(X-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,H.fg,H.bg,H.extended)),J.setCellFromCodePoint(this._activeBuffer.x++,I,U,H.fg,H.bg,H.extended),U>0)for(;--U;)J.setCellFromCodePoint(this._activeBuffer.x++,0,0,H.fg,H.bg,H.extended)}else J.getWidth(this._activeBuffer.x-1)?J.addCodepointToCell(this._activeBuffer.x-1,I):J.addCodepointToCell(this._activeBuffer.x-2,I)}M-D>0&&(J.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<X&&M-D>0&&J.getWidth(this._activeBuffer.x)===0&&!J.hasContent(this._activeBuffer.x)&&J.setCellFromCodePoint(this._activeBuffer.x,0,1,H.fg,H.bg,H.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,D){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,D):this._parser.registerCsiHandler(j,M=>!P(M.params[0],this._optionsService.rawOptions.windowOptions)||D(M))}registerDcsHandler(j,D){return this._parser.registerDcsHandler(j,new E.DcsHandler(D))}registerEscHandler(j,D){return this._parser.registerEscHandler(j,D)}registerOscHandler(j,D){return this._parser.registerOscHandler(j,new C.OscHandler(D))}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 j;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&&(!((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||j===void 0)&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=j,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+D)}cursorUp(j){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const D=j.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=j.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=j.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const D=j.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,D,M,I=!1,U=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);K.replaceCells(D,M,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),U),I&&(K.isWrapped=!1)}_resetBufferLine(j,D=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),M.isWrapped=!1)}eraseInDisplay(j,D=!1){let M;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);M<this._bufferService.rows;M++)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(M);break;case 1:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(j,D=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let D=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;D--;)this._activeBuffer.lines.splice(U-1,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let D=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;D--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let D=j.params[0]||1;for(;D--;)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(j){let D=j.params[0]||1;for(;D--;)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(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);I.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);I.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);I.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=j.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);I.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){if(!this._parser.precedingCodepoint)return!0;const D=j.params[0]||1,M=new Uint32Array(D);for(let I=0;I<D;++I)M[I]=this._parser.precedingCodepoint;return this.print(M,0,M.length),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let D=0;D<j.length;D++)switch(j.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let D=0;D<j.length;D++)switch(j.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(j){for(let D=0;D<j.length;D++)switch(j.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let D=0;D<j.length;D++)switch(j.params[D]){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(),j.params[D]===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(j,D){const M=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:U}=this._coreMouseService,K=this._coreService,{buffers:Y,cols:X}=this._bufferService,{active:le,alt:R}=Y,H=this._optionsService.rawOptions,J=de=>de?1:2,W=j.params[0];return re=W,Q=D?W===2?4:W===4?J(K.modes.insertMode):W===12?3:W===20?J(H.convertEol):0:W===1?J(M.applicationCursorKeys):W===3?H.windowOptions.setWinLines?X===80?2:X===132?1:0:0:W===6?J(M.origin):W===7?J(M.wraparound):W===8?3:W===9?J(I==="X10"):W===12?J(H.cursorBlink):W===25?J(!K.isCursorHidden):W===45?J(M.reverseWraparound):W===66?J(M.applicationKeypad):W===67?4:W===1e3?J(I==="VT200"):W===1002?J(I==="DRAG"):W===1003?J(I==="ANY"):W===1004?J(M.sendFocus):W===1005?4:W===1006?J(U==="SGR"):W===1015?4:W===1016?J(U==="SGR_PIXELS"):W===1048?1:W===47||W===1047||W===1049?J(le===R):W===2004?J(M.bracketedPasteMode):0,K.triggerDataEvent(`${p.C0.ESC}[${D?"":"?"}${re};${Q}$y`),!0;var re,Q}_updateAttrColor(j,D,M,I,U){return D===2?(j|=50331648,j&=-16777216,j|=v.AttributeData.fromColorRGB([M,I,U])):D===5&&(j&=-50331904,j|=33554432|255&M),j}_extractColor(j,D,M){const I=[0,0,-1,0,0,0];let U=0,K=0;do{if(I[K+U]=j.params[D+K],j.hasSubParams(D+K)){const Y=j.getSubParams(D+K);let X=0;do I[1]===5&&(U=1),I[K+X+1+U]=Y[X];while(++X<Y.length&&X+K+1+U<I.length);break}if(I[1]===5&&K+U>=2||I[1]===2&&K+U>=5)break;I[1]&&(U=1)}while(++K+D<j.length&&K+U<I.length);for(let Y=2;Y<I.length;++Y)I[Y]===-1&&(I[Y]=0);switch(I[0]){case 38:M.fg=this._updateAttrColor(M.fg,I[1],I[3],I[4],I[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,I[1],I[3],I[4],I[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,I[1],I[3],I[4],I[5])}return K}_processUnderline(j,D){D.extended=D.extended.clone(),(!~j||j>5)&&(j=1),D.extended.underlineStyle=j,D.fg|=268435456,j===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(j){j.fg=d.DEFAULT_ATTR_DATA.fg,j.bg=d.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=j.length;let M;const I=this._curAttrData;for(let U=0;U<D;U++)M=j.params[U],M>=30&&M<=37?(I.fg&=-50331904,I.fg|=16777216|M-30):M>=40&&M<=47?(I.bg&=-50331904,I.bg|=16777216|M-40):M>=90&&M<=97?(I.fg&=-50331904,I.fg|=16777224|M-90):M>=100&&M<=107?(I.bg&=-50331904,I.bg|=16777224|M-100):M===0?this._processSGR0(I):M===1?I.fg|=134217728:M===3?I.bg|=67108864:M===4?(I.fg|=268435456,this._processUnderline(j.hasSubParams(U)?j.getSubParams(U)[0]:1,I)):M===5?I.fg|=536870912:M===7?I.fg|=67108864:M===8?I.fg|=1073741824:M===9?I.fg|=2147483648:M===2?I.bg|=134217728:M===21?this._processUnderline(2,I):M===22?(I.fg&=-134217729,I.bg&=-134217729):M===23?I.bg&=-67108865:M===24?(I.fg&=-268435457,this._processUnderline(0,I)):M===25?I.fg&=-536870913:M===27?I.fg&=-67108865:M===28?I.fg&=-1073741825:M===29?I.fg&=2147483647:M===39?(I.fg&=-67108864,I.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):M===49?(I.bg&=-67108864,I.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?U+=this._extractColor(j,U,I):M===53?I.bg|=1073741824:M===55?I.bg&=-1073741825:M===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):M===100?(I.fg&=-67108864,I.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${D};${M}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${D};${M}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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(j){const D=j.params[0]||1;switch(D){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 M=D%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(j){const D=j.params[0]||1;let M;return(j.length<2||(M=j.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(j){if(!P(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(L.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(L.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const D=[],M=j.split(";");for(;M.length>1;){const I=M.shift(),U=M.shift();if(/^\d+$/.exec(I)){const K=parseInt(I);if(F(K))if(U==="?")D.push({type:0,index:K});else{const Y=(0,S.parseColor)(U);Y&&D.push({type:1,index:K,color:Y})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(j){const D=j.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(j,D){this._getCurrentLinkId()&&this._finishHyperlink();const M=j.split(":");let I;const U=M.findIndex(K=>K.startsWith("id="));return U!==-1&&(I=M[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,D){const M=j.split(";");for(let I=0;I<M.length&&!(D>=this._specialColors.length);++I,++D)if(M[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const U=(0,S.parseColor)(M[I]);U&&this._onColor.fire([{type:1,index:this._specialColors[D],color:U}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const D=[],M=j.split(";");for(let I=0;I<M.length;++I)if(/^\d+$/.exec(M[I])){const U=parseInt(M[I]);F(U)&&D.push({type:2,index:U})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,m.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(k[j[0]],m.CHARSETS[j[1]]||m.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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new h.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const M=this._activeBuffer.ybase+this._activeBuffer.y+D,I=this._activeBuffer.lines.get(M);I&&(I.fill(j),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,D){const M=this._bufferService.buffer,I=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${U}${p.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,D){this._dirtyRowTracker.markRangeDirty(j,D)}}o.InputHandler=$;let O=class{constructor(z){this._bufferService=z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(z){z<this.start?this.start=z:z>this.end&&(this.end=z)}markRangeDirty(z,j){z>j&&(B=z,z=j,j=B),z<this.start&&(this.start=z),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function F(z){return 0<=z&&z<256}O=f([_(0,b.IBufferService)],O)},844:(g,o)=>{function a(f){for(const _ of f)_.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const _=this._disposables.indexOf(f);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var _;this._isDisposed||f===this._value||((_=this._value)===null||_===void 0||_.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)===null||f===void 0||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=a,o.getDisposeArrayDisposable=function(f){return{dispose:()=>a(f)}}},1505:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(_,p,m){this._data[_]||(this._data[_]={}),this._data[_][p]=m}get(_,p){return this._data[_]?this._data[_][p]:void 0}clear(){this._data={}}}o.TwoKeyMap=a,o.FourKeyMap=class{constructor(){this._data=new a}set(f,_,p,m,x){this._data.get(f,_)||this._data.set(f,_,new a),this._data.get(f,_).set(p,m,x)}get(f,_,p,m){var x;return(x=this._data.get(f,_))===null||x===void 0?void 0:x.get(p,m)}clear(){this._data.clear()}}},6114:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof navigator>"u";const a=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=a.includes("Firefox"),o.isLegacyEdge=a.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(a),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=a.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(a)},6106:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let a=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(a=this._search(this._getKey(f)),this._array.splice(a,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const _=this._getKey(f);if(_===void 0||(a=this._search(_),a===-1)||this._getKey(this._array[a])!==_)return!1;do if(this._array[a]===f)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===_);return!1}*getKeyIterator(f){if(this._array.length!==0&&(a=this._search(f),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===f))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===f)}forEachByKey(f,_){if(this._array.length!==0&&(a=this._search(f),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===f))do _(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===f)}values(){return[...this._array].values()}_search(f){let _=0,p=this._array.length-1;for(;p>=_;){let m=_+p>>1;const x=this._getKey(this._array[m]);if(x>f)p=m-1;else{if(!(x<f)){for(;m>0&&this._getKey(this._array[m-1])===f;)m--;return m}_=m+1}}return _}}},7226:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=a(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let w=0,y=0,d=x.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),y=Math.max(w,y),u=x.timeRemaining(),1.5*y>u)return d-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-w))}ms`),void this._start();d=u}this.clear()}}class p extends _{_requestCallback(x){return setTimeout(()=>x(this._createDeadline(16)))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const w=Date.now()+x;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}o.PriorityTaskQueue=p,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:p,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=a(643);o.updateWindowsModeWrappedState=function(_){const p=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),m=p==null?void 0:p.get(_.cols-1),x=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);x&&m&&(x.isWrapped=m[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&m[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new a;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}o.AttributeData=a;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}constructor(p=0,m=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=m}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=a(6349),_=a(7226),p=a(3734),m=a(8437),x=a(4634),w=a(511),y=a(643),d=a(4863),u=a(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(l,h,v){this._hasScrollback=l,this._optionsService=h,this._bufferService=v,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.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 p.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 p.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,h){return new m.BufferLine(this._bufferService.cols,this.getNullCell(l),h)}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 h=l+this._optionsService.rawOptions.scrollback;return h>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:h}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=m.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,h){const v=this.getNullCell(m.DEFAULT_ATTR_DATA);let b=0;const C=this._getCorrectBufferLength(h);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<l)for(let S=0;S<this.lines.length;S++)b+=+this.lines.get(S).resize(l,v);let E=0;if(this._rows<h)for(let S=this._rows;S<h;S++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(l,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(l,v)));else for(let S=this._rows;S>h;S--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const S=this.lines.length-C;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=C}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,h-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(l,h),this._cols>l))for(let E=0;E<this.lines.length;E++)b+=+this.lines.get(E).resize(l,v);this._cols=l,this._rows=h,this._memoryCleanupQueue.clear(),b>.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 h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>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,h){this._cols!==l&&(l>this._cols?this._reflowLarger(l,h):this._reflowSmaller(l,h))}_reflowLarger(l,h){const v=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(v.length>0){const b=(0,x.reflowLargerCreateNewLayout)(this.lines,v);(0,x.reflowLargerApplyNewLayout)(this.lines,b.layout),this._reflowLargerAdjustViewport(l,h,b.countRemoved)}}_reflowLargerAdjustViewport(l,h,v){const b=this.getNullCell(m.DEFAULT_ATTR_DATA);let C=v;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new m.BufferLine(l,b))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(l,h){const v=this.getNullCell(m.DEFAULT_ATTR_DATA),b=[];let C=0;for(let E=this.lines.length-1;E>=0;E--){let S=this.lines.get(E);if(!S||!S.isWrapped&&S.getTrimmedLength()<=l)continue;const k=[S];for(;S.isWrapped&&E>0;)S=this.lines.get(--E),k.unshift(S);const T=this.ybase+this.y;if(T>=E&&T<E+k.length)continue;const P=k[k.length-1].getTrimmedLength(),L=(0,x.reflowSmallerGetNewLineLengths)(k,this._cols,l),B=L.length-k.length;let $;$=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 O=[];for(let I=0;I<B;I++){const U=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);O.push(U)}O.length>0&&(b.push({start:E+k.length+C,newLines:O}),C+=O.length),k.push(...O);let F=L.length-1,z=L[F];z===0&&(F--,z=L[F]);let j=k.length-B-1,D=P;for(;j>=0;){const I=Math.min(D,z);if(k[F]===void 0)break;if(k[F].copyCellsFrom(k[j],D-I,z-I,I,!0),z-=I,z===0&&(F--,z=L[F]),D-=I,D===0){j--;const U=Math.max(j,0);D=(0,x.getWrappedLineTrimmedLength)(k,U,this._cols)}}for(let I=0;I<k.length;I++)L[I]<l&&k[I].setCell(L[I],v);let M=B-$;for(;M-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+h-1)}if(b.length>0){const E=[],S=[];for(let F=0;F<this.lines.length;F++)S.push(this.lines.get(F));const k=this.lines.length;let T=k-1,P=0,L=b[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let B=0;for(let F=Math.min(this.lines.maxLength-1,k+C-1);F>=0;F--)if(L&&L.start>T+B){for(let z=L.newLines.length-1;z>=0;z--)this.lines.set(F--,L.newLines[z]);F++,E.push({index:T+1,amount:L.newLines.length}),B+=L.newLines.length,L=b[++P]}else this.lines.set(F,S[T--]);let $=0;for(let F=E.length-1;F>=0;F--)E[F].index+=$,this.lines.onInsertEmitter.fire(E[F]),$+=E[F].amount;const O=Math.max(0,k+C-this.lines.maxLength);O>0&&this.lines.onTrimEmitter.fire(O)}}translateBufferLineToString(l,h,v=0,b){const C=this.lines.get(l);return C?C.translateToString(h,v,b):""}getWrappedRangeForLine(l){let h=l,v=l;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:h,last:v}}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 h=0;h<this.markers.length;h++)this.markers[h].line===l&&(this.markers[h].dispose(),this.markers.splice(h--,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 h=new d.Marker(l);return this.markers.push(h),h.register(this.lines.onTrim(v=>{h.line-=v,h.line<0&&h.dispose()})),h.register(this.lines.onInsert(v=>{h.line>=v.index&&(h.line+=v.amount)})),h.register(this.lines.onDelete(v=>{h.line>=v.index&&h.line<v.index+v.amount&&h.dispose(),h.line>v.index&&(h.line-=v.amount)})),h.register(h.onDispose(()=>this._removeMarker(h))),h}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=a(3734),_=a(511),p=a(643),m=a(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let x=0;class w{constructor(d,u,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const h=u||_.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let v=0;v<d;++v)this.setCell(v,h);this.length=d}get(d){const u=this._data[3*d+0],l=2097151&u;return[this._data[3*d+1],2097152&u?this._combined[d]:l?(0,m.stringFromCodePoint)(l):"",u>>22,2097152&u?this._combined[d].charCodeAt(this._combined[d].length-1):l]}set(d,u){this._data[3*d+1]=u[p.CHAR_DATA_ATTR_INDEX],u[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=u[1],this._data[3*d+0]=2097152|d|u[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=u[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const u=this._data[3*d+0];return 2097152&u?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&u}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const u=this._data[3*d+0];return 2097152&u?this._combined[d]:2097151&u?(0,m.stringFromCodePoint)(2097151&u):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,u){return x=3*d,u.content=this._data[x+0],u.fg=this._data[x+1],u.bg=this._data[x+2],2097152&u.content&&(u.combinedData=this._combined[d]),268435456&u.bg&&(u.extended=this._extendedAttrs[d]),u}setCell(d,u){2097152&u.content&&(this._combined[d]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[d]=u.extended),this._data[3*d+0]=u.content,this._data[3*d+1]=u.fg,this._data[3*d+2]=u.bg}setCellFromCodePoint(d,u,l,h,v,b){268435456&v&&(this._extendedAttrs[d]=b),this._data[3*d+0]=u|l<<22,this._data[3*d+1]=h,this._data[3*d+2]=v}addCodepointToCell(d,u){let l=this._data[3*d+0];2097152&l?this._combined[d]+=(0,m.stringFromCodePoint)(u):(2097151&l?(this._combined[d]=(0,m.stringFromCodePoint)(2097151&l)+(0,m.stringFromCodePoint)(u),l&=-2097152,l|=2097152):l=u|4194304,this._data[3*d+0]=l)}insertCells(d,u,l,h){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodePoint(d-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs),u<this.length-d){const v=new _.CellData;for(let b=this.length-d-u-1;b>=0;--b)this.setCell(d+u+b,this.loadCell(d+b,v));for(let b=0;b<u;++b)this.setCell(d+b,l)}else for(let v=d;v<this.length;++v)this.setCell(v,l);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs)}deleteCells(d,u,l,h){if(d%=this.length,u<this.length-d){const v=new _.CellData;for(let b=0;b<this.length-d-u;++b)this.setCell(d+b,this.loadCell(d+u+b,v));for(let b=this.length-u;b<this.length;++b)this.setCell(b,l)}else for(let v=d;v<this.length;++v)this.setCell(v,l);d&&this.getWidth(d-1)===2&&this.setCellFromCodePoint(d-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodePoint(d,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs)}replaceCells(d,u,l,h,v=!1){if(v)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodePoint(d-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodePoint(u,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs);d<u&&d<this.length;)this.isProtected(d)||this.setCell(d,l),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodePoint(d-1,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u,0,1,(h==null?void 0:h.fg)||0,(h==null?void 0:h.bg)||0,(h==null?void 0:h.extended)||new f.ExtendedAttrs);d<u&&d<this.length;)this.setCell(d++,l)}resize(d,u){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const h=new Uint32Array(l);h.set(this._data),this._data=h}for(let h=this.length;h<d;++h)this.setCell(h,u)}else{this._data=this._data.subarray(0,l);const h=Object.keys(this._combined);for(let b=0;b<h.length;b++){const C=parseInt(h[b],10);C>=d&&delete this._combined[C]}const v=Object.keys(this._extendedAttrs);for(let b=0;b<v.length;b++){const C=parseInt(v[b],10);C>=d&&delete this._extendedAttrs[C]}}return this.length=d,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,u=!1){if(u)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,d);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const u in d._combined)this._combined[u]=d._combined[u];this._extendedAttrs={};for(const u in d._extendedAttrs)this._extendedAttrs[u]=d._extendedAttrs[u];this.isWrapped=d.isWrapped}clone(){const d=new w(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const u in this._combined)d._combined[u]=this._combined[u];for(const u in this._extendedAttrs)d._extendedAttrs[u]=this._extendedAttrs[u];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,u,l,h,v){const b=d._data;if(v)for(let E=h-1;E>=0;E--){for(let S=0;S<3;S++)this._data[3*(l+E)+S]=b[3*(u+E)+S];268435456&b[3*(u+E)+2]&&(this._extendedAttrs[l+E]=d._extendedAttrs[u+E])}else for(let E=0;E<h;E++){for(let S=0;S<3;S++)this._data[3*(l+E)+S]=b[3*(u+E)+S];268435456&b[3*(u+E)+2]&&(this._extendedAttrs[l+E]=d._extendedAttrs[u+E])}const C=Object.keys(d._combined);for(let E=0;E<C.length;E++){const S=parseInt(C[E],10);S>=u&&(this._combined[S-u+l]=d._combined[S])}}translateToString(d=!1,u=0,l=this.length){d&&(l=Math.min(l,this.getTrimmedLength()));let h="";for(;u<l;){const v=this._data[3*u+0],b=2097151&v;h+=2097152&v?this._combined[u]:b?(0,m.stringFromCodePoint)(b):p.WHITESPACE_CELL_CHAR,u+=v>>22||1}return h}}o.BufferLine=w},4841:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(a,f){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return f*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(g,o)=>{function a(f,_,p){if(_===f.length-1)return f[_].getTrimmedLength();const m=!f[_].hasContent(p-1)&&f[_].getWidth(p-1)===1,x=f[_+1].getWidth(0)===2;return m&&x?p-1:p}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,_,p,m,x){const w=[];for(let y=0;y<f.length-1;y++){let d=y,u=f.get(++d);if(!u.isWrapped)continue;const l=[f.get(y)];for(;d<f.length&&u.isWrapped;)l.push(u),u=f.get(++d);if(m>=y&&m<d){y+=l.length-1;continue}let h=0,v=a(l,h,_),b=1,C=0;for(;b<l.length;){const S=a(l,b,_),k=S-C,T=p-v,P=Math.min(k,T);l[h].copyCellsFrom(l[b],C,v,P,!1),v+=P,v===p&&(h++,v=0),C+=P,C===S&&(b++,C=0),v===0&&h!==0&&l[h-1].getWidth(p-1)===2&&(l[h].copyCellsFrom(l[h-1],p-1,v++,1,!1),l[h-1].setCell(p-1,x))}l[h].replaceCells(v,p,x);let E=0;for(let S=l.length-1;S>0&&(S>h||l[S].getTrimmedLength()===0);S--)E++;E>0&&(w.push(y+l.length-E),w.push(E)),y+=l.length-1}return w},o.reflowLargerCreateNewLayout=function(f,_){const p=[];let m=0,x=_[m],w=0;for(let y=0;y<f.length;y++)if(x===y){const d=_[++m];f.onDeleteEmitter.fire({index:y-w,amount:d}),y+=d-1,w+=d,x=_[++m]}else p.push(y);return{layout:p,countRemoved:w}},o.reflowLargerApplyNewLayout=function(f,_){const p=[];for(let m=0;m<_.length;m++)p.push(f.get(_[m]));for(let m=0;m<p.length;m++)f.set(m,p[m]);f.length=_.length},o.reflowSmallerGetNewLineLengths=function(f,_,p){const m=[],x=f.map((u,l)=>a(f,l,_)).reduce((u,l)=>u+l);let w=0,y=0,d=0;for(;d<x;){if(x-d<p){m.push(x-d);break}w+=p;const u=a(f,y,_);w>u&&(w-=u,y++);const l=f[y].getWidth(w-1)===2;l&&w--;const h=l?p-1:p;m.push(h),d+=h}return m},o.getWrappedLineTrimmedLength=a},5295:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=a(8460),_=a(844),p=a(9092);class m extends _.Disposable{constructor(w,y){super(),this._optionsService=w,this._bufferService=y,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(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,y){this._normal.resize(w,y),this._alt.resize(w,y),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}o.BufferSet=m},511:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=a(482),_=a(643),p=a(3734);class m extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const y=new m;return y.setFromCharData(w),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(w[_.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(w[_.CHAR_DATA_CHAR_INDEX].length===2){const d=w[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const u=w[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(d-55296)+u-56320+65536|w[_.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=w[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[_.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=w[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=m},643:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=a(8460),_=a(844);class p{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}o.Marker=p,p._nextId=1},7116:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(g,o)=>{var a,f,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
55
+ `,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""}(a||(o.C0=a={})),function(p){p.PAD="€",p.HOP="",p.BPH="‚",p.NBH="ƒ",p.IND="„",p.NEL="…",p.SSA="†",p.ESA="‡",p.HTS="ˆ",p.HTJ="‰",p.VTS="Š",p.PLD="‹",p.PLU="Œ",p.RI="",p.SS2="Ž",p.SS3="",p.DCS="",p.PU1="‘",p.PU2="’",p.STS="“",p.CCH="”",p.MW="•",p.SPA="–",p.EPA="—",p.SOS="˜",p.SGCI="™",p.SCI="š",p.CSI="›",p.ST="œ",p.OSC="",p.PM="ž",p.APC="Ÿ"}(f||(o.C1=f={})),function(p){p.ST=`${a.ESC}\\`}(_||(o.C1_ESCAPED=_={}))},7399:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=a(2584),_={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:["'",'"']};o.evaluateKeyboardEvent=function(p,m,x,w){const y={type:0,cancel:!1,key:void 0},d=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?y.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?y.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?y.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(y.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:if(p.altKey){y.key=f.C0.ESC+f.C0.DEL;break}y.key=f.C0.DEL;break;case 9:if(p.shiftKey){y.key=f.C0.ESC+"[Z";break}y.key=f.C0.HT,y.cancel=!0;break;case 13:y.key=p.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,y.cancel=!0;break;case 27:y.key=f.C0.ESC,p.altKey&&(y.key=f.C0.ESC+f.C0.ESC),y.cancel=!0;break;case 37:if(p.metaKey)break;d?(y.key=f.C0.ESC+"[1;"+(d+1)+"D",y.key===f.C0.ESC+"[1;3D"&&(y.key=f.C0.ESC+(x?"b":"[1;5D"))):y.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(p.metaKey)break;d?(y.key=f.C0.ESC+"[1;"+(d+1)+"C",y.key===f.C0.ESC+"[1;3C"&&(y.key=f.C0.ESC+(x?"f":"[1;5C"))):y.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(p.metaKey)break;d?(y.key=f.C0.ESC+"[1;"+(d+1)+"A",x||y.key!==f.C0.ESC+"[1;3A"||(y.key=f.C0.ESC+"[1;5A")):y.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(p.metaKey)break;d?(y.key=f.C0.ESC+"[1;"+(d+1)+"B",x||y.key!==f.C0.ESC+"[1;3B"||(y.key=f.C0.ESC+"[1;5B")):y.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(y.key=f.C0.ESC+"[2~");break;case 46:y.key=d?f.C0.ESC+"[3;"+(d+1)+"~":f.C0.ESC+"[3~";break;case 36:y.key=d?f.C0.ESC+"[1;"+(d+1)+"H":m?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:y.key=d?f.C0.ESC+"[1;"+(d+1)+"F":m?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:p.shiftKey?y.type=2:p.ctrlKey?y.key=f.C0.ESC+"[5;"+(d+1)+"~":y.key=f.C0.ESC+"[5~";break;case 34:p.shiftKey?y.type=3:p.ctrlKey?y.key=f.C0.ESC+"[6;"+(d+1)+"~":y.key=f.C0.ESC+"[6~";break;case 112:y.key=d?f.C0.ESC+"[1;"+(d+1)+"P":f.C0.ESC+"OP";break;case 113:y.key=d?f.C0.ESC+"[1;"+(d+1)+"Q":f.C0.ESC+"OQ";break;case 114:y.key=d?f.C0.ESC+"[1;"+(d+1)+"R":f.C0.ESC+"OR";break;case 115:y.key=d?f.C0.ESC+"[1;"+(d+1)+"S":f.C0.ESC+"OS";break;case 116:y.key=d?f.C0.ESC+"[15;"+(d+1)+"~":f.C0.ESC+"[15~";break;case 117:y.key=d?f.C0.ESC+"[17;"+(d+1)+"~":f.C0.ESC+"[17~";break;case 118:y.key=d?f.C0.ESC+"[18;"+(d+1)+"~":f.C0.ESC+"[18~";break;case 119:y.key=d?f.C0.ESC+"[19;"+(d+1)+"~":f.C0.ESC+"[19~";break;case 120:y.key=d?f.C0.ESC+"[20;"+(d+1)+"~":f.C0.ESC+"[20~";break;case 121:y.key=d?f.C0.ESC+"[21;"+(d+1)+"~":f.C0.ESC+"[21~";break;case 122:y.key=d?f.C0.ESC+"[23;"+(d+1)+"~":f.C0.ESC+"[23~";break;case 123:y.key=d?f.C0.ESC+"[24;"+(d+1)+"~":f.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(x&&!w||!p.altKey||p.metaKey)!x||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?y.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(y.key=f.C0.US),p.key==="@"&&(y.key=f.C0.NUL)):p.keyCode===65&&(y.type=1);else{const u=_[p.keyCode],l=u==null?void 0:u[p.shiftKey?1:0];if(l)y.key=f.C0.ESC+l;else if(p.keyCode>=65&&p.keyCode<=90){const h=p.ctrlKey?p.keyCode-64:p.keyCode+32;let v=String.fromCharCode(h);p.shiftKey&&(v=v.toUpperCase()),y.key=f.C0.ESC+v}else if(p.keyCode===32)y.key=f.C0.ESC+(p.ctrlKey?f.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let h=p.code.slice(3,4);p.shiftKey||(h=h.toLowerCase()),y.key=f.C0.ESC+h,y.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?y.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?y.key=f.C0.NUL:p.keyCode>=51&&p.keyCode<=55?y.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?y.key=f.C0.DEL:p.keyCode===219?y.key=f.C0.ESC:p.keyCode===220?y.key=f.C0.FS:p.keyCode===221&&(y.key=f.C0.GS)}return y}},482:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},o.utf32ToString=function(a,f=0,_=a.length){let p="";for(let m=f;m<_;++m){let x=a[m];x>65535?(x-=65536,p+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):p+=String.fromCharCode(x)}return p},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,f){const _=a.length;if(!_)return 0;let p=0,m=0;if(this._interim){const x=a.charCodeAt(m++);56320<=x&&x<=57343?f[p++]=1024*(this._interim-55296)+x-56320+65536:(f[p++]=this._interim,f[p++]=x),this._interim=0}for(let x=m;x<_;++x){const w=a.charCodeAt(x);if(55296<=w&&w<=56319){if(++x>=_)return this._interim=w,p;const y=a.charCodeAt(x);56320<=y&&y<=57343?f[p++]=1024*(w-55296)+y-56320+65536:(f[p++]=w,f[p++]=y)}else w!==65279&&(f[p++]=w)}return p}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,f){const _=a.length;if(!_)return 0;let p,m,x,w,y=0,d=0,u=0;if(this.interim[0]){let v=!1,b=this.interim[0];b&=(224&b)==192?31:(240&b)==224?15:7;let C,E=0;for(;(C=63&this.interim[++E])&&E<4;)b<<=6,b|=C;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=S-E;for(;u<k;){if(u>=_)return 0;if(C=a[u++],(192&C)!=128){u--,v=!0;break}this.interim[E++]=C,b<<=6,b|=63&C}v||(S===2?b<128?u--:f[y++]=b:S===3?b<2048||b>=55296&&b<=57343||b===65279||(f[y++]=b):b<65536||b>1114111||(f[y++]=b)),this.interim.fill(0)}const l=_-4;let h=u;for(;h<_;){for(;!(!(h<l)||128&(p=a[h])||128&(m=a[h+1])||128&(x=a[h+2])||128&(w=a[h+3]));)f[y++]=p,f[y++]=m,f[y++]=x,f[y++]=w,h+=4;if(p=a[h++],p<128)f[y++]=p;else if((224&p)==192){if(h>=_)return this.interim[0]=p,y;if(m=a[h++],(192&m)!=128){h--;continue}if(d=(31&p)<<6|63&m,d<128){h--;continue}f[y++]=d}else if((240&p)==224){if(h>=_)return this.interim[0]=p,y;if(m=a[h++],(192&m)!=128){h--;continue}if(h>=_)return this.interim[0]=p,this.interim[1]=m,y;if(x=a[h++],(192&x)!=128){h--;continue}if(d=(15&p)<<12|(63&m)<<6|63&x,d<2048||d>=55296&&d<=57343||d===65279)continue;f[y++]=d}else if((248&p)==240){if(h>=_)return this.interim[0]=p,y;if(m=a[h++],(192&m)!=128){h--;continue}if(h>=_)return this.interim[0]=p,this.interim[1]=m,y;if(x=a[h++],(192&x)!=128){h--;continue}if(h>=_)return this.interim[0]=p,this.interim[1]=m,this.interim[2]=x,y;if(w=a[h++],(192&w)!=128){h--;continue}if(d=(7&p)<<18|(63&m)<<12|(63&x)<<6|63&w,d<65536||d>1114111)continue;f[y++]=d}}return y}}},225:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const a=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let p=0;p<a.length;++p)_.fill(0,a[p][0],a[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?_[p]:function(m,x){let w,y=0,d=x.length-1;if(m<x[0][0]||m>x[d][1])return!1;for(;d>=y;)if(w=y+d>>1,m>x[w][1])y=w+1;else{if(!(m<x[w][0]))return!0;d=w-1}return!1}(p,f)?0:p>=131072&&p<=196605||p>=196608&&p<=262141?2:1}}},5981:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=a(8460),_=a(844);class p extends _.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,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+=x.length,this._writeBuffer.push(x),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(w)}_innerWrite(x=0,w=!0){const y=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],u=this._action(d,w);if(u){const h=v=>Date.now()-y>=12?setTimeout(()=>this._innerWrite(0,v)):this._innerWrite(y,v);return void u.catch(v=>(queueMicrotask(()=>{throw v}),Promise.resolve(!1))).then(h)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-y>=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()}}o.WriteBuffer=p},5941:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const a=/^([\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})$/,f=/^[\da-f]+$/;function _(p,m){const x=p.toString(16),w=x.length<2?"0"+x:x;switch(m){case 4:return x[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}o.parseColor=function(p){if(!p)return;let m=p.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const x=a.exec(m);if(x){const w=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/w*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/w*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/w*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),f.exec(m)&&[3,6,9,12].includes(m.length))){const x=m.length/3,w=[0,0,0];for(let y=0;y<3;++y){const d=parseInt(m.slice(x*y,x*y+x),16);w[y]=x===1?d<<4:x===2?d:x===3?d>>4:d>>8}return w}},o.toRgbString=function(p,m=16){const[x,w,y]=p;return`rgb:${_(x,m)}/${_(w,m)}/${_(y,m)}`}},5770:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=a(482),_=a(8742),p=a(5770),m=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(w,y){this._handlers[w]===void 0&&(this._handlers[w]=[]);const d=this._handlers[w];return d.push(y),{dispose:()=>{const u=d.indexOf(y);u!==-1&&d.splice(u,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=m,this._ident=0}hook(w,y){if(this.reset(),this._ident=w,this._active=this._handlers[w]||m,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(w,y,d){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(w,y,d);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,y,d))}unhook(w,y=!0){if(this._active.length){let d=!1,u=this._active.length-1,l=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,d=y,l=this._stack.fallThrough,this._stack.paused=!1),!l&&d===!1){for(;u>=0&&(d=this._active[u].unhook(w),d!==!0);u--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,d;u--}for(;u>=0;u--)if(d=this._active[u].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",w);this._active=m,this._ident=0}};const x=new _.Params;x.addParam(0),o.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=x,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():x,this._data="",this._hitLimit=!1}put(w,y,d){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,y,d),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let y=!1;if(this._hitLimit)y=!1;else if(w&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then(d=>(this._params=x,this._data="",this._hitLimit=!1,d));return this._params=x,this._data="",this._hitLimit=!1,y}}},2015:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=a(844),_=a(8742),p=a(6242),m=a(6351);class x{constructor(u){this.table=new Uint8Array(u)}setDefault(u,l){this.table.fill(u<<4|l)}add(u,l,h,v){this.table[l<<8|u]=h<<4|v}addMany(u,l,h,v){for(let b=0;b<u.length;b++)this.table[l<<8|u[b]]=h<<4|v}}o.TransitionTable=x;const w=160;o.VT500_TRANSITION_TABLE=function(){const d=new x(4095),u=Array.apply(null,Array(256)).map((E,S)=>S),l=(E,S)=>u.slice(E,S),h=l(32,127),v=l(0,24);v.push(25),v.push.apply(v,l(28,32));const b=l(0,14);let C;for(C in d.setDefault(1,0),d.addMany(h,0,2,0),b)d.addMany([24,26,153,154],C,3,0),d.addMany(l(128,144),C,3,0),d.addMany(l(144,152),C,3,0),d.add(156,C,0,0),d.add(27,C,11,1),d.add(157,C,4,8),d.addMany([152,158,159],C,0,7),d.add(155,C,11,3),d.add(144,C,11,9);return d.addMany(v,0,3,0),d.addMany(v,1,3,1),d.add(127,1,0,1),d.addMany(v,8,0,8),d.addMany(v,3,3,3),d.add(127,3,0,3),d.addMany(v,4,3,4),d.add(127,4,0,4),d.addMany(v,6,3,6),d.addMany(v,5,3,5),d.add(127,5,0,5),d.addMany(v,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(h,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(l(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(h,7,0,7),d.addMany(v,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(l(64,127),3,7,0),d.addMany(l(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(l(48,60),4,8,4),d.addMany(l(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(l(32,64),6,0,6),d.add(127,6,0,6),d.addMany(l(64,127),6,0,0),d.addMany(l(32,48),3,9,5),d.addMany(l(32,48),5,9,5),d.addMany(l(48,64),5,0,6),d.addMany(l(64,127),5,7,0),d.addMany(l(32,48),4,9,5),d.addMany(l(32,48),1,9,2),d.addMany(l(32,48),2,9,2),d.addMany(l(48,127),2,10,0),d.addMany(l(48,80),1,10,0),d.addMany(l(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(l(96,127),1,10,0),d.add(80,1,11,9),d.addMany(v,9,0,9),d.add(127,9,0,9),d.addMany(l(28,32),9,0,9),d.addMany(l(32,48),9,9,12),d.addMany(l(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(v,11,0,11),d.addMany(l(32,128),11,0,11),d.addMany(l(28,32),11,0,11),d.addMany(v,10,0,10),d.add(127,10,0,10),d.addMany(l(28,32),10,0,10),d.addMany(l(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(l(32,48),10,9,12),d.addMany(v,12,0,12),d.add(127,12,0,12),d.addMany(l(28,32),12,0,12),d.addMany(l(32,48),12,9,12),d.addMany(l(48,64),12,0,11),d.addMany(l(64,127),12,12,13),d.addMany(l(64,127),10,12,13),d.addMany(l(64,127),9,12,13),d.addMany(v,13,13,13),d.addMany(h,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(w,0,2,0),d.add(w,8,5,8),d.add(w,6,0,6),d.add(w,11,0,11),d.add(w,13,13,13),d}();class y extends f.Disposable{constructor(u=o.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(l,h,v)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,h)=>{},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,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new p.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(u,l=[64,126]){let h=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=u.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let b=0;b<u.intermediates.length;++b){const C=u.intermediates.charCodeAt(b);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=C}}if(u.final.length!==1)throw new Error("final must be a single byte");const v=u.final.charCodeAt(0);if(l[0]>v||v>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return h<<=8,h|=v,h}identToString(u){const l=[];for(;u;)l.push(String.fromCharCode(255&u)),u>>=8;return l.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,l){const h=this._identifier(u,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const v=this._escHandlers[h];return v.push(l),{dispose:()=>{const b=v.indexOf(l);b!==-1&&v.splice(b,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,l){this._executeHandlers[u.charCodeAt(0)]=l}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,l){const h=this._identifier(u);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const v=this._csiHandlers[h];return v.push(l),{dispose:()=>{const b=v.indexOf(l);b!==-1&&v.splice(b,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,l){return this._dcsParser.registerHandler(this._identifier(u),l)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,l){return this._oscParser.registerHandler(u,l)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(u,l,h,v,b){this._parseStack.state=u,this._parseStack.handlers=l,this._parseStack.handlerPos=h,this._parseStack.transition=v,this._parseStack.chunkPos=b}parse(u,l,h){let v,b=0,C=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&k>-1){for(;k>=0&&(v=S[k](this._params),v!==!0);k--)if(v instanceof Promise)return this._parseStack.handlerPos=k,v}this._parseStack.handlers=[];break;case 4:if(h===!1&&k>-1){for(;k>=0&&(v=S[k](),v!==!0);k--)if(v instanceof Promise)return this._parseStack.handlerPos=k,v}this._parseStack.handlers=[];break;case 6:if(b=u[this._parseStack.chunkPos],v=this._dcsParser.unhook(b!==24&&b!==26,h),v)return v;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(b=u[this._parseStack.chunkPos],v=this._oscParser.end(b!==24&&b!==26,h),v)return v;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let S=E;S<l;++S){switch(b=u[S],C=this._transitions.table[this.currentState<<8|(b<160?b:w)],C>>4){case 2:for(let B=S+1;;++B){if(B>=l||(b=u[B])<32||b>126&&b<w){this._printHandler(u,S,B),S=B-1;break}if(++B>=l||(b=u[B])<32||b>126&&b<w){this._printHandler(u,S,B),S=B-1;break}if(++B>=l||(b=u[B])<32||b>126&&b<w){this._printHandler(u,S,B),S=B-1;break}if(++B>=l||(b=u[B])<32||b>126&&b<w){this._printHandler(u,S,B),S=B-1;break}}break;case 3:this._executeHandlers[b]?this._executeHandlers[b]():this._executeHandlerFb(b),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:b,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|b];let T=k?k.length-1:-1;for(;T>=0&&(v=k[T](this._params),v!==!0);T--)if(v instanceof Promise)return this._preserveStack(3,k,T,C,S),v;T<0&&this._csiHandlerFb(this._collect<<8|b,this._params),this.precedingCodepoint=0;break;case 8:do switch(b){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(b-48)}while(++S<l&&(b=u[S])>47&&b<60);S--;break;case 9:this._collect<<=8,this._collect|=b;break;case 10:const P=this._escHandlers[this._collect<<8|b];let L=P?P.length-1:-1;for(;L>=0&&(v=P[L](),v!==!0);L--)if(v instanceof Promise)return this._preserveStack(4,P,L,C,S),v;L<0&&this._escHandlerFb(this._collect<<8|b),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|b,this._params);break;case 13:for(let B=S+1;;++B)if(B>=l||(b=u[B])===24||b===26||b===27||b>127&&b<w){this._dcsParser.put(u,S,B),S=B-1;break}break;case 14:if(v=this._dcsParser.unhook(b!==24&&b!==26),v)return this._preserveStack(6,[],0,C,S),v;b===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let B=S+1;;B++)if(B>=l||(b=u[B])<32||b>127&&b<w){this._oscParser.put(u,S,B),S=B-1;break}break;case 6:if(v=this._oscParser.end(b!==24&&b!==26),v)return this._preserveStack(5,[],0,C,S),v;b===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&C}}}o.EscapeSequenceParser=y},6242:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=a(5770),_=a(482),p=[];o.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,x){this._handlers[m]===void 0&&(this._handlers[m]=[]);const w=this._handlers[m];return w.push(x),{dispose:()=>{const y=w.indexOf(x);y!==-1&&w.splice(y,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,x,w){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(m,x,w);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(m,x,w))}start(){this.reset(),this._state=1}put(m,x,w){if(this._state!==3){if(this._state===1)for(;x<w;){const y=m[x++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&w-x>0&&this._put(m,x,w)}}end(m,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,y=this._active.length-1,d=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,w=x,d=this._stack.fallThrough,this._stack.paused=!1),!d&&w===!1){for(;y>=0&&(w=this._active[y].end(m),w!==!0);y--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,w;y--}for(;y>=0;y--)if(w=this._active[y].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",m);this._active=p,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,x,w){this._hitLimit||(this._data+=(0,_.utf32ToString)(m,x,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let x=!1;if(this._hitLimit)x=!1;else if(m&&(x=this._handler(this._data),x instanceof Promise))return x.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,x}}},8742:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const a=2147483647;class f{static fromArray(p){const m=new f;if(!p.length)return m;for(let x=Array.isArray(p[0])?1:0;x<p.length;++x){const w=p[x];if(Array.isArray(w))for(let y=0;y<w.length;++y)m.addSubParam(w[y]);else m.addParam(w)}return m}constructor(p=32,m=32){if(this.maxLength=p,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new f(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let m=0;m<this.length;++m){p.push(this.params[m]);const x=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-x>0&&p.push(Array.prototype.slice.call(this._subParams,x,w))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>a?a:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>a?a:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const m=this._subParamsIdx[p]>>8,x=255&this._subParamsIdx[p];return x-m>0?this._subParams.subarray(m,x):null}getSubParamsAll(){const p={};for(let m=0;m<this.length;++m){const x=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-x>0&&(p[m]=this._subParams.slice(x,w))}return p}addDigit(p){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,w=x[m-1];x[m-1]=~w?Math.min(10*w+p,a):p}}o.Params=f},5741:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,f){const _={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(_),f.dispose=()=>this._wrappedAddonDispose(_),f.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let f=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===a){f=_;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(f,1)}}},8771:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=a(3785),_=a(511);o.BufferApiView=class{constructor(p,m){this._buffer=p,this.type=m}init(p){return this._buffer=p,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(p){const m=this._buffer.lines.get(p);if(m)return new f.BufferLineApiView(m)}getNullCell(){return new _.CellData}}},3785:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=a(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,p){if(!(_<0||_>=this._line.length))return p?(this._line.loadCell(_,p),p):this._line.loadCell(_,new f.CellData)}translateToString(_,p,m){return this._line.translateToString(_,p,m)}}},8285:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=a(8771),_=a(8460),p=a(844);class m extends p.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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)}}o.BufferNamespaceApi=m},7975:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,f){return this._core.registerCsiHandler(a,_=>f(_.toArray()))}addCsiHandler(a,f){return this.registerCsiHandler(a,f)}registerDcsHandler(a,f){return this._core.registerDcsHandler(a,(_,p)=>f(_,p.toArray()))}addDcsHandler(a,f){return this.registerDcsHandler(a,f)}registerEscHandler(a,f){return this._core.registerEscHandler(a,f)}addEscHandler(a,f){return this.registerEscHandler(a,f)}registerOscHandler(a,f){return this._core.registerOscHandler(a,f)}addOscHandler(a,f){return this.registerOscHandler(a,f)}}},7090:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(g,o,a){var f=this&&this.__decorate||function(d,u,l,h){var v,b=arguments.length,C=b<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,l,h);else for(var E=d.length-1;E>=0;E--)(v=d[E])&&(C=(b<3?v(C):b>3?v(u,l,C):v(u,l))||C);return b>3&&C&&Object.defineProperty(u,l,C),C},_=this&&this.__param||function(d,u){return function(l,h){u(l,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const p=a(8460),m=a(844),x=a(5295),w=a(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let y=o.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(d,this))}resize(d,u){this.cols=d,this.rows=u,this.buffers.resize(d,u),this._onResize.fire({cols:d,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,u=!1){const l=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===d.fg&&h.getBg(0)===d.bg||(h=l.getBlankLine(d,u),this._cachedBlankLine=h),h.isWrapped=u;const v=l.ybase+l.scrollTop,b=l.ybase+l.scrollBottom;if(l.scrollTop===0){const C=l.lines.isFull;b===l.lines.length-1?C?l.lines.recycle().copyFrom(h):l.lines.push(h.clone()):l.lines.splice(b+1,0,h.clone()),C?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const C=b-v+1;l.lines.shiftElements(v+1,C-1,-1),l.lines.set(b,h.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(d,u,l){const h=this.buffer;if(d<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else d+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const v=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+d,h.ybase),0),v!==h.ydisp&&(u||this._onScroll.fire(h.ydisp))}};o.BufferService=y=f([_(0,w.IOptionsService)],y)},7994:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,f){this._charsets[a]=f,this.glevel===a&&(this.charset=f)}}},1753:function(g,o,a){var f=this&&this.__decorate||function(h,v,b,C){var E,S=arguments.length,k=S<3?v:C===null?C=Object.getOwnPropertyDescriptor(v,b):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,v,b,C);else for(var T=h.length-1;T>=0;T--)(E=h[T])&&(k=(S<3?E(k):S>3?E(v,b,k):E(v,b))||k);return S>3&&k&&Object.defineProperty(v,b,k),k},_=this&&this.__param||function(h,v){return function(b,C){v(b,C,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const p=a(2585),m=a(8460),x=a(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function y(h,v){let b=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(b|=64,b|=h.action):(b|=3&h.button,4&h.button&&(b|=64),8&h.button&&(b|=128),h.action===32?b|=32:h.action!==0||v||(b|=3)),b}const d=String.fromCharCode,u={DEFAULT:h=>{const v=[y(h,!1)+32,h.col+32,h.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${d(v[0])}${d(v[1])}${d(v[2])}`},SGR:h=>{const v=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${y(h,!0)};${h.col};${h.row}${v}`},SGR_PIXELS:h=>{const v=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${y(h,!0)};${h.x};${h.y}${v}`}};let l=o.CoreMouseService=class extends x.Disposable{constructor(h,v){super(),this._bufferService=h,this._coreService=v,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const b of Object.keys(w))this.addProtocol(b,w[b]);for(const b of Object.keys(u))this.addEncoding(b,u[b]);this.reset()}addProtocol(h,v){this._protocols[h]=v}addEncoding(h,v){this._encodings[h]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const v=this._encodings[this._activeEncoding](h);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,v,b){if(b){if(h.x!==v.x||h.y!==v.y)return!1}else if(h.col!==v.col||h.row!==v.row)return!1;return h.button===v.button&&h.action===v.action&&h.ctrl===v.ctrl&&h.alt===v.alt&&h.shift===v.shift}};o.CoreMouseService=l=f([_(0,p.IBufferService),_(1,p.ICoreService)],l)},6975:function(g,o,a){var f=this&&this.__decorate||function(l,h,v,b){var C,E=arguments.length,S=E<3?h:b===null?b=Object.getOwnPropertyDescriptor(h,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(l,h,v,b);else for(var k=l.length-1;k>=0;k--)(C=l[k])&&(S=(E<3?C(S):E>3?C(h,v,S):C(h,v))||S);return E>3&&S&&Object.defineProperty(h,v,S),S},_=this&&this.__param||function(l,h){return function(v,b){h(v,b,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const p=a(1439),m=a(8460),x=a(844),w=a(2585),y=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=o.CoreService=class extends x.Disposable{constructor(l,h,v){super(),this._bufferService=l,this._logService=h,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(y),this.decPrivateModes=(0,p.clone)(d)}reset(){this.modes=(0,p.clone)(y),this.decPrivateModes=(0,p.clone)(d)}triggerDataEvent(l,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,()=>l.split("").map(b=>b.charCodeAt(0))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,()=>l.split("").map(h=>h.charCodeAt(0))),this._onBinary.fire(l))}};o.CoreService=u=f([_(0,w.IBufferService),_(1,w.ILogService),_(2,w.IOptionsService)],u)},9074:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=a(8055),_=a(8460),p=a(844),m=a(6106);let x=0,w=0;class y extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList(l=>l==null?void 0:l.marker.line),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)(()=>this.reset()))}registerDecoration(l){if(l.marker.isDisposed)return;const h=new d(l);if(h){const v=h.marker.onDispose(()=>h.dispose());h.onDispose(()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),v.dispose())}),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,h,v){var b,C,E;let S=0,k=0;for(const T of this._decorations.getKeyIterator(h))S=(b=T.options.x)!==null&&b!==void 0?b:0,k=S+((C=T.options.width)!==null&&C!==void 0?C:1),l>=S&&l<k&&(!v||((E=T.options.layer)!==null&&E!==void 0?E:"bottom")===v)&&(yield T)}forEachDecorationAtCell(l,h,v,b){this._decorations.forEachByKey(h,C=>{var E,S,k;x=(E=C.options.x)!==null&&E!==void 0?E:0,w=x+((S=C.options.width)!==null&&S!==void 0?S:1),l>=x&&l<w&&(!v||((k=C.options.layer)!==null&&k!==void 0?k:"bottom")===v)&&b(C)})}}o.DecorationService=y;class d extends p.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.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:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=a(2585),_=a(8343);class p{constructor(...x){this._entries=new Map;for(const[w,y]of x)this.set(w,y)}set(x,w){const y=this._entries.get(x);return this._entries.set(x,w),y}forEach(x){for(const[w,y]of this._entries.entries())x(w,y)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}o.ServiceCollection=p,o.InstantiationService=class{constructor(){this._services=new p,this._services.set(f.IInstantiationService,this)}setService(m,x){this._services.set(m,x)}getService(m){return this._services.get(m)}createInstance(m,...x){const w=(0,_.getServiceDependencies)(m).sort((u,l)=>u.index-l.index),y=[];for(const u of w){const l=this._services.get(u.id);if(!l)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${u.id}.`);y.push(l)}const d=w.length>0?w[0].index:x.length;if(x.length!==d)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${d+1} conflicts with ${x.length} static arguments`);return new m(...x,...y)}}},7866:function(g,o,a){var f=this&&this.__decorate||function(d,u,l,h){var v,b=arguments.length,C=b<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(d,u,l,h);else for(var E=d.length-1;E>=0;E--)(v=d[E])&&(C=(b<3?v(C):b>3?v(u,l,C):v(u,l))||C);return b>3&&C&&Object.defineProperty(u,l,C),C},_=this&&this.__param||function(d,u){return function(l,h){u(l,h,d)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const p=a(844),m=a(2585),x={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let w,y=o.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let u=0;u<d.length;u++)typeof d[u]=="function"&&(d[u]=d[u]())}_log(d,u,l){this._evalLazyOptionalParams(l),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...l)}trace(d,...u){var l,h;this._logLevel<=m.LogLevelEnum.TRACE&&this._log((h=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.trace.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.log,d,u)}debug(d,...u){var l,h;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log((h=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.debug.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.log,d,u)}info(d,...u){var l,h;this._logLevel<=m.LogLevelEnum.INFO&&this._log((h=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.info.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.info,d,u)}warn(d,...u){var l,h;this._logLevel<=m.LogLevelEnum.WARN&&this._log((h=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.warn.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.warn,d,u)}error(d,...u){var l,h;this._logLevel<=m.LogLevelEnum.ERROR&&this._log((h=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.error.bind(this._optionsService.options.logger))!==null&&h!==void 0?h:console.error,d,u)}};o.LogService=y=f([_(0,m.IOptionsService)],y),o.setTraceLogger=function(d){w=d},o.traceCall=function(d,u,l){if(typeof l.value!="function")throw new Error("not supported");const h=l.value;l.value=function(...v){if(w.logLevel!==m.LogLevelEnum.TRACE)return h.apply(this,v);w.trace(`GlyphRenderer#${h.name}(${v.map(C=>JSON.stringify(C)).join(", ")})`);const b=h.apply(this,v);return w.trace(`GlyphRenderer#${h.name} return`,b),b}}},7302:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=a(8460),_=a(844),p=a(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,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:{},rightClickSelectsWord:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends _.Disposable{constructor(y){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d=Object.assign({},o.DEFAULT_OPTIONS);for(const u in y)if(u in d)try{const l=y[u];d[u]=this._sanitizeAndValidateOption(u,l)}catch(l){console.error(l)}this.rawOptions=d,this.options=Object.assign({},d),this._setupOptions()}onSpecificOptionChange(y,d){return this.onOptionChange(u=>{u===y&&d(this.rawOptions[y])})}onMultipleOptionChange(y,d){return this.onOptionChange(u=>{y.indexOf(u)!==-1&&d()})}_setupOptions(){const y=u=>{if(!(u in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},d=(u,l)=>{if(!(u in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);l=this._sanitizeAndValidateOption(u,l),this.rawOptions[u]!==l&&(this.rawOptions[u]=l,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const l={get:y.bind(this,u),set:d.bind(this,u)};Object.defineProperty(this.options,u,l)}}_sanitizeAndValidateOption(y,d){switch(y){case"cursorStyle":if(d||(d=o.DEFAULT_OPTIONS[y]),!function(u){return u==="block"||u==="underline"||u==="bar"}(d))throw new Error(`"${d}" is not a valid value for ${y}`);break;case"wordSeparator":d||(d=o.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=m.includes(d)?d:o.DEFAULT_OPTIONS[y];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${y} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${y} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}o.OptionsService=x},2660:function(g,o,a){var f=this&&this.__decorate||function(x,w,y,d){var u,l=arguments.length,h=l<3?w:d===null?d=Object.getOwnPropertyDescriptor(w,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(x,w,y,d);else for(var v=x.length-1;v>=0;v--)(u=x[v])&&(h=(l<3?u(h):l>3?u(w,y,h):u(w,y))||h);return l>3&&h&&Object.defineProperty(w,y,h),h},_=this&&this.__param||function(x,w){return function(y,d){w(y,d,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const p=a(2585);let m=o.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const w=this._bufferService.buffer;if(x.id===void 0){const v=w.addMarker(w.ybase+w.y),b={data:x,id:this._nextId++,lines:[v]};return v.onDispose(()=>this._removeMarkerFromLink(b,v)),this._dataByLinkId.set(b.id,b),b.id}const y=x,d=this._getEntryIdKey(y),u=this._entriesWithId.get(d);if(u)return this.addLineToLink(u.id,w.ybase+w.y),u.id;const l=w.addMarker(w.ybase+w.y),h={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(h,l)),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(x,w){const y=this._dataByLinkId.get(x);if(y&&y.lines.every(d=>d.line!==w)){const d=this._bufferService.buffer.addMarker(w);y.lines.push(d),d.onDispose(()=>this._removeMarkerFromLink(y,d))}}getLinkData(x){var w;return(w=this._dataByLinkId.get(x))===null||w===void 0?void 0:w.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,w){const y=x.lines.indexOf(w);y!==-1&&(x.lines.splice(y,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};o.OscLinkService=m=f([_(0,p.IBufferService)],m)},8343:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const a="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[f]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const p=function(m,x,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,d,u){d[a]===d?d[f].push({id:y,index:u}):(d[f]=[{id:y,index:u}],d[a]=d)})(p,m,w)};return p.toString=()=>_,o.serviceRegistry.set(_,p),p}},2585:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=a(8343);var _;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"}(_||(o.LogLevelEnum=_={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(g,o,a)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=a(8460),_=a(225);o.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const p=new _.UnicodeV6;this.register(p),this._active=p.version,this._activeProvider=p}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(p){if(!this._providers[p])throw new Error(`unknown Unicode version "${p}"`);this._active=p,this._activeProvider=this._providers[p],this._onChange.fire(p)}register(p){this._providers[p.version]=p}wcwidth(p){return this._activeProvider.wcwidth(p)}getStringCellWidth(p){let m=0;const x=p.length;for(let w=0;w<x;++w){let y=p.charCodeAt(w);if(55296<=y&&y<=56319){if(++w>=x)return m+this.wcwidth(y);const d=p.charCodeAt(w);56320<=d&&d<=57343?y=1024*(y-55296)+d-56320+65536:m+=this.wcwidth(d)}m+=this.wcwidth(y)}return m}}}},n={};function s(g){var o=n[g];if(o!==void 0)return o.exports;var a=n[g]={exports:{}};return r[g].call(a.exports,a,a.exports,s),a.exports}var c={};return(()=>{var g=c;Object.defineProperty(g,"__esModule",{value:!0}),g.Terminal=void 0;const o=s(9042),a=s(3236),f=s(844),_=s(5741),p=s(8285),m=s(7975),x=s(7090),w=["cols","rows"];class y extends f.Disposable{constructor(u){super(),this._core=this.register(new a.Terminal(u)),this._addonManager=this.register(new _.AddonManager),this._publicOptions=Object.assign({},this._core.options);const l=v=>this._core.options[v],h=(v,b)=>{this._checkReadonlyOptions(v),this._core.options[v]=b};for(const v in this._core.options){const b={get:l.bind(this,v),set:h.bind(this,v)};Object.defineProperty(this._publicOptions,v,b)}}_checkReadonlyOptions(u){if(w.includes(u))throw new Error(`Option "${u}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=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:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const l in u)this._publicOptions[l]=u[l]}blur(){this._core.blur()}focus(){this._core.focus()}resize(u,l){this._verifyIntegers(u,l),this._core.resize(u,l)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){var l,h,v;return this._checkProposedApi(),this._verifyPositiveIntegers((l=u.x)!==null&&l!==void 0?l:0,(h=u.width)!==null&&h!==void 0?h:0,(v=u.height)!==null&&v!==void 0?v:0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,l,h){this._verifyIntegers(u,l,h),this._core.select(u,l,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,l){this._verifyIntegers(u,l),this._core.selectLines(u,l)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,l){this._core.write(u,l)}writeln(u,l){this._core.write(u),this._core.write(`\r
56
+ `,l)}paste(u){this._core.paste(u)}refresh(u,l){this._verifyIntegers(u,l),this._core.refresh(u,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return o}_verifyIntegers(...u){for(const l of u)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const l of u)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}g.Terminal=y})(),c})())})(Ug);var h0=Ug.exports,qg={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={};return(()=>{var n=r;Object.defineProperty(n,"__esModule",{value:!0}),n.FitAddon=void 0,n.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const c=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(c._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,c=s._renderService.dimensions;if(c.css.cell.width===0||c.css.cell.height===0)return;const g=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),p=a-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),m=f-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-g;return{cols:Math.max(2,Math.floor(m/c.css.cell.width)),rows:Math.max(1,Math.floor(p/c.css.cell.height))}}}})(),r})())})(qg);var f0=qg.exports,Kg={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(g,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(f,_,p,m={}){this._terminal=f,this._regex=_,this._handler=p,this._options=m}provideLinks(f,_){const p=a.computeLink(f,this._regex,this._terminal,this._handler);_(this._addCallbacks(p))}_addCallbacks(f){return f.map(_=>(_.leave=this._options.leave,_.hover=(p,m)=>{if(this._options.hover){const{range:x}=_;this._options.hover(p,m,x)}},_))}};class a{static computeLink(_,p,m,x){const w=new RegExp(p.source,(p.flags||"")+"g"),[y,d]=a._getWindowedLineStrings(_-1,m),u=y.join("");let l;const h=[];for(;l=w.exec(u);){const v=l[0];try{const T=new URL(v),P=decodeURI(T.toString());if(v!==P&&v+"/"!==P)continue}catch{continue}const[b,C]=a._mapStrIdx(m,d,0,l.index),[E,S]=a._mapStrIdx(m,b,C,v.length);if(b===-1||C===-1||E===-1||S===-1)continue;const k={start:{x:C+1,y:b+1},end:{x:S,y:E+1}};h.push({range:k,text:v,activate:x})}return h}static _getWindowedLineStrings(_,p){let m,x=_,w=_,y=0,d="";const u=[];if(m=p.buffer.active.getLine(_)){const l=m.translateToString(!0);if(m.isWrapped&&l[0]!==" "){for(y=0;(m=p.buffer.active.getLine(--x))&&y<2048&&(d=m.translateToString(!0),y+=d.length,u.push(d),m.isWrapped&&d.indexOf(" ")===-1););u.reverse()}for(u.push(l),y=0;(m=p.buffer.active.getLine(++w))&&m.isWrapped&&y<2048&&(d=m.translateToString(!0),y+=d.length,u.push(d),d.indexOf(" ")===-1););}return[u,x]}static _mapStrIdx(_,p,m,x){const w=_.buffer.active,y=w.getNullCell();let d=m;for(;x;){const u=w.getLine(p);if(!u)return[-1,-1];for(let l=d;l<u.length;++l){u.getCell(l,y);const h=y.getChars();if(y.getWidth()&&(x-=h.length||1,l===u.length-1&&h==="")){const v=w.getLine(p+1);v&&v.isWrapped&&(v.getCell(0,y),y.getWidth()===2&&(x+=1))}if(x<0)return[p,l]}p++,d=0}return[p,d]}}o.LinkComputer=a}},n={};function s(g){var o=n[g];if(o!==void 0)return o.exports;var a=n[g]={exports:{}};return r[g](a,a.exports,s),a.exports}var c={};return(()=>{var g=c;Object.defineProperty(g,"__esModule",{value:!0}),g.WebLinksAddon=void 0;const o=s(6),a=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(_,p){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}g.WebLinksAddon=class{constructor(_=f,p={}){this._handler=_,this._options=p}activate(_){this._terminal=_;const p=this._options,m=p.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,m,this._handler,p))}dispose(){var _;(_=this._linkProvider)===null||_===void 0||_.dispose()}}})(),c})())})(Kg);var p0=Kg.exports;function Vg({agentGated:e=!1}={}){const t=N.useRef(null),[r,n]=N.useState(null),[s,c]=N.useState(!1),[g,o]=N.useState(!1),[a,f]=N.useState(null);return N.useEffect(()=>{if(!t.current)return;let _=!1,p=null,m=null,x=null;const w=window.location.protocol==="https:"?"wss":"ws",y=new WebSocket(`${w}://${window.location.host}/api/agent/ws`),d=()=>{if(m||!t.current)return m;const u=new h0.Terminal({fontFamily:'"JetBrains Mono", ui-monospace, Menlo, monospace',fontSize:13,lineHeight:1.3,letterSpacing:0,theme:{background:"#070d18",foreground:"#f2f7fc",cursor:"#dcb866",selectionBackground:"#1f3a66",black:"#0c1628",red:"#a85a5a",green:"#6a9b8f",yellow:"#dcb866",blue:"#7aa7dc",magenta:"#7a6db0",cyan:"#a8c8ea",white:"#a4b0c2",brightBlack:"#33394a",brightRed:"#c87a7a",brightGreen:"#8abbaf",brightYellow:"#ead08e",brightBlue:"#a8c8ea",brightMagenta:"#9a8dd0",brightCyan:"#cbdef3",brightWhite:"#f2f7fc"},convertEol:!0,scrollback:5e3,allowProposedApi:!0}),l=new f0.FitAddon;u.loadAddon(l),u.loadAddon(new p0.WebLinksAddon),u.open(t.current);const h=()=>{if(!(_||!t.current)&&!(t.current.offsetWidth===0||t.current.offsetHeight===0))try{l.fit()}catch{}};return p=window.requestAnimationFrame(h),x=new ResizeObserver(()=>{h()}),x.observe(t.current),u.onData(v=>{y.readyState===WebSocket.OPEN&&y.send(JSON.stringify({kind:"input",data:v}))}),u.onResize(({cols:v,rows:b})=>{y.readyState===WebSocket.OPEN&&y.send(JSON.stringify({kind:"resize",cols:v,rows:b}))}),m=u,u};return y.onopen=()=>{c(!0),d()},y.onclose=()=>c(!1),y.onerror=()=>c(!1),y.onmessage=u=>{try{const l=JSON.parse(u.data);l.kind==="data"&&typeof l.data=="string"?m==null||m.write(l.data):l.kind==="meta"?(n({active:!!l.autoMode,reason:l.reason??""}),typeof l.agentReady=="boolean"&&o(l.agentReady)):l.kind==="auth_url"&&typeof l.url=="string"||(l.kind==="error"?l.recoverable&&l.remediation?f({message:l.message??"agent failed to start",remediation:l.remediation}):m==null||m.write(`\r
57
+ \x1B[31m[error] ${l.message??"unknown error"}\x1B[0m\r
58
+ `):l.kind==="exit"&&(m==null||m.write(`\r
59
+ \x1B[33m[claude session exited]\x1B[0m\r
60
+ `)))}catch{}},()=>{_=!0,p!==null&&window.cancelAnimationFrame(p),y.close(),x==null||x.disconnect(),m==null||m.dispose()}},[]),i.jsxs("div",{className:"h-full w-full flex flex-col",style:{background:"var(--bg-sunken)"},children:[i.jsxs("div",{className:"px-4 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border)",background:"var(--bg-elevated)"},children:[i.jsx("span",{className:"j-mono text-[11px]",style:{color:s?"var(--vow-green)":"var(--fg-dim)",letterSpacing:"0.05em"},children:s?"● connected":"○ disconnected"}),r&&i.jsx("span",{className:"j-label",style:{color:r.active?"var(--accent-gold)":"var(--fg-dim)",fontSize:"10px"},title:r.active?"Claude Code Auto Mode is active":r.reason,children:r.active?"Auto Mode":"Default permissions"})]}),a&&i.jsxs("div",{className:"px-5 py-4 m-3 flex flex-col gap-2",style:{border:"1px solid var(--break-red)",background:"rgba(168, 90, 90, 0.06)",borderRadius:"var(--radius-2)"},children:[i.jsx("span",{className:"j-label",style:{color:"var(--break-red)"},children:"Agent panel unavailable"}),i.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:a.message}),a.remediation&&i.jsxs("p",{className:"j-mono text-xs",style:{color:"var(--fg-dim)"},children:[i.jsx("span",{style:{color:"var(--fg-muted)"},children:"Fix · "}),a.remediation]})]}),i.jsx("div",{ref:t,className:"flex-1 w-full",style:{background:"var(--bg-sunken)",padding:"12px",minHeight:"400px",visibility:e&&!g?"hidden":"visible",display:e&&!g?"none":"block"}}),e&&!g&&!a&&i.jsx(g0,{})]})}function g0(){return i.jsx("div",{className:"flex-1 w-full flex items-center justify-center px-6",style:{background:"var(--bg-sunken)"},children:i.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-[34ch] text-center",children:[i.jsx("span",{"aria-hidden":"true",style:{width:"8px",height:"8px",borderRadius:"50%",background:"var(--seer-violet)",boxShadow:"0 0 0 0 rgba(122, 109, 176, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}}),i.jsx("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:"The agent will come online once harness setup is complete."})]})})}const v0={wallet:{phase:1,subState:null},safe_predicted:{phase:1,subState:null},awaiting_funding:{phase:2,subState:null},safe_deployed:{phase:3,subState:"Deploying"},service_created:{phase:3,subState:"Deploying"},service_activated:{phase:3,subState:"Deploying"},agents_registered:{phase:3,subState:"Deploying"},service_deployed:{phase:3,subState:"Deploying"},service_staked:{phase:3,subState:"Deploying"},staked:{phase:3,subState:"Deploying"},mech_deployed:{phase:3,subState:"Joining the network"},agent_registered:{phase:3,subState:"Joining the network"},safe_binding_pending:{phase:3,subState:"Binding identity"}},m0={1:"Provisioning your wallet",2:"Fund your wallet",3:"Joining Jinn"};function _0(e){return v0[e]??{phase:1,subState:null}}function y0(e,t){return e<t?"done":e===t?"active":"queued"}function x0(){const{data:e,isLoading:t}=ce({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:2e3});if(t||!e)return i.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--bg)"},children:i.jsx("span",{className:"j-label",children:"Connecting…"})});const r=e.chain==="base"?"https://basescan.org":"https://sepolia.basescan.org",n=e.master_address??"",{phase:s,subState:c}=_0(e.currentStep),g=e.error,o=e.services.find(a=>a.step===e.currentStep)??e.services[0];return i.jsxs("div",{className:"min-h-screen w-full",style:{background:"var(--bg)",color:"var(--fg)"},children:[i.jsx("style",{children:D0}),i.jsxs("div",{className:"max-w-[1280px] mx-auto px-10 py-10 grid grid-cols-12 gap-10",children:[i.jsxs("section",{className:"col-span-12 lg:col-span-7 flex flex-col gap-8",children:[i.jsxs("header",{className:"flex items-baseline justify-between",children:[i.jsx("span",{className:"j-label",style:{color:"var(--accent-gold)"},children:"Jinn · Onboarding"}),i.jsx(S0,{chain:e.chain})]}),i.jsx("h1",{className:"j-display",style:{fontSize:"76px",color:"var(--fg)",lineHeight:1.05},children:"Welcome to Jinn."}),i.jsx("ol",{className:"flex flex-col",children:[1,2,3].map(a=>{var p;const f=y0(a,s),_=g&&a===s;return i.jsxs(b0,{phase:a,status:_?"error":f,children:[_&&i.jsx(k0,{envelope:g}),!_&&a===2&&f==="active"&&n&&i.jsx(u0,{address:n,minimumWei:((p=e.funding)==null?void 0:p.targetWei)??"10000000000000000",chainExplorerBase:r}),!_&&a===3&&f==="active"&&i.jsx(R0,{label:c??"Working",step:e.currentStep,serviceIndex:o==null?void 0:o.index,serviceId:o==null?void 0:o.service_id,safeAddress:o==null?void 0:o.safe_address,explorer:r,contractRevertReason:(o==null?void 0:o.error_revert_reason)??null})]},a)})})]}),i.jsxs("aside",{className:"col-span-12 lg:col-span-5 flex flex-col gap-3",children:[i.jsx("span",{className:"j-label",children:"Ask Claude"}),i.jsx("div",{className:"j-card overflow-hidden",style:{height:"calc(100vh - 220px)",minHeight:"520px"},children:i.jsx(Vg,{agentGated:!1})})]})]})]})}function S0({chain:e}){const t=e==="base";return i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"j-label",style:{color:t?"var(--fg-dim)":"var(--accent-sky)",padding:"4px 10px",border:t?"1px solid var(--border)":"1px solid var(--accent-sky)",borderRadius:"var(--radius-1)"},children:"Testnet"}),i.jsx("span",{className:"j-label",style:{color:"var(--fg-dim)",padding:"4px 10px",border:"1px dashed var(--border)",borderRadius:"var(--radius-1)",opacity:.6},title:"Mainnet support is coming. v1 supports testnet only.",children:"Mainnet · soon"})]})}function b0({phase:e,status:t,children:r}){const n=t==="active",s=t==="error",c=t==="done",g=n||s,o=s?"var(--break-red)":n?"var(--accent-gold)":c?"var(--accent-sky)":"var(--fg-dim)",a=s||n?"var(--fg)":c?"var(--fg-muted)":"var(--fg-dim)";return i.jsxs("li",{className:"phase-row","data-status":t,style:{borderTop:"1px solid var(--border)"},children:[i.jsxs("div",{className:"grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4",children:[i.jsx("span",{className:"j-mono text-xs tabular-nums",style:{color:o,letterSpacing:"0.05em",transition:"color 240ms ease"},children:String(e).padStart(2,"0")}),i.jsx("span",{className:g?"j-display":"j-mono",style:{fontSize:g?"28px":"14px",color:a,lineHeight:1.2,transition:"color 240ms ease"},children:m0[e]}),i.jsx(w0,{status:t})]}),g&&r&&i.jsx("div",{className:"ml-12 pb-5 pr-2",style:{animation:"jinnFadeSlide 320ms ease-out both"},children:r})]})}function w0({status:e}){return e==="done"?i.jsx("span",{className:"j-label",style:{color:"var(--vow-green)",fontSize:"10px"},children:"✓ Done"}):e==="error"?i.jsx("span",{className:"j-label",style:{color:"var(--break-red)",fontSize:"10px"},children:"! Failed"}):e==="active"?i.jsxs("span",{className:"j-label flex items-center gap-2",style:{color:"var(--accent-gold)",fontSize:"10px"},children:[i.jsx(C0,{}),"Active"]}):i.jsx("span",{className:"j-label",style:{color:"var(--fg-dim)",fontSize:"10px"},children:"Queued"})}function C0(){return i.jsx("span",{"aria-hidden":"true",style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--accent-gold)",boxShadow:"0 0 0 0 rgba(220, 184, 102, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}})}function k0({envelope:e}){const t=E0(e),r=j0(e.generatedAt);return i.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",style:{border:"1px solid var(--break-red)",background:"rgba(168, 90, 90, 0.06)",borderRadius:"var(--radius-2)"},children:[i.jsxs("div",{className:"flex items-baseline justify-between",children:[i.jsxs("span",{className:"j-label",style:{color:"var(--break-red)"},children:["Bootstrap halted · ",e.code]}),r&&i.jsx("span",{className:"j-mono text-[10px]",style:{color:"var(--fg-dim)"},children:r})]}),i.jsx("p",{className:"j-mono text-xs break-words",style:{color:"var(--fg)"},children:e.message}),e.hint&&i.jsxs("p",{className:"j-mono text-xs",style:{color:"var(--fg-muted)"},children:[i.jsx("span",{style:{color:"var(--fg-dim)"},children:"Fix · "}),e.hint]}),t&&i.jsx("a",{href:`https://sepolia.basescan.org/tx/${t}`,target:"_blank",rel:"noopener noreferrer",className:"j-mono text-[11px] hover:underline self-start",style:{color:"var(--accent-sky)"},children:"view failed tx ↗"}),i.jsxs("p",{className:"j-mono text-[11px]",style:{color:"var(--fg-dim)"},children:["Setup is paused at this step. Once you've addressed the cause, run"," ",i.jsx("code",{style:{color:"var(--fg-muted)"},children:"jinn run"})," again to retry from the persisted state."]})]})}function E0(e){var r,n;const t=[(r=e.details)==null?void 0:r.txHash,(n=e.details)==null?void 0:n.cause,e.message];for(const s of t){if(typeof s!="string")continue;const c=/(0x[a-fA-F0-9]{64})/.exec(s);if(c)return c[1]}return null}function j0(e){try{const t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return null;const r=Math.round(t/1e3);if(r<60)return`${r}s ago`;const n=Math.round(r/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}catch{return null}}function R0({label:e,step:t,serviceIndex:r,serviceId:n,safeAddress:s,explorer:c,contractRevertReason:g}){const o=!!g;return i.jsxs("div",{className:"px-4 py-3 flex flex-col gap-3",style:{border:o?"1px solid var(--break-red)":"1px solid var(--border)",borderRadius:"var(--radius-2)",background:"var(--bg-elevated)"},children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{"aria-hidden":"true",style:{width:"6px",height:"6px",borderRadius:"50%",background:o?"var(--break-red)":"var(--accent-sky)",boxShadow:o?"0 0 0 0 rgba(168, 90, 90, 0.6)":"0 0 0 0 rgba(122, 167, 220, 0.6)",animation:"jinnPulse 1.6s ease-out infinite"}}),i.jsx("span",{className:"j-mono text-sm",style:{color:"var(--fg)"},children:e}),i.jsx("span",{className:"j-mono text-[10px] ml-auto",style:{color:o?"var(--break-red)":"var(--fg-dim)"},children:o?"binding failed · will retry":"running · no action needed"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[120px_1fr] gap-x-4 gap-y-1 j-mono text-[11px]",style:{color:"var(--fg-muted)"},children:[i.jsx("span",{style:{color:"var(--fg-dim)"},children:"Current step"}),i.jsx("span",{children:T0(t)}),r!==void 0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"var(--fg-dim)"},children:"Service"}),i.jsxs("span",{children:["#",r,n!==void 0?` · id ${n}`:""]})]}),s&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"var(--fg-dim)"},children:"Safe"}),i.jsx("a",{href:`${c}/address/${s}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline break-all",style:{color:"var(--accent-sky)"},children:s})]}),g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{color:"var(--fg-dim)"},children:"Contract revert reason"}),i.jsx("code",{className:"text-xs break-words",style:{color:"var(--break-red)"},children:g})]})]})]})}function T0(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const D0=`
61
+ @keyframes jinnPulse {
62
+ 0% { box-shadow: 0 0 0 0 rgba(220, 184, 102, 0.55); }
63
+ 70% { box-shadow: 0 0 0 10px rgba(220, 184, 102, 0); }
64
+ 100% { box-shadow: 0 0 0 0 rgba(220, 184, 102, 0); }
65
+ }
66
+ @keyframes jinnFadeSlide {
67
+ 0% { opacity: 0; transform: translateY(-4px); }
68
+ 100% { opacity: 1; transform: translateY(0); }
69
+ }
70
+ /* Smooth title scaling when a row activates */
71
+ .phase-row[data-status="active"] {
72
+ background:
73
+ linear-gradient(90deg, rgba(220, 184, 102, 0.04) 0%, transparent 60%);
74
+ transition: background 320ms ease;
75
+ }
76
+ `;function L0({header:e,tabs:t,rail:r,children:n}){return i.jsxs("div",{className:"w-full",style:{background:"var(--bg)",color:"var(--fg)",display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",gridTemplateColumns:"1fr 320px",height:"100vh",overflow:"hidden"},children:[i.jsx("div",{style:{gridColumn:"1 / -1",borderBottom:"1px solid var(--border)"},children:e}),i.jsx("div",{style:{gridColumn:"1 / -1",borderBottom:"1px solid var(--border)"},children:t}),i.jsx("main",{style:{overflowY:"auto",minHeight:0},children:n}),i.jsx("aside",{style:{borderLeft:"1px solid var(--border)",overflowY:"auto",minHeight:0,height:"100%"},children:r})]})}function M0(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function P0({network:e,rpcHealthy:t,masterAddress:r}){return i.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"14px 24px"},children:[i.jsx("div",{style:{display:"flex",alignItems:"center",gap:"20px"},children:i.jsx(wt,{href:"/overview",style:{textDecoration:"none",color:"var(--fg)"},children:i.jsx("span",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"26px",color:"var(--fg)"},children:"jinn operator"})})}),i.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:[i.jsx("span",{style:{border:"1px solid var(--border)",borderRadius:"4px",padding:"2px 8px"},children:e}),i.jsxs("span",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[i.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:t?"var(--vow-green)":"var(--break-red)"}}),t?"rpc healthy":"rpc unreachable"]}),i.jsxs("span",{style:{color:"var(--fg-dim)"},children:["master ",M0(r)]})]})]})}const oh=[{path:"/overview",label:"Dashboard"},{path:"/operator",label:"Settings"},{path:"/build",label:"Build"}];function B0(){const[e]=Li(),t=e==="/launcher"||e.startsWith("/launcher/"),{data:r}=ce({queryKey:["solvernets","launched","top-tabs"],queryFn:()=>ee.solvernets.listLaunched(),refetchInterval:3e4,enabled:!t}),s=t||((r==null?void 0:r.records.length)??0)>0?[...oh,{path:"/launcher",label:"Launcher"}]:oh;return i.jsx("nav",{style:{display:"flex",padding:"0 24px"},children:s.map(c=>{const g=e===c.path||e.startsWith(`${c.path}/`);return i.jsx(wt,{href:c.path,"data-active":g?"true":"false",style:{padding:"14px 18px",fontFamily:"'JetBrains Mono', ui-monospace, SF Mono, Menlo, monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:g?"var(--fg)":"var(--fg-muted)",borderBottom:`1px solid ${g?"var(--accent-sky)":"transparent"}`,marginBottom:"-1px",textDecoration:"none"},children:c.label},c.path)})})}function A0({agentGated:e}){return i.jsxs("div",{className:"agent-rail",style:{padding:"16px",display:"flex",flexDirection:"column",gap:"12px",height:"100%",minWidth:0,overflow:"hidden"},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",overflowWrap:"anywhere"},children:"Claude"}),i.jsx(Vg,{agentGated:e})]})}function I0({restartPending:e,onRestart:t}){return e?i.jsxs("div",{style:{background:"var(--bg-elevated)",borderBottom:"1px solid var(--border-accent)",padding:"10px 24px",display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:[i.jsx("span",{style:{color:"var(--fg)"},children:"Operator settings saved. Restart the node to apply."}),i.jsx("button",{type:"button",onClick:t,style:{background:"var(--accent-sky)",border:"1px solid var(--accent-sky)",color:"var(--bg-sunken)",padding:"6px 14px",borderRadius:"6px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",cursor:"pointer"},children:"Restart node"})]}):null}function Xa({children:e,action:t,activeAction:r,onClick:n}){const s=r===t,c=r!==null;return i.jsx("button",{type:"button",onClick:n,disabled:c,style:{alignSelf:"flex-start",marginTop:"14px",background:"transparent",border:"1px solid var(--accent-sky)",borderRadius:"6px",color:"var(--accent-sky)",cursor:s?"wait":c?"not-allowed":"pointer",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",opacity:c&&!s?.55:1,padding:"8px 10px",textTransform:"uppercase"},children:s?"Working...":e})}function Ya({label:e,value:t,unit:r,sub:n,action:s}){return i.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px",minWidth:0},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",display:"block",marginBottom:"12px"},children:e}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"24px",fontWeight:500,color:"var(--fg)",letterSpacing:0,display:"block"},children:t}),r&&i.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"14px",marginTop:"4px",display:"block",fontFamily:"'JetBrains Mono', monospace"},children:r}),n&&i.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px",marginTop:"6px",display:"block",fontFamily:"'JetBrains Mono', monospace"},children:n}),s]})}function O0({label:e,state:t,dot:r,action:n}){return i.jsxs("div",{"data-testid":"overview-status-stat","data-state":t,style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px",minWidth:0},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",display:"block",marginBottom:"12px"},children:"Status"}),i.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",fontWeight:500,color:"var(--fg)",letterSpacing:0,display:"flex",alignItems:"center",gap:"10px",minHeight:"29px"},children:[i.jsx("span",{"aria-hidden":"true",style:{color:r,fontSize:"16px",lineHeight:1},children:"●"}),e]}),n]})}function F0({tasksDelivered:e,jinnClaimable:t,gasBalanceEth:r,gasRunwayDays:n,statusLabel:s,statusState:c,statusDot:g,activeAction:o,onClaim:a,onTopUp:f,onRestart:_}){return i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:"16px"},children:[i.jsx(Ya,{label:"Solutions delivered",value:e}),i.jsx(Ya,{label:"JINN claimable",value:t,unit:"JINN",action:i.jsx(Xa,{action:"Claim JINN",activeAction:o,onClick:a,children:"Claim now"})}),i.jsx(Ya,{label:"Gas",value:r,unit:"ETH",sub:`${n} days runway`,action:i.jsx(Xa,{action:"Top up gas",activeAction:o,onClick:f,children:"Top up"})}),i.jsx(O0,{label:s,state:c,dot:g,action:i.jsx(Xa,{action:"Restart node",activeAction:o,onClick:_,children:"Restart"})})]})}function N0({active:e=!0,lead:t,body:r,ctaLabel:n,ctaHref:s}){return e?i.jsxs("div",{style:{border:"1px solid var(--border-accent)",background:"transparent",borderRadius:"10px",padding:"14px 24px",display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsxs("span",{style:{color:"var(--fg)"},children:[i.jsx("span",{style:{color:"var(--accent-gold)",marginRight:"6px"},children:t}),r]}),i.jsxs(wt,{href:s,style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--accent-sky)",textDecoration:"none"},children:[n," →"]})]}):null}const H0=new Set(["COMPLETE","FAILED"]),Qg="/overview/activity",ah=new Set(["complete","safe_binding_pending"]);function z0(e){return e.code.includes("harness")||e.configField,"/operator#solvernets"}function $0(e){return e.code.includes("harness"),"Configure SolverNet"}function W0(e){if(!Number.isFinite(e)||e<0)return"—";if(e<6e4)return`${Math.round(e/1e3)}s`;if(e<36e5){const t=Math.floor(e/6e4),r=Math.round(e%6e4/1e3);return r>0?`${t}m ${r}s`:`${t}m`}return`${Math.round(e/36e5)}h`}function U0(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().slice(11,16)}function J0(e){const t=(e??[]).filter(o=>!H0.has(o.state)),r=t.filter(o=>o.taskRole==="restoration").length,n=t.filter(o=>o.taskRole==="evaluation").length,s=t.length,c=t.length===0?0:Date.now()-Math.min(...t.map(o=>o.stateUpdatedAt));let g;return r>0&&n>0?g=`${r} restoring · ${n} evaluating`:r>0?g=`${r} ${r===1?"task":"tasks"} restoring`:n>0?g=`${n} ${n===1?"task":"tasks"} evaluating`:g=`${s} ${s===1?"task":"tasks"} in flight`,{line:g,longestMs:c}}function Gg(e){var o,a,f,_,p,m,x,w,y;const t={label:"View activity",href:Qg},r=((o=e==null?void 0:e.fleet)==null?void 0:o.services)??[];if(r.length>0){const d=r.filter(u=>ah.has(u.step)).length;if(d<r.length){const u=((a=r.find(l=>!ah.has(l.step)))==null?void 0:a.step)??"—";return{state:"bootstrapping",line:`${d}/${r.length} services complete`,meta:`next: ${u}`,cta:t}}}const n=(((_=(f=e==null?void 0:e.predictionV1)==null?void 0:f.operator)==null?void 0:_.diagnostics)??[]).filter(d=>d.severity==="error"&&d.code!=="prediction_solvernet_disabled");if(n.length>0){const d=n[0],u=n.length-1;return{state:"attention",line:d.message,meta:"",cta:{label:$0(d),href:z0(d)},...u>0?{attentionMore:u}:{}}}const s=e==null?void 0:e.taskRuns;if((((p=s==null?void 0:s.totals)==null?void 0:p.activeTaskRuns)??((x=(m=e==null?void 0:e.predictionV1)==null?void 0:m.totals)==null?void 0:x.activeTaskRuns)??0)>0){const d=(s==null?void 0:s.inFlight)??(s==null?void 0:s.recentTasks),u=J0(d??((w=e==null?void 0:e.predictionV1)==null?void 0:w.recentTasks));return{state:"working",line:u.line,meta:u.longestMs>0?`longest in flight ${W0(u.longestMs)}`:"",cta:t}}const g=(((y=e==null?void 0:e.activity)==null?void 0:y.recent)??[]).map(d=>d.ts).filter(d=>!!d).sort().at(-1);return{state:"idle",line:"waiting for next task",meta:g?`idle since ${U0(g)}`:"",cta:t}}const Xg={bootstrapping:{dot:"var(--accent-sky)",eyebrow:"Now · Bootstrapping",border:"var(--border)"},attention:{dot:"var(--break-red)",eyebrow:"Now · Needs attention",border:"var(--border-accent)"},working:{dot:"var(--vow-green)",eyebrow:"Now · Live",border:"var(--border)"},idle:{dot:"var(--fg-muted)",eyebrow:"Now · Live",border:"var(--border)"}},Yg={bootstrapping:"BOOTSTRAPPING",attention:"ATTENTION",working:"WORKING",idle:"IDLE"};function Zg(){const{data:e}=ce({queryKey:["status"],queryFn:()=>ee.getStatus(),refetchInterval:5e3}),t=Gg(e),r=Xg[t.state],n=Yg[t.state];return i.jsxs("section",{"data-testid":"live-now-band","data-state":t.state,style:{background:"var(--bg-elevated)",border:`1px solid ${r.border}`,borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"8px",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[i.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:r.eyebrow}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.attentionMore!==void 0&&i.jsxs(wt,{href:Qg,"data-testid":"live-now-attention-more",style:{fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--accent-gold)",border:"1px solid var(--border-accent)",borderRadius:"4px",padding:"2px 8px",textDecoration:"none"},children:[t.attentionMore," more"]}),i.jsxs(wt,{href:t.cta.href,"data-testid":"live-now-cta",style:{display:"inline-flex",alignItems:"center",minHeight:"30px",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:t.state==="attention"?"var(--bg-sunken)":"var(--accent-sky)",background:t.state==="attention"?"var(--accent-sky)":"transparent",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",padding:"0 12px",textDecoration:"none"},children:[t.cta.label," →"]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"12px"},children:[i.jsx("span",{"aria-hidden":"true",style:{color:r.dot,fontSize:"18px",lineHeight:1},children:"●"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0,flex:1},children:[i.jsxs("span",{"data-testid":"live-now-line",style:{fontFamily:"'JetBrains Mono', ui-monospace, SF Mono, Menlo, monospace",fontSize:"14px",fontWeight:500,color:"var(--fg)",lineHeight:1.45,wordBreak:"break-word",letterSpacing:0},children:[i.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"var(--fg-muted)",marginRight:"10px",letterSpacing:"0.12em"},children:n}),t.line]}),t.meta&&i.jsx("span",{"data-testid":"live-now-meta",style:{fontSize:"12px",color:"var(--fg-muted)"},children:t.meta})]})]})]})}function Ps({label:e,value:t,tone:r}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"20px",fontWeight:500,color:r==="warn"?"var(--wane)":"var(--fg)"},children:t})]})}function q0({name:e,totals:t}){return i.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Network · ",e]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(72px, 1fr))",gap:"16px 24px"},children:[i.jsx(Ps,{label:"tasks",value:t.tasks}),i.jsx(Ps,{label:"active",value:t.active}),i.jsx(Ps,{label:"solutions",value:t.solutions}),i.jsx(Ps,{label:"verdicts",value:t.verdicts}),i.jsx(Ps,{label:"failed",value:t.failed,tone:t.failed>0?"warn":void 0})]})]})}function K0(e){return e==="solving"?"Solver":"Evaluator"}function V0({name:e,roles:t,state:r,waitingMessage:n}){const s=r==="live"?"var(--vow-green)":r==="available"?"var(--fg-muted)":"var(--fg-dim)";return i.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Solving on"}),i.jsx("span",{style:{fontSize:"11px",color:s,textTransform:"uppercase",letterSpacing:"0.14em"},children:r.replace("_"," ")})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px",color:"var(--fg)",fontSize:"14px",flexWrap:"wrap"},children:[i.jsx("span",{children:e}),i.jsx("span",{style:{color:"var(--fg-muted)"},children:"·"}),i.jsx("span",{style:{color:"var(--fg-muted)"},children:t.length>1?"Roles":"Role"}),i.jsx("span",{style:{color:"var(--fg-muted)"},children:"·"}),t.length===0?i.jsx("span",{style:{color:"var(--fg-dim)"},children:"none"}):t.map((c,g)=>i.jsx("span",{"data-role":c,style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"999px",padding:"2px 10px",marginLeft:g===0?0:"4px"},children:K0(c)},c))]}),i.jsx(wt,{href:"/operator#solvernets",style:{color:"var(--accent-sky)",fontSize:"11px",textDecoration:"none",letterSpacing:"0.14em",textTransform:"uppercase"},children:"Change →"})]}),n&&i.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:n})]})}function Q0(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function G0({agentId:e,chain:t,safeAddress:r,services:n=[],bindingError:s}){const c=n.find(y=>y.agentId!==null&&!y.safeBoundToAgent),[g,o]=N.useState(!1),[a,f]=N.useState(!1),[_,p]=N.useState(null),[m,x]=N.useState(s??null),w=async()=>{if(c){f(!0),p(null),x(null);try{const d=(await ee.retryAgentBinding({serviceIndex:c.index})).attempts[0];(d==null?void 0:d.status)==="success"?(p("success"),o(!1)):(p("reverted"),x((d==null?void 0:d.detail)??"Bind reverted on chain."))}catch(y){p("reverted"),x(y instanceof Error?y.message:String(y))}finally{f(!1)}}};return i.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Identity"}),i.jsxs("div",{style:{display:"flex",gap:"32px",fontSize:"13px",flexWrap:"wrap"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Agent"}),i.jsxs("span",{style:{color:"var(--fg)",display:"flex",gap:"8px",alignItems:"center"},children:[e!==null?`#${e}`:"—",c&&i.jsx("button",{type:"button",onClick:()=>o(y=>!y),style:{fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:"'JetBrains Mono', monospace",border:"1px solid var(--wane)",color:"var(--wane)",background:"transparent",borderRadius:"999px",padding:"1px 6px",cursor:"pointer"},children:"binding pending"}),_==="success"&&i.jsx("span",{style:{fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",border:"1px solid var(--vow-green)",color:"var(--vow-green)",borderRadius:"999px",padding:"1px 6px"},children:"bound"})]})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Chain"}),i.jsx("span",{style:{color:"var(--fg)"},children:t})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:"Safe"}),i.jsx("span",{style:{color:"var(--fg)"},children:Q0(r)})]})]}),g&&c&&i.jsxs("div",{style:{marginTop:"8px",padding:"12px 14px",border:"1px solid var(--wane)",borderRadius:"6px",background:"rgba(184, 128, 47, 0.07)",display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsxs("span",{style:{fontSize:"12px",color:"var(--fg)"},children:["Service #",c.index," Safe is not yet bound to agent #",c.agentId,". The bootstrap left it unbound; retry to attempt the ERC-1271 bind again."]}),m&&i.jsx("span",{style:{fontSize:"11px",color:"var(--break-red)"},children:m}),i.jsx("button",{type:"button",onClick:()=>{w()},disabled:a,style:{alignSelf:"flex-start",border:"1px solid var(--accent-sky)",background:"var(--accent-sky)",color:"var(--bg-sunken)",borderRadius:"6px",padding:"8px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",cursor:a?"wait":"pointer"},children:a?"Retrying…":"Retry binding"})]})]})}function X0({children:e}){const[t,r]=N.useState(!1);return i.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("button",{type:"button",onClick:()=>r(n=>!n),style:{alignSelf:"flex-start",background:"transparent",border:"none",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",cursor:"pointer",padding:0},children:[t?"▾":"▸"," Advanced details"]}),t&&i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:e??i.jsx("div",{style:{border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",background:"var(--bg-elevated)",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:"No additional details available."})})]})}function Y0(){const[e,t]=N.useState(null),[r,n]=N.useState(!0);if(N.useEffect(()=>{(async()=>{try{const a=await fetch("/api/harness/status",{credentials:"same-origin"});if(a.ok){const f=await a.json();t(f)}}catch{}finally{n(!1)}})()},[]),r||!e)return i.jsx("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px"},children:i.jsx("span",{style:{fontSize:"13px",color:"var(--fg-muted)"},children:"Harness status unavailable"})});const s=e.mode==="train"?"var(--vow-green)":"var(--wane)",c=e.mode==="train"?"var(--vow-green)":"var(--wane)",g=e.lastModeSwitchAt?new Date(e.lastModeSwitchAt).toLocaleString():"Never";return i.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"4px"},children:[i.jsx("span",{style:{fontSize:"13px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:"var(--fg)"},children:"Harness Status"}),i.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:s}})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[i.jsxs("div",{children:[i.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)",textTransform:"uppercase",letterSpacing:"0.14em"},children:"Mode"}),i.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:c,marginTop:"4px"},children:e.mode.toUpperCase()}),i.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)",marginTop:"6px",display:"block"},children:e.mode==="train"?"Contributing to substrate":"Benchmarking only"})]}),i.jsxs("div",{children:[i.jsx("span",{style:{fontSize:"11px",color:"var(--fg-muted)",textTransform:"uppercase",letterSpacing:"0.14em"},children:"Code Digest"}),i.jsxs("div",{style:{fontSize:"12px",fontFamily:"'JetBrains Mono', monospace",color:"var(--fg)",marginTop:"4px",wordBreak:"break-all"},children:[e.codeDigest.slice(0,16),"…"]})]})]}),e.lastModeSwitchAt&&i.jsxs("div",{style:{fontSize:"11px",color:"var(--fg-muted)",paddingTop:"8px",borderTop:"1px solid var(--border)",marginTop:"8px"},children:["Mode switched: ",g]})]})}function Z0(e,t,r,n){if(e)for(const[c,g]of Object.entries(e)){if(!g||typeof g!="object")continue;const o=Array.isArray(g.roles)?g.roles:[];if(o.length===0)continue;const a=Yi(o);return{name:g.name??g.manifestCid??c,configId:g.manifestCid??c,roles:a.length>0?a:["solving"]}}if(t){for(const[c,g]of Object.entries(t)){if(!g||typeof g!="object"||!(g.manifestCid!==void 0||c.startsWith("baf")||c.startsWith("Qm")))continue;const a=Array.isArray(g.roles)?g.roles:[];if(a.length===0)continue;const f=Yi(a);return{name:g.name??c,configId:g.manifestCid??c,roles:f.length>0?f:["solving"]}}for(const[c,g]of Object.entries(t)){if(!g||typeof g!="object")continue;const o=Array.isArray(g.roles)?g.roles:[],a=Yi(o);if(!(g.enabled!==!0&&a.length===0))return{name:g.name??c,configId:g.manifestCid??c,roles:a.length>0?a:["solving"]}}}const s=Yi(n??[]);return r||s.length>0?{name:"prediction",configId:"prediction",roles:s.length>0?s:["solving"]}:null}function Yi(e){const t=[];for(const r of e)r==="solving"||r==="solver"?t.includes("solving")||t.push("solving"):(r==="evaluating"||r==="evaluator")&&(t.includes("evaluating")||t.push("evaluating"));return t}function lh(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);return(Number(t)/1e18).toFixed(4)}catch{return"—"}}function ex(e,t,r){if(((t==null?void 0:t.observedTasks)??0)>0||((t==null?void 0:t.activeTaskRuns)??0)>0||((t==null?void 0:t.completed)??0)>0||((t==null?void 0:t.failed)??0)>0)return((t==null?void 0:t.activeTaskRuns)??0)>0?"Working on current run.":"Waiting for the next available run.";if((e==null?void 0:e.configId)==="prediction")return r}function tx(){var h,v,b,C,E,S,k,T,P,L,B,$;const[e,t]=N.useState(null),[r,n]=N.useState(null),{data:s}=ce({queryKey:["status"],queryFn:()=>ee.getStatus(),refetchInterval:5e3}),{data:c}=ce({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:3e4}),g=(h=s==null?void 0:s.predictionV1)==null?void 0:h.operator,o=Z0(c==null?void 0:c.joinedSolverNets,c==null?void 0:c.solverNets,((v=g==null?void 0:g.solverNet)==null?void 0:v.enabled)===!0,(b=g==null?void 0:g.solverNet)==null?void 0:b.roles),a=(C=s==null?void 0:s.taskRuns)==null?void 0:C.totals,f=(E=s==null?void 0:s.predictionV1)==null?void 0:E.totals,_={tasks:(a==null?void 0:a.observedTasks)??(f==null?void 0:f.observedTasks)??0,active:(a==null?void 0:a.activeTaskRuns)??(f==null?void 0:f.activeTaskRuns)??0,solutions:(a==null?void 0:a.solutions)??(f==null?void 0:f.solutions)??0,verdicts:(a==null?void 0:a.verdicts)??(f==null?void 0:f.verdicts)??0,failed:(a==null?void 0:a.failed)??(f==null?void 0:f.failed)??0},p=(((S=s==null?void 0:s.fleet)==null?void 0:S.services)??[]).map(O=>({index:O.index,safeAddress:O.safeAddress??"",agentId:O.agentId??null,safeBoundToAgent:O.safeBoundToAgent??!1})),m=_.solutions,x=lh((k=s==null?void 0:s.rewards)==null?void 0:k.pendingStakingRewardsWei),w=lh((T=s==null?void 0:s.masterGas)==null?void 0:T.balanceWei),y=((P=s==null?void 0:s.masterGas)==null?void 0:P.runwayDaysExcess)??"—",d=Gg(s),u=ex(o,a,(L=g==null?void 0:g.nextAction)==null?void 0:L.description),l=(O,F)=>{t(O),n(null),Promise.resolve().then(F).then(z=>{n({tone:"success",text:(z==null?void 0:z.message)??`${O} requested.`})}).catch(z=>{n({tone:"error",text:z instanceof Error?z.message:String(z)})}).finally(()=>t(null))};return i.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"24px"},children:[i.jsx(F0,{tasksDelivered:m,jinnClaimable:x,gasBalanceEth:w,gasRunwayDays:y,statusLabel:Yg[d.state],statusState:d.state,statusDot:Xg[d.state].dot,activeAction:e,onClaim:()=>l("Claim JINN",async()=>{const O=await ee.claimRewards();if(!O.ok)throw new Error(O.error??"Reward claim failed.");return{message:"JINN claim command completed."}}),onTopUp:()=>l("Top up gas",async()=>{var z;const O=await ee.triggerDrip();if(!O.ok)throw new Error(O.reason??"Gas top-up failed.");const F=((z=O.txHashes)==null?void 0:z.length)??(O.txHash?1:0);return F>0?{message:`Gas top-up requested (${F} ${F===1?"transaction":"transactions"}).`}:O.attempts===0?{message:"Gas balance is already above the testnet top-up target."}:{message:"Gas top-up checked; no additional funding was needed."}}),onRestart:()=>l("Restart node",async()=>{if(!(await ee.restartDaemon()).ok)throw new Error("Restart request failed.");return{message:"Restart requested. The dashboard will reconnect when the daemon is back."}})}),r&&i.jsx("div",{role:r.tone==="error"?"alert":"status","data-testid":"dashboard-action-notice",style:{border:`1px solid ${r.tone==="error"?"var(--break-red)":"var(--vow-green)"}`,color:r.tone==="error"?"var(--break-red)":"var(--vow-green)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:r.text}),i.jsx(q0,{name:(o==null?void 0:o.name)??"SolverNet",totals:_}),o?i.jsx(V0,{name:o.name,configId:o.configId,roles:o.roles,state:"live",waitingMessage:u}):i.jsx(N0,{lead:"Get started",body:"Pick a SolverNet to participate in",ctaLabel:"Configure",ctaHref:"/operator#solvernets"}),i.jsxs(X0,{children:[i.jsx(G0,{agentId:((B=p[0])==null?void 0:B.agentId)??null,chain:"Base Sepolia",safeAddress:(($=p[0])==null?void 0:$.safeAddress)??null,services:p}),i.jsx(Y0,{})]})]})}const rx=new Set(["COMPLETE","FAILED"]);function nx(e){if(!Number.isFinite(e)||e<0)return"—";if(e<6e4)return`${Math.round(e/1e3)}s`;if(e<36e5){const t=Math.floor(e/6e4),r=Math.round(e%6e4/1e3);return r>0?`${t}m ${r}s`:`${t}m`}return`${Math.round(e/36e5)}h`}function sx(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function ix(e){return e.replace(/_/g," ")}function ox(e){return e.length<=14?e:`${e.slice(0,8)}…${e.slice(-4)}`}function ax(e){return e?e.length>12?`${e.slice(0,6)}…${e.slice(-4)}`:e:"—"}const lx={task_posted:"var(--accent-sky)",request_claimed:"var(--accent-sky)",delivery_submitted:"var(--vow-green)",evaluation_submitted:"var(--vow-green)",reward_claimed:"var(--accent-gold)",tick_error:"var(--break-red)",intent_registry_failed:"var(--break-red)",error:"var(--break-red)"};function cx(e,t){return t==="failed"?"var(--break-red)":lx[e]??"var(--accent-sky)"}function ux({pollIntervalMs:e=5e3}={}){var a,f,_;const{data:t,isLoading:r,isError:n,error:s,refetch:c}=ce({queryKey:["status"],queryFn:()=>ee.getStatus(),refetchInterval:e}),g=((a=t==null?void 0:t.taskRuns)==null?void 0:a.inFlight)??(((f=t==null?void 0:t.predictionV1)==null?void 0:f.recentTasks)??[]).filter(p=>!rx.has(p.state)),o=((_=t==null?void 0:t.activity)==null?void 0:_.recent)??[];return i.jsxs("main",{"data-testid":"overview-activity",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"20px",maxWidth:"960px",margin:"0 auto"},children:[i.jsxs("header",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"16px"},children:[i.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"32px",fontWeight:400,margin:0,color:"var(--fg)"},children:"Activity"}),i.jsx(wt,{href:"/overview","data-testid":"overview-activity-back",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--accent-sky)",textDecoration:"none"},children:"← Overview"})]}),i.jsx(Zg,{}),i.jsxs("section",{"data-testid":"overview-activity-in-flight",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:i.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["In flight · ",g.length]})}),r&&i.jsx("p",{"data-testid":"overview-activity-loading",style:{margin:0,color:"var(--fg-muted)",fontSize:"12px"},children:"Loading…"}),!r&&!n&&g.length===0&&i.jsx("p",{"data-testid":"overview-activity-in-flight-empty",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"No tasks in flight."}),g.length>0&&i.jsx("ul",{"data-testid":"overview-activity-in-flight-list",style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"0"},children:g.map(p=>i.jsxs("li",{"data-testid":"overview-activity-in-flight-row",style:{display:"grid",gridTemplateColumns:"110px 110px 1fr 80px",gap:"12px",padding:"10px 0",borderTop:"1px solid var(--border)",fontSize:"12px"},children:[i.jsx("span",{style:{color:"var(--accent-sky)",textTransform:"uppercase",letterSpacing:"0.12em",fontSize:"11px"},children:p.state}),i.jsx("span",{style:{color:"var(--fg-muted)"},children:p.taskRole??"—"}),i.jsxs("span",{style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:[p.solverType?`${p.solverType} · `:"",ox(p.requestId)]}),i.jsx("span",{style:{color:"var(--fg-muted)",textAlign:"right"},children:nx(Date.now()-p.stateUpdatedAt)})]},p.requestId))})]}),i.jsxs("section",{"data-testid":"overview-activity-recent",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"12px",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:i.jsxs("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Recent · ",o.length]})}),n&&i.jsxs("div",{role:"alert","data-testid":"overview-activity-error",style:{border:"1px solid var(--break-red)",borderRadius:"6px",padding:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px"},children:[i.jsx("span",{style:{color:"var(--break-red)",fontSize:"12px"},children:s instanceof Error?s.message:"Failed to load activity."}),i.jsx("button",{type:"button",onClick:()=>{c()},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.12em",textTransform:"uppercase",background:"transparent",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--fg)",padding:"6px 10px",cursor:"pointer"},children:"Retry"})]}),!r&&!n&&o.length===0&&i.jsx("p",{"data-testid":"overview-activity-recent-empty",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"No events yet."}),o.length>0&&i.jsx("ul",{"data-testid":"overview-activity-recent-list",style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"0"},children:o.map(p=>i.jsxs("li",{"data-testid":"overview-activity-recent-row",style:{display:"grid",gridTemplateColumns:"160px 110px 1fr 110px",gap:"12px",padding:"10px 0",borderTop:"1px solid var(--border)",fontSize:"12px"},children:[i.jsx("span",{style:{color:"var(--fg-dim)"},children:sx(p.ts)}),i.jsx("span",{style:{color:cx(p.kind,p.outcome),textTransform:"uppercase",letterSpacing:"0.12em",fontSize:"11px"},children:ix(p.kind)}),i.jsx("span",{style:{color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis"},children:p.requestId??p.solverType??"—"}),i.jsx("span",{style:{color:p.txHash?"var(--accent-gold)":"var(--fg-dim)",textAlign:"right"},children:ax(p.txHash)})]},p.id))}),i.jsx("p",{style:{margin:0,color:"var(--fg-dim)",fontSize:"11px",fontStyle:"italic"},children:"Older events: see on-chain via the operator's safe address. Pagination here is a follow-up."})]})]})}const dx={default:{color:"var(--fg-dim)",border:"var(--border)"},live:{color:"var(--vow-green)",border:"var(--vow-green)"},attention:{color:"var(--wane)",border:"var(--wane)"},danger:{color:"var(--break-red)",border:"var(--break-red)"}};function va({title:e,summary:t,metaChip:r,defaultExpanded:n=!1,variant:s="default",dirty:c,children:g}){const[o,a]=N.useState(n);N.useEffect(()=>{n&&a(!0)},[n]);const f=dx[(r==null?void 0:r.tone)??"default"],_=s==="danger"?"var(--break-red)":"var(--border)";return i.jsxs("section",{style:{background:"var(--bg-elevated)",border:`1px solid ${_}`,borderRadius:"10px",overflow:"hidden"},children:[i.jsxs("button",{type:"button",onClick:()=>a(p=>!p),style:{display:"grid",gridTemplateColumns:"1fr auto auto",gap:"16px",alignItems:"center",padding:"20px 24px",width:"100%",background:"transparent",border:"none",color:"inherit",textAlign:"left",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsxs("span",{children:[i.jsx("span",{style:{display:"block",fontSize:"17px",fontWeight:500,color:s==="danger"?"var(--break-red)":"var(--fg)",letterSpacing:"-0.01em",marginBottom:"4px"},children:e}),i.jsx("span",{style:{fontSize:"13px",color:"var(--fg-muted)"},children:t})]}),r&&i.jsx("span",{style:{fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:f.color,border:`1px solid ${f.border}`,borderRadius:"4px",padding:"2px 8px"},children:r.label}),i.jsx("span",{style:{color:o?"var(--fg)":"var(--fg-dim)",fontSize:"14px",width:"16px",textAlign:"right"},children:o?"▾":"▸"})]}),o&&i.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:"24px",display:"flex",flexDirection:"column",gap:"14px"},children:[g,c&&i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"14px",marginTop:"4px",borderTop:"1px solid var(--border)",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsx("span",{style:{fontSize:"12px",color:c.error?"var(--break-red)":"var(--accent-sky)"},children:c.error??(c.saving?"Saving…":c.pendingSummary)}),i.jsxs("span",{style:{display:"flex",gap:"8px"},children:[i.jsx("button",{type:"button",onClick:c.onCancel,disabled:c.saving,style:{border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 20px",background:"transparent",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:c.saving?"wait":"pointer"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:c.onSave,disabled:c.saving,style:{border:"1px solid var(--accent-sky)",background:"var(--accent-sky)",color:"var(--bg-sunken)",borderRadius:"6px",padding:"10px 20px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:c.saving?"wait":"pointer"},children:"Save changes"})]})]})]})]})}const ch={launching:{fg:"var(--accent-sky)",border:"var(--accent-sky)",label:"Launching"},launched:{fg:"var(--vow-green)",border:"var(--vow-green)",label:"Launched"},paused:{fg:"var(--wane)",border:"var(--wane)",label:"Paused"},retired:{fg:"var(--fg-dim)",border:"var(--border)",label:"Retired"},failed:{fg:"var(--break-red)",border:"var(--break-red)",label:"Failed"}};function ev(e){return e?e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`:""}function tv(e){return e?e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function yi(e){if(!e)return"—";try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}const hx={launched:["paused","retired"],paused:["launched","retired"]};function uh(e,t,r){const n=10n**BigInt(t),s=e/n,c=e%n;if(c===0n||r===0)return s.toString();const o=c.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return o?`${s}.${o}`:s.toString()}function jr(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${uh(t,18,t>=r?4:6)} ETH`:t>=s?`${uh(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function fx(e,t,r){if(!e||!/^\d+$/.test(e)||!t||!/^\d+$/.test(t)||!r||!/^\d+$/.test(r))return null;let n;try{n=BigInt(e)}catch{return null}const s=BigInt(t)+BigInt(r);return s<=0n?null:{tasks:Number(n/s),perTaskWei:s}}const dh={launched:{fg:"var(--vow-green)",border:"var(--vow-green)",label:"Launched"},paused:{fg:"var(--wane)",border:"var(--wane)",label:"Paused"},retired:{fg:"var(--fg-dim)",border:"var(--border)",label:"Retired"}};function px(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function gx(e){if(!e)return null;try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}function vx(e){if(e instanceof Error){const t=e.code;if(typeof t=="string")return t;if(e.message.includes("subsystem_not_ready"))return"subsystem_not_ready";if(e.message.includes("registry_unavailable"))return"registry_unavailable"}return null}function mx(e){switch(vx(e)){case"subsystem_not_ready":return{title:"SolverNet subsystem is still starting.",detail:"Wait a few seconds, then retry. If this persists, restart the daemon and check its startup logs."};case"registry_unavailable":return{title:"Registry cache is unavailable.",detail:"The daemon could not read the SolverNet registry cache. Retry after startup finishes; check daemon logs if it keeps failing."};default:return{title:"Failed to load registry catalog.",detail:e instanceof Error?e.message:"Unknown error"}}}function _x({status:e}){const t=dh[e]??dh.launched;return i.jsx("span",{"data-testid":"registry-status-badge","data-status":e,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:t.fg,border:`1px solid ${t.border}`,borderRadius:"var(--radius-1)",padding:"2px 8px",whiteSpace:"nowrap"},children:t.label})}function yx({openRoles:e}){return e.length===0?i.jsx("span",{style:{color:"var(--fg-dim)",fontSize:"12px"},children:"no open roles"}):i.jsx("span",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:e.map(t=>i.jsx("span",{"data-testid":"registry-open-role","data-role":t,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"999px",padding:"2px 10px"},children:t},t))})}function xx({summary:e,joinedRoles:t}){const r=`/operator/join/${encodeURIComponent(e.manifestCid)}`,n=(t??[]).length>0;return i.jsxs("article",{"data-testid":"registry-card","data-manifest-cid":e.manifestCid,style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"16px"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"15px",fontWeight:500,color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),i.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:["Launcher: ",px(e.launcherSafeAddress)," · agentId"," ",e.launcherAgentId]})]}),i.jsx(_x,{status:e.status})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[i.jsx("span",{children:"Open roles"}),i.jsx(yx,{openRoles:e.openRoles}),i.jsx("span",{children:"Solution price"}),i.jsx("span",{style:{color:"var(--fg)"},children:jr(e.solutionPriceWei)}),i.jsx("span",{children:"Verdict price"}),i.jsx("span",{style:{color:"var(--fg)"},children:jr(e.verdictPriceWei)})]}),i.jsxs("footer",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"12px"},children:[n&&i.jsxs("span",{"data-testid":"registry-card-joined","data-manifest-cid":e.manifestCid,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:"var(--vow-green)",border:"1px solid var(--vow-green)",borderRadius:"var(--radius-pill)",padding:"4px 10px"},children:["JOINED · ",(t??[]).join(", ")]}),i.jsx(wt,{href:r,"data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,style:{display:"inline-block",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 16px",background:e.status==="launched"&&!n?"var(--accent-sky)":"transparent",color:e.status==="launched"&&!n?"var(--bg-sunken)":"var(--fg-dim)",border:`1px solid ${e.status==="launched"&&!n?"var(--accent-sky)":"var(--border)"}`,borderRadius:"var(--radius-2)",textDecoration:"none",cursor:e.status==="launched"?"pointer":"not-allowed",pointerEvents:e.status==="launched"?"auto":"none"},children:n?"Edit":"Join"})]})]})}function Sx({refetchIntervalMs:e=3e4}={}){var m;const{data:t,isLoading:r,isError:n,error:s,refetch:c}=ce({queryKey:["solvernets","registry"],queryFn:()=>ee.solvernets.listRegistry(),refetchInterval:e}),g=ce({queryKey:["operator","joined"],queryFn:()=>ee.operator.listJoined(),refetchInterval:e}),o=((m=g.data)==null?void 0:m.joinedSolverNets)??{};if(r||g.isLoading)return i.jsx("p",{"data-testid":"registry-catalog-loading",style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",margin:0},children:"Loading catalog…"});if(n||g.isError){const x=n?s:g.error,w=mx(x);return i.jsxs("div",{"data-testid":"registry-catalog-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",fontWeight:500},children:w.title}),i.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:w.detail})]}),i.jsx("button",{type:"button",onClick:()=>{c()},"data-testid":"registry-catalog-retry",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 14px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},children:"Retry"})]})}const a=(t==null?void 0:t.summaries)??[],f=a.filter(x=>o[x.manifestCid]===void 0),_=gx((t==null?void 0:t.lastRefreshedAt)??null),p=(t==null?void 0:t.lastError)??null;return i.jsxs("div",{"data-testid":"registry-catalog",style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)",letterSpacing:"0.14em",textTransform:"uppercase"},children:[i.jsxs("span",{"data-testid":"registry-catalog-meta",children:[f.length," discoverable · last refreshed"," ",_??"never"]}),p&&i.jsxs("span",{"data-testid":"registry-catalog-warn",style:{color:"var(--wane)"},children:["stale (",p.message,")"]})]}),f.length===0?i.jsx("div",{"data-testid":"registry-catalog-empty",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"24px 20px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:a.length===0?"No launched SolverNets available.":"No unjoined SolverNets available."}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:f.map(x=>{var w;return i.jsx(xx,{summary:x,joinedRoles:(w=o[x.manifestCid])==null?void 0:w.roles},x.manifestCid)})})]})}const Du="claude-code",Lu="codex",Qo="hermes-agent",bx={"claude-code-learner":Du,"codex-code-learner":Lu},wx={[Du]:"Claude Code",[Lu]:"Codex",[Qo]:"Hermes Agent","swe-rebench-v2-evaluator":"SWE-rebench v2 Evaluator"};function Lt(e){return e?bx[e]??e:""}function qr(e){const t=Lt(e);return wx[t]??t}function rv(e,t){const r=qr(e);return t?`${r} ${t}`:r}function Cx(e,t){return Lt(e)===Lt(t)}const nv=[{label:"Haiku",id:"claude-haiku-4-5-20251001"},{label:"Sonnet",id:"claude-sonnet-4-6"},{label:"Opus",id:"claude-opus-4-7"}],sv=[{label:"GPT-5.4 Mini",id:"gpt-5.4-mini"},{label:"GPT-5.5",id:"gpt-5.5"},{label:"GPT-5.4",id:"gpt-5.4"},{label:"GPT-5.3 Codex",id:"gpt-5.3-codex"},{label:"GPT-5.3 Codex Spark",id:"gpt-5.3-codex-spark"}],iv=[{label:"Claude Opus 4.6 (OpenRouter)",id:"anthropic/claude-opus-4.6"},{label:"Claude Sonnet 4.6 (OpenRouter)",id:"anthropic/claude-sonnet-4.6"},{label:"Hermes 4 405B (Nous)",id:"nousresearch/hermes-4-405b"}];function kx(e){return Lt(e)===Lu}function Ex(e){return Lt(e)===Qo}function ma(e){return Ex(e)?iv:kx(e)?sv:nv}function Jn(e){return ma(e)[0].id}function bo(e,t){const n=ma(t).find(s=>s.id===e)??null??nv.find(s=>s.id===e)??sv.find(s=>s.id===e)??iv.find(s=>s.id===e)??null;return n?{canonical:n,label:n.label,isCustom:!1}:{canonical:null,label:`Custom (${e})`,isCustom:!0}}const jx=[{name:"network-tools",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Jinn runtime tools"},{name:"claude-code-learner",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Learner loop"}],Rx=new Set(["swe-rebench-v2-runtime"]),Tx={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},Go="bundled:";function Bs(e){return Tx[e]??e}function Fn(e){return e.startsWith(Go)?e.slice(Go.length):e}function Dx(e){return e.source==="bundled"?`${Go}${e.name}`:e.name}function hh(e){const t=new Set,r=[];for(const n of e){const s=Fn(n);t.has(s)||(t.add(s),r.push(n))}return r}function Lx(e,t){const r=new Set,n=[];for(const s of jx)r.add(s.name),n.push(s);for(const s of e){if(r.has(s.name))continue;r.add(s.name);const c=Rx.has(s.name);n.push({...s,...c?{defaultIncluded:!0}:{recommended:!0},description:s.name==="swe-rebench-v2-runtime"?"SWE-rebench v2 runtime":"Recommended for this SolverNet"})}for(const s of t){const c=Fn(s);r.has(c)||(r.add(c),n.push({name:c,version:"configured",source:s.startsWith(Go)?"bundled":"custom",description:"Already configured"}))}return n}function Mx(e){const t=[e.source,e.version];return e.description&&t.push(e.description),t.join(" · ")}function _c({available:e,selected:t,disabledDefaultPlugins:r=[],onChange:n,rowTestId:s,searchTestId:c}){const[g,o]=N.useState(""),[a,f]=N.useState(!1),[_,p]=N.useState(null),m=N.useMemo(()=>Lx(e,t),[e,t]),x=new Set(t.map(Fn)),w=new Set(r.map(Fn)),y=new Set(x);for(const k of m)k.defaultIncluded&&!w.has(k.name)&&y.add(k.name);const d=m.filter(k=>y.has(k.name)),u=d.filter(k=>k.defaultIncluded).length,l=d.length-u,h=m.filter(k=>!y.has(k.name)),v=g.trim().toLowerCase(),b=v?h.filter(k=>`${k.name} ${Bs(k.name)} ${k.source} ${k.description??""}`.toLowerCase().includes(v)):h,C=k=>{const T=k.defaultIncluded?r.filter(L=>Fn(L)!==k.name):r,P=k.defaultIncluded?t:hh([...t,Dx(k)]);n(P,T),f(!1),o("")},E=k=>{if(k.defaultIncluded){p(k),f(!1),o("");return}n(t.filter(T=>Fn(T)!==k.name),r)},S=()=>{_&&(n(t,hh([...r,_.name])),p(null))};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px",position:"relative"},children:[i.jsx("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:d.map(k=>i.jsxs("span",{"data-testid":`${s}-chip`,"data-plugin":k.name,style:{border:"1px solid var(--border)",borderRadius:"999px",padding:"5px 7px 5px 9px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg)",background:k.defaultIncluded?"var(--bg-sunken)":"transparent",display:"inline-flex",alignItems:"center",gap:"6px"},children:[i.jsxs("span",{children:[Bs(k.name),i.jsx("span",{style:{color:"var(--fg-dim)"},children:k.defaultIncluded?" · default":" · selected"})]}),i.jsx("button",{type:"button","aria-label":`Remove ${Bs(k.name)}`,"data-testid":`${s}-remove`,"data-plugin":k.name,onClick:()=>E(k),style:{border:"none",background:"transparent",color:"var(--fg-muted)",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",lineHeight:1,padding:"1px 3px"},children:"x"})]},k.name))}),_&&i.jsxs("div",{role:"alertdialog","data-testid":`${s}-default-warning`,style:{border:"1px solid var(--wane)",borderRadius:"8px",background:"var(--bg-elevated)",padding:"10px 12px",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"12px",alignItems:"center",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsxs("span",{style:{fontSize:"12px",color:"var(--fg)"},children:[Bs(_.name)," is part of the default operator baseline. Removing it may break standard SolverNet workflows."]}),i.jsxs("span",{style:{display:"flex",gap:"8px"},children:[i.jsx("button",{type:"button","data-testid":`${s}-default-warning-cancel`,onClick:()=>p(null),style:{border:"1px solid var(--border)",borderRadius:"6px",background:"transparent",color:"var(--fg-muted)",padding:"6px 9px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",cursor:"pointer"},children:"Keep"}),i.jsx("button",{type:"button","data-testid":`${s}-default-warning-confirm`,onClick:S,style:{border:"1px solid var(--wane)",borderRadius:"6px",background:"transparent",color:"var(--wane)",padding:"6px 9px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",cursor:"pointer"},children:"Remove"})]})]}),i.jsxs("button",{type:"button","data-testid":`${s}-trigger`,"aria-haspopup":"listbox","aria-expanded":a,onClick:()=>f(k=>!k),onKeyDown:k=>{k.key==="Escape"&&(f(!1),o(""))},style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"6px",padding:"9px 11px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"12px",alignItems:"center",textAlign:"left",cursor:"pointer"},children:[i.jsxs("span",{style:{minWidth:0},children:["Add plugin",i.jsxs("span",{style:{color:"var(--fg-dim)"},children:[" ","· ",u," default",l>0?` · ${l} selected`:""]})]}),i.jsx("span",{style:{color:"var(--fg-muted)"},children:a?"^":"v"})]}),a&&i.jsxs("div",{style:{position:"absolute",top:"calc(100% + 6px)",left:0,right:0,zIndex:30,border:"1px solid var(--border)",borderRadius:"8px",background:"var(--bg-elevated)",boxShadow:"0 14px 34px rgba(0, 0, 0, 0.35)",overflow:"hidden"},children:[i.jsx("input",{type:"search",autoFocus:!0,"aria-label":"Search plugins","data-testid":c,value:g,onChange:k=>o(k.target.value),onKeyDown:k=>{k.key==="Escape"&&(f(!1),o(""))},placeholder:"Search plugins",style:{width:"100%",boxSizing:"border-box",background:"var(--bg)",border:"none",borderBottom:"1px solid var(--border)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)",outline:"none"}}),i.jsx("div",{role:"listbox","aria-label":"Plugins",style:{maxHeight:"240px",overflowY:"auto",display:"flex",flexDirection:"column"},children:b.length===0?i.jsx("span",{style:{padding:"12px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)"},children:h.length===0?"No plugins available to add.":"No matching plugins."}):b.map((k,T)=>{const P=y.has(k.name);return i.jsxs("button",{type:"button",role:"option","aria-selected":P,"data-testid":s,"data-plugin":k.name,"data-plugin-active":P?"true":"false","data-plugin-default":k.defaultIncluded?"true":"false",onClick:()=>C(k),style:{border:"none",borderTop:T===0?"none":"1px solid var(--border)",background:P?"var(--bg-sunken)":"transparent",color:"var(--fg)",padding:"10px 12px",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"12px",textAlign:"left",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsxs("span",{style:{minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:{fontSize:"13px",color:"var(--fg)"},children:Bs(k.name)}),i.jsx("span",{style:{fontSize:"11px",color:"var(--fg-dim)"},children:Mx(k)})]}),i.jsx("span",{style:{color:k.defaultIncluded?"var(--fg-dim)":k.recommended?"var(--accent-sky)":"var(--fg-muted)",fontSize:"11px",alignSelf:"center",textTransform:"uppercase",letterSpacing:0},children:k.defaultIncluded?"Default":k.recommended?"Recommended":"Add"})]},k.name)})})]})]})}function Za(e){const t=Lt(e.harness);return{harness:t,plugins:e.plugins??[],disabledDefaultPlugins:e.disabledDefaultPlugins??[],model:e.model??Jn(t)}}function fh(e,t){const r=Lt(t.harness);if(e.harness!==r||e.model!==(t.model??Jn(r)))return!0;const n=[...e.plugins].sort(),s=[...t.plugins??[]].sort();if(n.length!==s.length)return!0;for(let o=0;o<n.length;o+=1)if(n[o]!==s[o])return!0;const c=[...e.disabledDefaultPlugins].sort(),g=[...t.disabledDefaultPlugins??[]].sort();if(c.length!==g.length)return!0;for(let o=0;o<c.length;o+=1)if(c[o]!==g[o])return!0;return!1}function Px({joined:e,catalogEntry:t,defaultExpanded:r=!1,focusOn:n,onRestartPending:s}){const[c,g]=N.useState(r),[o,a]=N.useState(()=>Za(e)),f=N.useRef(null),_=N.useRef(null),p=yn(),m=t!==void 0,x=ce({queryKey:["solvernets","manifest",e.manifestCid],queryFn:()=>ee.solvernets.getManifest(e.manifestCid),enabled:!m&&!!e.manifestCid,staleTime:1/0,retry:!1}),w=ce({queryKey:["solvernets","catalog"],queryFn:()=>ee.getSolverNets(),enabled:!m}),d=(()=>{var z;if(m)return t;const F=(z=x.data)==null?void 0:z.manifest;if(!(!F||!w.data))return w.data.nets.find(j=>j.contract.id===F.contract.id&&j.contract.version===F.contract.version)})(),u=e.contract??(d==null?void 0:d.contract),l=!m&&(x.isLoading||w.isLoading),h=!m&&x.isError&&!x.isLoading;N.useEffect(()=>{fh(o,e)||a(Za(e))},[e.harness,e.model,JSON.stringify(e.plugins??[]),JSON.stringify(e.disabledDefaultPlugins??[])]),N.useEffect(()=>{r&&(g(!0),n==="harness"&&setTimeout(()=>{var F,z;(F=f.current)==null||F.scrollIntoView({block:"center",behavior:"smooth"}),(z=_.current)==null||z.focus()},50))},[r,n]);const v=((d==null?void 0:d.compatibleHarnesses)??[]).filter(F=>F.supportsRoles.includes("solving")).map(F=>({...F,name:Lt(F.name)})).filter((F,z,j)=>j.findIndex(D=>D.name===F.name)===z),b=new Set(v.map(F=>F.name)),C=o.harness!==""&&v.length>0&&![...b].some(F=>Cx(F,o.harness)),E=d?`${d.contract.id}@${d.contract.version}`:"",S=ma(o.harness),k=tr({mutationFn:()=>ee.operator.join(e.manifestCid,{...e.name!==void 0?{name:e.name}:{},...u!==void 0?{contract:{id:u.id,version:u.version}}:{},roles:e.roles,...o.harness?{harness:o.harness}:{},plugins:o.plugins,disabledDefaultPlugins:o.disabledDefaultPlugins,...o.model?{model:o.model}:{}}),onSuccess:F=>{p.invalidateQueries({queryKey:["operator","joined"]}),F.restartRequired&&(s==null||s())}}),[T,P]=N.useState(!1),L=tr({mutationFn:()=>ee.operator.leave(e.manifestCid),onSuccess:F=>{p.invalidateQueries({queryKey:["operator","joined"]}),F.restartRequired&&(s==null||s()),P(!1)}}),B=fh(o,e),$=e.name??e.manifestCid,O=`${e.manifestCid.slice(0,8)}…${e.manifestCid.slice(-4)}`;return i.jsxs("article",{"data-testid":"joined-net-card","data-manifest-cid":e.manifestCid,"data-expanded":c?"true":"false",style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"flex-start",gap:"12px"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",minWidth:0},children:[i.jsx("span",{"data-testid":"joined-net-card-name",style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"20px",color:"var(--fg)",letterSpacing:"-0.01em",lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis"},children:$}),i.jsxs("div",{style:{display:"flex",gap:"8px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)",flexWrap:"wrap"},children:[e.roles.map(F=>i.jsx(Bx,{label:F},F)),i.jsxs("span",{style:{color:"var(--fg-dim)"},children:["cid ",O]})]})]}),h?i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"},children:T?i.jsxs("div",{style:{display:"flex",gap:"6px"},children:[i.jsx("button",{type:"button","data-testid":"joined-net-card-leave-cancel",disabled:L.isPending,onClick:()=>P(!1),style:tl(!L.isPending),children:"Cancel"}),i.jsx("button",{type:"button","data-testid":"joined-net-card-leave-confirm",disabled:L.isPending,onClick:()=>L.mutate(),style:Zi(!L.isPending,!0),children:L.isPending?"Leaving…":"Confirm leave"})]}):i.jsx("button",{type:"button","data-testid":"joined-net-card-leave",onClick:()=>P(!0),style:Zi(!0),children:"✕ Leave"})}):i.jsx("button",{type:"button","data-testid":"joined-net-card-toggle",onClick:()=>g(F=>!F),style:{background:"transparent",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"6px 10px",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg)"},children:c?"▾ Close":"▸ Edit"})]}),h&&i.jsxs("div",{"data-testid":"joined-net-card-orphaned",style:{border:"1px solid var(--wane)",borderRadius:"var(--radius-1)",padding:"10px 14px",background:"transparent",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",lineHeight:1.5},children:[i.jsx("span",{style:{color:"var(--wane)",textTransform:"uppercase",letterSpacing:"0.14em",fontSize:"10px",marginRight:"8px"},children:"Retired"}),"Manifest no longer in the registry. This SolverNet is not claiming on-chain anymore — leaving it cleans up your config.",L.isError&&i.jsx("div",{role:"alert",style:{marginTop:"6px",color:"var(--break-red)",fontSize:"11px"},children:L.error instanceof Error?L.error.message:"Leave failed."})]}),!c&&!h&&i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"90px 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[i.jsx("span",{children:"harness"}),i.jsxs("span",{style:{color:"var(--fg)"},children:[e.harness?qr(e.harness):i.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"}),C&&i.jsxs("span",{"data-testid":"joined-net-card-warn-collapsed",style:{marginLeft:"10px",color:"var(--break-red)"},children:["⚠ does not support ",E]})]}),i.jsx("span",{children:"plugins"}),i.jsx("span",{style:{color:"var(--fg)"},children:(e.plugins??[]).length===0?i.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"}):`${e.plugins.length} active`}),i.jsx("span",{children:"model"}),i.jsx("span",{style:{color:"var(--fg)"},children:e.model?bo(e.model,Lt(e.harness)).label:i.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"})})]}),h&&i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"90px 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[i.jsx("span",{children:"harness"}),i.jsx("span",{style:{color:"var(--fg)"},children:e.harness?qr(e.harness):i.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"})}),i.jsx("span",{children:"plugins"}),i.jsx("span",{style:{color:"var(--fg)"},children:(e.plugins??[]).length===0?i.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"}):`${e.plugins.length} active`}),i.jsx("span",{children:"model"}),i.jsx("span",{style:{color:"var(--fg)"},children:e.model?bo(e.model,Lt(e.harness)).label:i.jsx("span",{style:{color:"var(--fg-dim)"},children:"—"})})]}),c&&!h&&i.jsxs("div",{"data-testid":"joined-net-card-form",style:{display:"flex",flexDirection:"column",gap:"14px",borderTop:"1px solid var(--border)",paddingTop:"12px"},children:[i.jsxs("div",{ref:f,style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:el,children:"Harness"}),i.jsxs("select",{ref:_,"aria-label":"Harness implementation","data-testid":"joined-net-card-harness-select",value:o.harness,onChange:F=>{const z=F.target.value;a(j=>({...j,harness:z,model:Jn(z)}))},style:{...ph,borderColor:C?"var(--break-red)":"var(--border)"},children:[o.harness===""&&i.jsx("option",{value:"",children:"—"}),v.map(F=>i.jsx("option",{value:F.name,children:rv(F.name,F.version)},F.name)),o.harness&&v.length>0&&!b.has(o.harness)&&i.jsxs("option",{value:o.harness,children:[qr(o.harness)," (incompatible)"]}),o.harness&&v.length===0&&i.jsx("option",{value:o.harness,children:qr(o.harness)})]}),C&&i.jsxs("span",{"data-testid":"joined-net-card-warn-expanded",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--break-red)",lineHeight:1.5},children:["⚠ This harness does not support ",i.jsx("span",{style:{color:"var(--fg)"},children:E}),".",v.length>0&&i.jsxs(i.Fragment,{children:[" Compatible: ",v.map((F,z)=>i.jsxs("span",{style:{color:"var(--accent-sky)"},children:[qr(F.name),z<v.length-1?" · ":""]},F.name))]})]})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:el,children:"Plugins"}),l?i.jsx("span",{"data-testid":"joined-net-card-catalog-loading",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)"},children:"Loading registry catalog…"}):d?(d.compatiblePlugins??[]).length===0?i.jsx(_c,{available:[],selected:o.plugins,disabledDefaultPlugins:o.disabledDefaultPlugins,onChange:(F,z)=>a(j=>({...j,plugins:F,disabledDefaultPlugins:z})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search"}):i.jsx(_c,{available:(d==null?void 0:d.compatiblePlugins)??[],selected:o.plugins,disabledDefaultPlugins:o.disabledDefaultPlugins,onChange:(F,z)=>a(j=>({...j,plugins:F,disabledDefaultPlugins:z})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search"}):i.jsx("span",{"data-testid":"joined-net-card-catalog-missing",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)",fontStyle:"italic"},children:"Registry catalog has no template for this SolverNet's contract — plugins can't be verified."})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:el,children:"Model"}),i.jsxs("select",{"aria-label":"Model","data-testid":"joined-net-card-model-select",value:o.model,onChange:F=>a({...o,model:F.target.value}),style:ph,children:[S.map(F=>i.jsx("option",{value:F.id,children:F.label},F.id)),(()=>{const F=bo(o.model,o.harness);return F.isCustom?i.jsx("option",{value:o.model,children:F.label},o.model):null})()]})]}),k.isError&&i.jsx("span",{role:"alert","data-testid":"joined-net-card-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:k.error instanceof Error?k.error.message:"Save failed."}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid var(--border)",paddingTop:"10px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)"},children:[i.jsx("span",{children:B?"Restart required to apply.":"No unsaved changes."}),i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[i.jsx("button",{type:"button","data-testid":"joined-net-card-cancel",disabled:!B||k.isPending,onClick:()=>a(Za(e)),style:tl(B&&!k.isPending),children:"Cancel"}),i.jsx("button",{type:"button","data-testid":"joined-net-card-save",disabled:!B||k.isPending,onClick:()=>k.mutate(),style:Ax(B&&!k.isPending),children:k.isPending?"Saving…":"Save"})]})]}),i.jsxs("div",{"data-testid":"joined-net-card-leave-zone",style:{marginTop:"4px",paddingTop:"12px",borderTop:"1px dashed var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",lineHeight:1.5},children:"Leaving stops claims for this SolverNet on the next daemon restart. You can re-join from the Discover catalog later."}),T?i.jsxs("div",{style:{display:"flex",gap:"6px"},children:[i.jsx("button",{type:"button","data-testid":"joined-net-card-leave-cancel",disabled:L.isPending,onClick:()=>P(!1),style:tl(!L.isPending),children:"Cancel"}),i.jsx("button",{type:"button","data-testid":"joined-net-card-leave-confirm",disabled:L.isPending,onClick:()=>L.mutate(),style:Zi(!L.isPending,!0),children:L.isPending?"Leaving…":"Confirm leave"})]}):i.jsx("button",{type:"button","data-testid":"joined-net-card-leave",onClick:()=>P(!0),style:Zi(!0),children:"✕ Leave SolverNet"})]})]})]})}function Bx({label:e}){return i.jsx("span",{"data-testid":"joined-net-card-role",style:{fontSize:"10px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"1px 6px"},children:e})}const el={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},ph={background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"8px 10px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"};function tl(e){return{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",letterSpacing:"0.12em",textTransform:"uppercase",padding:"7px 12px",background:"transparent",color:e?"var(--fg)":"var(--fg-dim)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",cursor:e?"pointer":"not-allowed"}}function Ax(e){return{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",letterSpacing:"0.12em",textTransform:"uppercase",padding:"7px 14px",background:e?"var(--accent-sky)":"transparent",color:e?"var(--bg-sunken)":"var(--fg-dim)",border:`1px solid ${e?"var(--accent-sky)":"var(--border)"}`,borderRadius:"var(--radius-1)",cursor:e?"pointer":"not-allowed"}}function Zi(e,t=!1){const r=e?"var(--break-red)":"var(--fg-dim)";return{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",padding:"7px 12px",background:t&&e?"var(--break-red)":"transparent",color:t&&e?"var(--bg-sunken)":r,border:`1px solid ${r}`,borderRadius:"var(--radius-1)",cursor:e?"pointer":"not-allowed"}}function Ix({defaultExpanded:e=!0,onRestartPending:t,joinedHashFragment:r}={}){const n=N.useRef(null),s=ce({queryKey:["operator","joined"],queryFn:()=>ee.operator.listJoined(),refetchInterval:3e4}),c=N.useMemo(()=>{var f;const a=((f=s.data)==null?void 0:f.joinedSolverNets)??{};return Object.values(a)},[s.data]),[g,o]=N.useMemo(()=>{if(!r)return[null,null];const a=r.split("/");return[a[0]??null,a[1]==="harness"?"harness":null]},[r]);return N.useEffect(()=>{const a=()=>{var f,_;!e||r!==void 0||window.location.hash==="#solvernets"&&((f=n.current)==null||f.scrollIntoView({block:"start"}),(_=n.current)==null||_.focus({preventScroll:!0}))};return a(),window.addEventListener("hashchange",a),()=>window.removeEventListener("hashchange",a)},[e,r]),i.jsx("div",{id:"solvernets",ref:n,tabIndex:-1,children:i.jsx(va,{title:"SolverNets",summary:"Configure your joined SolverNets and discover new ones.",defaultExpanded:e,children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("section",{"data-testid":"solvernets-joined-block",style:{display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[i.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Joined · ",c.length]}),s.isError&&i.jsx("span",{role:"alert",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--break-red)"},children:"Failed to load joined SolverNets."})]}),s.isLoading&&i.jsx("p",{"data-testid":"solvernets-joined-loading",style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:"Loading…"}),!s.isLoading&&c.length===0&&i.jsx("p",{"data-testid":"solvernets-joined-empty",style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",lineHeight:1.5},children:"You haven't joined any SolverNets yet. Pick one below to participate."}),c.map(a=>{const f=g!==null&&g===a.manifestCid;return i.jsx(Px,{joined:a,defaultExpanded:f,focusOn:f?o??void 0:void 0,onRestartPending:t},a.manifestCid)})]}),i.jsxs("section",{"data-testid":"solvernets-discover-block",style:{display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Discover"}),i.jsx(Sx,{})]})]})})})}function Ox(){return i.jsx("span",{style:{color:"var(--wane)",fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",fontFamily:"'JetBrains Mono', monospace",border:"1px solid var(--wane)",borderRadius:"999px",padding:"1px 6px"},children:"restart"})}function gh({label:e,restartRequired:t,helperText:r,children:n}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",display:"flex",gap:"6px",alignItems:"center"},children:[e,t&&i.jsx(Ox,{})]}),n,r&&i.jsx("span",{style:{fontSize:"11px",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace"},children:r})]})}function Fx({chain:e,rpcUrl:t,defaultRpcUrl:r,rpcHealthy:n,onRestartPending:s,defaultExpanded:c=!1}){const[g,o]=N.useState(t),[a,f]=N.useState(!1),[_,p]=N.useState(null),m=g!==t,x=e==="base"?"Base mainnet (chain id 8453)":"Base Sepolia (chain id 84532)",w=async()=>{f(!0),p(null);try{const y=g.length===0?null:g;(await ee.updateNetwork({rpcUrl:y})).restartRequired&&s()}catch(y){p(y instanceof Error?y.message:String(y))}finally{f(!1)}};return i.jsx(va,{title:"Network",summary:`${x.split(" (")[0]} · ${t}`,metaChip:{label:n?"Healthy":"Unreachable",tone:n?"live":"danger"},defaultExpanded:c,dirty:m?{pendingSummary:"RPC URL changed · save to apply",saving:a,error:_??void 0,onSave:()=>{w()},onCancel:()=>{o(t),p(null)}}:void 0,children:i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[i.jsxs(gh,{label:"Chain",helperText:"Switching chains resets fleet state — that's a separate flow.",children:[i.jsx("div",{style:{background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)"},children:x}),i.jsx("span",{style:{alignSelf:"flex-start",fontFamily:"'JetBrains Mono', monospace",fontSize:"9px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)",border:"1px solid var(--border)",borderRadius:"999px",padding:"1px 6px",marginTop:"6px"},children:"locked"})]}),i.jsxs(gh,{label:"RPC URL",restartRequired:!0,helperText:`Default: ${r}`,children:[i.jsx("input",{type:"text",value:g,onChange:y=>o(y.target.value),placeholder:r,style:{background:"var(--bg)",border:`1px solid ${m?"var(--accent-sky)":"var(--border)"}`,borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"}}),i.jsx("button",{type:"button",onClick:()=>o(""),style:{alignSelf:"flex-start",background:"transparent",border:"none",color:"var(--accent-sky)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",cursor:"pointer",marginTop:"4px",padding:0},children:"Use default"})]})]})})}function Nx({defaultExpanded:e=!1}){const[t,r]=N.useState(""),[n,s]=N.useState(""),[c,g]=N.useState("idle"),[o,a]=N.useState(null),f=async()=>{g("rotating"),a(null);try{await ee.changeKeystorePassword(t,n),g("rotated"),r(""),s("")}catch(_){a(_ instanceof Error?_.message:String(_)),g("failed")}};return i.jsxs(va,{title:"Security",summary:"Rotate keystore password · last rotated never",metaChip:{label:"Danger zone",tone:"danger"},variant:"danger",defaultExpanded:e,children:[i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Current password"}),i.jsx("input",{type:"password",value:t,onChange:_=>r(_.target.value),style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"}})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"New password"}),i.jsx("input",{type:"password",value:n,onChange:_=>s(_.target.value),style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"6px",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"}})]})]}),i.jsx("button",{type:"button",onClick:()=>{f()},disabled:c==="rotating"||t.length===0||n.length<8,style:{alignSelf:"flex-start",background:"var(--break-red)",border:"1px solid var(--break-red)",color:"var(--fg)",borderRadius:"6px",padding:"10px 20px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",cursor:c==="rotating"?"wait":"pointer"},children:c==="rotating"?"Rotating…":"Rotate password"}),c==="rotated"&&i.jsx("span",{style:{color:"var(--vow-green)",fontSize:"12px"},children:"Password rotated. Re-run jinn run with the new password."}),c==="failed"&&i.jsxs("span",{style:{color:"var(--break-red)",fontSize:"12px"},children:["Rotation failed: ",o]})]})}function Hx(){const[e,t]=N.useState(()=>{const r=window.location.hash.replace(/^#/,"");return r.length>0?r:null});return N.useEffect(()=>{const r=()=>{const n=window.location.hash.replace(/^#/,"");t(n.length>0?n:null)};return r(),window.addEventListener("hashchange",r),()=>window.removeEventListener("hashchange",r)},[]),e}function yc(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function zx(e,t){return e.publicEndpoint===t.publicEndpoint&&e.defaultPriceUsdc===t.defaultPriceUsdc&&JSON.stringify(yc(e.perArtifactTypePrice))===JSON.stringify(yc(t.perArtifactTypePrice))&&e.donation.enabled===t.donation.enabled}function vh({label:e,value:t,meta:r}){return i.jsxs("div",{"data-testid":"operator-donation-fact",style:{border:"1px solid var(--border)",borderRadius:"8px",padding:"12px 14px",minWidth:0,display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{className:"j-label",children:e}),i.jsx("strong",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",color:"var(--fg)",fontWeight:500},children:t}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})]})}function $x({pricing:e,eligibleRuns:t,peerDatasetsUsed:r,saving:n,error:s,onSave:c}){const[g,o]=N.useState(e.donation.enabled),[a,f]=N.useState(!1),_=N.useMemo(()=>({publicEndpoint:e.publicEndpoint,defaultPriceUsdc:e.defaultPriceUsdc,perArtifactTypePrice:e.perArtifactTypePrice,donation:{enabled:g}}),[g,e.defaultPriceUsdc,e.perArtifactTypePrice,e.publicEndpoint]),p=!zx(e,_),m=x=>{if(x&&!g&&!e.donation.enabled){f(!0);return}o(x)};return i.jsxs("div",{"data-testid":"operator-donation-status",style:{border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"18px",display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px",flexWrap:"wrap"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"7px",minWidth:"260px",flex:"1 1 360px"},children:[i.jsx("span",{className:"j-label",children:"Donate execution data"}),i.jsx("strong",{"data-testid":"operator-donation-mode",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",color:g?"var(--vow-green)":"var(--fg)",fontWeight:500},children:g?"Donation is on":"Donation is off"}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)",lineHeight:1.45},children:"Share scrubbed and anonymized solver/evaluator data from future runs with other operators. This lets the network learn from real executions and improve itself. Public testnet donations are free and published to IPFS."})]}),i.jsxs("label",{"data-testid":"operator-donation-toggle",style:{border:"1px solid var(--border)",borderRadius:"999px",padding:"5px",display:"inline-grid",gridTemplateColumns:"minmax(72px, auto) 42px",alignItems:"center",gap:"8px",cursor:"pointer",background:"var(--bg-sunken)",position:"relative"},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:g?"var(--vow-green)":"var(--fg-muted)",textTransform:"uppercase",letterSpacing:"0.12em",paddingLeft:"8px",whiteSpace:"nowrap"},children:g?"On":"Off"}),i.jsx("span",{"aria-hidden":"true",style:{width:"38px",height:"22px",borderRadius:"999px",background:g?"var(--vow-green)":"var(--border)",position:"relative",display:"inline-block"},children:i.jsx("span",{style:{position:"absolute",top:"3px",left:g?"19px":"3px",width:"16px",height:"16px",borderRadius:"999px",background:"var(--bg)",transition:"left 120ms ease"}})}),i.jsx("input",{"aria-label":"Donate produced data",type:"checkbox",checked:g,onChange:x=>m(x.target.checked),style:{position:"absolute",opacity:0,pointerEvents:"none"}})]})]}),i.jsxs("div",{"data-testid":"operator-donation-facts",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"10px"},children:[i.jsx(vh,{label:"Eligible runs",value:String(t),meta:"local history"}),i.jsx(vh,{label:"Peer datasets used",value:String(r),meta:"from other operators"})]}),i.jsx("div",{"data-testid":"operator-donation-caveat",style:{border:"1px solid var(--border)",borderRadius:"8px",padding:"11px 13px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",lineHeight:1.45},children:"Turning donation off stops future publishing. Data already published to IPFS may remain available."}),i.jsxs("div",{style:{borderTop:"1px solid var(--border)",paddingTop:"12px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[i.jsx(wt,{href:"/operator/execution-data",style:{color:"var(--accent-sky)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",textDecoration:"none"},children:"Review execution data →"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginLeft:"auto"},children:[i.jsx("span",{"data-testid":"operator-donation-settings-state",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:s?"var(--break-red)":p?"var(--accent-sky)":"var(--fg-dim)"},children:s??(p?"Donation changed":"Current")}),i.jsx("button",{type:"button",disabled:!p||n,onClick:()=>c(_),style:{border:"1px solid var(--accent-sky)",background:p?"var(--accent-sky)":"transparent",color:p?"var(--bg-sunken)":"var(--fg-dim)",borderRadius:"6px",padding:"9px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",cursor:!p||n?"not-allowed":"pointer"},children:n?"Saving…":"Save"})]})]}),a&&i.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"operator-donation-confirm-title","data-testid":"operator-donation-confirm",style:{position:"fixed",inset:0,zIndex:40,background:"rgba(0, 0, 0, 0.55)",display:"grid",placeItems:"center",padding:"24px"},children:i.jsxs("div",{style:{width:"min(460px, 100%)",border:"1px solid var(--border)",borderRadius:"10px",background:"var(--bg-elevated)",padding:"20px",display:"flex",flexDirection:"column",gap:"14px",boxShadow:"0 22px 70px rgba(0, 0, 0, 0.36)"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"7px"},children:[i.jsx("span",{className:"j-label",children:"Enable donation"}),i.jsx("strong",{id:"operator-donation-confirm-title",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",color:"var(--fg)",fontWeight:500},children:"Share future execution data"}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-dim)",lineHeight:1.5},children:"Future solver/evaluator runs will be scrubbed, anonymized, and published to IPFS so other operators can use them. This helps the network learn from real executions and improve itself."}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",lineHeight:1.5},children:"Turning donation off later stops future publishing, but data already published to IPFS may remain available."})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px",flexWrap:"wrap"},children:[i.jsx("button",{type:"button",onClick:()=>f(!1),style:{border:"1px solid var(--border)",background:"transparent",color:"var(--fg)",borderRadius:"6px",padding:"9px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",cursor:"pointer"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:()=>{o(!0),f(!1)},style:{border:"1px solid var(--accent-sky)",background:"var(--accent-sky)",color:"var(--bg-sunken)",borderRadius:"6px",padding:"9px 14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",cursor:"pointer"},children:"Enable donation"})]})]})})]})}function Wx({defaultExpanded:e=!1,onRestartPending:t=()=>{}}){const r=yn(),{data:n,isLoading:s,isError:c,error:g,refetch:o}=ce({queryKey:["operator-artifacts","served"],queryFn:()=>ee.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=tr({mutationFn:p=>ee.operator.updatePricing(p),onSuccess:async()=>{t(),await r.invalidateQueries({queryKey:["operator-artifacts"]})}}),f=n==null?void 0:n.summary,_=f?`${f.served.totalCount} eligible runs · donation ${n!=null&&n.pricing.donation.enabled?"on":"off"} · ${f.network.totalCount} peer datasets used`:"Donate scrubbed and anonymized run data to IPFS so other operators can use it.";return i.jsxs(va,{title:"Data donation",summary:_,defaultExpanded:e,metaChip:{label:n!=null&&n.pricing.donation.enabled?"IPFS donation on":"Donation off",tone:n!=null&&n.pricing.donation.enabled?"live":"default"},children:[s&&i.jsx("p",{"data-testid":"operator-data-market-loading",style:{margin:0,color:"var(--fg-muted)",fontSize:"13px"},children:"Loading execution data…"}),c&&i.jsxs("div",{role:"alert","data-testid":"operator-data-market-error",style:{border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"14px 16px",display:"flex",justifyContent:"space-between",gap:"12px",alignItems:"center"},children:[i.jsx("span",{style:{color:"var(--break-red)",fontSize:"13px"},children:g instanceof Error?g.message:"Failed to load execution data."}),i.jsx("button",{type:"button",onClick:()=>{o()},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",background:"transparent",color:"var(--fg)",padding:"7px 10px",cursor:"pointer"},children:"Retry"})]}),n&&i.jsx(i.Fragment,{children:i.jsx($x,{pricing:n.pricing,eligibleRuns:n.summary.served.totalCount,peerDatasetsUsed:n.summary.network.totalCount,saving:a.isPending,error:a.error instanceof Error?a.error.message:null,onSave:p=>a.mutate(p)},`${n.pricing.publicEndpoint}|${n.pricing.defaultPriceUsdc}|${n.pricing.donation.enabled}|${JSON.stringify(yc(n.pricing.perArtifactTypePrice))}`)})]})}function Ux({onRestartPending:e=()=>{}}){const{data:t}=ce({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:1500}),r=Hx(),n=(r==null?void 0:r.split("/"))??[],s=n[0],c=s==="solvernets"&&n.slice(1).join("/")||void 0,g=(t==null?void 0:t.chain)??"base-sepolia",o=(t==null?void 0:t.rpcUrl)??"",a=(t==null?void 0:t.defaultRpcUrl)??(g==="base"?"https://mainnet.base.org":"https://sepolia.base.org");return i.jsxs("div",{"data-testid":"operator-page",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[i.jsx(Zg,{}),i.jsxs("section",{style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"10px",padding:"16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:{fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Launcher tools"}),i.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:"Create or manage SolverNets you own."})]}),i.jsx(wt,{href:"/launcher",style:{color:"var(--accent-sky)",fontSize:"11px",textDecoration:"none",letterSpacing:"0.14em",textTransform:"uppercase",whiteSpace:"nowrap"},children:"Open Launcher →"})]}),i.jsx(Ix,{defaultExpanded:s==="solvernets"||s===void 0,joinedHashFragment:c,onRestartPending:e}),i.jsx(Wx,{defaultExpanded:s==="data-market",onRestartPending:e}),i.jsx(Fx,{chain:g,rpcUrl:o,defaultRpcUrl:a,rpcHealthy:!0,onRestartPending:e,defaultExpanded:s==="network"}),i.jsx(Nx,{defaultExpanded:s==="security"})]})}function ys(e,t){const r=e??[];return r.includes(t)?r:[...r,t]}function Xr(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${mh(t,18,t>=r?4:6)} ETH`:t>=s?`${mh(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function mh(e,t,r){const n=10n**BigInt(t),s=e/n,c=e%n;if(c===0n||r===0)return s.toString();const o=c.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return o?`${s}.${o}`:s.toString()}function _h(e){const t=e.trim();if(t.length===0)return null;if(!/^\d+$/.test(t))throw new Error("not a non-negative integer");return BigInt(t)}const yh={launching:{fg:"var(--accent-sky)",border:"var(--accent-sky)",label:"Launching"},launched:{fg:"var(--vow-green)",border:"var(--vow-green)",label:"Launched"},paused:{fg:"var(--wane)",border:"var(--wane)",label:"Paused"},retired:{fg:"var(--fg-dim)",border:"var(--border)",label:"Retired"},failed:{fg:"var(--break-red)",border:"var(--break-red)",label:"Failed"}};function Jx(e){return e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`}function qx(e){try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}function Kx({status:e}){const t=yh[e]??yh.launching;return i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:t.fg,border:`1px solid ${t.border}`,borderRadius:"var(--radius-1)",padding:"2px 8px",whiteSpace:"nowrap"},children:t.label})}function Vx({label:e}){return i.jsx("span",{"data-testid":"launcher-owned-row-role",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.12em",color:"var(--fg-muted)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"1px 6px"},children:e})}function Qx({record:e}){const[,t]=Li(),r=`/launcher/launched/${encodeURIComponent(e.solverNetId)}`,n=e.summary,s=(n==null?void 0:n.name)??e.solverNetId,c=n!==void 0?`${n.contractId}.${n.contractVersion}`:null;return i.jsxs("a",{href:r,"data-testid":"launcher-owned-row","data-solvernet-id":e.solverNetId,"data-has-summary":n!==void 0?"true":"false",onClick:g=>{g.preventDefault(),t(r)},style:{display:"grid",gridTemplateColumns:"1fr auto",alignItems:"center",gap:"16px",padding:"16px 20px",background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",textDecoration:"none",color:"inherit",cursor:"pointer"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:[i.jsx("div",{"data-testid":"launcher-owned-row-primary",style:{fontFamily:n!==void 0?"'Instrument Serif', 'Times New Roman', serif":"'JetBrains Mono', monospace",fontSize:n!==void 0?"18px":"14px",fontWeight:n!==void 0?400:500,color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",letterSpacing:n!==void 0?"-0.01em":void 0},children:s}),c!==null&&i.jsx("div",{"data-testid":"launcher-owned-row-contract",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:c}),n!==void 0&&i.jsxs("div",{"data-testid":"launcher-owned-row-prices",style:{display:"flex",gap:"14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",flexWrap:"wrap"},children:[i.jsxs("span",{children:["solution ",Xr(n.solutionPriceWei)]}),i.jsxs("span",{children:["verdict ",Xr(n.verdictPriceWei)]})]}),n!==void 0&&n.openRoles.length>0&&i.jsx("div",{"data-testid":"launcher-owned-row-roles",style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:n.openRoles.map(g=>i.jsx(Vx,{label:g},g))}),i.jsxs("div",{style:{display:"flex",gap:"14px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",flexWrap:"wrap"},children:[i.jsxs("span",{children:["cid ",Jx(e.manifestCid)]}),i.jsxs("span",{children:["launched ",qx(e.launchedAt)]})]})]}),i.jsx(Kx,{status:e.status})]})}function Gx(){return i.jsxs("div",{"data-testid":"launcher-empty-state",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"32px 24px",display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsx("h2",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"18px",fontWeight:500,color:"var(--fg)",margin:0,letterSpacing:"-0.01em"},children:"No SolverNets created yet."}),i.jsx("p",{style:{color:"var(--fg-muted)",fontSize:"14px",lineHeight:1.5,margin:0},children:"Create a SolverNet to direct operators toward a specific kind of knowledge work."}),i.jsx("div",{children:i.jsx(wt,{href:"/launcher/create",style:{display:"inline-block",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",padding:"12px 20px",background:"var(--accent-sky)",color:"var(--bg-sunken)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",textDecoration:"none",cursor:"pointer"},children:"Create SolverNet"})})]})}function Xx(){const{data:e,isLoading:t,isError:r,error:n,refetch:s}=ce({queryKey:["solvernets","launched","owned"],queryFn:()=>ee.solvernets.listLaunched(),refetchInterval:3e4});return i.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[i.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"32px",margin:0,color:"var(--fg)",fontWeight:400},children:"Your SolverNets"}),((e==null?void 0:e.records.length)??0)>0&&i.jsx(wt,{href:"/launcher/create","data-testid":"launcher-create-cta",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 16px",background:"var(--accent-sky)",color:"var(--bg-sunken)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",textDecoration:"none",cursor:"pointer"},children:"Create SolverNet"})]}),t&&i.jsx("p",{"data-testid":"launcher-loading",style:{color:"var(--fg-muted)",fontSize:"13px",margin:0},children:"Loading…"}),r&&i.jsxs("div",{"data-testid":"launcher-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",fontWeight:500},children:"Failed to load your SolverNets."}),i.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px"},children:n instanceof Error?n.message:"Unknown error"})]}),i.jsx("button",{type:"button",onClick:()=>{s()},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 14px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},children:"Retry"})]}),!t&&!r&&e&&e.records.length===0&&i.jsx(Gx,{}),!t&&!r&&e&&e.records.length>0&&i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:e.records.map(c=>i.jsx(Qx,{record:c},c.solverNetId))})]})}function Yx({current:e,total:t=5}){return i.jsxs("div",{"data-testid":"launcher-create-progress",style:{display:"flex",alignItems:"center",gap:"12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:[i.jsxs("span",{"data-testid":"launcher-create-step-counter",children:["Step ",e," of ",t]}),i.jsx("div",{style:{display:"flex",gap:"4px",flex:1,maxWidth:"320px"},children:Array.from({length:t}).map((r,n)=>{const s=n+1,c=s<=e;return i.jsx("span",{"data-testid":`launcher-create-progress-pip-${s}`,"data-filled":c?"true":"false",style:{flex:1,height:"3px",background:c?"var(--accent-sky)":"var(--border)",borderRadius:"var(--radius-1)"}},s)})})]})}function xn({step:e,total:t=5,title:r,blurb:n,children:s,footer:c,error:g}){return i.jsxs("main",{"data-testid":`launcher-create-step-${e}`,style:{padding:"24px",display:"flex",flexDirection:"column",gap:"20px",maxWidth:"720px",margin:"0 auto"},children:[i.jsx(Yx,{current:e,total:t}),i.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"32px",margin:0,color:"var(--fg)",fontWeight:400,letterSpacing:"-0.01em"},children:r}),n&&i.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"14px",lineHeight:1.5},children:n})]}),g&&i.jsx("div",{"data-testid":"launcher-create-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"12px 16px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:g}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:s}),i.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:c})]})}function Sn({onBack:e,onNext:t,nextLabel:r="Next",nextDisabled:n=!1,busy:s=!1,right:c}){return i.jsxs(i.Fragment,{children:[i.jsx("div",{children:e&&i.jsx("button",{type:"button","data-testid":"launcher-create-back",onClick:e,disabled:s,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 18px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:s?"wait":"pointer"},children:"Back"})}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[c,t&&i.jsx("button",{type:"button","data-testid":"launcher-create-next",onClick:t,disabled:n||s,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 22px",background:n||s?"var(--bg-elevated)":"var(--accent-sky)",color:n||s?"var(--fg-dim)":"var(--bg-sunken)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",cursor:n||s?"not-allowed":"pointer",opacity:n||s?.6:1},children:r})]})]})}function Pe({label:e,helperText:t,error:r,children:n}){return i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),n,r?i.jsx("span",{style:{fontSize:"12px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace"},children:r}):t&&i.jsx("span",{style:{fontSize:"11px",color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace"},children:t})]})}const ov={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",width:"100%",boxSizing:"border-box"},Ue=ov,ot={...ov,border:"1px solid var(--break-red)"};function xh({draft:e,onAdvance:t,busy:r,error:n}){const[s,c]=N.useState(e.name??""),[g,o]=N.useState(e.description??""),[a,f]=N.useState(!1),_=a&&s.trim().length===0?"Name is required.":null,p=a&&g.trim().length===0?"Description is required.":null,m=async x=>{x==null||x.preventDefault(),f(!0),!(s.trim().length===0||g.trim().length===0)&&await t({name:s.trim(),description:g.trim(),completedSteps:ys(e.completedSteps,"define")})};return i.jsx(xn,{step:1,title:"Name your SolverNet",blurb:"Pick a short, recognisable name and describe what kind of knowledge work this SolverNet directs operators toward.",error:n,footer:i.jsx(Sn,{onNext:()=>{m()},nextDisabled:s.trim().length===0||g.trim().length===0,busy:r}),children:i.jsxs("form",{onSubmit:x=>{m(x)},style:{display:"flex",flexDirection:"column",gap:"16px"},children:[i.jsx(Pe,{label:"Name",error:_,helperText:"Shown in the registry catalog and the operator opt-in cards.",children:i.jsx("input",{"data-testid":"launcher-create-name",type:"text",value:s,onChange:x=>c(x.target.value),placeholder:"e.g. Polymarket forecasts",style:_?ot:Ue,disabled:r})}),i.jsx(Pe,{label:"Description",error:p,helperText:"One or two sentences. Operators read this when deciding whether to opt in.",children:i.jsx("textarea",{"data-testid":"launcher-create-description",value:g,onChange:x=>o(x.target.value),rows:4,placeholder:"Forecast resolved Polymarket outcomes; rewarded by Brier score on verified resolutions.",style:{...p?ot:Ue,resize:"vertical",minHeight:"96px",fontFamily:"'JetBrains Mono', monospace"},disabled:r})}),i.jsx("button",{type:"submit",hidden:!0,"aria-hidden":!0,tabIndex:-1})]})})}const xs={id:"prediction",version:"v1",name:"Prediction",description:"Forecast resolved outcomes. Solvers submit a probability for a binary market; evaluators score against the on-chain resolution using Brier loss.",schemas:{task:{name:"prediction.v1 Task",description:"A binary Polymarket market with resolution time, condition id, and orderbook snapshot."},solution:{name:"prediction.v1 Solution",description:"A scalar probability in [0, 1] that the market resolves YES."},verdict:{name:"prediction.v1 Verdict",description:"Brier-loss score derived from the solver probability and the resolved outcome."}},evaluationFunction:{id:"prediction.brier-loss.v1",deterministic:!0,inputs:["prediction.v1 Task","prediction.v1 Solution","Polymarket/UMA resolution"],output:"prediction.v1 Verdict"},aggregationFunction:{id:"prediction.trailing-mean-brier-spread.v1",deterministic:!0,inputs:["SCORED prediction.v1 Verdicts"],output:"trailing mean brierSpread",windowDays:84},claimPolicyDefaults:{mode:"parallel",maxClaims:25,maxClaimsPerOperator:1,claimLeaseTtlSeconds:30*60},credentialRequirements:{creator:[{id:"polymarket.public.market-data.read",kind:"public-api",required:!0,description:"Read public Polymarket market metadata and orderbook snapshots for Task creation."}],solver:[],evaluator:[{id:"polymarket.public.resolution.read",kind:"public-api",required:!0,description:"Read public Polymarket/UMA final market state for resolution mapping."}]},generatorDefaults:{cadenceMs:6*60*60*1e3,submissionWindowMs:6*60*60*1e3,maxNewRoundsPerPoll:25,maxNewRoundsPerDay:100,maxOpenRounds:250,minTimeToResolutionHours:24,maxTimeToResolutionHours:168,minLiquidityUsd:"10000",minVolume24hUsd:"2500",maxYesSpread:"0.10",maxOrderbookAgeSeconds:60}},av={id:"swe-rebench-v2",version:"v1",name:"SWE-rebench v2",description:"Code-issue benchmark sourced from the nebius/SWE-rebench-leaderboard HuggingFace dataset. Solvers submit a patch; evaluators run the upstream eval.py harness inside the per-instance Docker image and emit a 0/1 Verdict against the FAIL_TO_PASS / PASS_TO_PASS tests.",schemas:{task:{name:"swe-rebench-v2.v1 Task",description:"A reference to a HuggingFace dataset row by (hf_dataset, hf_split, instance_id), plus repo + base_commit + language + problem statement."},solution:{name:"swe-rebench-v2.v1 Solution",description:"A unified diff patch (git-format), with optional self-reported cost. The trajectory blob is pinned daemon-side and referenced via the envelope, not the payload."},verdict:{name:"swe-rebench-v2.v1 Verdict",description:"Score 0 or 1 based on whether the patch passes the per-instance Docker test suite, plus passed_match flag and evaluator cost. The test log is pinned daemon-side and surfaced via the verdict-artifact metadata."}},evaluationFunction:{id:"swe-rebench-v2.docker-test-suite.v1",deterministic:!0,inputs:["swe-rebench-v2.v1 Task","swe-rebench-v2.v1 Solution","per-instance Docker image"],output:"swe-rebench-v2.v1 Verdict"},aggregationFunction:{id:"swe-rebench-v2.multi-winrate.v1",deterministic:!0,inputs:["SCORED swe-rebench-v2.v1 Verdicts"],output:"mean / complexityWeighted / byLanguage / frontierResolved / parityTripRate",windowDays:30},claimPolicyDefaults:{mode:"parallel",maxClaims:50,maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60},credentialRequirements:{creator:[{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read public HuggingFace dataset rows from the nebius/SWE-rebench-leaderboard splits."}],solver:[],evaluator:[{id:"docker.local.run",kind:"local-runtime",required:!0,description:"Run per-instance Docker images that ship with the upstream eval.py harness."},{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read the HF dataset row referenced by the Task to recover test_patch + FAIL_TO_PASS / PASS_TO_PASS."}]},generatorDefaults:{N_target_successes:3,N_max_postings_per_task:10,cooldown_ms:24*60*60*1e3}},xc={"prediction.v1":xs,"swe-rebench-v2.v1":av},Zx="prediction.v1";function eS({draft:e,template:t=xs,onAdvance:r,onBack:n,busy:s,error:c}){const g=()=>{r({templateContractId:t.id,templateContractVersion:t.version,completedSteps:ys(e.completedSteps,"reviewContract")})};return i.jsx(xn,{step:2,title:"Review contract",blurb:"The contract defines the schemas, evaluation, and aggregation that this SolverNet will pin to its manifest.",error:c,footer:i.jsx(Sn,{onBack:n,onNext:g,busy:s}),children:i.jsxs("article",{"data-testid":"launcher-create-template","data-template-id":`${t.id}.${t.version}`,style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"16px"},children:[i.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:[t.id,".",t.version]}),i.jsx("h2",{style:{margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"24px",fontWeight:400,color:"var(--fg)"},children:t.name}),i.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5},children:t.description})]}),i.jsxs(As,{title:"Schemas",children:[i.jsx(Qe,{label:"Task",value:t.schemas.task.name,hint:t.schemas.task.description}),i.jsx(Qe,{label:"Solution",value:t.schemas.solution.name,hint:t.schemas.solution.description}),i.jsx(Qe,{label:"Verdict",value:t.schemas.verdict.name,hint:t.schemas.verdict.description})]}),i.jsxs(As,{title:"Evaluation function",children:[i.jsx(Qe,{label:"Id",value:t.evaluationFunction.id,mono:!0}),i.jsx(Qe,{label:"Deterministic",value:t.evaluationFunction.deterministic?"yes":"no"}),i.jsx(Qe,{label:"Inputs",value:t.evaluationFunction.inputs.join(", ")}),i.jsx(Qe,{label:"Output",value:t.evaluationFunction.output})]}),i.jsxs(As,{title:"Aggregation function",children:[i.jsx(Qe,{label:"Id",value:t.aggregationFunction.id,mono:!0}),i.jsx(Qe,{label:"Window",value:t.aggregationFunction.windowDays!==void 0?`${t.aggregationFunction.windowDays} days`:"—"}),i.jsx(Qe,{label:"Output",value:t.aggregationFunction.output})]}),i.jsxs(As,{title:"Claim policy defaults",children:[i.jsx(Qe,{label:"Mode",value:t.claimPolicyDefaults.mode}),i.jsx(Qe,{label:"Max claims",value:String(t.claimPolicyDefaults.maxClaims)}),i.jsx(Qe,{label:"Per operator",value:String(t.claimPolicyDefaults.maxClaimsPerOperator)}),i.jsx(Qe,{label:"Lease TTL",value:`${t.claimPolicyDefaults.claimLeaseTtlSeconds}s`})]}),i.jsxs(As,{title:"Credential requirements",children:[i.jsx(rl,{role:"creator",creds:t.credentialRequirements.creator}),i.jsx(rl,{role:"solver",creds:t.credentialRequirements.solver}),i.jsx(rl,{role:"evaluator",creds:t.credentialRequirements.evaluator})]})]})})}function As({title:e,children:t}){return i.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:"8px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:[i.jsx("h3",{style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:e}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:t})]})}function Qe({label:e,value:t,hint:r,mono:n}){return i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr",gap:"12px",alignItems:"baseline"},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",letterSpacing:"0.06em"},children:e}),i.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[i.jsx("span",{style:{fontFamily:n?"'JetBrains Mono', monospace":"inherit",fontSize:"13px",color:"var(--fg)"},children:t}),r&&i.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",lineHeight:1.5},children:r})]})]})}function rl({role:e,creds:t}){return i.jsxs("div",{"data-testid":`launcher-create-credentials-${e}`,style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",letterSpacing:"0.06em",textTransform:"capitalize"},children:e}),t.length===0?i.jsx("div",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:"None."}):t.map(r=>i.jsxs("div",{style:{fontSize:"12px",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace",lineHeight:1.5},children:[i.jsx("span",{style:{color:"var(--accent-sky)"},children:r.id}),i.jsxs("span",{style:{color:"var(--fg-dim)"},children:[" · ",r.kind]}),r.required&&i.jsx("span",{style:{color:"var(--wane)"},children:" · required"}),i.jsx("div",{style:{color:"var(--fg-muted)"},children:r.description})]},r.id))]})}function tS(e){const t=e.template??xs;switch(t.id){case"prediction":return i.jsx(nS,{...e,template:t});case"swe-rebench-v2":return i.jsx(iS,{...e,template:t});default:return i.jsx(xn,{step:3,title:"Configure generator",blurb:"No generator form is registered for this template.",error:e.error??null,footer:i.jsx(Sn,{onBack:e.onBack,onNext:()=>{},nextDisabled:!0,busy:e.busy}),children:i.jsx("div",{"data-testid":"launcher-create-generator-unsupported"})})}}const Sh=6e4;function qt(e,t){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():String(t)}function bh(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function rS(e){const t=xs.generatorDefaults,r=60*60*1e3;return{cadenceMs:qt(e==null?void 0:e.cadenceMs,t.cadenceMs),windowMs:qt((e==null?void 0:e.windowMs)??(e==null?void 0:e.submissionWindowMs),t.submissionWindowMs),resolveGapMs:qt(e==null?void 0:e.resolveGapMs,r),maxNewRoundsPerPoll:qt(e==null?void 0:e.maxNewRoundsPerPoll,t.maxNewRoundsPerPoll),maxNewRoundsPerDay:qt(e==null?void 0:e.maxNewRoundsPerDay,t.maxNewRoundsPerDay),maxOpenRounds:qt(e==null?void 0:e.maxOpenRounds,t.maxOpenRounds),allowlistConditionIds:bh(e==null?void 0:e.allowlistConditionIds),blocklistConditionIds:bh(e==null?void 0:e.blocklistConditionIds)}}function wh(e){const t={},r=Kt(e.cadenceMs);r===null?t.cadenceMs="Must be a positive integer (ms).":r<Sh&&(t.cadenceMs=`Cadence must be at least ${Sh/1e3}s.`);const n=Kt(e.windowMs);n===null&&(t.windowMs="Must be a positive integer (ms).");const s=Kt(e.resolveGapMs);s===null&&(t.resolveGapMs="Must be a positive integer (ms).");const c=Kt(e.maxNewRoundsPerPoll);c===null&&(t.maxNewRoundsPerPoll="Must be a positive integer.");const g=Kt(e.maxNewRoundsPerDay);g===null&&(t.maxNewRoundsPerDay="Must be a positive integer.");const o=Kt(e.maxOpenRounds);return o===null&&(t.maxOpenRounds="Must be a positive integer."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{cadenceMs:r,windowMs:n,resolveGapMs:s,submissionWindowMs:n,maxNewRoundsPerPoll:c,maxNewRoundsPerDay:g,maxOpenRounds:o,allowlistConditionIds:Ch(e.allowlistConditionIds),blocklistConditionIds:Ch(e.blocklistConditionIds)}}}function Kt(e){const t=e.trim();if(t.length===0||!/^\d+$/.test(t))return null;const r=Number(t);return!Number.isFinite(r)||r<=0?null:r}function Ch(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function nS({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const c=N.useMemo(()=>rS(e.generatorConfig),[e.generatorConfig]),[g,o]=N.useState(c),[a,f]=N.useState(!1),_=a?wh(g):{ok:!0,errors:{}},p=a?_.errors:{},m=()=>{f(!0);const w=wh(g);!w.ok||!w.generatorConfig||t({generatorConfig:w.generatorConfig,completedSteps:ys(e.completedSteps,"configureGenerator")})},x=(w,y)=>{o(d=>({...d,[w]:y}))};return i.jsxs(xn,{step:3,title:"Configure generator",blurb:"The auto-generator polls Polymarket and posts Tasks while the SolverNet is launched. Defaults are tuned for a healthy idle SolverNet — adjust to match your appetite.",error:s,footer:i.jsx(Sn,{onBack:r,onNext:m,busy:n,nextDisabled:a&&!_.ok}),children:[i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[i.jsx(Pe,{label:"Cadence (ms)",helperText:"How often the generator polls Polymarket. Minimum 60s.",error:p.cadenceMs??null,children:i.jsx("input",{"data-testid":"launcher-create-cadenceMs",type:"text",inputMode:"numeric",value:g.cadenceMs,onChange:w=>x("cadenceMs",w.target.value),style:p.cadenceMs?ot:Ue,disabled:n})}),i.jsx(Pe,{label:"Submission window (ms)",helperText:"How long Tasks stay open for solving.",error:p.windowMs??null,children:i.jsx("input",{"data-testid":"launcher-create-windowMs",type:"text",inputMode:"numeric",value:g.windowMs,onChange:w=>x("windowMs",w.target.value),style:p.windowMs?ot:Ue,disabled:n})}),i.jsx(Pe,{label:"Resolve gap (ms)",helperText:"Cushion between window-close and resolution.",error:p.resolveGapMs??null,children:i.jsx("input",{"data-testid":"launcher-create-resolveGapMs",type:"text",inputMode:"numeric",value:g.resolveGapMs,onChange:w=>x("resolveGapMs",w.target.value),style:p.resolveGapMs?ot:Ue,disabled:n})}),i.jsx(Pe,{label:"Max rounds / poll",helperText:"Cap on new Tasks per generator tick.",error:p.maxNewRoundsPerPoll??null,children:i.jsx("input",{"data-testid":"launcher-create-maxNewRoundsPerPoll",type:"text",inputMode:"numeric",value:g.maxNewRoundsPerPoll,onChange:w=>x("maxNewRoundsPerPoll",w.target.value),style:p.maxNewRoundsPerPoll?ot:Ue,disabled:n})}),i.jsx(Pe,{label:"Max rounds / day",helperText:"Daily ceiling across all polls.",error:p.maxNewRoundsPerDay??null,children:i.jsx("input",{"data-testid":"launcher-create-maxNewRoundsPerDay",type:"text",inputMode:"numeric",value:g.maxNewRoundsPerDay,onChange:w=>x("maxNewRoundsPerDay",w.target.value),style:p.maxNewRoundsPerDay?ot:Ue,disabled:n})}),i.jsx(Pe,{label:"Max open rounds",helperText:"Concurrent open Tasks before back-off kicks in.",error:p.maxOpenRounds??null,children:i.jsx("input",{"data-testid":"launcher-create-maxOpenRounds",type:"text",inputMode:"numeric",value:g.maxOpenRounds,onChange:w=>x("maxOpenRounds",w.target.value),style:p.maxOpenRounds?ot:Ue,disabled:n})})]}),i.jsx(Pe,{label:"Allowlist condition ids",helperText:"Comma-separated. If non-empty, only these markets are considered.",children:i.jsx("textarea",{"data-testid":"launcher-create-allowlistConditionIds",value:g.allowlistConditionIds,onChange:w=>x("allowlistConditionIds",w.target.value),rows:2,placeholder:"0xabc…, 0xdef…",style:{...Ue,resize:"vertical",fontFamily:"'JetBrains Mono', monospace"},disabled:n})}),i.jsx(Pe,{label:"Blocklist condition ids",helperText:"Comma-separated. Markets here are skipped, even if they pass the eligibility filters.",children:i.jsx("textarea",{"data-testid":"launcher-create-blocklistConditionIds",value:g.blocklistConditionIds,onChange:w=>x("blocklistConditionIds",w.target.value),rows:2,placeholder:"0xabc…",style:{...Ue,resize:"vertical",fontFamily:"'JetBrains Mono', monospace"},disabled:n})})]})}const kh=6e4;function sS(e){const t=av.generatorDefaults;return{N_target_successes:qt(e==null?void 0:e.N_target_successes,t.N_target_successes),N_max_postings_per_task:qt(e==null?void 0:e.N_max_postings_per_task,t.N_max_postings_per_task),cooldown_ms:qt(e==null?void 0:e.cooldown_ms,t.cooldown_ms)}}function Eh(e){const t={},r=Kt(e.N_target_successes);r===null&&(t.N_target_successes="Must be a positive integer.");const n=Kt(e.N_max_postings_per_task);n===null?t.N_max_postings_per_task="Must be a positive integer.":r!==null&&n<r&&(t.N_max_postings_per_task="Max postings must be ≥ target successes — otherwise saturation is unreachable.");const s=Kt(e.cooldown_ms);return s===null?t.cooldown_ms="Must be a positive integer (ms).":s<kh&&(t.cooldown_ms=`Cooldown must be at least ${kh/1e3}s.`),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{N_target_successes:r,N_max_postings_per_task:n,cooldown_ms:s}}}function iS({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const c=N.useMemo(()=>sS(e.generatorConfig),[e.generatorConfig]),[g,o]=N.useState(c),[a,f]=N.useState(!1),_=a?Eh(g):{ok:!0,errors:{}},p=a?_.errors:{},m=()=>{f(!0);const w=Eh(g);!w.ok||!w.generatorConfig||t({generatorConfig:w.generatorConfig,completedSteps:ys(e.completedSteps,"configureGenerator")})},x=(w,y)=>{o(d=>({...d,[w]:y}))};return i.jsx(xn,{step:3,title:"Configure generator",blurb:"The generator pulls SWE-rebench v2 instances from the HuggingFace pool and posts Tasks until enough successful Verdicts accumulate or the posting cap is hit.",error:s,footer:i.jsx(Sn,{onBack:r,onNext:m,busy:n,nextDisabled:a&&!_.ok}),children:i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[i.jsx(Pe,{label:"Target successful Verdicts per instance",helperText:"How many score=1 Verdicts saturate a SWE instance and stop further Task posting.",error:p.N_target_successes??null,children:i.jsx("input",{"data-testid":"launcher-create-N_target_successes",type:"text",inputMode:"numeric",value:g.N_target_successes,onChange:w=>x("N_target_successes",w.target.value),style:p.N_target_successes?ot:Ue,disabled:n})}),i.jsx(Pe,{label:"Max Task postings per instance",helperText:"Hard ceiling on Task postings to bound spend on impossible SWE instances.",error:p.N_max_postings_per_task??null,children:i.jsx("input",{"data-testid":"launcher-create-N_max_postings_per_task",type:"text",inputMode:"numeric",value:g.N_max_postings_per_task,onChange:w=>x("N_max_postings_per_task",w.target.value),style:p.N_max_postings_per_task?ot:Ue,disabled:n})}),i.jsx(Pe,{label:"Cooldown between task postings (ms)",helperText:"Minimum gap before posting another Task for the same SWE instance. Minimum 60s.",error:p.cooldown_ms??null,children:i.jsx("input",{"data-testid":"launcher-create-cooldown_ms",type:"text",inputMode:"numeric",value:g.cooldown_ms,onChange:w=>x("cooldown_ms",w.target.value),style:p.cooldown_ms?ot:Ue,disabled:n})})]})})}function oS(e,t){const r={};let n,s;try{n=_h(e),n===null?r.solutionPriceWei="Required.":n<0n&&(r.solutionPriceWei="Must be non-negative.")}catch{r.solutionPriceWei="Must be a non-negative integer (wei).",n=null}try{s=_h(t),s===null?r.verdictPriceWei="Required.":s<0n&&(r.verdictPriceWei="Must be non-negative.")}catch{r.verdictPriceWei="Must be a non-negative integer (wei).",s=null}return n!==null&&s!==null&&!r.solutionPriceWei&&!r.verdictPriceWei&&n===0n&&s===0n&&(r.combined="At least one price must be positive."),{ok:Object.keys(r).length===0,errors:r,solutionWei:n??void 0,verdictWei:s??void 0}}function aS(e,t,r,n){if(!e||!/^\d+$/.test(e)||t===void 0||r===void 0)return null;let s;try{s=BigInt(e)}catch{return null}const c=t+r*BigInt(n);return c<=0n?null:{tasks:Number(s/c),perTaskWei:c}}function lS({draft:e,template:t=xs,onAdvance:r,onBack:n,fundingSafeAddress:s,fundingSafeBalanceWei:c,busy:g,error:o}){var h,v;const[a,f]=N.useState(e.solutionPriceWei??""),[_,p]=N.useState(e.verdictPriceWei??""),[m,x]=N.useState(!1),w=N.useMemo(()=>oS(a,_),[a,_]),y=t.claimPolicyDefaults.maxClaimsPerOperator,d=N.useMemo(()=>aS(c??null,w.solutionWei,w.verdictWei,y),[c,w.solutionWei,w.verdictWei,y]),u=()=>{x(!0),w.ok&&r({solutionPriceWei:a,verdictPriceWei:_,completedSteps:ys(e.completedSteps,"configurePricing")})},l=m?w.errors:{};return i.jsxs(xn,{step:4,title:"Configure pricing",blurb:"Set what each Task pays out. The funding Safe is your launcher's master Safe; pricing applies per claim and per verdict.",error:o,footer:i.jsx(Sn,{onBack:n,onNext:u,busy:g,nextDisabled:m&&!w.ok}),children:[i.jsx(Pe,{label:"Funding Safe",helperText:"Tasks are funded from this Safe at launch. Defaults to your launcher master Safe.",children:i.jsx("div",{"data-testid":"launcher-create-fundingSafe",style:{background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)",wordBreak:"break-all"},children:s??"— (master Safe will be picked at launch)"})}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[i.jsx(Pe,{label:"Solution price (wei)",helperText:`≈ ${Xr((h=w.solutionWei)==null?void 0:h.toString())}`,error:l.solutionPriceWei??null,children:i.jsx("input",{"data-testid":"launcher-create-solutionPriceWei",type:"text",inputMode:"numeric",value:a,onChange:b=>f(b.target.value),placeholder:"e.g. 100000000000000 (0.0001 ETH)",style:l.solutionPriceWei?ot:Ue,disabled:g})}),i.jsx(Pe,{label:"Verdict price (wei)",helperText:`≈ ${Xr((v=w.verdictWei)==null?void 0:v.toString())}`,error:l.verdictPriceWei??null,children:i.jsx("input",{"data-testid":"launcher-create-verdictPriceWei",type:"text",inputMode:"numeric",value:_,onChange:b=>p(b.target.value),placeholder:"e.g. 50000000000000 (0.00005 ETH)",style:l.verdictPriceWei?ot:Ue,disabled:g})})]}),l.combined&&i.jsx("div",{"data-testid":"launcher-create-pricing-combined-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:l.combined}),i.jsxs("section",{"data-testid":"launcher-create-projection",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"16px 18px",display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx("h3",{style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:"Runway projection"}),i.jsx(nl,{label:"Safe balance",value:c?`${Xr(c)} (${c} wei)`:"—"}),i.jsx(nl,{label:"Per-Task cost",value:d?`${Xr(d.perTaskWei.toString())} (${d.perTaskWei} wei)`:"—",hint:`solution + verdict × maxClaimsPerOperator (${y})`}),i.jsx(nl,{label:"Projected Tasks",value:d?`~${d.tasks.toLocaleString("en-US")}`:"—",hint:"Approximate; ignores gas and any in-flight reservations.",testId:"launcher-create-projected-tasks"})]})]})}function nl({label:e,value:t,hint:r,testId:n}){return i.jsxs("div",{"data-testid":n,style:{display:"grid",gridTemplateColumns:"160px 1fr",alignItems:"baseline",gap:"12px"},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-dim)",letterSpacing:"0.06em"},children:e}),i.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:t}),r&&i.jsx("span",{style:{fontSize:"12px",color:"var(--fg-muted)"},children:r})]})]})}const cS=1500,jh=["pinning","recording","broadcasting","confirming","spawning"],uS={pinning:"Pinning manifest",recording:"Recording draft",broadcasting:"Broadcasting tx",confirming:"Confirming on-chain",spawning:"Spawning generator"};function dS({draft:e,template:t=xs,onUpdateDraft:r,onBack:n,onLaunchFailure:s,navigateTo:c,pollIntervalMs:g=cS}){const[,o]=Li(),a=c??o,f=N.useMemo(()=>e.openRoles&&e.openRoles.length>0?e.openRoles:["solver","evaluator"],[e.openRoles]),[_,p]=N.useState(f),[m,x]=N.useState({kind:"idle"}),w=N.useRef(!1);N.useEffect(()=>()=>{w.current=!0},[]);const y=h=>{p(v=>v.includes(h)?v.filter(b=>b!==h):[...v,h])},d=async()=>{var h,v,b;if(_.length!==0){x(C=>C.kind==="failed"?{kind:"idle"}:C),w.current=!1;try{await r({openRoles:_,completedSteps:ys(e.completedSteps,"configurePricing")});const C=await ee.solvernets.launch(e.draftId);if(w.current)return;let E="pinning";for(x({kind:"launching",phase:E,solverNetId:C.solverNetId});;){if(w.current)return;let S;try{S=await ee.solvernets.get(C.solverNetId)}catch{if(w.current)return;await Lh(g);continue}if((h=S.launchProgress)!=null&&h.phase&&(E=S.launchProgress.phase),S.status==="launched"){x({kind:"launching",phase:"spawning",solverNetId:C.solverNetId}),a(`/launcher/launched/${encodeURIComponent(C.solverNetId)}`);return}if(S.status==="failed"){const k=((b=(v=S.launchProgress)==null?void 0:v.txError)==null?void 0:b.message)??`Launch failed during ${E}.`;x({kind:"failed",message:k,solverNetId:C.solverNetId}),s==null||s();return}x({kind:"launching",phase:E,solverNetId:C.solverNetId}),await Lh(g)}}catch(C){if(w.current)return;x({kind:"failed",message:C instanceof Error?C.message:String(C)}),s==null||s()}}},u=m.kind==="launching",l=_.length===0||u;return i.jsxs(xn,{step:5,title:"Review & launch",blurb:"One last check. The Launch button signs the manifest, pins it to IPFS, and broadcasts the registry transaction.",footer:i.jsx(Sn,{onBack:n,onNext:()=>{d()},nextLabel:u?"Launching…":"Launch",nextDisabled:l,busy:u,right:u&&i.jsx(hS,{current:m.kind==="launching"?m.phase:"pinning"})}),children:[i.jsx(fS,{draft:e,template:t}),i.jsxs(Pe,{label:"Open roles",helperText:"Operators can opt in to any role you open here. Most launchers want both.",children:[i.jsxs("div",{"data-testid":"launcher-create-openRoles",style:{display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx(Dh,{role:"solver",checked:_.includes("solver"),onChange:()=>y("solver"),disabled:u}),i.jsx(Dh,{role:"evaluator",checked:_.includes("evaluator"),onChange:()=>y("evaluator"),disabled:u})]}),_.length===0&&i.jsx("span",{"data-testid":"launcher-create-openRoles-error",style:{fontSize:"12px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace"},children:"At least one role must be open."})]}),m.kind==="failed"&&i.jsxs("div",{"data-testid":"launcher-create-launch-failure",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",fontWeight:500},children:"Launch failed."}),i.jsx("span",{style:{color:"var(--fg-muted)",fontSize:"12px",fontFamily:"'JetBrains Mono', monospace"},children:m.message}),i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[i.jsx("button",{type:"button","data-testid":"launcher-create-launch-retry",onClick:()=>{d()},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 14px",background:"var(--accent-sky)",color:"var(--bg-sunken)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",cursor:"pointer"},children:"Retry"}),i.jsx("button",{type:"button","data-testid":"launcher-create-launch-abandon",onClick:()=>{a("/launcher")},style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 14px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},children:"Abandon"})]})]})]})}function hS({current:e}){const t=jh.indexOf(e);return i.jsxs("div",{"data-testid":"launcher-create-launch-progress","data-phase":e,style:{display:"flex",alignItems:"center",gap:"6px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)",letterSpacing:"0.06em"},children:[i.jsx("span",{"data-testid":"launcher-create-launch-phase",children:uS[e]}),i.jsx("div",{style:{display:"flex",gap:"3px"},children:jh.map((r,n)=>i.jsx("span",{"data-testid":`launcher-create-launch-phase-pip-${r}`,"data-active":n<=t?"true":"false",style:{width:"8px",height:"3px",background:n<=t?"var(--accent-sky)":"var(--border)",borderRadius:"var(--radius-1)"}},r))})]})}function fS({draft:e,template:t}){const r=e.generatorConfig??{},n=e.templateContractId??t.id,s=e.templateContractVersion??t.version;return i.jsxs("article",{"data-testid":"launcher-create-manifest-summary",style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},children:[n,".",s]}),i.jsx("h2",{style:{margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"24px",fontWeight:400,color:"var(--fg)"},children:e.name??"— unnamed"}),e.description&&i.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5},children:e.description})]}),i.jsxs(vS,{children:[i.jsx(Ht,{label:"Solution price",value:Rh(e.solutionPriceWei)}),i.jsx(Ht,{label:"Verdict price",value:Rh(e.verdictPriceWei)}),t.id==="prediction"?i.jsx(pS,{generator:r}):i.jsx(gS,{generator:r})]})]})}function pS({generator:e}){const t=qn(e.cadenceMs),r=qn(e.windowMs??e.submissionWindowMs),n=qn(e.maxOpenRounds);return i.jsxs(i.Fragment,{children:[i.jsx(Ht,{label:"Cadence",value:t?`${t} ms`:"—"}),i.jsx(Ht,{label:"Window",value:r?`${r} ms`:"—"}),i.jsx(Ht,{label:"Max open rounds",value:n??"—"}),i.jsx(Ht,{label:"Allowlist",value:Th(e.allowlistConditionIds)}),i.jsx(Ht,{label:"Blocklist",value:Th(e.blocklistConditionIds)})]})}function gS({generator:e}){const t=qn(e.N_target_successes),r=qn(e.N_max_postings_per_task),n=qn(e.cooldown_ms);return i.jsxs(i.Fragment,{children:[i.jsx(Ht,{label:"Target successes",value:t??"—"}),i.jsx(Ht,{label:"Max postings / Task",value:r??"—"}),i.jsx(Ht,{label:"Cooldown",value:n?`${n} ms`:"—"})]})}function Rh(e){return e?`${e} wei (${Xr(e)})`:"—"}function qn(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&/^\d+$/.test(e.trim())?e.trim():null}function Th(e){return Array.isArray(e)&&e.length>0?`${e.length} entries`:"none"}function vS({children:e}){return i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px 16px",paddingTop:"8px",borderTop:"1px solid var(--border)"},children:e})}function Ht({label:e,value:t}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},children:e}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:t})]})}function Dh({role:e,checked:t,onChange:r,disabled:n}){return i.jsxs("label",{style:{display:"flex",gap:"10px",alignItems:"center",cursor:n?"not-allowed":"pointer",opacity:n?.6:1},children:[i.jsx("input",{"data-testid":`launcher-create-openRoles-${e}`,type:"checkbox",checked:t,onChange:r,disabled:n}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:e})]})}function Lh(e){return new Promise(t=>setTimeout(t,e))}const Sc="jinn.launcher-create.draftId.v1";function mS(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Sc)}catch{return null}}function Mh(e){if(!(typeof window>"u"))try{e===null?window.localStorage.removeItem(Sc):window.localStorage.setItem(Sc,e)}catch{}}function _S(){if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search).get("template");return t&&t.length>0?t:null}function yS({templateKey:e}={}){var C;const t=e??_S()??Zx,r=N.useMemo(()=>xc[t]??null,[t]),[n,s]=N.useState(null),[c,g]=N.useState(null),[o,a]=N.useState(1),[f,_]=N.useState(!1),[p,m]=N.useState(null),x=N.useRef(!1),{data:w}=ce({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:3e4}),{data:y}=ce({queryKey:["status"],queryFn:()=>ee.getStatus(),refetchInterval:3e4}),d=(w==null?void 0:w.master_address)??(y==null?void 0:y.master_address)??null,u=((C=y==null?void 0:y.masterGas)==null?void 0:C.balanceWei)??null;N.useEffect(()=>{if(x.current)return;x.current=!0;let E=!1;return(async()=>{const k=mS();if(k)try{const T=await ee.solvernets.getDraft(k);if(E)return;s(T);return}catch{Mh(null)}try{const T=await ee.solvernets.createDraft();if(E)return;Mh(T.draftId),s(T)}catch(T){if(E)return;g(T instanceof Error?T.message:"Failed to create draft.")}})(),()=>{E=!0}},[]);const l=async E=>{if(n){_(!0),m(null);try{const S=await ee.solvernets.updateDraft(n.draftId,E);s(S),a(k=>k<5?k+1:k)}catch(S){m(S instanceof Error?S.message:String(S))}finally{_(!1)}}},h=async E=>{if(n){_(!0),m(null);try{const S=await ee.solvernets.updateDraft(n.draftId,E);s(S)}catch(S){m(S instanceof Error?S.message:String(S))}finally{_(!1)}}},v=()=>{m(null),a(E=>E>1?E-1:E)},b=()=>{m(null)};if(r===null)return i.jsxs("main",{"data-testid":"launcher-create-unknown-template","data-template-key":t,style:{padding:"24px",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"28px",margin:0,color:"var(--fg)",fontWeight:400},children:"Unknown SolverNet template"}),i.jsxs("p",{style:{marginTop:"12px",color:"var(--break-red)",fontSize:"13px"},children:["No template registered for ",i.jsx("code",{children:t}),". Available keys:"," ",Object.keys(xc).map(E=>`?template=${E}`).join(", "),"."]})]});if(c)return i.jsxs("main",{"data-testid":"launcher-create-bootstrap-error",style:{padding:"24px",color:"var(--fg)",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsx("h1",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"28px",margin:0,color:"var(--fg)",fontWeight:400},children:"Couldn't start a new draft"}),i.jsx("p",{style:{marginTop:"12px",color:"var(--break-red)",fontSize:"13px"},children:c})]});if(!n)return i.jsx("main",{"data-testid":"launcher-create-loading",style:{padding:"24px",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:"Loading draft…"});switch(o){case 1:return i.jsx(xh,{draft:n,onAdvance:l,busy:f,error:p});case 2:return i.jsx(eS,{draft:n,template:r,onAdvance:l,onBack:v,busy:f,error:p});case 3:return i.jsx(tS,{draft:n,template:r,onAdvance:l,onBack:v,busy:f,error:p});case 4:return i.jsx(lS,{draft:n,template:r,onAdvance:l,onBack:v,fundingSafeAddress:d,fundingSafeBalanceWei:u??null,busy:f,error:p});case 5:return i.jsx(dS,{draft:n,template:r,onUpdateDraft:h,onBack:v,onLaunchFailure:b});default:return i.jsx(xh,{draft:n,onAdvance:l,busy:f,error:p})}}const Ph=6e4,Bh=6e4;function xS(e){const t=e??{};return{cadenceMs:mt(t.cadenceMs),windowMs:mt(t.windowMs??t.submissionWindowMs),resolveGapMs:mt(t.resolveGapMs),maxNewRoundsPerPoll:mt(t.maxNewRoundsPerPoll),maxNewRoundsPerDay:mt(t.maxNewRoundsPerDay),maxOpenRounds:mt(t.maxOpenRounds),allowlistConditionIds:Ah(t.allowlistConditionIds),blocklistConditionIds:Ah(t.blocklistConditionIds)}}function SS(e,t){const r=e??{},n=bS(r.claimPolicy),s=(t==null?void 0:t.contract.claimPolicyDefaults)??{maxClaims:50,maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60};return{N_target_successes:mt(r.N_target_successes),N_max_postings_per_task:mt(r.N_max_postings_per_task),cooldown_ms:mt(r.cooldown_ms),maxClaims:mt(n.maxClaims??s.maxClaims),maxClaimsPerOperator:mt(n.maxClaimsPerOperator??s.maxClaimsPerOperator),claimLeaseTtlSeconds:mt(n.claimLeaseTtlSeconds??s.claimLeaseTtlSeconds)}}function bS(e){return typeof e=="object"&&e!==null?e:{}}function mt(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():""}function Ah(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function Jr(e){const t=e.trim();if(!t||!/^\d+$/.test(t))return null;const r=Number(t);return!Number.isFinite(r)||r<=0?null:r}function wS(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function CS(e,t){const r={},n={};for(const s of["cadenceMs","windowMs","resolveGapMs","maxNewRoundsPerPoll","maxNewRoundsPerDay","maxOpenRounds"]){if(e[s]===t[s]||e[s].trim().length===0)continue;const c=Jr(e[s]);if(c===null){r[s]="Must be a positive integer.";continue}if(s==="cadenceMs"&&c<Ph){r[s]=`Cadence must be at least ${Ph/1e3}s.`;continue}s==="windowMs"?n.submissionWindowMs=c:n[s]=c}for(const s of["allowlistConditionIds","blocklistConditionIds"])e[s]!==t[s]&&(n[s]=wS(e[s]));return{ok:Object.keys(r).length===0,patch:n,errors:r}}function kS(e,t){const r={},n={},s=Jr(e.N_target_successes),c=Jr(e.N_max_postings_per_task),g=Jr(e.maxClaims),o=Jr(e.maxClaimsPerOperator);for(const f of["N_target_successes","N_max_postings_per_task","cooldown_ms"]){if(e[f]===t[f]||e[f].trim().length===0)continue;const _=Jr(e[f]);if(_===null){r[f]=f==="cooldown_ms"?"Must be a positive integer (ms).":"Must be a positive integer.";continue}if(f==="cooldown_ms"&&_<Bh){r[f]=`Cooldown must be at least ${Bh/1e3}s.`;continue}n[f]=_}const a={};for(const f of["maxClaims","maxClaimsPerOperator","claimLeaseTtlSeconds"]){if(e[f]===t[f]||e[f].trim().length===0)continue;const _=Jr(e[f]);if(_===null){r[f]=f==="claimLeaseTtlSeconds"?"Must be a positive integer (seconds).":"Must be a positive integer.";continue}a[f]=_}return Object.keys(a).length>0&&(n.claimPolicy=a),s!==null&&c!==null&&c<s&&(r.N_max_postings_per_task="Max postings must be >= target successes."),g!==null&&o!==null&&o>g&&(r.maxClaimsPerOperator="Claims per operator must be <= max claims."),{ok:Object.keys(r).length===0,patch:n,errors:r}}function ES(e,t){var n;if(t)return t.id==="swe-rebench-v2"&&t.version==="v1";if(((n=e.summary)==null?void 0:n.contractId)==="swe-rebench-v2"&&e.summary.contractVersion==="v1")return!0;const r=e.generatorConfig??{};return Object.prototype.hasOwnProperty.call(r,"N_target_successes")||Object.prototype.hasOwnProperty.call(r,"N_max_postings_per_task")||Object.prototype.hasOwnProperty.call(r,"cooldown_ms")}function jS({record:e,manifest:t,template:r,onSave:n}){return ES(e,r)?i.jsx(TS,{record:e,manifest:t,onSave:n}):i.jsx(RS,{record:e,onSave:n})}function RS({record:e,onSave:t}){var w,y;const r=N.useMemo(()=>xS(e.generatorConfig),[e.generatorConfig]),[n,s]=N.useState(r),[c,g]=N.useState({kind:"idle"}),[o,a]=N.useState(!1);N.useEffect(()=>{s(u=>JSON.stringify(u)!==JSON.stringify(d())?u:r);function d(){return r}},[JSON.stringify(e.generatorConfig)]);const f=(d,u)=>{s(l=>({...l,[d]:u}))},_=N.useMemo(()=>CS(n,r),[n,r]),p=Object.keys(_.patch).length>0,m=c.kind==="saving",x=async()=>{if(!(!_.ok||!p||m)){g({kind:"saving"});try{await t(_.patch),g({kind:"saved",at:new Date})}catch(d){g({kind:"error",message:d instanceof Error?d.message:String(d)})}}};return i.jsxs("section",{"data-testid":"launcher-launched-generator-panel",style:uv,children:[i.jsxs("header",{style:dv,children:[i.jsxs("div",{style:hv,children:[i.jsx("h2",{style:fv,children:"Generator"}),i.jsx(cv,{record:e})]}),i.jsx("button",{type:"button","data-testid":"launcher-launched-generator-toggle","aria-expanded":o,"aria-controls":"launcher-launched-generator-config",onClick:()=>a(d=>!d),style:pv,children:o?"Hide config":"Edit config"})]}),i.jsxs("dl",{style:mv,children:[i.jsx(Xo,{label:"Last poll",value:yi((w=e.generatorState)==null?void 0:w.lastPollAt),testid:"launcher-launched-generator-last-poll"}),i.jsx(Xo,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),((y=e.generatorState)==null?void 0:y.lastError)&&i.jsxs("div",{"data-testid":"launcher-launched-generator-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"12px 14px",display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsxs("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:500},children:["Last error · ",yi(e.generatorState.lastError.at)]}),i.jsx("span",{style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:e.generatorState.lastError.message})]}),o&&i.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",style:gv,children:[i.jsx("h3",{style:bc,children:"Hot-apply config"}),i.jsxs("div",{style:vv,children:[i.jsx(_t,{label:"Cadence (ms)",testid:"launcher-launched-generator-cadenceMs",value:n.cadenceMs,onChange:d=>f("cadenceMs",d),error:_.errors.cadenceMs,disabled:m}),i.jsx(_t,{label:"Submission window (ms)",testid:"launcher-launched-generator-windowMs",value:n.windowMs,onChange:d=>f("windowMs",d),error:_.errors.windowMs,disabled:m}),i.jsx(_t,{label:"Resolve gap (ms)",testid:"launcher-launched-generator-resolveGapMs",value:n.resolveGapMs,onChange:d=>f("resolveGapMs",d),error:_.errors.resolveGapMs,disabled:m}),i.jsx(_t,{label:"Max rounds / poll",testid:"launcher-launched-generator-maxNewRoundsPerPoll",value:n.maxNewRoundsPerPoll,onChange:d=>f("maxNewRoundsPerPoll",d),error:_.errors.maxNewRoundsPerPoll,disabled:m}),i.jsx(_t,{label:"Max rounds / day",testid:"launcher-launched-generator-maxNewRoundsPerDay",value:n.maxNewRoundsPerDay,onChange:d=>f("maxNewRoundsPerDay",d),error:_.errors.maxNewRoundsPerDay,disabled:m}),i.jsx(_t,{label:"Max open rounds",testid:"launcher-launched-generator-maxOpenRounds",value:n.maxOpenRounds,onChange:d=>f("maxOpenRounds",d),error:_.errors.maxOpenRounds,disabled:m})]}),i.jsx(Ih,{label:"Allowlist condition ids",testid:"launcher-launched-generator-allowlistConditionIds",value:n.allowlistConditionIds,onChange:d=>f("allowlistConditionIds",d),disabled:m}),i.jsx(Ih,{label:"Blocklist condition ids",testid:"launcher-launched-generator-blocklistConditionIds",value:n.blocklistConditionIds,onChange:d=>f("blocklistConditionIds",d),disabled:m}),i.jsx(lv,{dirty:p,saving:m,validationOk:_.ok,saveStatus:c,onSubmit:x})]})]})}function TS({record:e,manifest:t,onSave:r}){var y,d;const n=N.useMemo(()=>SS(e.generatorConfig,t),[e.generatorConfig,t]),[s,c]=N.useState(n),[g,o]=N.useState({kind:"idle"}),[a,f]=N.useState(!1);N.useEffect(()=>{c(u=>JSON.stringify(u)!==JSON.stringify(n)?u:n)},[JSON.stringify(e.generatorConfig)]);const _=(u,l)=>{c(h=>({...h,[u]:l}))},p=N.useMemo(()=>kS(s,n),[s,n]),m=Object.keys(p.patch).length>0,x=g.kind==="saving",w=async()=>{if(!(!p.ok||!m||x)){o({kind:"saving"});try{await r(p.patch),o({kind:"saved",at:new Date})}catch(u){o({kind:"error",message:u instanceof Error?u.message:String(u)})}}};return i.jsxs("section",{"data-testid":"launcher-launched-generator-panel",style:uv,children:[i.jsxs("header",{style:dv,children:[i.jsxs("div",{style:hv,children:[i.jsx("h2",{style:fv,children:"Generator"}),i.jsx(cv,{record:e})]}),i.jsx("button",{type:"button","data-testid":"launcher-launched-generator-toggle","aria-expanded":a,"aria-controls":"launcher-launched-generator-config",onClick:()=>f(u=>!u),style:pv,children:a?"Hide config":"Edit config"})]}),i.jsxs("dl",{style:mv,children:[i.jsx(Xo,{label:"Last poll",value:yi((y=e.generatorState)==null?void 0:y.lastPollAt),testid:"launcher-launched-generator-last-poll"}),i.jsx(Xo,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),((d=e.generatorState)==null?void 0:d.lastError)&&i.jsx(DS,{record:e}),a&&i.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",style:gv,children:[i.jsx("h3",{style:bc,children:"Hot-apply config"}),i.jsxs("div",{style:vv,children:[i.jsx(_t,{label:"Target successful Verdicts per instance",testid:"launcher-launched-generator-N_target_successes",value:s.N_target_successes,onChange:u=>_("N_target_successes",u),error:p.errors.N_target_successes,disabled:x}),i.jsx(_t,{label:"Max Task postings per instance",testid:"launcher-launched-generator-N_max_postings_per_task",value:s.N_max_postings_per_task,onChange:u=>_("N_max_postings_per_task",u),error:p.errors.N_max_postings_per_task,disabled:x}),i.jsx(_t,{label:"Cooldown between task postings (ms)",testid:"launcher-launched-generator-cooldown_ms",value:s.cooldown_ms,onChange:u=>_("cooldown_ms",u),error:p.errors.cooldown_ms,disabled:x})]}),i.jsx("h3",{style:bc,children:"Claim policy"}),i.jsxs("div",{style:MS,children:[i.jsx(_t,{label:"Max claims per Task",testid:"launcher-launched-generator-claimPolicy-maxClaims",value:s.maxClaims,onChange:u=>_("maxClaims",u),error:p.errors.maxClaims,disabled:x}),i.jsx(_t,{label:"Max claims per operator",testid:"launcher-launched-generator-claimPolicy-maxClaimsPerOperator",value:s.maxClaimsPerOperator,onChange:u=>_("maxClaimsPerOperator",u),error:p.errors.maxClaimsPerOperator,disabled:x}),i.jsx(_t,{label:"Claim lease (seconds)",testid:"launcher-launched-generator-claimPolicy-claimLeaseTtlSeconds",value:s.claimLeaseTtlSeconds,onChange:u=>_("claimLeaseTtlSeconds",u),error:p.errors.claimLeaseTtlSeconds,disabled:x})]}),i.jsx(lv,{dirty:m,saving:x,validationOk:p.ok,saveStatus:g,onSubmit:w})]})]})}function lv({dirty:e,saving:t,validationOk:r,saveStatus:n,onSubmit:s}){const c=e&&r&&!t;return i.jsxs("div",{style:PS,children:[i.jsx(LS,{status:n}),i.jsx("button",{type:"button","data-testid":"launcher-launched-generator-save",onClick:()=>{s()},disabled:!c,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 18px",background:c?"var(--accent-sky)":"var(--bg-elevated)",color:c?"var(--bg-sunken)":"var(--fg-dim)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-2)",cursor:c?"pointer":"not-allowed",opacity:c?1:.7},children:t?"Saving…":"Save"})]})}function DS({record:e}){var t,r,n,s;return i.jsxs("div",{"data-testid":"launcher-launched-generator-error",style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"12px 14px",display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsxs("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:500},children:["Last error · ",yi((r=(t=e.generatorState)==null?void 0:t.lastError)==null?void 0:r.at)]}),i.jsx("span",{style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:(s=(n=e.generatorState)==null?void 0:n.lastError)==null?void 0:s.message})]})}function cv({record:e}){var s;const t=e.generatorEnabled,n=!!((s=e.generatorState)!=null&&s.lastError)?{fg:"var(--break-red)",label:"Errored"}:t?{fg:"var(--vow-green)",label:"Enabled"}:{fg:"var(--fg-dim)",label:"Disabled"};return i.jsx("span",{"data-testid":"launcher-launched-generator-state-badge",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:n.fg,border:`1px solid ${n.fg}`,borderRadius:"var(--radius-1)",padding:"2px 8px"},children:n.label})}function LS({status:e}){if(e.kind==="saving")return i.jsx("span",{"data-testid":"launcher-launched-generator-save-status",style:{color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:"Saving…"});if(e.kind==="saved"){const t=e.at.toISOString().slice(11,16);return i.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",style:{color:"var(--vow-green)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:["Saved at ",t," UTC"]})}return e.kind==="error"?i.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:["Save failed: ",e.message]}):i.jsx("span",{"data-testid":"launcher-launched-generator-save-status",style:{color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px"},children:"Edits hot-apply without restart."})}function _t({label:e,testid:t,value:r,onChange:n,error:s,disabled:c}){return i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Mu,children:e}),i.jsx("input",{"data-testid":t,type:"text",inputMode:"numeric",value:r,onChange:g=>n(g.target.value),disabled:c,style:s?BS:Pu}),s&&i.jsx("span",{"data-testid":`${t}-error`,style:{fontSize:"11px",color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace"},children:s})]})}function Ih({label:e,testid:t,value:r,onChange:n,disabled:s}){return i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Mu,children:e}),i.jsx("textarea",{"data-testid":t,value:r,onChange:c=>n(c.target.value),disabled:s,rows:2,placeholder:"0xabc…, 0xdef…",style:{...Pu,resize:"vertical"}})]})}function Xo({label:e,value:t,testid:r}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[i.jsx("dt",{style:Mu,children:e}),i.jsx("dd",{"data-testid":r,style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},children:t})]})}const uv={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"14px"},dv={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},hv={display:"flex",alignItems:"center",gap:"10px",minWidth:0},fv={margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",color:"var(--fg)",fontWeight:400},pv={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",color:"var(--fg)",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",padding:"8px 12px"},gv={borderTop:"1px solid var(--border)",display:"flex",flexDirection:"column",gap:"14px",paddingTop:"14px"},bc={margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-dim)"},vv={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:"14px"},MS={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:"14px"},PS={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",paddingTop:"8px",borderTop:"1px solid var(--border)"},Mu={fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},mv={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:"8px 16px",margin:0},Pu={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",width:"100%",boxSizing:"border-box"},BS={...Pu,border:"1px solid var(--break-red)"},AS={paused:{title:"Pause SolverNet",body:"The generator will stop posting new Tasks. Existing Tasks continue through their normal lifecycle. You can resume any time.",confirmLabel:"Pause"},launched:{title:"Resume SolverNet",body:"The generator will resume polling and posting new Tasks at the configured cadence.",confirmLabel:"Resume"},retired:{title:"Retire SolverNet",body:"Retirement is permanent. The SolverNet stops accepting new work and disappears from the operator catalog. Historical Tasks, solutions, and verdicts remain discoverable. Type the SolverNet name to confirm.",confirmLabel:"Retire permanently",danger:!0}};function IS({open:e,target:t,solverNetName:r,onConfirm:n,onCancel:s,pending:c=!1,errorMessage:g}){const[o,a]=N.useState("");if(N.useEffect(()=>{e||a("")},[e,t]),!e)return null;const f=AS[t],_=t==="retired",p=!_||o.trim()===r.trim(),m=c||!p;return i.jsx("div",{"data-testid":"launcher-launched-dialog","data-target":t,role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",zIndex:100},onClick:x=>{x.target===x.currentTarget&&!c&&s()},children:i.jsxs("div",{style:{background:"var(--bg-elevated)",border:`1px solid ${f.danger?"var(--break-red)":"var(--border)"}`,borderRadius:"var(--radius-3)",padding:"24px 26px",display:"flex",flexDirection:"column",gap:"16px",maxWidth:"480px",width:"100%"},children:[i.jsx("h2",{style:{margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"24px",color:f.danger?"var(--break-red)":"var(--fg)",fontWeight:400},children:f.title}),i.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5},children:f.body}),_&&i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},children:["Type ",i.jsx("span",{style:{color:"var(--fg)"},children:r})," to confirm"]}),i.jsx("input",{"data-testid":"launcher-launched-dialog-typed",type:"text",autoFocus:!0,value:o,onChange:x=>a(x.target.value),disabled:c,style:{background:"var(--bg)",border:`1px solid ${p?"var(--vow-green)":"var(--border)"}`,borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"}})]}),g&&i.jsx("span",{"data-testid":"launcher-launched-dialog-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:g}),i.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[i.jsx("button",{type:"button","data-testid":"launcher-launched-dialog-cancel",onClick:s,disabled:c,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 16px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:c?"wait":"pointer"},children:"Cancel"}),i.jsx("button",{type:"button","data-testid":"launcher-launched-dialog-confirm",onClick:n,disabled:m,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 18px",background:f.danger?m?"var(--bg-elevated)":"var(--break-red)":m?"var(--bg-elevated)":"var(--accent-sky)",color:m?"var(--fg-dim)":(f.danger,"var(--bg-sunken)"),border:`1px solid ${f.danger?"var(--break-red)":"var(--accent-sky)"}`,borderRadius:"var(--radius-2)",cursor:m?"not-allowed":"pointer",opacity:m?.6:1},children:c?`${f.confirmLabel}…`:f.confirmLabel})]})]})})}function OS({record:e,manifest:t,fetchLauncherStatus:r}){var w,y;const n=r??(()=>ee.fetchLauncherStatus()),{data:s,isLoading:c,isError:g}=ce({queryKey:["launcher-status",e.solverNetId],queryFn:()=>n(),refetchInterval:3e4}),o=t?`${t.contract.id}.${t.contract.version}`:e.summary?`${e.summary.contractId}.${e.summary.contractVersion}`:void 0,a=o?s==null?void 0:s.nets.find(d=>{var u;return d.solverType===o||d.name===((t==null?void 0:t.name)??((u=e.summary)==null?void 0:u.name))}):void 0,f=a==null?void 0:a.budget.safeBalanceWei,_=(a==null?void 0:a.budget.safeAddress)??e.launcherSafeAddress,p=(t==null?void 0:t.solutionPriceWei)??((w=e.summary)==null?void 0:w.solutionPriceWei),m=(t==null?void 0:t.verdictPriceWei)??((y=e.summary)==null?void 0:y.verdictPriceWei),x=fx(f,p,m);return i.jsxs("section",{"data-testid":"launcher-launched-spend-panel",style:FS,children:[i.jsx("header",{style:NS,children:i.jsx("h2",{style:HS,children:"Spend & runway"})}),i.jsxs("dl",{style:zS,children:[i.jsx(Cn,{label:"Safe address",value:tv(_),title:_,testid:"launcher-launched-spend-safe-address"}),i.jsx(Cn,{label:"Safe balance",value:c?"—":f?jr(f):"unavailable",title:f?`${f} wei`:void 0,testid:"launcher-launched-spend-safe-balance"}),i.jsx(Cn,{label:"Solution price",value:p?jr(p):"—",title:p?`${p} wei`:void 0,testid:"launcher-launched-spend-solution-price"}),i.jsx(Cn,{label:"Verdict price",value:m?jr(m):"—",title:m?`${m} wei`:void 0,testid:"launcher-launched-spend-verdict-price"}),i.jsx(Cn,{label:"Per-Task cost",value:x?jr(x.perTaskWei.toString()):"—",title:x?`${x.perTaskWei.toString()} wei`:void 0,testid:"launcher-launched-spend-per-task"}),i.jsx(Cn,{label:"Projected runway",value:x?`${x.tasks.toLocaleString()} Tasks at current prices`:"manifest or balance unavailable",testid:"launcher-launched-spend-runway"})]}),g&&i.jsx("span",{"data-testid":"launcher-launched-spend-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:"Failed to load Safe balance."}),i.jsx("p",{style:{margin:0,color:"var(--fg-dim)",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",lineHeight:1.5},children:"Runway projects how many Tasks the Safe can fund at the current manifest prices, before any operator participation cost adjustments."})]})}function Cn({label:e,value:t,testid:r,title:n}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px",minWidth:0},children:[i.jsx("dt",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},children:e}),i.jsx("dd",{"data-testid":r,title:n,style:{margin:0,fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}const FS={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"12px"},NS={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},HS={margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",color:"var(--fg)",fontWeight:400},zS={display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:"8px 16px",margin:0},$S={paused:"Pause",launched:"Resume",retired:"Retire"};function WS({record:e,manifest:t,onAction:r,pending:n}){var o;const s=ch[e.status]??ch.launching,c=hx[e.status]??[],g=(t==null?void 0:t.name)??((o=e.summary)==null?void 0:o.name)??e.solverNetId;return i.jsxs("header",{"data-testid":"launcher-launched-status-header","data-status":e.status,style:{background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"24px 26px",display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"16px",flexWrap:"wrap"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",minWidth:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[i.jsx("h1",{"data-testid":"launcher-launched-name",style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"32px",margin:0,color:"var(--fg)",fontWeight:400,letterSpacing:"-0.01em"},children:g}),i.jsx("span",{"data-testid":"launcher-launched-status-badge",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.14em",color:s.fg,border:`1px solid ${s.border}`,borderRadius:"var(--radius-1)",padding:"3px 10px",whiteSpace:"nowrap"},children:s.label})]}),(t==null?void 0:t.description)&&i.jsx("p",{style:{margin:0,color:"var(--fg-muted)",fontSize:"13px",lineHeight:1.5,maxWidth:"720px"},children:t.description})]}),i.jsx(US,{allowed:c,onAction:r,pending:n??null,terminal:e.status==="retired",launching:e.status==="launching"})]}),i.jsxs("dl",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:"8px 18px",margin:0,paddingTop:"12px",borderTop:"1px solid var(--border)"},children:[i.jsx(eo,{label:"SolverNet id",value:e.solverNetId,testid:"launcher-launched-solvernet-id",mono:!0}),i.jsx(eo,{label:"Manifest cid",value:ev(e.manifestCid),testid:"launcher-launched-manifest-cid",mono:!0,title:e.manifestCid}),i.jsx(eo,{label:"Launcher Safe",value:tv(e.launcherSafeAddress),testid:"launcher-launched-safe",mono:!0,title:e.launcherSafeAddress}),i.jsx(eo,{label:"Launcher agent",value:e.launcherAgentId,testid:"launcher-launched-agent",mono:!0})]})]})}function eo({label:e,value:t,testid:r,mono:n=!1,title:s}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px",minWidth:0},children:[i.jsx("dt",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)"},children:e}),i.jsx("dd",{"data-testid":r,title:s,style:{margin:0,fontFamily:n?"'JetBrains Mono', monospace":void 0,fontSize:"13px",color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}function US({allowed:e,onAction:t,pending:r,terminal:n,launching:s}){return n?i.jsx("span",{"data-testid":"launcher-launched-terminal-pill",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"6px 12px",alignSelf:"flex-start",whiteSpace:"nowrap"},children:"Retired — no further actions"}):s?i.jsx("span",{"data-testid":"launcher-launched-launching-pill",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--accent-sky)",border:"1px solid var(--accent-sky)",borderRadius:"var(--radius-1)",padding:"6px 12px",alignSelf:"flex-start",whiteSpace:"nowrap"},children:"Launching…"}):e.length===0?null:i.jsx("div",{"data-testid":"launcher-launched-actions",style:{display:"flex",gap:"8px",alignSelf:"flex-start",flexWrap:"wrap"},children:e.map(c=>{const g=$S[c],o=r===c,a=c==="retired";return i.jsx("button",{type:"button","data-testid":`launcher-launched-action-${c}`,onClick:()=>t(c),disabled:r!==null,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"10px 16px",background:a?"transparent":"var(--accent-sky)",color:a?"var(--break-red)":"var(--bg-sunken)",border:`1px solid ${a?"var(--break-red)":"var(--accent-sky)"}`,borderRadius:"var(--radius-2)",cursor:r!==null?"not-allowed":"pointer",opacity:r!==null&&!o?.6:1,whiteSpace:"nowrap"},children:o?`${g}…`:g},c)})})}const Oh=5,JS={open:{fg:"var(--accent-sky)",label:"Open"},"claims-in-flight":{fg:"var(--accent-sky)",label:"In flight"},"fully-claimed":{fg:"var(--vow-green)",label:"Claimed"},settled:{fg:"var(--vow-green)",label:"Settled"},failed:{fg:"var(--break-red)",label:"Failed"}};function qS({record:e,fetchTasks:t}){var x,w,y;const[r,n]=N.useState([void 0]),s=r[r.length-1],c=t??(d=>ee.fetchLauncherTasks(d)),{data:g,isLoading:o,isError:a,error:f,refetch:_}=ce({queryKey:["launcher-tasks",e.solverNetId,s??null],queryFn:()=>c({cursor:s,limit:Oh}),refetchInterval:15e3}),p=()=>{var d;(d=g==null?void 0:g.cursor)!=null&&d.before&&n(u=>[...u,g.cursor.before])},m=()=>{n(d=>d.length>1?d.slice(0,-1):d)};return i.jsxs("section",{"data-testid":"launcher-launched-tasks-panel",style:QS,children:[i.jsxs("header",{style:GS,children:[i.jsx("h2",{style:XS,children:"Recent posted Tasks"}),i.jsx("button",{type:"button","data-testid":"launcher-launched-tasks-refresh",onClick:()=>{_()},style:sl,children:"Refresh"})]}),o&&i.jsx("p",{"data-testid":"launcher-launched-tasks-loading",style:Fh,children:"Loading…"}),a&&i.jsxs("div",{"data-testid":"launcher-launched-tasks-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px"},children:["Failed to load tasks: ",f instanceof Error?f.message:"unknown error"]}),!o&&!a&&g&&g.tasks.length===0&&i.jsx(VS,{}),!o&&!a&&g&&g.tasks.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{"data-testid":"launcher-launched-tasks-list",role:"table",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",overflow:"hidden"},children:[i.jsxs("div",{role:"row",style:YS,children:[i.jsx("span",{children:"Task"}),i.jsx("span",{children:"SolverType"}),i.jsx("span",{children:"Posted"}),i.jsx("span",{children:"State"}),i.jsx("span",{style:{textAlign:"right"},children:"Claims"})]}),g.tasks.map(d=>i.jsx(KS,{task:d},d.taskId))]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},children:[i.jsx("button",{type:"button","data-testid":"launcher-launched-tasks-prev",onClick:m,disabled:r.length<=1,style:{...sl,opacity:r.length<=1?.5:1,cursor:r.length<=1?"not-allowed":"pointer"},children:"← Newer"}),i.jsxs("span",{style:Fh,children:["Page ",r.length,g.tasks.length<Oh&&g.cursor===void 0?" · end":""]}),i.jsx("button",{type:"button","data-testid":"launcher-launched-tasks-next",onClick:p,disabled:!((x=g.cursor)!=null&&x.before),style:{...sl,opacity:(w=g.cursor)!=null&&w.before?1:.5,cursor:(y=g.cursor)!=null&&y.before?"pointer":"not-allowed"},children:"Older →"})]})]})]})}function KS({task:e}){var r;const t=JS[e.state]??{fg:"var(--fg-muted)",label:e.state};return i.jsxs("div",{role:"row","data-testid":"launcher-launched-task-row","data-task-id":e.taskId,style:ZS,children:[i.jsx("span",{title:e.taskCid,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:((r=e.summary)==null?void 0:r.title)??ev(e.taskCid)}),i.jsx("span",{title:e.solverType??e.solverNet,style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.solverType??e.solverNet}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:yi(e.postedAt)}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:t.fg,textTransform:"uppercase",letterSpacing:"0.1em"},children:t.label}),i.jsxs("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",textAlign:"right"},children:[e.claims.current," / ",e.claims.max]})]})}function VS(){return i.jsx("div",{"data-testid":"launcher-launched-tasks-empty",style:{padding:"24px",textAlign:"center",color:"var(--fg-muted)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",border:"1px dashed var(--border)",borderRadius:"var(--radius-2)"},children:"Tasks will appear here after the first generator poll posts a Task."})}const QS={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-3)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:"12px"},GS={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},XS={margin:0,fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",color:"var(--fg)",fontWeight:400},YS={display:"grid",gridTemplateColumns:"2fr minmax(130px, 0.9fr) 1.4fr 1fr 0.8fr",gap:"12px",padding:"8px 14px",background:"var(--bg)",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--fg-dim)",borderBottom:"1px solid var(--border)"},ZS={display:"grid",gridTemplateColumns:"2fr minmax(130px, 0.9fr) 1.4fr 1fr 0.8fr",gap:"12px",alignItems:"center",padding:"10px 14px",borderBottom:"1px solid var(--border)"},sl={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",padding:"6px 12px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},Fh={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",margin:0},e1=2500;function t1({pollIntervalMs:e=e1,navigateTo:t,solverNetId:r}={}){var b,C,E,S;const n=Tu(),[,s]=Li(),c=t??s,g=yn(),o=r??n.solverNetId,a=ce({queryKey:["solvernets","launched",o],queryFn:()=>ee.solvernets.get(o),refetchInterval:e,enabled:!!o}),f=(b=a.data)==null?void 0:b.manifestCid,_=ce({queryKey:["solvernets","manifest",f],queryFn:()=>ee.solvernets.getManifest(f),enabled:!!f,staleTime:1/0}),[p,m]=N.useState(null),[x,w]=N.useState(null),y=tr({mutationFn:({target:k})=>ee.solvernets.transitionLifecycle(o,k),onSuccess:async k=>{await g.cancelQueries({queryKey:["solvernets","launched",o]}),g.setQueryData(["solvernets","launched",o],k),m(null),w(null)},onError:k=>{w(k instanceof Error?k.message:String(k))}}),d=tr({mutationFn:k=>ee.solvernets.updateGeneratorConfig(o,k),onSuccess:()=>{g.invalidateQueries({queryKey:["solvernets","launched",o]})}});if(!o)return i.jsx("main",{"data-testid":"launcher-launched-missing-id",style:to,children:i.jsx(Nh,{message:"No solverNetId supplied.",onBack:()=>c("/launcher")})});if(a.isLoading)return i.jsx("main",{"data-testid":"launcher-launched-loading",style:to,children:i.jsx("p",{style:s1,children:"Loading…"})});if(a.isError||!a.data){const k=a.error instanceof Error?a.error.message:"Unknown error";return i.jsx("main",{"data-testid":"launcher-launched-error",style:to,children:i.jsx(Nh,{message:`Failed to load SolverNet: ${k}`,onBack:()=>c("/launcher"),onRetry:()=>{a.refetch()}})})}const u=a.data,l=(C=_.data)==null?void 0:C.manifest,h=n1(u,l),v=(l==null?void 0:l.name)??((E=u.summary)==null?void 0:E.name)??u.solverNetId;return i.jsxs("main",{"data-testid":"launcher-launched","data-solvernet-id":o,style:to,children:[i.jsx(WS,{record:u,manifest:l,onAction:k=>{w(null),m(k)},pending:y.isPending?((S=y.variables)==null?void 0:S.target)??null:null}),i.jsx(jS,{record:u,manifest:l,template:h,onSave:async k=>{await d.mutateAsync(k)}}),i.jsx(OS,{record:u,manifest:l}),i.jsx(qS,{record:u}),_.isError&&i.jsxs("p",{"data-testid":"launcher-launched-manifest-error",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",margin:0},children:["Failed to load manifest:"," ",r1(_.error)]}),i.jsx(IS,{open:p!==null,target:p??"paused",solverNetName:v,pending:y.isPending,errorMessage:x??void 0,onCancel:()=>{y.isPending||(m(null),w(null))},onConfirm:()=>{p&&y.mutate({target:p})}})]})}function r1(e){const t=e instanceof Error?e.message:String(e??"unknown error");return/404|manifest_not_found|registry_unavailable/i.test(t)?`Manifest unavailable from local cache or registry (${t})`:t}function n1(e,t){const r=(t==null?void 0:t.contract)??(e.summary?{id:e.summary.contractId,version:e.summary.contractVersion}:void 0);if(r)return xc[`${r.id}.${r.version}`]}function Nh({message:e,onBack:t,onRetry:r}){return i.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[i.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:e}),i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[r&&i.jsx("button",{type:"button","data-testid":"launcher-launched-error-retry",onClick:r,style:Hh,children:"Retry"}),i.jsx("button",{type:"button","data-testid":"launcher-launched-error-back",onClick:t,style:Hh,children:"Back to launcher"})]})]})}const to={padding:"24px",display:"flex",flexDirection:"column",gap:"16px",maxWidth:"960px",margin:"0 auto"},s1={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)",margin:0},Hh={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",padding:"8px 14px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},zh="curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash",ro={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",flexDirection:"column",gap:"12px"},il={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg)"},$h={fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},ol={background:"var(--bg-sunken)",border:"1px solid var(--border)",borderRadius:"var(--radius-1)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},$r={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 16px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"},no={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"};function i1({onSuccess:e,onCancel:t}){const[r,n]=N.useState("checking"),[s,c]=N.useState(""),[g,o]=N.useState(""),a=()=>{n("checking"),ee.hermesDoctor().then(_=>{if(!_.installed){n("not-installed");return}if(_.exitCode!==0){n("config-issue"),c(_.stderr);return}n("ok"),e()}).catch(_=>{o(_ instanceof Error?_.message:String(_)),n("network-error")})},f=()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(zh).catch(()=>{})};return N.useEffect(()=>{a()},[]),r==="checking"?i.jsxs("div",{"data-testid":"hermes-precheck-checking",style:ro,children:[i.jsx("span",{style:no,children:"Hermes install check"}),i.jsx("p",{style:$h,children:"Checking hermes install…"})]}):r==="not-installed"?i.jsxs("div",{"data-testid":"hermes-precheck-not-installed",style:ro,children:[i.jsx("span",{style:no,children:"Hermes Agent not installed"}),i.jsx("p",{style:il,children:"Hermes Agent is not installed on this machine. Run this command in your terminal, then click Retry:"}),i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[i.jsx("pre",{style:{...ol,flex:1},children:zh}),i.jsx("button",{type:"button","data-testid":"hermes-precheck-copy-install","aria-label":"Copy install command",onClick:f,style:{...$r,padding:"6px 10px",fontSize:"11px"},children:"Copy"})]}),i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[i.jsx("button",{type:"button","data-testid":"hermes-precheck-retry",onClick:a,style:{...$r,borderColor:"var(--accent-sky)",color:"var(--accent-sky)"},children:"I've installed Hermes — retry precheck"}),i.jsx("button",{type:"button","data-testid":"hermes-precheck-cancel",onClick:t,style:$r,children:"Cancel"})]})]}):r==="network-error"?i.jsxs("div",{"data-testid":"hermes-precheck-network-error",style:ro,children:[i.jsx("span",{style:no,children:"Hermes precheck failed"}),i.jsxs("p",{style:il,children:["Could not reach the daemon API to run ",i.jsx("code",{children:"hermes doctor"}),". Check that the daemon is running and the UI token is valid."]}),g?i.jsx("pre",{style:ol,children:g}):null,i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[i.jsx("button",{type:"button","data-testid":"hermes-precheck-retry",onClick:a,style:{...$r,borderColor:"var(--accent-sky)",color:"var(--accent-sky)"},children:"Retry precheck"}),i.jsx("button",{type:"button","data-testid":"hermes-precheck-cancel",onClick:t,style:$r,children:"Cancel"})]})]}):r==="config-issue"?i.jsxs("div",{"data-testid":"hermes-precheck-config-issue",style:ro,children:[i.jsx("span",{style:no,children:"Hermes Agent configuration issue"}),i.jsx("p",{style:il,children:"Hermes is installed but reports configuration issues:"}),i.jsx("pre",{style:ol,children:s||"(no diagnostic output)"}),i.jsxs("p",{style:$h,children:["Run ",i.jsx("code",{children:"hermes model"})," or ",i.jsx("code",{children:"hermes setup"})," to configure a provider, then retry."]}),i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[i.jsx("button",{type:"button","data-testid":"hermes-precheck-retry",onClick:a,style:{...$r,borderColor:"var(--accent-sky)",color:"var(--accent-sky)"},children:"Retry precheck"}),i.jsx("button",{type:"button","data-testid":"hermes-precheck-cancel",onClick:t,style:$r,children:"Cancel"})]})]}):i.jsx(i.Fragment,{})}const o1="Self-improving agent by Nous Research. Built-in learning loop, 200+ models via OpenRouter plus Nous Portal, NVIDIA NIM, GLM, Kimi, and more.",al=Du;function a1(e,t){return e==null?void 0:e.nets.find(r=>r.contract.id===t.id&&r.contract.version===t.version)}function l1(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function c1({manifestCid:e,navigateTo:t}={}){var L,B,$;const r=Tu(),[,n]=Li(),s=t??n,c=yn(),g=e??r.cid,o=ce({queryKey:["solvernets","manifest",g],queryFn:()=>ee.solvernets.getManifest(g),enabled:!!g,retry:!1}),a=ce({queryKey:["solvernets","catalog"],queryFn:()=>ee.getSolverNets()}),f=(L=o.data)==null?void 0:L.manifest,_=f?a1(a.data,f.contract):void 0,p=((_==null?void 0:_.compatibleHarnesses)??[]).filter(O=>O.supportsRoles.includes("solving")).map(O=>({...O,name:Lt(O.name)})).filter((O,F,z)=>z.findIndex(j=>j.name===O.name)===F),m=((B=p[0])==null?void 0:B.name)??al,x=Jn(m),[w,y]=N.useState({roles:[],harness:m,plugins:[],disabledDefaultPlugins:[],model:x}),[d,u]=N.useState(null),[l,h]=N.useState(!1),v=($=p[0])==null?void 0:$.name;v&&w.harness===al&&v!==al&&y({...w,harness:v,model:Jn(v)});const b=ma(w.harness),C=tr({mutationFn:()=>ee.operator.join(g,{...(f==null?void 0:f.name)!==void 0?{name:f.name}:{},...(f==null?void 0:f.contract)!==void 0?{contract:{id:f.contract.id,version:f.contract.version}}:{},roles:w.roles,...w.roles.includes("solver")?{harness:w.harness,plugins:w.plugins,disabledDefaultPlugins:w.disabledDefaultPlugins,model:w.model}:{}}),onSuccess:()=>{c.invalidateQueries({queryKey:["operator","joined"]}),s("/operator#solvernets")},onError:O=>{u(O instanceof Error?O.message:String(O))}});if(!g)return i.jsx("main",{"data-testid":"join-flow-missing-cid",style:so,children:i.jsx(Wh,{message:"No manifest cid supplied.",onBack:()=>s("/operator#solvernets")})});if(o.isLoading)return i.jsx("main",{"data-testid":"join-flow-loading",style:so,children:i.jsx("p",{style:u1,children:"Loading manifest…"})});if(o.isError||!f){const O=o.error instanceof Error?o.error.message:"Unknown error";return i.jsx("main",{"data-testid":"join-flow-error",style:so,children:i.jsx(Wh,{message:`Failed to load manifest: ${O}`,onBack:()=>s("/operator#solvernets"),onRetry:()=>{o.refetch()}})})}const{openRoles:E}=f,S=O=>{E.includes(O)&&y(F=>{const j=F.roles.includes(O)?F.roles.filter(D=>D!==O):E.filter(D=>D===O||F.roles.includes(D));return{...F,roles:j}})},k=w.roles.includes("solver"),T=w.roles.includes("evaluator"),P=w.roles.length>0&&!C.isPending;return i.jsxs("main",{"data-testid":"join-flow","data-manifest-cid":g,style:so,children:[i.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsxs("span",{"data-testid":"join-flow-title",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"20px",fontWeight:500,color:"var(--fg)"},children:["Join ",f.name]}),i.jsx("span",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:f.description})]}),i.jsxs("section",{"data-testid":"join-flow-summary",style:Is,children:[i.jsx("span",{style:Os,children:"Manifest"}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)"},children:[i.jsx("span",{children:"Contract"}),i.jsxs("span",{style:{color:"var(--fg)"},children:[f.contract.id," · ",f.contract.version]}),i.jsx("span",{children:"Solution price"}),i.jsx("span",{style:{color:"var(--fg)"},children:jr(f.solutionPriceWei)}),i.jsx("span",{children:"Verdict price"}),i.jsx("span",{style:{color:"var(--fg)"},children:jr(f.verdictPriceWei)}),i.jsx("span",{children:"Open roles"}),i.jsx("span",{"data-testid":"join-flow-open-roles",style:{color:"var(--fg)"},children:E.join(", ")||"none"}),i.jsx("span",{children:"Launcher"}),i.jsxs("span",{style:{color:"var(--fg)"},children:[l1(f.launcher.safeAddress)," · agentId"," ",f.launcher.agentId]}),i.jsx("span",{children:"Manifest CID"}),i.jsx("span",{"data-testid":"join-flow-manifest-cid",style:{color:"var(--fg-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g})]})]}),i.jsxs("section",{style:Is,children:[i.jsx("span",{style:Os,children:"Roles"}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${E.length||1}, 1fr)`,border:"1px solid var(--border)",borderRadius:"var(--radius-2)",overflow:"hidden"},children:E.map((O,F)=>{const z=w.roles.includes(O),j=`join-role-${O}`;return i.jsxs("label",{htmlFor:j,"data-testid":"join-role-option","data-role":O,"data-role-active":z?"true":"false",style:{padding:"12px 16px",display:"flex",flexDirection:"column",gap:"6px",background:z?"var(--bg)":"transparent",color:z?"var(--fg)":"var(--fg-muted)",borderRight:F<E.length-1?"1px solid var(--border)":"none",cursor:"pointer",fontFamily:"'JetBrains Mono', monospace"},children:[i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("input",{id:j,type:"checkbox",checked:z,onChange:()=>S(O),"aria-label":O==="solver"?"Solver":"Evaluator",style:{accentColor:"var(--accent-sky)",width:"14px",height:"14px"}}),i.jsx("span",{style:{fontSize:"14px",fontWeight:500},children:O==="solver"?"Solver":"Evaluator"})]}),i.jsx("span",{style:{fontSize:"11px",color:z?"var(--fg-muted)":"var(--fg-dim)",paddingLeft:"22px"},children:O==="solver"?"attempt tasks; submit solutions":"verify solutions submitted by other operators"})]},O)})})]}),k&&i.jsxs("section",{"data-testid":"join-flow-solver-fields",style:Is,children:[i.jsx("span",{style:Os,children:"Solver configuration"}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:ll,children:"Harness"}),i.jsxs("select",{"aria-label":"Harness","data-testid":"join-harness-select",value:w.harness,onChange:O=>{const F=O.target.value;y({...w,harness:F,model:Jn(F)})},style:Uh,children:[p.map(O=>i.jsx("option",{value:O.name,children:rv(O.name,O.version)},O.name)),(!_||p.length===0)&&i.jsx("option",{value:w.harness,children:qr(w.harness)})]}),w.harness===Qo&&i.jsxs("span",{"data-testid":"join-harness-hermes-description",style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)"},children:[o1," ",i.jsx("span",{style:{color:"var(--break-amber)"},children:"(requires separate install)"})]})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:ll,children:"Model"}),i.jsxs("select",{"aria-label":"Model","data-testid":"join-model-select",value:w.model,onChange:O=>y({...w,model:O.target.value}),style:Uh,children:[b.map(O=>i.jsx("option",{value:O.id,children:O.label},O.id)),(()=>{const O=bo(w.model,w.harness);return O.isCustom?i.jsx("option",{value:w.model,children:O.label},w.model):null})()]})]})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsx("span",{style:ll,children:"Plugins"}),i.jsx(_c,{available:(_==null?void 0:_.compatiblePlugins)??[],selected:w.plugins,disabledDefaultPlugins:w.disabledDefaultPlugins,onChange:(O,F)=>y({...w,plugins:O,disabledDefaultPlugins:F}),rowTestId:"join-plugin-option",searchTestId:"join-plugin-search"})]})]}),T&&!k&&i.jsxs("section",{"data-testid":"join-flow-evaluator-info",style:Is,children:[i.jsx("span",{style:Os,children:"Evaluator configuration"}),i.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",margin:0},children:["The evaluator harness is bound to"," ",i.jsx("code",{style:{color:"var(--fg)"},children:f.contract.evaluationFunction.implementation})," ","by the manifest's contract; no operator selection required."]})]}),T&&k&&i.jsxs("section",{"data-testid":"join-flow-evaluator-info",style:Is,children:[i.jsx("span",{style:Os,children:"Evaluator binding"}),i.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg-muted)",margin:0},children:["Evaluator harness is bound to"," ",i.jsx("code",{style:{color:"var(--fg)"},children:f.contract.evaluationFunction.implementation})," ","by the manifest. The fields above only configure the solver role."]})]}),l&&i.jsx(i1,{onSuccess:()=>{h(!1),C.mutate()},onCancel:()=>{h(!1)}}),d&&i.jsx("p",{"data-testid":"join-flow-submit-error",role:"alert",style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",margin:0},children:d}),i.jsxs("footer",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"12px"},children:[i.jsx("button",{type:"button","data-testid":"join-flow-cancel",onClick:()=>s("/operator#solvernets"),style:Yo,children:"Cancel"}),i.jsx("button",{type:"button","data-testid":"join-flow-submit",disabled:!P,onClick:()=>{if(u(null),w.roles.includes("solver")&&w.harness===Qo){h(!0);return}C.mutate()},style:{...Yo,background:P?"var(--accent-sky)":"transparent",color:P?"var(--bg-sunken)":"var(--fg-dim)",border:`1px solid ${P?"var(--accent-sky)":"var(--border)"}`,cursor:P?"pointer":"not-allowed"},children:C.isPending?"Joining…":"Join SolverNet"})]})]})}function Wh({message:e,onBack:t,onRetry:r}){return i.jsxs("div",{style:{background:"var(--bg-elevated)",border:"1px solid var(--break-red)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},children:[i.jsx("span",{style:{color:"var(--break-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:"13px"},children:e}),i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[r&&i.jsx("button",{type:"button","data-testid":"join-flow-retry",onClick:r,style:Yo,children:"Retry"}),i.jsx("button",{type:"button","data-testid":"join-flow-back",onClick:t,style:Yo,children:"Back"})]})]})}const so={padding:"24px",display:"flex",flexDirection:"column",gap:"16px",maxWidth:"880px",margin:"0 auto"},u1={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",color:"var(--fg-muted)",margin:0},Is={background:"var(--bg-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"16px 20px",display:"flex",flexDirection:"column",gap:"12px"},Os={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},ll={fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--fg-muted)"},Uh={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",padding:"10px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"14px",color:"var(--fg)"},Yo={fontFamily:"'JetBrains Mono', monospace",fontSize:"13px",padding:"8px 16px",background:"transparent",color:"var(--fg)",border:"1px solid var(--border)",borderRadius:"var(--radius-2)",cursor:"pointer"};function d1({capture:e}){var t;return i.jsxs("section",{style:{display:"grid",gap:6},children:[i.jsx("h2",{style:{margin:0,fontSize:14},children:"Executor"}),i.jsxs("dl",{style:{display:"grid",gridTemplateColumns:"120px 1fr",gap:"6px 12px",margin:0},children:[i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"Tool"}),i.jsx("dd",{style:{margin:0},children:e.originatingTool.name}),i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"Version"}),i.jsx("dd",{style:{margin:0},children:e.originatingTool.version??"unknown"}),i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"Repo"}),i.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.repoRemoteUrl??"none"}),i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"Commit"}),i.jsx("dd",{style:{margin:0,fontFamily:"monospace"},children:((t=e.repoCommitHash)==null?void 0:t.slice(0,12))??"none"})]})]})}function h1({spans:e}){const t=e.flatMap(r=>r.redactedKeys.map(n=>({span:r.name,key:n})));return i.jsxs("section",{style:{display:"grid",gap:8},children:[i.jsx("h2",{style:{margin:0,fontSize:14},children:"Redactions"}),t.length===0?i.jsx("div",{style:{color:"var(--fg-muted)"},children:"No redacted attributes."}):i.jsx("div",{style:{display:"grid",gap:6},children:t.map((r,n)=>i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(120px, 180px) 1fr",gap:12,fontFamily:"monospace",fontSize:12},children:[i.jsx("span",{children:r.span}),i.jsx("span",{children:r.key})]},`${r.span}-${r.key}-${n}`))})]})}function f1({detail:e,approving:t=!1,skipping:r=!1,onApprove:n,onSkip:s,onTrustRepo:c}){const{capture:g,spans:o}=e;return i.jsxs("div",{style:{display:"grid",gap:18},children:[i.jsxs("header",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[i.jsxs("div",{children:[i.jsx("h1",{style:{margin:0,fontSize:22},children:g.sessionId}),i.jsxs("div",{style:{marginTop:6,color:"var(--fg-muted)"},children:[new Date(g.capturedAt).toLocaleString()," · ",o.length," spans"]})]}),i.jsxs("div",{style:{display:"flex",gap:8,alignItems:"start"},children:[g.repoRemoteUrl?i.jsx("button",{type:"button",onClick:()=>c(!0),children:"Trust repo"}):null,i.jsx("button",{type:"button",disabled:r,onClick:s,children:r?"Skipping":"Skip"}),i.jsx("button",{type:"button",disabled:t,onClick:n,children:t?"Approving":"Approve"})]})]}),i.jsx(d1,{capture:g}),i.jsx(h1,{spans:o}),i.jsxs("section",{style:{display:"grid",gap:8},children:[i.jsx("h2",{style:{margin:0,fontSize:14},children:"Trajectory"}),i.jsx("div",{style:{display:"grid",gap:6},children:o.map(a=>i.jsx("div",{style:{padding:"10px 12px",border:"1px solid var(--border)",borderRadius:8,background:"var(--panel)"},children:i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[i.jsx("strong",{children:a.name}),i.jsx("span",{style:{color:"var(--fg-muted)",fontFamily:"monospace",fontSize:12},children:a.spanId})]})},a.spanId))})]})]})}function _v(e){if(!Number.isFinite(e)||e<=0)return"0 B";const t=["B","KB","MB","GB"];let r=e,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r>=10||n===0?Math.round(r):r.toFixed(1)} ${t[n]}`}function wc(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function p1(e){return e.length>14?`${e.slice(0,10)}…${e.slice(-6)}`:e}function Zo(e){return e.source==="served"?e.createdAt:e.fetchedAt}function Cc(e){return e.source==="served"?"shared":e.paidAmountUsdc==="0"?"peer donated":"peer used"}function Jh(e,t){return!e||e.kind!==t.kind?!1:e.kind==="capture"&&t.kind==="capture"?e.id===t.id:e.kind==="artifact"&&t.kind==="artifact"?e.source===t.source&&e.sha256===t.sha256:!1}function kc(e){return e?e instanceof Error?e.message:String(e):"Unknown error"}function cl(e){return/\b(401|403)\b|unauthorized|forbidden/i.test(kc(e))}function qh({kind:e,message:t}){const r=e==="permission"?"Permission required to view execution data. Open the dashboard from the daemon handshake URL or refresh an authenticated session.":`Execution data could not be loaded${t?`: ${t}`:"."}`;return i.jsx("div",{role:"alert","data-testid":e==="permission"?"execution-data-permission":"execution-data-error",style:{marginBottom:12,padding:"12px 14px",border:"1px solid var(--border)",borderRadius:8,background:"var(--panel)",color:e==="permission"?"var(--accent-warn)":"var(--accent-danger)"},children:r})}function g1(e){return{id:`capture:${e.sessionId}`,selection:{kind:"capture",id:e.sessionId},title:"execution-capture.v1",state:e.status,meta:`${e.originatingTool.name} · ${e.spanCount} spans · ${e.redactedSpanCount} redacted`,at:e.capturedAt}}function v1(e){const t=Cc(e);return{id:`artifact:${e.source}:${e.sha256}`,selection:{kind:"artifact",source:e.source,sha256:e.sha256},title:e.artifactType,state:t,meta:`${e.source==="served"?"produced":"peer"} · ${_v(e.contentSize)} · ${p1(e.sha256)}`,at:Zo(e)}}function m1({artifact:e}){const t=Zo(e);return i.jsxs("div",{style:{display:"grid",gap:18},children:[i.jsx("header",{style:{display:"flex",justifyContent:"space-between",gap:16},children:i.jsxs("div",{children:[i.jsx("h1",{style:{margin:0,fontSize:22},children:e.artifactType}),i.jsxs("div",{style:{marginTop:6,color:"var(--fg-muted)"},children:[Cc(e)," · ",_v(e.contentSize)," · ",wc(t)]})]})}),i.jsxs("dl",{style:{margin:0,padding:"14px 16px",border:"1px solid var(--border)",borderRadius:8,display:"grid",gridTemplateColumns:"140px minmax(0, 1fr)",gap:"10px 14px"},children:[i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"type"}),i.jsx("dd",{style:{margin:0},children:e.artifactType}),i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"state"}),i.jsx("dd",{style:{margin:0},children:Cc(e)}),i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"sha256"}),i.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.sha256}),i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"envelope"}),i.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.envelopeCid??"—"}),i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"recorded"}),i.jsx("dd",{style:{margin:0},children:wc(t)}),e.source==="served"?i.jsxs(i.Fragment,{children:[i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"request"}),i.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.requestId??"—"}),i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"accesses"}),i.jsxs("dd",{style:{margin:0},children:[e.access.accessCount," total · ",e.access.failedPaymentCount," failed"]})]}):i.jsxs(i.Fragment,{children:[i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"operator"}),i.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.sourceOperator??"—"}),i.jsx("dt",{style:{color:"var(--fg-muted)"},children:"source"}),i.jsx("dd",{style:{margin:0,overflowWrap:"anywhere"},children:e.sourceEndpoint??"—"})]})]})]})}function _1(){var h,v,b;const e=yn(),[t,r]=N.useState(),n=ce({queryKey:["captures","pending"],queryFn:()=>ee.captures.listPending(),refetchInterval:2500}),s=ce({queryKey:["operator-artifacts","served","execution-data"],queryFn:()=>ee.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),c=ce({queryKey:["operator-artifacts","network","execution-data"],queryFn:()=>ee.operator.listArtifacts({source:"network",limit:100}),refetchInterval:1e4}),g=((h=n.data)==null?void 0:h.captures)??[],o=[...((v=s.data)==null?void 0:v.artifacts)??[],...((b=c.data)==null?void 0:b.artifacts)??[]].sort((C,E)=>Zo(E).localeCompare(Zo(C))),a=[...g.map(g1),...o.map(v1)].sort((C,E)=>E.at.localeCompare(C.at)),f=(t==null?void 0:t.kind)==="capture"?t.id:void 0,_=(t==null?void 0:t.kind)==="artifact"?o.find(C=>C.source===t.source&&C.sha256===t.sha256):void 0,p=n.isLoading||s.isLoading||c.isLoading,m=[n.isError?n.error:n.failureReason,s.isError?s.error:s.failureReason,c.isError?c.error:c.failureReason].filter(Boolean),x=m.find(cl),w=x??m[0];N.useEffect(()=>{if(a.length===0){t&&r(void 0);return}(!t||!a.some(C=>Jh(t,C.selection)))&&r(a[0].selection)},[a,t]);const y=ce({queryKey:["captures",f],queryFn:()=>ee.captures.get(f),enabled:!!f}),d=tr({mutationFn:C=>ee.captures.approve(C),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:["captures"]}),e.invalidateQueries({queryKey:["operator-artifacts"]})])}}),u=tr({mutationFn:C=>ee.captures.skip(C),onSuccess:async()=>{await e.invalidateQueries({queryKey:["captures"]})}}),l=tr({mutationFn:C=>ee.captures.trustRepo(C,!0)});return i.jsxs("div",{style:{padding:24,display:"grid",gridTemplateColumns:"360px 1fr",gap:24},children:[i.jsxs("aside",{children:[i.jsx("h1",{style:{margin:"0 0 12px",fontSize:24},children:"Execution data"}),w?i.jsx(qh,{kind:x?"permission":"error",message:x?void 0:kc(w)}):null,p&&a.length===0?i.jsx("div",{style:{padding:24,color:"var(--fg-muted)"},children:"Loading execution data."}):a.length===0?i.jsx("div",{style:{padding:24,color:"var(--fg-muted)"},children:"No execution data yet."}):i.jsx("div",{style:{display:"grid",gap:8},children:a.map(C=>{const E=Jh(t,C.selection);return i.jsxs("button",{type:"button","data-testid":"execution-data-row",onClick:()=>r(C.selection),style:{textAlign:"left",padding:"14px 16px",border:`1px solid ${E?"var(--accent-sky)":"var(--border)"}`,borderRadius:8,background:E?"rgba(56, 189, 248, 0.08)":"var(--panel)",color:"var(--fg)",cursor:"pointer"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[i.jsx("strong",{children:C.title}),i.jsx("span",{style:{color:"var(--fg-muted)",fontSize:12},children:C.state})]}),i.jsxs("div",{style:{marginTop:6,color:"var(--fg-muted)",fontSize:12},children:[C.meta," · ",wc(C.at)]})]},C.id)})})]}),i.jsx("main",{children:y.error?i.jsx(qh,{kind:cl(y.error)?"permission":"error",message:cl(y.error)?void 0:kc(y.error)}):(t==null?void 0:t.kind)==="capture"&&y.data?i.jsx(f1,{detail:y.data,approving:d.isPending,skipping:u.isPending,onApprove:()=>f&&d.mutate(f),onSkip:()=>f&&u.mutate(f),onTrustRepo:()=>{const C=y.data.capture.repoRemoteUrl;C&&l.mutate(C)}}):(t==null?void 0:t.kind)==="artifact"&&_?i.jsx(m1,{artifact:_}):i.jsx("div",{style:{padding:24,color:"var(--fg-muted)"},children:p?"Loading execution data.":"Select execution data."})})]})}function y1(e){const t=[],r=e.split(`
77
+ `);let n=0;for(;n<r.length;){const s=r[n]??"";if(/^```/.test(s)){const o=s.slice(3).trim(),a=[];for(n++;n<r.length&&!/^```/.test(r[n]??"");)a.push(r[n]??""),n++;n++,t.push({kind:"code",lang:o,text:a.join(`
78
+ `)});continue}const c=/^(#{1,3})\s+(.*)$/.exec(s);if(c){t.push({kind:"heading",level:c[1].length,text:c[2]}),n++;continue}if(/^-\s+/.test(s)){const o=[];for(;n<r.length&&/^-\s+/.test(r[n]??"");)o.push((r[n]??"").replace(/^-\s+/,"")),n++;t.push({kind:"list",items:o});continue}if(s.trim()===""){n++;continue}const g=[s];for(n++;n<r.length&&(r[n]??"").trim()!==""&&!/^(#{1,3}\s|```|-\s)/.test(r[n]??"");)g.push(r[n]??""),n++;t.push({kind:"paragraph",text:g.join(" ")})}return t}function Kh(e){const t=[],r=/`([^`]+)`/g;let n=0,s,c=0;for(;(s=r.exec(e))!==null;)s.index>n&&t.push(e.slice(n,s.index)),t.push(N.createElement("code",{key:`c-${c++}`},s[1])),n=s.index+s[0].length;return n<e.length&&t.push(e.slice(n)),t}function x1(e){const t=y1(e);return N.createElement(N.Fragment,null,...t.map((r,n)=>r.kind==="heading"?r.level===1?N.createElement("h1",{key:n},r.text):r.level===2?N.createElement("h2",{key:n},r.text):N.createElement("h3",{key:n},r.text):r.kind==="code"?N.createElement("pre",{key:n},N.createElement("code",null,r.text??"")):r.kind==="list"?N.createElement("ul",{key:n},...(r.items??[]).map((s,c)=>N.createElement("li",{key:c},...Kh(s)))):N.createElement("p",{key:n},...Kh(r.text??""))))}const S1=`# Build a plug-in
79
+
80
+ Ship a Jinn SolverPlugin in 60 seconds. Targets the SWE-rebench v2 SolverNet running against the Hermes harness on testnet.
81
+
82
+ ## 1. Scaffold
83
+
84
+ \`\`\`bash
85
+ jinn create plugin @you/my-swe-skill --pattern solver-type-plugin --solver-type swe-rebench-v2.v1
86
+ cd @you/my-swe-skill
87
+ yarn install
88
+ yarn test
89
+ \`\`\`
90
+
91
+ The scaffolder emits a working package modeled on \`swe-rebench-v2-runtime\`:
92
+
93
+ \`\`\`
94
+ @you/my-swe-skill/
95
+ ├── jinn.plugin.json # the canonical manifest
96
+ ├── skills/example/SKILL.md
97
+ ├── test/plugin.test.ts # passes immediately
98
+ ├── package.json
99
+ ├── tsconfig.json
100
+ └── README.md
101
+ \`\`\`
102
+
103
+ ## 2. Edit your skill
104
+
105
+ Open \`skills/example/SKILL.md\` and replace it with the skill your plug-in offers. A SolverType plug-in can ship one or more skills; a runtime plug-in usually ships an MCP server in \`.mcp.json\` instead. See \`shape-reference.md\`.
106
+
107
+ ## 3. Publish to npm + chain
108
+
109
+ \`\`\`bash
110
+ npm publish --access public
111
+ jinn solver-plugins publish npm:@you/my-swe-skill
112
+ \`\`\`
113
+
114
+ \`jinn solver-plugins publish\` lazily completes your identity bootstrap (Stage 1) the first time you call it. If you have not yet funded your agent EOA with ETH on testnet, the verb pauses and tells you what to send where. Re-run when the wallet is funded.
115
+
116
+ The verb packs the plug-in, uploads the tarball to IPFS, and writes a \`plugin:<cid>\` record on the on-chain IdentityRegistry under your builder agentId.
117
+
118
+ ## 4. Confirm it published
119
+
120
+ Open the operator app's \`/build\` route. Under "Published plug-ins for SWE-rebench v2" you should see your plug-in. Under "Your published plug-ins" you should see the same record.
121
+
122
+ ## 5. Run it
123
+
124
+ An operator who has joined the SWE-rebench v2 SolverNet can install your plug-in:
125
+
126
+ \`\`\`bash
127
+ jinn solver-plugins show npm:@you/my-swe-skill
128
+ jinn solver-nets add-plugin swe-rebench-v2 npm:@you/my-swe-skill
129
+ \`\`\`
130
+
131
+ The next task they claim runs against your plug-in. The signed envelope's \`executor.plugins[]\` carries your CID; the network explorer attributes the score to your builder agentId.
132
+
133
+ ## Next
134
+
135
+ - \`shape-reference.md\` — the full \`jinn.plugin.json\` shape, the two modes, skills + MCP conventions.
136
+ - \`examples.md\` — annotated reference plug-ins.
137
+ - \`publishing-flow.md\` — what \`jinn solver-plugins publish\` does, step by step.
138
+ - \`identity.md\` — staged identity bootstrap; why publishing does not require operator-grade funding.
139
+ - \`compatibility.md\` — \`jinn.supports\` semantics, harness compatibility.
140
+ `,b1={border:"1px solid var(--border)",borderRadius:"var(--radius-3, 10px)",padding:"24px",background:"var(--surface)"};function un({title:e,children:t,className:r,style:n}){return i.jsxs("section",{style:{...b1,...n},className:r,children:[e&&i.jsx("h3",{style:{marginTop:0},children:e}),t]})}const w1="https://github.com/Jinn-Network/mono/blob/main/cargo/client/docs/build/quickstart.md";function C1(){return i.jsxs(un,{children:[i.jsx("div",{className:"hfmf-intro-markdown",children:x1(S1)}),i.jsx("p",{style:{marginTop:"16px"},children:i.jsx("a",{href:w1,target:"_blank",rel:"noreferrer",children:"Read the full quickstart on GitHub"})})]})}const k1=[{name:"name",type:"string",required:!0,description:"npm package name. Used as the canonical identifier across the registry."},{name:"version",type:"string",required:!0,description:"Semantic version. New versions publish under a new IPFS CID."},{name:"description",type:"string",required:!1,description:"Short prose description of what the plug-in offers."},{name:"jinn.supports",type:"string[]",required:!0,description:'Either ["jinn.runtime"] (runtime plug-in) OR one or more SolverType identifiers (solver-type plug-in). Mixing is rejected.'},{name:"jinn.capabilities",type:"object",required:!1,description:"Optional capabilities map. Reserved for future use; not consumed by Hermes today."},{name:"jinn.mcpServers",type:"object",required:!1,description:"Optional inline MCP server map. The Hermes harness reads .mcp.json instead; declare MCP there for harness-agnostic portability."},{name:"jinn.skills",type:"string[]",required:!1,description:"Relative paths to SKILL.md files. Each declared skill becomes available to the harness as an external skill directory."}],E1=[{id:"runtime",label:"Runtime plug-in",requires:'singleton — supports must be exactly ["jinn.runtime"]',example:'{ "jinn": { "supports": ["jinn.runtime"] } }'},{id:"solver-type",label:"SolverType plug-in",requires:'one or more SolverType ids; cannot include "jinn.runtime"',example:'{ "jinn": { "supports": ["swe-rebench-v2.v1"] } }'}],io={textAlign:"left",padding:"8px 12px",borderBottom:"1px solid var(--border)",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--fg-muted)"},oo={padding:"10px 12px",borderBottom:"1px solid var(--border)",fontSize:"13px",color:"var(--fg)",verticalAlign:"top"};function j1(){return i.jsxs(un,{children:[i.jsx("h2",{style:{marginTop:0},children:"Plug-in shape"}),i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",marginBottom:"24px"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{style:io,children:"Field"}),i.jsx("th",{style:io,children:"Type"}),i.jsx("th",{style:io,children:"Required"}),i.jsx("th",{style:io,children:"Description"})]})}),i.jsx("tbody",{children:k1.map(e=>i.jsxs("tr",{"data-field-required":e.required?"true":"false",children:[i.jsx("td",{style:{...oo,fontFamily:"'JetBrains Mono', monospace"},children:e.name}),i.jsx("td",{style:{...oo,fontFamily:"'JetBrains Mono', monospace",color:"var(--fg-muted)"},children:e.type}),i.jsx("td",{style:oo,children:e.required?"yes":"no"}),i.jsx("td",{style:oo,children:e.description})]},e.name))})]}),i.jsx("h3",{children:"Two modes"}),i.jsx("p",{style:{color:"var(--fg-muted)"},children:"The validator enforces exactly two exclusive modes. Mixing is rejected."}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:E1.map(e=>i.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-2, 6px)",padding:"12px"},children:[i.jsx("h4",{style:{marginTop:0},children:e.label}),i.jsx("p",{style:{color:"var(--fg-muted)",fontSize:"13px"},children:e.requires}),i.jsx("pre",{style:{background:"var(--surface-sunken)",padding:"8px",fontSize:"12px"},children:i.jsx("code",{children:e.example})})]},e.id))})]})}const kn={padding:"10px 12px",borderBottom:"1px solid var(--border)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)",verticalAlign:"top"},Fs={...kn,color:"var(--fg-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.1em",fontSize:"10px"};function R1(e){return e.length>14?`${e.slice(0,8)}…${e.slice(-4)}`:e}function T1({solverType:e}){const{data:t,isLoading:r,error:n}=ce({queryKey:["discovery","plugin-publications",e],queryFn:()=>ee.discovery.listPluginPublications({solverType:e}),refetchInterval:3e4});if(r)return i.jsx("section",{style:{padding:"24px",color:"var(--fg-muted)"},children:"Loading published plug-ins…"});if(n)return i.jsxs("section",{style:{padding:"24px",color:"var(--break-red)"},children:["Discovery unavailable. ",n.message]});const s=(t==null?void 0:t.publications)??[];return s.length===0?i.jsx(un,{title:`Published plug-ins for ${e}`,children:i.jsx("p",{style:{color:"var(--fg-dim)"},children:"No plug-ins published yet. Be the first."})}):i.jsx(un,{title:`Published plug-ins for ${e}`,children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{style:Fs,children:"Plug-in"}),i.jsx("th",{style:Fs,children:"Version"}),i.jsx("th",{style:Fs,children:"Builder agentId"}),i.jsx("th",{style:Fs,children:"CID"}),i.jsx("th",{style:Fs,children:"Status"})]})}),i.jsx("tbody",{children:s.map(c=>i.jsxs("tr",{children:[i.jsx("td",{style:kn,children:c.name}),i.jsx("td",{style:kn,children:c.version}),i.jsx("td",{style:{...kn,color:"var(--fg-muted)"},children:c.builderAgentId}),i.jsx("td",{style:{...kn,color:"var(--fg-muted)"},children:R1(c.cid)}),i.jsx("td",{style:kn,children:c.revoked?i.jsxs("span",{style:{color:"var(--wane)"},children:["revoked",c.revokedReason?` — ${c.revokedReason}`:""]}):i.jsx("span",{style:{color:"var(--vow-green)"},children:"active"})})]},`${c.builderAgentId}:${c.cid}`))})]})})})}const Us={padding:"10px 12px",borderBottom:"1px solid var(--border)",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)"},ao={...Us,color:"var(--fg-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.1em",fontSize:"10px"};function D1({fleetAgentId:e}){const t=!!e,{data:r,isLoading:n,error:s}=ce({queryKey:["discovery","builder-artifacts",e],queryFn:()=>ee.discovery.listBuilderArtifacts(e),enabled:t,refetchInterval:3e4});if(!t)return i.jsx(un,{title:"Your published plug-ins",style:{border:"1px dashed var(--border)",background:"var(--surface-sunken)"},children:i.jsxs("p",{style:{color:"var(--fg-muted)"},children:["Complete identity bootstrap to see your published plug-ins. Run"," ",i.jsx("code",{children:"jinn solver-plugins publish"})," on a plug-in and the lazy stage-ensure will provision your builder identity (Stage 1)."]})});if(n)return i.jsx("section",{style:{padding:"24px",color:"var(--fg-muted)"},children:"Loading your plug-ins…"});if(s)return i.jsx("section",{style:{padding:"24px",color:"var(--break-red)"},children:"Discovery unavailable."});const c=((r==null?void 0:r.artifacts)??[]).filter(g=>g.artifactType==="plugin");return c.length===0?i.jsx(un,{title:"Your published plug-ins",children:i.jsx("p",{style:{color:"var(--fg-dim)"},children:"You have not published any plug-ins yet."})}):i.jsx(un,{title:"Your published plug-ins",children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{style:ao,children:"Plug-in"}),i.jsx("th",{style:ao,children:"Version"}),i.jsx("th",{style:ao,children:"Supports"}),i.jsx("th",{style:ao,children:"Status"})]})}),i.jsx("tbody",{children:c.map(g=>i.jsxs("tr",{children:[i.jsx("td",{style:Us,children:g.name}),i.jsx("td",{style:Us,children:g.version}),i.jsx("td",{style:{...Us,color:"var(--fg-muted)"},children:g.supports.join(", ")}),i.jsx("td",{style:Us,children:g.revoked?i.jsx("span",{style:{color:"var(--wane)"},children:"revoked"}):i.jsx("span",{style:{color:"var(--vow-green)"},children:"active"})})]},`${g.builderAgentId}:${g.cid}`))})]})})})}const Vh=(e,t)=>({padding:"6px 12px",borderRadius:"var(--radius-pill, 999px)",border:`1px solid ${e?"var(--accent-sky)":"var(--border)"}`,background:e?"var(--accent-sky-tint, transparent)":"transparent",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.1em",color:t?"var(--fg-dim)":e?"var(--fg)":"var(--fg-muted)",cursor:t?"not-allowed":"pointer"});function L1({value:e,onChange:t}){return i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsx("button",{"aria-pressed":e==="plugin"?"true":"false",style:Vh(e==="plugin",!1),onClick:()=>{e!=="plugin"&&t("plugin")},children:"Plug-ins"}),i.jsxs("button",{disabled:!0,"aria-pressed":"false",style:Vh(!1,!0),children:["Harnesses ",i.jsx("span",{style:{marginLeft:6,fontSize:9},children:"coming soon"})]})]})}const M1="swe-rebench-v2.v1";function P1(){const{data:e}=ce({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:5e3}),[t,r]=N.useState("plugin");return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"24px",padding:"24px",maxWidth:1100,margin:"0 auto"},children:[i.jsx(C1,{}),i.jsx(j1,{}),i.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:i.jsx(L1,{value:t,onChange:r})}),t==="plugin"?i.jsxs(i.Fragment,{children:[i.jsx(T1,{solverType:M1}),i.jsx(D1,{fleetAgentId:e==null?void 0:e.fleet_agent_id})]}):null]})}function B1(){const{data:e,isLoading:t}=ce({queryKey:["bootstrap"],queryFn:()=>ee.getBootstrap(),refetchInterval:1500}),[r,n]=N.useState(!1);if(t||!e||e.mode==="uninitialized"){const g=e?e.mode==="uninitialized"?"Setting up your wallet":"Loading":"Starting jinn";return i.jsx(l0,{headline:g})}if(e.mode!=="running")return i.jsx(x0,{});const s=e.chain==="base"?"mainnet":"testnet",c=e.master_address??"";return i.jsxs($g,{children:[i.jsx(I0,{restartPending:r,onRestart:async()=>{await ee.restartDaemon(),n(!1)}}),i.jsx(L0,{header:i.jsx(P0,{network:s,rpcHealthy:!0,masterAddress:c}),tabs:i.jsx(B0,{}),rail:i.jsx(A0,{}),children:i.jsxs(s0,{children:[i.jsx(ft,{path:"/overview/activity",children:i.jsx(ux,{})}),i.jsx(ft,{path:"/overview",component:tx}),i.jsx(ft,{path:"/operator/join/:cid",children:i.jsx(c1,{})}),i.jsx(ft,{path:"/operator/execution-data",children:i.jsx(_1,{})}),i.jsx(ft,{path:"/operator",children:i.jsx(Ux,{onRestartPending:()=>n(!0)})}),i.jsx(ft,{path:"/captures",children:i.jsx(mc,{to:"/operator/execution-data"})}),i.jsx(ft,{path:"/configuration",children:i.jsx(A1,{})}),i.jsx(ft,{path:"/launcher/create",children:i.jsx(yS,{})}),i.jsx(ft,{path:"/launcher/launched/:solverNetId",children:i.jsx(t1,{})}),i.jsx(ft,{path:"/launcher",children:i.jsx(Xx,{})}),i.jsx(ft,{path:"/build",children:i.jsx(P1,{})}),i.jsx(ft,{children:i.jsx(mc,{to:"/overview"})})]})})]})}function A1(){const e=typeof window>"u"?"":window.location.hash;return i.jsx(mc,{to:`/operator${e}`})}const I1=new xy({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});o0().finally(()=>{ul.createRoot(document.getElementById("root")).render(i.jsx(mf.StrictMode,{children:i.jsx(Sy,{client:I1,children:i.jsx(B1,{})})}))});