@weavecode/weave 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/node_modules/@weavecode/cli/dist/cli.js +4 -4
  2. package/node_modules/@weavecode/cli/dist/commands/chpass.js +1 -1
  3. package/node_modules/@weavecode/cli/dist/commands/daemon-auth.js +1 -1
  4. package/node_modules/@weavecode/cli/dist/commands/daemon.js +2 -2
  5. package/node_modules/@weavecode/cli/dist/commands/dashboard.d.ts +0 -2
  6. package/node_modules/@weavecode/cli/dist/commands/dashboard.js +2 -1
  7. package/node_modules/@weavecode/cli/dist/commands/doctor.js +1 -1
  8. package/node_modules/@weavecode/cli/dist/commands/init.js +1 -1
  9. package/node_modules/@weavecode/cli/dist/commands/msg.js +2 -2
  10. package/node_modules/@weavecode/cli/dist/commands/scan.js +1 -1
  11. package/node_modules/@weavecode/cli/dist/commands/status.js +2 -2
  12. package/node_modules/@weavecode/cli/dist/commands/uninstall.js +1 -1
  13. package/node_modules/@weavecode/cli/dist/i18n/dict/en.js +5 -3
  14. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.d.ts +44 -1
  15. package/node_modules/@weavecode/cli/dist/i18n/dict/zh.js +6 -4
  16. package/node_modules/@weavecode/cli/dist/i18n/index.js +1 -1
  17. package/node_modules/@weavecode/cli/dist/i18n/t.js +1 -1
  18. package/node_modules/@weavecode/cli/dist/init/claudemd-gen.js +4 -4
  19. package/node_modules/@weavecode/cli/dist/init/executor.js +3 -3
  20. package/node_modules/@weavecode/cli/dist/init/git-commit.js +2 -2
  21. package/node_modules/@weavecode/cli/dist/init/harnesses/claude.js +7 -7
  22. package/node_modules/@weavecode/cli/dist/init/harnesses/codex.js +1 -1
  23. package/node_modules/@weavecode/cli/dist/init/helpers-gen.d.ts +4 -0
  24. package/node_modules/@weavecode/cli/dist/init/helpers-gen.js +1 -20
  25. package/node_modules/@weavecode/cli/dist/init/instruction-link.js +1 -1
  26. package/node_modules/@weavecode/cli/dist/init/mcp-gen.d.ts +3 -20
  27. package/node_modules/@weavecode/cli/dist/init/mcp-gen.js +1 -1
  28. package/node_modules/@weavecode/cli/dist/init/plugin-templates.js +1 -1
  29. package/node_modules/@weavecode/cli/dist/init/prompt.js +4 -4
  30. package/node_modules/@weavecode/cli/dist/init/settings-gen.d.ts +3 -30
  31. package/node_modules/@weavecode/cli/dist/init/settings-gen.js +1 -1
  32. package/node_modules/@weavecode/cli/dist/init/uninstall.js +6 -6
  33. package/node_modules/@weavecode/cli/dist/init/wiring.js +1 -1
  34. package/node_modules/@weavecode/cli/dist/parser.js +1 -1
  35. package/node_modules/@weavecode/cli/dist/statusline/ansi.js +1 -1
  36. package/node_modules/@weavecode/cli/dist/statusline/mock-input.js +1 -1
  37. package/node_modules/@weavecode/cli/dist/statusline/preview.js +2 -2
  38. package/node_modules/@weavecode/cli/package.json +5 -5
  39. package/node_modules/@weavecode/core/dist/harness-checks.js +1 -1
  40. package/node_modules/@weavecode/core/dist/harness.d.ts +45 -2
  41. package/node_modules/@weavecode/core/dist/harness.js +1 -1
  42. package/node_modules/@weavecode/core/dist/index.d.ts +1 -1
  43. package/node_modules/@weavecode/core/dist/index.js +1 -1
  44. package/node_modules/@weavecode/core/dist/platform.js +1 -1
  45. package/node_modules/@weavecode/core/dist/terminal.d.ts +28 -4
  46. package/node_modules/@weavecode/core/dist/terminal.js +1 -1
  47. package/node_modules/@weavecode/core/dist/types.d.ts +188 -11
  48. package/node_modules/@weavecode/core/dist/types.js +1 -1
  49. package/node_modules/@weavecode/core/dist/utils/fs.js +1 -1
  50. package/node_modules/@weavecode/core/dist/utils/logger.js +1 -1
  51. package/node_modules/@weavecode/core/package.json +1 -1
  52. package/node_modules/@weavecode/harness/dist/claude/assets.js +1 -1
  53. package/node_modules/@weavecode/harness/dist/claude/capture.d.ts +11 -1
  54. package/node_modules/@weavecode/harness/dist/claude/capture.js +5 -5
  55. package/node_modules/@weavecode/harness/dist/claude/detect.js +1 -1
  56. package/node_modules/@weavecode/harness/dist/claude/event-source.d.ts +1 -1
  57. package/node_modules/@weavecode/harness/dist/claude/event-source.js +1 -1
  58. package/node_modules/@weavecode/harness/dist/claude/helpers-gen.d.ts +5 -0
  59. package/node_modules/@weavecode/harness/dist/claude/helpers-gen.js +20 -0
  60. package/node_modules/@weavecode/harness/dist/claude/index.d.ts +5 -1
  61. package/node_modules/@weavecode/harness/dist/claude/index.js +1 -1
  62. package/node_modules/@weavecode/harness/dist/claude/mcp-gen.d.ts +22 -0
  63. package/node_modules/@weavecode/harness/dist/claude/mcp-gen.js +1 -0
  64. package/node_modules/@weavecode/harness/dist/claude/messaging.d.ts +11 -2
  65. package/node_modules/@weavecode/harness/dist/claude/messaging.js +4 -1
  66. package/node_modules/@weavecode/harness/dist/claude/model-aliases.d.ts +25 -0
  67. package/node_modules/@weavecode/harness/dist/claude/model-aliases.js +1 -0
  68. package/node_modules/@weavecode/harness/dist/claude/peers.js +1 -1
  69. package/node_modules/@weavecode/harness/dist/claude/plugins.js +4 -4
  70. package/node_modules/@weavecode/harness/dist/claude/prompt-inbox.js +1 -1
  71. package/node_modules/@weavecode/harness/dist/claude/prompt.js +3 -3
  72. package/node_modules/@weavecode/harness/dist/claude/questions.js +2 -1
  73. package/node_modules/@weavecode/harness/dist/claude/settings-gen.d.ts +32 -0
  74. package/node_modules/@weavecode/harness/dist/claude/settings-gen.js +1 -0
  75. package/node_modules/@weavecode/harness/dist/claude/transcript.d.ts +16 -0
  76. package/node_modules/@weavecode/harness/dist/claude/transcript.js +4 -2
  77. package/node_modules/@weavecode/harness/dist/codex/assets.js +1 -1
  78. package/node_modules/@weavecode/harness/dist/codex/detect.js +1 -1
  79. package/node_modules/@weavecode/harness/dist/codex/messaging.js +1 -1
  80. package/node_modules/@weavecode/harness/dist/codex/plugin-state.js +1 -1
  81. package/node_modules/@weavecode/harness/dist/codex/toml.js +9 -9
  82. package/node_modules/@weavecode/harness/dist/driver.d.ts +58 -1
  83. package/node_modules/@weavecode/harness/dist/driver.js +1 -1
  84. package/node_modules/@weavecode/harness/dist/index.d.ts +1 -0
  85. package/node_modules/@weavecode/harness/dist/index.js +1 -1
  86. package/node_modules/@weavecode/harness/dist/init/generated.d.ts +37 -0
  87. package/node_modules/@weavecode/harness/dist/init/generated.js +2 -0
  88. package/node_modules/@weavecode/harness/dist/init/pipeline.js +1 -1
  89. package/node_modules/@weavecode/harness/dist/registry-wiring.d.ts +3 -1
  90. package/node_modules/@weavecode/harness/dist/registry-wiring.js +1 -1
  91. package/node_modules/@weavecode/harness/dist/shared/install-link.js +1 -1
  92. package/node_modules/@weavecode/harness/package.json +2 -2
  93. package/node_modules/@weavecode/server/dist/daemon/ai-config.js +2 -2
  94. package/node_modules/@weavecode/server/dist/daemon/ai-context.js +6 -6
  95. package/node_modules/@weavecode/server/dist/daemon/ai-routes.js +4 -4
  96. package/node_modules/@weavecode/server/dist/daemon/api-log.d.ts +48 -0
  97. package/node_modules/@weavecode/server/dist/daemon/api-log.js +3 -0
  98. package/node_modules/@weavecode/server/dist/daemon/auth-routes.js +1 -1
  99. package/node_modules/@weavecode/server/dist/daemon/auto-start.js +6 -6
  100. package/node_modules/@weavecode/server/dist/daemon/capture-routes.js +1 -1
  101. package/node_modules/@weavecode/server/dist/daemon/claude-liveness.js +1 -1
  102. package/node_modules/@weavecode/server/dist/daemon/dashboard-auth.js +2 -2
  103. package/node_modules/@weavecode/server/dist/daemon/data-bus.js +1 -1
  104. package/node_modules/@weavecode/server/dist/daemon/dev-entry.js +1 -1
  105. package/node_modules/@weavecode/server/dist/daemon/fs-browser.js +1 -1
  106. package/node_modules/@weavecode/server/dist/daemon/hook-pipeline.d.ts +6 -1
  107. package/node_modules/@weavecode/server/dist/daemon/hook-pipeline.js +1 -1
  108. package/node_modules/@weavecode/server/dist/daemon/hooks-routes.js +1 -1
  109. package/node_modules/@weavecode/server/dist/daemon/http.js +1 -1
  110. package/node_modules/@weavecode/server/dist/daemon/opener.d.ts +102 -19
  111. package/node_modules/@weavecode/server/dist/daemon/opener.js +97 -7
  112. package/node_modules/@weavecode/server/dist/daemon/port.js +1 -1
  113. package/node_modules/@weavecode/server/dist/daemon/project-harnesses.js +2 -2
  114. package/node_modules/@weavecode/server/dist/daemon/project-updates-refresher.d.ts +4 -3
  115. package/node_modules/@weavecode/server/dist/daemon/project-updates-refresher.js +1 -1
  116. package/node_modules/@weavecode/server/dist/daemon/server.d.ts +8 -0
  117. package/node_modules/@weavecode/server/dist/daemon/server.js +6 -6
  118. package/node_modules/@weavecode/server/dist/daemon/session-probe.d.ts +59 -2
  119. package/node_modules/@weavecode/server/dist/daemon/session-probe.js +1 -1
  120. package/node_modules/@weavecode/server/dist/daemon/settings.d.ts +10 -0
  121. package/node_modules/@weavecode/server/dist/daemon/settings.js +2 -2
  122. package/node_modules/@weavecode/server/dist/daemon/start.js +1 -1
  123. package/node_modules/@weavecode/server/dist/daemon/state.js +2 -2
  124. package/node_modules/@weavecode/server/dist/daemon/static.js +1 -1
  125. package/node_modules/@weavecode/server/dist/daemon/terminal-topology-refresher.d.ts +4 -1
  126. package/node_modules/@weavecode/server/dist/daemon/tls.js +1 -1
  127. package/node_modules/@weavecode/server/dist/daemon/toolkit-routes.js +1 -1
  128. package/node_modules/@weavecode/server/dist/db/db.js +20 -2
  129. package/node_modules/@weavecode/server/dist/db/paths.d.ts +4 -0
  130. package/node_modules/@weavecode/server/dist/db/paths.js +1 -1
  131. package/node_modules/@weavecode/server/dist/hooks/answer-keys.js +1 -1
  132. package/node_modules/@weavecode/server/dist/hooks/bus.js +1 -1
  133. package/node_modules/@weavecode/server/dist/hooks/dispatcher.js +6 -6
  134. package/node_modules/@weavecode/server/dist/hooks/handlers/webhook.js +1 -1
  135. package/node_modules/@weavecode/server/dist/hooks/headless-runner.js +2 -2
  136. package/node_modules/@weavecode/server/dist/hooks/inbox-socket.d.ts +17 -4
  137. package/node_modules/@weavecode/server/dist/hooks/inbox-socket.js +2 -1
  138. package/node_modules/@weavecode/server/dist/hooks/inbox-worker.d.ts +20 -6
  139. package/node_modules/@weavecode/server/dist/hooks/inbox-worker.js +3 -3
  140. package/node_modules/@weavecode/server/dist/hooks/match.js +1 -1
  141. package/node_modules/@weavecode/server/dist/hooks/message-deliverer.d.ts +171 -13
  142. package/node_modules/@weavecode/server/dist/hooks/message-deliverer.js +3 -2
  143. package/node_modules/@weavecode/server/dist/hooks/mirror.js +4 -4
  144. package/node_modules/@weavecode/server/dist/hooks/plugin-installer.js +3 -3
  145. package/node_modules/@weavecode/server/dist/hooks/plugin-loader.js +1 -1
  146. package/node_modules/@weavecode/server/dist/hooks/plugin-project-state.js +1 -1
  147. package/node_modules/@weavecode/server/dist/hooks/prompt-flusher.js +1 -1
  148. package/node_modules/@weavecode/server/dist/hooks/promptbox.d.ts +13 -0
  149. package/node_modules/@weavecode/server/dist/hooks/promptbox.js +8 -8
  150. package/node_modules/@weavecode/server/dist/hooks/push-notify.js +2 -2
  151. package/node_modules/@weavecode/server/dist/hooks/question-tracker.d.ts +6 -4
  152. package/node_modules/@weavecode/server/dist/hooks/question-tracker.js +1 -1
  153. package/node_modules/@weavecode/server/dist/hooks/registry.js +1 -1
  154. package/node_modules/@weavecode/server/dist/hooks/resume-runner.js +1 -1
  155. package/node_modules/@weavecode/server/dist/hooks/sequence-engine.js +1 -1
  156. package/node_modules/@weavecode/server/dist/hooks/session-purge.d.ts +4 -0
  157. package/node_modules/@weavecode/server/dist/hooks/session-purge.js +1 -1
  158. package/node_modules/@weavecode/server/dist/hooks/session-sweeper.d.ts +5 -8
  159. package/node_modules/@weavecode/server/dist/hooks/session-sweeper.js +1 -1
  160. package/node_modules/@weavecode/server/dist/hooks/toolkit-scan.js +1 -1
  161. package/node_modules/@weavecode/server/dist/hooks/toolkit.d.ts +8 -0
  162. package/node_modules/@weavecode/server/dist/hooks/toolkit.js +5 -5
  163. package/node_modules/@weavecode/server/dist/hooks/watch-engine.d.ts +7 -0
  164. package/node_modules/@weavecode/server/dist/hooks/watch-engine.js +1 -1
  165. package/node_modules/@weavecode/server/dist/index.d.ts +1 -1
  166. package/node_modules/@weavecode/server/dist/install/apply-update.d.ts +1 -1
  167. package/node_modules/@weavecode/server/dist/install/apply-update.js +1 -1
  168. package/node_modules/@weavecode/server/dist/install/capabilities.js +1 -1
  169. package/node_modules/@weavecode/server/dist/install/codex-toml.js +1 -1
  170. package/node_modules/@weavecode/server/dist/install/file-assets.js +1 -1
  171. package/node_modules/@weavecode/server/dist/install/fingerprint.d.ts +5 -1
  172. package/node_modules/@weavecode/server/dist/install/fingerprint.js +1 -1
  173. package/node_modules/@weavecode/server/dist/install/git-classify.d.ts +30 -0
  174. package/node_modules/@weavecode/server/dist/install/git-classify.js +1 -0
  175. package/node_modules/@weavecode/server/dist/install/global-config.js +2 -2
  176. package/node_modules/@weavecode/server/dist/install/global-file-assets.js +1 -1
  177. package/node_modules/@weavecode/server/dist/install/init-files.d.ts +46 -0
  178. package/node_modules/@weavecode/server/dist/install/init-files.js +2 -0
  179. package/node_modules/@weavecode/server/dist/install/install-ledger.js +1 -1
  180. package/node_modules/@weavecode/server/dist/install/installer.js +3 -3
  181. package/node_modules/@weavecode/server/dist/install/library-index.js +1 -1
  182. package/node_modules/@weavecode/server/dist/install/mcp-rows.js +1 -1
  183. package/node_modules/@weavecode/server/dist/install/plugin-install.js +1 -1
  184. package/node_modules/@weavecode/server/dist/install/plugin-rows.js +1 -1
  185. package/node_modules/@weavecode/server/dist/install/plugin-templates.js +1 -1
  186. package/node_modules/@weavecode/server/dist/install/project-config.d.ts +0 -2
  187. package/node_modules/@weavecode/server/dist/install/project-config.js +2 -2
  188. package/node_modules/@weavecode/server/dist/install/reader.js +1 -1
  189. package/node_modules/@weavecode/server/dist/install/scan-cache.js +1 -1
  190. package/node_modules/@weavecode/server/dist/install/scanner.js +1 -1
  191. package/node_modules/@weavecode/server/dist/install/settings-mcp.js +2 -2
  192. package/node_modules/@weavecode/server/dist/install/updates.d.ts +17 -5
  193. package/node_modules/@weavecode/server/dist/install/updates.js +1 -1
  194. package/node_modules/@weavecode/server/dist/market/builtin.js +1 -1
  195. package/node_modules/@weavecode/server/dist/market/identity.js +1 -1
  196. package/node_modules/@weavecode/server/dist/market/import.js +2 -2
  197. package/node_modules/@weavecode/server/dist/market/refresh.js +1 -1
  198. package/node_modules/@weavecode/server/dist/market/resolve.js +1 -1
  199. package/node_modules/@weavecode/server/dist/market/updates.js +1 -1
  200. package/node_modules/@weavecode/server/dist/registry.js +2 -2
  201. package/node_modules/@weavecode/server/dist/repositories/hook-dispatches.js +5 -5
  202. package/node_modules/@weavecode/server/dist/repositories/hook-events.js +2 -2
  203. package/node_modules/@weavecode/server/dist/repositories/hook-rules.js +4 -4
  204. package/node_modules/@weavecode/server/dist/repositories/libraries.js +1 -1
  205. package/node_modules/@weavecode/server/dist/repositories/plugin-states.js +1 -1
  206. package/node_modules/@weavecode/server/dist/repositories/projects.d.ts +7 -0
  207. package/node_modules/@weavecode/server/dist/repositories/projects.js +2 -2
  208. package/node_modules/@weavecode/server/dist/repositories/push-subscriptions.js +2 -2
  209. package/node_modules/@weavecode/server/dist/repositories/session-watches.js +4 -4
  210. package/node_modules/@weavecode/server/dist/repositories/sessions.d.ts +17 -4
  211. package/node_modules/@weavecode/server/dist/repositories/sessions.js +2 -2
  212. package/node_modules/@weavecode/server/dist/repositories/uploads.d.ts +66 -0
  213. package/node_modules/@weavecode/server/dist/repositories/uploads.js +7 -0
  214. package/node_modules/@weavecode/server/dist/statusline/cache-sweeper.js +1 -1
  215. package/node_modules/@weavecode/server/dist/statusline/generator.js +81 -40
  216. package/node_modules/@weavecode/server/dist/statusline/manager.d.ts +2 -0
  217. package/node_modules/@weavecode/server/dist/statusline/manager.js +4 -4
  218. package/node_modules/@weavecode/server/dist/surfaces.js +1 -1
  219. package/node_modules/@weavecode/server/dist/watch/cache.js +1 -1
  220. package/node_modules/@weavecode/server/dist/watch/classifier.js +1 -1
  221. package/node_modules/@weavecode/server/dist/watch/plugin-mods.js +1 -1
  222. package/node_modules/@weavecode/server/dist/watch/sync-scheduler.d.ts +8 -4
  223. package/node_modules/@weavecode/server/dist/watch/sync-scheduler.js +1 -1
  224. package/node_modules/@weavecode/server/dist/watch/watch-service.js +1 -1
  225. package/node_modules/@weavecode/server/package.json +4 -4
  226. package/node_modules/@weavecode/server/web/dist/assets/index-D5WFh77i.css +11 -0
  227. package/node_modules/@weavecode/server/web/dist/assets/index-DJibaGnJ.js +585 -0
  228. package/node_modules/@weavecode/server/web/dist/index.html +14 -2
  229. package/node_modules/@weavecode/templates/dist/resources/weave-market/plugins/core-skills/weave-plugin-creator/skills/weave-plugin-creator/SKILL.md +2 -2
  230. package/node_modules/@weavecode/templates/package.json +2 -2
  231. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/README.md +50 -32
  232. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/build/index.d.ts +86 -40
  233. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/build/index.es.js +860 -353
  234. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/build/index.js +860 -353
  235. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-cms/node_modules/asn1js/package.json +20 -17
  236. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/README.md +50 -32
  237. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/build/index.d.ts +86 -40
  238. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/build/index.es.js +860 -353
  239. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/build/index.js +860 -353
  240. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-csr/node_modules/asn1js/package.json +20 -17
  241. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/README.md +50 -32
  242. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/build/index.d.ts +86 -40
  243. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/build/index.es.js +860 -353
  244. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/build/index.js +860 -353
  245. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-ecc/node_modules/asn1js/package.json +20 -17
  246. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/README.md +50 -32
  247. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/build/index.d.ts +86 -40
  248. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/build/index.es.js +860 -353
  249. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/build/index.js +860 -353
  250. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-pkcs9/node_modules/asn1js/package.json +20 -17
  251. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/README.md +50 -32
  252. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/build/index.d.ts +86 -40
  253. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/build/index.es.js +860 -353
  254. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/build/index.js +860 -353
  255. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-rsa/node_modules/asn1js/package.json +20 -17
  256. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/README.md +50 -32
  257. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/build/index.d.ts +86 -40
  258. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/build/index.es.js +860 -353
  259. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/build/index.js +860 -353
  260. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-schema/node_modules/asn1js/package.json +20 -17
  261. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/README.md +50 -32
  262. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/build/index.d.ts +86 -40
  263. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/build/index.es.js +860 -353
  264. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/build/index.js +860 -353
  265. package/node_modules/selfsigned/node_modules/@peculiar/x509/node_modules/@peculiar/asn1-x509/node_modules/asn1js/package.json +20 -17
  266. package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/README.md +50 -32
  267. package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/build/index.d.ts +86 -40
  268. package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/build/index.es.js +860 -353
  269. package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/build/index.js +860 -353
  270. package/node_modules/selfsigned/node_modules/pkijs/node_modules/asn1js/package.json +20 -17
  271. package/package.json +6 -6
  272. package/node_modules/@weavecode/server/web/dist/assets/index-BOzaRlQE.js +0 -560
  273. package/node_modules/@weavecode/server/web/dist/assets/index-ChX8G8cT.css +0 -11
@@ -0,0 +1,585 @@
1
+ var Qk=e=>{throw TypeError(e)};var Dm=(e,t,n)=>t.has(e)||Qk("Cannot "+n);var ie=(e,t,n)=>(Dm(e,t,"read from private field"),n?n.call(e):t.get(e)),Je=(e,t,n)=>t.has(e)?Qk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),qe=(e,t,n,s)=>(Dm(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),gt=(e,t,n)=>(Dm(e,t,"access private method"),n);var of=(e,t,n,s)=>({set _(r){qe(e,t,r,n)},get _(){return ie(e,t,s)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var Wk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eC={exports:{}},Pp={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var SO=Symbol.for("react.transitional.element"),NO=Symbol.for("react.fragment");function tC(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:SO,type:e,key:s,ref:t!==void 0?t:null,props:n}}Pp.Fragment=NO;Pp.jsx=tC;Pp.jsxs=tC;eC.exports=Pp;var o=eC.exports,nC={exports:{}},lt={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var cy=Symbol.for("react.transitional.element"),EO=Symbol.for("react.portal"),_O=Symbol.for("react.fragment"),CO=Symbol.for("react.strict_mode"),TO=Symbol.for("react.profiler"),AO=Symbol.for("react.consumer"),MO=Symbol.for("react.context"),jO=Symbol.for("react.forward_ref"),RO=Symbol.for("react.suspense"),OO=Symbol.for("react.memo"),sC=Symbol.for("react.lazy"),DO=Symbol.for("react.activity"),Zk=Symbol.iterator;function IO(e){return e===null||typeof e!="object"?null:(e=Zk&&e[Zk]||e["@@iterator"],typeof e=="function"?e:null)}var rC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},iC=Object.assign,aC={};function gc(e,t,n){this.props=e,this.context=t,this.refs=aC,this.updater=n||rC}gc.prototype.isReactComponent={};gc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};gc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lC(){}lC.prototype=gc.prototype;function uy(e,t,n){this.props=e,this.context=t,this.refs=aC,this.updater=n||rC}var dy=uy.prototype=new lC;dy.constructor=uy;iC(dy,gc.prototype);dy.isPureReactComponent=!0;var Jk=Array.isArray;function B0(){}var Vt={H:null,A:null,T:null,S:null},oC=Object.prototype.hasOwnProperty;function fy(e,t,n){var s=n.ref;return{$$typeof:cy,type:e,key:t,ref:s!==void 0?s:null,props:n}}function LO(e,t){return fy(e.type,t,e.props)}function hy(e){return typeof e=="object"&&e!==null&&e.$$typeof===cy}function PO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ew=/\/+/g;function Im(e,t){return typeof e=="object"&&e!==null&&e.key!=null?PO(""+e.key):t.toString(36)}function zO(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(B0,B0):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Xl(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case cy:case EO:a=!0;break;case sC:return a=e._init,Xl(a(e._payload),t,n,s,r)}}if(a)return r=r(e),a=s===""?"."+Im(e,0):s,Jk(r)?(n="",a!=null&&(n=a.replace(ew,"$&/")+"/"),Xl(r,t,n,"",function(u){return u})):r!=null&&(hy(r)&&(r=LO(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(ew,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=s===""?".":s+":";if(Jk(e))for(var c=0;c<e.length;c++)s=e[c],i=l+Im(s,c),a+=Xl(s,t,n,i,r);else if(c=IO(e),typeof c=="function")for(e=c.call(e),c=0;!(s=e.next()).done;)s=s.value,i=l+Im(s,c++),a+=Xl(s,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return Xl(zO(e),t,n,s,r);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 a}function cf(e,t,n){if(e==null)return e;var s=[],r=0;return Xl(e,s,"","",function(i){return t.call(n,i,r++)}),s}function UO(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var tw=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},FO={map:cf,forEach:function(e,t,n){cf(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return cf(e,function(){t++}),t},toArray:function(e){return cf(e,function(t){return t})||[]},only:function(e){if(!hy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};lt.Activity=DO;lt.Children=FO;lt.Component=gc;lt.Fragment=_O;lt.Profiler=TO;lt.PureComponent=uy;lt.StrictMode=CO;lt.Suspense=RO;lt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Vt;lt.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Vt.H.useMemoCache(e)}};lt.cache=function(e){return function(){return e.apply(null,arguments)}};lt.cacheSignal=function(){return null};lt.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=iC({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!oC.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(s[i]=t[i]);var i=arguments.length-2;if(i===1)s.children=n;else if(1<i){for(var a=Array(i),l=0;l<i;l++)a[l]=arguments[l+2];s.children=a}return fy(e.type,r,s)};lt.createContext=function(e){return e={$$typeof:MO,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:AO,_context:e},e};lt.createElement=function(e,t,n){var s,r={},i=null;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)oC.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(s in a=e.defaultProps,a)r[s]===void 0&&(r[s]=a[s]);return fy(e,i,r)};lt.createRef=function(){return{current:null}};lt.forwardRef=function(e){return{$$typeof:jO,render:e}};lt.isValidElement=hy;lt.lazy=function(e){return{$$typeof:sC,_payload:{_status:-1,_result:e},_init:UO}};lt.memo=function(e,t){return{$$typeof:OO,type:e,compare:t===void 0?null:t}};lt.startTransition=function(e){var t=Vt.T,n={};Vt.T=n;try{var s=e(),r=Vt.S;r!==null&&r(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(B0,tw)}catch(i){tw(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),Vt.T=t}};lt.unstable_useCacheRefresh=function(){return Vt.H.useCacheRefresh()};lt.use=function(e){return Vt.H.use(e)};lt.useActionState=function(e,t,n){return Vt.H.useActionState(e,t,n)};lt.useCallback=function(e,t){return Vt.H.useCallback(e,t)};lt.useContext=function(e){return Vt.H.useContext(e)};lt.useDebugValue=function(){};lt.useDeferredValue=function(e,t){return Vt.H.useDeferredValue(e,t)};lt.useEffect=function(e,t){return Vt.H.useEffect(e,t)};lt.useEffectEvent=function(e){return Vt.H.useEffectEvent(e)};lt.useId=function(){return Vt.H.useId()};lt.useImperativeHandle=function(e,t,n){return Vt.H.useImperativeHandle(e,t,n)};lt.useInsertionEffect=function(e,t){return Vt.H.useInsertionEffect(e,t)};lt.useLayoutEffect=function(e,t){return Vt.H.useLayoutEffect(e,t)};lt.useMemo=function(e,t){return Vt.H.useMemo(e,t)};lt.useOptimistic=function(e,t){return Vt.H.useOptimistic(e,t)};lt.useReducer=function(e,t,n){return Vt.H.useReducer(e,t,n)};lt.useRef=function(e){return Vt.H.useRef(e)};lt.useState=function(e){return Vt.H.useState(e)};lt.useSyncExternalStore=function(e,t,n){return Vt.H.useSyncExternalStore(e,t,n)};lt.useTransition=function(){return Vt.H.useTransition()};lt.version="19.2.8";nC.exports=lt;var x=nC.exports;const Jn=vd(x);var cC={exports:{}},zp={},uC={exports:{}},dC={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(C,O){var U=C.length;C.push(O);e:for(;0<U;){var F=U-1>>>1,j=C[F];if(0<r(j,O))C[F]=O,C[U]=j,U=F;else break e}}function n(C){return C.length===0?null:C[0]}function s(C){if(C.length===0)return null;var O=C[0],U=C.pop();if(U!==O){C[0]=U;e:for(var F=0,j=C.length,N=j>>>1;F<N;){var G=2*(F+1)-1,T=C[G],Z=G+1,te=C[Z];if(0>r(T,U))Z<j&&0>r(te,T)?(C[F]=te,C[Z]=U,F=Z):(C[F]=T,C[G]=U,F=G);else if(Z<j&&0>r(te,U))C[F]=te,C[Z]=U,F=Z;else break e}}return O}function r(C,O){var U=C.sortIndex-O.sortIndex;return U!==0?U:C.id-O.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,k=!1,w=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function S(C){for(var O=n(u);O!==null;){if(O.callback===null)s(u);else if(O.startTime<=C)s(u),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(u)}}function M(C){if(k=!1,S(C),!m)if(n(c)!==null)m=!0,E||(E=!0,$());else{var O=n(u);O!==null&&L(M,O.startTime-C)}}var E=!1,A=-1,R=5,D=-1;function _(){return w?!0:!(e.unstable_now()-D<R)}function z(){if(w=!1,E){var C=e.unstable_now();D=C;var O=!0;try{e:{m=!1,k&&(k=!1,y(A),A=-1),p=!0;var U=h;try{t:{for(S(C),f=n(c);f!==null&&!(f.expirationTime>C&&_());){var F=f.callback;if(typeof F=="function"){f.callback=null,h=f.priorityLevel;var j=F(f.expirationTime<=C);if(C=e.unstable_now(),typeof j=="function"){f.callback=j,S(C),O=!0;break t}f===n(c)&&s(c),S(C)}else s(c);f=n(c)}if(f!==null)O=!0;else{var N=n(u);N!==null&&L(M,N.startTime-C),O=!1}}break e}finally{f=null,h=U,p=!1}O=void 0}}finally{O?$():E=!1}}}var $;if(typeof b=="function")$=function(){b(z)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,I=H.port2;H.port1.onmessage=z,$=function(){I.postMessage(null)}}else $=function(){g(z,0)};function L(C,O){A=g(function(){C(e.unstable_now())},O)}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(C){C.callback=null},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(C){switch(h){case 1:case 2:case 3:var O=3;break;default:O=h}var U=h;h=O;try{return C()}finally{h=U}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(C,O){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var U=h;h=C;try{return O()}finally{h=U}},e.unstable_scheduleCallback=function(C,O,U){var F=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?F+U:F):U=F,C){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=U+j,C={id:d++,callback:O,priorityLevel:C,startTime:U,expirationTime:j,sortIndex:-1},U>F?(C.sortIndex=U,t(u,C),n(c)===null&&C===n(u)&&(k?(y(A),A=-1):k=!0,L(M,U-F))):(C.sortIndex=j,t(c,C),m||p||(m=!0,E||(E=!0,$()))),C},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(C){var O=h;return function(){var U=h;h=O;try{return C.apply(this,arguments)}finally{h=U}}}})(dC);uC.exports=dC;var BO=uC.exports,fC={exports:{}},ss={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var HO=x;function hC(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Ii(){}var ts={d:{f:Ii,r:function(){throw Error(hC(522))},D:Ii,C:Ii,L:Ii,m:Ii,X:Ii,S:Ii,M:Ii},p:0,findDOMNode:null},$O=Symbol.for("react.portal");function GO(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$O,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}var au=HO.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Up(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}ss.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ts;ss.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(hC(299));return GO(e,t,null,n)};ss.flushSync=function(e){var t=au.T,n=ts.p;try{if(au.T=null,ts.p=2,e)return e()}finally{au.T=t,ts.p=n,ts.d.f()}};ss.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,ts.d.C(e,t))};ss.prefetchDNS=function(e){typeof e=="string"&&ts.d.D(e)};ss.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,s=Up(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?ts.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:i}):n==="script"&&ts.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};ss.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Up(t.as,t.crossOrigin);ts.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&ts.d.M(e)};ss.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,s=Up(n,t.crossOrigin);ts.d.L(e,n,{crossOrigin:s,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};ss.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Up(t.as,t.crossOrigin);ts.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else ts.d.m(e)};ss.requestFormReset=function(e){ts.d.r(e)};ss.unstable_batchedUpdates=function(e,t){return e(t)};ss.useFormState=function(e,t,n){return au.H.useFormState(e,t,n)};ss.useFormStatus=function(){return au.H.useHostTransitionStatus()};ss.version="19.2.8";function pC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pC)}catch(e){console.error(e)}}pC(),fC.exports=ss;var un=fC.exports;/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var En=BO,mC=x,KO=un;function Te(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function gC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kd(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function bC(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 xC(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function nw(e){if(kd(e)!==e)throw Error(Te(188))}function qO(e){var t=e.alternate;if(!t){if(t=kd(e),t===null)throw Error(Te(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return nw(r),e;if(i===s)return nw(r),t;i=i.sibling}throw Error(Te(188))}if(n.return!==s.return)n=r,s=i;else{for(var a=!1,l=r.child;l;){if(l===n){a=!0,n=r,s=i;break}if(l===s){a=!0,s=r,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,s=r;break}if(l===s){a=!0,s=i,n=r;break}l=l.sibling}if(!a)throw Error(Te(189))}}if(n.alternate!==s)throw Error(Te(190))}if(n.tag!==3)throw Error(Te(188));return n.stateNode.current===n?e:t}function yC(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=yC(e),t!==null)return t;e=e.sibling}return null}var Xt=Object.assign,YO=Symbol.for("react.element"),uf=Symbol.for("react.transitional.element"),Vc=Symbol.for("react.portal"),to=Symbol.for("react.fragment"),vC=Symbol.for("react.strict_mode"),H0=Symbol.for("react.profiler"),kC=Symbol.for("react.consumer"),oi=Symbol.for("react.context"),py=Symbol.for("react.forward_ref"),$0=Symbol.for("react.suspense"),G0=Symbol.for("react.suspense_list"),my=Symbol.for("react.memo"),qi=Symbol.for("react.lazy"),K0=Symbol.for("react.activity"),VO=Symbol.for("react.memo_cache_sentinel"),sw=Symbol.iterator;function Oc(e){return e===null||typeof e!="object"?null:(e=sw&&e[sw]||e["@@iterator"],typeof e=="function"?e:null)}var XO=Symbol.for("react.client.reference");function q0(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===XO?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case to:return"Fragment";case H0:return"Profiler";case vC:return"StrictMode";case $0:return"Suspense";case G0:return"SuspenseList";case K0:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Vc:return"Portal";case oi:return e.displayName||"Context";case kC:return(e._context.displayName||"Context")+".Consumer";case py:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case my:return t=e.displayName||null,t!==null?t:q0(e.type)||"Memo";case qi:t=e._payload,e=e._init;try{return q0(e(t))}catch{}}return null}var Xc=Array.isArray,tt=mC.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,At=KO.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,al={pending:!1,data:null,method:null,action:null},Y0=[],no=-1;function Pr(e){return{current:e}}function Rn(e){0>no||(e.current=Y0[no],Y0[no]=null,no--)}function $t(e,t){no++,Y0[no]=e.current,e.current=t}var Dr=Pr(null),Mu=Pr(null),ma=Pr(null),Lh=Pr(null);function Ph(e,t){switch($t(ma,t),$t(Mu,e),$t(Dr,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?c1(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=c1(t),e=B2(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Rn(Dr),$t(Dr,e)}function Yo(){Rn(Dr),Rn(Mu),Rn(ma)}function V0(e){e.memoizedState!==null&&$t(Lh,e);var t=Dr.current,n=B2(t,e.type);t!==n&&($t(Mu,e),$t(Dr,n))}function zh(e){Mu.current===e&&(Rn(Dr),Rn(Mu)),Lh.current===e&&(Rn(Lh),Bu._currentValue=al)}var Lm,rw;function Ha(e){if(Lm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Lm=t&&t[1]||"",rw=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Lm+e+rw}var Pm=!1;function zm(e,t){if(!e||Pm)return"";Pm=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(p){var h=p}Reflect.construct(e,[],f)}else{try{f.call()}catch(p){h=p}e.call(f.prototype)}}else{try{throw Error()}catch(p){h=p}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(p){if(p&&h&&typeof p.stack=="string")return[p.stack,h.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=s.DetermineComponentFrameRoot(),a=i[0],l=i[1];if(a&&l){var c=a.split(`
44
+ `),u=l.split(`
45
+ `);for(r=s=0;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;for(;r<u.length&&!u[r].includes("DetermineComponentFrameRoot");)r++;if(s===c.length||r===u.length)for(s=c.length-1,r=u.length-1;1<=s&&0<=r&&c[s]!==u[r];)r--;for(;1<=s&&0<=r;s--,r--)if(c[s]!==u[r]){if(s!==1||r!==1)do if(s--,r--,0>r||c[s]!==u[r]){var d=`
46
+ `+c[s].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=s&&0<=r);break}}}finally{Pm=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ha(n):""}function QO(e,t){switch(e.tag){case 26:case 27:case 5:return Ha(e.type);case 16:return Ha("Lazy");case 13:return e.child!==t&&t!==null?Ha("Suspense Fallback"):Ha("Suspense");case 19:return Ha("SuspenseList");case 0:case 15:return zm(e.type,!1);case 11:return zm(e.type.render,!1);case 1:return zm(e.type,!0);case 31:return Ha("Activity");default:return""}}function iw(e){try{var t="",n=null;do t+=QO(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var X0=Object.prototype.hasOwnProperty,gy=En.unstable_scheduleCallback,Um=En.unstable_cancelCallback,WO=En.unstable_shouldYield,ZO=En.unstable_requestPaint,_s=En.unstable_now,JO=En.unstable_getCurrentPriorityLevel,wC=En.unstable_ImmediatePriority,SC=En.unstable_UserBlockingPriority,Uh=En.unstable_NormalPriority,eD=En.unstable_LowPriority,NC=En.unstable_IdlePriority,tD=En.log,nD=En.unstable_setDisableYieldValue,wd=null,Cs=null;function oa(e){if(typeof tD=="function"&&nD(e),Cs&&typeof Cs.setStrictMode=="function")try{Cs.setStrictMode(wd,e)}catch{}}var Ts=Math.clz32?Math.clz32:iD,sD=Math.log,rD=Math.LN2;function iD(e){return e>>>=0,e===0?32:31-(sD(e)/rD|0)|0}var df=256,ff=262144,hf=4194304;function $a(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fp(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~i,s!==0?r=$a(s):(a&=l,a!==0?r=$a(a):n||(n=l&~e,n!==0&&(r=$a(n))))):(l=s&~i,l!==0?r=$a(l):a!==0?r=$a(a):n||(n=s&~e,n!==0&&(r=$a(n)))),r===0?0:t!==0&&t!==r&&!(t&i)&&(i=r&-r,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:r}function Sd(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function aD(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function EC(){var e=hf;return hf<<=1,!(hf&62914560)&&(hf=4194304),e}function Fm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Nd(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function lD(e,t,n,s,r,i){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0<n;){var d=31-Ts(n),f=1<<d;l[d]=0,c[d]=-1;var h=u[d];if(h!==null)for(u[d]=null,d=0;d<h.length;d++){var p=h[d];p!==null&&(p.lane&=-536870913)}n&=~f}s!==0&&_C(e,s,0),i!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=i&~(a&~t))}function _C(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Ts(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function CC(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ts(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}function TC(e,t){var n=t&-t;return n=n&42?1:by(n),n&(e.suspendedLanes|t)?0:n}function by(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function xy(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function AC(){var e=At.p;return e!==0?e:(e=window.event,e===void 0?32:Z2(e.type))}function aw(e,t){var n=At.p;try{return At.p=e,t()}finally{At.p=n}}var ja=Math.random().toString(36).slice(2),Ln="__reactFiber$"+ja,ps="__reactProps$"+ja,bc="__reactContainer$"+ja,Q0="__reactEvents$"+ja,oD="__reactListeners$"+ja,cD="__reactHandles$"+ja,lw="__reactResources$"+ja,Ed="__reactMarker$"+ja;function yy(e){delete e[Ln],delete e[ps],delete e[Q0],delete e[oD],delete e[cD]}function so(e){var t=e[Ln];if(t)return t;for(var n=e.parentNode;n;){if(t=n[bc]||n[Ln]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=p1(e);e!==null;){if(n=e[Ln])return n;e=p1(e)}return t}e=n,n=e.parentNode}return null}function xc(e){if(e=e[Ln]||e[bc]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Qc(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Te(33))}function xo(e){var t=e[lw];return t||(t=e[lw]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function jn(e){e[Ed]=!0}var MC=new Set,jC={};function Il(e,t){Vo(e,t),Vo(e+"Capture",t)}function Vo(e,t){for(jC[e]=t,e=0;e<t.length;e++)MC.add(t[e])}var uD=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ow={},cw={};function dD(e){return X0.call(cw,e)?!0:X0.call(ow,e)?!1:uD.test(e)?cw[e]=!0:(ow[e]=!0,!1)}function ch(e,t,n){if(dD(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function pf(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Vr(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function Ps(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function RC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fD(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,i=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function W0(e){if(!e._valueTracker){var t=RC(e)?"checked":"value";e._valueTracker=fD(e,t,""+e[t])}}function OC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=RC(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Fh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var hD=/[\n"\\]/g;function Bs(e){return e.replace(hD,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Z0(e,t,n,s,r,i,a,l){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ps(t)):e.value!==""+Ps(t)&&(e.value=""+Ps(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?J0(e,a,Ps(t)):n!=null?J0(e,a,Ps(n)):s!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Ps(l):e.removeAttribute("name")}function DC(e,t,n,s,r,i,a,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){W0(e);return}n=n!=null?""+Ps(n):"",t=t!=null?""+Ps(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),W0(e)}function J0(e,t,n){t==="number"&&Fh(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function yo(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Ps(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function IC(e,t,n){if(t!=null&&(t=""+Ps(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ps(n):""}function LC(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(Te(92));if(Xc(s)){if(1<s.length)throw Error(Te(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=Ps(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),W0(e)}function Xo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pD=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function uw(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||pD.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function PC(e,t,n){if(t!=null&&typeof t!="object")throw Error(Te(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var r in t)s=t[r],t.hasOwnProperty(r)&&n[r]!==s&&uw(e,r,s)}else for(var i in t)t.hasOwnProperty(i)&&uw(e,i,t[i])}function vy(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mD=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),gD=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function uh(e){return gD.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ci(){}var eb=null;function ky(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ro=null,vo=null;function dw(e){var t=xc(e);if(t&&(e=t.stateNode)){var n=e[ps]||null;e:switch(e=t.stateNode,t.type){case"input":if(Z0(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Bs(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=s[ps]||null;if(!r)throw Error(Te(90));Z0(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&OC(s)}break e;case"textarea":IC(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&yo(e,!!n.multiple,t,!1)}}}var Bm=!1;function zC(e,t,n){if(Bm)return e(t,n);Bm=!0;try{var s=e(t);return s}finally{if(Bm=!1,(ro!==null||vo!==null)&&(Zp(),ro&&(t=ro,e=vo,vo=ro=null,dw(t),e)))for(t=0;t<e.length;t++)dw(e[t])}}function ju(e,t){var n=e.stateNode;if(n===null)return null;var s=n[ps]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Te(231,t,typeof n));return n}var gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tb=!1;if(gi)try{var Dc={};Object.defineProperty(Dc,"passive",{get:function(){tb=!0}}),window.addEventListener("test",Dc,Dc),window.removeEventListener("test",Dc,Dc)}catch{tb=!1}var ca=null,wy=null,dh=null;function UC(){if(dh)return dh;var e,t=wy,n=t.length,s,r="value"in ca?ca.value:ca.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var a=n-e;for(s=1;s<=a&&t[n-s]===r[i-s];s++);return dh=r.slice(e,1<s?1-s:void 0)}function fh(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 mf(){return!0}function fw(){return!1}function ms(e){function t(n,s,r,i,a){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?mf:fw,this.isPropagationStopped=fw,this}return Xt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=mf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=mf)},persist:function(){},isPersistent:mf}),t}var Ll={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bp=ms(Ll),_d=Xt({},Ll,{view:0,detail:0}),bD=ms(_d),Hm,$m,Ic,Hp=Xt({},_d,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sy,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!==Ic&&(Ic&&e.type==="mousemove"?(Hm=e.screenX-Ic.screenX,$m=e.screenY-Ic.screenY):$m=Hm=0,Ic=e),Hm)},movementY:function(e){return"movementY"in e?e.movementY:$m}}),hw=ms(Hp),xD=Xt({},Hp,{dataTransfer:0}),yD=ms(xD),vD=Xt({},_d,{relatedTarget:0}),Gm=ms(vD),kD=Xt({},Ll,{animationName:0,elapsedTime:0,pseudoElement:0}),wD=ms(kD),SD=Xt({},Ll,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ND=ms(SD),ED=Xt({},Ll,{data:0}),pw=ms(ED),_D={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CD={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"},TD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=TD[e])?!!t[e]:!1}function Sy(){return AD}var MD=Xt({},_d,{key:function(e){if(e.key){var t=_D[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?CD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sy,charCode:function(e){return e.type==="keypress"?fh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jD=ms(MD),RD=Xt({},Hp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mw=ms(RD),OD=Xt({},_d,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sy}),DD=ms(OD),ID=Xt({},Ll,{propertyName:0,elapsedTime:0,pseudoElement:0}),LD=ms(ID),PD=Xt({},Hp,{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}),zD=ms(PD),UD=Xt({},Ll,{newState:0,oldState:0}),FD=ms(UD),BD=[9,13,27,32],Ny=gi&&"CompositionEvent"in window,lu=null;gi&&"documentMode"in document&&(lu=document.documentMode);var HD=gi&&"TextEvent"in window&&!lu,FC=gi&&(!Ny||lu&&8<lu&&11>=lu),gw=" ",bw=!1;function BC(e,t){switch(e){case"keyup":return BD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var io=!1;function $D(e,t){switch(e){case"compositionend":return HC(t);case"keypress":return t.which!==32?null:(bw=!0,gw);case"textInput":return e=t.data,e===gw&&bw?null:e;default:return null}}function GD(e,t){if(io)return e==="compositionend"||!Ny&&BC(e,t)?(e=UC(),dh=wy=ca=null,io=!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 FC&&t.locale!=="ko"?null:t.data;default:return null}}var KD={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 xw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!KD[e.type]:t==="textarea"}function $C(e,t,n,s){ro?vo?vo.push(s):vo=[s]:ro=s,t=rp(t,"onChange"),0<t.length&&(n=new Bp("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ou=null,Ru=null;function qD(e){z2(e,0)}function $p(e){var t=Qc(e);if(OC(t))return e}function yw(e,t){if(e==="change")return t}var GC=!1;if(gi){var Km;if(gi){var qm="oninput"in document;if(!qm){var vw=document.createElement("div");vw.setAttribute("oninput","return;"),qm=typeof vw.oninput=="function"}Km=qm}else Km=!1;GC=Km&&(!document.documentMode||9<document.documentMode)}function kw(){ou&&(ou.detachEvent("onpropertychange",KC),Ru=ou=null)}function KC(e){if(e.propertyName==="value"&&$p(Ru)){var t=[];$C(t,Ru,e,ky(e)),zC(qD,t)}}function YD(e,t,n){e==="focusin"?(kw(),ou=t,Ru=n,ou.attachEvent("onpropertychange",KC)):e==="focusout"&&kw()}function VD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $p(Ru)}function XD(e,t){if(e==="click")return $p(t)}function QD(e,t){if(e==="input"||e==="change")return $p(t)}function WD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ms=typeof Object.is=="function"?Object.is:WD;function Ou(e,t){if(Ms(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!X0.call(t,r)||!Ms(e[r],t[r]))return!1}return!0}function ww(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sw(e,t){var n=ww(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ww(n)}}function qC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function YC(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Fh(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fh(e.document)}return t}function Ey(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var ZD=gi&&"documentMode"in document&&11>=document.documentMode,ao=null,nb=null,cu=null,sb=!1;function Nw(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;sb||ao==null||ao!==Fh(s)||(s=ao,"selectionStart"in s&&Ey(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),cu&&Ou(cu,s)||(cu=s,s=rp(nb,"onSelect"),0<s.length&&(t=new Bp("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=ao)))}function Pa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var lo={animationend:Pa("Animation","AnimationEnd"),animationiteration:Pa("Animation","AnimationIteration"),animationstart:Pa("Animation","AnimationStart"),transitionrun:Pa("Transition","TransitionRun"),transitionstart:Pa("Transition","TransitionStart"),transitioncancel:Pa("Transition","TransitionCancel"),transitionend:Pa("Transition","TransitionEnd")},Ym={},VC={};gi&&(VC=document.createElement("div").style,"AnimationEvent"in window||(delete lo.animationend.animation,delete lo.animationiteration.animation,delete lo.animationstart.animation),"TransitionEvent"in window||delete lo.transitionend.transition);function Pl(e){if(Ym[e])return Ym[e];if(!lo[e])return e;var t=lo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in VC)return Ym[e]=t[n];return e}var XC=Pl("animationend"),QC=Pl("animationiteration"),WC=Pl("animationstart"),JD=Pl("transitionrun"),eI=Pl("transitionstart"),tI=Pl("transitioncancel"),ZC=Pl("transitionend"),JC=new Map,rb="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");rb.push("scrollEnd");function pr(e,t){JC.set(e,t),Il(t,[e])}var Bh=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Is=[],oo=0,_y=0;function Gp(){for(var e=oo,t=_y=oo=0;t<e;){var n=Is[t];Is[t++]=null;var s=Is[t];Is[t++]=null;var r=Is[t];Is[t++]=null;var i=Is[t];if(Is[t++]=null,s!==null&&r!==null){var a=s.pending;a===null?r.next=r:(r.next=a.next,a.next=r),s.pending=r}i!==0&&eT(n,r,i)}}function Kp(e,t,n,s){Is[oo++]=e,Is[oo++]=t,Is[oo++]=n,Is[oo++]=s,_y|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Cy(e,t,n,s){return Kp(e,t,n,s),Hh(e)}function zl(e,t){return Kp(e,null,null,t),Hh(e)}function eT(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var r=!1,i=e.return;i!==null;)i.childLanes|=n,s=i.alternate,s!==null&&(s.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(r=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,r&&t!==null&&(r=31-Ts(n),e=i.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=n|536870912),i):null}function Hh(e){if(50<xu)throw xu=0,Eb=null,Error(Te(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var co={};function nI(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ss(e,t,n,s){return new nI(e,t,n,s)}function Ty(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fi(e,t){var n=e.alternate;return n===null?(n=Ss(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function tT(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function hh(e,t,n,s,r,i){var a=0;if(s=e,typeof e=="function")Ty(e)&&(a=1);else if(typeof e=="string")a=l4(e,n,Dr.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K0:return e=Ss(31,n,t,r),e.elementType=K0,e.lanes=i,e;case to:return ll(n.children,r,i,t);case vC:a=8,r|=24;break;case H0:return e=Ss(12,n,t,r|2),e.elementType=H0,e.lanes=i,e;case $0:return e=Ss(13,n,t,r),e.elementType=$0,e.lanes=i,e;case G0:return e=Ss(19,n,t,r),e.elementType=G0,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oi:a=10;break e;case kC:a=9;break e;case py:a=11;break e;case my:a=14;break e;case qi:a=16,s=null;break e}a=29,n=Error(Te(130,e===null?"null":typeof e,"")),s=null}return t=Ss(a,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function ll(e,t,n,s){return e=Ss(7,e,s,t),e.lanes=n,e}function Vm(e,t,n){return e=Ss(6,e,null,t),e.lanes=n,e}function nT(e){var t=Ss(18,null,null,0);return t.stateNode=e,t}function Xm(e,t,n){return t=Ss(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ew=new WeakMap;function Hs(e,t){if(typeof e=="object"&&e!==null){var n=Ew.get(e);return n!==void 0?n:(t={value:e,source:t,stack:iw(t)},Ew.set(e,t),t)}return{value:e,source:t,stack:iw(t)}}var uo=[],fo=0,$h=null,Du=0,zs=[],Us=0,Na=null,Mr=1,jr="";function si(e,t){uo[fo++]=Du,uo[fo++]=$h,$h=e,Du=t}function sT(e,t,n){zs[Us++]=Mr,zs[Us++]=jr,zs[Us++]=Na,Na=e;var s=Mr;e=jr;var r=32-Ts(s)-1;s&=~(1<<r),n+=1;var i=32-Ts(t)+r;if(30<i){var a=r-r%5;i=(s&(1<<a)-1).toString(32),s>>=a,r-=a,Mr=1<<32-Ts(t)+r|n<<r|s,jr=i+e}else Mr=1<<i|n<<r|s,jr=e}function Ay(e){e.return!==null&&(si(e,1),sT(e,1,0))}function My(e){for(;e===$h;)$h=uo[--fo],uo[fo]=null,Du=uo[--fo],uo[fo]=null;for(;e===Na;)Na=zs[--Us],zs[Us]=null,jr=zs[--Us],zs[Us]=null,Mr=zs[--Us],zs[Us]=null}function rT(e,t){zs[Us++]=Mr,zs[Us++]=jr,zs[Us++]=Na,Mr=t.id,jr=t.overflow,Na=e}var Pn=null,Yt=null,St=!1,ga=null,$s=!1,ib=Error(Te(519));function Ea(e){var t=Error(Te(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Iu(Hs(t,e)),ib}function _w(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[Ln]=e,t[ps]=s,n){case"dialog":ht("cancel",t),ht("close",t);break;case"iframe":case"object":case"embed":ht("load",t);break;case"video":case"audio":for(n=0;n<Uu.length;n++)ht(Uu[n],t);break;case"source":ht("error",t);break;case"img":case"image":case"link":ht("error",t),ht("load",t);break;case"details":ht("toggle",t);break;case"input":ht("invalid",t),DC(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ht("invalid",t);break;case"textarea":ht("invalid",t),LC(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||F2(t.textContent,n)?(s.popover!=null&&(ht("beforetoggle",t),ht("toggle",t)),s.onScroll!=null&&ht("scroll",t),s.onScrollEnd!=null&&ht("scrollend",t),s.onClick!=null&&(t.onclick=ci),t=!0):t=!1,t||Ea(e,!0)}function Cw(e){for(Pn=e.return;Pn;)switch(Pn.tag){case 5:case 31:case 13:$s=!1;return;case 27:case 3:$s=!0;return;default:Pn=Pn.return}}function Gl(e){if(e!==Pn)return!1;if(!St)return Cw(e),St=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Mb(e.type,e.memoizedProps)),n=!n),n&&Yt&&Ea(e),Cw(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Te(317));Yt=h1(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Te(317));Yt=h1(e)}else t===27?(t=Yt,Ra(e.type)?(e=Db,Db=null,Yt=e):Yt=t):Yt=Pn?Ys(e.stateNode.nextSibling):null;return!0}function yl(){Yt=Pn=null,St=!1}function Qm(){var e=ga;return e!==null&&(us===null?us=e:us.push.apply(us,e),ga=null),e}function Iu(e){ga===null?ga=[e]:ga.push(e)}var ab=Pr(null),Ul=null,ui=null;function Qi(e,t,n){$t(ab,t._currentValue),t._currentValue=n}function hi(e){e._currentValue=ab.current,Rn(ab)}function lb(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function ob(e,t,n,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=r.dependencies;if(i!==null){var a=r.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),lb(i.return,n,e),s||(a=null);break e}i=l.next}}else if(r.tag===18){if(a=r.return,a===null)throw Error(Te(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),lb(a,n,e),a=null}else a=r.child;if(a!==null)a.return=r;else for(a=r;a!==null;){if(a===e){a=null;break}if(r=a.sibling,r!==null){r.return=a.return,a=r;break}a=a.return}r=a}}function yc(e,t,n,s){e=null;for(var r=t,i=!1;r!==null;){if(!i){if(r.flags&524288)i=!0;else if(r.flags&262144)break}if(r.tag===10){var a=r.alternate;if(a===null)throw Error(Te(387));if(a=a.memoizedProps,a!==null){var l=r.type;Ms(r.pendingProps.value,a.value)||(e!==null?e.push(l):e=[l])}}else if(r===Lh.current){if(a=r.alternate,a===null)throw Error(Te(387));a.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Bu):e=[Bu])}r=r.return}e!==null&&ob(t,e,n,s),t.flags|=262144}function Gh(e){for(e=e.firstContext;e!==null;){if(!Ms(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function vl(e){Ul=e,ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Un(e){return iT(Ul,e)}function gf(e,t){return Ul===null&&vl(e),iT(e,t)}function iT(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ui===null){if(e===null)throw Error(Te(308));ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ui=ui.next=t;return n}var sI=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},rI=En.unstable_scheduleCallback,iI=En.unstable_NormalPriority,gn={$$typeof:oi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jy(){return{controller:new sI,data:new Map,refCount:0}}function Cd(e){e.refCount--,e.refCount===0&&rI(iI,function(){e.controller.abort()})}var uu=null,cb=0,Qo=0,ko=null;function aI(e,t){if(uu===null){var n=uu=[];cb=0,Qo=nv(),ko={status:"pending",value:void 0,then:function(s){n.push(s)}}}return cb++,t.then(Tw,Tw),t}function Tw(){if(--cb===0&&uu!==null){ko!==null&&(ko.status="fulfilled");var e=uu;uu=null,Qo=0,ko=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function lI(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),s}var Aw=tt.S;tt.S=function(e,t){y2=_s(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&aI(e,t),Aw!==null&&Aw(e,t)};var ol=Pr(null);function Ry(){var e=ol.current;return e!==null?e:Ft.pooledCache}function ph(e,t){t===null?$t(ol,ol.current):$t(ol,t.pool)}function aT(){var e=Ry();return e===null?null:{parent:gn._currentValue,pool:e}}var vc=Error(Te(460)),Oy=Error(Te(474)),qp=Error(Te(542)),Kh={then:function(){}};function Mw(e){return e=e.status,e==="fulfilled"||e==="rejected"}function lT(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ci,ci),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rw(e),e;default:if(typeof t.status=="string")t.then(ci,ci);else{if(e=Ft,e!==null&&100<e.shellSuspendCounter)throw Error(Te(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rw(e),e}throw cl=t,vc}}function Ga(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(cl=n,vc):n}}var cl=null;function jw(){if(cl===null)throw Error(Te(459));var e=cl;return cl=null,e}function Rw(e){if(e===vc||e===qp)throw Error(Te(483))}var wo=null,Lu=0;function bf(e){var t=Lu;return Lu+=1,wo===null&&(wo=[]),lT(wo,e,t)}function Lc(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xf(e,t){throw t.$$typeof===YO?Error(Te(525)):(e=Object.prototype.toString.call(t),Error(Te(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function oT(e){function t(g,y){if(e){var b=g.deletions;b===null?(g.deletions=[y],g.flags|=16):b.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function s(g){for(var y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function r(g,y){return g=fi(g,y),g.index=0,g.sibling=null,g}function i(g,y,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<y?(g.flags|=67108866,y):b):(g.flags|=67108866,y)):(g.flags|=1048576,y)}function a(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function l(g,y,b,S){return y===null||y.tag!==6?(y=Vm(b,g.mode,S),y.return=g,y):(y=r(y,b),y.return=g,y)}function c(g,y,b,S){var M=b.type;return M===to?d(g,y,b.props.children,S,b.key):y!==null&&(y.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===qi&&Ga(M)===y.type)?(y=r(y,b.props),Lc(y,b),y.return=g,y):(y=hh(b.type,b.key,b.props,null,g.mode,S),Lc(y,b),y.return=g,y)}function u(g,y,b,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=Xm(b,g.mode,S),y.return=g,y):(y=r(y,b.children||[]),y.return=g,y)}function d(g,y,b,S,M){return y===null||y.tag!==7?(y=ll(b,g.mode,S,M),y.return=g,y):(y=r(y,b),y.return=g,y)}function f(g,y,b){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Vm(""+y,g.mode,b),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case uf:return b=hh(y.type,y.key,y.props,null,g.mode,b),Lc(b,y),b.return=g,b;case Vc:return y=Xm(y,g.mode,b),y.return=g,y;case qi:return y=Ga(y),f(g,y,b)}if(Xc(y)||Oc(y))return y=ll(y,g.mode,b,null),y.return=g,y;if(typeof y.then=="function")return f(g,bf(y),b);if(y.$$typeof===oi)return f(g,gf(g,y),b);xf(g,y)}return null}function h(g,y,b,S){var M=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return M!==null?null:l(g,y,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case uf:return b.key===M?c(g,y,b,S):null;case Vc:return b.key===M?u(g,y,b,S):null;case qi:return b=Ga(b),h(g,y,b,S)}if(Xc(b)||Oc(b))return M!==null?null:d(g,y,b,S,null);if(typeof b.then=="function")return h(g,y,bf(b),S);if(b.$$typeof===oi)return h(g,y,gf(g,b),S);xf(g,b)}return null}function p(g,y,b,S,M){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return g=g.get(b)||null,l(y,g,""+S,M);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case uf:return g=g.get(S.key===null?b:S.key)||null,c(y,g,S,M);case Vc:return g=g.get(S.key===null?b:S.key)||null,u(y,g,S,M);case qi:return S=Ga(S),p(g,y,b,S,M)}if(Xc(S)||Oc(S))return g=g.get(b)||null,d(y,g,S,M,null);if(typeof S.then=="function")return p(g,y,b,bf(S),M);if(S.$$typeof===oi)return p(g,y,b,gf(y,S),M);xf(y,S)}return null}function m(g,y,b,S){for(var M=null,E=null,A=y,R=y=0,D=null;A!==null&&R<b.length;R++){A.index>R?(D=A,A=null):D=A.sibling;var _=h(g,A,b[R],S);if(_===null){A===null&&(A=D);break}e&&A&&_.alternate===null&&t(g,A),y=i(_,y,R),E===null?M=_:E.sibling=_,E=_,A=D}if(R===b.length)return n(g,A),St&&si(g,R),M;if(A===null){for(;R<b.length;R++)A=f(g,b[R],S),A!==null&&(y=i(A,y,R),E===null?M=A:E.sibling=A,E=A);return St&&si(g,R),M}for(A=s(A);R<b.length;R++)D=p(A,g,R,b[R],S),D!==null&&(e&&D.alternate!==null&&A.delete(D.key===null?R:D.key),y=i(D,y,R),E===null?M=D:E.sibling=D,E=D);return e&&A.forEach(function(z){return t(g,z)}),St&&si(g,R),M}function k(g,y,b,S){if(b==null)throw Error(Te(151));for(var M=null,E=null,A=y,R=y=0,D=null,_=b.next();A!==null&&!_.done;R++,_=b.next()){A.index>R?(D=A,A=null):D=A.sibling;var z=h(g,A,_.value,S);if(z===null){A===null&&(A=D);break}e&&A&&z.alternate===null&&t(g,A),y=i(z,y,R),E===null?M=z:E.sibling=z,E=z,A=D}if(_.done)return n(g,A),St&&si(g,R),M;if(A===null){for(;!_.done;R++,_=b.next())_=f(g,_.value,S),_!==null&&(y=i(_,y,R),E===null?M=_:E.sibling=_,E=_);return St&&si(g,R),M}for(A=s(A);!_.done;R++,_=b.next())_=p(A,g,R,_.value,S),_!==null&&(e&&_.alternate!==null&&A.delete(_.key===null?R:_.key),y=i(_,y,R),E===null?M=_:E.sibling=_,E=_);return e&&A.forEach(function($){return t(g,$)}),St&&si(g,R),M}function w(g,y,b,S){if(typeof b=="object"&&b!==null&&b.type===to&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case uf:e:{for(var M=b.key;y!==null;){if(y.key===M){if(M=b.type,M===to){if(y.tag===7){n(g,y.sibling),S=r(y,b.props.children),S.return=g,g=S;break e}}else if(y.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===qi&&Ga(M)===y.type){n(g,y.sibling),S=r(y,b.props),Lc(S,b),S.return=g,g=S;break e}n(g,y);break}else t(g,y);y=y.sibling}b.type===to?(S=ll(b.props.children,g.mode,S,b.key),S.return=g,g=S):(S=hh(b.type,b.key,b.props,null,g.mode,S),Lc(S,b),S.return=g,g=S)}return a(g);case Vc:e:{for(M=b.key;y!==null;){if(y.key===M)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(g,y.sibling),S=r(y,b.children||[]),S.return=g,g=S;break e}else{n(g,y);break}else t(g,y);y=y.sibling}S=Xm(b,g.mode,S),S.return=g,g=S}return a(g);case qi:return b=Ga(b),w(g,y,b,S)}if(Xc(b))return m(g,y,b,S);if(Oc(b)){if(M=Oc(b),typeof M!="function")throw Error(Te(150));return b=M.call(b),k(g,y,b,S)}if(typeof b.then=="function")return w(g,y,bf(b),S);if(b.$$typeof===oi)return w(g,y,gf(g,b),S);xf(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,y!==null&&y.tag===6?(n(g,y.sibling),S=r(y,b),S.return=g,g=S):(n(g,y),S=Vm(b,g.mode,S),S.return=g,g=S),a(g)):n(g,y)}return function(g,y,b,S){try{Lu=0;var M=w(g,y,b,S);return wo=null,M}catch(A){if(A===vc||A===qp)throw A;var E=Ss(29,A,null,g.mode);return E.lanes=S,E.return=g,E}finally{}}}var kl=oT(!0),cT=oT(!1),Yi=!1;function Dy(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ub(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Ct&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=Hh(e),eT(e,null,n),t}return Kp(e,s,t,n),Hh(e)}function du(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,CC(e,n)}}function Wm(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?r=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var db=!1;function fu(){if(db){var e=ko;if(e!==null)throw e}}function hu(e,t,n,s){db=!1;var r=e.updateQueue;Yi=!1;var i=r.firstBaseUpdate,a=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=r.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane&-536870913,p=h!==l.lane;if(p?(bt&h)===h:(s&h)===h){h!==0&&h===Qo&&(db=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,k=l;h=t;var w=n;switch(k.tag){case 1:if(m=k.payload,typeof m=="function"){f=m.call(w,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=k.payload,h=typeof m=="function"?m.call(w,f,h):m,h==null)break e;f=Xt({},f,h);break e;case 2:Yi=!0}}h=l.callback,h!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[h]:p.push(h))}else p={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;p=l,l=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);d===null&&(c=f),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,i===null&&(r.shared.lanes=0),Ca|=a,e.lanes=a,e.memoizedState=f}}function uT(e,t){if(typeof e!="function")throw Error(Te(191,e));e.call(t)}function dT(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)uT(n[e],t)}var Wo=Pr(null),qh=Pr(0);function Ow(e,t){e=vi,$t(qh,e),$t(Wo,t),vi=e|t.baseLanes}function fb(){$t(qh,vi),$t(Wo,Wo.current)}function Iy(){vi=qh.current,Rn(Wo),Rn(qh)}var js=Pr(null),qs=null;function Wi(e){var t=e.alternate;$t(cn,cn.current&1),$t(js,e),qs===null&&(t===null||Wo.current!==null||t.memoizedState!==null)&&(qs=e)}function hb(e){$t(cn,cn.current),$t(js,e),qs===null&&(qs=e)}function fT(e){e.tag===22?($t(cn,cn.current),$t(js,e),qs===null&&(qs=e)):Zi()}function Zi(){$t(cn,cn.current),$t(js,js.current)}function ws(e){Rn(js),qs===e&&(qs=null),Rn(cn)}var cn=Pr(0);function Yh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Rb(n)||Ob(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)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 bi=0,ot=null,Pt=null,pn=null,Vh=!1,So=!1,wl=!1,Xh=0,Pu=0,No=null,oI=0;function ln(){throw Error(Te(321))}function Ly(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ms(e[n],t[n]))return!1;return!0}function Py(e,t,n,s,r,i){return bi=i,ot=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,tt.H=e===null||e.memoizedState===null?$T:Vy,wl=!1,i=n(s,r),wl=!1,So&&(i=pT(t,n,s,r)),hT(e),i}function hT(e){tt.H=zu;var t=Pt!==null&&Pt.next!==null;if(bi=0,pn=Pt=ot=null,Vh=!1,Pu=0,No=null,t)throw Error(Te(300));e===null||bn||(e=e.dependencies,e!==null&&Gh(e)&&(bn=!0))}function pT(e,t,n,s){ot=e;var r=0;do{if(So&&(No=null),Pu=0,So=!1,25<=r)throw Error(Te(301));if(r+=1,pn=Pt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}tt.H=GT,i=t(n,s)}while(So);return i}function cI(){var e=tt.H,t=e.useState()[0];return t=typeof t.then=="function"?Td(t):t,e=e.useState()[0],(Pt!==null?Pt.memoizedState:null)!==e&&(ot.flags|=1024),t}function zy(){var e=Xh!==0;return Xh=0,e}function Uy(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Fy(e){if(Vh){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vh=!1}bi=0,pn=Pt=ot=null,So=!1,Pu=Xh=0,No=null}function Wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?ot.memoizedState=pn=e:pn=pn.next=e,pn}function dn(){if(Pt===null){var e=ot.alternate;e=e!==null?e.memoizedState:null}else e=Pt.next;var t=pn===null?ot.memoizedState:pn.next;if(t!==null)pn=t,Pt=e;else{if(e===null)throw ot.alternate===null?Error(Te(467)):Error(Te(310));Pt=e,e={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},pn===null?ot.memoizedState=pn=e:pn=pn.next=e}return pn}function Yp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Td(e){var t=Pu;return Pu+=1,No===null&&(No=[]),e=lT(No,e,t),t=ot,(pn===null?t.memoizedState:pn.next)===null&&(t=t.alternate,tt.H=t===null||t.memoizedState===null?$T:Vy),e}function Vp(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Td(e);if(e.$$typeof===oi)return Un(e)}throw Error(Te(438,String(e)))}function By(e){var t=null,n=ot.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=ot.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Yp(),ot.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=VO;return t.index++,n}function xi(e,t){return typeof t=="function"?t(e):t}function mh(e){var t=dn();return Hy(t,Pt,e)}function Hy(e,t,n){var s=e.queue;if(s===null)throw Error(Te(311));s.lastRenderedReducer=n;var r=e.baseQueue,i=s.pending;if(i!==null){if(r!==null){var a=r.next;r.next=i.next,i.next=a}t.baseQueue=r=i,s.pending=null}if(i=e.baseState,r===null)e.memoizedState=i;else{t=r.next;var l=a=null,c=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(bt&f)===f:(bi&f)===f){var h=u.revertLane;if(h===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Qo&&(d=!0);else if((bi&h)===h){u=u.next,h===Qo&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=f,a=i):c=c.next=f,ot.lanes|=h,Ca|=h;f=u.action,wl&&n(i,f),i=u.hasEagerState?u.eagerState:n(i,f)}else h={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=h,a=i):c=c.next=h,ot.lanes|=f,Ca|=f;u=u.next}while(u!==null&&u!==t);if(c===null?a=i:c.next=l,!Ms(i,e.memoizedState)&&(bn=!0,d&&(n=ko,n!==null)))throw n;e.memoizedState=i,e.baseState=a,e.baseQueue=c,s.lastRenderedState=i}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Zm(e){var t=dn(),n=t.queue;if(n===null)throw Error(Te(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do i=e(i,a.action),a=a.next;while(a!==r);Ms(i,t.memoizedState)||(bn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function mT(e,t,n){var s=ot,r=dn(),i=St;if(i){if(n===void 0)throw Error(Te(407));n=n()}else n=t();var a=!Ms((Pt||r).memoizedState,n);if(a&&(r.memoizedState=n,bn=!0),r=r.queue,$y(xT.bind(null,s,r,e),[e]),r.getSnapshot!==t||a||pn!==null&&pn.memoizedState.tag&1){if(s.flags|=2048,Zo(9,{destroy:void 0},bT.bind(null,s,r,n,t),null),Ft===null)throw Error(Te(349));i||bi&127||gT(s,t,n)}return n}function gT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ot.updateQueue,t===null?(t=Yp(),ot.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bT(e,t,n,s){t.value=n,t.getSnapshot=s,yT(t)&&vT(e)}function xT(e,t,n){return n(function(){yT(t)&&vT(e)})}function yT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ms(e,n)}catch{return!0}}function vT(e){var t=zl(e,2);t!==null&&hs(t,e,2)}function pb(e){var t=Wn();if(typeof e=="function"){var n=e;if(e=n(),wl){oa(!0);try{n()}finally{oa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:e},t}function kT(e,t,n,s){return e.baseState=n,Hy(e,Pt,typeof s=="function"?s:xi)}function uI(e,t,n,s,r){if(Qp(e))throw Error(Te(485));if(e=t.action,e!==null){var i={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){i.listeners.push(a)}};tt.T!==null?n(!0):i.isTransition=!1,s(i),n=t.pending,n===null?(i.next=t.pending=i,wT(t,i)):(i.next=n.next,t.pending=n.next=i)}}function wT(e,t){var n=t.action,s=t.payload,r=e.state;if(t.isTransition){var i=tt.T,a={};tt.T=a;try{var l=n(r,s),c=tt.S;c!==null&&c(a,l),Dw(e,t,l)}catch(u){mb(e,t,u)}finally{i!==null&&a.types!==null&&(i.types=a.types),tt.T=i}}else try{i=n(r,s),Dw(e,t,i)}catch(u){mb(e,t,u)}}function Dw(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){Iw(e,t,s)},function(s){return mb(e,t,s)}):Iw(e,t,n)}function Iw(e,t,n){t.status="fulfilled",t.value=n,ST(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,wT(e,n)))}function mb(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,ST(t),t=t.next;while(t!==s)}e.action=null}function ST(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function NT(e,t){return t}function Lw(e,t){if(St){var n=Ft.formState;if(n!==null){e:{var s=ot;if(St){if(Yt){t:{for(var r=Yt,i=$s;r.nodeType!==8;){if(!i){r=null;break t}if(r=Ys(r.nextSibling),r===null){r=null;break t}}i=r.data,r=i==="F!"||i==="F"?r:null}if(r){Yt=Ys(r.nextSibling),s=r.data==="F!";break e}}Ea(s)}s=!1}s&&(t=n[0])}}return n=Wn(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:NT,lastRenderedState:t},n.queue=s,n=FT.bind(null,ot,s),s.dispatch=n,s=pb(!1),i=Yy.bind(null,ot,!1,s.queue),s=Wn(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,n=uI.bind(null,ot,r,i,n),r.dispatch=n,s.memoizedState=e,[t,n,!1]}function Pw(e){var t=dn();return ET(t,Pt,e)}function ET(e,t,n){if(t=Hy(e,t,NT)[0],e=mh(xi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Td(t)}catch(a){throw a===vc?qp:a}else s=t;t=dn();var r=t.queue,i=r.dispatch;return n!==t.memoizedState&&(ot.flags|=2048,Zo(9,{destroy:void 0},dI.bind(null,r,n),null)),[s,i,e]}function dI(e,t){e.action=t}function zw(e){var t=dn(),n=Pt;if(n!==null)return ET(t,n,e);dn(),t=t.memoizedState,n=dn();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function Zo(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=ot.updateQueue,t===null&&(t=Yp(),ot.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function _T(){return dn().memoizedState}function gh(e,t,n,s){var r=Wn();ot.flags|=e,r.memoizedState=Zo(1|t,{destroy:void 0},n,s===void 0?null:s)}function Xp(e,t,n,s){var r=dn();s=s===void 0?null:s;var i=r.memoizedState.inst;Pt!==null&&s!==null&&Ly(s,Pt.memoizedState.deps)?r.memoizedState=Zo(t,i,n,s):(ot.flags|=e,r.memoizedState=Zo(1|t,i,n,s))}function Uw(e,t){gh(8390656,8,e,t)}function $y(e,t){Xp(2048,8,e,t)}function fI(e){ot.flags|=4;var t=ot.updateQueue;if(t===null)t=Yp(),ot.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function CT(e){var t=dn().memoizedState;return fI({ref:t,nextImpl:e}),function(){if(Ct&2)throw Error(Te(440));return t.impl.apply(void 0,arguments)}}function TT(e,t){return Xp(4,2,e,t)}function AT(e,t){return Xp(4,4,e,t)}function MT(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jT(e,t,n){n=n!=null?n.concat([e]):null,Xp(4,4,MT.bind(null,t,e),n)}function Gy(){}function RT(e,t){var n=dn();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Ly(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function OT(e,t){var n=dn();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Ly(t,s[1]))return s[0];if(s=e(),wl){oa(!0);try{e()}finally{oa(!1)}}return n.memoizedState=[s,t],s}function Ky(e,t,n){return n===void 0||bi&1073741824&&!(bt&261930)?e.memoizedState=t:(e.memoizedState=n,e=k2(),ot.lanes|=e,Ca|=e,n)}function DT(e,t,n,s){return Ms(n,t)?n:Wo.current!==null?(e=Ky(e,n,s),Ms(e,t)||(bn=!0),e):!(bi&42)||bi&1073741824&&!(bt&261930)?(bn=!0,e.memoizedState=n):(e=k2(),ot.lanes|=e,Ca|=e,t)}function IT(e,t,n,s,r){var i=At.p;At.p=i!==0&&8>i?i:8;var a=tt.T,l={};tt.T=l,Yy(e,!1,t,n);try{var c=r(),u=tt.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=lI(c,s);pu(e,t,d,As(e))}else pu(e,t,s,As(e))}catch(f){pu(e,t,{then:function(){},status:"rejected",reason:f},As())}finally{At.p=i,a!==null&&l.types!==null&&(a.types=l.types),tt.T=a}}function hI(){}function gb(e,t,n,s){if(e.tag!==5)throw Error(Te(476));var r=LT(e).queue;IT(e,r,t,al,n===null?hI:function(){return PT(e),n(s)})}function LT(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:al,baseState:al,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:al},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function PT(e){var t=LT(e);t.next===null&&(t=e.alternate.memoizedState),pu(e,t.next.queue,{},As())}function qy(){return Un(Bu)}function zT(){return dn().memoizedState}function UT(){return dn().memoizedState}function pI(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=As();e=ba(n);var s=xa(t,e,n);s!==null&&(hs(s,t,n),du(s,t,n)),t={cache:jy()},e.payload=t;return}t=t.return}}function mI(e,t,n){var s=As();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Qp(e)?BT(t,n):(n=Cy(e,t,n,s),n!==null&&(hs(n,e,s),HT(n,t,s)))}function FT(e,t,n){var s=As();pu(e,t,n,s)}function pu(e,t,n,s){var r={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qp(e))BT(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(r.hasEagerState=!0,r.eagerState=l,Ms(l,a))return Kp(e,t,r,0),Ft===null&&Gp(),!1}catch{}finally{}if(n=Cy(e,t,r,s),n!==null)return hs(n,e,s),HT(n,t,s),!0}return!1}function Yy(e,t,n,s){if(s={lane:2,revertLane:nv(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Qp(e)){if(t)throw Error(Te(479))}else t=Cy(e,n,s,2),t!==null&&hs(t,e,2)}function Qp(e){var t=e.alternate;return e===ot||t!==null&&t===ot}function BT(e,t){So=Vh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function HT(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,CC(e,n)}}var zu={readContext:Un,use:Vp,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};zu.useEffectEvent=ln;var $T={readContext:Un,use:Vp,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:Un,useEffect:Uw,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,gh(4194308,4,MT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gh(4194308,4,e,t)},useInsertionEffect:function(e,t){gh(4,2,e,t)},useMemo:function(e,t){var n=Wn();t=t===void 0?null:t;var s=e();if(wl){oa(!0);try{e()}finally{oa(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=Wn();if(n!==void 0){var r=n(t);if(wl){oa(!0);try{n(t)}finally{oa(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=mI.bind(null,ot,e),[s.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:function(e){e=pb(e);var t=e.queue,n=FT.bind(null,ot,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gy,useDeferredValue:function(e,t){var n=Wn();return Ky(n,e,t)},useTransition:function(){var e=pb(!1);return e=IT.bind(null,ot,e.queue,!0,!1),Wn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=ot,r=Wn();if(St){if(n===void 0)throw Error(Te(407));n=n()}else{if(n=t(),Ft===null)throw Error(Te(349));bt&127||gT(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,Uw(xT.bind(null,s,i,e),[e]),s.flags|=2048,Zo(9,{destroy:void 0},bT.bind(null,s,i,n,t),null),n},useId:function(){var e=Wn(),t=Ft.identifierPrefix;if(St){var n=jr,s=Mr;n=(s&~(1<<32-Ts(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Xh++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=oI++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:qy,useFormState:Lw,useActionState:Lw,useOptimistic:function(e){var t=Wn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Yy.bind(null,ot,!0,n),n.dispatch=t,[e,t]},useMemoCache:By,useCacheRefresh:function(){return Wn().memoizedState=pI.bind(null,ot)},useEffectEvent:function(e){var t=Wn(),n={impl:e};return t.memoizedState=n,function(){if(Ct&2)throw Error(Te(440));return n.impl.apply(void 0,arguments)}}},Vy={readContext:Un,use:Vp,useCallback:RT,useContext:Un,useEffect:$y,useImperativeHandle:jT,useInsertionEffect:TT,useLayoutEffect:AT,useMemo:OT,useReducer:mh,useRef:_T,useState:function(){return mh(xi)},useDebugValue:Gy,useDeferredValue:function(e,t){var n=dn();return DT(n,Pt.memoizedState,e,t)},useTransition:function(){var e=mh(xi)[0],t=dn().memoizedState;return[typeof e=="boolean"?e:Td(e),t]},useSyncExternalStore:mT,useId:zT,useHostTransitionStatus:qy,useFormState:Pw,useActionState:Pw,useOptimistic:function(e,t){var n=dn();return kT(n,Pt,e,t)},useMemoCache:By,useCacheRefresh:UT};Vy.useEffectEvent=CT;var GT={readContext:Un,use:Vp,useCallback:RT,useContext:Un,useEffect:$y,useImperativeHandle:jT,useInsertionEffect:TT,useLayoutEffect:AT,useMemo:OT,useReducer:Zm,useRef:_T,useState:function(){return Zm(xi)},useDebugValue:Gy,useDeferredValue:function(e,t){var n=dn();return Pt===null?Ky(n,e,t):DT(n,Pt.memoizedState,e,t)},useTransition:function(){var e=Zm(xi)[0],t=dn().memoizedState;return[typeof e=="boolean"?e:Td(e),t]},useSyncExternalStore:mT,useId:zT,useHostTransitionStatus:qy,useFormState:zw,useActionState:zw,useOptimistic:function(e,t){var n=dn();return Pt!==null?kT(n,Pt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:By,useCacheRefresh:UT};GT.useEffectEvent=CT;function Jm(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:Xt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bb={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=As(),r=ba(s);r.payload=t,n!=null&&(r.callback=n),t=xa(e,r,s),t!==null&&(hs(t,e,s),du(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=As(),r=ba(s);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=xa(e,r,s),t!==null&&(hs(t,e,s),du(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=As(),s=ba(n);s.tag=2,t!=null&&(s.callback=t),t=xa(e,s,n),t!==null&&(hs(t,e,n),du(t,e,n))}};function Fw(e,t,n,s,r,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,a):t.prototype&&t.prototype.isPureReactComponent?!Ou(n,s)||!Ou(r,i):!0}function Bw(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&bb.enqueueReplaceState(t,t.state,null)}function Sl(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=Xt({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function KT(e){Bh(e)}function qT(e){console.error(e)}function YT(e){Bh(e)}function Qh(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Hw(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function xb(e,t,n){return n=ba(n),n.tag=3,n.payload={element:null},n.callback=function(){Qh(e,t)},n}function VT(e){return e=ba(e),e.tag=3,e}function XT(e,t,n,s){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=s.value;e.payload=function(){return r(i)},e.callback=function(){Hw(t,n,s)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){Hw(t,n,s),typeof r!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var l=s.stack;this.componentDidCatch(s.value,{componentStack:l!==null?l:""})})}function gI(e,t,n,s,r){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&yc(t,n,r,!0),n=js.current,n!==null){switch(n.tag){case 31:case 13:return qs===null?tp():n.alternate===null&&on===0&&(on=3),n.flags&=-257,n.flags|=65536,n.lanes=r,s===Kh?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),ug(e,s,r)),!1;case 22:return n.flags|=65536,s===Kh?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),ug(e,s,r)),!1}throw Error(Te(435,n.tag))}return ug(e,s,r),tp(),!1}if(St)return t=js.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==ib&&(e=Error(Te(422),{cause:s}),Iu(Hs(e,n)))):(s!==ib&&(t=Error(Te(423),{cause:s}),Iu(Hs(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=Hs(s,n),r=xb(e.stateNode,s,r),Wm(e,r),on!==4&&(on=2)),!1;var i=Error(Te(520),{cause:s});if(i=Hs(i,n),bu===null?bu=[i]:bu.push(i),on!==4&&(on=2),t===null)return!0;s=Hs(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=xb(n.stateNode,s,e),Wm(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(ya===null||!ya.has(i))))return n.flags|=65536,r&=-r,n.lanes|=r,r=VT(r),XT(r,e,n,s),Wm(n,r),!1}n=n.return}while(n!==null);return!1}var Xy=Error(Te(461)),bn=!1;function On(e,t,n,s){t.child=e===null?cT(t,null,n,s):kl(t,e.child,n,s)}function $w(e,t,n,s,r){n=n.render;var i=t.ref;if("ref"in s){var a={};for(var l in s)l!=="ref"&&(a[l]=s[l])}else a=s;return vl(t),s=Py(e,t,n,a,i,r),l=zy(),e!==null&&!bn?(Uy(e,t,r),yi(e,t,r)):(St&&l&&Ay(t),t.flags|=1,On(e,t,s,r),t.child)}function Gw(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!Ty(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,QT(e,t,i,s,r)):(e=hh(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Qy(e,r)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ou,n(a,s)&&e.ref===t.ref)return yi(e,t,r)}return t.flags|=1,e=fi(i,s),e.ref=t.ref,e.return=t,t.child=e}function QT(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(Ou(i,s)&&e.ref===t.ref)if(bn=!1,t.pendingProps=s=i,Qy(e,r))e.flags&131072&&(bn=!0);else return t.lanes=e.lanes,yi(e,t,r)}return yb(e,t,n,s,r)}function WT(e,t,n,s){var r=s.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if(t.flags&128){if(i=i!==null?i.baseLanes|n:n,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~i}else s=0,t.child=null;return Kw(e,t,i,n,s)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ph(t,i!==null?i.cachePool:null),i!==null?Ow(t,i):fb(),fT(t);else return s=t.lanes=536870912,Kw(e,t,i!==null?i.baseLanes|n:n,n,s)}else i!==null?(ph(t,i.cachePool),Ow(t,i),Zi(),t.memoizedState=null):(e!==null&&ph(t,null),fb(),Zi());return On(e,t,r,n),t.child}function Wc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kw(e,t,n,s,r){var i=Ry();return i=i===null?null:{parent:gn._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&ph(t,null),fb(),fT(t),e!==null&&yc(e,t,s,!0),t.childLanes=r,null}function bh(e,t){return t=Wh({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function qw(e,t,n){return kl(t,e.child,null,n),e=bh(t,t.pendingProps),e.flags|=2,ws(t),t.memoizedState=null,e}function bI(e,t,n){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(St){if(s.mode==="hidden")return e=bh(t,s),t.lanes=536870912,Wc(null,e);if(hb(t),(e=Yt)?(e=$2(e,$s),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:Mr,overflow:jr}:null,retryLane:536870912,hydrationErrors:null},n=nT(e),n.return=t,t.child=n,Pn=t,Yt=null)):e=null,e===null)throw Ea(t);return t.lanes=536870912,null}return bh(t,s)}var i=e.memoizedState;if(i!==null){var a=i.dehydrated;if(hb(t),r)if(t.flags&256)t.flags&=-257,t=qw(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(Te(558));else if(bn||yc(e,t,n,!1),r=(n&e.childLanes)!==0,bn||r){if(s=Ft,s!==null&&(a=TC(s,n),a!==0&&a!==i.retryLane))throw i.retryLane=a,zl(e,a),hs(s,e,a),Xy;tp(),t=qw(e,t,n)}else e=i.treeContext,Yt=Ys(a.nextSibling),Pn=t,St=!0,ga=null,$s=!1,e!==null&&rT(t,e),t=bh(t,s),t.flags|=4096;return t}return e=fi(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xh(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(Te(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function yb(e,t,n,s,r){return vl(t),n=Py(e,t,n,s,void 0,r),s=zy(),e!==null&&!bn?(Uy(e,t,r),yi(e,t,r)):(St&&s&&Ay(t),t.flags|=1,On(e,t,n,r),t.child)}function Yw(e,t,n,s,r,i){return vl(t),t.updateQueue=null,n=pT(t,s,n,r),hT(e),s=zy(),e!==null&&!bn?(Uy(e,t,i),yi(e,t,i)):(St&&s&&Ay(t),t.flags|=1,On(e,t,n,i),t.child)}function Vw(e,t,n,s,r){if(vl(t),t.stateNode===null){var i=co,a=n.contextType;typeof a=="object"&&a!==null&&(i=Un(a)),i=new n(s,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=bb,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=s,i.state=t.memoizedState,i.refs={},Dy(t),a=n.contextType,i.context=typeof a=="object"&&a!==null?Un(a):co,i.state=t.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(Jm(t,n,a,s),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(a=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),a!==i.state&&bb.enqueueReplaceState(i,i.state,null),hu(t,s,i,r),fu(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=Sl(n,l);i.props=c;var u=i.context,d=n.contextType;a=co,typeof d=="object"&&d!==null&&(a=Un(d));var f=n.getDerivedStateFromProps;d=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||u!==a)&&Bw(t,i,s,a),Yi=!1;var h=t.memoizedState;i.state=h,hu(t,s,i,r),fu(),u=t.memoizedState,l||h!==u||Yi?(typeof f=="function"&&(Jm(t,n,f,s),u=t.memoizedState),(c=Yi||Fw(t,n,c,s,h,u,a))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=u),i.props=s,i.state=u,i.context=a,s=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{i=t.stateNode,ub(e,t),a=t.memoizedProps,d=Sl(n,a),i.props=d,f=t.pendingProps,h=i.context,u=n.contextType,c=co,typeof u=="object"&&u!==null&&(c=Un(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==f||h!==c)&&Bw(t,i,s,c),Yi=!1,h=t.memoizedState,i.state=h,hu(t,s,i,r),fu();var p=t.memoizedState;a!==f||h!==p||Yi||e!==null&&e.dependencies!==null&&Gh(e.dependencies)?(typeof l=="function"&&(Jm(t,n,l,s),p=t.memoizedState),(d=Yi||Fw(t,n,d,s,h,p,c)||e!==null&&e.dependencies!==null&&Gh(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(s,p,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(s,p,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=p),i.props=s,i.state=p,i.context=c,s=d):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),s=!1)}return i=s,xh(e,t),s=(t.flags&128)!==0,i||s?(i=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&s?(t.child=kl(t,e.child,null,r),t.child=kl(t,null,n,r)):On(e,t,n,r),t.memoizedState=i.state,e=t.child):e=yi(e,t,r),e}function Xw(e,t,n,s){return yl(),t.flags|=256,On(e,t,n,s),t.child}var eg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tg(e){return{baseLanes:e,cachePool:aT()}}function ng(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Es),e}function ZT(e,t,n){var s=t.pendingProps,r=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(cn.current&2)!==0),a&&(r=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(St){if(r?Wi(t):Zi(),(e=Yt)?(e=$2(e,$s),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:Mr,overflow:jr}:null,retryLane:536870912,hydrationErrors:null},n=nT(e),n.return=t,t.child=n,Pn=t,Yt=null)):e=null,e===null)throw Ea(t);return Ob(e)?t.lanes=32:t.lanes=536870912,null}var l=s.children;return s=s.fallback,r?(Zi(),r=t.mode,l=Wh({mode:"hidden",children:l},r),s=ll(s,r,n,null),l.return=t,s.return=t,l.sibling=s,t.child=l,s=t.child,s.memoizedState=tg(n),s.childLanes=ng(e,a,n),t.memoizedState=eg,Wc(null,s)):(Wi(t),vb(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(Wi(t),t.flags&=-257,t=sg(e,t,n)):t.memoizedState!==null?(Zi(),t.child=e.child,t.flags|=128,t=null):(Zi(),l=s.fallback,r=t.mode,s=Wh({mode:"visible",children:s.children},r),l=ll(l,r,n,null),l.flags|=2,s.return=t,l.return=t,s.sibling=l,t.child=s,kl(t,e.child,null,n),s=t.child,s.memoizedState=tg(n),s.childLanes=ng(e,a,n),t.memoizedState=eg,t=Wc(null,s));else if(Wi(t),Ob(l)){if(a=l.nextSibling&&l.nextSibling.dataset,a)var u=a.dgst;a=u,s=Error(Te(419)),s.stack="",s.digest=a,Iu({value:s,source:null,stack:null}),t=sg(e,t,n)}else if(bn||yc(e,t,n,!1),a=(n&e.childLanes)!==0,bn||a){if(a=Ft,a!==null&&(s=TC(a,n),s!==0&&s!==c.retryLane))throw c.retryLane=s,zl(e,s),hs(a,e,s),Xy;Rb(l)||tp(),t=sg(e,t,n)}else Rb(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Yt=Ys(l.nextSibling),Pn=t,St=!0,ga=null,$s=!1,e!==null&&rT(t,e),t=vb(t,s.children),t.flags|=4096);return t}return r?(Zi(),l=s.fallback,r=t.mode,c=e.child,u=c.sibling,s=fi(c,{mode:"hidden",children:s.children}),s.subtreeFlags=c.subtreeFlags&65011712,u!==null?l=fi(u,l):(l=ll(l,r,n,null),l.flags|=2),l.return=t,s.return=t,s.sibling=l,t.child=s,Wc(null,s),s=t.child,l=e.child.memoizedState,l===null?l=tg(n):(r=l.cachePool,r!==null?(c=gn._currentValue,r=r.parent!==c?{parent:c,pool:c}:r):r=aT(),l={baseLanes:l.baseLanes|n,cachePool:r}),s.memoizedState=l,s.childLanes=ng(e,a,n),t.memoizedState=eg,Wc(e.child,s)):(Wi(t),n=e.child,e=n.sibling,n=fi(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=n,t.memoizedState=null,n)}function vb(e,t){return t=Wh({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Wh(e,t){return e=Ss(22,e,null,t),e.lanes=0,e}function sg(e,t,n){return kl(t,e.child,null,n),e=vb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qw(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),lb(e.return,t,n)}function rg(e,t,n,s,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r,treeForkCount:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=r,a.treeForkCount=i)}function JT(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=s.tail;s=s.children;var a=cn.current,l=(a&2)!==0;if(l?(a=a&1|2,t.flags|=128):a&=1,$t(cn,a),On(e,t,s,n),s=St?Du:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qw(e,n,t);else if(e.tag===19)Qw(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Yh(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),rg(t,!1,r,n,i,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Yh(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}rg(t,!0,n,null,i,s);break;case"together":rg(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function yi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ca|=t.lanes,!(n&t.childLanes))if(e!==null){if(yc(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(Te(153));if(t.child!==null){for(e=t.child,n=fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Qy(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Gh(e)))}function xI(e,t,n){switch(t.tag){case 3:Ph(t,t.stateNode.containerInfo),Qi(t,gn,e.memoizedState.cache),yl();break;case 27:case 5:V0(t);break;case 4:Ph(t,t.stateNode.containerInfo);break;case 10:Qi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hb(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Wi(t),t.flags|=128,null):n&t.child.childLanes?ZT(e,t,n):(Wi(t),e=yi(e,t,n),e!==null?e.sibling:null);Wi(t);break;case 19:var r=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(yc(e,t,n,!1),s=(n&t.childLanes)!==0),r){if(s)return JT(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),$t(cn,cn.current),s)break;return null;case 22:return t.lanes=0,WT(e,t,n,t.pendingProps);case 24:Qi(t,gn,e.memoizedState.cache)}return yi(e,t,n)}function e2(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)bn=!0;else{if(!Qy(e,n)&&!(t.flags&128))return bn=!1,xI(e,t,n);bn=!!(e.flags&131072)}else bn=!1,St&&t.flags&1048576&&sT(t,Du,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Ga(t.elementType),t.type=e,typeof e=="function")Ty(e)?(s=Sl(e,s),t.tag=1,t=Vw(null,t,e,s,n)):(t.tag=0,t=yb(null,t,e,s,n));else{if(e!=null){var r=e.$$typeof;if(r===py){t.tag=11,t=$w(null,t,e,s,n);break e}else if(r===my){t.tag=14,t=Gw(null,t,e,s,n);break e}}throw t=q0(e)||e,Error(Te(306,t,""))}}return t;case 0:return yb(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,r=Sl(s,t.pendingProps),Vw(e,t,s,r,n);case 3:e:{if(Ph(t,t.stateNode.containerInfo),e===null)throw Error(Te(387));s=t.pendingProps;var i=t.memoizedState;r=i.element,ub(e,t),hu(t,s,null,n);var a=t.memoizedState;if(s=a.cache,Qi(t,gn,s),s!==i.cache&&ob(t,[gn],n,!0),fu(),s=a.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Xw(e,t,s,n);break e}else if(s!==r){r=Hs(Error(Te(424)),t),Iu(r),t=Xw(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Yt=Ys(e.firstChild),Pn=t,St=!0,ga=null,$s=!0,n=cT(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(yl(),s===r){t=yi(e,t,n);break e}On(e,t,s,n)}t=t.child}return t;case 26:return xh(e,t),e===null?(n=g1(t.type,null,t.pendingProps,null))?t.memoizedState=n:St||(n=t.type,e=t.pendingProps,s=ip(ma.current).createElement(n),s[Ln]=t,s[ps]=e,Fn(s,n,e),jn(s),t.stateNode=s):t.memoizedState=g1(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return V0(t),e===null&&St&&(s=t.stateNode=G2(t.type,t.pendingProps,ma.current),Pn=t,$s=!0,r=Yt,Ra(t.type)?(Db=r,Yt=Ys(s.firstChild)):Yt=r),On(e,t,t.pendingProps.children,n),xh(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&St&&((r=s=Yt)&&(s=VI(s,t.type,t.pendingProps,$s),s!==null?(t.stateNode=s,Pn=t,Yt=Ys(s.firstChild),$s=!1,r=!0):r=!1),r||Ea(t)),V0(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,Mb(r,i)?s=null:a!==null&&Mb(r,a)&&(t.flags|=32),t.memoizedState!==null&&(r=Py(e,t,cI,null,null,n),Bu._currentValue=r),xh(e,t),On(e,t,s,n),t.child;case 6:return e===null&&St&&((e=n=Yt)&&(n=XI(n,t.pendingProps,$s),n!==null?(t.stateNode=n,Pn=t,Yt=null,e=!0):e=!1),e||Ea(t)),null;case 13:return ZT(e,t,n);case 4:return Ph(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=kl(t,null,s,n):On(e,t,s,n),t.child;case 11:return $w(e,t,t.type,t.pendingProps,n);case 7:return On(e,t,t.pendingProps,n),t.child;case 8:return On(e,t,t.pendingProps.children,n),t.child;case 12:return On(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,Qi(t,t.type,s.value),On(e,t,s.children,n),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,vl(t),r=Un(r),s=s(r),t.flags|=1,On(e,t,s,n),t.child;case 14:return Gw(e,t,t.type,t.pendingProps,n);case 15:return QT(e,t,t.type,t.pendingProps,n);case 19:return JT(e,t,n);case 31:return bI(e,t,n);case 22:return WT(e,t,n,t.pendingProps);case 24:return vl(t),s=Un(gn),e===null?(r=Ry(),r===null&&(r=Ft,i=jy(),r.pooledCache=i,i.refCount++,i!==null&&(r.pooledCacheLanes|=n),r=i),t.memoizedState={parent:s,cache:r},Dy(t),Qi(t,gn,r)):(e.lanes&n&&(ub(e,t),hu(t,null,null,n),fu()),r=e.memoizedState,i=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Qi(t,gn,s)):(s=i.cache,Qi(t,gn,s),s!==r.cache&&ob(t,[gn],n,!0))),On(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(Te(156,t.tag))}function Xr(e){e.flags|=4}function ig(e,t,n,s,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(N2())e.flags|=8192;else throw cl=Kh,Oy}else e.flags&=-16777217}function Ww(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Y2(t))if(N2())e.flags|=8192;else throw cl=Kh,Oy}function yf(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?EC():536870912,e.lanes|=t,Jo|=t)}function Pc(e,t){if(!St)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function yI(e,t,n){var s=t.pendingProps;switch(My(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(t),null;case 1:return Gt(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),hi(gn),Yo(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?Xr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Qm())),Gt(t),null;case 26:var r=t.type,i=t.memoizedState;return e===null?(Xr(t),i!==null?(Gt(t),Ww(t,i)):(Gt(t),ig(t,r,null,s,n))):i?i!==e.memoizedState?(Xr(t),Gt(t),Ww(t,i)):(Gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Xr(t),Gt(t),ig(t,r,e,s,n)),null;case 27:if(zh(t),n=ma.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xr(t);else{if(!s){if(t.stateNode===null)throw Error(Te(166));return Gt(t),null}e=Dr.current,Gl(t)?_w(t):(e=G2(r,s,n),t.stateNode=e,Xr(t))}return Gt(t),null;case 5:if(zh(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Xr(t);else{if(!s){if(t.stateNode===null)throw Error(Te(166));return Gt(t),null}if(i=Dr.current,Gl(t))_w(t);else{var a=ip(ma.current);switch(i){case 1:i=a.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:i=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":i=a.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":i=a.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":i=a.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof s.is=="string"?a.createElement("select",{is:s.is}):a.createElement("select"),s.multiple?i.multiple=!0:s.size&&(i.size=s.size);break;default:i=typeof s.is=="string"?a.createElement(r,{is:s.is}):a.createElement(r)}}i[Ln]=t,i[ps]=s;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)i.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=i;e:switch(Fn(i,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Xr(t)}}return Gt(t),ig(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Xr(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(Te(166));if(e=ma.current,Gl(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,r=Pn,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[Ln]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||F2(e.nodeValue,n)),e||Ea(t,!0)}else e=ip(e).createTextNode(s),e[Ln]=t,t.stateNode=e}return Gt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Gl(t),n!==null){if(e===null){if(!s)throw Error(Te(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Te(557));e[Ln]=t}else yl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gt(t),e=!1}else n=Qm(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ws(t),t):(ws(t),null);if(t.flags&128)throw Error(Te(558))}return Gt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Gl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(Te(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(Te(317));r[Ln]=t}else yl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Gt(t),r=!1}else r=Qm(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ws(t),t):(ws(t),null)}return ws(t),t.flags&128?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==r&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),yf(t,t.updateQueue),Gt(t),null);case 4:return Yo(),e===null&&sv(t.stateNode.containerInfo),Gt(t),null;case 10:return hi(t.type),Gt(t),null;case 19:if(Rn(cn),s=t.memoizedState,s===null)return Gt(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)Pc(s,!1);else{if(on!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Yh(e),i!==null){for(t.flags|=128,Pc(s,!1),e=i.updateQueue,t.updateQueue=e,yf(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)tT(n,e),n=n.sibling;return $t(cn,cn.current&1|2),St&&si(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&_s()>Jh&&(t.flags|=128,r=!0,Pc(s,!1),t.lanes=4194304)}else{if(!r)if(e=Yh(i),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,yf(t,e),Pc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!St)return Gt(t),null}else 2*_s()-s.renderingStartTime>Jh&&n!==536870912&&(t.flags|=128,r=!0,Pc(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(e=s.last,e!==null?e.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=_s(),e.sibling=null,n=cn.current,$t(cn,r?n&1|2:n&1),St&&si(t,s.treeForkCount),e):(Gt(t),null);case 22:case 23:return ws(t),Iy(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(Gt(t),t.subtreeFlags&6&&(t.flags|=8192)):Gt(t),n=t.updateQueue,n!==null&&yf(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&Rn(ol),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),hi(gn),Gt(t),null;case 25:return null;case 30:return null}throw Error(Te(156,t.tag))}function vI(e,t){switch(My(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hi(gn),Yo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return zh(t),null;case 31:if(t.memoizedState!==null){if(ws(t),t.alternate===null)throw Error(Te(340));yl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ws(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Te(340));yl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Rn(cn),null;case 4:return Yo(),null;case 10:return hi(t.type),null;case 22:case 23:return ws(t),Iy(),e!==null&&Rn(ol),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return hi(gn),null;case 25:return null;default:return null}}function t2(e,t){switch(My(t),t.tag){case 3:hi(gn),Yo();break;case 26:case 27:case 5:zh(t);break;case 4:Yo();break;case 31:t.memoizedState!==null&&ws(t);break;case 13:ws(t);break;case 19:Rn(cn);break;case 10:hi(t.type);break;case 22:case 23:ws(t),Iy(),e!==null&&Rn(ol);break;case 24:hi(gn)}}function Ad(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){s=void 0;var i=n.create,a=n.inst;s=i(),a.destroy=s}n=n.next}while(n!==r)}}catch(l){Rt(t,t.return,l)}}function _a(e,t,n){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var i=r.next;s=i;do{if((s.tag&e)===e){var a=s.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,r=t;var c=n,u=l;try{u()}catch(d){Rt(r,c,d)}}}s=s.next}while(s!==i)}}catch(d){Rt(t,t.return,d)}}function n2(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{dT(t,n)}catch(s){Rt(e,e.return,s)}}}function s2(e,t,n){n.props=Sl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Rt(e,t,s)}}function mu(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(r){Rt(e,t,r)}}function Rr(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(r){Rt(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Rt(e,t,r)}else n.current=null}function r2(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(r){Rt(e,e.return,r)}}function ag(e,t,n){try{var s=e.stateNode;HI(s,e.type,n,t),s[ps]=t}catch(r){Rt(e,e.return,r)}}function i2(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ra(e.type)||e.tag===4}function lg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||i2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ra(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kb(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ci));else if(s!==4&&(s===27&&Ra(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(kb(e,t,n),e=e.sibling;e!==null;)kb(e,t,n),e=e.sibling}function Zh(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Ra(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zh(e,t,n),e=e.sibling;e!==null;)Zh(e,t,n),e=e.sibling}function a2(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Fn(t,s,n),t[Ln]=e,t[ps]=n}catch(i){Rt(e,e.return,i)}}var ai=!1,mn=!1,og=!1,Zw=typeof WeakSet=="function"?WeakSet:Set,An=null;function kI(e,t){if(e=e.containerInfo,Tb=cp,e=YC(e),Ey(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||r!==0&&f.nodeType!==3||(l=a+r),f!==i||s!==0&&f.nodeType!==3||(c=a+s),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=a),h===i&&++d===s&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ab={focusedElem:e,selectionRange:n},cp=!1,An=t;An!==null;)if(t=An,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,An=e;else for(;An!==null;){switch(t=An,i=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)r=e[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&i!==null){e=void 0,n=t,r=i.memoizedProps,i=i.memoizedState,s=n.stateNode;try{var m=Sl(n.type,r);e=s.getSnapshotBeforeUpdate(m,i),s.__reactInternalSnapshotBeforeUpdate=e}catch(k){Rt(n,n.return,k)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)jb(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":jb(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(Te(163))}if(e=t.sibling,e!==null){e.return=t.return,An=e;break}An=t.return}}function l2(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:Wr(e,n),s&4&&Ad(5,n);break;case 1:if(Wr(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(a){Rt(n,n.return,a)}else{var r=Sl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){Rt(n,n.return,a)}}s&64&&n2(n),s&512&&mu(n,n.return);break;case 3:if(Wr(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{dT(e,t)}catch(a){Rt(n,n.return,a)}}break;case 27:t===null&&s&4&&a2(n);case 26:case 5:Wr(e,n),t===null&&s&4&&r2(n),s&512&&mu(n,n.return);break;case 12:Wr(e,n);break;case 31:Wr(e,n),s&4&&u2(e,n);break;case 13:Wr(e,n),s&4&&d2(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=MI.bind(null,n),QI(e,n))));break;case 22:if(s=n.memoizedState!==null||ai,!s){t=t!==null&&t.memoizedState!==null||mn,r=ai;var i=mn;ai=s,(mn=t)&&!i?ti(e,n,(n.subtreeFlags&8772)!==0):Wr(e,n),ai=r,mn=i}break;case 30:break;default:Wr(e,n)}}function o2(e){var t=e.alternate;t!==null&&(e.alternate=null,o2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&yy(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Jt=null,cs=!1;function Qr(e,t,n){for(n=n.child;n!==null;)c2(e,t,n),n=n.sibling}function c2(e,t,n){if(Cs&&typeof Cs.onCommitFiberUnmount=="function")try{Cs.onCommitFiberUnmount(wd,n)}catch{}switch(n.tag){case 26:mn||Rr(n,t),Qr(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:mn||Rr(n,t);var s=Jt,r=cs;Ra(n.type)&&(Jt=n.stateNode,cs=!1),Qr(e,t,n),yu(n.stateNode),Jt=s,cs=r;break;case 5:mn||Rr(n,t);case 6:if(s=Jt,r=cs,Jt=null,Qr(e,t,n),Jt=s,cs=r,Jt!==null)if(cs)try{(Jt.nodeType===9?Jt.body:Jt.nodeName==="HTML"?Jt.ownerDocument.body:Jt).removeChild(n.stateNode)}catch(i){Rt(n,t,i)}else try{Jt.removeChild(n.stateNode)}catch(i){Rt(n,t,i)}break;case 18:Jt!==null&&(cs?(e=Jt,d1(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),sc(e)):d1(Jt,n.stateNode));break;case 4:s=Jt,r=cs,Jt=n.stateNode.containerInfo,cs=!0,Qr(e,t,n),Jt=s,cs=r;break;case 0:case 11:case 14:case 15:_a(2,n,t),mn||_a(4,n,t),Qr(e,t,n);break;case 1:mn||(Rr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&s2(n,t,s)),Qr(e,t,n);break;case 21:Qr(e,t,n);break;case 22:mn=(s=mn)||n.memoizedState!==null,Qr(e,t,n),mn=s;break;default:Qr(e,t,n)}}function u2(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{sc(e)}catch(n){Rt(t,t.return,n)}}}function d2(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{sc(e)}catch(n){Rt(t,t.return,n)}}function wI(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zw),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zw),t;default:throw Error(Te(435,e.tag))}}function vf(e,t){var n=wI(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var r=jI.bind(null,e,s);s.then(r,r)}})}function as(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s],i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 27:if(Ra(l.type)){Jt=l.stateNode,cs=!1;break e}break;case 5:Jt=l.stateNode,cs=!1;break e;case 3:case 4:Jt=l.stateNode.containerInfo,cs=!0;break e}l=l.return}if(Jt===null)throw Error(Te(160));c2(i,a,r),Jt=null,cs=!1,i=r.alternate,i!==null&&(i.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)f2(t,e),t=t.sibling}var nr=null;function f2(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:as(t,e),ls(e),s&4&&(_a(3,e,e.return),Ad(3,e),_a(5,e,e.return));break;case 1:as(t,e),ls(e),s&512&&(mn||n===null||Rr(n,n.return)),s&64&&ai&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var r=nr;if(as(t,e),ls(e),s&512&&(mn||n===null||Rr(n,n.return)),s&4){var i=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(s){case"title":i=r.getElementsByTagName("title")[0],(!i||i[Ed]||i[Ln]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=r.createElement(s),r.head.insertBefore(i,r.querySelector("head > title"))),Fn(i,s,n),i[Ln]=e,jn(i),s=i;break e;case"link":var a=x1("link","href",r).get(s+(n.href||""));if(a){for(var l=0;l<a.length;l++)if(i=a[l],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(l,1);break t}}i=r.createElement(s),Fn(i,s,n),r.head.appendChild(i);break;case"meta":if(a=x1("meta","content",r).get(s+(n.content||""))){for(l=0;l<a.length;l++)if(i=a[l],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(l,1);break t}}i=r.createElement(s),Fn(i,s,n),r.head.appendChild(i);break;default:throw Error(Te(468,s))}i[Ln]=e,jn(i),s=i}e.stateNode=s}else y1(r,e.type,e.stateNode);else e.stateNode=b1(r,s,e.memoizedProps);else i!==s?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,s===null?y1(r,e.type,e.stateNode):b1(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&ag(e,e.memoizedProps,n.memoizedProps)}break;case 27:as(t,e),ls(e),s&512&&(mn||n===null||Rr(n,n.return)),n!==null&&s&4&&ag(e,e.memoizedProps,n.memoizedProps);break;case 5:if(as(t,e),ls(e),s&512&&(mn||n===null||Rr(n,n.return)),e.flags&32){r=e.stateNode;try{Xo(r,"")}catch(m){Rt(e,e.return,m)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,ag(e,r,n!==null?n.memoizedProps:r)),s&1024&&(og=!0);break;case 6:if(as(t,e),ls(e),s&4){if(e.stateNode===null)throw Error(Te(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(m){Rt(e,e.return,m)}}break;case 3:if(kh=null,r=nr,nr=ap(t.containerInfo),as(t,e),nr=r,ls(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{sc(t.containerInfo)}catch(m){Rt(e,e.return,m)}og&&(og=!1,h2(e));break;case 4:s=nr,nr=ap(e.stateNode.containerInfo),as(t,e),ls(e),nr=s;break;case 12:as(t,e),ls(e);break;case 31:as(t,e),ls(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,vf(e,s)));break;case 13:as(t,e),ls(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Wp=_s()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,vf(e,s)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,u=ai,d=mn;if(ai=u||r,mn=d||c,as(t,e),mn=d,ai=u,ls(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||ai||mn||Ka(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(i=c.stateNode,r)a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{l=c.stateNode;var f=c.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(m){Rt(c,c.return,m)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(m){Rt(c,c.return,m)}}}else if(t.tag===18){if(n===null){c=t;try{var p=c.stateNode;r?f1(p,!0):f1(c.stateNode,!1)}catch(m){Rt(c,c.return,m)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,vf(e,n))));break;case 19:as(t,e),ls(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,vf(e,s)));break;case 30:break;case 21:break;default:as(t,e),ls(e)}}function ls(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(i2(s)){n=s;break}s=s.return}if(n==null)throw Error(Te(160));switch(n.tag){case 27:var r=n.stateNode,i=lg(e);Zh(e,i,r);break;case 5:var a=n.stateNode;n.flags&32&&(Xo(a,""),n.flags&=-33);var l=lg(e);Zh(e,l,a);break;case 3:case 4:var c=n.stateNode.containerInfo,u=lg(e);kb(e,u,c);break;default:throw Error(Te(161))}}catch(d){Rt(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function h2(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;h2(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)l2(e,t.alternate,t),t=t.sibling}function Ka(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_a(4,t,t.return),Ka(t);break;case 1:Rr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&s2(t,t.return,n),Ka(t);break;case 27:yu(t.stateNode);case 26:case 5:Rr(t,t.return),Ka(t);break;case 22:t.memoizedState===null&&Ka(t);break;case 30:Ka(t);break;default:Ka(t)}e=e.sibling}}function ti(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,i=t,a=i.flags;switch(i.tag){case 0:case 11:case 15:ti(r,i,n),Ad(4,i);break;case 1:if(ti(r,i,n),s=i,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(u){Rt(s,s.return,u)}if(s=i,r=s.updateQueue,r!==null){var l=s.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)uT(c[r],l)}catch(u){Rt(s,s.return,u)}}n&&a&64&&n2(i),mu(i,i.return);break;case 27:a2(i);case 26:case 5:ti(r,i,n),n&&s===null&&a&4&&r2(i),mu(i,i.return);break;case 12:ti(r,i,n);break;case 31:ti(r,i,n),n&&a&4&&u2(r,i);break;case 13:ti(r,i,n),n&&a&4&&d2(r,i);break;case 22:i.memoizedState===null&&ti(r,i,n),mu(i,i.return);break;case 30:break;default:ti(r,i,n)}t=t.sibling}}function Wy(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Cd(n))}function Zy(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cd(e))}function Js(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)p2(e,t,n,s),t=t.sibling}function p2(e,t,n,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Js(e,t,n,s),r&2048&&Ad(9,t);break;case 1:Js(e,t,n,s);break;case 3:Js(e,t,n,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cd(e)));break;case 12:if(r&2048){Js(e,t,n,s),e=t.stateNode;try{var i=t.memoizedProps,a=i.id,l=i.onPostCommit;typeof l=="function"&&l(a,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Rt(t,t.return,c)}}else Js(e,t,n,s);break;case 31:Js(e,t,n,s);break;case 13:Js(e,t,n,s);break;case 23:break;case 22:i=t.stateNode,a=t.alternate,t.memoizedState!==null?i._visibility&2?Js(e,t,n,s):gu(e,t):i._visibility&2?Js(e,t,n,s):(i._visibility|=2,Ql(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Wy(a,t);break;case 24:Js(e,t,n,s),r&2048&&Zy(t.alternate,t);break;default:Js(e,t,n,s)}}function Ql(e,t,n,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,a=t,l=n,c=s,u=a.flags;switch(a.tag){case 0:case 11:case 15:Ql(i,a,l,c,r),Ad(8,a);break;case 23:break;case 22:var d=a.stateNode;a.memoizedState!==null?d._visibility&2?Ql(i,a,l,c,r):gu(i,a):(d._visibility|=2,Ql(i,a,l,c,r)),r&&u&2048&&Wy(a.alternate,a);break;case 24:Ql(i,a,l,c,r),r&&u&2048&&Zy(a.alternate,a);break;default:Ql(i,a,l,c,r)}t=t.sibling}}function gu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,r=s.flags;switch(s.tag){case 22:gu(n,s),r&2048&&Wy(s.alternate,s);break;case 24:gu(n,s),r&2048&&Zy(s.alternate,s);break;default:gu(n,s)}t=t.sibling}}var Zc=8192;function Kl(e,t,n){if(e.subtreeFlags&Zc)for(e=e.child;e!==null;)m2(e,t,n),e=e.sibling}function m2(e,t,n){switch(e.tag){case 26:Kl(e,t,n),e.flags&Zc&&e.memoizedState!==null&&o4(n,nr,e.memoizedState,e.memoizedProps);break;case 5:Kl(e,t,n);break;case 3:case 4:var s=nr;nr=ap(e.stateNode.containerInfo),Kl(e,t,n),nr=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Zc,Zc=16777216,Kl(e,t,n),Zc=s):Kl(e,t,n));break;default:Kl(e,t,n)}}function g2(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function zc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];An=s,x2(s,e)}g2(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)b2(e),e=e.sibling}function b2(e){switch(e.tag){case 0:case 11:case 15:zc(e),e.flags&2048&&_a(9,e,e.return);break;case 3:zc(e);break;case 12:zc(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,yh(e)):zc(e);break;default:zc(e)}}function yh(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];An=s,x2(s,e)}g2(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_a(8,t,t.return),yh(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,yh(t));break;default:yh(t)}e=e.sibling}}function x2(e,t){for(;An!==null;){var n=An;switch(n.tag){case 0:case 11:case 15:_a(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Cd(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,An=s;else e:for(n=e;An!==null;){s=An;var r=s.sibling,i=s.return;if(o2(s),s===n){An=null;break e}if(r!==null){r.return=i,An=r;break e}An=i}}}var SI={getCacheForType:function(e){var t=Un(gn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Un(gn).controller.signal}},NI=typeof WeakMap=="function"?WeakMap:Map,Ct=0,Ft=null,pt=null,bt=0,jt=0,ks=null,ua=!1,kc=!1,Jy=!1,vi=0,on=0,Ca=0,ul=0,ev=0,Es=0,Jo=0,bu=null,us=null,wb=!1,Wp=0,y2=0,Jh=1/0,ep=null,ya=null,Nn=0,va=null,ec=null,pi=0,Sb=0,Nb=null,v2=null,xu=0,Eb=null;function As(){return Ct&2&&bt!==0?bt&-bt:tt.T!==null?nv():AC()}function k2(){if(Es===0)if(!(bt&536870912)||St){var e=ff;ff<<=1,!(ff&3932160)&&(ff=262144),Es=e}else Es=536870912;return e=js.current,e!==null&&(e.flags|=32),Es}function hs(e,t,n){(e===Ft&&(jt===2||jt===9)||e.cancelPendingCommit!==null)&&(tc(e,0),da(e,bt,Es,!1)),Nd(e,n),(!(Ct&2)||e!==Ft)&&(e===Ft&&(!(Ct&2)&&(ul|=n),on===4&&da(e,bt,Es,!1)),zr(e))}function w2(e,t,n){if(Ct&6)throw Error(Te(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Sd(e,t),r=s?CI(e,t):cg(e,t,!0),i=s;do{if(r===0){kc&&!s&&da(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!EI(n)){r=cg(e,t,!1),i=!1;continue}if(r===2){if(i=t,e.errorRecoveryDisabledLanes&i)var a=0;else a=e.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){t=a;e:{var l=e;r=bu;var c=l.current.memoizedState.isDehydrated;if(c&&(tc(l,a).flags|=256),a=cg(l,a,!1),a!==2){if(Jy&&!c){l.errorRecoveryDisabledLanes|=i,ul|=i,r=4;break e}i=us,us=r,i!==null&&(us===null?us=i:us.push.apply(us,i))}r=a}if(i=!1,r!==2)continue}}if(r===1){tc(e,0),da(e,t,0,!0);break}e:{switch(s=e,i=r,i){case 0:case 1:throw Error(Te(345));case 4:if((t&4194048)!==t)break;case 6:da(s,t,Es,!ua);break e;case 2:us=null;break;case 3:case 5:break;default:throw Error(Te(329))}if((t&62914560)===t&&(r=Wp+300-_s(),10<r)){if(da(s,t,Es,!ua),Fp(s,0,!0)!==0)break e;pi=t,s.timeoutHandle=H2(Jw.bind(null,s,n,us,ep,wb,t,Es,ul,Jo,ua,i,"Throttled",-0,0),r);break e}Jw(s,n,us,ep,wb,t,Es,ul,Jo,ua,i,null,-0,0)}}break}while(!0);zr(e)}function Jw(e,t,n,s,r,i,a,l,c,u,d,f,h,p){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ci},m2(t,i,f);var m=(i&62914560)===i?Wp-_s():(i&4194048)===i?y2-_s():0;if(m=c4(f,m),m!==null){pi=i,e.cancelPendingCommit=m(t1.bind(null,e,t,i,n,s,r,a,l,c,d,f,null,h,p)),da(e,i,a,!u);return}}t1(e,t,i,n,s,r,a,l,c)}function EI(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!Ms(i(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function da(e,t,n,s){t&=~ev,t&=~ul,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var i=31-Ts(r),a=1<<i;s[i]=-1,r&=~a}n!==0&&_C(e,n,t)}function Zp(){return Ct&6?!0:(Md(0),!1)}function tv(){if(pt!==null){if(jt===0)var e=pt.return;else e=pt,ui=Ul=null,Fy(e),wo=null,Lu=0,e=pt;for(;e!==null;)t2(e.alternate,e),e=e.return;pt=null}}function tc(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,KI(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),pi=0,tv(),Ft=e,pt=n=fi(e.current,null),bt=t,jt=0,ks=null,ua=!1,kc=Sd(e,t),Jy=!1,Jo=Es=ev=ul=Ca=on=0,us=bu=null,wb=!1,t&8&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-Ts(s),i=1<<r;t|=e[r],s&=~i}return vi=t,Gp(),n}function S2(e,t){ot=null,tt.H=zu,t===vc||t===qp?(t=jw(),jt=3):t===Oy?(t=jw(),jt=4):jt=t===Xy?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ks=t,pt===null&&(on=1,Qh(e,Hs(t,e.current)))}function N2(){var e=js.current;return e===null?!0:(bt&4194048)===bt?qs===null:(bt&62914560)===bt||bt&536870912?e===qs:!1}function E2(){var e=tt.H;return tt.H=zu,e===null?zu:e}function _2(){var e=tt.A;return tt.A=SI,e}function tp(){on=4,ua||(bt&4194048)!==bt&&js.current!==null||(kc=!0),!(Ca&134217727)&&!(ul&134217727)||Ft===null||da(Ft,bt,Es,!1)}function cg(e,t,n){var s=Ct;Ct|=2;var r=E2(),i=_2();(Ft!==e||bt!==t)&&(ep=null,tc(e,t)),t=!1;var a=on;e:do try{if(jt!==0&&pt!==null){var l=pt,c=ks;switch(jt){case 8:tv(),a=6;break e;case 3:case 2:case 9:case 6:js.current===null&&(t=!0);var u=jt;if(jt=0,ks=null,ho(e,l,c,u),n&&kc){a=0;break e}break;default:u=jt,jt=0,ks=null,ho(e,l,c,u)}}_I(),a=on;break}catch(d){S2(e,d)}while(!0);return t&&e.shellSuspendCounter++,ui=Ul=null,Ct=s,tt.H=r,tt.A=i,pt===null&&(Ft=null,bt=0,Gp()),a}function _I(){for(;pt!==null;)C2(pt)}function CI(e,t){var n=Ct;Ct|=2;var s=E2(),r=_2();Ft!==e||bt!==t?(ep=null,Jh=_s()+500,tc(e,t)):kc=Sd(e,t);e:do try{if(jt!==0&&pt!==null){t=pt;var i=ks;t:switch(jt){case 1:jt=0,ks=null,ho(e,t,i,1);break;case 2:case 9:if(Mw(i)){jt=0,ks=null,e1(t);break}t=function(){jt!==2&&jt!==9||Ft!==e||(jt=7),zr(e)},i.then(t,t);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:Mw(i)?(jt=0,ks=null,e1(t)):(jt=0,ks=null,ho(e,t,i,7));break;case 5:var a=null;switch(pt.tag){case 26:a=pt.memoizedState;case 5:case 27:var l=pt;if(a?Y2(a):l.stateNode.complete){jt=0,ks=null;var c=l.sibling;if(c!==null)pt=c;else{var u=l.return;u!==null?(pt=u,Jp(u)):pt=null}break t}}jt=0,ks=null,ho(e,t,i,5);break;case 6:jt=0,ks=null,ho(e,t,i,6);break;case 8:tv(),on=6;break e;default:throw Error(Te(462))}}TI();break}catch(d){S2(e,d)}while(!0);return ui=Ul=null,tt.H=s,tt.A=r,Ct=n,pt!==null?0:(Ft=null,bt=0,Gp(),on)}function TI(){for(;pt!==null&&!WO();)C2(pt)}function C2(e){var t=e2(e.alternate,e,vi);e.memoizedProps=e.pendingProps,t===null?Jp(e):pt=t}function e1(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Yw(n,t,t.pendingProps,t.type,void 0,bt);break;case 11:t=Yw(n,t,t.pendingProps,t.type.render,t.ref,bt);break;case 5:Fy(t);default:t2(n,t),t=pt=tT(t,vi),t=e2(n,t,vi)}e.memoizedProps=e.pendingProps,t===null?Jp(e):pt=t}function ho(e,t,n,s){ui=Ul=null,Fy(t),wo=null,Lu=0;var r=t.return;try{if(gI(e,r,t,n,bt)){on=1,Qh(e,Hs(n,e.current)),pt=null;return}}catch(i){if(r!==null)throw pt=r,i;on=1,Qh(e,Hs(n,e.current)),pt=null;return}t.flags&32768?(St||s===1?e=!0:kc||bt&536870912?e=!1:(ua=e=!0,(s===2||s===9||s===3||s===6)&&(s=js.current,s!==null&&s.tag===13&&(s.flags|=16384))),T2(t,e)):Jp(t)}function Jp(e){var t=e;do{if(t.flags&32768){T2(t,ua);return}e=t.return;var n=yI(t.alternate,t,vi);if(n!==null){pt=n;return}if(t=t.sibling,t!==null){pt=t;return}pt=t=e}while(t!==null);on===0&&(on=5)}function T2(e,t){do{var n=vI(e.alternate,e);if(n!==null){n.flags&=32767,pt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){pt=e;return}pt=e=n}while(e!==null);on=6,pt=null}function t1(e,t,n,s,r,i,a,l,c){e.cancelPendingCommit=null;do em();while(Nn!==0);if(Ct&6)throw Error(Te(327));if(t!==null){if(t===e.current)throw Error(Te(177));if(i=t.lanes|t.childLanes,i|=_y,lD(e,n,i,a,l,c),e===Ft&&(pt=Ft=null,bt=0),ec=t,va=e,pi=n,Sb=i,Nb=r,v2=s,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,RI(Uh,function(){return O2(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,t.subtreeFlags&13878||s){s=tt.T,tt.T=null,r=At.p,At.p=2,a=Ct,Ct|=4;try{kI(e,t,n)}finally{Ct=a,At.p=r,tt.T=s}}Nn=1,A2(),M2(),j2()}}function A2(){if(Nn===1){Nn=0;var e=va,t=ec,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=tt.T,tt.T=null;var s=At.p;At.p=2;var r=Ct;Ct|=4;try{f2(t,e);var i=Ab,a=YC(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(a!==l&&l&&l.ownerDocument&&qC(l.ownerDocument.documentElement,l)){if(c!==null&&Ey(l)){var u=c.start,d=c.end;if(d===void 0&&(d=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(d,l.value.length);else{var f=l.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var p=h.getSelection(),m=l.textContent.length,k=Math.min(c.start,m),w=c.end===void 0?k:Math.min(c.end,m);!p.extend&&k>w&&(a=w,w=k,k=a);var g=Sw(l,k),y=Sw(l,w);if(g&&y&&(p.rangeCount!==1||p.anchorNode!==g.node||p.anchorOffset!==g.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var b=f.createRange();b.setStart(g.node,g.offset),p.removeAllRanges(),k>w?(p.addRange(b),p.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),p.addRange(b))}}}}for(f=[],p=l;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var S=f[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}cp=!!Tb,Ab=Tb=null}finally{Ct=r,At.p=s,tt.T=n}}e.current=t,Nn=2}}function M2(){if(Nn===2){Nn=0;var e=va,t=ec,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=tt.T,tt.T=null;var s=At.p;At.p=2;var r=Ct;Ct|=4;try{l2(e,t.alternate,t)}finally{Ct=r,At.p=s,tt.T=n}}Nn=3}}function j2(){if(Nn===4||Nn===3){Nn=0,ZO();var e=va,t=ec,n=pi,s=v2;t.subtreeFlags&10256||t.flags&10256?Nn=5:(Nn=0,ec=va=null,R2(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(ya=null),xy(n),t=t.stateNode,Cs&&typeof Cs.onCommitFiberRoot=="function")try{Cs.onCommitFiberRoot(wd,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=tt.T,r=At.p,At.p=2,tt.T=null;try{for(var i=e.onRecoverableError,a=0;a<s.length;a++){var l=s[a];i(l.value,{componentStack:l.stack})}}finally{tt.T=t,At.p=r}}pi&3&&em(),zr(e),r=e.pendingLanes,n&261930&&r&42?e===Eb?xu++:(xu=0,Eb=e):xu=0,Md(0)}}function R2(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Cd(t)))}function em(){return A2(),M2(),j2(),O2()}function O2(){if(Nn!==5)return!1;var e=va,t=Sb;Sb=0;var n=xy(pi),s=tt.T,r=At.p;try{At.p=32>n?32:n,tt.T=null,n=Nb,Nb=null;var i=va,a=pi;if(Nn=0,ec=va=null,pi=0,Ct&6)throw Error(Te(331));var l=Ct;if(Ct|=4,b2(i.current),p2(i,i.current,a,n),Ct=l,Md(0,!1),Cs&&typeof Cs.onPostCommitFiberRoot=="function")try{Cs.onPostCommitFiberRoot(wd,i)}catch{}return!0}finally{At.p=r,tt.T=s,R2(e,t)}}function n1(e,t,n){t=Hs(n,t),t=xb(e.stateNode,t,2),e=xa(e,t,2),e!==null&&(Nd(e,2),zr(e))}function Rt(e,t,n){if(e.tag===3)n1(e,e,n);else for(;t!==null;){if(t.tag===3){n1(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ya===null||!ya.has(s))){e=Hs(n,e),n=VT(2),s=xa(t,n,2),s!==null&&(XT(n,s,t,e),Nd(s,2),zr(s));break}}t=t.return}}function ug(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new NI;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(Jy=!0,r.add(n),e=AI.bind(null,e,t,n),t.then(e,e))}function AI(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ft===e&&(bt&n)===n&&(on===4||on===3&&(bt&62914560)===bt&&300>_s()-Wp?!(Ct&2)&&tc(e,0):ev|=n,Jo===bt&&(Jo=0)),zr(e)}function D2(e,t){t===0&&(t=EC()),e=zl(e,t),e!==null&&(Nd(e,t),zr(e))}function MI(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),D2(e,n)}function jI(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(Te(314))}s!==null&&s.delete(t),D2(e,n)}function RI(e,t){return gy(e,t)}var np=null,Wl=null,_b=!1,sp=!1,dg=!1,fa=0;function zr(e){e!==Wl&&e.next===null&&(Wl===null?np=Wl=e:Wl=Wl.next=e),sp=!0,_b||(_b=!0,DI())}function Md(e,t){if(!dg&&sp){dg=!0;do for(var n=!1,s=np;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var i=0;else{var a=s.suspendedLanes,l=s.pingedLanes;i=(1<<31-Ts(42|e)+1)-1,i&=r&~(a&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,s1(s,i))}else i=bt,i=Fp(s,s===Ft?i:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(i&3)||Sd(s,i)||(n=!0,s1(s,i));s=s.next}while(n);dg=!1}}function OI(){I2()}function I2(){sp=_b=!1;var e=0;fa!==0&&GI()&&(e=fa);for(var t=_s(),n=null,s=np;s!==null;){var r=s.next,i=L2(s,t);i===0?(s.next=null,n===null?np=r:n.next=r,r===null&&(Wl=n)):(n=s,(e!==0||i&3)&&(sp=!0)),s=r}Nn!==0&&Nn!==5||Md(e),fa!==0&&(fa=0)}function L2(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var a=31-Ts(i),l=1<<a,c=r[a];c===-1?(!(l&n)||l&s)&&(r[a]=aD(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=Ft,n=bt,n=Fp(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(jt===2||jt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Um(s),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Sd(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Um(s),xy(n)){case 2:case 8:n=SC;break;case 32:n=Uh;break;case 268435456:n=NC;break;default:n=Uh}return s=P2.bind(null,e),n=gy(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Um(s),e.callbackPriority=2,e.callbackNode=null,2}function P2(e,t){if(Nn!==0&&Nn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(em()&&e.callbackNode!==n)return null;var s=bt;return s=Fp(e,e===Ft?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(w2(e,s,t),L2(e,_s()),e.callbackNode!=null&&e.callbackNode===n?P2.bind(null,e):null)}function s1(e,t){if(em())return null;w2(e,t,!0)}function DI(){qI(function(){Ct&6?gy(wC,OI):I2()})}function nv(){if(fa===0){var e=Qo;e===0&&(e=df,df<<=1,!(df&261888)&&(df=256)),fa=e}return fa}function r1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:uh(""+e)}function i1(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function II(e,t,n,s,r){if(t==="submit"&&n&&n.stateNode===r){var i=r1((r[ps]||null).action),a=s.submitter;a&&(t=(t=a[ps]||null)?r1(t.formAction):a.getAttribute("formAction"),t!==null&&(i=t,a=null));var l=new Bp("action","action",null,s,r);e.push({event:l,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(fa!==0){var c=a?i1(r,a):new FormData(r);gb(n,{pending:!0,data:c,method:r.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=a?i1(r,a):new FormData(r),gb(n,{pending:!0,data:c,method:r.method,action:i},i,c))},currentTarget:r}]})}}for(var fg=0;fg<rb.length;fg++){var hg=rb[fg],LI=hg.toLowerCase(),PI=hg[0].toUpperCase()+hg.slice(1);pr(LI,"on"+PI)}pr(XC,"onAnimationEnd");pr(QC,"onAnimationIteration");pr(WC,"onAnimationStart");pr("dblclick","onDoubleClick");pr("focusin","onFocus");pr("focusout","onBlur");pr(JD,"onTransitionRun");pr(eI,"onTransitionStart");pr(tI,"onTransitionCancel");pr(ZC,"onTransitionEnd");Vo("onMouseEnter",["mouseout","mouseover"]);Vo("onMouseLeave",["mouseout","mouseover"]);Vo("onPointerEnter",["pointerout","pointerover"]);Vo("onPointerLeave",["pointerout","pointerover"]);Il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Il("onBeforeInput",["compositionend","keypress","textInput","paste"]);Il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uu="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(" "),zI=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uu));function z2(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var i=void 0;if(t)for(var a=s.length-1;0<=a;a--){var l=s[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(d){Bh(d)}r.currentTarget=null,i=c}else for(a=0;a<s.length;a++){if(l=s[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&r.isPropagationStopped())break e;i=l,r.currentTarget=u;try{i(r)}catch(d){Bh(d)}r.currentTarget=null,i=c}}}}function ht(e,t){var n=t[Q0];n===void 0&&(n=t[Q0]=new Set);var s=e+"__bubble";n.has(s)||(U2(t,e,2,!1),n.add(s))}function pg(e,t,n){var s=0;t&&(s|=4),U2(n,e,s,t)}var kf="_reactListening"+Math.random().toString(36).slice(2);function sv(e){if(!e[kf]){e[kf]=!0,MC.forEach(function(n){n!=="selectionchange"&&(zI.has(n)||pg(n,!1,e),pg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[kf]||(t[kf]=!0,pg("selectionchange",!1,t))}}function U2(e,t,n,s){switch(Z2(t)){case 2:var r=f4;break;case 8:r=h4;break;default:r=lv}n=r.bind(null,t,n,e),r=void 0,!tb||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function mg(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var a=s.tag;if(a===3||a===4){var l=s.stateNode.containerInfo;if(l===r)break;if(a===4)for(a=s.return;a!==null;){var c=a.tag;if((c===3||c===4)&&a.stateNode.containerInfo===r)return;a=a.return}for(;l!==null;){if(a=so(l),a===null)return;if(c=a.tag,c===5||c===6||c===26||c===27){s=i=a;continue e}l=l.parentNode}}s=s.return}zC(function(){var u=i,d=ky(n),f=[];e:{var h=JC.get(e);if(h!==void 0){var p=Bp,m=e;switch(e){case"keypress":if(fh(n)===0)break e;case"keydown":case"keyup":p=jD;break;case"focusin":m="focus",p=Gm;break;case"focusout":m="blur",p=Gm;break;case"beforeblur":case"afterblur":p=Gm;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=hw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=yD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=DD;break;case XC:case QC:case WC:p=wD;break;case ZC:p=LD;break;case"scroll":case"scrollend":p=bD;break;case"wheel":p=zD;break;case"copy":case"cut":case"paste":p=ND;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=mw;break;case"toggle":case"beforetoggle":p=FD}var k=(t&4)!==0,w=!k&&(e==="scroll"||e==="scrollend"),g=k?h!==null?h+"Capture":null:h;k=[];for(var y=u,b;y!==null;){var S=y;if(b=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||b===null||g===null||(S=ju(y,g),S!=null&&k.push(Fu(y,S,b))),w)break;y=y.return}0<k.length&&(h=new p(h,m,null,n,d),f.push({event:h,listeners:k}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==eb&&(m=n.relatedTarget||n.fromElement)&&(so(m)||m[bc]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?so(m):null,m!==null&&(w=kd(m),k=m.tag,m!==w||k!==5&&k!==27&&k!==6)&&(m=null)):(p=null,m=u),p!==m)){if(k=hw,S="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(k=mw,S="onPointerLeave",g="onPointerEnter",y="pointer"),w=p==null?h:Qc(p),b=m==null?h:Qc(m),h=new k(S,y+"leave",p,n,d),h.target=w,h.relatedTarget=b,S=null,so(d)===u&&(k=new k(g,y+"enter",m,n,d),k.target=b,k.relatedTarget=w,S=k),w=S,p&&m)t:{for(k=UI,g=p,y=m,b=0,S=g;S;S=k(S))b++;S=0;for(var M=y;M;M=k(M))S++;for(;0<b-S;)g=k(g),b--;for(;0<S-b;)y=k(y),S--;for(;b--;){if(g===y||y!==null&&g===y.alternate){k=g;break t}g=k(g),y=k(y)}k=null}else k=null;p!==null&&a1(f,h,p,k,!1),m!==null&&w!==null&&a1(f,w,m,k,!0)}}e:{if(h=u?Qc(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var E=yw;else if(xw(h))if(GC)E=QD;else{E=VD;var A=YD}else p=h.nodeName,!p||p.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?u&&vy(u.elementType)&&(E=yw):E=XD;if(E&&(E=E(e,u))){$C(f,E,n,d);break e}A&&A(e,h,u),e==="focusout"&&u&&h.type==="number"&&u.memoizedProps.value!=null&&J0(h,"number",h.value)}switch(A=u?Qc(u):window,e){case"focusin":(xw(A)||A.contentEditable==="true")&&(ao=A,nb=u,cu=null);break;case"focusout":cu=nb=ao=null;break;case"mousedown":sb=!0;break;case"contextmenu":case"mouseup":case"dragend":sb=!1,Nw(f,n,d);break;case"selectionchange":if(ZD)break;case"keydown":case"keyup":Nw(f,n,d)}var R;if(Ny)e:{switch(e){case"compositionstart":var D="onCompositionStart";break e;case"compositionend":D="onCompositionEnd";break e;case"compositionupdate":D="onCompositionUpdate";break e}D=void 0}else io?BC(e,n)&&(D="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(D="onCompositionStart");D&&(FC&&n.locale!=="ko"&&(io||D!=="onCompositionStart"?D==="onCompositionEnd"&&io&&(R=UC()):(ca=d,wy="value"in ca?ca.value:ca.textContent,io=!0)),A=rp(u,D),0<A.length&&(D=new pw(D,e,null,n,d),f.push({event:D,listeners:A}),R?D.data=R:(R=HC(n),R!==null&&(D.data=R)))),(R=HD?$D(e,n):GD(e,n))&&(D=rp(u,"onBeforeInput"),0<D.length&&(A=new pw("onBeforeInput","beforeinput",null,n,d),f.push({event:A,listeners:D}),A.data=R)),II(f,e,u,n,d)}z2(f,t)})}function Fu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rp(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||i===null||(r=ju(e,n),r!=null&&s.unshift(Fu(e,r,i)),r=ju(e,t),r!=null&&s.push(Fu(e,r,i))),e.tag===3)return s;e=e.return}return[]}function UI(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function a1(e,t,n,s,r){for(var i=t._reactName,a=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===s)break;l!==5&&l!==26&&l!==27||u===null||(c=u,r?(u=ju(n,i),u!=null&&a.unshift(Fu(n,u,c))):r||(u=ju(n,i),u!=null&&a.push(Fu(n,u,c)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var FI=/\r\n?/g,BI=/\u0000|\uFFFD/g;function l1(e){return(typeof e=="string"?e:""+e).replace(FI,`
49
+ `).replace(BI,"")}function F2(e,t){return t=l1(t),l1(e)===t}function Lt(e,t,n,s,r,i){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Xo(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Xo(e,""+s);break;case"className":pf(e,"class",s);break;case"tabIndex":pf(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":pf(e,n,s);break;case"style":PC(e,s,i);break;case"data":if(t!=="object"){pf(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=uh(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(n==="formAction"?(t!=="input"&&Lt(e,t,"name",r.name,r,null),Lt(e,t,"formEncType",r.formEncType,r,null),Lt(e,t,"formMethod",r.formMethod,r,null),Lt(e,t,"formTarget",r.formTarget,r,null)):(Lt(e,t,"encType",r.encType,r,null),Lt(e,t,"method",r.method,r,null),Lt(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=uh(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=ci);break;case"onScroll":s!=null&&ht("scroll",e);break;case"onScrollEnd":s!=null&&ht("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(Te(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(Te(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=uh(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":ht("beforetoggle",e),ht("toggle",e),ch(e,"popover",s);break;case"xlinkActuate":Vr(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Vr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Vr(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Vr(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Vr(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Vr(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Vr(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Vr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Vr(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":ch(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=mD.get(n)||n,ch(e,n,s))}}function Cb(e,t,n,s,r,i){switch(n){case"style":PC(e,s,i);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(Te(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(Te(60));e.innerHTML=n}}break;case"children":typeof s=="string"?Xo(e,s):(typeof s=="number"||typeof s=="bigint")&&Xo(e,""+s);break;case"onScroll":s!=null&&ht("scroll",e);break;case"onScrollEnd":s!=null&&ht("scrollend",e);break;case"onClick":s!=null&&(e.onclick=ci);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jC.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),i=e[ps]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,r),typeof s=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,r);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):ch(e,n,s)}}}function Fn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ht("error",e),ht("load",e);var s=!1,r=!1,i;for(i in n)if(n.hasOwnProperty(i)){var a=n[i];if(a!=null)switch(i){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(Te(137,t));default:Lt(e,t,i,a,n,null)}}r&&Lt(e,t,"srcSet",n.srcSet,n,null),s&&Lt(e,t,"src",n.src,n,null);return;case"input":ht("invalid",e);var l=i=a=r=null,c=null,u=null;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(d!=null)switch(s){case"name":r=d;break;case"type":a=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":i=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(Te(137,t));break;default:Lt(e,t,s,d,n,null)}}DC(e,i,l,c,u,a,r,!1);return;case"select":ht("invalid",e),s=a=i=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":i=l;break;case"defaultValue":a=l;break;case"multiple":s=l;default:Lt(e,t,r,l,n,null)}t=i,n=a,e.multiple=!!s,t!=null?yo(e,!!s,t,!1):n!=null&&yo(e,!!s,n,!0);return;case"textarea":ht("invalid",e),i=r=s=null;for(a in n)if(n.hasOwnProperty(a)&&(l=n[a],l!=null))switch(a){case"value":s=l;break;case"defaultValue":r=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(Te(91));break;default:Lt(e,t,a,l,n,null)}LC(e,s,r,i);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(s=n[c],s!=null))switch(c){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Lt(e,t,c,s,n,null)}return;case"dialog":ht("beforetoggle",e),ht("toggle",e),ht("cancel",e),ht("close",e);break;case"iframe":case"object":ht("load",e);break;case"video":case"audio":for(s=0;s<Uu.length;s++)ht(Uu[s],e);break;case"image":ht("error",e),ht("load",e);break;case"details":ht("toggle",e);break;case"embed":case"source":case"link":ht("error",e),ht("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(s=n[u],s!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(Te(137,t));default:Lt(e,t,u,s,n,null)}return;default:if(vy(t)){for(d in n)n.hasOwnProperty(d)&&(s=n[d],s!==void 0&&Cb(e,t,d,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(s=n[l],s!=null&&Lt(e,t,l,s,n,null))}function HI(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,i=null,a=null,l=null,c=null,u=null,d=null;for(p in n){var f=n[p];if(n.hasOwnProperty(p)&&f!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":c=f;default:s.hasOwnProperty(p)||Lt(e,t,p,null,s,f)}}for(var h in s){var p=s[h];if(f=n[h],s.hasOwnProperty(h)&&(p!=null||f!=null))switch(h){case"type":i=p;break;case"name":r=p;break;case"checked":u=p;break;case"defaultChecked":d=p;break;case"value":a=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(Te(137,t));break;default:p!==f&&Lt(e,t,h,p,s,f)}}Z0(e,a,l,c,u,d,i,r);return;case"select":p=a=l=h=null;for(i in n)if(c=n[i],n.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":p=c;default:s.hasOwnProperty(i)||Lt(e,t,i,null,s,c)}for(r in s)if(i=s[r],c=n[r],s.hasOwnProperty(r)&&(i!=null||c!=null))switch(r){case"value":h=i;break;case"defaultValue":l=i;break;case"multiple":a=i;default:i!==c&&Lt(e,t,r,i,s,c)}t=l,n=a,s=p,h!=null?yo(e,!!n,h,!1):!!s!=!!n&&(t!=null?yo(e,!!n,t,!0):yo(e,!!n,n?[]:"",!1));return;case"textarea":p=h=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!s.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Lt(e,t,l,null,s,r)}for(a in s)if(r=s[a],i=n[a],s.hasOwnProperty(a)&&(r!=null||i!=null))switch(a){case"value":h=r;break;case"defaultValue":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(Te(91));break;default:r!==i&&Lt(e,t,a,r,s,i)}IC(e,h,p);return;case"option":for(var m in n)if(h=n[m],n.hasOwnProperty(m)&&h!=null&&!s.hasOwnProperty(m))switch(m){case"selected":e.selected=!1;break;default:Lt(e,t,m,null,s,h)}for(c in s)if(h=s[c],p=n[c],s.hasOwnProperty(c)&&h!==p&&(h!=null||p!=null))switch(c){case"selected":e.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Lt(e,t,c,h,s,p)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var k in n)h=n[k],n.hasOwnProperty(k)&&h!=null&&!s.hasOwnProperty(k)&&Lt(e,t,k,null,s,h);for(u in s)if(h=s[u],p=n[u],s.hasOwnProperty(u)&&h!==p&&(h!=null||p!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(Te(137,t));break;default:Lt(e,t,u,h,s,p)}return;default:if(vy(t)){for(var w in n)h=n[w],n.hasOwnProperty(w)&&h!==void 0&&!s.hasOwnProperty(w)&&Cb(e,t,w,void 0,s,h);for(d in s)h=s[d],p=n[d],!s.hasOwnProperty(d)||h===p||h===void 0&&p===void 0||Cb(e,t,d,h,s,p);return}}for(var g in n)h=n[g],n.hasOwnProperty(g)&&h!=null&&!s.hasOwnProperty(g)&&Lt(e,t,g,null,s,h);for(f in s)h=s[f],p=n[f],!s.hasOwnProperty(f)||h===p||h==null&&p==null||Lt(e,t,f,h,s,p)}function o1(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $I(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var r=n[s],i=r.transferSize,a=r.initiatorType,l=r.duration;if(i&&l&&o1(a)){for(a=0,l=r.responseEnd,s+=1;s<n.length;s++){var c=n[s],u=c.startTime;if(u>l)break;var d=c.transferSize,f=c.initiatorType;d&&o1(f)&&(c=c.responseEnd,a+=d*(c<l?1:(l-u)/(c-u)))}if(--s,t+=8*(i+a)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Tb=null,Ab=null;function ip(e){return e.nodeType===9?e:e.ownerDocument}function c1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function B2(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Mb(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var gg=null;function GI(){var e=window.event;return e&&e.type==="popstate"?e===gg?!1:(gg=e,!0):(gg=null,!1)}var H2=typeof setTimeout=="function"?setTimeout:void 0,KI=typeof clearTimeout=="function"?clearTimeout:void 0,u1=typeof Promise=="function"?Promise:void 0,qI=typeof queueMicrotask=="function"?queueMicrotask:typeof u1<"u"?function(e){return u1.resolve(null).then(e).catch(YI)}:H2;function YI(e){setTimeout(function(){throw e})}function Ra(e){return e==="head"}function d1(e,t){var n=t,s=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(r),sc(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")yu(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,yu(n);for(var i=n.firstChild;i;){var a=i.nextSibling,l=i.nodeName;i[Ed]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=a}}else n==="body"&&yu(e.ownerDocument.body);n=r}while(n);sc(t)}function f1(e,t){var n=e;e=0;do{var s=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function jb(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":jb(n),yy(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function VI(e,t,n,s){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Ed])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Ys(e.nextSibling),e===null)break}return null}function XI(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ys(e.nextSibling),e===null))return null;return e}function $2(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ys(e.nextSibling),e===null))return null;return e}function Rb(e){return e.data==="$?"||e.data==="$~"}function Ob(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function QI(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Ys(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Db=null;function h1(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ys(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function p1(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function G2(e,t,n){switch(t=ip(n),e){case"html":if(e=t.documentElement,!e)throw Error(Te(452));return e;case"head":if(e=t.head,!e)throw Error(Te(453));return e;case"body":if(e=t.body,!e)throw Error(Te(454));return e;default:throw Error(Te(451))}}function yu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);yy(e)}var Xs=new Map,m1=new Set;function ap(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ni=At.d;At.d={f:WI,r:ZI,D:JI,C:e4,L:t4,m:n4,X:r4,S:s4,M:i4};function WI(){var e=Ni.f(),t=Zp();return e||t}function ZI(e){var t=xc(e);t!==null&&t.tag===5&&t.type==="form"?PT(t):Ni.r(e)}var wc=typeof document>"u"?null:document;function K2(e,t,n){var s=wc;if(s&&typeof t=="string"&&t){var r=Bs(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),m1.has(r)||(m1.add(r),e={rel:e,crossOrigin:n,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),Fn(t,"link",e),jn(t),s.head.appendChild(t)))}}function JI(e){Ni.D(e),K2("dns-prefetch",e,null)}function e4(e,t){Ni.C(e,t),K2("preconnect",e,t)}function t4(e,t,n){Ni.L(e,t,n);var s=wc;if(s&&e&&t){var r='link[rel="preload"][as="'+Bs(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Bs(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Bs(n.imageSizes)+'"]')):r+='[href="'+Bs(e)+'"]';var i=r;switch(t){case"style":i=nc(e);break;case"script":i=Sc(e)}Xs.has(i)||(e=Xt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Xs.set(i,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(jd(i))||t==="script"&&s.querySelector(Rd(i))||(t=s.createElement("link"),Fn(t,"link",e),jn(t),s.head.appendChild(t)))}}function n4(e,t){Ni.m(e,t);var n=wc;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Bs(s)+'"][href="'+Bs(e)+'"]',i=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Sc(e)}if(!Xs.has(i)&&(e=Xt({rel:"modulepreload",href:e},t),Xs.set(i,e),n.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Rd(i)))return}s=n.createElement("link"),Fn(s,"link",e),jn(s),n.head.appendChild(s)}}}function s4(e,t,n){Ni.S(e,t,n);var s=wc;if(s&&e){var r=xo(s).hoistableStyles,i=nc(e);t=t||"default";var a=r.get(i);if(!a){var l={loading:0,preload:null};if(a=s.querySelector(jd(i)))l.loading=5;else{e=Xt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Xs.get(i))&&rv(e,n);var c=a=s.createElement("link");jn(c),Fn(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,vh(a,t,s)}a={type:"stylesheet",instance:a,count:1,state:l},r.set(i,a)}}}function r4(e,t){Ni.X(e,t);var n=wc;if(n&&e){var s=xo(n).hoistableScripts,r=Sc(e),i=s.get(r);i||(i=n.querySelector(Rd(r)),i||(e=Xt({src:e,async:!0},t),(t=Xs.get(r))&&iv(e,t),i=n.createElement("script"),jn(i),Fn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function i4(e,t){Ni.M(e,t);var n=wc;if(n&&e){var s=xo(n).hoistableScripts,r=Sc(e),i=s.get(r);i||(i=n.querySelector(Rd(r)),i||(e=Xt({src:e,async:!0,type:"module"},t),(t=Xs.get(r))&&iv(e,t),i=n.createElement("script"),jn(i),Fn(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},s.set(r,i))}}function g1(e,t,n,s){var r=(r=ma.current)?ap(r):null;if(!r)throw Error(Te(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=nc(n.href),n=xo(r).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=nc(n.href);var i=xo(r).hoistableStyles,a=i.get(e);if(a||(r=r.ownerDocument||r,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,a),(i=r.querySelector(jd(e)))&&!i._p&&(a.instance=i,a.state.loading=5),Xs.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Xs.set(e,n),i||a4(r,e,n,a.state))),t&&s===null)throw Error(Te(528,""));return a}if(t&&s!==null)throw Error(Te(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Sc(n),n=xo(r).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(Te(444,e))}}function nc(e){return'href="'+Bs(e)+'"'}function jd(e){return'link[rel="stylesheet"]['+e+"]"}function q2(e){return Xt({},e,{"data-precedence":e.precedence,precedence:null})}function a4(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Fn(t,"link",n),jn(t),e.head.appendChild(t))}function Sc(e){return'[src="'+Bs(e)+'"]'}function Rd(e){return"script[async]"+e}function b1(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Bs(n.href)+'"]');if(s)return t.instance=s,jn(s),s;var r=Xt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),jn(s),Fn(s,"style",r),vh(s,n.precedence,e),t.instance=s;case"stylesheet":r=nc(n.href);var i=e.querySelector(jd(r));if(i)return t.state.loading|=4,t.instance=i,jn(i),i;s=q2(n),(r=Xs.get(r))&&rv(s,r),i=(e.ownerDocument||e).createElement("link"),jn(i);var a=i;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Fn(i,"link",s),t.state.loading|=4,vh(i,n.precedence,e),t.instance=i;case"script":return i=Sc(n.src),(r=e.querySelector(Rd(i)))?(t.instance=r,jn(r),r):(s=n,(r=Xs.get(i))&&(s=Xt({},n),iv(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),jn(r),Fn(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(Te(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,vh(s,n.precedence,e));return t.instance}function vh(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,i=r,a=0;a<s.length;a++){var l=s[a];if(l.dataset.precedence===t)i=l;else if(i!==r)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function rv(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function iv(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var kh=null;function x1(e,t,n){if(kh===null){var s=new Map,r=kh=new Map;r.set(n,s)}else r=kh,s=r.get(n),s||(s=new Map,r.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var i=n[r];if(!(i[Ed]||i[Ln]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var a=i.getAttribute(t)||"";a=e+a;var l=s.get(a);l?l.push(i):s.set(a,[i])}}return s}function y1(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function l4(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Y2(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function o4(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var r=nc(s.href),i=t.querySelector(jd(r));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=lp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,jn(i);return}i=t.ownerDocument||t,s=q2(s),(r=Xs.get(r))&&rv(s,r),i=i.createElement("link"),jn(i);var a=i;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Fn(i,"link",s),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lp.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var bg=0;function c4(e,t){return e.stylesheets&&e.count===0&&wh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&wh(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&bg===0&&(bg=62500*$I());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&wh(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>bg?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function lp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var op=null;function wh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,op=new Map,t.forEach(u4,e),op=null,lp.call(e))}function u4(e,t){if(!(t.state.loading&4)){var n=op.get(e);if(n)var s=n.get(null);else{n=new Map,op.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<r.length;i++){var a=r[i];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),s=a)}s&&n.set(null,s)}r=t.instance,a=r.getAttribute("data-precedence"),i=n.get(a)||s,i===s&&n.set(null,r),n.set(a,r),this.count++,s=lp.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),i?i.parentNode.insertBefore(r,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Bu={$$typeof:oi,Provider:null,Consumer:null,_currentValue:al,_currentValue2:al,_threadCount:0};function d4(e,t,n,s,r,i,a,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fm(0),this.hiddenUpdates=Fm(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=i,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function V2(e,t,n,s,r,i,a,l,c,u,d,f){return e=new d4(e,t,n,a,c,u,d,f,l),t=1,i===!0&&(t|=24),i=Ss(3,null,null,t),e.current=i,i.stateNode=e,t=jy(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:s,isDehydrated:n,cache:t},Dy(i),e}function X2(e){return e?(e=co,e):co}function Q2(e,t,n,s,r,i){r=X2(r),s.context===null?s.context=r:s.pendingContext=r,s=ba(t),s.payload={element:n},i=i===void 0?null:i,i!==null&&(s.callback=i),n=xa(e,s,t),n!==null&&(hs(n,e,t),du(n,e,t))}function v1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function av(e,t){v1(e,t),(e=e.alternate)&&v1(e,t)}function W2(e){if(e.tag===13||e.tag===31){var t=zl(e,67108864);t!==null&&hs(t,e,67108864),av(e,67108864)}}function k1(e){if(e.tag===13||e.tag===31){var t=As();t=by(t);var n=zl(e,t);n!==null&&hs(n,e,t),av(e,t)}}var cp=!0;function f4(e,t,n,s){var r=tt.T;tt.T=null;var i=At.p;try{At.p=2,lv(e,t,n,s)}finally{At.p=i,tt.T=r}}function h4(e,t,n,s){var r=tt.T;tt.T=null;var i=At.p;try{At.p=8,lv(e,t,n,s)}finally{At.p=i,tt.T=r}}function lv(e,t,n,s){if(cp){var r=Ib(s);if(r===null)mg(e,t,s,up,n),w1(e,s);else if(m4(r,e,t,n,s))s.stopPropagation();else if(w1(e,s),t&4&&-1<p4.indexOf(e)){for(;r!==null;){var i=xc(r);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var a=$a(i.pendingLanes);if(a!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;a;){var c=1<<31-Ts(a);l.entanglements[1]|=c,a&=~c}zr(i),!(Ct&6)&&(Jh=_s()+500,Md(0))}}break;case 31:case 13:l=zl(i,2),l!==null&&hs(l,i,2),Zp(),av(i,2)}if(i=Ib(s),i===null&&mg(e,t,s,up,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else mg(e,t,s,null,n)}}function Ib(e){return e=ky(e),ov(e)}var up=null;function ov(e){if(up=null,e=so(e),e!==null){var t=kd(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=bC(t),e!==null)return e;e=null}else if(n===31){if(e=xC(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return up=e,null}function Z2(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(JO()){case wC:return 2;case SC:return 8;case Uh:case eD:return 32;case NC:return 268435456;default:return 32}default:return 32}}var Lb=!1,ka=null,wa=null,Sa=null,Hu=new Map,$u=new Map,Ji=[],p4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function w1(e,t){switch(e){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":wa=null;break;case"mouseover":case"mouseout":Sa=null;break;case"pointerover":case"pointerout":Hu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$u.delete(t.pointerId)}}function Uc(e,t,n,s,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},t!==null&&(t=xc(t),t!==null&&W2(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function m4(e,t,n,s,r){switch(t){case"focusin":return ka=Uc(ka,e,t,n,s,r),!0;case"dragenter":return wa=Uc(wa,e,t,n,s,r),!0;case"mouseover":return Sa=Uc(Sa,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return Hu.set(i,Uc(Hu.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,$u.set(i,Uc($u.get(i)||null,e,t,n,s,r)),!0}return!1}function J2(e){var t=so(e.target);if(t!==null){var n=kd(t);if(n!==null){if(t=n.tag,t===13){if(t=bC(n),t!==null){e.blockedOn=t,aw(e.priority,function(){k1(n)});return}}else if(t===31){if(t=xC(n),t!==null){e.blockedOn=t,aw(e.priority,function(){k1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ib(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);eb=s,n.target.dispatchEvent(s),eb=null}else return t=xc(n),t!==null&&W2(t),e.blockedOn=n,!1;t.shift()}return!0}function S1(e,t,n){Sh(e)&&n.delete(t)}function g4(){Lb=!1,ka!==null&&Sh(ka)&&(ka=null),wa!==null&&Sh(wa)&&(wa=null),Sa!==null&&Sh(Sa)&&(Sa=null),Hu.forEach(S1),$u.forEach(S1)}function wf(e,t){e.blockedOn===t&&(e.blockedOn=null,Lb||(Lb=!0,En.unstable_scheduleCallback(En.unstable_NormalPriority,g4)))}var Sf=null;function N1(e){Sf!==e&&(Sf=e,En.unstable_scheduleCallback(En.unstable_NormalPriority,function(){Sf===e&&(Sf=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(ov(s||n)===null)continue;break}var i=xc(n);i!==null&&(e.splice(t,3),t-=3,gb(i,{pending:!0,data:r,method:n.method,action:s},s,r))}}))}function sc(e){function t(c){return wf(c,e)}ka!==null&&wf(ka,e),wa!==null&&wf(wa,e),Sa!==null&&wf(Sa,e),Hu.forEach(t),$u.forEach(t);for(var n=0;n<Ji.length;n++){var s=Ji[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ji.length&&(n=Ji[0],n.blockedOn===null);)J2(n),n.blockedOn===null&&Ji.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var r=n[s],i=n[s+1],a=r[ps]||null;if(typeof i=="function")a||N1(n);else if(a){var l=null;if(i&&i.hasAttribute("formAction")){if(r=i,a=i[ps]||null)l=a.formAction;else if(ov(r)!==null)continue}else l=a.action;typeof l=="function"?n[s+1]=l:(n.splice(s,3),s-=3),N1(n)}}}function eA(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(a){return r=a})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function cv(e){this._internalRoot=e}tm.prototype.render=cv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Te(409));var n=t.current,s=As();Q2(n,s,e,t,null,null)};tm.prototype.unmount=cv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Q2(e.current,2,null,e,null,null),Zp(),t[bc]=null}};function tm(e){this._internalRoot=e}tm.prototype.unstable_scheduleHydration=function(e){if(e){var t=AC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ji.length&&t!==0&&t<Ji[n].priority;n++);Ji.splice(n,0,e),n===0&&J2(e)}};var E1=mC.version;if(E1!=="19.2.8")throw Error(Te(527,E1,"19.2.8"));At.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Te(188)):(e=Object.keys(e).join(","),Error(Te(268,e)));return e=qO(t),e=e!==null?yC(e):null,e=e===null?null:e.stateNode,e};var b4={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:tt,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nf.isDisabled&&Nf.supportsFiber)try{wd=Nf.inject(b4),Cs=Nf}catch{}}zp.createRoot=function(e,t){if(!gC(e))throw Error(Te(299));var n=!1,s="",r=KT,i=qT,a=YT;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=V2(e,1,!1,null,null,n,s,null,r,i,a,eA),e[bc]=t.current,sv(e),new cv(t)};zp.hydrateRoot=function(e,t,n){if(!gC(e))throw Error(Te(299));var s=!1,r="",i=KT,a=qT,l=YT,c=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=V2(e,1,!0,t,n??null,s,r,c,i,a,l,eA),t.context=X2(null),n=t.current,s=As(),s=by(s),r=ba(s),r.callback=null,xa(n,r,s),n=s,t.current.lanes=n,Nd(t,n),zr(t),e[bc]=t.current,sv(e),new tm(t)};zp.version="19.2.8";function tA(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tA)}catch(e){console.error(e)}}tA(),cC.exports=zp;var x4=cC.exports;const y4=vd(x4),nA=x.createContext(void 0),sA=e=>{const t=x.useContext(nA);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},v4=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(nA.Provider,{value:e,children:t})),k4={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var ta,oy,G_,w4=(G_=class{constructor(){Je(this,ta,k4);Je(this,oy,!1)}setTimeoutProvider(e){qe(this,ta,e)}setTimeout(e,t){return ie(this,ta).setTimeout(e,t)}clearTimeout(e){ie(this,ta).clearTimeout(e)}setInterval(e,t){return ie(this,ta).setInterval(e,t)}clearInterval(e){ie(this,ta).clearInterval(e)}},ta=new WeakMap,oy=new WeakMap,G_);const Xa=new w4;function S4(e){setTimeout(e,0)}const N4=typeof window>"u"||"Deno"in globalThis;function ds(){}function E4(e,t){return typeof e=="function"?e(t):e}function rA(e){return typeof e=="number"&&e>=0&&e!==1/0}function iA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function en(e,t){return typeof e=="function"?e(t):e}function _1(e,t){const{type:n="all",exact:s,fetchStatus:r,predicate:i,queryKey:a,stale:l}=e;if(a){if(s){if(t.queryHash!==uv(a,t.options))return!1}else if(!rc(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||r&&r!==t.state.fetchStatus||i&&!i(t))}function C1(e,t){const{exact:n,status:s,predicate:r,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Gu(t.options.mutationKey)!==Gu(i))return!1}else if(!rc(t.options.mutationKey,i))return!1}return!(s&&t.state.status!==s||r&&!r(t))}function uv(e,t){return((t==null?void 0:t.queryKeyHashFn)||Gu)(e)}function Gu(e){return JSON.stringify(e,(t,n)=>Pb(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function rc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let s=0;s<t.length;s++)if(!rc(e[s],t[s]))return!1;return!0}const n=Object.keys(t);for(const s of n)if(!rc(e[s],t[s]))return!1;return!0}return!1}const _4=Object.prototype.hasOwnProperty;function aA(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=T1(e)&&T1(t);if(!s&&!(Pb(e)&&Pb(t)))return t;const r=(s?e:Object.keys(e)).length,i=s?t:Object.keys(t),a=i.length,l=s?new Array(a):{};let c=0;for(let u=0;u<a;u++){const d=s?u:i[u],f=e[d],h=t[d];if(f===h){l[d]=f,(s?u<r:_4.call(e,d))&&c++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){l[d]=h;continue}const p=aA(f,h,n+1);l[d]=p,p===f&&c++}return r===a&&c===r?e:l}function xg(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function T1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pb(e){if(!A1(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const s=n.prototype;return!(!A1(s)||!s.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function A1(e){return Object.prototype.toString.call(e)==="[object Object]"}function C4(e){return new Promise(t=>{Xa.setTimeout(t,e)})}function zb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?aA(e,t):t}function T4(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function A4(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}const dv=Symbol();function lA(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===dv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function oA(e,t){return typeof e=="function"?e(...t):!!e}function M4(e,t,n){let s=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??(r=t()),s||(s=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),e}let j4=()=>N4;const fv=()=>j4();var Od=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(){}},Wa,na,Do,K_,R4=(K_=class extends Od{constructor(){super();Je(this,Wa);Je(this,na);Je(this,Do);qe(this,Do,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ie(this,na)||this.setEventListener(ie(this,Do))}onUnsubscribe(){var t;this.hasListeners()||((t=ie(this,na))==null||t.call(this),qe(this,na,void 0))}setEventListener(t){var n;qe(this,Do,t),(n=ie(this,na))==null||n.call(this),qe(this,na,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){ie(this,Wa)!==t&&(qe(this,Wa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ie(this,Wa)=="boolean"?ie(this,Wa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Wa=new WeakMap,na=new WeakMap,Do=new WeakMap,K_);const hv=new R4,O4=S4;function D4(){let e=[],t=0,n=l=>{l()},s=l=>{l()},r=O4;const i=l=>{t?e.push(l):r(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&r(()=>{s(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{s=l},setScheduler:l=>{r=l}}}const Dn=D4();var Io,sa,Lo,q_,I4=(q_=class extends Od{constructor(){super();Je(this,Io,!0);Je(this,sa);Je(this,Lo);qe(this,Lo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){ie(this,sa)||this.setEventListener(ie(this,Lo))}onUnsubscribe(){var t;this.hasListeners()||((t=ie(this,sa))==null||t.call(this),qe(this,sa,void 0))}setEventListener(t){var n;qe(this,Lo,t),(n=ie(this,sa))==null||n.call(this),qe(this,sa,t(this.setOnline.bind(this)))}setOnline(t){ie(this,Io)!==t&&(qe(this,Io,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return ie(this,Io)}},Io=new WeakMap,sa=new WeakMap,Lo=new WeakMap,q_);const dp=new I4;function L4(e){return Math.min(1e3*2**e,3e4)}function cA(e){return(e??"online")==="online"?dp.isOnline():!0}var Ub=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function uA(e){let t=!1,n=0,s,r="pending",i,a;const l=new Promise((y,b)=>{i=y,a=b});l.catch(ds);const c=()=>r!=="pending",u=y=>{var b;if(!c()){const S=new Ub(y);k(S),(b=e.onCancel)==null||b.call(e,S)}},d=()=>{t=!0},f=()=>{t=!1},h=()=>hv.isFocused()&&(e.networkMode==="always"||dp.isOnline())&&e.canRun(),p=()=>cA(e.networkMode)&&e.canRun(),m=y=>{c()||(s==null||s(),r="resolved",i(y))},k=y=>{c()||(s==null||s(),r="rejected",a(y))},w=y=>new Promise(b=>{var S;s=M=>{(c()||y())&&b(M)},(S=e.onPause)==null||S.call(e)}).then(()=>{var b;s=void 0,c()||(b=e.onContinue)==null||b.call(e)}),g=()=>{if(c())return;let y;const b=n===0?e.initialPromise:void 0;try{y=b??e.fn()}catch(S){y=Promise.reject(S)}Promise.resolve(y).then(m).catch(S=>{var D;if(c())return;const M=e.retry??(fv()?0:3),E=e.retryDelay??L4,A=typeof E=="function"?E(n,S):E,R=M===!0||typeof M=="number"&&n<M||typeof M=="function"&&M(n,S);if(t||!R){k(S);return}n++,(D=e.onFail)==null||D.call(e,n,S),C4(A).then(()=>h()?void 0:w(h)).then(()=>{t?k(S):g()})})};return{promise:l,status:()=>r,cancel:u,continue:()=>(s==null||s(),l),cancelRetry:d,continueRetry:f,canStart:p,start:()=>(p()?g():w(p).then(g),l)}}var Za,Y_,dA=(Y_=class{constructor(){Je(this,Za)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rA(this.gcTime)&&qe(this,Za,Xa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fv()?1/0:3e5))}clearGcTimeout(){ie(this,Za)!==void 0&&(Xa.clearTimeout(ie(this,Za)),qe(this,Za,void 0))}},Za=new WeakMap,Y_);function P4(e){return{onFetch:(t,n)=>{var d,f,h,p,m;const s=t.options,r=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],a=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let k=!1;const w=b=>{M4(b,()=>t.signal,()=>k=!0)},g=lA(t.options,t.fetchOptions),y=async(b,S,M)=>{if(k)return Promise.reject(t.signal.reason);if(S==null&&b.pages.length)return Promise.resolve(b);const A=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:S,direction:M?"backward":"forward",meta:t.options.meta};return w(z),z})(),R=await g(A),{maxPages:D}=t.options,_=M?A4:T4;return{pages:_(b.pages,R,D),pageParams:_(b.pageParams,S,D)}};if(r&&i.length){const b=r==="backward",S=b?z4:M1,M={pages:i,pageParams:a};l=await y(M,S(s,M),b)}else{const b=e??i.length;do{const S=c===0?a[0]??s.initialPageParam:M1(s,l);if(c>0&&S==null)break;l=await y(l,S),c++}while(c<b)}return l};t.options.persister?t.fetchFn=()=>{var k,w;return(w=(k=t.options).persister)==null?void 0:w.call(k,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function M1(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function z4(e,{pages:t,pageParams:n}){var s;return t.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,n[0],n):void 0}var Po,Ja,zo,Ds,el,vn,md,tl,er,ni,V_,U4=(V_=class extends dA{constructor(t){super();Je(this,er);Je(this,Po);Je(this,Ja);Je(this,zo);Je(this,Ds);Je(this,el);Je(this,vn);Je(this,md);Je(this,tl);qe(this,tl,!1),qe(this,md,t.defaultOptions),this.setOptions(t.options),this.observers=[],qe(this,el,t.client),qe(this,Ds,ie(this,el).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,qe(this,Ja,R1(this.options)),this.state=t.state??ie(this,Ja),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return ie(this,Po)}get promise(){var t;return(t=ie(this,vn))==null?void 0:t.promise}setOptions(t){if(this.options={...ie(this,md),...t},t!=null&&t._type&&qe(this,Po,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=R1(this.options);n.data!==void 0&&(this.setState(j1(n.data,n.dataUpdatedAt)),qe(this,Ja,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ie(this,Ds).remove(this)}setData(t,n){const s=zb(this.state.data,t,this.options);return gt(this,er,ni).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(t){gt(this,er,ni).call(this,{type:"setState",state:t})}cancel(t){var s,r;const n=(s=ie(this,vn))==null?void 0:s.promise;return(r=ie(this,vn))==null||r.cancel(t),n?n.then(ds).catch(ds):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ie(this,Ja)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>en(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dv||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>en(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:!iA(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(s=>s.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=ie(this,vn))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(s=>s.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=ie(this,vn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ie(this,Ds).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(ie(this,vn)&&(ie(this,tl)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?ie(this,vn).cancel({revert:!0}):ie(this,vn).cancelRetry()),this.scheduleGc()),ie(this,Ds).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||gt(this,er,ni).call(this,{type:"invalidate"})}async fetch(t,n){var u,d,f,h,p,m,k,w,g,y,b,S;if(this.state.fetchStatus!=="idle"&&((u=ie(this,vn))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ie(this,vn))return ie(this,vn).continueRetry(),ie(this,vn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(E=>E.options.queryFn);M&&this.setOptions(M.options)}const s=new AbortController,r=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(qe(this,tl,!0),s.signal)})},i=()=>{const M=lA(this.options,n),A=(()=>{const R={client:ie(this,el),queryKey:this.queryKey,meta:this.meta};return r(R),R})();return qe(this,tl,!1),this.options.persister?this.options.persister(M,A,this):M(A)},l=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ie(this,el),state:this.state,fetchFn:i};return r(M),M})();(d=ie(this,Po)==="infinite"?P4(this.options.pages):this.options.behavior)==null||d.onFetch(l,this),qe(this,zo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=l.fetchOptions)==null?void 0:f.meta))&&gt(this,er,ni).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const c=qe(this,vn,uA({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:M=>{M instanceof Ub&&M.revert&&this.setState({...ie(this,zo),fetchStatus:"idle"}),s.abort()},onFail:(M,E)=>{gt(this,er,ni).call(this,{type:"failed",failureCount:M,error:E})},onPause:()=>{gt(this,er,ni).call(this,{type:"pause"})},onContinue:()=>{gt(this,er,ni).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const M=await c.start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(m=(p=ie(this,Ds).config).onSuccess)==null||m.call(p,M,this),(w=(k=ie(this,Ds).config).onSettled)==null||w.call(k,M,this.state.error,this),M}catch(M){if(M instanceof Ub){if(M.silent)return ie(this,vn).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw gt(this,er,ni).call(this,{type:"error",error:M}),(y=(g=ie(this,Ds).config).onError)==null||y.call(g,M,this),(S=(b=ie(this,Ds).config).onSettled)==null||S.call(b,this.state.data,M,this),M}finally{ie(this,vn)===c&&qe(this,vn,void 0),this.scheduleGc()}}},Po=new WeakMap,Ja=new WeakMap,zo=new WeakMap,Ds=new WeakMap,el=new WeakMap,vn=new WeakMap,md=new WeakMap,tl=new WeakMap,er=new WeakSet,ni=function(t){const n=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...fA(s.data,this.options),fetchMeta:t.meta??null};case"success":const r={...s,...j1(t.data,t.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return qe(this,zo,t.manual?r:void 0),r;case"error":const i=t.error;return{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=n(this.state),Dn.batch(()=>{this.observers.slice().forEach(s=>{s.onQueryUpdate()}),ie(this,Ds).notify({query:this,type:"updated",action:t})})},V_);function fA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:cA(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function j1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function R1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Xn,wt,gd,Qn,nl,Uo,ri,bd,Fo,Bo,sl,rl,ra,Ho,Tt,Jc,Fb,Bb,Hb,$b,Gb,Kb,qb,Yb,X_,F4=(X_=class extends Od{constructor(t,n){super();Je(this,Tt);Je(this,Xn);Je(this,wt);Je(this,gd);Je(this,Qn);Je(this,nl);Je(this,Uo);Je(this,ri);Je(this,bd);Je(this,Fo);Je(this,Bo);Je(this,sl);Je(this,rl);Je(this,ra);Je(this,Ho,new Set);this.options=n,qe(this,Xn,t),qe(this,ri,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ie(this,wt).addObserver(this),O1(ie(this,wt),this.options)?gt(this,Tt,Jc).call(this):this.updateResult(),gt(this,Tt,Gb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Vb(ie(this,wt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Vb(ie(this,wt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,gt(this,Tt,Kb).call(this),gt(this,Tt,qb).call(this),ie(this,wt).removeObserver(this)}setOptions(t){const n=this.options,s=ie(this,wt);if(this.options=ie(this,Xn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof en(this.options.enabled,ie(this,wt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");gt(this,Tt,Yb).call(this),ie(this,wt).setOptions(this.options),n._defaulted&&!xg(this.options,n)&&ie(this,Xn).getQueryCache().notify({type:"observerOptionsUpdated",query:ie(this,wt),observer:this});const r=this.hasListeners();r&&D1(ie(this,wt),s,this.options,n)&&gt(this,Tt,Jc).call(this),this.updateResult(),r&&(ie(this,wt)!==s||en(this.options.enabled,ie(this,wt))!==en(n.enabled,ie(this,wt))||en(this.options.staleTime,ie(this,wt))!==en(n.staleTime,ie(this,wt)))&&gt(this,Tt,Bb).call(this);const i=gt(this,Tt,Hb).call(this);r&&(ie(this,wt)!==s||en(this.options.enabled,ie(this,wt))!==en(n.enabled,ie(this,wt))||i!==ie(this,ra))&&gt(this,Tt,$b).call(this,i)}getOptimisticResult(t){const n=ie(this,Xn).getQueryCache().build(ie(this,Xn),t),s=this.createResult(n,t);return xg(this.getCurrentResult(),s)||(qe(this,Qn,s),qe(this,Uo,this.options),qe(this,nl,ie(this,wt).state)),s}getCurrentResult(){return ie(this,Qn)}trackResult(t,n){return new Proxy(t,{get:(s,r)=>(this.trackProp(r),n==null||n(r),Reflect.get(s,r))})}trackProp(t){ie(this,Ho).add(t)}getCurrentQuery(){return ie(this,wt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ie(this,Xn).defaultQueryOptions(t),s=ie(this,Xn).getQueryCache().build(ie(this,Xn),n);let r=()=>{},i;const a=new Promise(l=>{i=l,r=ie(this,Xn).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===s.queryHash&&s.state.data!==void 0&&(r(),l(this.createResult(s,n)))})});return Promise.race([s.fetch().then(()=>{const l=this.createResult(s,n);return i==null||i(l),l}).finally(()=>{r()}),a])}fetch(t){return gt(this,Tt,Jc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ie(this,Qn)))}createResult(t,n){var E;const s=ie(this,wt),r=this.options,i=ie(this,Qn),a=ie(this,nl),l=ie(this,Uo),c=t!==s?t.state:ie(this,gd),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const A=this.hasListeners(),R=!A&&O1(t,n),D=A&&D1(t,s,n,r);(R||D)&&(d={...d,...fA(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:k}=d;h=d.data;let w=!1;if(n.placeholderData!==void 0&&h===void 0&&k==="pending"){let A;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(A=i.data,w=!0):A=typeof n.placeholderData=="function"?n.placeholderData((E=ie(this,Bo))==null?void 0:E.state.data,ie(this,Bo)):n.placeholderData,A!==void 0&&(k="success",h=zb(i==null?void 0:i.data,A,n),f=!0)}if(n.select&&h!==void 0&&!w)if(i&&h===(a==null?void 0:a.data)&&n.select===ie(this,bd))h=ie(this,Fo);else try{qe(this,bd,n.select),h=n.select(h),h=zb(i==null?void 0:i.data,h,n),qe(this,Fo,h),qe(this,ri,null)}catch(A){qe(this,ri,A)}else h===void 0&&qe(this,ri,null);ie(this,ri)&&(p=ie(this,ri),h=ie(this,Fo),m=Date.now(),k="error",f=!1);const g=d.fetchStatus==="fetching",y=k==="pending",b=k==="error",S=y&&g,M=h!==void 0;return{status:k,fetchStatus:d.fetchStatus,isPending:y,isSuccess:k==="success",isError:b,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:g,isRefetching:g&&!y,isLoadingError:b&&!M,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&M,isStale:pv(t,n),refetch:this.refetch,isEnabled:en(n.enabled,t)!==!1}}updateResult(){const t=ie(this,Qn),n=this.createResult(ie(this,wt),this.options);if(qe(this,nl,ie(this,wt).state),qe(this,Uo,this.options),ie(this,nl).data!==void 0&&qe(this,Bo,ie(this,wt)),xg(n,t))return;qe(this,Qn,n);const r=(()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ie(this,Ho).size)return!0;const l=new Set(a??ie(this,Ho));return this.options.throwOnError&&l.add("error"),Object.keys(ie(this,Qn)).some(c=>{const u=c;return ie(this,Qn)[u]!==t[u]&&l.has(u)})})();Dn.batch(()=>{r&&this.listeners.forEach(i=>{i(ie(this,Qn))}),ie(this,Xn).getQueryCache().notify({query:ie(this,wt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&gt(this,Tt,Gb).call(this)}},Xn=new WeakMap,wt=new WeakMap,gd=new WeakMap,Qn=new WeakMap,nl=new WeakMap,Uo=new WeakMap,ri=new WeakMap,bd=new WeakMap,Fo=new WeakMap,Bo=new WeakMap,sl=new WeakMap,rl=new WeakMap,ra=new WeakMap,Ho=new WeakMap,Tt=new WeakSet,Jc=function(t){gt(this,Tt,Yb).call(this);let n=ie(this,wt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ds)),n},Fb=function(t){return!fv()&&en(this.options.enabled,ie(this,wt))!==!1&&rA(t)},Bb=function(){gt(this,Tt,Kb).call(this);const t=en(this.options.staleTime,ie(this,wt));if(ie(this,Qn).isStale||!gt(this,Tt,Fb).call(this,t))return;const n=iA(ie(this,Qn).dataUpdatedAt,t)+1;qe(this,sl,Xa.setTimeout(()=>{ie(this,Qn).isStale||this.updateResult()},n))},Hb=function(){return en(this.options.refetchInterval,ie(this,wt))??!1},$b=function(t){gt(this,Tt,qb).call(this),qe(this,ra,t),!(ie(this,ra)===0||!gt(this,Tt,Fb).call(this,ie(this,ra)))&&qe(this,rl,Xa.setInterval(()=>{(this.options.refetchIntervalInBackground||hv.isFocused())&&gt(this,Tt,Jc).call(this)},ie(this,ra)))},Gb=function(){gt(this,Tt,Bb).call(this),gt(this,Tt,$b).call(this,gt(this,Tt,Hb).call(this))},Kb=function(){ie(this,sl)!==void 0&&(Xa.clearTimeout(ie(this,sl)),qe(this,sl,void 0))},qb=function(){ie(this,rl)!==void 0&&(Xa.clearInterval(ie(this,rl)),qe(this,rl,void 0))},Yb=function(){const t=ie(this,Xn).getQueryCache().build(ie(this,Xn),this.options);if(t===ie(this,wt))return;const n=ie(this,wt);qe(this,wt,t),qe(this,gd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},X_);function B4(e,t){return en(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&en(t.retryOnMount,e)===!1)}function O1(e,t){return B4(e,t)||e.state.data!==void 0&&Vb(e,t,t.refetchOnMount)}function Vb(e,t,n){if(en(t.enabled,e)!==!1&&en(t.staleTime,e)!=="static"){const s=en(n,e);return s==="always"||s!==!1&&pv(e,t)}return!1}function D1(e,t,n,s){return(e!==t||en(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&pv(e,n)}function pv(e,t){return en(t.enabled,e)!==!1&&e.isStaleByTime(en(t.staleTime,e))}var xd,Nr,Gn,il,Er,Ki,Q_,H4=(Q_=class extends dA{constructor(t){super();Je(this,Er);Je(this,xd);Je(this,Nr);Je(this,Gn);Je(this,il);qe(this,xd,t.client),this.mutationId=t.mutationId,qe(this,Gn,t.mutationCache),qe(this,Nr,[]),this.state=t.state||$4(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ie(this,Nr).includes(t)||(ie(this,Nr).push(t),this.clearGcTimeout(),ie(this,Gn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){qe(this,Nr,ie(this,Nr).filter(n=>n!==t)),this.scheduleGc(),ie(this,Gn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ie(this,Nr).length||(this.state.status==="pending"?this.scheduleGc():ie(this,Gn).remove(this))}continue(){var t;return((t=ie(this,il))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var l,c,u,d,f,h,p,m,k,w,g,y,b,S,M,E,A,R;const n=()=>{gt(this,Er,Ki).call(this,{type:"continue"})},s={client:ie(this,xd),meta:this.options.meta,mutationKey:this.options.mutationKey},r=qe(this,il,uA({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(new Error("No mutationFn found")),onFail:(D,_)=>{gt(this,Er,Ki).call(this,{type:"failed",failureCount:D,error:_})},onPause:()=>{gt(this,Er,Ki).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ie(this,Gn).canRun(this)})),i=this.state.status==="pending",a=!r.canStart();try{if(i)n();else{gt(this,Er,Ki).call(this,{type:"pending",variables:t,isPaused:a}),ie(this,Gn).config.onMutate&&await ie(this,Gn).config.onMutate(t,this,s);const _=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,s));_!==this.state.context&&gt(this,Er,Ki).call(this,{type:"pending",context:_,variables:t,isPaused:a})}const D=await r.start();return await((d=(u=ie(this,Gn).config).onSuccess)==null?void 0:d.call(u,D,t,this.state.context,this,s)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,D,t,this.state.context,s)),await((m=(p=ie(this,Gn).config).onSettled)==null?void 0:m.call(p,D,null,this.state.variables,this.state.context,this,s)),await((w=(k=this.options).onSettled)==null?void 0:w.call(k,D,null,t,this.state.context,s)),gt(this,Er,Ki).call(this,{type:"success",data:D}),D}catch(D){try{await((y=(g=ie(this,Gn).config).onError)==null?void 0:y.call(g,D,t,this.state.context,this,s))}catch(_){Promise.reject(_)}try{await((S=(b=this.options).onError)==null?void 0:S.call(b,D,t,this.state.context,s))}catch(_){Promise.reject(_)}try{await((E=(M=ie(this,Gn).config).onSettled)==null?void 0:E.call(M,void 0,D,this.state.variables,this.state.context,this,s))}catch(_){Promise.reject(_)}try{await((R=(A=this.options).onSettled)==null?void 0:R.call(A,void 0,D,t,this.state.context,s))}catch(_){Promise.reject(_)}throw gt(this,Er,Ki).call(this,{type:"error",error:D}),D}finally{ie(this,il)===r&&qe(this,il,void 0),ie(this,Gn).runNext(this)}}},xd=new WeakMap,Nr=new WeakMap,Gn=new WeakMap,il=new WeakMap,Er=new WeakSet,Ki=function(t){const n=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,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{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Dn.batch(()=>{ie(this,Nr).forEach(s=>{s.onMutationUpdate(t)}),ie(this,Gn).notify({mutation:this,type:"updated",action:t})})},Q_);function $4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ii,tr,yd,W_,G4=(W_=class extends Od{constructor(t={}){super();Je(this,ii);Je(this,tr);Je(this,yd);this.config=t,qe(this,ii,new Set),qe(this,tr,new Map),qe(this,yd,0)}build(t,n,s){const r=new H4({client:t,mutationCache:this,mutationId:++of(this,yd)._,options:t.defaultMutationOptions(n),state:s});return this.add(r),r}add(t){ie(this,ii).add(t);const n=Ef(t);if(typeof n=="string"){const s=ie(this,tr).get(n);s?s.push(t):ie(this,tr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ie(this,ii).delete(t)){const n=Ef(t);if(typeof n=="string"){const s=ie(this,tr).get(n);if(s)if(s.length>1){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}else s[0]===t&&ie(this,tr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var s;const n=Ef(t);if(typeof n=="string"){const r=(s=ie(this,tr).get(n))==null?void 0:s.find(i=>i.state.status==="pending");return!r||r===t}else return!0}runNext(t){var s,r;const n=Ef(t);return typeof n=="string"?((r=(s=ie(this,tr).get(n))==null?void 0:s.find(i=>i!==t&&i.state.isPaused))==null?void 0:r.continue())??Promise.resolve():Promise.resolve()}clear(){Dn.batch(()=>{ie(this,ii).forEach(t=>{this.notify({type:"removed",mutation:t})}),ie(this,ii).clear(),ie(this,tr).clear()})}getAll(){return Array.from(ie(this,ii))}find(t){const n={exact:!0,...t};return this.getAll().find(s=>C1(n,s))}findAll(t={}){return this.getAll().filter(n=>C1(t,n))}notify(t){Dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Dn.batch(()=>Promise.all(t.map(n=>n.continue().catch(ds))))}},ii=new WeakMap,tr=new WeakMap,yd=new WeakMap,W_);function Ef(e){var t;return(t=e.options.scope)==null?void 0:t.id}var _r,Z_,K4=(Z_=class extends Od{constructor(t={}){super();Je(this,_r);this.config=t,qe(this,_r,new Map)}build(t,n,s){const r=n.queryKey,i=n.queryHash??uv(r,n);let a=this.get(i);return a||(a=new U4({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(n),state:s,defaultOptions:t.getQueryDefaults(r)}),this.add(a)),a}add(t){ie(this,_r).has(t.queryHash)||(ie(this,_r).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){ie(this,_r).get(t.queryHash)===t&&(t.destroy(),ie(this,_r).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ie(this,_r).get(t)}getAll(){return[...ie(this,_r).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(s=>_1(n,s))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(s=>_1(t,s)):n}notify(t){Dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Dn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Dn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},_r=new WeakMap,Z_),sn,ia,aa,$o,Go,la,Ko,qo,J_,q4=(J_=class{constructor(e={}){Je(this,sn);Je(this,ia);Je(this,aa);Je(this,$o);Je(this,Go);Je(this,la);Je(this,Ko);Je(this,qo);qe(this,sn,e.queryCache||new K4),qe(this,ia,e.mutationCache||new G4),qe(this,aa,e.defaultOptions||{}),qe(this,$o,new Map),qe(this,Go,new Map),qe(this,la,0)}mount(){of(this,la)._++,ie(this,la)===1&&(qe(this,Ko,hv.subscribe(async e=>{e&&(await this.resumePausedMutations(),ie(this,sn).onFocus())})),qe(this,qo,dp.subscribe(async e=>{e&&(await this.resumePausedMutations(),ie(this,sn).onOnline())})))}unmount(){var e,t;of(this,la)._--,ie(this,la)===0&&((e=ie(this,Ko))==null||e.call(this),qe(this,Ko,void 0),(t=ie(this,qo))==null||t.call(this),qe(this,qo,void 0))}isFetching(e){return ie(this,sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ie(this,ia).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ie(this,sn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ie(this,sn).build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(en(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return ie(this,sn).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var a;const s=this.defaultQueryOptions({queryKey:e}),r=(a=ie(this,sn).get(s.queryHash))==null?void 0:a.state.data,i=E4(t,r);if(i!==void 0)return ie(this,sn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Dn.batch(()=>ie(this,sn).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ie(this,sn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ie(this,sn);Dn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ie(this,sn);return Dn.batch(()=>{const s=n.findAll(e),r=new Set(s);return s.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>r.has(i)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},s=Dn.batch(()=>ie(this,sn).findAll(e).map(r=>r.cancel(n)));return Promise.all(s).then(ds).catch(ds)}invalidateQueries(e,t={}){return Dn.batch(()=>(ie(this,sn).findAll(e).forEach(n=>{n.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 n={...t,cancelRefetch:t.cancelRefetch??!0},s=Dn.batch(()=>ie(this,sn).findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,n);return n.throwOnError||(i=i.catch(ds)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(ds)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ie(this,sn).build(this,t),s=n.isStaleByTime(en(t.staleTime,n))?await n.fetch(t):n.state.data,r=t.select;return r?r(s):s}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ie(this,sn).build(this,t);return n.isStaleByTime(en(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ds).catch(ds)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ds).catch(ds)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return dp.isOnline()?ie(this,ia).resumePausedMutations():Promise.resolve()}getQueryCache(){return ie(this,sn)}getMutationCache(){return ie(this,ia)}getDefaultOptions(){return ie(this,aa)}setDefaultOptions(e){qe(this,aa,e)}setQueryDefaults(e,t){ie(this,$o).set(Gu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ie(this,$o).values()],n={};return t.forEach(s=>{rc(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){ie(this,Go).set(Gu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ie(this,Go).values()],n={};return t.forEach(s=>{rc(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ie(this,aa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=uv(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===dv&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ie(this,aa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ie(this,sn).clear(),ie(this,ia).clear()}},sn=new WeakMap,ia=new WeakMap,aa=new WeakMap,$o=new WeakMap,Go=new WeakMap,la=new WeakMap,Ko=new WeakMap,qo=new WeakMap,J_);const hA=x.createContext(!1),Y4=()=>x.useContext(hA);hA.Provider;function V4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const X4=x.createContext(V4()),Q4=()=>x.useContext(X4),W4=(e,t,n)=>{const s=n!=null&&n.state.error&&typeof e.throwOnError=="function"?oA(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||s)&&(t.isReset()||(e.retryOnMount=!1))},Z4=e=>{x.useEffect(()=>{e.clearReset()},[e])},J4=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(r&&e.data===void 0||oA(n,[e.error,s])),eL=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},tL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,nL=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function sL(e,t,n){const s=Y4(),r=Q4(),i=sA(),a=i.defaultQueryOptions(e),l=i.getQueryCache().get(a.queryHash),c=e.subscribed!==!1;a._optimisticResults=s?"isRestoring":c?"optimistic":void 0,eL(a),W4(a,r,l),Z4(r);const[u]=x.useState(()=>new t(i,a)),d=u.getOptimisticResult(a),f=!s&&c;if(x.useSyncExternalStore(x.useCallback(h=>{const p=f?u.subscribe(Dn.batchCalls(h)):ds;return u.updateResult(),p},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setOptions(a)},[a,u]),tL(a,d))throw nL(a,u,r);if(J4({result:d,errorResetBoundary:r,throwOnError:a.throwOnError,query:l,suspense:a.suspense}))throw d.error;return a.notifyOnChangeProps?d:u.trackResult(d)}function Xb(e,t){return sL(e,F4)}function rL(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>s=>{t.forEach(r=>r(s))},t)}const nm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Nc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mv(e){return"nodeType"in e}function gs(e){var t,n;return e?Nc(e)?e:mv(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function gv(e){const{Document:t}=gs(e);return e instanceof t}function Dd(e){return Nc(e)?!1:e instanceof gs(e).HTMLElement}function pA(e){return e instanceof gs(e).SVGElement}function Ec(e){return e?Nc(e)?e.document:mv(e)?gv(e)?e:Dd(e)||pA(e)?e.ownerDocument:document:document:document}const Lr=nm?x.useLayoutEffect:x.useEffect;function bv(e){const t=x.useRef(e);return Lr(()=>{t.current=e}),x.useCallback(function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return t.current==null?void 0:t.current(...s)},[])}function iL(){const e=x.useRef(null),t=x.useCallback((s,r)=>{e.current=setInterval(s,r)},[]),n=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ku(e,t){t===void 0&&(t=[e]);const n=x.useRef(e);return Lr(()=>{n.current!==e&&(n.current=e)},t),n}function Id(e,t){const n=x.useRef();return x.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function fp(e){const t=bv(e),n=x.useRef(null),s=x.useCallback(r=>{r!==n.current&&(t==null||t(r,n.current)),n.current=r},[]);return[n,s]}function Qb(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}let yg={};function Ld(e,t){return x.useMemo(()=>{if(t)return t;const n=yg[e]==null?0:yg[e]+1;return yg[e]=n,e+"-"+n},[e,t])}function mA(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return s.reduce((i,a)=>{const l=Object.entries(a);for(const[c,u]of l){const d=i[c];d!=null&&(i[c]=d+e*u)}return i},{...t})}}const Eo=mA(1),hp=mA(-1);function aL(e){return"clientX"in e&&"clientY"in e}function xv(e){if(!e)return!1;const{KeyboardEvent:t}=gs(e.target);return t&&e instanceof t}function lL(e){if(!e)return!1;const{TouchEvent:t}=gs(e.target);return t&&e instanceof t}function Wb(e){if(lL(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return aL(e)?{x:e.clientX,y:e.clientY}:null}const pp=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[pp.Translate.toString(e),pp.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),I1="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function oL(e){return e.matches(I1)?e:e.querySelector(I1)}const cL={display:"none"};function uL(e){let{id:t,value:n}=e;return Jn.createElement("div",{id:t,style:cL},n)}function dL(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Jn.createElement("div",{id:t,style:r,role:"status","aria-live":s,"aria-atomic":!0},n)}function fL(){const[e,t]=x.useState("");return{announce:x.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const gA=x.createContext(null);function hL(e){const t=x.useContext(gA);x.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function pL(){const[e]=x.useState(()=>new Set),t=x.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[x.useCallback(s=>{let{type:r,event:i}=s;e.forEach(a=>{var l;return(l=a[r])==null?void 0:l.call(a,i)})},[e]),t]}const mL={draggable:`
50
+ To pick up a draggable item, press the space bar.
51
+ While dragging, use the arrow keys to move the item.
52
+ Press space again to drop the item in its new position, or press escape to cancel.
53
+ `},gL={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function bL(e){let{announcements:t=gL,container:n,hiddenTextDescribedById:s,screenReaderInstructions:r=mL}=e;const{announce:i,announcement:a}=fL(),l=Ld("DndLiveRegion"),[c,u]=x.useState(!1);if(x.useEffect(()=>{u(!0)},[]),hL(x.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&i(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;i(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;i(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;i(t.onDragCancel({active:h,over:p}))}}),[i,t])),!c)return null;const d=Jn.createElement(Jn.Fragment,null,Jn.createElement(uL,{id:s,value:r.draggable}),Jn.createElement(dL,{id:l,announcement:a}));return n?un.createPortal(d,n):d}var wn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(wn||(wn={}));function mp(){}function qu(e,t){return x.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function yv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const fr=Object.freeze({x:0,y:0});function xL(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function yL(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function vL(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function kL(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function L1(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const wL=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const r=L1(t,t.left,t.top),i=[];for(const a of s){const{id:l}=a,c=n.get(l);if(c){const u=xL(L1(c),r);i.push({id:l,data:{droppableContainer:a,value:u}})}}return i.sort(yL)};function SL(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-s,l=i-n;if(s<r&&n<i){const c=t.width*t.height,u=e.width*e.height,d=a*l,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const NL=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const r=[];for(const i of s){const{id:a}=i,l=n.get(a);if(l){const c=SL(l,t);c>0&&r.push({id:a,data:{droppableContainer:i,value:c}})}}return r.sort(vL)};function EL(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function bA(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:fr}function _L(e){return function(n){for(var s=arguments.length,r=new Array(s>1?s-1:0),i=1;i<s;i++)r[i-1]=arguments[i];return r.reduce((a,l)=>({...a,top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),{...n})}}const CL=_L(1);function TL(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function AL(e,t,n){const s=TL(t);if(!s)return e;const{scaleX:r,scaleY:i,x:a,y:l}=s,c=e.left-a-(1-r)*parseFloat(n),u=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const ML={ignoreTransform:!1};function _c(e,t){t===void 0&&(t=ML);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=gs(e).getComputedStyle(e);u&&(n=AL(n,u,d))}const{top:s,left:r,width:i,height:a,bottom:l,right:c}=n;return{top:s,left:r,width:i,height:a,bottom:l,right:c}}function P1(e){return _c(e,{ignoreTransform:!0})}function jL(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function RL(e,t){return t===void 0&&(t=gs(e).getComputedStyle(e)),t.position==="fixed"}function OL(e,t){t===void 0&&(t=gs(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const i=t[r];return typeof i=="string"?n.test(i):!1})}function vv(e,t){const n=[];function s(r){if(t!=null&&n.length>=t||!r)return n;if(gv(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Dd(r)||pA(r)||n.includes(r))return n;const i=gs(e).getComputedStyle(r);return r!==e&&OL(r,i)&&n.push(r),RL(r,i)?n:s(r.parentNode)}return e?s(e):n}function xA(e){const[t]=vv(e,1);return t??null}function vg(e){return!nm||!e?null:Nc(e)?e:mv(e)?gv(e)||e===Ec(e).scrollingElement?window:Dd(e)?e:null:null}function yA(e){return Nc(e)?e.scrollX:e.scrollLeft}function vA(e){return Nc(e)?e.scrollY:e.scrollTop}function Zb(e){return{x:yA(e),y:vA(e)}}var Mn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Mn||(Mn={}));function kA(e){return!nm||!e?!1:e===document.scrollingElement}function wA(e){const t={x:0,y:0},n=kA(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},r=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,a=e.scrollTop>=s.y,l=e.scrollLeft>=s.x;return{isTop:r,isLeft:i,isBottom:a,isRight:l,maxScroll:s,minScroll:t}}const DL={x:.2,y:.2};function IL(e,t,n,s,r){let{top:i,left:a,right:l,bottom:c}=n;s===void 0&&(s=10),r===void 0&&(r=DL);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=wA(e),p={x:0,y:0},m={x:0,y:0},k={height:t.height*r.y,width:t.width*r.x};return!u&&i<=t.top+k.height?(p.y=Mn.Backward,m.y=s*Math.abs((t.top+k.height-i)/k.height)):!d&&c>=t.bottom-k.height&&(p.y=Mn.Forward,m.y=s*Math.abs((t.bottom-k.height-c)/k.height)),!h&&l>=t.right-k.width?(p.x=Mn.Forward,m.x=s*Math.abs((t.right-k.width-l)/k.width)):!f&&a<=t.left+k.width&&(p.x=Mn.Backward,m.x=s*Math.abs((t.left+k.width-a)/k.width)),{direction:p,speed:m}}function LL(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:t,left:n,right:s,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:r,width:e.clientWidth,height:e.clientHeight}}function SA(e){return e.reduce((t,n)=>Eo(t,Zb(n)),fr)}function PL(e){return e.reduce((t,n)=>t+yA(n),0)}function zL(e){return e.reduce((t,n)=>t+vA(n),0)}function UL(e,t){if(t===void 0&&(t=_c),!e)return;const{top:n,left:s,bottom:r,right:i}=t(e);xA(e)&&(r<=0||i<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const FL=[["x",["left","right"],PL],["y",["top","bottom"],zL]];class kv{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=vv(n),r=SA(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,l]of FL)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=l(s),d=r[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var r;(r=this.target)==null||r.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function BL(e){const{EventTarget:t}=gs(e);return e instanceof t?e:Ec(e)}function kg(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var Ls;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ls||(Ls={}));function z1(e){e.preventDefault()}function HL(e){e.stopPropagation()}var _t;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(_t||(_t={}));const NA={start:[_t.Space,_t.Enter],cancel:[_t.Esc],end:[_t.Space,_t.Enter,_t.Tab]},$L=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case _t.Right:return{...n,x:n.x+25};case _t.Left:return{...n,x:n.x-25};case _t.Down:return{...n,y:n.y+25};case _t.Up:return{...n,y:n.y-25}}};class EA{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new vu(Ec(n)),this.windowListeners=new vu(gs(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ls.Resize,this.handleCancel),this.windowListeners.add(Ls.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ls.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&UL(s),n(fr)}handleKeyDown(t){if(xv(t)){const{active:n,context:s,options:r}=this.props,{keyboardCodes:i=NA,coordinateGetter:a=$L,scrollBehavior:l="smooth"}=r,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=s.current,d=u?{x:u.left,y:u.top}:fr;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(t,{active:n,context:s.current,currentCoordinates:d});if(f){const h=hp(f,d),p={x:0,y:0},{scrollableAncestors:m}=s.current;for(const k of m){const w=t.code,{isTop:g,isRight:y,isLeft:b,isBottom:S,maxScroll:M,minScroll:E}=wA(k),A=LL(k),R={x:Math.min(w===_t.Right?A.right-A.width/2:A.right,Math.max(w===_t.Right?A.left:A.left+A.width/2,f.x)),y:Math.min(w===_t.Down?A.bottom-A.height/2:A.bottom,Math.max(w===_t.Down?A.top:A.top+A.height/2,f.y))},D=w===_t.Right&&!y||w===_t.Left&&!b,_=w===_t.Down&&!S||w===_t.Up&&!g;if(D&&R.x!==f.x){const z=k.scrollLeft+h.x,$=w===_t.Right&&z<=M.x||w===_t.Left&&z>=E.x;if($&&!h.y){k.scrollTo({left:z,behavior:l});return}$?p.x=k.scrollLeft-z:p.x=w===_t.Right?k.scrollLeft-M.x:k.scrollLeft-E.x,p.x&&k.scrollBy({left:-p.x,behavior:l});break}else if(_&&R.y!==f.y){const z=k.scrollTop+h.y,$=w===_t.Down&&z<=M.y||w===_t.Up&&z>=E.y;if($&&!h.x){k.scrollTo({top:z,behavior:l});return}$?p.y=k.scrollTop-z:p.y=w===_t.Down?k.scrollTop-M.y:k.scrollTop-E.y,p.y&&k.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(t,Eo(hp(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}EA.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=NA,onActivation:r}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(s.start.includes(a)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),r==null||r({event:e.nativeEvent}),!0)}return!1}}];function U1(e){return!!(e&&"distance"in e)}function F1(e){return!!(e&&"delay"in e)}class wv{constructor(t,n,s){var r;s===void 0&&(s=BL(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=Ec(a),this.documentListeners=new vu(this.document),this.listeners=new vu(s),this.windowListeners=new vu(gs(a)),this.initialCoordinates=(r=Wb(i))!=null?r:fr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:s}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ls.Resize,this.handleCancel),this.windowListeners.add(Ls.DragStart,z1),this.windowListeners.add(Ls.VisibilityChange,this.handleCancel),this.windowListeners.add(Ls.ContextMenu,z1),this.documentListeners.add(Ls.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(F1(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(U1(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:s,onPending:r}=this.props;r(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ls.Click,HL,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ls.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!r)return;const c=(n=Wb(t))!=null?n:fr,u=hp(r,c);if(!s&&l){if(U1(l)){if(l.tolerance!=null&&kg(u,l.tolerance))return this.handleCancel();if(kg(u,l.distance))return this.handleStart()}if(F1(l)&&kg(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===_t.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const GL={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Pd extends wv{constructor(t){const{event:n}=t,s=Ec(n.target);super(t,GL,s)}}Pd.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return!n.isPrimary||n.button!==0?!1:(s==null||s({event:n}),!0)}}];const KL={move:{name:"mousemove"},end:{name:"mouseup"}};var Jb;(function(e){e[e.RightClick=2]="RightClick"})(Jb||(Jb={}));class qL extends wv{constructor(t){super(t,KL,Ec(t.event.target))}}qL.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===Jb.RightClick?!1:(s==null||s({event:n}),!0)}}];const wg={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Sv extends wv{constructor(t){super(t,wg)}static setup(){return window.addEventListener(wg.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(wg.move.name,t)};function t(){}}}Sv.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:r}=n;return r.length>1?!1:(s==null||s({event:n}),!0)}}];var ku;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ku||(ku={}));var gp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(gp||(gp={}));function YL(e){let{acceleration:t,activator:n=ku.Pointer,canScroll:s,draggingRect:r,enabled:i,interval:a=5,order:l=gp.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const p=XL({delta:f,disabled:!i}),[m,k]=iL(),w=x.useRef({x:0,y:0}),g=x.useRef({x:0,y:0}),y=x.useMemo(()=>{switch(n){case ku.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ku.DraggableRect:return r}},[n,r,c]),b=x.useRef(null),S=x.useCallback(()=>{const E=b.current;if(!E)return;const A=w.current.x*g.current.x,R=w.current.y*g.current.y;E.scrollBy(A,R)},[]),M=x.useMemo(()=>l===gp.TreeOrder?[...u].reverse():u,[l,u]);x.useEffect(()=>{if(!i||!u.length||!y){k();return}for(const E of M){if((s==null?void 0:s(E))===!1)continue;const A=u.indexOf(E),R=d[A];if(!R)continue;const{direction:D,speed:_}=IL(E,R,y,t,h);for(const z of["x","y"])p[z][D[z]]||(_[z]=0,D[z]=0);if(_.x>0||_.y>0){k(),b.current=E,m(S,a),w.current=_,g.current=D;return}}w.current={x:0,y:0},g.current={x:0,y:0},k()},[t,S,s,k,i,a,JSON.stringify(y),JSON.stringify(p),m,u,M,d,JSON.stringify(h)])}const VL={x:{[Mn.Backward]:!1,[Mn.Forward]:!1},y:{[Mn.Backward]:!1,[Mn.Forward]:!1}};function XL(e){let{delta:t,disabled:n}=e;const s=Qb(t);return Id(r=>{if(n||!s||!r)return VL;const i={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[Mn.Backward]:r.x[Mn.Backward]||i.x===-1,[Mn.Forward]:r.x[Mn.Forward]||i.x===1},y:{[Mn.Backward]:r.y[Mn.Backward]||i.y===-1,[Mn.Forward]:r.y[Mn.Forward]||i.y===1}}},[n,t,s])}function QL(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return Id(r=>{var i;return t==null?null:(i=s??r)!=null?i:null},[s,t])}function WL(e,t){return x.useMemo(()=>e.reduce((n,s)=>{const{sensor:r}=s,i=r.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,s)}));return[...n,...i]},[]),[e,t])}var Yu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Yu||(Yu={}));var ex;(function(e){e.Optimized="optimized"})(ex||(ex={}));const B1=new Map;function ZL(e,t){let{dragging:n,dependencies:s,config:r}=t;const[i,a]=x.useState(null),{frequency:l,measure:c,strategy:u}=r,d=x.useRef(e),f=w(),h=Ku(f),p=x.useCallback(function(g){g===void 0&&(g=[]),!h.current&&a(y=>y===null?g:y.concat(g.filter(b=>!y.includes(b))))},[h]),m=x.useRef(null),k=Id(g=>{if(f&&!n)return B1;if(!g||g===B1||d.current!==e||i!=null){const y=new Map;for(let b of e){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){y.set(b.id,b.rect.current);continue}const S=b.node.current,M=S?new kv(c(S),S):null;b.rect.current=M,M&&y.set(b.id,M)}return y}return g},[e,i,n,f,c]);return x.useEffect(()=>{d.current=e},[e]),x.useEffect(()=>{f||p()},[n,f]),x.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),x.useEffect(()=>{f||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},l))},[l,f,p,...s]),{droppableRects:k,measureDroppableContainers:p,measuringScheduled:i!=null};function w(){switch(u){case Yu.Always:return!1;case Yu.BeforeDragging:return n;default:return!n}}}function _A(e,t){return Id(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function JL(e,t){return _A(e,t)}function eP(e){let{callback:t,disabled:n}=e;const s=bv(t),r=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(s)},[s,n]);return x.useEffect(()=>()=>r==null?void 0:r.disconnect(),[r]),r}function sm(e){let{callback:t,disabled:n}=e;const s=bv(t),r=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(s)},[n]);return x.useEffect(()=>()=>r==null?void 0:r.disconnect(),[r]),r}function tP(e){return new kv(_c(e),e)}function H1(e,t,n){t===void 0&&(t=tP);const[s,r]=x.useState(null);function i(){r(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const a=eP({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=sm({callback:i});return Lr(()=>{i(),e?(l==null||l.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[e]),s}function nP(e){const t=_A(e);return bA(e,t)}const $1=[];function sP(e){const t=x.useRef(e),n=Id(s=>e?s&&s!==$1&&e&&t.current&&e.parentNode===t.current.parentNode?s:vv(e):$1,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function rP(e){const[t,n]=x.useState(null),s=x.useRef(e),r=x.useCallback(i=>{const a=vg(i.target);a&&n(l=>l?(l.set(a,Zb(a)),new Map(l)):null)},[]);return x.useEffect(()=>{const i=s.current;if(e!==i){a(i);const l=e.map(c=>{const u=vg(c);return u?(u.addEventListener("scroll",r,{passive:!0}),[u,Zb(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),s.current=e}return()=>{a(e),a(i)};function a(l){l.forEach(c=>{const u=vg(c);u==null||u.removeEventListener("scroll",r)})}},[r,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,a)=>Eo(i,a),fr):SA(e):fr,[e,t])}function G1(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const s=e!==fr;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?hp(e,n.current):fr}function iP(e){x.useEffect(()=>{if(!nm)return;const t=e.map(n=>{let{sensor:s}=n;return s.setup==null?void 0:s.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function aP(e,t){return x.useMemo(()=>e.reduce((n,s)=>{let{eventName:r,handler:i}=s;return n[r]=a=>{i(a,t)},n},{}),[e,t])}function CA(e){return x.useMemo(()=>e?jL(e):null,[e])}const K1=[];function lP(e,t){t===void 0&&(t=_c);const[n]=e,s=CA(n?gs(n):null),[r,i]=x.useState(K1);function a(){i(()=>e.length?e.map(c=>kA(c)?s:new kv(t(c),c)):K1)}const l=sm({callback:a});return Lr(()=>{l==null||l.disconnect(),a(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),r}function oP(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Dd(t)?t:e}function cP(e){let{measure:t}=e;const[n,s]=x.useState(null),r=x.useCallback(u=>{for(const{target:d}of u)if(Dd(d)){s(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=sm({callback:r}),a=x.useCallback(u=>{const d=oP(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),s(d?t(d):null)},[t,i]),[l,c]=fp(a);return x.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const uP=[{sensor:Pd,options:{}},{sensor:EA,options:{}}],dP={current:{}},Nh={draggable:{measure:P1},droppable:{measure:P1,strategy:Yu.WhileDragging,frequency:ex.Optimized},dragOverlay:{measure:_c}};class wu extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const fP={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new wu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:mp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Nh,measureDroppableContainers:mp,windowRect:null,measuringScheduled:!1},hP={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:mp,draggableNodes:new Map,over:null,measureDroppableContainers:mp},rm=x.createContext(hP),TA=x.createContext(fP);function pP(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new wu}}}function mP(e,t){switch(t.type){case wn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case wn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case wn.DragEnd:case wn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case wn.RegisterDroppable:{const{element:n}=t,{id:s}=n,r=new wu(e.droppable.containers);return r.set(s,n),{...e,droppable:{...e.droppable,containers:r}}}case wn.SetDroppableDisabled:{const{id:n,key:s,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||s!==i.key)return e;const a=new wu(e.droppable.containers);return a.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case wn.UnregisterDroppable:{const{id:n,key:s}=t,r=e.droppable.containers.get(n);if(!r||s!==r.key)return e;const i=new wu(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function gP(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:r}=x.useContext(rm),i=Qb(s),a=Qb(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!s&&i&&a!=null){if(!xv(i)||document.activeElement===i.target)return;const l=r.get(a);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=oL(d);if(f){f.focus();break}}})}},[s,t,r,a,i]),null}function bP(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...s}),n):n}function xP(e){return x.useMemo(()=>({draggable:{...Nh.draggable,...e==null?void 0:e.draggable},droppable:{...Nh.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Nh.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function yP(e){let{activeNode:t,measure:n,initialRect:s,config:r=!0}=e;const i=x.useRef(!1),{x:a,y:l}=typeof r=="boolean"?{x:r,y:r}:r;Lr(()=>{if(!a&&!l||!t){i.current=!1;return}if(i.current||!s)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=bA(d,s);if(a||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=xA(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,a,l,s,n])}const AA=x.createContext({...fr,scaleX:1,scaleY:1});var Vi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Vi||(Vi={}));const Nv=x.memo(function(t){var n,s,r,i;let{id:a,accessibility:l,autoScroll:c=!0,children:u,sensors:d=uP,collisionDetection:f=NL,measuring:h,modifiers:p,...m}=t;const k=x.useReducer(mP,void 0,pP),[w,g]=k,[y,b]=pL(),[S,M]=x.useState(Vi.Uninitialized),E=S===Vi.Initialized,{draggable:{active:A,nodes:R,translate:D},droppable:{containers:_}}=w,z=A!=null?R.get(A):null,$=x.useRef({initial:null,translated:null}),H=x.useMemo(()=>{var Me;return A!=null?{id:A,data:(Me=z==null?void 0:z.data)!=null?Me:dP,rect:$}:null},[A,z]),I=x.useRef(null),[L,C]=x.useState(null),[O,U]=x.useState(null),F=Ku(m,Object.values(m)),j=Ld("DndDescribedBy",a),N=x.useMemo(()=>_.getEnabled(),[_]),G=xP(h),{droppableRects:T,measureDroppableContainers:Z,measuringScheduled:te}=ZL(N,{dragging:E,dependencies:[D.x,D.y],config:G.droppable}),Q=QL(R,A),pe=x.useMemo(()=>O?Wb(O):null,[O]),V=_e(),q=JL(Q,G.draggable.measure);yP({activeNode:A!=null?R.get(A):null,config:V.layoutShiftCompensation,initialRect:q,measure:G.draggable.measure});const Y=H1(Q,G.draggable.measure,q),J=H1(Q?Q.parentElement:null),ce=x.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:T,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ke=_.getNodeFor((n=ce.current.over)==null?void 0:n.id),Ae=cP({measure:G.dragOverlay.measure}),je=(s=Ae.nodeRef.current)!=null?s:Q,ae=E?(r=Ae.rect)!=null?r:Y:null,Oe=!!(Ae.nodeRef.current&&Ae.rect),ye=nP(Oe?null:Y),ge=CA(je?gs(je):null),be=sP(E?ke??Q:null),$e=lP(be),ft=bP(p,{transform:{x:D.x-ye.x,y:D.y-ye.y,scaleX:1,scaleY:1},activatorEvent:O,active:H,activeNodeRect:Y,containerNodeRect:J,draggingNodeRect:ae,over:ce.current.over,overlayNodeRect:Ae.rect,scrollableAncestors:be,scrollableAncestorRects:$e,windowRect:ge}),mt=pe?Eo(pe,D):null,rt=rP(be),nt=G1(rt),ee=G1(rt,[Y]),ne=Eo(ft,nt),Ce=ae?CL(ae,ft):null,v=H&&Ce?f({active:H,collisionRect:Ce,droppableRects:T,droppableContainers:N,pointerCoordinates:mt}):null,X=kL(v,"id"),[de,xe]=x.useState(null),fe=Oe?ft:Eo(ft,ee),P=EL(fe,(i=de==null?void 0:de.rect)!=null?i:null,Y),oe=x.useRef(null),le=x.useCallback((Me,Fe)=>{let{sensor:De,options:He}=Fe;if(I.current==null)return;const Ge=R.get(I.current);if(!Ge)return;const xt=Me.nativeEvent,Mt=new De({active:I.current,activeNode:Ge,event:xt,options:He,context:ce,onAbort(Dt){if(!R.get(Dt))return;const{onDragAbort:zt}=F.current,Ht={id:Dt};zt==null||zt(Ht),y({type:"onDragAbort",event:Ht})},onPending(Dt,Wt,zt,Ht){if(!R.get(Dt))return;const{onDragPending:Pe}=F.current,Be={id:Dt,constraint:Wt,initialCoordinates:zt,offset:Ht};Pe==null||Pe(Be),y({type:"onDragPending",event:Be})},onStart(Dt){const Wt=I.current;if(Wt==null)return;const zt=R.get(Wt);if(!zt)return;const{onDragStart:Ht}=F.current,se={activatorEvent:xt,active:{id:Wt,data:zt.data,rect:$}};un.unstable_batchedUpdates(()=>{Ht==null||Ht(se),M(Vi.Initializing),g({type:wn.DragStart,initialCoordinates:Dt,active:Wt}),y({type:"onDragStart",event:se}),C(oe.current),U(xt)})},onMove(Dt){g({type:wn.DragMove,coordinates:Dt})},onEnd:Ot(wn.DragEnd),onCancel:Ot(wn.DragCancel)});oe.current=Mt;function Ot(Dt){return async function(){const{active:zt,collisions:Ht,over:se,scrollAdjustedTranslate:Pe}=ce.current;let Be=null;if(zt&&Pe){const{cancelDrop:it}=F.current;Be={activatorEvent:xt,active:zt,collisions:Ht,delta:Pe,over:se},Dt===wn.DragEnd&&typeof it=="function"&&await Promise.resolve(it(Be))&&(Dt=wn.DragCancel)}I.current=null,un.unstable_batchedUpdates(()=>{g({type:Dt}),M(Vi.Uninitialized),xe(null),C(null),U(null),oe.current=null;const it=Dt===wn.DragEnd?"onDragEnd":"onDragCancel";if(Be){const Ze=F.current[it];Ze==null||Ze(Be),y({type:it,event:Be})}})}}},[R]),ve=x.useCallback((Me,Fe)=>(De,He)=>{const Ge=De.nativeEvent,xt=R.get(He);if(I.current!==null||!xt||Ge.dndKit||Ge.defaultPrevented)return;const Mt={active:xt};Me(De,Fe.options,Mt)===!0&&(Ge.dndKit={capturedBy:Fe.sensor},I.current=He,le(De,Fe))},[R,le]),Se=WL(d,ve);iP(d),Lr(()=>{Y&&S===Vi.Initializing&&M(Vi.Initialized)},[Y,S]),x.useEffect(()=>{const{onDragMove:Me}=F.current,{active:Fe,activatorEvent:De,collisions:He,over:Ge}=ce.current;if(!Fe||!De)return;const xt={active:Fe,activatorEvent:De,collisions:He,delta:{x:ne.x,y:ne.y},over:Ge};un.unstable_batchedUpdates(()=>{Me==null||Me(xt),y({type:"onDragMove",event:xt})})},[ne.x,ne.y]),x.useEffect(()=>{const{active:Me,activatorEvent:Fe,collisions:De,droppableContainers:He,scrollAdjustedTranslate:Ge}=ce.current;if(!Me||I.current==null||!Fe||!Ge)return;const{onDragOver:xt}=F.current,Mt=He.get(X),Ot=Mt&&Mt.rect.current?{id:Mt.id,rect:Mt.rect.current,data:Mt.data,disabled:Mt.disabled}:null,Dt={active:Me,activatorEvent:Fe,collisions:De,delta:{x:Ge.x,y:Ge.y},over:Ot};un.unstable_batchedUpdates(()=>{xe(Ot),xt==null||xt(Dt),y({type:"onDragOver",event:Dt})})},[X]),Lr(()=>{ce.current={activatorEvent:O,active:H,activeNode:Q,collisionRect:Ce,collisions:v,droppableRects:T,draggableNodes:R,draggingNode:je,draggingNodeRect:ae,droppableContainers:_,over:de,scrollableAncestors:be,scrollAdjustedTranslate:ne},$.current={initial:ae,translated:Ce}},[H,Q,v,Ce,R,je,ae,T,_,de,be,ne]),YL({...V,delta:D,draggingRect:Ce,pointerCoordinates:mt,scrollableAncestors:be,scrollableAncestorRects:$e});const Ne=x.useMemo(()=>({active:H,activeNode:Q,activeNodeRect:Y,activatorEvent:O,collisions:v,containerNodeRect:J,dragOverlay:Ae,draggableNodes:R,droppableContainers:_,droppableRects:T,over:de,measureDroppableContainers:Z,scrollableAncestors:be,scrollableAncestorRects:$e,measuringConfiguration:G,measuringScheduled:te,windowRect:ge}),[H,Q,Y,O,v,J,Ae,R,_,T,de,Z,be,$e,G,te,ge]),ue=x.useMemo(()=>({activatorEvent:O,activators:Se,active:H,activeNodeRect:Y,ariaDescribedById:{draggable:j},dispatch:g,draggableNodes:R,over:de,measureDroppableContainers:Z}),[O,Se,H,Y,g,j,R,de,Z]);return Jn.createElement(gA.Provider,{value:b},Jn.createElement(rm.Provider,{value:ue},Jn.createElement(TA.Provider,{value:Ne},Jn.createElement(AA.Provider,{value:P},u)),Jn.createElement(gP,{disabled:(l==null?void 0:l.restoreFocus)===!1})),Jn.createElement(bL,{...l,hiddenTextDescribedById:j}));function _e(){const Me=(L==null?void 0:L.autoScrollEnabled)===!1,Fe=typeof c=="object"?c.enabled===!1:c===!1,De=E&&!Me&&!Fe;return typeof c=="object"?{...c,enabled:De}:{enabled:De}}}),vP=x.createContext(null),q1="button",kP="Draggable";function im(e){let{id:t,data:n,disabled:s=!1,attributes:r}=e;const i=Ld(kP),{activators:a,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=x.useContext(rm),{role:p=q1,roleDescription:m="draggable",tabIndex:k=0}=r??{},w=(c==null?void 0:c.id)===t,g=x.useContext(w?AA:vP),[y,b]=fp(),[S,M]=fp(),E=aP(a,t),A=Ku(n);Lr(()=>(f.set(t,{id:t,key:i,node:y,activatorNode:S,data:A}),()=>{const D=f.get(t);D&&D.key===i&&f.delete(t)}),[f,t]);const R=x.useMemo(()=>({role:p,tabIndex:k,"aria-disabled":s,"aria-pressed":w&&p===q1?!0:void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[s,p,k,w,m,d.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:R,isDragging:w,listeners:s?void 0:E,node:y,over:h,setNodeRef:b,setActivatorNodeRef:M,transform:g}}function wP(){return x.useContext(TA)}const SP="Droppable",NP={timeout:25};function Ev(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:r}=e;const i=Ld(SP),{active:a,dispatch:l,over:c,measureDroppableContainers:u}=x.useContext(rm),d=x.useRef({disabled:n}),f=x.useRef(!1),h=x.useRef(null),p=x.useRef(null),{disabled:m,updateMeasurementsFor:k,timeout:w}={...NP,...r},g=Ku(k??s),y=x.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),p.current=null},w)},[w]),b=sm({callback:y,disabled:m||!a}),S=x.useCallback((R,D)=>{b&&(D&&(b.unobserve(D),f.current=!1),R&&b.observe(R))},[b]),[M,E]=fp(S),A=Ku(t);return x.useEffect(()=>{!b||!M.current||(b.disconnect(),f.current=!1,b.observe(M.current))},[M,b]),x.useEffect(()=>(l({type:wn.RegisterDroppable,element:{id:s,key:i,disabled:n,node:M,rect:h,data:A}}),()=>l({type:wn.UnregisterDroppable,key:i,id:s})),[s]),x.useEffect(()=>{n!==d.current.disabled&&(l({type:wn.SetDroppableDisabled,id:s,key:i,disabled:n}),d.current.disabled=n)},[s,i,n,l]),{active:a,rect:h,isOver:(c==null?void 0:c.id)===s,node:M,over:c,setNodeRef:E}}/**
54
+ * @license lucide-react v0.460.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ */const EP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MA=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
59
+ * @license lucide-react v0.460.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */var _P={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
64
+ * @license lucide-react v0.460.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */const CP=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:r="",children:i,iconNode:a,...l},c)=>x.createElement("svg",{ref:c,..._P,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:MA("lucide",r),...l},[...a.map(([u,d])=>x.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
69
+ * @license lucide-react v0.460.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */const Ue=(e,t)=>{const n=x.forwardRef(({className:s,...r},i)=>x.createElement(CP,{ref:i,iconNode:t,className:MA(`lucide-${EP(e)}`,s),...r}));return n.displayName=`${e}`,n};/**
74
+ * @license lucide-react v0.460.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */const jA=Ue("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
79
+ * @license lucide-react v0.460.0 - ISC
80
+ *
81
+ * This source code is licensed under the ISC license.
82
+ * See the LICENSE file in the root directory of this source tree.
83
+ */const TP=Ue("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
84
+ * @license lucide-react v0.460.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */const _f=Ue("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
89
+ * @license lucide-react v0.460.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */const AP=Ue("Asterisk",[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]]);/**
94
+ * @license lucide-react v0.460.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */const RA=Ue("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
99
+ * @license lucide-react v0.460.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */const MP=Ue("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/**
104
+ * @license lucide-react v0.460.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */const OA=Ue("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
109
+ * @license lucide-react v0.460.0 - ISC
110
+ *
111
+ * This source code is licensed under the ISC license.
112
+ * See the LICENSE file in the root directory of this source tree.
113
+ */const tx=Ue("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
114
+ * @license lucide-react v0.460.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */const jP=Ue("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
119
+ * @license lucide-react v0.460.0 - ISC
120
+ *
121
+ * This source code is licensed under the ISC license.
122
+ * See the LICENSE file in the root directory of this source tree.
123
+ */const cr=Ue("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
124
+ * @license lucide-react v0.460.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */const Bn=Ue("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
129
+ * @license lucide-react v0.460.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */const ns=Ue("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
134
+ * @license lucide-react v0.460.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const zd=Ue("ChevronsDownUp",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);/**
139
+ * @license lucide-react v0.460.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const Ud=Ue("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
144
+ * @license lucide-react v0.460.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const RP=Ue("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
149
+ * @license lucide-react v0.460.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */const DA=Ue("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
154
+ * @license lucide-react v0.460.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const OP=Ue("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
159
+ * @license lucide-react v0.460.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const DP=Ue("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
164
+ * @license lucide-react v0.460.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */const IP=Ue("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
169
+ * @license lucide-react v0.460.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */const Vu=Ue("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
174
+ * @license lucide-react v0.460.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */const LP=Ue("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
179
+ * @license lucide-react v0.460.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */const PP=Ue("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
184
+ * @license lucide-react v0.460.0 - ISC
185
+ *
186
+ * This source code is licensed under the ISC license.
187
+ * See the LICENSE file in the root directory of this source tree.
188
+ */const _v=Ue("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
189
+ * @license lucide-react v0.460.0 - ISC
190
+ *
191
+ * This source code is licensed under the ISC license.
192
+ * See the LICENSE file in the root directory of this source tree.
193
+ */const zP=Ue("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
194
+ * @license lucide-react v0.460.0 - ISC
195
+ *
196
+ * This source code is licensed under the ISC license.
197
+ * See the LICENSE file in the root directory of this source tree.
198
+ */const UP=Ue("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
199
+ * @license lucide-react v0.460.0 - ISC
200
+ *
201
+ * This source code is licensed under the ISC license.
202
+ * See the LICENSE file in the root directory of this source tree.
203
+ */const Ta=Ue("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
204
+ * @license lucide-react v0.460.0 - ISC
205
+ *
206
+ * This source code is licensed under the ISC license.
207
+ * See the LICENSE file in the root directory of this source tree.
208
+ */const FP=Ue("FileSymlink",[["path",{d:"m10 18 3-3-3-3",key:"18f6ys"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 11V4a2 2 0 0 1 2-2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7",key:"50q2rw"}]]);/**
209
+ * @license lucide-react v0.460.0 - ISC
210
+ *
211
+ * This source code is licensed under the ISC license.
212
+ * See the LICENSE file in the root directory of this source tree.
213
+ */const Fd=Ue("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
214
+ * @license lucide-react v0.460.0 - ISC
215
+ *
216
+ * This source code is licensed under the ISC license.
217
+ * See the LICENSE file in the root directory of this source tree.
218
+ */const BP=Ue("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
219
+ * @license lucide-react v0.460.0 - ISC
220
+ *
221
+ * This source code is licensed under the ISC license.
222
+ * See the LICENSE file in the root directory of this source tree.
223
+ */const IA=Ue("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
224
+ * @license lucide-react v0.460.0 - ISC
225
+ *
226
+ * This source code is licensed under the ISC license.
227
+ * See the LICENSE file in the root directory of this source tree.
228
+ */const LA=Ue("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
229
+ * @license lucide-react v0.460.0 - ISC
230
+ *
231
+ * This source code is licensed under the ISC license.
232
+ * See the LICENSE file in the root directory of this source tree.
233
+ */const ar=Ue("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
234
+ * @license lucide-react v0.460.0 - ISC
235
+ *
236
+ * This source code is licensed under the ISC license.
237
+ * See the LICENSE file in the root directory of this source tree.
238
+ */const nx=Ue("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
239
+ * @license lucide-react v0.460.0 - ISC
240
+ *
241
+ * This source code is licensed under the ISC license.
242
+ * See the LICENSE file in the root directory of this source tree.
243
+ */const HP=Ue("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
244
+ * @license lucide-react v0.460.0 - ISC
245
+ *
246
+ * This source code is licensed under the ISC license.
247
+ * See the LICENSE file in the root directory of this source tree.
248
+ */const dl=Ue("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
249
+ * @license lucide-react v0.460.0 - ISC
250
+ *
251
+ * This source code is licensed under the ISC license.
252
+ * See the LICENSE file in the root directory of this source tree.
253
+ */const $P=Ue("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
254
+ * @license lucide-react v0.460.0 - ISC
255
+ *
256
+ * This source code is licensed under the ISC license.
257
+ * See the LICENSE file in the root directory of this source tree.
258
+ */const PA=Ue("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
259
+ * @license lucide-react v0.460.0 - ISC
260
+ *
261
+ * This source code is licensed under the ISC license.
262
+ * See the LICENSE file in the root directory of this source tree.
263
+ */const GP=Ue("Grip",[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]]);/**
264
+ * @license lucide-react v0.460.0 - ISC
265
+ *
266
+ * This source code is licensed under the ISC license.
267
+ * See the LICENSE file in the root directory of this source tree.
268
+ */const KP=Ue("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
269
+ * @license lucide-react v0.460.0 - ISC
270
+ *
271
+ * This source code is licensed under the ISC license.
272
+ * See the LICENSE file in the root directory of this source tree.
273
+ */const sx=Ue("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
274
+ * @license lucide-react v0.460.0 - ISC
275
+ *
276
+ * This source code is licensed under the ISC license.
277
+ * See the LICENSE file in the root directory of this source tree.
278
+ */const qP=Ue("Hexagon",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]]);/**
279
+ * @license lucide-react v0.460.0 - ISC
280
+ *
281
+ * This source code is licensed under the ISC license.
282
+ * See the LICENSE file in the root directory of this source tree.
283
+ */const YP=Ue("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
284
+ * @license lucide-react v0.460.0 - ISC
285
+ *
286
+ * This source code is licensed under the ISC license.
287
+ * See the LICENSE file in the root directory of this source tree.
288
+ */const Cf=Ue("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
289
+ * @license lucide-react v0.460.0 - ISC
290
+ *
291
+ * This source code is licensed under the ISC license.
292
+ * See the LICENSE file in the root directory of this source tree.
293
+ */const VP=Ue("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
294
+ * @license lucide-react v0.460.0 - ISC
295
+ *
296
+ * This source code is licensed under the ISC license.
297
+ * See the LICENSE file in the root directory of this source tree.
298
+ */const XP=Ue("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
299
+ * @license lucide-react v0.460.0 - ISC
300
+ *
301
+ * This source code is licensed under the ISC license.
302
+ * See the LICENSE file in the root directory of this source tree.
303
+ */const zA=Ue("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
304
+ * @license lucide-react v0.460.0 - ISC
305
+ *
306
+ * This source code is licensed under the ISC license.
307
+ * See the LICENSE file in the root directory of this source tree.
308
+ */const QP=Ue("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
309
+ * @license lucide-react v0.460.0 - ISC
310
+ *
311
+ * This source code is licensed under the ISC license.
312
+ * See the LICENSE file in the root directory of this source tree.
313
+ */const zn=Ue("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
314
+ * @license lucide-react v0.460.0 - ISC
315
+ *
316
+ * This source code is licensed under the ISC license.
317
+ * See the LICENSE file in the root directory of this source tree.
318
+ */const WP=Ue("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
319
+ * @license lucide-react v0.460.0 - ISC
320
+ *
321
+ * This source code is licensed under the ISC license.
322
+ * See the LICENSE file in the root directory of this source tree.
323
+ */const UA=Ue("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
324
+ * @license lucide-react v0.460.0 - ISC
325
+ *
326
+ * This source code is licensed under the ISC license.
327
+ * See the LICENSE file in the root directory of this source tree.
328
+ */const FA=Ue("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
329
+ * @license lucide-react v0.460.0 - ISC
330
+ *
331
+ * This source code is licensed under the ISC license.
332
+ * See the LICENSE file in the root directory of this source tree.
333
+ */const ZP=Ue("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
334
+ * @license lucide-react v0.460.0 - ISC
335
+ *
336
+ * This source code is licensed under the ISC license.
337
+ * See the LICENSE file in the root directory of this source tree.
338
+ */const JP=Ue("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
339
+ * @license lucide-react v0.460.0 - ISC
340
+ *
341
+ * This source code is licensed under the ISC license.
342
+ * See the LICENSE file in the root directory of this source tree.
343
+ */const rx=Ue("PackageX",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["path",{d:"m17 13 5 5m-5 0 5-5",key:"im3w4b"}]]);/**
344
+ * @license lucide-react v0.460.0 - ISC
345
+ *
346
+ * This source code is licensed under the ISC license.
347
+ * See the LICENSE file in the root directory of this source tree.
348
+ */const Xu=Ue("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
349
+ * @license lucide-react v0.460.0 - ISC
350
+ *
351
+ * This source code is licensed under the ISC license.
352
+ * See the LICENSE file in the root directory of this source tree.
353
+ */const e6=Ue("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
354
+ * @license lucide-react v0.460.0 - ISC
355
+ *
356
+ * This source code is licensed under the ISC license.
357
+ * See the LICENSE file in the root directory of this source tree.
358
+ */const Cv=Ue("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
359
+ * @license lucide-react v0.460.0 - ISC
360
+ *
361
+ * This source code is licensed under the ISC license.
362
+ * See the LICENSE file in the root directory of this source tree.
363
+ */const Bd=Ue("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
364
+ * @license lucide-react v0.460.0 - ISC
365
+ *
366
+ * This source code is licensed under the ISC license.
367
+ * See the LICENSE file in the root directory of this source tree.
368
+ */const Fl=Ue("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
369
+ * @license lucide-react v0.460.0 - ISC
370
+ *
371
+ * This source code is licensed under the ISC license.
372
+ * See the LICENSE file in the root directory of this source tree.
373
+ */const ix=Ue("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
374
+ * @license lucide-react v0.460.0 - ISC
375
+ *
376
+ * This source code is licensed under the ISC license.
377
+ * See the LICENSE file in the root directory of this source tree.
378
+ */const ic=Ue("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
379
+ * @license lucide-react v0.460.0 - ISC
380
+ *
381
+ * This source code is licensed under the ISC license.
382
+ * See the LICENSE file in the root directory of this source tree.
383
+ */const Sg=Ue("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
384
+ * @license lucide-react v0.460.0 - ISC
385
+ *
386
+ * This source code is licensed under the ISC license.
387
+ * See the LICENSE file in the root directory of this source tree.
388
+ */const Y1=Ue("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
389
+ * @license lucide-react v0.460.0 - ISC
390
+ *
391
+ * This source code is licensed under the ISC license.
392
+ * See the LICENSE file in the root directory of this source tree.
393
+ */const BA=Ue("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
394
+ * @license lucide-react v0.460.0 - ISC
395
+ *
396
+ * This source code is licensed under the ISC license.
397
+ * See the LICENSE file in the root directory of this source tree.
398
+ */const t6=Ue("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
399
+ * @license lucide-react v0.460.0 - ISC
400
+ *
401
+ * This source code is licensed under the ISC license.
402
+ * See the LICENSE file in the root directory of this source tree.
403
+ */const HA=Ue("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
404
+ * @license lucide-react v0.460.0 - ISC
405
+ *
406
+ * This source code is licensed under the ISC license.
407
+ * See the LICENSE file in the root directory of this source tree.
408
+ */const am=Ue("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
409
+ * @license lucide-react v0.460.0 - ISC
410
+ *
411
+ * This source code is licensed under the ISC license.
412
+ * See the LICENSE file in the root directory of this source tree.
413
+ */const $A=Ue("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
414
+ * @license lucide-react v0.460.0 - ISC
415
+ *
416
+ * This source code is licensed under the ISC license.
417
+ * See the LICENSE file in the root directory of this source tree.
418
+ */const GA=Ue("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
419
+ * @license lucide-react v0.460.0 - ISC
420
+ *
421
+ * This source code is licensed under the ISC license.
422
+ * See the LICENSE file in the root directory of this source tree.
423
+ */const V1=Ue("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
424
+ * @license lucide-react v0.460.0 - ISC
425
+ *
426
+ * This source code is licensed under the ISC license.
427
+ * See the LICENSE file in the root directory of this source tree.
428
+ */const Tv=Ue("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
429
+ * @license lucide-react v0.460.0 - ISC
430
+ *
431
+ * This source code is licensed under the ISC license.
432
+ * See the LICENSE file in the root directory of this source tree.
433
+ */const n6=Ue("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
434
+ * @license lucide-react v0.460.0 - ISC
435
+ *
436
+ * This source code is licensed under the ISC license.
437
+ * See the LICENSE file in the root directory of this source tree.
438
+ */const Av=Ue("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
439
+ * @license lucide-react v0.460.0 - ISC
440
+ *
441
+ * This source code is licensed under the ISC license.
442
+ * See the LICENSE file in the root directory of this source tree.
443
+ */const Qs=Ue("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
444
+ * @license lucide-react v0.460.0 - ISC
445
+ *
446
+ * This source code is licensed under the ISC license.
447
+ * See the LICENSE file in the root directory of this source tree.
448
+ */const lm=Ue("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
449
+ * @license lucide-react v0.460.0 - ISC
450
+ *
451
+ * This source code is licensed under the ISC license.
452
+ * See the LICENSE file in the root directory of this source tree.
453
+ */const ax=Ue("Waypoints",[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]]);/**
454
+ * @license lucide-react v0.460.0 - ISC
455
+ *
456
+ * This source code is licensed under the ISC license.
457
+ * See the LICENSE file in the root directory of this source tree.
458
+ */const s6=Ue("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
459
+ * @license lucide-react v0.460.0 - ISC
460
+ *
461
+ * This source code is licensed under the ISC license.
462
+ * See the LICENSE file in the root directory of this source tree.
463
+ */const KA=Ue("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
464
+ * @license lucide-react v0.460.0 - ISC
465
+ *
466
+ * This source code is licensed under the ISC license.
467
+ * See the LICENSE file in the root directory of this source tree.
468
+ */const r6=Ue("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
469
+ * @license lucide-react v0.460.0 - ISC
470
+ *
471
+ * This source code is licensed under the ISC license.
472
+ * See the LICENSE file in the root directory of this source tree.
473
+ */const tn=Ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
474
+ * @license lucide-react v0.460.0 - ISC
475
+ *
476
+ * This source code is licensed under the ISC license.
477
+ * See the LICENSE file in the root directory of this source tree.
478
+ */const om=Ue("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ac={claude:{label:"Claude",tooltip:"Claude Code",badge:"border-orange-800/50 bg-orange-900/40 text-orange-300",source:"bg-orange-900/40 text-orange-300",icon:AP,iconRunning:"text-orange-400",iconIdle:"text-orange-400/45",runAnimation:"harness-run-claude",dotDir:".claude"},codex:{label:"Codex",tooltip:"Codex",badge:"border-cyan-800/50 bg-cyan-900/40 text-cyan-300",source:"bg-cyan-900/40 text-cyan-300",icon:qP,iconRunning:"text-cyan-400",iconIdle:"text-cyan-400/45",runAnimation:"harness-run-codex",dotDir:".codex"}},Ng={label:"",tooltip:"",badge:"border-neutral-700/50 bg-neutral-800/40 text-neutral-300",source:"bg-neutral-800 text-neutral-400",icon:zn,iconRunning:"text-neutral-300",iconIdle:"text-neutral-500",runAnimation:"",dotDir:""},nn=Object.keys(ac);function Kn(e){return e&&e in ac?ac[e]:{...Ng,label:e??Ng.label,tooltip:e??Ng.tooltip}}class qA extends Error{constructor(t,n){super(t),this.status=n,this.name="AuthError"}}const Mv="/api";let lx="unknown";const ox=new Set;function Qu(e){if(lx!==e){lx=e;for(const t of ox)t()}}function jv(){return lx}function YA(e){return ox.add(e),()=>ox.delete(e)}function VA(){return x.useSyncExternalStore(YA,jv)}async function i6(e){const t=await e.text();try{const n=JSON.parse(t);if(typeof n.error=="string"&&n.error)return n.error}catch{}return t||String(e.status)}async function XA(){try{const e=await fetch(`${Mv}/auth/status`);if(!e.ok){Qu("anonymous");return}const t=await e.json();Qu(t.authenticated===!0?"authenticated":"anonymous")}catch{}}async function a6(e){const t=await fetch(`${Mv}/auth/login`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({password:e})});if(!t.ok)throw new qA(await i6(t),t.status);Qu("authenticated")}async function l6(){try{await fetch(`${Mv}/auth/logout`,{method:"POST"})}catch{}Qu("anonymous")}function o6(){Qu("anonymous")}function c6(){XA()}const mi="/api",za=mi;async function ze(e,t){const n=await fetch(`${mi}${e}`,{...t,headers:{"content-type":"application/json",...t==null?void 0:t.headers}});if(n.status===401)throw o6(),new Error(await X1(n));if(!n.ok)throw new Error(await X1(n));return await n.json()}async function X1(e){const t=await e.text();try{const n=JSON.parse(t);if(typeof n.error=="string"&&n.error)return n.error;if(typeof n.message=="string"&&n.message)return n.message}catch{}return t?`${e.status} ${t}`:String(e.status)}function Wu(e){return e.kind==="claude-event"?{kind:"hook-event",harness:"claude",event:e.event}:e}function u6(e){return e.kind==="claude-event"?"claude":e.kind==="hook-event"?e.harness:null}const QA=["PreToolUse","PostToolUse","UserPromptSubmit","SessionStart","Stop","SubagentStop","Notification","PreCompact","SessionEnd","PreModelSwitch","PostModelSwitch"],Eg=["PostToolUse","UserPromptSubmit","SessionStart","Stop","SubagentStop"],WA=["command","agent","workflow","rule","output-style"];function Hd(e){return nn.find(t=>e.startsWith(t))??null}const ZA=["gray","red","green","yellow","blue","magenta","cyan"],Q1="0.1.0",d6={project:["name","path"],git:["branch","repo"],git_user:["user","email"],changes:["added","deleted","files"],model:["model"],thinking:["level"],context:["bar","used","total","percent","remaining"],tokens:["total","percent"],cost:["cost","duration","api_duration","lines_added","lines_removed"],rate:["percent","limit","resets"],time:["time"],version:["version"],output_style:["style"],session:["name"],exceeds200k:["over"],fast_mode:["mode"],vim:["mode"],pr:["number","state","url"],worktree:["name","branch"],agent:["name"]},JA={project:"{name}",git:"{branch}",git_user:"{user} <{email}>",changes:"{files}",model:"{model}",thinking:"{level}",context:"{percent}% {bar}",tokens:"{total}",cost:"{cost}",rate:"{limit} {percent}%",time:"{time}",version:"{version}",output_style:"{style}",session:"{name}",exceeds200k:"{over}",fast_mode:"{mode}",vim:"{mode}",pr:"#{number}",worktree:"{name}",agent:"{name}"},f6={percent:"{percent}%",bar:"{bar}",both:"{percent}% {bar}"},Ee={listProjects:()=>ze("/projects").then(e=>e.projects),listArchivedProjects:()=>ze("/projects/archived").then(e=>e.projects),archiveProject:e=>ze(`/projects/${e}/archive`,{method:"POST"}),restoreProject:e=>ze(`/projects/${e}/restore`,{method:"POST"}),reorderProjects:e=>ze("/projects/order",{method:"PUT",body:JSON.stringify({ids:e})}).then(t=>t.projects),listAssets:e=>ze(`/assets?path=${encodeURIComponent(e)}`).then(t=>t.assets),listGlobalFileAssets:()=>ze("/global-file-assets").then(e=>e.assets),listSessionHooks:(e,t,n=300,s,r)=>ze(`/projects/${e}/hooks?sessionId=${encodeURIComponent(t)}&limit=${n}${s===void 0?"":`&beforeId=${s}`}${r!=null&&r.length?`&types=${encodeURIComponent(r.join(","))}`:""}`).then(i=>i.events),listHooksRules:e=>ze(`/hooks/rules${e===void 0?"":`?projectId=${e}`}`).then(t=>t.rules),createHookRule:e=>ze("/hooks/rules",{method:"POST",body:JSON.stringify(e)}).then(t=>t.rule),updateHookRule:(e,t)=>ze(`/hooks/rules/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}).then(n=>n.rule),deleteHookRule:e=>ze(`/hooks/rules/${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),listHookPlugins:e=>ze(`/hooks/plugins${e===void 0?"":`?projectId=${e}`}`).then(t=>t.plugins),toggleHookPlugin:(e,t,n)=>ze(`/hooks/plugins/${encodeURIComponent(e)}/toggle`,{method:"POST",body:JSON.stringify(n===void 0?{enabled:t}:{enabled:t,projectId:n})}).then(()=>{}),installHookPlugin:e=>ze("/hooks/plugins",{method:"POST",body:JSON.stringify({src:e})}),uninstallHookPlugin:e=>ze(`/hooks/plugins/${encodeURIComponent(e)}/uninstall`,{method:"POST"}).then(()=>{}),rescanHookPlugins:()=>ze("/hooks/plugins/rescan",{method:"POST"}).then(e=>e.plugins),listToolkit:e=>ze(`/projects/${e}/toolkit`),toggleToolkit:(e,t,n,s)=>ze(`/projects/${e}/toolkit/${encodeURIComponent(t)}/${n?"enable":"disable"}${s?`?source=${encodeURIComponent(s)}`:""}`,{method:"POST"}),cleanupToolkitLegacyCopies:e=>ze(`/projects/${e}/toolkit/legacy-copies/cleanup`,{method:"POST"}),uninstallToolkit:(e,t,n)=>ze(`/projects/${e}/toolkit/${encodeURIComponent(t)}/uninstall${n?`?source=${encodeURIComponent(n)}`:""}`,{method:"POST"}),listHookDispatches:e=>{const t=new URLSearchParams;e!=null&&e.ruleId&&t.set("ruleId",e.ruleId),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.sessionId&&t.set("sessionId",e.sessionId),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit));const n=t.toString();return ze(`/hooks/dispatches${n?`?${n}`:""}`).then(s=>s.dispatches)},runHookDispatch:(e,t)=>ze(`/hooks/dispatches/${e}/run`,{method:"POST",body:JSON.stringify({sessionId:t})}),listSessions:e=>ze(`/sessions${e===void 0?"":`?projectId=${e}`}`),renameSession:(e,t)=>ze(`/sessions/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({title:t})}).then(n=>n.session),openSessionTerminal:(e,t)=>ze(`/sessions/${encodeURIComponent(e)}/open-terminal`,{method:"POST",body:JSON.stringify(t?{target:t}:{})}),closeSessionPane:e=>ze(`/sessions/${encodeURIComponent(e)}/close-pane`,{method:"POST"}),closeProjectTerminal:(e,t)=>ze(`/projects/${e}/close-terminal`,{method:"POST",body:JSON.stringify({paneIds:t})}),listProjectPanes:e=>ze(`/projects/${e}/panes`).then(t=>t.panes),startProjectSession:(e,t)=>ze(`/projects/${e}/new-session`,{method:"POST",body:JSON.stringify(t?{harness:t}:{})}),listProjectTerminals:e=>ze(`/projects/${e}/terminals`).then(t=>t.terminals),deleteSession:e=>ze(`/sessions/${encodeURIComponent(e)}`,{method:"DELETE"}),listSessionMessages:e=>ze(`/sessions/${encodeURIComponent(e)}/messages`).then(t=>t.messages),sendSessionMessage:(e,t)=>ze(`/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:JSON.stringify(t)}),uploadImage:e=>ze("/uploads",{method:"POST",body:JSON.stringify(e)}).then(t=>t.upload),resendSessionMessage:(e,t)=>ze(`/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}/resend`,{method:"POST"}),dismissSessionMessage:(e,t)=>ze(`/sessions/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}/dismiss`,{method:"POST"}),messagingCapabilities:()=>ze("/messaging/capabilities").then(e=>e.capabilities),listQuestions:()=>ze("/messaging/questions").then(e=>e.questions),answerQuestion:(e,t)=>ze(`/sessions/${encodeURIComponent(e)}/answer`,{method:"POST",body:JSON.stringify({answers:t})}),interruptSession:e=>ze(`/sessions/${encodeURIComponent(e)}/interrupt`,{method:"POST"}),cycleSessionMode:e=>ze(`/sessions/${encodeURIComponent(e)}/mode`,{method:"POST"}),setSessionModel:(e,t)=>ze(`/sessions/${encodeURIComponent(e)}/model`,{method:"POST",body:JSON.stringify({model:t})}),listSessionWatches:()=>ze("/messaging/watches").then(e=>e.watches),createSessionWatch:(e,t={})=>ze(`/sessions/${encodeURIComponent(e)}/watch`,{method:"POST",body:JSON.stringify(t)}),deleteSessionWatch:(e,t)=>ze(`/sessions/${encodeURIComponent(e)}/watch`,{method:"DELETE",body:JSON.stringify({watchId:t})}),pushPublicKey:()=>ze("/messaging/push/key"),pushSubscribe:e=>ze("/messaging/push/subscribe",{method:"POST",body:JSON.stringify(e)}),pushUnsubscribe:e=>ze("/messaging/push/unsubscribe",{method:"POST",body:JSON.stringify({endpoint:e})}),listSessionSequences:()=>ze("/messaging/sequences").then(e=>e.sequences),createSequence:e=>ze("/messaging/sequences",{method:"POST",body:JSON.stringify(e)}),cancelSequence:e=>ze(`/messaging/sequences/${e}`,{method:"DELETE"}),capabilities:()=>ze("/capabilities"),listLibraries:()=>ze("/libraries").then(e=>e.libraries),addLibrary:(e,t)=>ze("/libraries",{method:"POST",body:JSON.stringify({path:e,kind:t})}),removeLibrary:e=>ze(`/libraries/${e}`,{method:"DELETE"}).then(()=>{}),listMarket:()=>ze("/market").then(e=>e.items),importMarketDir:e=>ze("/market",{method:"POST",body:JSON.stringify({kind:"dir",path:e})}).then(t=>t.item),importMarketGit:e=>ze("/market",{method:"POST",body:JSON.stringify({kind:"git",url:e})}).then(t=>t.item),removeMarket:e=>ze(`/market/${e}`,{method:"DELETE"}),checkMarketUpdates:e=>ze("/market/check-updates",{method:"POST",body:JSON.stringify(e!=null&&e.length?{ids:e}:{})}).then(t=>t.results),refreshMarketCache:e=>ze("/market/refresh",{method:"POST",body:JSON.stringify(e!=null&&e.length?{ids:e}:{})}).then(t=>t.results),migrateLibrary:e=>ze(`/libraries/${e}/market-import`,{method:"POST"}).then(t=>t.item),listFsRoots:()=>ze("/fs/roots").then(e=>e.roots),listFsChildren:e=>ze(`/fs/children?path=${encodeURIComponent(e)}`).then(t=>t.children),install:(e,t)=>fetch(`${za}/projects/${e}/install`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),uninstall:(e,t)=>fetch(`${za}/projects/${e}/uninstall`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),readFile:(e,t)=>ze(`/projects/${e}/file?path=${encodeURIComponent(t)}`),readGlobalFile:e=>ze(`/global-file?path=${encodeURIComponent(e)}`),listMcp:e=>ze(`/projects/${e}/mcp`).then(t=>t.rows),getStatusline:e=>ze(`/projects/${e}/statusline`),putStatusline:(e,t)=>fetch(`${za}/projects/${e}/statusline`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),getFactoryStatusline:()=>ze("/statusline/default").then(e=>e.config),putGlobalStatusline:e=>fetch(`${za}/statusline/global`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),listUpdates:e=>ze(`/projects/${e}/updates`),updateAsset:(e,t)=>fetch(`${za}/projects/${e}/update`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),syncAll:e=>fetch(`${za}/projects/${e}/sync-all`,{method:"POST"}),listGlobalSkills:e=>ze(`/projects/${e}/skills/global`).then(t=>t.groups),listGlobalSkillFiles:(e,t)=>{const n=new URLSearchParams({source:t.source,name:t.name});return t.pluginKey&&n.set("pluginKey",t.pluginKey),ze(`/projects/${e}/skills/global/files?${n}`).then(s=>s.files)},readGlobalSkillFile:(e,t)=>{const n=new URLSearchParams({source:t.source,name:t.name,path:t.path});return t.pluginKey&&n.set("pluginKey",t.pluginKey),ze(`/projects/${e}/skills/global/file?${n}`)},listPluginState:e=>ze(`/projects/${e}/plugins/state`).then(t=>t.rows),putPluginState:(e,t,n,s,r)=>ze(`/projects/${e}/plugins/state`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({runtime:t,key:n,scope:s,state:r})}),uninstallPluginPack:(e,t)=>ze(`/projects/${e}/plugins/uninstall`,{method:"POST",body:JSON.stringify(t)}),putMcpEnable:(e,t,n)=>ze(`/projects/${e}/mcp/enable`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t,state:n})}),getProjectConfig:e=>ze(`/projects/${e}/config`),getHarnessChecks:e=>ze(`/projects/${e}/harness-checks`),openProject:(e,t)=>ze(`/projects/${e}/open`,{method:"POST",body:JSON.stringify({target:t})}),getDaemonSettings:()=>ze("/settings"),putDaemonSettings:e=>ze("/settings",{method:"PUT",body:JSON.stringify(e)}),getCapture:()=>ze("/capture").then(e=>e.rows),putCapture:(e,t)=>ze("/capture",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({harness:e,enabled:t})}),putProjectConfig:(e,t)=>fetch(`${za}/projects/${e}/config`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),listLibraryAssets:e=>ze(`/libraries/${e}/assets`),eventsUrl:()=>`${mi}/events`};function ha(e,t){const n=t==null?void 0:t.categories[e];return{surfaces:(n==null?void 0:n.surfaces)??nn.map(r=>({harness:r,scopes:["project","user"]}))}}const h6={claude:"capability.reason.codexOnly",codex:"capability.reason.claudeOnly"};function _o(e,t){const n=e.surfaces.find(s=>s.harness===t.agent);return n?n.scopes.includes(t.scope)?{ok:!0,reasonKey:null}:{ok:!1,reasonKey:t.scope==="user"?"capability.reason.projectOnly":"capability.reason.globalOnly"}:{ok:!1,reasonKey:h6[t.agent]??"capability.reason.harnessUnsupported"}}function p6(e,t,n,s){return WA.includes(e)?_o(ha(e,s),{scope:n,agent:t}).ok:!1}function _g(e,t){return{...e,attrs:ha(e.category,t)}}const m6=new Set,Eh=new Map,_h=new Map,cx=new Set,eu=new Map,Ch=new Map;let Cr=null;function $d(){return jv()!=="authenticated"?null:Cr||(Cr=new EventSource(Ee.eventsUrl()),Cr.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}for(const n of Eh.get(t.type)??[])n(t);if(t.type==="push")for(const n of _h.get(String(t.key))??[])n(t.payload);if(t.type==="hook"&&typeof t.kind=="string"){const n=t;for(const s of cx)s(n);for(const[s,r]of eu)if(s===t.kind||s.endsWith(".")&&t.kind.startsWith(s))for(const i of r)i(n)}if(t.type==="invalidate")for(const n of Ch.get(String(t.key))??[])n();for(const n of m6)n(t)},Cr.onerror=()=>{c6()},Cr)}function g6(){Cr==null||Cr.close(),Cr=null}YA(()=>{if(jv()==="authenticated"){$d();return}g6()});function ux(e,t){$d();const n=Eh.get(e)??new Set;return Eh.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Eh.delete(e)}}function po(e,t){$d();const n=_h.get(e)??new Set;return _h.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&_h.delete(e)}}function Aa(e,t){if($d(),!t)return cx.add(e),()=>{cx.delete(e)};for(const n of t){const s=eu.get(n)??new Set;eu.set(n,s),s.add(e)}return()=>{for(const n of t){const s=eu.get(n);s&&(s.delete(e),s.size===0&&eu.delete(n))}}}function ki(e,t){$d();const n=Ch.get(e)??new Set;return Ch.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&Ch.delete(e)}}function Zu(e){try{const t=JSON.parse(e);return{toolName:typeof t.toolName=="string"?t.toolName:null,toolInput:t.toolInput??null,toolResponse:t.toolResponse??null,cwd:typeof t.cwd=="string"?t.cwd:null,transcriptPath:typeof t.transcriptPath=="string"?t.transcriptPath:null}}catch{return{toolName:null,toolInput:null,toolResponse:null,cwd:null,transcriptPath:null}}}const eM={PreToolUse:"bg-blue-900/40 text-blue-300",PostToolUse:"bg-emerald-900/40 text-emerald-300",UserPromptSubmit:"bg-cyan-900/40 text-cyan-300",SessionStart:"bg-purple-900/40 text-purple-300",SessionEnd:"bg-pink-900/40 text-pink-300",Notification:"bg-amber-900/40 text-amber-300",Stop:"bg-orange-900/40 text-orange-300",StopFailure:"bg-red-900/40 text-red-300",SubagentStop:"bg-orange-900/40 text-orange-300",SubagentStart:"bg-orange-900/40 text-orange-300",PostToolUseFailure:"bg-red-900/40 text-red-300",PermissionRequest:"bg-amber-900/40 text-amber-300",PermissionDenied:"bg-red-900/40 text-red-300"};Object.fromEntries(Object.entries(ac).map(([e,t])=>[e,t.source]));function rr(e){return new Date(e).toLocaleTimeString()}function Fc(e){const t=new Date(e),n=t.toLocaleTimeString();return t.toDateString()===new Date().toDateString()?n:`${t.getMonth()+1}/${t.getDate()} ${n}`}const W1="[weave] ",b6="weave",x6=/<cross-session-message([^>]*)>([\s\S]*)<\/cross-session-message>/,y6=/from-name="([^"]*)"/,v6=/^\[weave one-way injection — no reply is expected[^\]]*\]\s*/;function tM(e){var i;let t=e.startsWith(W1)?e.slice(W1.length):e;const n=t!==e,s=x6.exec(t),r=s?((i=y6.exec(s[1]))==null?void 0:i[1])??null:null;return s&&(t=s[2],t=t.startsWith(`
479
+ `)?t.slice(1):t),t=t.replace(v6,""),{text:t.trim(),fromWeave:n||r===b6,fromName:r}}function k6(e){return kn(Ei(e).prompt)}function w6(e){return kn(Ei(e).last_assistant_message)}function Sn(e,t){return e??t.slice(0,8)}const Z1=new WeakMap;function Rv(e){const t=Z1.get(e);if(t!==void 0)return t;let n={};try{const s=JSON.parse(e.payload);s&&typeof s=="object"&&(n=s)}catch{}return Z1.set(e,n),n}function Ei(e){const t=Rv(e);return t.raw&&typeof t.raw=="object"?t.raw:{}}const Tf=e=>e.replace(/\s+/g," ").trim(),kn=e=>typeof e=="string"&&e?e:null;function dx(e){if(e.eventType!=="PostToolUse")return null;const t=Rv(e),n=t.toolResponse;if(!n||typeof n.agentId!="string"||!n.agentId)return null;const s=t.raw;return{agentId:n.agentId,toolUseId:kn(s==null?void 0:s.tool_use_id),model:kn(n.resolvedModel)}}function cm(e){const t=Rv(e).raw,n=kn(t==null?void 0:t.prompt);if(!n||!n.startsWith("<task-notification>"))return null;const s=r=>{const i=n.match(new RegExp(`<${r}>([^<]*)</${r}>`));return i&&i[1].trim()||null};return{taskId:s("task-id"),toolUseId:s("tool-use-id"),status:s("status"),summary:s("summary")}}function Su(e){const t=Ei(e),n=Zu(e.payload);switch(e.eventType){case"UserPromptSubmit":{const s=cm(e);return s?[s.status,s.summary].filter(Boolean).join(" · "):Tf(kn(t.prompt)??"")}case"PreToolUse":case"PostToolUse":{const s=n.toolInput??{},r=kn(s.file_path)??kn(s.path)??kn(s.description)??kn(s.pattern)??kn(s.url)??kn(s.command)??"",i=Tf([n.toolName,r].filter(Boolean).join(" "));if(e.eventType==="PostToolUse"){const a=n.toolResponse,l=a&&typeof a=="object"?kn(a.stdout)??kn(a.type):null;if(l)return`${i} → ${Tf(l).slice(0,90)}`}return i}case"Notification":{const s=kn(t.message)??"",r=kn(t.notification_type);return r&&s?`${r} · ${s}`:r??s}case"SubagentStop":return Tf(kn(t.last_assistant_message)??"");case"SessionStart":case"SessionEnd":{const s=kn(t.session_title)??"",r=kn(t.source)??"";return[s,r].filter(Boolean).join(" · ")}default:return""}}async function J1(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const s={...t?{body:t}:{},...n?{tag:n}:{}},r="serviceWorker"in navigator?await navigator.serviceWorker.getRegistration():void 0;if(r){await r.showNotification(e,Object.keys(s).length?s:void 0);return}new Notification(e,Object.keys(s).length?s:void 0)}catch{}}async function nM(){if(typeof Notification>"u")return"unsupported";if(globalThis.isSecureContext===!1)return"insecure";if(Notification.permission==="granted")return"granted";if(Notification.permission==="denied")return"denied";try{return await Notification.requestPermission()==="granted"?"granted":"denied"}catch{return"denied"}}function um(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function S6(e,t){return e.reduce((n,s,r)=>{const i=t.get(s);return i&&(n[r]=i),n},Array(e.length))}function Af(e){return e!==null&&e>=0}function N6(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function E6(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Mf={scaleX:1,scaleY:1},_6=e=>{var t;let{rects:n,activeNodeRect:s,activeIndex:r,overIndex:i,index:a}=e;const l=(t=n[r])!=null?t:s;if(!l)return null;const c=C6(n,a,r);if(a===r){const u=n[i];return u?{x:r<i?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...Mf}:null}return a>r&&a<=i?{x:-l.width-c,y:0,...Mf}:a<r&&a>=i?{x:l.width+c,y:0,...Mf}:{x:0,y:0,...Mf}};function C6(e,t,n){const s=e[t],r=e[t-1],i=e[t+1];return!s||!r&&!i?0:n<t?r?s.left-(r.left+r.width):i.left-(s.left+s.width):i?i.left-(s.left+s.width):s.left-(r.left+r.width)}const sM=e=>{let{rects:t,activeIndex:n,overIndex:s,index:r}=e;const i=um(t,s,n),a=t[r],l=i[r];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},jf={scaleX:1,scaleY:1},T6=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:r,rects:i,overIndex:a}=e;const l=(t=i[n])!=null?t:s;if(!l)return null;if(r===n){const u=i[a];return u?{x:0,y:n<a?u.top+u.height-(l.top+l.height):u.top-l.top,...jf}:null}const c=A6(i,r,n);return r>n&&r<=a?{x:0,y:-l.height-c,...jf}:r<n&&r>=a?{x:0,y:l.height+c,...jf}:{x:0,y:0,...jf}};function A6(e,t,n){const s=e[t],r=e[t-1],i=e[t+1];return s?n<t?r?s.top-(r.top+r.height):i?i.top-(s.top+s.height):0:i?i.top-(s.top+s.height):r?s.top-(r.top+r.height):0:0}const rM="Sortable",iM=Jn.createContext({activeIndex:-1,containerId:rM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sM,disabled:{draggable:!1,droppable:!1}});function aM(e){let{children:t,id:n,items:s,strategy:r=sM,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:d}=wP(),f=Ld(rM,n),h=l.rect!==null,p=x.useMemo(()=>s.map(E=>typeof E=="object"&&"id"in E?E.id:E),[s]),m=a!=null,k=a?p.indexOf(a.id):-1,w=u?p.indexOf(u.id):-1,g=x.useRef(p),y=!N6(p,g.current),b=w!==-1&&k===-1||y,S=E6(i);Lr(()=>{y&&m&&d(p)},[y,p,m,d]),x.useEffect(()=>{g.current=p},[p]);const M=x.useMemo(()=>({activeIndex:k,containerId:f,disabled:S,disableTransforms:b,items:p,overIndex:w,useDragOverlay:h,sortedRects:S6(p,c),strategy:r}),[k,f,S.draggable,S.droppable,b,p,w,c,h,r]);return Jn.createElement(iM.Provider,{value:M},t)}const M6=e=>{let{id:t,items:n,activeIndex:s,overIndex:r}=e;return um(n,s,r).indexOf(t)},j6=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:r,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!s||l!==i&&r===a?!1:n?!0:a!==r&&t===c},R6={duration:200,easing:"ease"},lM="transform",O6=pp.Transition.toString({property:lM,duration:0,easing:"linear"}),D6={roleDescription:"sortable"};function I6(e){let{disabled:t,index:n,node:s,rect:r}=e;const[i,a]=x.useState(null),l=x.useRef(n);return Lr(()=>{if(!t&&n!==l.current&&s.current){const c=r.current;if(c){const u=_c(s.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&a(d)}}n!==l.current&&(l.current=n)},[t,n,s,r]),x.useEffect(()=>{i&&a(null)},[i]),i}function oM(e){let{animateLayoutChanges:t=j6,attributes:n,disabled:s,data:r,getNewIndex:i=M6,id:a,strategy:l,resizeObserverConfig:c,transition:u=R6}=e;const{items:d,containerId:f,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:k,overIndex:w,useDragOverlay:g,strategy:y}=x.useContext(iM),b=L6(s,p),S=d.indexOf(a),M=x.useMemo(()=>({sortable:{containerId:f,index:S,items:d},...r}),[f,r,S,d]),E=x.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:A,node:R,isOver:D,setNodeRef:_}=Ev({id:a,data:M,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:z,activatorEvent:$,activeNodeRect:H,attributes:I,setNodeRef:L,listeners:C,isDragging:O,over:U,setActivatorNodeRef:F,transform:j}=im({id:a,data:M,attributes:{...D6,...n},disabled:b.draggable}),N=rL(_,L),G=!!z,T=G&&!m&&Af(h)&&Af(w),Z=!g&&O,te=Z&&T?j:null,pe=T?te??(l??y)({rects:k,activeNodeRect:H,activeIndex:h,overIndex:w,index:S}):null,V=Af(h)&&Af(w)?i({id:a,items:d,activeIndex:h,overIndex:w}):S,q=z==null?void 0:z.id,Y=x.useRef({activeId:q,items:d,newIndex:V,containerId:f}),J=d!==Y.current.items,ce=t({active:z,containerId:f,isDragging:O,isSorting:G,id:a,index:S,items:d,newIndex:Y.current.newIndex,previousItems:Y.current.items,previousContainerId:Y.current.containerId,transition:u,wasDragging:Y.current.activeId!=null}),ke=I6({disabled:!ce,index:S,node:R,rect:A});return x.useEffect(()=>{G&&Y.current.newIndex!==V&&(Y.current.newIndex=V),f!==Y.current.containerId&&(Y.current.containerId=f),d!==Y.current.items&&(Y.current.items=d)},[G,V,f,d]),x.useEffect(()=>{if(q===Y.current.activeId)return;if(q&&!Y.current.activeId){Y.current.activeId=q;return}const je=setTimeout(()=>{Y.current.activeId=q},50);return()=>clearTimeout(je)},[q]),{active:z,activeIndex:h,attributes:I,data:M,rect:A,index:S,newIndex:V,items:d,isOver:D,isSorting:G,isDragging:O,listeners:C,node:R,overIndex:w,over:U,setNodeRef:N,setActivatorNodeRef:F,setDroppableNodeRef:_,setDraggableNodeRef:L,transform:ke??pe,transition:Ae()};function Ae(){if(ke||J&&Y.current.newIndex===S)return O6;if(!(Z&&!xv($)||!u)&&(G||ce))return pp.Transition.toString({...u,property:lM})}}function L6(e,t){var n,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:t.droppable}}_t.Down,_t.Right,_t.Up,_t.Left;function cM(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=cM(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function P6(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=cM(e))&&(s&&(s+=" "),s+=t);return s}const Ov="-",z6=e=>{const t=F6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:a=>{const l=a.split(Ov);return l[0]===""&&l.length!==1&&l.shift(),uM(l,t)||U6(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&s[a]?[...c,...s[a]]:c}}},uM=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),r=s?uM(e.slice(1),s):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(Ov);return(a=t.validators.find(({validator:l})=>l(i)))==null?void 0:a.classGroupId},eS=/^\[(.+)\]$/,U6=e=>{if(eS.test(e)){const t=eS.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},F6=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return H6(Object.entries(e.classGroups),n).forEach(([i,a])=>{fx(a,s,i,t)}),s},fx=(e,t,n,s)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:tS(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(B6(r)){fx(r(s),t,n,s);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,a])=>{fx(a,tS(t,i),n,s)})})},tS=(e,t)=>{let n=e;return t.split(Ov).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},B6=e=>e.isThemeGetter,H6=(e,t)=>t?e.map(([n,s])=>{const r=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,l])=>[t+a,l])):i);return[n,r]}):e,$6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const r=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,s=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=s.get(i))!==void 0)return r(i,a),a},set(i,a){n.has(i)?n.set(i,a):r(i,a)}}},dM="!",G6=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,r=t[0],i=t.length,a=l=>{const c=[];let u=0,d=0,f;for(let w=0;w<l.length;w++){let g=l[w];if(u===0){if(g===r&&(s||l.slice(w,w+i)===t)){c.push(l.slice(d,w)),d=w+i;continue}if(g==="/"){f=w;continue}}g==="["?u++:g==="]"&&u--}const h=c.length===0?l:l.substring(d),p=h.startsWith(dM),m=p?h.substring(1):h,k=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:k}};return n?l=>n({className:l,parseClassName:a}):a},K6=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},q6=e=>({cache:$6(e.cacheSize),parseClassName:G6(e),...z6(e)}),Y6=/\s+/,V6=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r}=t,i=[],a=e.trim().split(Y6);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let m=!!p,k=s(m?h.substring(0,p):h);if(!k){if(!m){l=u+(l.length>0?" "+l:l);continue}if(k=s(h),!k){l=u+(l.length>0?" "+l:l);continue}m=!1}const w=K6(d).join(":"),g=f?w+dM:w,y=g+k;if(i.includes(y))continue;i.push(y);const b=r(k,m);for(let S=0;S<b.length;++S){const M=b[S];i.push(g+M)}l=u+(l.length>0?" "+l:l)}return l};function X6(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=fM(t))&&(s&&(s+=" "),s+=n);return s}const fM=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=fM(e[s]))&&(n&&(n+=" "),n+=t);return n};function Q6(e,...t){let n,s,r,i=a;function a(c){const u=t.reduce((d,f)=>f(d),e());return n=q6(u),s=n.cache.get,r=n.cache.set,i=l,l(c)}function l(c){const u=s(c);if(u)return u;const d=V6(c,n);return r(c,d),d}return function(){return i(X6.apply(null,arguments))}}const Kt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},hM=/^\[(?:([a-z-]+):)?(.+)\]$/i,W6=/^\d+\/\d+$/,Z6=new Set(["px","full","screen"]),J6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ez=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zr=e=>Co(e)||Z6.has(e)||W6.test(e),Li=e=>Cc(e,"length",dz),Co=e=>!!e&&!Number.isNaN(Number(e)),Cg=e=>Cc(e,"number",Co),Bc=e=>!!e&&Number.isInteger(Number(e)),rz=e=>e.endsWith("%")&&Co(e.slice(0,-1)),ct=e=>hM.test(e),Pi=e=>J6.test(e),iz=new Set(["length","size","percentage"]),az=e=>Cc(e,iz,pM),lz=e=>Cc(e,"position",pM),oz=new Set(["image","url"]),cz=e=>Cc(e,oz,hz),uz=e=>Cc(e,"",fz),Hc=()=>!0,Cc=(e,t,n)=>{const s=hM.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},dz=e=>ez.test(e)&&!tz.test(e),pM=()=>!1,fz=e=>nz.test(e),hz=e=>sz.test(e),pz=()=>{const e=Kt("colors"),t=Kt("spacing"),n=Kt("blur"),s=Kt("brightness"),r=Kt("borderColor"),i=Kt("borderRadius"),a=Kt("borderSpacing"),l=Kt("borderWidth"),c=Kt("contrast"),u=Kt("grayscale"),d=Kt("hueRotate"),f=Kt("invert"),h=Kt("gap"),p=Kt("gradientColorStops"),m=Kt("gradientColorStopPositions"),k=Kt("inset"),w=Kt("margin"),g=Kt("opacity"),y=Kt("padding"),b=Kt("saturate"),S=Kt("scale"),M=Kt("sepia"),E=Kt("skew"),A=Kt("space"),R=Kt("translate"),D=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",ct,t],$=()=>[ct,t],H=()=>["",Zr,Li],I=()=>["auto",Co,ct],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",ct],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>[Co,ct];return{cacheSize:500,separator:":",theme:{colors:[Hc],spacing:[Zr,Li],blur:["none","",Pi,ct],brightness:N(),borderColor:[e],borderRadius:["none","","full",Pi,ct],borderSpacing:$(),borderWidth:H(),contrast:N(),grayscale:F(),hueRotate:N(),invert:F(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[rz,Li],inset:z(),margin:z(),opacity:N(),padding:$(),saturate:N(),scale:N(),sepia:F(),skew:N(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",ct]}],container:["container"],columns:[{columns:[Pi]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),ct]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Bc,ct]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ct]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Bc,ct]}],"grid-cols":[{"grid-cols":[Hc]}],"col-start-end":[{col:["auto",{span:["full",Bc,ct]},ct]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Hc]}],"row-start-end":[{row:["auto",{span:[Bc,ct]},ct]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ct]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ct]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ct,t]}],"min-w":[{"min-w":[ct,t,"min","max","fit"]}],"max-w":[{"max-w":[ct,t,"none","full","min","max","fit","prose",{screen:[Pi]},Pi]}],h:[{h:[ct,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ct,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ct,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ct,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Pi,Li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Cg]}],"font-family":[{font:[Hc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ct]}],"line-clamp":[{"line-clamp":["none",Co,Cg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zr,ct]}],"list-image":[{"list-image":["none",ct]}],"list-style-type":[{list:["none","disc","decimal",ct]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...C(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zr,Li]}],"underline-offset":[{"underline-offset":["auto",Zr,ct]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ct]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ct]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),lz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",az]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},cz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...C(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:C()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...C()]}],"outline-offset":[{"outline-offset":[Zr,ct]}],"outline-w":[{outline:[Zr,Li]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Zr,Li]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Pi,uz]}],"shadow-color":[{shadow:[Hc]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...O(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Pi,ct]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ct]}],duration:[{duration:N()}],ease:[{ease:["linear","in","out","in-out",ct]}],delay:[{delay:N()}],animate:[{animate:["none","spin","ping","pulse","bounce",ct]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Bc,ct]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ct]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ct]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ct]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Zr,Li,Cg]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},mz=Q6(pz);function me(...e){return mz(P6(e))}const nS={default:"bg-neutral-800 text-neutral-100",skill:"bg-blue-900/40 text-blue-300",command:"bg-purple-900/40 text-purple-300",agent:"bg-emerald-900/40 text-emerald-300",helper:"bg-amber-900/40 text-amber-300",mcp:"bg-pink-900/40 text-pink-300",settings:"bg-cyan-900/40 text-cyan-300",warning:"bg-orange-900/40 text-orange-300",other:"bg-neutral-800 text-neutral-400"};function Qe({className:e,variant:t="default",...n}){return o.jsx("span",{className:me("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium tracking-tight",nS[t]??nS.default,e),...n})}function mr({agent:e,className:t}){return e?o.jsx(Qe,{className:me("shrink-0",Kn(e).badge,t),children:e}):null}function Nl(e){const[t,n]=x.useState(()=>typeof window<"u"&&window.matchMedia(e).matches);return x.useEffect(()=>{const s=window.matchMedia(e),r=()=>n(s.matches);return r(),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),t}const mM=["zh-CN","en"],hx="zh-CN",gz={"zh-CN":"中文(简体)",en:"English"},gM="weave:locale",bz={"common.close":"关闭","common.cancel":"取消","common.confirm":"确认","common.save":"保存","common.saving":"保存中…","common.loading":"加载中…","common.empty":"(空)","common.expand":"展开","common.collapse":"折叠","common.copy":"复制","common.copyFailed":"复制失败:浏览器未放行剪贴板(手机请用页面上的 HTTPS 地址访问)","common.decrease":"减少","common.increase":"增加","common.canvas.lines":"网格底纹","common.canvas.dots":"点阵底纹","common.canvas.cross":"十字底纹","common.canvas.none":"无底纹","common.canvas.tintNone":"默认底色","common.canvas.tintSky":"蓝色底色","common.canvas.tintViolet":"紫色底色","common.canvas.tintEmerald":"绿色底色","common.canvas.tintAmber":"琥珀底色"},xz={"common.close":"Close","common.cancel":"Cancel","common.confirm":"Confirm","common.save":"Save","common.saving":"Saving…","common.loading":"Loading…","common.empty":"(empty)","common.expand":"Expand","common.collapse":"Collapse","common.copy":"Copy","common.copyFailed":"Copy failed: the browser blocked clipboard access (on a phone, use the HTTPS address)","common.decrease":"Decrease","common.increase":"Increase","common.canvas.lines":"Grid pattern","common.canvas.dots":"Dot pattern","common.canvas.cross":"Cross pattern","common.canvas.none":"No pattern","common.canvas.tintNone":"Default background","common.canvas.tintSky":"Blue background","common.canvas.tintViolet":"Violet background","common.canvas.tintEmerald":"Green background","common.canvas.tintAmber":"Amber background"},yz={"settings.title":"设置","settings.language":"语言","settings.languageHint":"dashboard 与 weave CLI 共用的界面语言。","settings.defaultTerminal":"默认终端","settings.defaultTerminalHint":"「在终端中打开」使用的终端程序;自动 = 自动选择可用的终端。","settings.customCommand":"自定义命令","settings.pathHint":"会被替换为带引号的项目路径,例如:","settings.hooks":"Weave 总开关","settings.hooksHint":"Weave 总开关(规则级开关另控);关闭后规则不再生效。","settings.launchOnLogin":"开机自启 daemon","settings.launchOnLoginHint":"登录系统时自动启动 weave 后台服务,默认关闭。","settings.retentionDays":"事件日志保留天数","settings.retentionDaysHint":"超过该天数的事件日志会被自动清理;保存后下一条事件即生效。","settings.sessionIdleDays":"会话闲置保留天数","settings.sessionIdleDaysHint":"收到过消息的会话无操作 {n} 天后自动移除;没有消息的新会话 1 小时后过期。会话行内标注剩余存活时间。","settings.daysUnit":"天","settings.accessUrls":"访问地址","settings.accessUrlsHint":"本机与局域网设备访问 dashboard 的完整地址;https 端口用于手机浏览器通知(自签证书,首次访问需在浏览器接受)。","settings.urlLan":"局域网","settings.urlLocal":"本机","settings.push":"推送提醒","settings.pushHint":"页面关闭后仍能收到提醒(逐设备开关)。","settings.pushInsecure":"推送需 HTTPS 访问(当前是 HTTP,浏览器不支持)。","settings.pushUnsupported":"此浏览器不支持 Web Push(iOS 需将本站加到主屏幕后可用)。","settings.pushFailed":"推送订阅未成功——提醒保持「页面开着才通知」。"},vz={"settings.title":"Settings","settings.language":"Language","settings.languageHint":"UI language shared by the dashboard and the weave CLI.","settings.defaultTerminal":"Default terminal","settings.defaultTerminalHint":'Terminal used by "Open in terminal"; auto picks an available terminal.',"settings.customCommand":"Custom command","settings.pathHint":"is replaced with the quoted project path, e.g.:","settings.hooks":"Weave master switch","settings.hooksHint":"Weave master switch (rule-level switches stay independent); when off, no rules run.","settings.launchOnLogin":"Launch daemon on login","settings.launchOnLoginHint":"Start the weave daemon automatically at login. Off by default.","settings.retentionDays":"Event log retention (days)","settings.retentionDaysHint":"Event logs older than this are cleaned up automatically; takes effect on the next event.","settings.sessionIdleDays":"Session idle retention (days)","settings.sessionIdleDaysHint":"Prompted sessions are removed after {n} idle days; new sessions with no prompt expire in 1 hour. Each row shows its remaining lifetime.","settings.daysUnit":"days","settings.accessUrls":"Access URLs","settings.accessUrlsHint":"Full URLs for this dashboard on loopback and LAN devices; the https port is what phone browsers need for notifications (self-signed — accept it on first visit).","settings.urlLan":"LAN","settings.urlLocal":"Local","settings.push":"Push alerts","settings.pushHint":"Alerts arrive even with the page closed (per-device toggle).","settings.pushInsecure":"Push requires HTTPS (this page is HTTP, so the browser blocks it).","settings.pushUnsupported":"This browser has no Web Push support (on iOS, add the site to the Home Screen first).","settings.pushFailed":"Push subscription failed — alerts stay page-open-only."},kz={"preset.auto":"自动(探测可用终端)","preset.wt":"Windows Terminal","preset.powershell":"PowerShell","preset.cmd":"命令提示符 (cmd)","preset.terminal":"Terminal.app","preset.iterm":"iTerm2","preset.gnome":"gnome-terminal","preset.konsole":"Konsole","preset.wezterm":"WezTerm","preset.ghostty":"Ghostty","preset.custom":"自定义命令"},wz={"preset.auto":"Auto (detect available terminal)","preset.wt":"Windows Terminal","preset.powershell":"PowerShell","preset.cmd":"Command Prompt (cmd)","preset.terminal":"Terminal.app","preset.iterm":"iTerm2","preset.gnome":"gnome-terminal","preset.konsole":"Konsole","preset.wezterm":"WezTerm","preset.ghostty":"Ghostty","preset.custom":"Custom command"},Sz={"app.projectCount":"{n} 个项目","app.settingsTooltip":"设置(默认终端等)","app.themeToLight":"切换到浅色","app.themeToDark":"切换到深色","app.resizeLeft":"拖拽调整左侧宽度","app.resizeRight":"拖拽调整右侧宽度","app.resizeTaskHeight":"拖拽调整任务区高度","app.resizeDialog":"拖拽调整窗口大小","app.globalTitle":"全局配置","app.globalSubtitle":"机器级 harness 默认模板 · 作用于所有项目","app.updateCountOne":"1 个更新","app.updateCount":"{n} 个更新","app.syncAllTooltip":"同步全部 {n} 项:更新过期、装回缺失","app.syncAll":"全部同步","app.scopeCoverageTooltip":"同步覆盖 Skills、MCP、单文件资产与 init 生成物;会进 git 的 init 文件(如 CLAUDE.md)只提示不代写,需在终端跑 weave init。不含状态栏。","app.scopeCoverageChip":"覆盖 Skills · MCP · 资源管理 · init 生成物","app.needProjectAnchor":"需要至少注册一个项目作为全局数据源。","app.selectProject":"请选择一个项目","app.selectProjectForAssets":"请选择一个项目,资产将安装到该项目。","app.mobileProjects":"项目列表","app.mobileLibrary":"资源市场","app.mobileDrawerClose":"收起","project.globalConfig":"全局配置","project.globalSubtitle":"机器级 harness 默认模板","project.sectionHeader":"项目","project.noneRegistered":"尚未注册任何项目","project.openInExplorer":"在资源管理器中打开","project.openInTerminal":"在终端中打开","project.dragToReorder":"拖动调整顺序","project.terminalsOpen":"{n} 个终端已打开","project.closeTerminal":"关闭该项目的 {n} 个终端","project.syncNow":"立即同步","project.syncPending":"有更新待同步({n})— 点击立即同步","project.needsInit":"待 init","project.needsInitTip":"有会进 git 的 init 文件变了,同步不会代写——请在终端执行 weave init","project.sessionsRunning":"{n} 个会话运行中","project.sessionsOpen":"{n} 个会话就绪(等输入)","project.harnessesTip":"本项目 init 时选择接入的 harness","project.archive":"归档项目","project.archiveConfirm":"归档「{name}」?历史会话将立即清空;基础信息保留,可随时恢复。","project.archivedSection":"归档项目","project.archivedCount":"{n} 个归档项目 — 点击查看","project.archivedOn":"归档于 {date}","project.restore":"恢复","project.restoreTooltip":"恢复为活跃项目(历史会话已清空,不会回来)","toast.projectArchived":"已归档「{name}」(清除 {sessions} 个会话 / {events} 条事件)","toast.projectRestored":"已恢复「{name}」","errors.archiveFailed":"归档失败:{error}","errors.restoreFailed":"恢复失败:{error}","skillDetail.readOnly":"只读","skillDetail.plugin":"插件","skillDetail.local":"本地","skillDetail.fileCount":"{n} 个文件","skillDetail.update":"待更新","skillDetail.custom":"自定义","skillDetail.uninstallTitle":"卸载 skill","skillDetail.expandAllDirs":"展开全部目录","skillDetail.collapseAllDirs":"折叠全部目录","skillDetail.expandAll":"全展开","skillDetail.collapseAll":"全折叠","skillDetail.noFiles":"无文件","skillDetail.emptySkillMd":"SKILL.md 为空","skillDetail.projectScopeHint":"项目级 skill — 位于 {root}/skills/","skillDetail.globalReadOnlyHint":"全局技能(只读)","skillDetail.globalPluginHint":"全局插件技能 — {runtime}","skillDetail.globalLocalHint":"全局本地技能 — {runtime}","errors.installFailed":"安装失败:{error}","errors.mcpInstallFailed":"MCP 安装失败:{error}","errors.uninstallFailed":"卸载失败:{error}","errors.mcpUninstallFailed":"MCP 卸载失败:{error}","errors.projectReorderFailed":"项目排序保存失败:{error}","toast.synced":"已同步 {n} 项","toast.nothingToSync":"没有需要同步的项","toast.sessionDeleted":"已删除会话({n} 条事件)","toast.sessionPaneClosed":"已关闭该会话(历史保留)","toast.terminalsClosed":"已关闭 {n} 个终端","errors.syncFailed":"同步失败:{error}","errors.updateFailed":"更新失败:{error}","errors.pluginToggleFailed":"插件启用状态更新失败:{error}","errors.openFailed":"打开失败:{error}","errors.closeTerminalFailed":"关闭终端失败:{error}"},Nz={"app.projectCount":"{n} projects","app.settingsTooltip":"Settings (default terminal, etc.)","app.themeToLight":"Switch to light","app.themeToDark":"Switch to dark","app.resizeLeft":"Drag to resize the left pane","app.resizeRight":"Drag to resize the right pane","app.resizeTaskHeight":"Drag to resize the task area height","app.resizeDialog":"Drag to resize this window","app.globalTitle":"Global config","app.globalSubtitle":"Machine-level harness default template · applies to all projects","app.updateCountOne":"1 update","app.updateCount":"{n} updates","app.syncAllTooltip":"Sync all {n}: update outdated, reinstall missing","app.syncAll":"Sync all","app.scopeCoverageTooltip":"Sync covers Skills, MCP, single-file assets and init artefacts; init files that enter git (e.g. CLAUDE.md) are only flagged — run `weave init` in a terminal. Excludes the statusline.","app.scopeCoverageChip":"Covers Skills · MCP · resources · init artefacts","app.needProjectAnchor":"Register at least one project to serve as the global data source.","app.selectProject":"Select a project","app.selectProjectForAssets":"Select a project to install assets into.","app.mobileProjects":"Projects","app.mobileLibrary":"Resource market","app.mobileDrawerClose":"Dismiss","project.globalConfig":"Global config","project.globalSubtitle":"Machine-level harness default template","project.sectionHeader":"Projects","project.noneRegistered":"No projects registered","project.openInExplorer":"Open in Explorer","project.openInTerminal":"Open in terminal","project.dragToReorder":"Drag to reorder","project.terminalsOpen":"{n} terminal(s) open","project.closeTerminal":"Close this project's {n} terminal(s)","project.syncNow":"Sync now","project.syncPending":"{n} update(s) pending — click to sync now","project.needsInit":"needs init","project.needsInitTip":"An init file that enters git changed — sync will not write it. Run `weave init` in a terminal.","project.sessionsRunning":"{n} session(s) running","project.sessionsOpen":"{n} session(s) ready (awaiting input)","project.harnessesTip":"Harness integrated for this project at init","project.archive":"Archive project","project.archiveConfirm":'Archive "{name}"? Session history is cleared immediately; basic info is kept — restore anytime.',"project.archivedSection":"Archived projects","project.archivedCount":"{n} archived — click to view","project.archivedOn":"Archived {date}","project.restore":"Restore","project.restoreTooltip":"Restore as an active project (session history is gone)","toast.projectArchived":'Archived "{name}" (purged {sessions} session(s) / {events} event(s))',"toast.projectRestored":'Restored "{name}"',"errors.archiveFailed":"Archive failed: {error}","errors.restoreFailed":"Restore failed: {error}","skillDetail.readOnly":"Read-only","skillDetail.plugin":"Plugin","skillDetail.local":"Local","skillDetail.fileCount":"{n} files","skillDetail.update":"update","skillDetail.custom":"custom","skillDetail.uninstallTitle":"Uninstall skill","skillDetail.expandAllDirs":"Expand all folders","skillDetail.collapseAllDirs":"Collapse all folders","skillDetail.expandAll":"Expand all","skillDetail.collapseAll":"Collapse all","skillDetail.noFiles":"No files","skillDetail.emptySkillMd":"Empty SKILL.md","skillDetail.projectScopeHint":"Project-scope skill — lives in {root}/skills/","skillDetail.globalReadOnlyHint":"Global skill (read-only)","skillDetail.globalPluginHint":"Global plugin skill — {runtime}","skillDetail.globalLocalHint":"Global skill (local) — {runtime}","errors.installFailed":"Install failed: {error}","errors.mcpInstallFailed":"MCP install failed: {error}","errors.uninstallFailed":"Uninstall failed: {error}","errors.mcpUninstallFailed":"MCP uninstall failed: {error}","errors.projectReorderFailed":"Failed to save project order: {error}","toast.synced":"Synced {n} item(s)","toast.nothingToSync":"Nothing needs syncing","toast.sessionDeleted":"Session deleted ({n} events)","toast.sessionPaneClosed":"Session closed (history kept)","toast.terminalsClosed":"Closed {n} terminal(s)","errors.syncFailed":"Sync failed: {error}","errors.updateFailed":"Update failed: {error}","errors.pluginToggleFailed":"Plugin toggle failed: {error}","errors.openFailed":"Open failed: {error}","errors.closeTerminalFailed":"Close terminal failed: {error}"},Ez={"statusline.title":"状态栏","statusline.scopeGlobal":"全局模板","statusline.scopeProject":"项目配置","statusline.resetHint":"用出厂默认覆盖当前全局模板(需再次点击确认)","statusline.resetConfirm":"确认恢复出厂?","statusline.reset":"恢复出厂","statusline.saved":"已保存 ✓","statusline.retry":"重试","statusline.saveFailed":"保存失败:{error}","statusline.emptyRow":"(空行)","statusline.preview":" ← 预览","statusline.followingGlobal":"跟随全局模板","statusline.editsDisabled":"编辑已禁用 — 切换为本地配置以自定义此项目。","statusline.customizeLocally":"本地自定义","statusline.localCustom":"本地自定义配置","statusline.ownConfig":"此项目已有自己的配置。","statusline.followHint":"改为跟随全局模板 — 本地自定义配置将被替换(再次点击确认,5 秒内有效)","statusline.followConfirm":"确认跟随?","statusline.follow":"跟随全局","statusline.syncHint":"用全局模板覆盖本地自定义配置(再次点击确认,5 秒内有效)","statusline.syncConfirm":"确认覆盖?","statusline.sync":"从全局同步","statusline.alignLabel":"对齐","statusline.refresh":"刷新","statusline.refreshHint":"空闲时的刷新间隔(秒)","statusline.refreshNote":"空闲时定时刷新;交互后即时更新","statusline.powerlineStyle":"Powerline 样式","statusline.powerlineHint":"(实心背景块,图标合并)","statusline.glyphSeparator":"分隔符","statusline.glyphStartCap":"左端","statusline.glyphEndCap":"右端","statusline.nerdFontHint":"需要 Nerd Font 终端字体","statusline.logo":"徽标","statusline.logoHint":"文字固定、不可隐藏,仅颜色可调","statusline.separator":"分隔符","statusline.separatorHint":"(powerline 模式下忽略)","statusline.bar":"进度条","statusline.barCellsHint":"进度条格数(1-40)","statusline.fill":"填充","statusline.emptyChar":"空白","statusline.labelSep":"标签分隔","statusline.labelSepHint":"渲染在段标签与取值之间","statusline.labelInputHint":"取值之前的静态前缀","statusline.lines":"行","statusline.addRow":"+ 添加行","statusline.rowN":"第 {n} 行","statusline.blockCount":"{n} 块","statusline.removeRow":"删除行","statusline.emptyRowHint":"空行 — 点 + 添加块,或把胶囊拖进来","statusline.addBlockHint":"添加块(选择类型;已在其他行的类型会移动过来)","statusline.addBlock":"+ 块","statusline.capsuleTitle":"{name} — 点击编辑,拖动排序","statusline.capsuleTitleOff":"{name}(未启用)— 点击编辑,拖动排序","statusline.addBlockTitle":"添加块","statusline.closeEsc":"关闭 (Esc)","statusline.tagOtherRow":"已在第 {n} 行 — 点击移至本行","statusline.rowShort":"第{n}行","statusline.pickHint":"选择一个块类型加入本行;已在其他行的类型会整体移动过来。","statusline.enabled":"已启用","statusline.disabled":"未启用","statusline.bold":"加粗","statusline.mergeHint":"并入下一块的背景","statusline.merge":"合并","statusline.iconPlaceholder":"图标","statusline.iconHint":"可选的 emoji / 符号前缀","statusline.fieldStyle":"样式","statusline.fieldMetric":"计量","statusline.fieldWindow":"窗口","statusline.metric.session":"会话","statusline.metric.context":"上下文","statusline.metric.sessionTitle":"本会话累计 token","statusline.metric.contextTitle":"当前上下文窗口中的 token","statusline.fgBg":"前景 / 背景","statusline.fieldLabel":"标签","statusline.labelPlaceholder":"标签","statusline.fieldFormat":"格式","statusline.tokensTitle":"模板 token:{tokens}","statusline.unplaceHint":"把该块移出行(配置保留,可从 + 块再加回)","statusline.unplace":"从行中移除","statusline.done":"完成","statusline.noBackground":"无背景","statusline.moreColorsCurrent":"更多颜色 — 当前:{color}","statusline.moreColors":"更多颜色(256 / hex)","statusline.pickTruecolor":"选取 truecolor 值","statusline.colorPlaceholder":"#rrggbb 或 ansi256:N","statusline.ok":"确定","statusline.disableCap":"禁用该端盖","statusline.none":"无","statusline.glyph.triangleRight":"右向三角","statusline.glyph.triangleLeft":"左向三角","statusline.glyph.roundRight":"右向圆角","statusline.glyph.roundLeft":"左向圆角","statusline.glyph.triangle":"三角","statusline.glyph.round":"圆角","statusline.glyph.lowerTriangle":"下三角","statusline.glyph.diagonal":"斜角","statusline.barStyle.percent":"%","statusline.barStyle.bar":"条形","statusline.barStyle.both":"两者","seg.project":"项目","seg.git":"Git","seg.gitUser":"Git 身份","seg.changes":"变更","seg.model":"模型","seg.thinking":"思考","seg.context":"上下文","seg.tokens":"Token","seg.cost":"费用","seg.rate":"限额","seg.time":"时间","seg.version":"版本","seg.output_style":"输出风格","seg.session":"会话","seg.exceeds200k":"200k+","seg.fast_mode":"快速模式","seg.vim":"Vim","seg.pr":"PR","seg.worktree":"Worktree","seg.agent":"智能体","align.left":"左","align.center":"居中","align.right":"右","rateWin.fiveHour.label":"5h","rateWin.fiveHour.title":"5 小时限额","rateWin.sevenDay.label":"7d","rateWin.sevenDay.title":"7 天限额","rateWin.spend.label":"花费","rateWin.spend.title":"花费限额"},_z={"statusline.title":"Statusline","statusline.scopeGlobal":"Global template","statusline.scopeProject":"Project config","statusline.resetHint":"Overwrite the current global template with factory defaults (click again to confirm)","statusline.resetConfirm":"Reset to factory?","statusline.reset":"Factory reset","statusline.saved":"Saved ✓","statusline.retry":"Retry","statusline.saveFailed":"Save failed: {error}","statusline.emptyRow":"(empty row)","statusline.preview":" ← preview","statusline.followingGlobal":"following global template","statusline.editsDisabled":"Edits are disabled — switch to a local config to customize this project.","statusline.customizeLocally":"Customize locally","statusline.localCustom":"local custom config","statusline.ownConfig":"This project has its own config.","statusline.followHint":"Switch to the global template — the local custom config will be replaced (click again to confirm, valid for 5 seconds)","statusline.followConfirm":"Follow global?","statusline.follow":"Follow global","statusline.syncHint":"Overwrite the local custom config with the global template (click again to confirm, valid for 5 seconds)","statusline.syncConfirm":"Overwrite?","statusline.sync":"Sync from global","statusline.alignLabel":"Align","statusline.refresh":"Refresh","statusline.refreshHint":"Refresh interval while idle (seconds)","statusline.refreshNote":"Refreshes on a timer while idle; updates immediately after interaction","statusline.powerlineStyle":"Powerline style","statusline.powerlineHint":"(solid background blocks, icons merge)","statusline.glyphSeparator":"Separator","statusline.glyphStartCap":"Start cap","statusline.glyphEndCap":"End cap","statusline.nerdFontHint":"Requires a Nerd Font terminal font","statusline.logo":"Logo","statusline.logoHint":"Text is fixed and cannot be hidden; only the colour can be changed","statusline.separator":"Separator","statusline.separatorHint":"(powerline ignores it)","statusline.bar":"Bar","statusline.barCellsHint":"Bar cells (1-40)","statusline.fill":"fill","statusline.emptyChar":"empty","statusline.labelSep":"Label sep","statusline.labelSepHint":"Rendered between a segment's label and its value","statusline.labelInputHint":"Static prefix before the value","statusline.lines":"Lines","statusline.addRow":"+ Add row","statusline.rowN":"row {n}","statusline.blockCount":"{n} block(s)","statusline.removeRow":"Remove row","statusline.emptyRowHint":"Empty row — click + to add a block, or drag a capsule in","statusline.addBlockHint":"Add a block (pick a type; a type already on another row moves here)","statusline.addBlock":"+ Block","statusline.capsuleTitle":"{name} — click to edit, drag to reorder","statusline.capsuleTitleOff":"{name} (disabled) — click to edit, drag to reorder","statusline.addBlockTitle":"Add block","statusline.closeEsc":"Close (Esc)","statusline.tagOtherRow":"Already on row {n} — click to move here","statusline.rowShort":"row{n}","statusline.pickHint":"Pick a block type to add to this row; a type already on another row moves over as a whole.","statusline.enabled":"Enabled","statusline.disabled":"Disabled","statusline.bold":"Bold","statusline.mergeHint":"Merge into the next block's background","statusline.merge":"merge","statusline.iconPlaceholder":"icon","statusline.iconHint":"Optional emoji / symbol prefix","statusline.fieldStyle":"Style","statusline.fieldMetric":"Metric","statusline.fieldWindow":"Window","statusline.metric.session":"session","statusline.metric.context":"context","statusline.metric.sessionTitle":"Cumulative tokens for the session","statusline.metric.contextTitle":"Tokens currently in the context window","statusline.fgBg":"fg / bg","statusline.fieldLabel":"label","statusline.labelPlaceholder":"Label","statusline.fieldFormat":"format","statusline.tokensTitle":"Template tokens: {tokens}","statusline.unplaceHint":"Take this block out of its row (config is kept; re-add it from the + block button)","statusline.unplace":"Remove from row","statusline.done":"Done","statusline.noBackground":"No background","statusline.moreColorsCurrent":"More colours — current: {color}","statusline.moreColors":"More colours (256 / hex)","statusline.pickTruecolor":"Pick a truecolor value","statusline.colorPlaceholder":"#rrggbb or ansi256:N","statusline.ok":"OK","statusline.disableCap":"Disable this cap","statusline.none":"None","statusline.glyph.triangleRight":"Triangle Right","statusline.glyph.triangleLeft":"Triangle Left","statusline.glyph.roundRight":"Round Right","statusline.glyph.roundLeft":"Round Left","statusline.glyph.triangle":"Triangle","statusline.glyph.round":"Round","statusline.glyph.lowerTriangle":"Lower Triangle","statusline.glyph.diagonal":"Diagonal","statusline.barStyle.percent":"%","statusline.barStyle.bar":"bar","statusline.barStyle.both":"both","seg.project":"Project","seg.git":"Git","seg.gitUser":"Git Identity","seg.changes":"Changes","seg.model":"Model","seg.thinking":"Thinking","seg.context":"Context","seg.tokens":"Tokens","seg.cost":"Cost","seg.rate":"Rate","seg.time":"Time","seg.version":"Version","seg.output_style":"Output Style","seg.session":"Session","seg.exceeds200k":"200k+","seg.fast_mode":"Fast Mode","seg.vim":"Vim","seg.pr":"PR","seg.worktree":"Worktree","seg.agent":"Agent","align.left":"Left","align.center":"Center","align.right":"Right","rateWin.fiveHour.label":"5h","rateWin.fiveHour.title":"5-hour limit","rateWin.sevenDay.label":"7d","rateWin.sevenDay.title":"7-day limit","rateWin.spend.label":"spend","rateWin.spend.title":"Spend limit"},Cz={"picker.title":"选择资源目录","picker.subtitle":"勾选一个或多个文件夹(点击箭头展开目录)","picker.quickAccess":"快速访问","picker.home":"主目录","picker.desktop":"桌面","picker.downloads":"下载","picker.documents":"文档","picker.libraryParent":"资源位置","picker.drive":"磁盘","picker.root":"根目录","picker.alreadyAdded":"已添加","picker.anchorTip":"资源位置是市场副本所在目录,其中的资源已在列表中,不能再作为来源导入","picker.selectFolder":"选择此文件夹","picker.unselect":"取消选择","picker.noneSelected":"尚未选择任何文件夹","picker.clickRemove":"点击移除","picker.selectedCount":"已选 {count} 项","picker.add":"添加","picker.addCount":"添加({count})","picker.pathPlaceholder":"完整路径:勾选文件夹后显示在此,也可粘贴一个路径","picker.addPathTip":"把这一路径加入选择","category.tabAllTip":"展示全部工具的资产","category.tabToolTip":"仅展示 {tool} 生效的资产","category.tabAll":"全部","category.emptySkillsGlobalCodex":"未安装 Codex 生效的全局 skills","category.emptySkillsProjectCodex":"该项目 .codex/skills/ 下暂无 skills","category.emptySkillsGlobal":"未安装全局 skills","category.emptySkillsProject":"该项目未安装 skills","category.emptyMcpCodex":"未配置 Codex MCP(~/.codex/config.toml)","category.emptyMcpGlobal":"未配置全局 MCP","category.emptyMcpProject":"该项目未配置 MCP","category.codexFilesPlaceholder":"该项目暂无 Codex 资源","category.emptyFilesOtherHarness":"该项目暂无 {harness} 资源","category.emptyFilesProject":"该项目暂无资源","category.globalFilesTitle":"全局资源","category.emptyFilesGlobalDesc":"~/.claude 与 ~/.codex 下暂无匹配的资源","category.personalizationGlobal":"全局 Claude 个性化配置(模板)","category.personalizationProject":"Claude Code 个性化配置","category.statuslineSource":"statusline:{source}","category.statuslineCustom":"项目自定义","category.statuslineFollowGlobal":"跟随全局模板","category.codexPersonalizationPlaceholder":"Codex 没有个性化配置的等价项。","category.personalizationUnsupported":"{harness} 没有等价的个性化配置","category.dropToInstall":"拖放以安装 skill","library.heading":"资源市场","library.expandAllTip":"展开全部分组与区块","library.collapseAllTip":"折叠全部分组与区块","library.expandAll":"全展开","library.collapseAll":"全折叠","library.installTo":"安装到","library.scopeGlobal":"全局","library.scopeProject":"项目","library.followsSelection":"跟随当前选择","library.addFoldersTip":"选择一个或多个文件夹导入资源市场","library.addFolders":"导入本地目录(可多选)","library.gitPlaceholder":"Git URL(https:// 或 git@…)","library.importGit":"导入","library.importGitTip":"克隆 git 仓库进资源市场(仅 https/ssh)","library.importGitOk":"已导入:{name}","library.importFailed":"导入失败:{error}","library.importDirOk":"已导入 {n} 个目录","library.importDirFail":"导入失败:{path}:{error}","library.badgeGit":"Git","library.badgeDir":"本地目录","library.badgeExternal":"外部源","library.marketSectionBuiltin":"内置","library.tagInstalled":"已装 {done} / {total}","library.marketSectionLocal":"本地","library.marketSectionGit":"Git","library.migrate":"迁入市场","library.migrateTip":"复制进资源市场(源目录保留)","library.migrating":"迁入中…","library.migratedOk":"已迁入市场:{name}","library.migrateFailed":"迁入失败:{error}","library.importedAt":"{date} 导入","library.removeMarketTip":"移除市场:删除副本并卸载该市场的插件","library.removeMarketTitle":"移除市场","library.removeMarketConfirm":"移除市场「{name}」?会删除市场副本并卸载从该市场安装的插件(连同插件数据);已安装的 skills 等保留。","library.removeLegacyTip":"从清单移除(外部目录保留)","library.removedOk":"已移除:{name}","library.removeFailed":"移除失败:{error}","library.removeDeregWarn":"市场副本已删,但注销市场未成功:{error}","library.noTemplates":"「{name}」分类暂无外部可安装模板。","library.noTemplatesHint":"切换到 Skills / MCP tab 查看可安装内容。","library.catPersonalization":"个性化配置","library.sectionSkills":"Skill 模板","library.sectionFiles":"文件模板","library.sectionMcp":"MCP 模板","library.sectionUpdates":"更新提示","library.hintDragInstall":"拖放安装","library.hintClickInstall":"点击安装","library.hintClickAdd":"点击添加","library.hintOverwrite":"会覆盖本地修改","library.scanning":"扫描中…","library.addLibrarySkills":"在上方导入资源以浏览 skills。","library.noSkillsFound":"未发现 skills。","library.checkUpdates":"批量检查更新","library.checking":"检查中…","library.checkUpdatesTip":"检查来源目录 / Git 远端有无更新","library.checkDone":"检查完成:{n} 项可更新","library.checkFailed":"检查更新失败:{error}","library.refreshUpdates":"一键更新","library.refreshUpdatesTip":"更新已安装的副本(CC 插件会自动重装)","library.refreshDone":"一键更新完成:{n} 项","library.refreshFailed":"一键更新失败:{error}","library.statusUptodate":"最新","library.statusUpdateAvailable":"有更新","library.statusOriginMissing":"源缺失","library.statusUnknown":"检查失败","library.sectionPlugins":"插件包","library.addLibraryPlugins":"在上方导入资源以浏览插件包。","library.noPlugins":"该库未发现插件包。","library.badgeCcPlugin":"CC 插件","library.badgeWeavePlugin":"Weave 规则包","library.ccPluginTip":"CC 原生插件:全局安装、项目启用","library.weavePluginTip":"Weave 规则包:项目级开关","library.pluginSkillsLabel":"包内 skills · 随插件启停","library.pluginSkillsFollowTip":"隶属该插件,不单独安装——随插件启用/停用","library.pluginNotInToolkit":"来源不在内置或市场导入中——无法在此安装","library.pluginsSectionHint":"「安装」= CC 插件装到全局并在当前项目启用,weave 规则包直接启用。启停与卸载在 资源管理 ▸ Plugins","library.installPackTip":"安装:CC 插件装到全局并在当前项目启用;weave 规则包直接启用","library.packInstalled":"已安装并启用:{name}","library.installing":"安装中…","library.installedManageTip":"已安装——启停与卸载在 资源管理 ▸ Plugins","library.pluginSourceDir":"来源目录","library.addLibraryTemplates":"在上方导入资源以浏览模板。","library.noFileTemplates":"资源中未发现文件模板。","library.noMcpTemplates":"未发现 MCP 模板。","library.rootName":"资源根目录","library.localBadge":"本地","library.install":"安装","library.installed":"已安装","library.installedOk":"已安装:{name}","library.update":"更新","library.updatedOk":"已更新:{name}","library.installTarget":"安装目标","library.tipSkillsClaude":"安装到 .claude/skills/","library.tipSkillsCodex":"安装到 .codex/skills/(全局则为 ~/.codex/skills/)","library.tipMcpClaude":"安装到 .mcp.json / ~/.claude.json","library.tipMcpCodex":"写入 ~/.codex/config.toml(全局)","library.addMcpServer":"添加 MCP Server","library.mcpNamePlaceholder":"名称","library.mcpCommandPlaceholder":"命令(如 npx)","library.mcpArgsPlaceholder":"参数(空格分隔)","library.mcpEnvPlaceholder":"环境变量(每行 KEY=value)","capability.reason.projectOnly":"该资源仅支持项目安装","capability.reason.globalOnly":"该资源仅支持全局安装","capability.reason.claudeOnly":"该资源不支持 Codex","capability.reason.codexOnly":"该资源不支持 Claude","capability.reason.harnessUnsupported":"该资源不支持此 harness"},Tz={"picker.title":"Choose resource folder","picker.subtitle":"Check one or more folders (click the arrow to expand a directory)","picker.quickAccess":"Quick access","picker.home":"Home","picker.desktop":"Desktop","picker.downloads":"Downloads","picker.documents":"Documents","picker.libraryParent":"Resource location","picker.drive":"Drive","picker.root":"Root","picker.alreadyAdded":"Added","picker.anchorTip":"Resource location holds the market copies — its resources are already listed and cannot be imported again","picker.selectFolder":"Select this folder","picker.unselect":"Deselect","picker.noneSelected":"No folders selected yet","picker.clickRemove":"Click to remove","picker.selectedCount":"{count} selected","picker.add":"Add","picker.addCount":"Add ({count})","picker.pathPlaceholder":"Full path: shown here after checking a folder, or paste one","picker.addPathTip":"Add this path to the selection","category.tabAllTip":"Show assets from every tool","category.tabToolTip":"Show only assets effective for {tool}","category.tabAll":"All","category.emptySkillsGlobalCodex":"No global skills effective for Codex installed","category.emptySkillsProjectCodex":"No skills under .codex/skills/ in this project","category.emptySkillsGlobal":"No global skills installed","category.emptySkillsProject":"No skills installed in this project","category.emptyMcpCodex":"No Codex MCP configured (~/.codex/config.toml)","category.emptyMcpGlobal":"No global MCP configured","category.emptyMcpProject":"No MCP configured in this project","category.codexFilesPlaceholder":"This project has no Codex resources yet","category.emptyFilesOtherHarness":"This project has no {harness} resources yet","category.emptyFilesProject":"This project has no resources yet","category.globalFilesTitle":"Global resources","category.emptyFilesGlobalDesc":"No matching resources under ~/.claude and ~/.codex","category.personalizationGlobal":"Global Claude personalization config (templates)","category.personalizationProject":"Claude Code personalization config","category.statuslineSource":"statusline: {source}","category.statuslineCustom":"Project custom","category.statuslineFollowGlobal":"Follows global template","category.codexPersonalizationPlaceholder":"Codex has no personalization counterpart.","category.personalizationUnsupported":"{harness} has no equivalent personalization","category.dropToInstall":"Drop to install skill","library.heading":"Resource Market","library.expandAllTip":"Expand all groups and sections","library.collapseAllTip":"Collapse all groups and sections","library.expandAll":"Expand all","library.collapseAll":"Collapse all","library.installTo":"Install to","library.scopeGlobal":"Global","library.scopeProject":"Project","library.followsSelection":"Follows current selection","library.addFoldersTip":"Pick one or more folders to import into the resource market","library.addFolders":"Import local folders (multi-select)","library.gitPlaceholder":"Git URL (https:// or git@…)","library.importGit":"Import","library.importGitTip":"Clone a git repo into the resource market (https/ssh only)","library.importGitOk":"Imported: {name}","library.importFailed":"Import failed: {error}","library.importDirOk":"Imported {n} folder(s)","library.importDirFail":"Import failed: {path}: {error}","library.badgeGit":"Git","library.badgeDir":"Local dir","library.badgeExternal":"External","library.marketSectionBuiltin":"Builtin","library.tagInstalled":"{done} / {total} installed","library.marketSectionLocal":"Local","library.marketSectionGit":"Git","library.migrate":"Move into market","library.migrateTip":"Copy into the resource market (source kept)","library.migrating":"Moving…","library.migratedOk":"Moved into market: {name}","library.migrateFailed":"Move failed: {error}","library.importedAt":"imported {date}","library.removeMarketTip":"Remove the market: delete the copy and uninstall its plugins","library.removeMarketTitle":"Remove market","library.removeMarketConfirm":'Remove market "{name}"? The copy is deleted and plugins installed from it are uninstalled (including their data); installed skills are kept.',"library.removeLegacyTip":"Remove from the registry (external folder kept)","library.removedOk":"Removed: {name}","library.removeFailed":"Remove failed: {error}","library.removeDeregWarn":"Market copy removed, but deregistering it failed: {error}","library.noTemplates":'The "{name}" category has no externally installable templates.',"library.noTemplatesHint":"Switch to the Skills / MCP tab to view installable content.","library.catPersonalization":"Personalization","library.sectionSkills":"Skill templates","library.sectionFiles":"File templates","library.sectionMcp":"MCP templates","library.sectionUpdates":"Update hints","library.hintDragInstall":"Drag to install","library.hintClickInstall":"Click to install","library.hintClickAdd":"Click to add","library.hintOverwrite":"Overwrites local changes","library.scanning":"Scanning…","library.addLibrarySkills":"Import a resource above to browse skills.","library.noSkillsFound":"No skills found.","library.checkUpdates":"Check for updates","library.checking":"Checking…","library.checkUpdatesTip":"Check the source folder / git remote for updates","library.checkDone":"Check complete: {n} update(s) available","library.checkFailed":"Update check failed: {error}","library.refreshUpdates":"Update all","library.refreshUpdatesTip":"Refresh installed copies (CC plugins are reinstalled automatically)","library.refreshDone":"Update all finished: {n} item(s)","library.refreshFailed":"Update all failed: {error}","library.statusUptodate":"Up to date","library.statusUpdateAvailable":"Update","library.statusOriginMissing":"Source missing","library.statusUnknown":"Unknown","library.sectionPlugins":"Plugin packs","library.addLibraryPlugins":"Import a resource above to browse plugin packs.","library.noPlugins":"No plugin packs found in this library.","library.badgeCcPlugin":"CC plugin","library.badgeWeavePlugin":"Weave pack","library.ccPluginTip":"CC native plugin: installed globally, enabled per project","library.weavePluginTip":"Weave pack: toggled per project","library.pluginSkillsLabel":"Pack skills · follow plugin enablement","library.pluginSkillsFollowTip":"Belongs to this plugin — not installed separately; enabled/disabled with it","library.pluginNotInToolkit":"Source is neither builtin nor imported into the market — cannot install here","library.pluginsSectionHint":'"Install" adds CC plugins globally and enables them in this project; Weave packs are enabled directly. Manage enable/uninstall in Resource Management ▸ Plugins',"library.installPackTip":"Install: CC plugins go global and enable in this project; Weave packs are enabled directly","library.packInstalled":"Installed and enabled: {name}","library.installing":"Installing…","library.installedManageTip":"Installed — enable/disable and uninstall in Resource Management ▸ Plugins","library.pluginSourceDir":"Source path","library.addLibraryTemplates":"Import a resource above to browse templates.","library.noFileTemplates":"No file templates found in this resource.","library.noMcpTemplates":"No MCP templates found.","library.rootName":"resource root","library.localBadge":"Local","library.install":"install","library.installed":"installed","library.installedOk":"Installed: {name}","library.update":"update","library.updatedOk":"Updated: {name}","library.installTarget":"Install target","library.tipSkillsClaude":"Install to .claude/skills/","library.tipSkillsCodex":"Install to .codex/skills/ (global scope uses ~/.codex/skills/)","library.tipMcpClaude":"Install to .mcp.json / ~/.claude.json","library.tipMcpCodex":"Writes ~/.codex/config.toml (global)","library.addMcpServer":"Add MCP Server","library.mcpNamePlaceholder":"name","library.mcpCommandPlaceholder":"command (e.g. npx)","library.mcpArgsPlaceholder":"args (space-separated)","library.mcpEnvPlaceholder":"env (KEY=value per line)","capability.reason.projectOnly":"This resource only installs into a project","capability.reason.globalOnly":"This resource only installs globally","capability.reason.claudeOnly":"This resource does not support Codex","capability.reason.codexOnly":"This resource does not support Claude","capability.reason.harnessUnsupported":"This resource does not support this harness"},Az={"skillGrid.projectHeading":"项目 Skills","skillGrid.globalHeading":"全局 Skills","skillGrid.readOnly":"只读","skillGrid.globalTag":"全局","skillGrid.update":"待更新","skillGrid.custom":"自定义","skillGrid.openDetail":"打开 {name} 详情","skillGrid.uninstall":"卸载 {name}","skillGrid.uninstalled":"已卸载:{name}","skillGrid.uninstallGlobalTitle":"卸载全局技能","skillGrid.uninstallGlobalConfirm":"从全局技能位删除「{name}」?链接只移除链接本身,副本将递归删除。","skillGrid.uninstallPackTitle":"卸载插件包","skillGrid.uninstallPackConfirm":"从 Claude Code 卸载插件包「{key}」?市场副本保留,可随时重装。","skillGrid.packUninstalled":"已卸载插件包:{label}","skillGrid.effective":"已生效:{done} / {total}","skillGrid.effNone":"没有可统计的 skill","skillGrid.effAll":"{n} 个 skill 全部生效","skillGrid.effDisabled":"{n} 个 skill 因所属插件被禁用而未生效","skillGrid.expandAllGroups":"展开全部分组","skillGrid.collapseAllGroups":"折叠全部分组","skillGrid.expandAll":"全部展开","skillGrid.collapseAll":"全部折叠","skillGrid.plugin":"插件","skillGrid.enableDefault":"默认","skillGrid.enableOn":"启用","skillGrid.enableOff":"禁用","skillGrid.scopeUser":"全局","skillGrid.scopeProject":"项目","skillGrid.scopeLocal":"仅本人","skillGrid.enableTip":"{scope}:{state}——点击切换","skillGrid.keyTip":"插件所属市场","repo.local":"本地","repo.namespaceTip":"该市场下的全部插件","repo.packCount":"{n} 个包","repo.enabledCount":"已启 {done} / {total}","repo.formLink":"链接","repo.formCopy":"副本","repo.formLegend":"链接 / 副本","repo.formTip":"「链接」= 生效内容即源文件;「副本」= 建立链接失败后改用的复制。若环境禁用了链接创建,可在「设置 ▸ 系统 ▸ 开发者选项」启用开发者模式后重装","fileTree.all":"全部","fileTree.scopeGlobal":"全局","fileTree.scopeProject":"项目","fileTree.title":"资源管理","fileTree.pathsProject":"{dirs} · 根目录","fileTree.expandAllDirs":"展开全部目录","fileTree.collapseAllDirs":"折叠全部目录","fileTree.expandAll":"全展开","fileTree.collapseAll":"全折叠","fileTree.emptyFiltered":"没有匹配当前筛选的文件","fileTree.symlinkTitle":"{path} — 符号链接","fileTree.uninstall":"卸载 {name}","fileTree.uninstalled":"已卸载:{name}","fileTree.update":"待更新","fileTree.custom":"自定义","assetView.packs":"Plugins","assetView.files":"Files","category.externalAssets":"外部资源","category.externalAssetsNote":"不在任何插件包内","category.externalAssetsSummary":"技能 {skills} · MCP {mcp}","mcp.headingGlobal":"全局 MCP Servers","mcp.headingProject":"项目 MCP Servers","mcp.update":"待更新","mcp.remove":"移除 {name}","mcp.uninstalled":"已卸载:{name}","mcp.enableDefault":"默认","mcp.enableOn":"启用","mcp.enableOff":"禁用","mcp.enableTip":"{state} — 点击切换","mcp.enableFailed":"MCP 启用状态切换失败:{error}","catbar.files":"资源管理","catbar.personalization":"个性化配置","catbar.updateBadge":"{n} 待更新","catbar.custom":"自定义","catbar.followGlobal":"跟随全局","catbar.items":"{n} 项","task.heading":"任务({events} 条事件,{sessions} 个会话)","task.expandAll":"全部展开","task.collapseAll":"全部折叠","task.empty":"暂无 hook 事件","task.events":"{n} 条事件","task.noPayload":"无 payload 详情","task.copySessionId":"复制会话 ID","task.copied":"已复制","task.pendingTitle":"待生效","fm.title":"Frontmatter"},Mz={"skillGrid.projectHeading":"Project Skills","skillGrid.globalHeading":"Global Skills","skillGrid.readOnly":"Read-only","skillGrid.globalTag":"Global","skillGrid.update":"update","skillGrid.custom":"custom","skillGrid.openDetail":"Open {name} detail","skillGrid.uninstall":"Uninstall {name}","skillGrid.uninstalled":"Uninstalled: {name}","skillGrid.uninstallGlobalTitle":"Uninstall global skill","skillGrid.uninstallGlobalConfirm":'Remove "{name}" from the global skills location? A link only removes the link itself; a copy is deleted recursively.',"skillGrid.uninstallPackTitle":"Uninstall plugin pack","skillGrid.uninstallPackConfirm":'Uninstall plugin pack "{key}" from Claude Code? The market copy is kept and it can be reinstalled anytime.',"skillGrid.packUninstalled":"Plugin pack uninstalled: {label}","skillGrid.effective":"In effect: {done} / {total}","skillGrid.effNone":"No skills to count","skillGrid.effAll":"All {n} skills in effect","skillGrid.effDisabled":"{n} skills not in effect because their plugin is disabled","skillGrid.expandAllGroups":"Expand all groups","skillGrid.collapseAllGroups":"Collapse all groups","skillGrid.expandAll":"Expand all","skillGrid.collapseAll":"Collapse all","skillGrid.plugin":"Plugin","skillGrid.enableDefault":"Default","skillGrid.enableOn":"Enabled","skillGrid.enableOff":"Disabled","skillGrid.scopeUser":"Global","skillGrid.scopeProject":"Project","skillGrid.scopeLocal":"Local only","skillGrid.enableTip":"{scope}: {state} — click to cycle","skillGrid.keyTip":"Plugin marketplace","repo.local":"Local","repo.namespaceTip":"Every plugin from this marketplace","repo.packCount":"{n} packs","repo.enabledCount":"{done} / {total} enabled","repo.formLink":"linked","repo.formCopy":"copied","repo.formLegend":"linked / copied","repo.formTip":"Linked = the source files are what takes effect; copied = creating a link failed and weave fell back to copying. If link creation is disabled in your environment, enable Developer Mode under Settings ▸ System ▸ For developers and reinstall","fileTree.all":"All","fileTree.scopeGlobal":"Global","fileTree.scopeProject":"Project","fileTree.title":"Resource Management","fileTree.pathsProject":"{dirs} · root dir","fileTree.expandAllDirs":"Expand all folders","fileTree.collapseAllDirs":"Collapse all folders","fileTree.expandAll":"Expand all","fileTree.collapseAll":"Collapse all","fileTree.emptyFiltered":"No files match the current filter","fileTree.symlinkTitle":"{path} — symlink","fileTree.uninstall":"Uninstall {name}","fileTree.uninstalled":"Uninstalled: {name}","fileTree.update":"update","fileTree.custom":"custom","assetView.packs":"Plugins","assetView.files":"Files","category.externalAssets":"External","category.externalAssetsNote":"not part of any plugin pack","category.externalAssetsSummary":"skills {skills} · MCP {mcp}","mcp.headingGlobal":"Global MCP Servers","mcp.headingProject":"Project MCP Servers","mcp.update":"update","mcp.remove":"Remove {name}","mcp.uninstalled":"Uninstalled: {name}","mcp.enableDefault":"Default","mcp.enableOn":"Enabled","mcp.enableOff":"Disabled","mcp.enableTip":"{state} — click to cycle","mcp.enableFailed":"MCP enable state toggle failed: {error}","catbar.files":"Resource Management","catbar.personalization":"Personalization","catbar.updateBadge":"{n} update","catbar.custom":"Custom","catbar.followGlobal":"Follow global","catbar.items":"{n} items","task.heading":"Tasks ({events} events, {sessions} sessions)","task.expandAll":"Expand all","task.collapseAll":"Collapse all","task.empty":"No hook events yet","task.events":"{n} events","task.noPayload":"No payload details","task.copySessionId":"Copy session ID","task.copied":"Copied","task.pendingTitle":"Pending","fm.title":"Frontmatter"},jz={"catbar.hooks":"Weave","hooks.title":"Weave 规则与数据流","hooks.flowTitle":"数据流画布","hooks.mindmap.pickSession":"会话","hooks.mindmap.hint":"每次 prompt 一个折叠根 · 展开看 hook / subagent / 指令子节点","hooks.mindmap.empty":"该会话暂无 hook 事件","hooks.mindmap.preSession":"会话引导","hooks.mindmap.openTag":"未正常结束","hooks.mindmap.runningTag":"执行中","hooks.mindmap.subagentCount":"subagent ×{n}","hooks.mindmap.agentDispatched":"子代理 ×{n}","hooks.mindmap.notifyTag":"子代理返回","hooks.mindmap.compactTag":"压缩会话","hooks.mindmap.agentRunning":"执行中","hooks.mindmap.agentPending":"已派发,等待子代理返回","hooks.mindmap.dispatchTag":"指令","hooks.mindmap.dispatchCount":"指令 ×{n}","hooks.mindmap.toolCluster":"工具调用","hooks.mindmap.pendingTip":"链路上存在待处理指令","hooks.mindmap.detailTitle":"节点明细","hooks.mindmap.closeDetail":"关闭明细","hooks.colSource":"事件源","hooks.colRule":"规则","hooks.colHandler":"处理器","hooks.emptyFlow":"还没有任何规则,链路图为空","hooks.emptyFlowDisabled":"没有已启用的规则,链路图为空","hooks.loading":"加载中…","hooks.loadFailed":"加载失败:{error}","hooks.actionFailed":"操作失败:{error}","hooks.pluginsAndRules":"插件与规则","hooks.localRules":"本地规则","hooks.newRule":"新建规则","hooks.rulesEmpty":"还没有规则,点击「新建规则」创建第一条。","hooks.thName":"名称","hooks.thEvent":"事件","hooks.thFilter":"过滤","hooks.thHandler":"处理器","hooks.thActions":"操作","hooks.filterNone":"无过滤","hooks.filterToolTip":"工具名:{names}","hooks.filterPathTip":"路径:{paths}","hooks.filterCrossTip":"仅跨项目命中时触发","hooks.scopeGlobal":"全局","hooks.scopeProjectName":"项目:{name}","hooks.scopeProjectId":"项目 #{id}","hooks.edit":"编辑","hooks.delete":"删除","hooks.confirmDelete":"确认删除?","hooks.toggleTip":"启用或停用「{name}」","hooks.form.createTitle":"新建规则","hooks.form.editTitle":"编辑规则","hooks.quickTemplate":"文档更新检查(一键模板)","hooks.quickTemplateTip":"填充一个 PostToolUse + *.md 的注入规则示例(默认停用)","hooks.quickTemplateName":"文档更新检查","hooks.quickTemplatePrompt":"请检查本次改动涉及的文档({file} 等)是否需要同步更新;如有过期内容请直接修改相关 Markdown 文档。","hooks.field.name":"名称","hooks.namePlaceholder":"如:文档更新检查","hooks.field.project":"生效范围","hooks.projectGlobal":"全局(所有项目)","hooks.field.event":"触发事件","hooks.eventInjectHint":"inject 处理器仅支持这些事件:{events}","hooks.field.sourceKind":"规则来源","hooks.sourceKind.hookEvent":"事件规则","hooks.sourceKind.legacy":"兼容旧版","hooks.field.harness":"目标 harness","hooks.harness.any":"任意(any)","hooks.field.handler":"处理器","hooks.handler.log":"仅记录","hooks.handler.webhook":"Webhook 转发","hooks.handler.inject":"注入会话","hooks.handler.manual":"手动指令","hooks.handler.plugin":"插件处理器","hooks.handlerLogTip":"只记录事件,不生成指令","hooks.handlerWebhookTip":"将事件摘要发送到外部地址","hooks.handlerInjectTip":"渲染指令并同步注入当前会话","hooks.handlerManualTip":"渲染为指令节点,等待复制或拖到会话执行","hooks.handlerPluginTip":"执行插件自带的处理器","hooks.field.toolNames":"工具名过滤","hooks.toolNamesPlaceholder":"逗号分隔,如 Read, Edit, Bash","hooks.field.pathGlobs":"路径 glob 过滤","hooks.pathGlobsPlaceholder":"逗号分隔,如 **/*.md, docs/**","hooks.field.crossProjectOnly":"仅跨项目命中时触发","hooks.field.template":"指令模板","hooks.templatePlaceholder":"支持占位符:{event} {tool} {file} {cwd} {session} {project} {rule}","hooks.field.url":"回调 URL","hooks.urlPlaceholder":"https://example.com/hook","hooks.field.secret":"签名密钥(可选)","hooks.field.pluginId":"插件 ID","hooks.pluginIdPlaceholder":"如 changelog-reminder","hooks.field.pluginHandlerType":"handlerType","hooks.pluginHandlerPlaceholder":"如 notify","hooks.field.record":"记录为指令","hooks.field.enabled":"启用","hooks.save":"保存","hooks.cancel":"取消","hooks.errNameRequired":"请填写规则名称","hooks.errTemplateRequired":"请填写指令模板","hooks.errUrlRequired":"请填写合法的回调 URL","hooks.errPluginRequired":"请填写 pluginId 与 handlerType","hooks.status.pending":"待执行","hooks.status.injected":"已注入","hooks.status.running":"运行中","hooks.status.succeeded":"成功","hooks.status.failed":"失败","hooks.status.timeout":"超时","hooks.runConfirm":"将指令 #{id} 执行到会话「{session}」?","hooks.runConfirmYes":"确认执行","hooks.plugins.hint":"放入约定目录即自动识别 · 见 docs/PLUGIN-SPEC.md","hooks.plugins.projectHint":"本项目启用状态(未单独设置则跟随全局)· 安装 / 卸载在全局侧操作","hooks.plugins.followGlobal":"跟随全局","hooks.plugins.projectOverride":"已单独设置","hooks.plugins.empty":"暂无插件——从内置仓或资源市场安装","hooks.plugins.rules":"{n} 条规则","hooks.plugins.toggleTip":"启停该插件的全部规则(各项目可单独覆盖)","hooks.plugins.rejectedTip":"插件校验失败,修复后热重载自动恢复","hooks.plugins.hotReload":"插件文件变更后 1 秒内热重载生效","hooks.plugins.rescan":"重新扫描","hooks.plugins.rescanTip":"重新扫描插件目录(守护进程启动后才出现的目录由此纳入)","hooks.plugins.rescanOk":"插件根已重新扫描(当前 {n} 个插件)","hooks.plugins.rescanFail":"重新扫描失败:{error}","hooks.plugins.expand":"展开该插件的规则","hooks.plugins.collapse":"折叠该插件的规则","hooks.plugins.uninstallTip":"卸载插件(删除目录)","hooks.plugins.uninstallTitle":"卸载插件","hooks.plugins.uninstallConfirm":"卸载插件 {id}?其规则将被级联移除。","hooks.plugins.toggleFail":"插件开关失败:{error}","hooks.plugins.uninstallOk":"已卸载:{id}","hooks.plugins.uninstallFail":"卸载失败:{error}","hooks.capture.title":"事件采集(user 档)","hooks.capture.hint":"跨项目采集全部会话事件","hooks.capture.note":"安装即启用;项目档已有的采集组会被自动清理,不会重复采集","hooks.capture.toggleTip":"安装 / 停用 user 档事件采集","hooks.capture.onOk":"user 档采集已安装","hooks.capture.offOk":"user 档采集已停用","hooks.capture.fail":"采集开关失败:{error}","hooks.capture.half":"半安装","hooks.capture.halfTip":"采集组已写但 helper 脚本缺失——关掉再打开即可修复"},Rz={"catbar.hooks":"Weave","hooks.title":"Weave rules & data flow","hooks.flowTitle":"Data flow canvas","hooks.mindmap.pickSession":"Session","hooks.mindmap.hint":"One collapsible root per prompt · expand for hook / subagent / dispatch children","hooks.mindmap.empty":"No hook events in this session","hooks.mindmap.preSession":"Session intro","hooks.mindmap.openTag":"Interrupted","hooks.mindmap.runningTag":"Running","hooks.mindmap.subagentCount":"subagent ×{n}","hooks.mindmap.agentDispatched":"Agents ×{n}","hooks.mindmap.notifyTag":"Agent returned","hooks.mindmap.compactTag":"Compacted","hooks.mindmap.agentRunning":"Running","hooks.mindmap.agentPending":"Dispatched — awaiting the subagent","hooks.mindmap.dispatchTag":"Dispatch","hooks.mindmap.dispatchCount":"Dispatch ×{n}","hooks.mindmap.toolCluster":"Tool calls","hooks.mindmap.pendingTip":"A pending dispatch sits on this path","hooks.mindmap.detailTitle":"Node details","hooks.mindmap.closeDetail":"Close details","hooks.colSource":"Sources","hooks.colRule":"Rules","hooks.colHandler":"Handlers","hooks.emptyFlow":"No rules yet — the flow graph is empty","hooks.emptyFlowDisabled":"No enabled rules — the flow graph is empty","hooks.loading":"Loading…","hooks.loadFailed":"Failed to load: {error}","hooks.actionFailed":"Action failed: {error}","hooks.pluginsAndRules":"Plugins & rules","hooks.localRules":"Local rules","hooks.newRule":"New rule","hooks.rulesEmpty":'No rules yet — click "New rule" to create the first one.',"hooks.thName":"Name","hooks.thEvent":"Event","hooks.thFilter":"Filter","hooks.thHandler":"Handler","hooks.thActions":"Actions","hooks.filterNone":"No filter","hooks.filterToolTip":"Tool names: {names}","hooks.filterPathTip":"Paths: {paths}","hooks.filterCrossTip":"Only fires on cross-project matches","hooks.scopeGlobal":"Global","hooks.scopeProjectName":"Project: {name}","hooks.scopeProjectId":"Project #{id}","hooks.edit":"Edit","hooks.delete":"Delete","hooks.confirmDelete":"Confirm delete?","hooks.toggleTip":'Enable or disable "{name}"',"hooks.form.createTitle":"New rule","hooks.form.editTitle":"Edit rule","hooks.quickTemplate":"Docs update check (quick template)","hooks.quickTemplateTip":"Fills an example PostToolUse + *.md inject rule (disabled by default)","hooks.quickTemplateName":"Docs update check","hooks.quickTemplatePrompt":"Check whether docs touched by this change (e.g. {file}) need syncing; edit any stale Markdown docs directly.","hooks.field.name":"Name","hooks.namePlaceholder":"e.g. Docs update check","hooks.field.project":"Scope","hooks.projectGlobal":"Global (all projects)","hooks.field.event":"Trigger event","hooks.eventInjectHint":"The inject handler only supports these events: {events}","hooks.field.sourceKind":"Rule source","hooks.sourceKind.hookEvent":"Event rule","hooks.sourceKind.legacy":"Legacy","hooks.field.harness":"Target harness","hooks.harness.any":"Any","hooks.field.handler":"Handler","hooks.handler.log":"Log only","hooks.handler.webhook":"Webhook","hooks.handler.inject":"Inject into session","hooks.handler.manual":"Manual prompt","hooks.handler.plugin":"Plugin handler","hooks.handlerLogTip":"Records the event only; no prompt generated","hooks.handlerWebhookTip":"Sends an event summary to an external URL","hooks.handlerInjectTip":"Renders the prompt and injects it into the current session","hooks.handlerManualTip":"Renders the prompt as a node to copy or drag onto a session","hooks.handlerPluginTip":"Runs the plugin's own handler","hooks.field.toolNames":"Tool name filter","hooks.toolNamesPlaceholder":"Comma-separated, e.g. Read, Edit, Bash","hooks.field.pathGlobs":"Path glob filter","hooks.pathGlobsPlaceholder":"Comma-separated, e.g. **/*.md, docs/**","hooks.field.crossProjectOnly":"Only fire on cross-project matches","hooks.field.template":"Prompt template","hooks.templatePlaceholder":"Placeholders: {event} {tool} {file} {cwd} {session} {project} {rule}","hooks.field.url":"Webhook URL","hooks.urlPlaceholder":"https://example.com/hook","hooks.field.secret":"Signing secret (optional)","hooks.field.pluginId":"Plugin ID","hooks.pluginIdPlaceholder":"e.g. changelog-reminder","hooks.field.pluginHandlerType":"handlerType","hooks.pluginHandlerPlaceholder":"e.g. notify","hooks.field.record":"Record dispatches","hooks.field.enabled":"Enabled","hooks.save":"Save","hooks.cancel":"Cancel","hooks.errNameRequired":"Please enter a rule name","hooks.errTemplateRequired":"Please enter a prompt template","hooks.errUrlRequired":"Please enter a valid webhook URL","hooks.errPluginRequired":"Please fill in pluginId and handlerType","hooks.status.pending":"Pending","hooks.status.injected":"Injected","hooks.status.running":"Running","hooks.status.succeeded":"Succeeded","hooks.status.failed":"Failed","hooks.status.timeout":"Timeout","hooks.runConfirm":'Run prompt #{id} into session "{session}"?',"hooks.runConfirmYes":"Run","hooks.plugins.hint":"Drop a directory into a scan root to auto-register · see docs/PLUGIN-SPEC.md","hooks.plugins.projectHint":"Enabled state for this project (follows global until overridden) · install / uninstall at global scope","hooks.plugins.followGlobal":"Follows global","hooks.plugins.projectOverride":"Set for this project","hooks.plugins.empty":"No plugins yet — install from the builtin repository or a resource market","hooks.plugins.rules":"{n} rules","hooks.plugins.toggleTip":"Enable/disable all rules of this plugin (projects can override)","hooks.plugins.rejectedTip":"Plugin validation failed; fix it and hot reload recovers automatically","hooks.plugins.hotReload":"Plugin file changes hot reload within 1 second","hooks.plugins.rescan":"Rescan","hooks.plugins.rescanTip":"Rescan plugin directories (ones created after the daemon started get picked up)","hooks.plugins.rescanOk":"Plugin roots rescanned ({n} plugins)","hooks.plugins.rescanFail":"Rescan failed: {error}","hooks.plugins.expand":"Expand this plugin's rules","hooks.plugins.collapse":"Collapse this plugin's rules","hooks.plugins.uninstallTip":"Uninstall plugin (remove directory)","hooks.plugins.uninstallTitle":"Uninstall plugin","hooks.plugins.uninstallConfirm":"Uninstall plugin {id}? Its rules will be cascade-removed.","hooks.plugins.toggleFail":"Failed to toggle plugin: {error}","hooks.plugins.uninstallOk":"Uninstalled: {id}","hooks.plugins.uninstallFail":"Uninstall failed: {error}","hooks.capture.title":"Event capture (user scope)","hooks.capture.hint":"Captures session events across every project","hooks.capture.note":"Install = enabled; existing project-scope capture groups are cleaned up so nothing is captured twice","hooks.capture.toggleTip":"Install / disable user-scope event capture","hooks.capture.onOk":"User-scope capture installed","hooks.capture.offOk":"User-scope capture disabled","hooks.capture.fail":"Capture toggle failed: {error}","hooks.capture.half":"Half-installed","hooks.capture.halfTip":"Hook groups written but helper script missing — toggle off and on to repair"},Oz={"catbar.tasks":"任务","tasks.heading":"任务视图","tasks.selectHint":"从左侧选择一个会话,查看它的数据流","tasks.emptySessions":"暂无会话——在项目里跑一次 Claude 会话即出现","tasks.listTitle":"会话","tasks.refresh":"刷新","tasks.refreshed":"已刷新","tasks.newSession":"新建会话","tasks.newSessionTip":"起一个新会话","tasks.newSessionNoHarness":"本项目已接入的 harness 都不能起交互会话——重跑 weave init 选一个","tasks.newSessionFailed":"新建会话失败:{error}","tasks.newSessionStarting":"正在新建会话…","tasks.statusRunning":"运行中","tasks.statusCompacting":"压缩中","tasks.statusFailed":"失败","tasks.statusOpen":"就绪","tasks.statusClosed":"关闭","tasks.statusTerminated":"已终止","tasks.statusInterrupted":"已中断","tasks.events":"{n} 事件","tasks.renameTip":"双击改名","tasks.renamePlaceholder":"会话标题","tasks.renameVerifyFail":"改名未生效,请重试","tasks.renamePendingTip":"已挂起,等会话下次活动时生效","tasks.dropTip":"把指令卡拖到这里执行","tasks.copySessionId":"复制完整 sessionId","tasks.copied":"已复制","tasks.openSessionTerminal":"在默认终端打开会话","tasks.sessionTerminalRunning":"该会话已在终端运行——不可重复打开","tasks.transcriptMissing":"转录已丢失","tasks.transcriptMissingTip":"该会话的转录文件已不在磁盘上(被清理或删除),接不回来了;会话行与已采集的事件照常保留,可以删掉这一行","tasks.closePaneTooltip":"关闭该会话的终端(退出会话;历史保留)","tasks.closePaneTitle":"关闭会话","tasks.closePaneConfirm":"关闭会话「{id}」的终端?会话会一起退出;历史保留。","tasks.closePaneFallback":"未命名窗格","tasks.closePaneFailed":"关闭会话失败:{error}","tasks.closeTerminalPickTitle":"选择要关闭的终端","tasks.closeTerminalConfirmLabel":"关闭 {n} 个","tasks.terminalPickTitle":"选择要附加到的终端","tasks.terminalPickCancel":"取消","tasks.harnessPickTitle":"在哪个 harness 里新建会话","tasks.terminalTargetFallback":"窗口 {w} · Tab {t}","tasks.terminalTargetActive":"当前聚焦","tasks.terminalTargetFull":"已满({n} 个窗格)","tasks.terminalTargetFullTip":"这个终端已满——新会话需另开终端","tasks.terminalTargetDetail":"{match} 个本项目的窗格(共 {total})","tasks.terminalBlock":"终端 {w}","tasks.terminalBlockTab":"终端 {w} · Tab {t}","tasks.terminalBlockSessions":"{n} 个会话","tasks.deleteSession":"删除会话","tasks.deleteTooltip":"删除该会话及其全部事件,不可撤销","tasks.deleteConfirm":"删除会话「{id}」及其全部事件?此操作不可撤销。","tasks.deleteFailed":"删除会话失败:{error}","tasks.messageTooltip":"对话:查看消息投递与回合总结","tasks.resizeList":"拖拽调整会话列表宽度","tasks.messagesTitle":"对话","tasks.messagesClose":"关闭","tasks.messagesMinimize":"最小化","tasks.msgCloseConfirmTitle":"关闭对话框","tasks.msgCloseConfirm":"输入框里还有未发送的内容,关闭会丢弃它们。","tasks.messagesEmpty":"还没有对话——从下方投递第一条","tasks.convAnswer":"回答","tasks.convFilterAll":"全部","tasks.convFilterSent":"我发的","tasks.convFilterRecv":"回复","tasks.convFilterEmpty":"当前过滤下没有消息","tasks.convCount":"共 {n} 条","tasks.convSelect":"多选","tasks.convSelected":"已选 {n} 条","tasks.convCopy":"复制","tasks.convCancel":"取消","tasks.convCopyOk":"已复制 {n} 条(带时刻戳)","tasks.convCopyFailed":"复制失败:可手动选中文本复制","tasks.convSelectAll":"全选","tasks.convDeselectAll":"取消全选","tasks.convShare":"分享图片","tasks.convShareCopy":"复制到剪贴板","tasks.convShareDownload":"下载 PNG","tasks.convImgOk":"已复制 {n} 条对话图片","tasks.convImgCopyFailed":"复制图片失败:该浏览器不支持,可改用「下载 PNG」","tasks.convImgSaved":"图片已下载","tasks.convImgFailed":"生成图片失败:{error}","tasks.convImgSubtitle":"{at} 导出 · {n} 条","tasks.convRoleUser":"我","tasks.convRoleAssistant":"会话","tasks.msgEarlier":"加载更早的消息…","tasks.pullMore":"继续拉动加载更早的消息","tasks.pullMoreEvents":"继续拉动加载更早的事件","tasks.messagesPlaceholder":"输入要投递的消息…(Enter 发送,Shift+Enter 换行)","tasks.messagesSend":"发送","tasks.msgChannelTitle":"投递通道","tasks.msgChannelCurrent":"投递通道:{via}","tasks.msgChannelAuto":"自动","tasks.msgChannelAutoHint":"直投优先,失败才回落终端 / 中继","tasks.msgChannelTerminal":"终端输入","tasks.msgChannelTerminalHint":"强制写进会话自己的终端——宿主只把这里当用户输入","tasks.msgNewline":"换行","tasks.msgSendFailed":"投递失败:{error}","tasks.msgUnsupported":"该会话不支持消息投递","tasks.msgImageAttach":"图片","tasks.msgImageRemove":"移除这张图","tasks.msgImageUnsupported":"该会话不收图","tasks.msgImageTooLarge":"图片超过 10MB","tasks.msgImageTooMany":"一条最多带 8 张图","tasks.msgImageBadType":"只支持 PNG / JPEG / GIF / WebP","tasks.msgImageUploadFailed":"图片上传失败:{error}","tasks.msgImagePreview":"关闭大图","tasks.modeLabel":"模式","tasks.modeUnknown":"未知","tasks.modeLastKnown":"最后一次活动时的模式","tasks.modeCycle":"切换执行模式","tasks.modeCycled":"已送出切换","tasks.modeCycleFailed":"切换模式失败:{error}","tasks.modeConfirmTitle":"切换执行模式","tasks.modeConfirm":"切换执行模式:顺序由会话决定,可能落到 plan 或 bypass 权限模式,且无法撤回。","tasks.modeConfirmAction":"切换","tasks.modelLabel":"模型","tasks.modelUnknown":"未知","tasks.modelLastKnown":"最近一轮用过的模型","tasks.modelSet":"已送出切换","tasks.modelSetFailed":"切换模型失败:{error}","tasks.msgViaSocket":"直投","tasks.msgViaRelay":"中继","tasks.msgViaTerminal":"终端","tasks.msgAcked":"已回执","tasks.msgGenerating":"生成中…","tasks.msgCompacting":"压缩会话中…","tasks.msgInterrupted":"已中断","tasks.msgStalled":"未回执 · 队列已暂停","tasks.msgResend":"重发","tasks.msgResendFailed":"重发失败:{error}","tasks.msgDismiss":"删除","tasks.msgDismissHint":"把这条从对话里删掉;已送到会话的内容不受影响","tasks.msgDismissQueuedHint":"这条还没送出去——删掉即取消发送","tasks.msgDismissFailed":"删除失败:{error}","tasks.msgOffline":"会话未运行——消息没有送出去(先打开该会话,再点重发)","tasks.msgOfflineToast":"会话未运行,消息没有送出去","tasks.msgStatusQueued":"排队中","tasks.msgStatusSent":"已发出","tasks.outboxDequeue":"取回编辑","tasks.outboxDequeueHint":"取回队列里最新这条,放回输入框改完再发","tasks.msgDequeueFailed":"出队失败:{error}","tasks.msgStatusDelivering":"投递中","tasks.msgStatusInjected":"已注入","tasks.msgStatusDelivered":"已送达","tasks.msgDeliveredHint":"已交给对方会话——不代表已读","tasks.msgStatusRunning":"回合执行中","tasks.msgStatusSucceeded":"已完成","tasks.msgStatusFailed":"失败","tasks.msgStatusTimeout":"超时","tasks.msgModePrompt":"投递","tasks.msgModeAuto":"自动","tasks.msgModeInject":"注入","tasks.msgModeHeadless":"无头","tasks.msgModePromptHint":"投递(送进会话;未打开的排队)","tasks.msgModeAutoHint":"自动(忙时排队,闲时立刻开一轮)","tasks.msgModeInjectHint":"注入(排队,等会话下次活动再送)","tasks.msgModeHeadlessHint":"无头(只在空闲时,立刻开新回合)","tasks.msgOutput":"回合输出","tasks.watchTooltip":"会话提醒:订阅下一条命中的消息(一次性)","tasks.watchActiveTooltip":"已订阅提醒——剩余 {n} 次(点击调整/取消)","tasks.watchOn":"「{label}」已空闲","tasks.watchTurnEnd":"「{label}」一轮对话结束","tasks.watchMsgFailed":"「{label}」有消息投递失败","tasks.watchNotifyTitle":"会话提醒","tasks.questionPending":"「{label}」在等你作答","tasks.questionPendingTitle":"待答提醒","tasks.watchPickerTitle":"会话提醒","tasks.watchPickerHint":"订阅该会话「下一条」符合所选条件的消息,命中即提醒并自动失效。","tasks.watchKindIdle":"空闲","tasks.watchKindIdleHint":"该会话空闲时(一轮结束或会话退出)","tasks.watchKindTurnEnd":"一轮对话结束","tasks.watchKindTurnEndHint":"该会话跑完一轮对话","tasks.watchKindMessageFailed":"投递失败·超时","tasks.watchKindMessageFailedHint":"投递给该会话的消息失败或超时","tasks.watchTimes":"提醒次数","tasks.watchTimesLeft":"剩余次数","tasks.watchPersistent":"持久化(不失效)","tasks.watchSubscribe":"订阅","tasks.watchUpdate":"更新","tasks.watchUnwatch":"取消订阅","tasks.notifyDenied":"浏览器通知未授权——提醒只在页面内显示","tasks.notifyUnsupported":"此浏览器不支持通知——提醒只在页面内显示","tasks.notifyInsecure":"HTTP 访问无法使用浏览器通知(需 HTTPS 或 localhost)——提醒只在页面内显示","tasks.messageInflight":"{n} 条消息在途(未送达)","tasks.watchFailed":"订阅空闲提醒失败:{error}","tasks.unwatchFailed":"取消订阅失败:{error}","tasks.answerTooltip":"会话在等待作答(问题 / 计划 / 权限确认)","tasks.answerActiveTooltip":"{n} 个待答问题(点击远程作答)","tasks.answerPendingTag":"待答","tasks.answerPickerTitle":"待答问题","tasks.answerPickerHint":"单问点选项即提交;多问或多选选好后用下方按钮一次提交。","tasks.answerPickerHintPreview":"点选项只挪高亮,提交走「发送」;备注随高亮选项一起发。","tasks.answerIncomplete":"还有 {n} 个问题未作答","tasks.answerSend":"发送","tasks.answerFailed":"作答失败:{error}","tasks.pendingTitle":"改名待生效","tasks.chainTitle":"事件链","tasks.chainEmpty":"该会话还没有采集到事件","tasks.chainCatchUp":"正在向前补拉更早的 prompt…","tasks.searchPlaceholder":"搜索事件名","tasks.searchMatches":"{n} 条匹配","tasks.searchNoMatch":"没有匹配的折叠条","tasks.dispatchQueue":"待派发 {n}","tasks.dispatchHint":"选择活跃会话后派发,结果在事件链中高亮","tasks.dispatchRun":"派发","tasks.dispatchRunFailed":"派发执行失败:{error}","tasks.legendNote":"历史事件链可能缺少这类节点","tasks.unnamedSession":"未命名会话","tasks.groupDispatches":"{n} 派发","tasks.groupOpen":"未正常结束","tasks.groupRunning":"执行中","tasks.groupSubagent":"子代理完成 ×{n}","tasks.groupAgents":"子代理 ×{n}","tasks.groupQuestions":"问答 ×{n}","tasks.copyPrompt":"复制 prompt","tasks.stop":"停止","tasks.stopTooltip":"停止会话","tasks.stopOk":"已送出停止","tasks.stopFail":"停止失败:{error}","tasks.groupPreSession":"会话引导","tasks.autoDeleteInDays":"{n} 天后自动移除","tasks.autoDeleteInHours":"{n} 小时后自动移除","tasks.autoDeleteInMinutes":"{n} 分钟后自动移除","tasks.autoDeleteSoon":"即将自动移除","tasks.yesterday":"昨天","tasks.overviewTitle":"全局任务总览","tasks.overviewEmpty":"暂无跨项目会话——在任意项目里跑一次 Claude 会话即出现","tasks.overviewProject":"项目","tasks.overviewSession":"会话","tasks.overviewStatus":"状态","tasks.overviewEvents":"事件","tasks.overviewTime":"时间","tasks.overviewUnknownProject":"未识别项目","tasks.overviewAllProjects":"全部项目","tasks.rangeAll":"全部时间","tasks.rangeToday":"当天","tasks.range1d":"1天内","tasks.range3d":"3天内","tasks.range7d":"7天内","tasks.range30d":"30天内","tasks.rangeOver30":"大于30天","tasks.rangeCustom":"自定义","tasks.rangeFrom":"起始日期","tasks.rangeTo":"结束日期","tasks.olderHint":"向下滚动或点击加载更早的 prompt(默认显示最新 10 条)","tasks.loadOlder":"加载更早 {n} 条","tasks.loadOlderEvents":"加载更早事件","tasks.loadAll":"加载全部","catbar.orchestrate":"编排","orch.title":"跨会话编排","orch.hint":"会话按类型分道排布,节点上显示在途消息数;点击可收消息的节点查看对话","orch.canvasEmpty":"本项目暂无会话——先在任务视图跑出会话,再回到这里编排","orch.messages":"{n} 条在途消息","orch.unknownLane":"未知 harness","orch.received":"在途 {n}","orch.builderTitle":"触发序列","orch.builderHint":"最多 3 步,前一步完成后自动发下一步","orch.namePlaceholder":"序列名(可选)","orch.stepTarget":"目标会话","orch.stepMode":"投递通道","orch.stepText":"消息内容","orch.addStep":"加一步","orch.removeStep":"移除该步","orch.trigger":"触发","orch.triggerFailed":"触发序列失败:{error}","orch.noCapableSessions":"暂无可收消息的会话","orch.sequencesTitle":"序列","orch.seqEmpty":"暂无序列——用上方触发器发起第一条","orch.seqNameFallback":"序列 #{id}","orch.seqProgress":"第 {cur}/{n} 步","orch.seqDone":"已完成","orch.seqCancelled":"已取消","orch.seqCancel":"取消","orch.seqCancelFailed":"取消序列失败:{error}","orch.seqStepPending":"未触发","orch.globalHint":"编排是项目级视图——选择一个项目后编排它的会话"},Dz={"catbar.tasks":"Tasks","tasks.heading":"Task view","tasks.selectHint":"Pick a session on the left to see its data flow","tasks.emptySessions":"No sessions yet — run a Claude session in this project","tasks.listTitle":"Sessions","tasks.refresh":"Refresh","tasks.refreshed":"Refreshed","tasks.newSession":"New session","tasks.newSessionTip":"Start a new session","tasks.newSessionNoHarness":"No harness integrated in this project can start an interactive session — re-run weave init and pick one","tasks.newSessionFailed":"Failed to start a new session: {error}","tasks.newSessionStarting":"Starting a new session…","tasks.statusRunning":"Running","tasks.statusCompacting":"Compacting","tasks.statusFailed":"Failed","tasks.statusOpen":"Ready","tasks.statusClosed":"Closed","tasks.statusTerminated":"Terminated","tasks.statusInterrupted":"Interrupted","tasks.events":"{n} events","tasks.renameTip":"Double-click to rename","tasks.renamePlaceholder":"Session title","tasks.renameVerifyFail":"Rename did not take effect — please retry","tasks.renamePendingTip":"Queued — applies on the session’s next activity","tasks.dropTip":"Drop an instruction card here to run","tasks.copySessionId":"Copy full session id","tasks.copied":"Copied","tasks.openSessionTerminal":"Open in default terminal","tasks.sessionTerminalRunning":"A terminal is already running this session — cannot open again","tasks.transcriptMissing":"Transcript missing","tasks.transcriptMissingTip":"This session’s transcript file is gone from disk (cleaned up or deleted), so it can no longer be resumed; the row and its collected events remain — you can delete the row","tasks.closePaneTooltip":"Close this session’s terminal (exits the session; history is kept)","tasks.closePaneTitle":"Close session","tasks.closePaneConfirm":"Close the terminal running session “{id}”? The session exits too; history is kept.","tasks.closePaneFallback":"Unnamed pane","tasks.closePaneFailed":"Close session failed: {error}","tasks.closeTerminalPickTitle":"Choose terminals to close","tasks.closeTerminalConfirmLabel":"Close {n}","tasks.terminalPickTitle":"Choose a terminal to attach to","tasks.terminalPickCancel":"Cancel","tasks.harnessPickTitle":"New session in which harness?","tasks.terminalTargetFallback":"Window {w} · Tab {t}","tasks.terminalTargetActive":"Focused","tasks.terminalTargetFull":"Full ({n} panes)","tasks.terminalTargetFullTip":"This terminal is full — a new session needs its own terminal","tasks.terminalTargetDetail":"{match} pane(s) in this project ({total} total)","tasks.terminalBlock":"Terminal {w}","tasks.terminalBlockTab":"Terminal {w} · Tab {t}","tasks.terminalBlockSessions":"{n} session(s)","tasks.deleteSession":"Delete session","tasks.deleteTooltip":"Delete this session and all its events — cannot be undone","tasks.deleteConfirm":"Delete session “{id}” and all its events? This cannot be undone.","tasks.deleteFailed":"Failed to delete session: {error}","tasks.messageTooltip":"Conversation: view deliveries and turn summaries","tasks.resizeList":"Drag to resize the session list","tasks.messagesTitle":"Conversation","tasks.messagesClose":"Close","tasks.messagesMinimize":"Minimize","tasks.msgCloseConfirmTitle":"Close conversation","tasks.msgCloseConfirm":"The input box still has unsent content; closing will discard it.","tasks.messagesEmpty":"No conversation yet — deliver the first message below","tasks.convAnswer":"Answer","tasks.convFilterAll":"All","tasks.convFilterSent":"Sent","tasks.convFilterRecv":"Replies","tasks.convFilterEmpty":"No messages under this filter","tasks.convCount":"{n} messages","tasks.convSelect":"Select messages","tasks.convSelected":"{n} selected","tasks.convCopy":"Copy","tasks.convCancel":"Cancel","tasks.convCopyOk":"Copied {n} messages (with timestamps)","tasks.convCopyFailed":"Copy failed: select the text to copy manually","tasks.convSelectAll":"Select all","tasks.convDeselectAll":"Clear selection","tasks.convShare":"Share image","tasks.convShareCopy":"Copy to clipboard","tasks.convShareDownload":"Download PNG","tasks.convImgOk":"Copied {n} messages as an image","tasks.convImgCopyFailed":'Copying the image failed: this browser cannot do it — use "Download PNG"',"tasks.convImgSaved":"Image downloaded","tasks.convImgFailed":"Rendering the image failed: {error}","tasks.convImgSubtitle":"exported {at} · {n} messages","tasks.convRoleUser":"Me","tasks.convRoleAssistant":"Session","tasks.msgEarlier":"Loading earlier messages…","tasks.pullMore":"Keep pulling to load earlier messages","tasks.pullMoreEvents":"Keep pulling to load earlier events","tasks.messagesPlaceholder":"Message to deliver… (Enter to send, Shift+Enter for newline)","tasks.messagesSend":"Send","tasks.msgChannelTitle":"Delivery channel","tasks.msgChannelCurrent":"Delivery channel: {via}","tasks.msgChannelAuto":"Automatic","tasks.msgChannelAutoHint":"Direct injection first, fall back to terminal / relay","tasks.msgChannelTerminal":"Terminal input","tasks.msgChannelTerminalHint":"Write into the session's own terminal — the only path the host counts as user input","tasks.msgNewline":"Newline","tasks.msgSendFailed":"Delivery failed: {error}","tasks.msgUnsupported":"This session supports no message delivery","tasks.msgImageAttach":"Image","tasks.msgImageRemove":"Remove this image","tasks.msgImageUnsupported":"This session takes no images","tasks.msgImageTooLarge":"Image exceeds 10MB","tasks.msgImageTooMany":"At most 8 images per message","tasks.msgImageBadType":"Only PNG / JPEG / GIF / WebP","tasks.msgImageUploadFailed":"Image upload failed: {error}","tasks.msgImagePreview":"Close preview","tasks.modeLabel":"Mode","tasks.modeUnknown":"unknown","tasks.modeLastKnown":"Mode at last activity","tasks.modeCycle":"Switch execution mode","tasks.modeCycled":"Switch sent","tasks.modeCycleFailed":"Mode switch failed: {error}","tasks.modeConfirmTitle":"Switch execution mode","tasks.modeConfirm":"Switches the execution mode: the session decides the order — it may land on plan or bypass permissions, with no undo.","tasks.modeConfirmAction":"Switch","tasks.modelLabel":"Model","tasks.modelUnknown":"unknown","tasks.modelLastKnown":"Model used in the last turn","tasks.modelSet":"Switch sent","tasks.modelSetFailed":"Model switch failed: {error}","tasks.msgViaSocket":"Direct","tasks.msgViaRelay":"Relay","tasks.msgViaTerminal":"Terminal","tasks.msgAcked":"Acknowledged","tasks.msgGenerating":"Generating…","tasks.msgCompacting":"Compacting context…","tasks.msgInterrupted":"Interrupted","tasks.msgStalled":"No receipt · queue paused","tasks.msgResend":"Resend","tasks.msgResendFailed":"Resend failed: {error}","tasks.msgDismiss":"Delete","tasks.msgDismissHint":"Remove this row from the conversation; content already delivered to the session is unaffected","tasks.msgDismissQueuedHint":"Not sent yet — deleting it cancels the send","tasks.msgDismissFailed":"Delete failed: {error}","tasks.msgOffline":"Session is not running — the message was not sent (open the session, then resend)","tasks.msgOfflineToast":"Session is not running — nothing was sent","tasks.msgStatusQueued":"Queued","tasks.msgStatusSent":"Sent","tasks.outboxDequeue":"Edit","tasks.outboxDequeueHint":"Take the newest queued message back into the composer to edit it","tasks.msgDequeueFailed":"Could not take it out of the queue: {error}","tasks.msgStatusDelivering":"Delivering","tasks.msgStatusInjected":"Injected","tasks.msgStatusDelivered":"Delivered","tasks.msgDeliveredHint":"Handed to the target session — not read","tasks.msgStatusRunning":"Turn running","tasks.msgStatusSucceeded":"Succeeded","tasks.msgStatusFailed":"Failed","tasks.msgStatusTimeout":"Timed out","tasks.msgModePrompt":"Prompt","tasks.msgModeAuto":"Auto","tasks.msgModeInject":"Inject","tasks.msgModeHeadless":"Headless","tasks.msgModePromptHint":"Prompt (into the session; queues if closed)","tasks.msgModeAutoHint":"Auto (busy queues, idle starts a turn)","tasks.msgModeInjectHint":"Inject (queues until the session’s next activity)","tasks.msgModeHeadlessHint":"Headless (idle only, starts a new turn right away)","tasks.msgOutput":"Turn output","tasks.watchTooltip":"Session alert: subscribe to the next matching message (one-shot)","tasks.watchActiveTooltip":"Alert subscribed — {n} left (click to adjust / cancel)","tasks.watchOn":'"{label}" is now idle',"tasks.watchTurnEnd":'"{label}" finished a turn',"tasks.watchMsgFailed":'"{label}" had a failed message delivery',"tasks.watchNotifyTitle":"Session alert","tasks.questionPending":'"{label}" is waiting for your answer',"tasks.questionPendingTitle":"Answer needed","tasks.watchPickerTitle":"Session alert","tasks.watchPickerHint":'Subscribe to the "next" message matching the selected conditions — fires once, then expires.',"tasks.watchKindIdle":"Idle","tasks.watchKindIdleHint":"When the session goes idle (turn ends or session exits)","tasks.watchKindTurnEnd":"Turn finished","tasks.watchKindTurnEndHint":"When the session finishes a turn","tasks.watchKindMessageFailed":"Delivery failed / timed out","tasks.watchKindMessageFailedHint":"When a message to this session fails or times out","tasks.watchTimes":"Alert count","tasks.watchTimesLeft":"Alerts left","tasks.watchPersistent":"Persistent (never expires)","tasks.watchSubscribe":"Subscribe","tasks.watchUpdate":"Update","tasks.watchUnwatch":"Cancel","tasks.notifyDenied":"Browser notifications not allowed — alerts stay in-page","tasks.notifyUnsupported":"This browser has no notification support — alerts stay in-page","tasks.notifyInsecure":"Browser notifications need HTTPS (or localhost) — alerts stay in-page","tasks.messageInflight":"{n} message(s) in flight (not delivered yet)","tasks.watchFailed":"Failed to watch session: {error}","tasks.unwatchFailed":"Failed to cancel watch: {error}","tasks.answerTooltip":"Session is waiting for an answer (question / plan / permission)","tasks.answerActiveTooltip":"{n} pending question(s) — click to answer remotely","tasks.answerPendingTag":"Awaiting answer","tasks.answerPickerTitle":"Pending questions","tasks.answerPickerHint":"One question submits on click; several questions (or a multi-select) submit in one go with the buttons below.","tasks.answerPickerHintPreview":"Clicking an option only moves the highlight — Send commits; notes go with the highlighted option.","tasks.answerIncomplete":"{n} question(s) still unanswered","tasks.answerSend":"Send","tasks.answerFailed":"Failed to answer: {error}","tasks.pendingTitle":"Rename pending","tasks.chainTitle":"Event chain","tasks.chainEmpty":"No events captured for this session yet","tasks.chainCatchUp":"Catching up on earlier prompts…","tasks.searchPlaceholder":"Search event names","tasks.searchMatches":"{n} matches","tasks.searchNoMatch":"No matching prompt bars","tasks.dispatchQueue":"{n} pending dispatches","tasks.dispatchHint":"Pick an active session to dispatch; results highlight in the chain","tasks.dispatchRun":"Dispatch","tasks.dispatchRunFailed":"Failed to run dispatch: {error}","tasks.legendNote":"Historical chains may omit these nodes","tasks.unnamedSession":"Unnamed session","tasks.groupDispatches":"{n} dispatches","tasks.groupOpen":"Not ended normally","tasks.groupRunning":"Running","tasks.groupSubagent":"Subagents completed ×{n}","tasks.groupAgents":"Agents ×{n}","tasks.groupQuestions":"Q&A ×{n}","tasks.copyPrompt":"Copy prompt","tasks.stop":"Stop","tasks.stopTooltip":"Stop the session","tasks.stopOk":"Stop sent","tasks.stopFail":"Stop failed: {error}","tasks.groupPreSession":"Session kickoff","tasks.autoDeleteInDays":"Removes in {n}d","tasks.autoDeleteInHours":"Removes in {n}h","tasks.autoDeleteInMinutes":"Removes in {n}m","tasks.autoDeleteSoon":"Removes soon","tasks.yesterday":"Yesterday","tasks.overviewTitle":"Global task overview","tasks.overviewEmpty":"No sessions across projects yet — run a Claude session in any project","tasks.overviewProject":"Project","tasks.overviewSession":"Session","tasks.overviewStatus":"Status","tasks.overviewEvents":"Events","tasks.overviewTime":"Time","tasks.overviewUnknownProject":"Unknown project","tasks.overviewAllProjects":"All projects","tasks.rangeAll":"All time","tasks.rangeToday":"Today","tasks.range1d":"Within 1 day","tasks.range3d":"Within 3 days","tasks.range7d":"Within 7 days","tasks.range30d":"Within 30 days","tasks.rangeOver30":"Over 30 days","tasks.rangeCustom":"Custom","tasks.rangeFrom":"From date","tasks.rangeTo":"To date","tasks.olderHint":"Scroll down or click to load earlier prompts (latest 10 shown by default)","tasks.loadOlder":"Load {n} earlier","tasks.loadOlderEvents":"Load earlier events","tasks.loadAll":"Load all","catbar.orchestrate":"Orchestrate","orch.title":"Cross-session orchestration","orch.hint":"Sessions grouped into lanes by type, with in-flight counts on each node — click a message-capable node to open its conversation","orch.canvasEmpty":"No sessions in this project yet — run one from the Tasks view first","orch.messages":"{n} in-flight messages","orch.unknownLane":"Unknown harness","orch.received":"In flight {n}","orch.builderTitle":"Trigger a sequence","orch.builderHint":"Up to 3 steps; each fires when the previous one completes","orch.namePlaceholder":"Sequence name (optional)","orch.stepTarget":"Target session","orch.stepMode":"Channel","orch.stepText":"Message","orch.addStep":"Add step","orch.removeStep":"Remove step","orch.trigger":"Run","orch.triggerFailed":"Failed to trigger sequence: {error}","orch.noCapableSessions":"No message-capable sessions yet","orch.sequencesTitle":"Sequences","orch.seqEmpty":"No sequences yet — trigger the first one above","orch.seqNameFallback":"Sequence #{id}","orch.seqProgress":"Step {cur}/{n}","orch.seqDone":"Done","orch.seqCancelled":"Cancelled","orch.seqCancel":"Cancel","orch.seqCancelFailed":"Failed to cancel sequence: {error}","orch.seqStepPending":"Not fired","orch.globalHint":"Orchestration is a per-project view — pick a project to orchestrate its sessions"},Iz={"health.badgeTip":"{count} 项健康检查未通过","health.okTip":"健康检查全部通过","health.check.instructionLinkNotMaterialised":'{agents} 是内容为 "{claude}" 的普通文件——git 把软链接检出成了文本。',"health.check.instructionFilesDuplicated":"{claude} 与 {agents} 都是独立文件——两者内容会各自漂移。","health.check.instructionLinkDangling":"{name} 是目标不存在的软链接。","health.check.statuslinePathUnresolved":"statusLine 命令无法解析出脚本路径:{command}","health.check.statuslinePathForeign":"statusLine 指向本项目之外({path})——它是为另一个检出生成的。","health.check.statuslineScriptMissing":"statusLine 脚本缺失:{path}"},Lz={"health.badgeTip":"{count} health check(s) failing","health.okTip":"All health checks passing","health.check.instructionLinkNotMaterialised":'{agents} is a plain file containing "{claude}" — git checked the symlink out as text.',"health.check.instructionFilesDuplicated":"{claude} and {agents} are both regular files — they will drift apart.","health.check.instructionLinkDangling":"{name} is a symlink whose target does not exist.","health.check.statuslinePathUnresolved":"statusLine command does not resolve to a script path: {command}","health.check.statuslinePathForeign":"statusLine points outside this project ({path}) — it was generated for another checkout.","health.check.statuslineScriptMissing":"statusLine script is missing: {path}"},Pz={"toolkit.hint":"CC 插件与 mod 整包启停,其余按包成分启停","toolkit.scopeRoot":"未分目录","toolkit.expandAll":"全部展开","toolkit.collapseAll":"全部折叠","toolkit.expandAllGroups":"展开全部分组","toolkit.collapseAllGroups":"折叠全部分组","toolkit.empty":"暂无工具包","toolkit.loading":"加载中…","toolkit.loadFailed":"加载失败:{error}","toolkit.toggleFailed":"操作失败:{error}","toolkit.uninstallFailed":"卸载失败:{error}","toolkit.uninstalled":"已卸载:{name}","toolkit.legacyCleaned":"已清理旧副本","toolkit.toggleTip":"启用/停用本项目(CC 插件与 mod 首次启用会先安装到全局)","toolkit.install":"安装","toolkit.installing":"安装中…","toolkit.installTip":"装到全局(user 档)","toolkit.installFailed":"安装失败:{error}","toolkit.userInstalled":"已装到全局:{key}","toolkit.enableDefault":"默认","toolkit.enableOn":"启用","toolkit.enableOff":"禁用","toolkit.enableTip":"{state} — 点击切换","toolkit.kind.skill":"skill","toolkit.kind.hook":"hook","toolkit.kind.mod":"mod","toolkit.kind.rule":"rule","toolkit.kind.surface":"surface","toolkit.prov.builtin":"内置","toolkit.prov.market":"市场","toolkit.targets":"目标:{targets}","toolkit.weaveRules":"规则 {n}","toolkit.keyTip":"插件所属市场 · 安装:{scopes}","toolkit.scopesNone":"未安装","toolkit.legacyTitle":"发现 {n} 个 Weave 旧插件副本","toolkit.legacyHint":"旧版本残留的副本,不会被加载,可安全清理","toolkit.legacyCleanup":"清理","toolkit.uninstall":"卸载","toolkit.uninstallTip":"彻底卸载(预置源保留,可重装)"},zz={"toolkit.hint":"CC plugins & mods toggle as a whole, others by component","toolkit.scopeRoot":"Ungrouped","toolkit.expandAll":"Expand all","toolkit.collapseAll":"Collapse all","toolkit.expandAllGroups":"Expand all groups","toolkit.collapseAllGroups":"Collapse all groups","toolkit.empty":"No toolkit packs","toolkit.loading":"Loading…","toolkit.loadFailed":"Load failed: {error}","toolkit.toggleFailed":"Operation failed: {error}","toolkit.uninstallFailed":"Uninstall failed: {error}","toolkit.uninstalled":"Uninstalled: {name}","toolkit.legacyCleaned":"Stale copies cleaned up","toolkit.toggleTip":"Enable/disable in this project (CC plugins & mods install globally on first enable)","toolkit.install":"Install","toolkit.installing":"Installing…","toolkit.installTip":"Install to user scope","toolkit.installFailed":"Install failed: {error}","toolkit.userInstalled":"Installed to user scope: {key}","toolkit.enableDefault":"Default","toolkit.enableOn":"Enabled","toolkit.enableOff":"Disabled","toolkit.enableTip":"{state} — click to cycle","toolkit.kind.skill":"skill","toolkit.kind.hook":"hook","toolkit.kind.mod":"mod","toolkit.kind.rule":"rule","toolkit.kind.surface":"surface","toolkit.prov.builtin":"builtin","toolkit.prov.market":"market","toolkit.targets":"Targets: {targets}","toolkit.weaveRules":"rules {n}","toolkit.keyTip":"Plugin marketplace · install: {scopes}","toolkit.scopesNone":"not installed","toolkit.legacyTitle":"Found {n} stale Weave plugin copies","toolkit.legacyHint":"Leftovers from an older version; never loaded, safe to clean up","toolkit.legacyCleanup":"Clean up","toolkit.uninstall":"Uninstall","toolkit.uninstallTip":"Uninstall completely (the shipped source is kept and can be reinstalled)"},Uz={"auth.title":"weave 控制台","auth.passwordPlaceholder":"登录密码","auth.login":"登录","auth.wrongPassword":"密码错误","auth.logout":"退出登录","auth.hint":"初始密码见本机 `weave dashboard` 输出;改密用 `weave chpass <新密码>`(本机执行)。"},Fz={"auth.title":"weave console","auth.passwordPlaceholder":"Login password","auth.login":"Log in","auth.wrongPassword":"Wrong password","auth.logout":"Log out","auth.hint":"The initial password is printed by `weave dashboard` on this machine; change it with `weave chpass <new password>`."},Bz={"ai.title":"AI 助手","ai.open":"打开 AI 助手","ai.close":"关闭","ai.placeholder":"问点关于 weave 的…(Enter 发送,Shift+Enter 换行)","ai.send":"发送","ai.stop":"停止生成","ai.clear":"清空对话","ai.empty":"还没有对话。助手只回答 weave 相关问题——可直接提问。","ai.docsMissing":"(未找到 docs/,仅使用内置技能)","ai.intro":"回答范围仅限 weave(功能、用法、配置、技能),越界会拒答。","ai.thinking":"正在生成…","ai.emptyAnswer":"(没有返回内容——请检查模型名与接口地址)","ai.failed":"AI 请求失败:{error}","settings.ai":"AI 助手","settings.aiHint":"配置好 OpenAI 兼容端点后,右下角出现助手按钮。API key 只保存在服务端,不会回显到浏览器。","settings.aiBaseUrl":"API 地址","settings.aiBaseUrlPlaceholder":"https://api.example.com/v1","settings.aiModel":"模型","settings.aiModelPlaceholder":"gpt-4o-mini","settings.aiModelFetch":"拉取模型","settings.aiModelFetchTip":"拉取该地址可用的模型(地址与 key 齐了会自动拉一次)","settings.aiApiKey":"API Key","settings.aiApiKeySet":"已设置(留空 = 保持不变)","settings.aiApiKeyUnset":"未设置","settings.aiApiKeyClear":"清除","settings.aiApiKeyShow":"显示","settings.aiApiKeyHide":"隐藏"},Hz={"ai.title":"AI assistant","ai.open":"Open the AI assistant","ai.close":"Close","ai.placeholder":"Ask about weave… (Enter to send, Shift+Enter for a newline)","ai.send":"Send","ai.stop":"Stop generating","ai.clear":"Clear chat","ai.empty":"No messages yet. The assistant answers weave questions only — just ask.","ai.docsMissing":" (docs/ not found — using built-in skills only)","ai.intro":"Scope is limited to weave (features, usage, config, skills); off-topic asks are declined.","ai.thinking":"Generating…","ai.emptyAnswer":"(No content returned — check the model name and base URL.)","ai.failed":"AI request failed: {error}","settings.ai":"AI assistant","settings.aiHint":"Point this at an OpenAI-compatible endpoint and the assistant button appears bottom-right. The API key is stored server-side and never sent back to the browser.","settings.aiBaseUrl":"API base URL","settings.aiBaseUrlPlaceholder":"https://api.example.com/v1","settings.aiModel":"Model","settings.aiModelPlaceholder":"gpt-4o-mini","settings.aiModelFetch":"Fetch models","settings.aiModelFetchTip":"Fetch the models available at this base URL (auto-fetched once URL and key are set)","settings.aiApiKey":"API key","settings.aiApiKeySet":"Set (leave blank to keep)","settings.aiApiKeyUnset":"Not set","settings.aiApiKeyClear":"Clear","settings.aiApiKeyShow":"Show","settings.aiApiKeyHide":"Hide"},bM={...bz,...yz,...kz,...Sz,...Ez,...Cz,...Az,...jz,...Oz,...Iz,...Pz,...Uz,...Bz},$z={...xz,...vz,...wz,...Nz,..._z,...Tz,...Mz,...Rz,...Dz,...Lz,...zz,...Fz,...Hz},sS={"zh-CN":bM,en:$z};function Gz(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>s in t?String(t[s]):n):e}function Kz(e,t){return(n,s)=>Gz(e[n]??t[n]??String(n),s)}const xM=x.createContext(null);function qz(){try{const e=localStorage.getItem(gM);return e==="zh-CN"||e==="en"?e:hx}catch{return hx}}function rS(e){try{localStorage.setItem(gM,e)}catch{}}function Yz({children:e}){const[t,n]=x.useState(qz);x.useEffect(()=>{let i=!0;return Ee.getDaemonSettings().then(a=>{if(!i)return;const l=a.settings.locale;mM.includes(l)&&(n(l),rS(l))}).catch(()=>{}),()=>{i=!1}},[]),x.useEffect(()=>{document.documentElement.lang=t},[t]);const s=x.useMemo(()=>Kz(sS[t],sS[hx]),[t]),r=x.useMemo(()=>({locale:t,t:s,setLocale:i=>{n(i),rS(i)}}),[t,s]);return o.jsx(xM.Provider,{value:r,children:e})}function yM(){const e=x.useContext(xM);if(!e)throw new Error("useI18n must be used inside <I18nProvider>");return e}function We(){return yM().t}function El({harness:e,running:t=!1,className:n}){if(e&&e in ac){const r=ac[e],i=r.icon;return o.jsx("span",{className:me("inline-flex shrink-0",t&&r.runAnimation,n),children:o.jsx(i,{className:me("h-3.5 w-3.5",t?r.iconRunning:r.iconIdle)})})}const s=Kn(null);return o.jsx(zn,{className:me("h-3.5 w-3.5 shrink-0",t?"animate-spin text-orange-400":s.iconIdle,n)})}function ut({state:e,icon:t,className:n}){return o.jsx("span",{className:"pointer-events-none inline-flex items-center",children:e==="loading"?o.jsx(zn,{className:me("animate-spin",n)}):e==="success"?o.jsx(cr,{className:me("text-emerald-400",n)}):t??null})}function wi({open:e,title:t,message:n,confirmLabel:s,onConfirm:r,onClose:i}){const a=We();return e?un.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:i}),o.jsxs("div",{className:"relative w-[380px] max-w-full rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac overflow-hidden flex flex-col",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx(lm,{className:"h-4 w-4 text-amber-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:t}),o.jsx("button",{onClick:i,className:"ml-auto p-1 rounded text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",title:a("common.close"),children:o.jsx(tn,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"px-4 py-4",children:o.jsx("p",{className:"text-xs leading-relaxed text-neutral-400",children:n})}),o.jsxs("footer",{className:"shrink-0 border-t border-edge/[0.06] px-4 py-2.5 flex items-center justify-end gap-2 frosted",children:[o.jsx("button",{onClick:i,className:"rounded-lg bg-neutral-800 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-700",children:a("common.cancel")}),o.jsx("button",{onClick:()=>{r(),i()},className:"rounded-lg bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-500",children:s})]})]})]}),document.body):null}function vM({title:e,onClose:t,children:n,footer:s}){const r=We();return x.useEffect(()=>{const i=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t]),un.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:t,children:o.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-edge/[0.08] bg-neutral-900 p-3 shadow-mac",onClick:i=>i.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsx("p",{className:"text-xs font-medium text-neutral-200",children:e}),o.jsx("button",{type:"button",title:r("tasks.terminalPickCancel"),"aria-label":r("tasks.terminalPickCancel"),onClick:t,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(tn,{className:"h-3.5 w-3.5"})})]}),n,s]})}),document.body)}function Vz({targets:e,busy:t,onPick:n,onClose:s}){const r=We();return o.jsx(vM,{title:r("tasks.terminalPickTitle"),onClose:s,children:o.jsx("ul",{className:"max-h-72 space-y-1 overflow-y-auto",children:e.map(i=>o.jsx("li",{children:o.jsxs("button",{type:"button",disabled:t||i.full,onClick:()=>n(i.id),title:i.full?r("tasks.terminalTargetFullTip"):void 0,className:"w-full rounded-lg border border-edge/[0.06] bg-edge/[0.02] px-2.5 py-2 text-left transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.06] disabled:opacity-50",children:[o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",children:i.title??r("tasks.terminalTargetFallback",{w:i.windowId,t:i.tabId})}),i.full&&o.jsx("span",{className:"shrink-0 rounded bg-amber-900/40 px-1 text-[10px] text-amber-300",children:r("tasks.terminalTargetFull",{n:i.paneCount})}),i.active&&o.jsx("span",{className:"shrink-0 rounded bg-emerald-900/40 px-1 text-[10px] text-emerald-300",children:r("tasks.terminalTargetActive")})]}),o.jsxs("span",{className:"mt-0.5 block text-[10px] text-neutral-500",children:[r("tasks.terminalTargetDetail",{match:i.matchCount,total:i.paneCount})," · ",r("tasks.terminalTargetFallback",{w:i.windowId,t:i.tabId})]})]})},i.id))})})}function Xz({panes:e,onConfirm:t,onClose:n}){const s=We(),[r,i]=x.useState(()=>new Set),a=l=>i(c=>{const u=new Set(c);return u.has(l)?u.delete(l):u.add(l),u});return o.jsx(vM,{title:s("tasks.closeTerminalPickTitle"),onClose:n,footer:o.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[o.jsx("button",{type:"button",onClick:n,className:"rounded-lg bg-neutral-800 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-700",children:s("common.cancel")}),o.jsx("button",{type:"button",disabled:r.size===0,onClick:()=>t([...r]),className:"rounded-lg bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-500 disabled:opacity-50",children:s("tasks.closeTerminalConfirmLabel",{n:r.size})})]}),children:o.jsx("ul",{className:"max-h-72 space-y-1 overflow-y-auto",children:e.map(l=>{const c=r.has(l.id);return o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>a(l.id),className:me("w-full rounded-lg border px-2.5 py-2 text-left transition-colors",c?"border-blue-500 bg-blue-500/10":"border-edge/[0.06] bg-edge/[0.02] hover:border-edge/[0.16] hover:bg-edge/[0.06]"),children:[o.jsx("span",{className:"block truncate text-xs text-neutral-200",children:l.title??s("tasks.closePaneFallback")}),l.cwd&&o.jsx("span",{className:"mt-0.5 block truncate text-[10px] text-neutral-500",children:l.cwd})]})},l.id)})})})}function Qz(e,t){return[...e,t]}function Wz(e,t){return e.filter(n=>n.id!==t)}const Zz={success:3e3,info:4e3,error:8e3},Jz=2e3;function e9(e,t){return t==="start"?"loading":e!=="loading"?e:t==="ok"?"success":"idle"}function t9(e){return e!=="loading"}const iS={success:{box:"border-emerald-500/30 bg-emerald-950/80 text-emerald-100",icon:o.jsx(RP,{className:"mt-px h-3.5 w-3.5 shrink-0 text-emerald-400"})},error:{box:"border-red-500/30 bg-red-950/80 text-red-100",icon:o.jsx(OP,{className:"mt-px h-3.5 w-3.5 shrink-0 text-red-400"})},info:{box:"border-edge/[0.08] bg-neutral-900/90 text-neutral-200",icon:o.jsx(VP,{className:"mt-px h-3.5 w-3.5 shrink-0 text-neutral-400"})}},kM=x.createContext(null);function n9({children:e}){const[t,n]=x.useState([]),s=x.useRef(1),r=x.useCallback(l=>{n(c=>Wz(c,l))},[]),i=x.useCallback((l,c)=>{const u=s.current++;n(d=>Qz(d,{id:u,kind:l,message:c})),setTimeout(()=>r(u),Zz[l])},[r]),a=x.useMemo(()=>({show:i}),[i]);return o.jsxs(kM.Provider,{value:a,children:[e,o.jsx("div",{className:"pointer-events-none fixed bottom-20 right-4 z-[60] flex w-80 flex-col gap-2",children:t.map(l=>o.jsxs("div",{role:"status",className:`pointer-events-auto flex items-start gap-2 rounded-lg border px-3 py-2 text-xs shadow-mac backdrop-blur ${iS[l.kind].box}`,children:[iS[l.kind].icon,o.jsx("span",{className:"min-w-0 flex-1 break-words",children:l.message}),o.jsx("button",{type:"button",onClick:()=>r(l.id),className:"shrink-0 rounded p-0.5 text-current/60 hover:text-current",children:o.jsx(tn,{className:"h-3 w-3"})})]},l.id))})]})}function an(){const e=x.useContext(kM);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function xn(){const[e,t]=x.useState({}),n=x.useRef({}),{show:s}=an(),r=x.useRef({}),i=x.useCallback((c,u)=>{r.current={...r.current,[c]:e9(r.current[c]??"idle",u)},t(r.current)},[]);x.useEffect(()=>()=>{for(const c of Object.values(n.current))clearTimeout(c)},[]);const a=x.useCallback(async(c,u,d)=>{if(t9(r.current[c]??"idle")){i(c,"start");try{await u(),i(c,"ok"),clearTimeout(n.current[c]),n.current[c]=setTimeout(()=>{r.current={...r.current,[c]:"idle"},t(r.current)},Jz)}catch(f){i(c,"fail"),s("error",d.fail(f))}}},[i,s]);return{stateOf:x.useCallback(c=>e[c]??"idle",[e]),run:a}}function Ye(e){return e instanceof Error?e.message:String(e)}const s9=450,aS=8;function r9({projects:e,selectedId:t,globalActive:n,onSelect:s,onSelectGlobal:r,onOpenExplorer:i,onOpenTerminal:a,onHoverProject:l,updatesOf:c,needsInitOf:u,onSyncNow:d,syncStateOf:f,openExplorerStateOf:h,openTerminalStateOf:p,onCloseTerminal:m,closeTerminalStateOf:k,sessionStatsOf:w,terminalsOf:g,onReorder:y,archivedProjects:b=[],onArchive:S,onRestore:M,restoreStateOf:E}){const A=We(),{show:R}=an(),D=Nl("(pointer: fine)"),_=qu(Pd,{activationConstraint:{distance:5}}),z=qu(Sv,{activationConstraint:{delay:200,tolerance:8}}),$=yv(D?_:z),[H,I]=x.useState(!1),[L,C]=x.useState(null),[O,U]=x.useState(null);x.useEffect(()=>{H&&b.length===0&&I(!1)},[H,b.length]);const F=V=>{const{active:q,over:Y}=V;if(!Y||q.id===Y.id)return;const J=e.findIndex(ke=>ke.id===Number(q.id)),ce=e.findIndex(ke=>ke.id===Number(Y.id));J<0||ce<0||y==null||y(um(e,J,ce).map(ke=>ke.id))},[j,N]=x.useState(null),G=x.useRef(null);x.useEffect(()=>{if(!j)return;const V=q=>{var Y;(Y=G.current)!=null&&Y.contains(q.target)||N(null)};return window.addEventListener("pointerdown",V,!0),window.addEventListener("contextmenu",V,!0),window.addEventListener("scroll",V,{capture:!0,passive:!0}),window.addEventListener("keydown",V),()=>{window.removeEventListener("pointerdown",V,!0),window.removeEventListener("contextmenu",V,!0),window.removeEventListener("scroll",V,!0),window.removeEventListener("keydown",V)}},[j]);const T=x.useRef(!1),Z=x.useRef(null),te=()=>{Z.current&&(window.clearTimeout(Z.current.timer),Z.current=null)},Q=V=>q=>{if(T.current=!1,D||q.button!==0)return;const{clientX:Y,clientY:J}=q,ce=window.setTimeout(()=>{Z.current=null,T.current=!0,N({x:Y,y:J,project:V})},s9);Z.current={x:Y,y:J,timer:ce}},pe=V=>{const q=Z.current;q&&(Math.abs(V.clientX-q.x)>aS||Math.abs(V.clientY-q.y)>aS)&&te()};return o.jsxs("div",{className:"flex flex-col",children:[o.jsx("p",{className:"px-4 pt-2 pb-1 text-[11px] text-neutral-500 uppercase tracking-wide",children:A("project.globalConfig")}),o.jsx("div",{className:"px-2",children:o.jsxs("button",{onClick:r,className:me("w-full flex items-center gap-2 rounded-lg px-2 py-2 text-left transition-colors duration-200",n?"bg-neutral-800/80":"hover:bg-neutral-800/50"),children:[o.jsx(dl,{className:me("h-3.5 w-3.5 shrink-0",n?"text-emerald-400":"text-neutral-500")}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm",children:A("project.globalConfig")}),o.jsx("span",{className:"block text-[11px] text-neutral-500",children:A("project.globalSubtitle")})]})]})}),o.jsxs("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1",children:[o.jsx("p",{className:"flex-1 text-[11px] text-neutral-500 uppercase tracking-wide",children:A("project.sectionHeader")}),b.length>0&&o.jsxs("button",{type:"button","aria-label":A("project.archivedCount",{n:b.length}),title:A("project.archivedCount",{n:b.length}),onClick:()=>I(!0),className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-neutral-500 transition-colors hover:text-neutral-200 hover:bg-neutral-800/50",children:[o.jsx(_f,{className:"h-3 w-3"}),b.length]})]}),e.length===0&&o.jsx("p",{className:"p-3 text-xs text-neutral-500",children:A("project.noneRegistered")}),o.jsx("ul",{className:"p-2 space-y-1",children:o.jsx(Nv,{sensors:$,onDragEnd:F,children:o.jsx(aM,{items:e.map(V=>V.id),strategy:T6,children:e.map(V=>{const q=c==null?void 0:c(V.id),Y=u==null?void 0:u(V.id),J=(w==null?void 0:w(V.id))??[],ce=(g==null?void 0:g(V.id))??0;return o.jsx(i9,{id:V.id,children:({setNodeRef:ke,style:Ae,attributes:je,listeners:ae,isDragging:Oe})=>{var ye;return o.jsxs("li",{ref:ke,style:Ae,className:me("group relative rounded-xl border transition-colors duration-200",!n&&t===V.id?"border-edge/[0.14] bg-neutral-800/60":"border-edge/[0.06] bg-neutral-900/50 hover:border-edge/[0.10]",Oe&&"z-10 opacity-80"),onMouseEnter:()=>l==null?void 0:l(V.id),children:[o.jsxs("div",{className:"flex items-start",children:[o.jsx("span",{...je,...ae,title:A("project.dragToReorder"),className:"ml-1 mt-2 shrink-0 cursor-grab touch-none rounded p-0.5 text-neutral-600 transition-colors hover:text-neutral-300 active:cursor-grabbing",children:o.jsx(PA,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{onClick:()=>{if(T.current){T.current=!1;return}s(V)},onPointerDown:Q(V),onPointerMove:pe,onPointerUp:te,onPointerCancel:te,onContextMenu:ge=>{ge.preventDefault(),ge.stopPropagation(),D&&N({x:ge.clientX,y:ge.clientY,project:V})},className:me("min-w-0 flex-1 flex items-start gap-2 rounded-lg px-1.5 py-1.5 text-left transition-colors duration-200","hover:bg-edge/[0.04]"),children:[o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm",title:V.name,children:V.name}),o.jsx("span",{className:"block truncate text-[11px] text-neutral-500",title:V.path,children:V.path}),(((ye=V.harnesses)==null?void 0:ye.length)??0)>0&&o.jsx("span",{className:"mt-1 flex flex-wrap items-center gap-1",title:A("project.harnessesTip"),children:V.harnesses.map(ge=>o.jsx(mr,{agent:ge.id},ge.id))})]}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5 mt-1.5",children:[o.jsx(l9,{counts:J}),o.jsx(c9,{projectId:V.id})]})]})]}),o.jsxs("div",{className:"flex items-center gap-1 px-2 pb-1 pl-9",children:[Y&&o.jsx("span",{title:A("project.needsInitTip"),className:"shrink-0 rounded-full bg-amber-900/40 px-1.5 text-[10px] leading-4 text-amber-300",children:A("project.needsInit")}),o.jsxs("span",{className:"relative",children:[o.jsx(Rf,{title:`${q?A("project.syncPending",{n:q}):A("project.syncNow")}
480
+
481
+ ${A("app.scopeCoverageTooltip")}`,onClick:()=>d==null?void 0:d(V),children:o.jsx(ut,{state:(f==null?void 0:f(V.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(ic,{className:me("h-3.5 w-3.5",q?"text-orange-300":"text-neutral-400")})})}),!!q&&o.jsx("span",{className:"pointer-events-none absolute -right-0.5 -top-0.5 h-1.5 w-1.5 animate-pulse rounded-full bg-orange-500"})]}),o.jsx(Rf,{title:A("project.openInExplorer"),onClick:()=>i(V),children:o.jsx(ut,{state:(h==null?void 0:h(V.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(IA,{className:"h-3.5 w-3.5"})})}),o.jsxs("span",{className:"relative",children:[o.jsx(Rf,{title:ce>0?`${A("project.terminalsOpen",{n:ce})}
482
+
483
+ ${A("project.openInTerminal")}`:A("project.openInTerminal"),onClick:()=>a(V),children:o.jsx(ut,{state:(p==null?void 0:p(V.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(Av,{className:me("h-3.5 w-3.5",ce>0&&"text-emerald-400")})})}),ce>0&&o.jsx("span",{className:"pointer-events-none absolute -top-1 -right-1.5 rounded-full bg-emerald-900/80 px-1 text-[9px] leading-3 text-emerald-300",children:ce})]}),ce>0&&m&&o.jsx(Rf,{danger:!0,title:A("project.closeTerminal",{n:ce}),onClick:()=>{Ee.listProjectPanes(V.id).then(ge=>U({project:V,panes:ge})).catch(ge=>R("error",A("errors.closeTerminalFailed",{error:Ye(ge)})))},children:o.jsx(ut,{state:(k==null?void 0:k(V.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(Fl,{className:"h-3.5 w-3.5"})})})]})]})}},V.id)})})})}),H&&un.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>I(!1)}),o.jsxs("div",{className:"relative w-[680px] max-w-full rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac overflow-hidden flex flex-col",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx(_f,{className:"h-4 w-4 text-neutral-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:A("project.archivedSection")}),o.jsx("span",{className:"text-xs text-neutral-500",children:b.length}),o.jsx("button",{onClick:()=>I(!1),className:"ml-auto p-1 rounded text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",title:A("common.close"),children:o.jsx(tn,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"p-4 max-h-[60vh] overflow-y-auto",children:o.jsx("div",{className:"grid grid-cols-3 gap-3",children:b.map(V=>o.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-edge/[0.06] bg-neutral-900/50 p-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(_f,{className:"h-4 w-4 shrink-0 text-neutral-600"}),o.jsx("span",{className:"truncate text-sm text-neutral-200",title:V.name,children:V.name})]}),o.jsx("p",{className:"text-[11px] text-neutral-500 truncate",title:V.path,children:V.path}),V.archivedAt&&o.jsx("p",{className:"text-[11px] text-neutral-600",children:A("project.archivedOn",{date:new Date(V.archivedAt).toLocaleString()})}),o.jsxs("button",{type:"button",onClick:()=>M==null?void 0:M(V),title:A("project.restoreTooltip"),className:"mt-auto inline-flex items-center justify-center gap-1.5 rounded-lg border border-edge/[0.08] bg-edge/[0.03] px-2.5 py-1.5 text-xs text-neutral-300 transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08] hover:text-neutral-100",children:[o.jsx(ut,{state:(E==null?void 0:E(V.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(TP,{className:"h-3.5 w-3.5"})}),A("project.restore")]})]},V.id))})})]})]}),document.body),o.jsx(wi,{open:L!==null,title:A("project.archive"),message:L?A("project.archiveConfirm",{name:L.name}):"",confirmLabel:A("common.confirm"),onConfirm:()=>{L&&(S==null||S(L))},onClose:()=>C(null)}),O&&o.jsx(Xz,{panes:O.panes,onConfirm:V=>{const{project:q}=O;U(null),m==null||m(q,V)},onClose:()=>U(null)}),j&&un.createPortal(o.jsxs("div",{ref:G,style:{left:Math.min(j.x,window.innerWidth-200),top:Math.min(j.y,window.innerHeight-88)},className:"fixed z-50 w-48 rounded-lg border border-edge/[0.08] bg-neutral-900 shadow-mac py-1",onContextMenu:V=>V.preventDefault(),children:[o.jsx("p",{className:"px-3 pb-1 pt-0.5 text-[10px] text-neutral-500 truncate",title:j.project.path,children:j.project.name}),o.jsx(a9,{icon:o.jsx(_f,{className:"h-3.5 w-3.5"}),label:A("project.archive"),onClick:()=>{C(j.project),N(null)}})]}),document.body)]})}function i9({id:e,children:t}){const{attributes:n,listeners:s,setNodeRef:r,transform:i,transition:a,isDragging:l}=oM({id:e}),c={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:a??void 0,position:"relative"};return t({setNodeRef:r,style:c,attributes:n,listeners:s,isDragging:l})}function a9({icon:e,label:t,onClick:n}){return o.jsxs("button",{onClick:n,className:"w-full flex items-center gap-2 px-3 py-1.5 text-left text-xs text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx("span",{className:"text-neutral-400",children:e}),t]})}function Rf({title:e,pressed:t,onClick:n,danger:s,children:r}){return o.jsx("button",{type:"button",title:e,"aria-label":e,"aria-pressed":t,onClick:i=>{i.stopPropagation(),n()},className:me("pointer-events-auto [&_svg]:pointer-events-none inline-flex h-5 w-5 items-center justify-center rounded border border-edge/[0.08] bg-edge/[0.02] transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08]",s?"text-red-400 hover:border-red-500/30 hover:bg-red-500/10 hover:text-red-300":"text-neutral-400 hover:text-neutral-100"),children:r})}function l9({counts:e}){const t=We();return o.jsx(o.Fragment,{children:e.map(n=>o.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[n.running>0&&o.jsxs("span",{className:"flex items-center gap-0.5",title:t("project.sessionsRunning",{n:n.running}),children:[o.jsx(El,{harness:n.harness,running:!0}),o.jsx("span",{className:"text-[10px] font-medium text-orange-300",children:n.running})]}),n.open>0&&o.jsxs("span",{className:"flex items-center gap-0.5",title:t("project.sessionsOpen",{n:n.open}),children:[o.jsx(El,{harness:n.harness}),o.jsx("span",{className:"text-[10px] font-medium text-neutral-400",children:n.open})]})]},n.harness??"unknown"))})}const o9={"instruction-link-not-materialised":"health.check.instructionLinkNotMaterialised","instruction-files-duplicated":"health.check.instructionFilesDuplicated","instruction-link-dangling":"health.check.instructionLinkDangling","statusline-path-unresolved":"health.check.statuslinePathUnresolved","statusline-path-foreign":"health.check.statuslinePathForeign","statusline-script-missing":"health.check.statuslineScriptMissing"};function c9({projectId:e}){const t=We(),{data:n}=Xb({queryKey:["harnessChecks",e],queryFn:()=>Ee.getHarnessChecks(e),staleTime:6e4}),s=n?n.checks.filter(i=>!i.ok):null;if(s===null)return null;if(s.length===0)return o.jsx("span",{title:t("health.okTip"),className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"});const r=[t("health.badgeTip",{count:s.length}),...s.flatMap(i=>{const a=o9[i.id];return a?[t(a,i.params)]:[]})].join(`
484
+ `);return o.jsx("span",{title:r,className:"shrink-0",children:o.jsx(lm,{className:"h-3.5 w-3.5 text-amber-400"})})}const Gd={claude:{open:"UserPromptSubmit",close:["Stop","StopFailure"],closeFailed:["StopFailure"],sessionMarkers:["SessionStart","SessionEnd"],subagentStop:"SubagentStop",questionTools:["AskUserQuestion","ExitPlanMode"],sessionExit:"SessionEnd"},codex:{open:"",close:[],closeFailed:[],sessionMarkers:[],subagentStop:"",questionTools:[],sessionExit:null}},Dv={claude:{start:"PreCompact",end:"SessionStart",endSource:"compact"},codex:{start:null,end:null,endSource:null}},wM={claude:{modeNames:["default","acceptEdits","plan","auto","dontAsk","bypassPermissions"],modelNames:["default","opus","sonnet","haiku","fable"]},codex:{modeNames:[],modelNames:[]}};function SM(e){var t;return e==null?[]:((t=wM[e])==null?void 0:t.modeNames)??[]}function u9(e){var t;return e==null?[]:((t=wM[e])==null?void 0:t.modelNames)??[]}const lS=["#cbd5e1","#38bdf8","#a78bfa","#2dd4bf","#fbbf24","#f87171"];function d9(e,t){if(!t)return null;const n=SM(e).indexOf(t);return n>=0?lS[n%lS.length]:null}function Iv(e,t,n){if(e==null)return!1;const s=Dv[e];return!(s!=null&&s.end)||!s.endSource?!1:t===s.end&&n===s.endSource}const f9=3e4,h9=5*6e4,p9=10*6e4,m9=10*6e4;function g9(e){var l;if(e.overlay)return e.overlay;if(e.hasRunningDispatch||e.hasRunningSubagent)return"running";if(e.latestDispatchFailed)return"failed";if(e.latestEventType==="SessionEnd")return"closed";if(e.pidAlive===!1)return"terminated";const t=e.now??Date.now(),n=e.latestEventAt?Date.parse(e.latestEventAt):NaN,s=Date.parse(e.lastSeenAt),r=Math.max(Number.isNaN(n)?0:n,Number.isNaN(s)?0:s),i=r>0?t-r:Number.POSITIVE_INFINITY;if(e.interruptedAt!=null&&e.interruptedAt>r)return"interrupted";const a=e.harness!=null?(l=Dv[e.harness])==null?void 0:l.start:null;return a!=null&&e.latestEventType===a&&i<p9?"compacting":e.turnOpen===!0&&i<h9?"running":e.turnOpen===!1?"open":i<f9?"running":"open"}function To(e){return e==="running"||e==="compacting"}function NM(e){var t;return e==null?!1:!!((t=Gd[e])!=null&&t.open)}function EM(e,t){return e==="closed"||e==="terminated"||e==="failed"||e==="interrupted"?!1:t===!0?!0:t===!1?!1:To(e)}const _M={running:"tasks.statusRunning",compacting:"tasks.statusCompacting",failed:"tasks.statusFailed",open:"tasks.statusOpen",closed:"tasks.statusClosed",terminated:"tasks.statusTerminated",interrupted:"tasks.statusInterrupted"},b9={running:"bg-orange-400",compacting:"bg-amber-400",failed:"bg-red-500",open:"bg-neutral-500",closed:"bg-neutral-700",terminated:"bg-rose-800",interrupted:"bg-slate-400"},CM={running:"bg-orange-900/50 text-orange-300",compacting:"bg-amber-900/50 text-amber-300",failed:"bg-red-900/50 text-red-300",open:"bg-neutral-800 text-neutral-300",closed:"bg-neutral-900 text-neutral-500",terminated:"bg-rose-950/60 text-rose-400",interrupted:"bg-slate-800 text-slate-300"};function x9(e,t){const n=new Map;for(const r of e){const i=t.get(r.sessionId)??"open";if(i!=="running"&&i!=="compacting"&&i!=="open"&&i!=="interrupted")continue;const a=r.harness!=null&&nn.includes(r.harness)?r.harness:null;let l=n.get(a);l||(l={harness:a,running:0,open:0},n.set(a,l)),i==="open"||i==="interrupted"?l.open+=1:l.running+=1}const s=r=>r===null?nn.length:nn.indexOf(r);return[...n.values()].sort((r,i)=>s(r.harness)-s(i.harness))}const TM=x.createContext(null);function oS(e,t){const{terminal:n,alive:s,interrupted:r}=t;if(!n&&!s&&!r)return e;let i=!1;const a=e.map(l=>{var f;let c=l;const u=n==null?void 0:n[l.sessionId];u!==void 0&&((f=c.terminal)==null?void 0:f.id)!==(u==null?void 0:u.id)&&(c={...c,terminal:u});const d=s==null?void 0:s[l.sessionId];if(d!==void 0&&c.pidAlive!==d&&(c={...c,pidAlive:d}),r){const h=r[l.sessionId]??null;(c.interruptedAt??null)!==h&&(c={...c,interruptedAt:h})}return c!==l&&(i=!0),c});return i?a:e}function y9({children:e}){const t=VA(),[n,s]=x.useState(null),[r,i]=x.useState([]),[a,l]=x.useState(null),[c,u]=x.useState(new Map),[d,f]=x.useState(new Map),[h,p]=x.useState(new Map),[m,k]=x.useState(new Map),[w,g]=x.useState({}),y=x.useRef({}),b=x.useCallback(async()=>{const[R,D,_]=await Promise.allSettled([Ee.listSessions(),Ee.listHookDispatches({limit:200}),Ee.listQuestions()]);if(D.status==="fulfilled"&&i(D.value),_.status==="fulfilled"&&k(new Map(_.value.map($=>[$.sessionId,$]))),R.status==="fulfilled")return s(()=>oS(R.value.sessions,y.current)),g(R.value.modelCatalog??{}),l(null),null;const z=R.reason instanceof Error?R.reason.message:String(R.reason);return l(z),z},[]);x.useEffect(()=>{t==="authenticated"&&b()},[t,b]),x.useEffect(()=>po("inflightCounts",R=>{p(new Map(Object.entries(R.counts??{})))}),[]),x.useEffect(()=>{const R=()=>s(_=>_&&oS(_,y.current)),D=[po("sessionLiveness",_=>{_.alive&&(y.current.alive=_.alive),R()}),po("sessionInterrupt",_=>{_.interrupted&&(y.current.interrupted=_.interrupted),R()}),po("terminalTopology",_=>{_.terminals&&(y.current.terminal=_.terminals),R()})];return()=>{for(const _ of D)_()}},[]),x.useEffect(()=>{let R=null;const D=()=>{R!==null&&window.clearTimeout(R),R=window.setTimeout(()=>{R=null,b().then(()=>{u(new Map)})},500)},z=Aa($=>{switch($.kind){case"event.ingested":{if(!$.sessionId)break;const H=$.sessionId;if($.backgroundTasks){const I=$.agentId,L=Date.now(),C=new Map;for(const O of $.backgroundTasks)O.status==="running"&&O.id!==I&&C.set(O.id,L);f(O=>{const U=new Map(O);return C.size?U.set(H,C):U.delete(H),U})}else if($.eventType==="SubagentStop"&&$.agentId){const I=$.agentId;f(L=>{const C=L.get(H);if(!(C!=null&&C.has(I)))return L;const O=new Map(C);O.delete(I);const U=new Map(L);return O.size?U.set(H,O):U.delete(H),U})}else if($.spawnAgentId||$.agentId){const I=$.spawnAgentId??$.agentId;f(L=>{const C=new Map(L),O=new Map(C.get(H)??[]);return O.set(I,Date.now()),C.set(H,O),C})}break}case"dispatch.started":{$.sessionId&&u(H=>new Map(H).set($.sessionId,"running"));break}case"dispatch.finished":{if(!$.sessionId)break;u(H=>{const I=new Map(H);return $.status==="failed"||$.status==="timeout"?I.set($.sessionId,"failed"):I.delete($.sessionId),I});break}}D()});return()=>{z(),R!==null&&window.clearTimeout(R)}},[b]);const S=x.useMemo(()=>{const R=new Map;for(const D of r){if(!D.sessionId)continue;const _=R.get(D.sessionId)??[];_.push(D),R.set(D.sessionId,_)}return R},[r]),M=x.useMemo(()=>{const R=Date.now(),D=new Map;for(const _ of n??[]){const z=S.get(_.sessionId)??[],$=z[0],H=d.get(_.sessionId);let I=!1;if(H){for(const L of H.values())if(R-L<m9){I=!0;break}}D.set(_.sessionId,g9({lastSeenAt:_.lastSeenAt,latestEventType:_.lastEventType??void 0,pidAlive:_.pidAlive??void 0,hasRunningDispatch:z.some(L=>L.status==="running"),hasRunningSubagent:I,latestDispatchFailed:$!==void 0&&($.status==="failed"||$.status==="timeout"),overlay:c.get(_.sessionId),turnOpen:_.turnOpen,interruptedAt:_.interruptedAt??void 0,harness:_.harness,now:R}))}return D},[n,S,d,c]),E=x.useMemo(()=>{const R=new Map;for(const _ of n??[]){if(_.projectId==null)continue;const z=R.get(_.projectId)??[];z.push(_),R.set(_.projectId,z)}const D=new Map;for(const[_,z]of R)D.set(_,x9(z,M));return D},[n,M]),A=x.useMemo(()=>({sessions:n,dispatches:r,statuses:M,projectStats:E,error:a,inflight:h,questions:m,modelCatalog:w,refresh:b}),[n,r,M,E,a,h,m,w,b]);return o.jsx(TM.Provider,{value:A,children:e})}function Kd(){const e=x.useContext(TM);if(!e)throw new Error("useSessionStatus must be used within SessionStatusProvider");return e}const AM=[{key:"tasks",labelKey:"catbar.tasks",icon:QP},{key:"orchestrate",labelKey:"catbar.orchestrate",icon:ax},{key:"files",labelKey:"catbar.files",icon:Av},{key:"personalization",labelKey:"catbar.personalization",icon:GA},{key:"weave",labelKey:"catbar.hooks",icon:KA}];function v9({category:e,onSelect:t,data:n}){const s=We(),r=a=>{switch(a){case"files":return n.files;case"personalization":return 1;case"weave":return n.hooksRules;case"tasks":return n.sessions;case"orchestrate":return n.sessions}},i=a=>{switch(a){case"files":return n.outdated>0?o.jsx(Qe,{variant:"warning",children:s("catbar.updateBadge",{n:n.outdated})}):null;case"personalization":return n.statuslineSource?o.jsx(Qe,{variant:n.statuslineSource==="custom"?"skill":"default",children:n.statuslineSource==="custom"?s("catbar.custom"):s("catbar.followGlobal")}):null;default:return null}};return o.jsx("div",{className:"flex flex-wrap gap-2 p-2 border-b border-edge/[0.06] overflow-x-auto",children:AM.map(({key:a,labelKey:l,icon:c})=>{const u=e===a;return o.jsxs("button",{onClick:()=>t(a),className:me("flex-1 min-w-[6.5rem] flex flex-wrap items-center gap-x-2 gap-y-1 rounded-lg px-2 py-2 text-left","border border-edge/[0.08] transition-all duration-200 ease-mac",u?"bg-neutral-800/90 ring-1 ring-blue-500/50 shadow-mac-sm":"bg-neutral-900/40 hover:bg-neutral-800/60"),children:[o.jsx(c,{className:me("h-4 w-4 shrink-0",a==="files"&&"text-purple-400",a==="personalization"&&"text-cyan-400",a==="tasks"&&"text-rose-400",a==="orchestrate"&&"text-teal-400",a==="weave"&&"text-amber-400")}),o.jsxs("span",{className:"min-w-0 flex-auto",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:s(l)}),o.jsx("span",{className:"block truncate text-[11px] text-neutral-500",children:s("catbar.items",{n:r(a)})})]}),o.jsx("span",{className:"flex flex-wrap items-center gap-1",children:i(a)})]},a)})})}const Ma=x.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:me("rounded-xl border border-edge/[0.08] bg-gradient-to-b from-neutral-800/70 to-neutral-900/70 shadow-mac-sm backdrop-blur-sm",e),...t}));Ma.displayName="Card";const _l=x.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:me("flex p-3 border-b border-edge/[0.06]",e),...t}));_l.displayName="CardHeader";const Cl=x.forwardRef(({className:e,...t},n)=>o.jsx("h3",{ref:n,className:me("text-sm font-semibold tracking-tight",e),...t}));Cl.displayName="CardTitle";const Tl=x.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:me("p-3",e),...t}));Tl.displayName="CardContent";function Ju(e){let t=0,n=0;for(const s of e)n+=s.skills.length,s.enabled!==!1&&(t+=s.skills.length);return{effective:t,total:n}}function ed(e,t){return t===0?"none":e===t?"ok":"partial"}const k9={ok:"bg-emerald-900/40 text-emerald-300",partial:"bg-amber-900/30 text-amber-300",none:"bg-neutral-800 text-neutral-500"};function td({tone:e,title:t,children:n}){return o.jsx("span",{className:me("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium tabular-nums",k9[e]),title:t,children:n})}const MM="__local__";function jM(e){const t=new Map;for(const s of e){const r=s.namespace??MM,i=t.get(r)??{key:r,...s.namespace!==void 0?{namespace:s.namespace}:{},groups:[]};i.groups.push(s),t.set(r,i)}const n=s=>s.namespace===void 0?1:s.groups.some(r=>r.provenance==="builtin")?0:2;return[...t.values()].sort((s,r)=>n(s)-n(r)||(s.namespace??"").localeCompare(r.namespace??""))}function fl(e,t){const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function w9(e){return e.endsWith("-plugin")?Hd(e):null}const S9={inherit:"on",on:"off",off:"inherit"},cS={inherit:"skillGrid.enableDefault",on:"skillGrid.enableOn",off:"skillGrid.enableOff"},uS={user:"skillGrid.scopeUser",project:"skillGrid.scopeProject",local:"skillGrid.scopeLocal"},N9=e=>e.installScopes.length>0?S9[e.enable]:e.enable==="on"?"off":"on";function Lv({row:e,update:t,canUninstall:n,readOnly:s,onUninstallSkill:r,onOpenDetail:i}){var w;const a=We(),{show:l}=an(),c=xn(),u=`skill-uninstall:${e.scope}:${e.agent??"claude"}:${e.name}`,d=c.stateOf(u),[f,h]=x.useState(!1),p=()=>void c.run(u,async()=>{await r(e.name,e.scope,e.agent),l("success",a("skillGrid.uninstalled",{name:e.name}))},{fail:g=>a("errors.uninstallFailed",{error:Ye(g)})}),m=((w=e.source)==null?void 0:w.endsWith("-personal"))??!1,k=e.scope==="user"&&m&&e.form!==void 0;return o.jsxs(Ma,{children:[o.jsxs(_l,{className:"items-center gap-2",children:[o.jsxs("button",{onClick:()=>i(e.name,e.scope,e.source,e.pluginKey,e.agent),className:"flex items-center gap-2 text-left flex-1 min-w-0",title:a("skillGrid.openDetail",{name:e.name}),children:[o.jsx(Ta,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx(Cl,{className:"truncate",children:e.name}),o.jsx(mr,{agent:e.agent,className:"ml-1"}),s?o.jsx(Qe,{variant:"settings",className:"ml-1",children:a("skillGrid.globalTag")}):e.scope==="project"&&o.jsx(Qe,{variant:"settings",className:"ml-1",children:a("library.scopeProject")}),e.files.length>0&&o.jsx(Qe,{variant:"skill",className:"ml-1",children:e.files.length}),(t==null?void 0:t.outdated)&&o.jsx(Qe,{variant:"warning",className:"ml-1",children:a("skillGrid.update")}),(t==null?void 0:t.custom)&&o.jsx(Qe,{variant:"other",className:"ml-1",children:a("skillGrid.custom")}),k&&o.jsx("span",{className:me("ml-1 shrink-0 rounded px-1 py-0.5 text-[10px]",e.form==="link"?"bg-neutral-800 text-neutral-400":"bg-amber-900/30 text-amber-300"),title:a("repo.formTip"),children:e.form==="link"?a("repo.formLink"):a("repo.formCopy")})]}),n&&!s&&o.jsx("button",{type:"button",disabled:d==="loading",onClick:()=>e.scope==="user"?h(!0):p(),className:"text-neutral-500 hover:text-red-400 shrink-0 disabled:cursor-not-allowed [&_svg]:pointer-events-none",title:a("skillGrid.uninstall",{name:e.name}),children:o.jsx(ut,{state:d,className:"h-3.5 w-3.5",icon:o.jsx(Qs,{className:"h-3.5 w-3.5"})})})]}),e.scope==="user"&&o.jsx(wi,{open:f,title:a("skillGrid.uninstallGlobalTitle"),message:a("skillGrid.uninstallGlobalConfirm",{name:e.name}),confirmLabel:a("common.confirm"),onConfirm:p,onClose:()=>h(!1)})]})}function E9({skills:e,groups:t,globalGroupsReadOnly:n,updates:s,empty:r,onUninstallSkill:i,onOpenDetail:a,onCyclePluginState:l,onUninstallPlugin:c}){const u=We(),d=p=>s==null?void 0:s.find(m=>m.name===p);if(t!==void 0&&t.length>0)return o.jsx(dS,{groups:t,updates:s,onUninstallSkill:i,onOpenDetail:a,onCyclePluginState:l,onUninstallPlugin:c});const f=!!e&&e.length>0,h=!!n&&n.length>0;return!f&&!h?o.jsx("p",{className:"text-xs text-neutral-600 border border-dashed border-edge/[0.06] rounded-md p-3",children:r}):o.jsxs("div",{className:"space-y-4",children:[f&&o.jsxs("section",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:u("skillGrid.projectHeading")}),o.jsx("span",{className:"ml-auto rounded-full bg-neutral-800/60 text-neutral-400 px-2 py-0.5 text-[11px] font-medium tabular-nums",children:e.length})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 items-start",children:e.map(p=>o.jsx(Lv,{row:p,update:d(p.name),canUninstall:p.scope==="project",onUninstallSkill:i,onOpenDetail:a},`${p.scope}-${p.name}`))})]}),h&&o.jsx(dS,{groups:n,updates:s,onUninstallSkill:i,onOpenDetail:a,onCyclePluginState:l,readOnly:!0})]})}function px({effective:e,total:t}){const n=We(),s=t===0?n("skillGrid.effNone"):e===t?n("skillGrid.effAll",{n:t}):n("skillGrid.effDisabled",{n:t-e});return o.jsxs(td,{tone:ed(e,t),title:s,children:[o.jsx(Fl,{className:"h-3 w-3"}),n("skillGrid.effective",{done:e,total:t})]})}function _9({group:e,collapsed:t,onToggle:n,findUpdate:s,onUninstallSkill:r,onOpenDetail:i,onCyclePluginState:a,onUninstallPlugin:l,readOnly:c}){var E;const u=We(),d=xn(),{show:f}=an(),[h,p]=x.useState(!1),m=e.source.endsWith("-plugin"),k=w9(e.source),w=Ju([e]),g=m&&!!e.installSurface&&!!l&&!c&&!!e.pluginKey,y=m&&!!k&&!!a&&(((E=e.scopeStates)==null?void 0:E.length)??0)>0,b=`pack-uninstall:${e.pluginKey??"-"}`,S=d.stateOf(b),M=()=>{!e.pluginKey||!l||d.run(b,async()=>{await l(k,e.pluginKey),f("success",u("skillGrid.packUninstalled",{label:e.label}))},{fail:A=>u("errors.uninstallFailed",{error:Ye(A)})})};return o.jsxs("div",{className:"rounded-xl border border-edge/[0.06] bg-neutral-900/40 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),n())},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-edge/[0.02] cursor-pointer",children:[t?o.jsx(ns,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Bn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(LA,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-300 truncate",children:e.label}),e.pluginKey&&o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",title:u("skillGrid.keyTip"),children:e.pluginKey}),o.jsx(Qe,{variant:m?"mcp":"skill",className:"ml-1",children:u(m?"skillGrid.plugin":"repo.local")}),o.jsx(mr,{agent:Hd(e.source)??void 0}),o.jsx(px,{effective:w.effective,total:w.total}),y&&o.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1",children:e.scopeStates.map(A=>{const R=`plugin-state:${k}:${e.pluginKey}:${A.scope}`;return o.jsxs("button",{type:"button",disabled:d.stateOf(R)==="loading",onClick:D=>{D.stopPropagation(),d.run(R,async()=>{await a(k,e.pluginKey,A.scope,N9(A))},{fail:_=>u("errors.pluginToggleFailed",{error:Ye(_)})})},title:u("skillGrid.enableTip",{scope:u(uS[A.scope]),state:u(cS[A.enable])}),className:me("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium disabled:cursor-not-allowed [&_svg]:pointer-events-none",A.enable==="on"?"bg-emerald-900/40 text-emerald-300":"bg-neutral-800 text-neutral-500"),children:[o.jsx(ut,{state:d.stateOf(R),className:"h-3 w-3",icon:o.jsx(Fl,{className:"h-3 w-3"})}),u(uS[A.scope]),"·",u(cS[A.enable])]},A.scope)})}),g&&o.jsx("button",{type:"button",disabled:S==="loading",onClick:A=>{A.stopPropagation(),p(!0)},className:me("shrink-0 text-neutral-500 hover:text-red-400 disabled:cursor-not-allowed [&_svg]:pointer-events-none",!y&&"ml-auto"),title:u("skillGrid.uninstallPackTitle"),children:o.jsx(ut,{state:S,className:"h-3.5 w-3.5",icon:o.jsx(Qs,{className:"h-3.5 w-3.5"})})})]}),!t&&o.jsx("div",{className:"px-3 pb-3 pt-1",children:e.skills.length===0?o.jsx("p",{className:"text-xs text-neutral-600 py-2",children:u("common.empty")}):o.jsx("div",{className:"grid grid-cols-2 gap-3 items-start",children:e.skills.map(A=>o.jsx(Lv,{row:A,update:s(A.name),canUninstall:!1,readOnly:c,onUninstallSkill:r,onOpenDetail:i},`${A.scope}-${A.agent??"claude"}-${A.name}`))})}),o.jsx(wi,{open:h,title:u("skillGrid.uninstallPackTitle"),message:u("skillGrid.uninstallPackConfirm",{key:e.pluginKey??""}),confirmLabel:u("common.confirm"),onConfirm:M,onClose:()=>p(!1)})]})}function dS({groups:e,updates:t,onUninstallSkill:n,onOpenDetail:s,onCyclePluginState:r,onUninstallPlugin:i,readOnly:a}){const l=We(),c=b=>t==null?void 0:t.find(S=>S.name===b),u=x.useMemo(()=>jM(e),[e]),d=x.useMemo(()=>e.map(b=>`${b.source}:${b.pluginKey??"-"}`),[e]),[f,h]=x.useState(new Set([MM])),[p,m]=x.useState(new Set),k=f.size>0||p.size>0,w=()=>{k?(h(new Set),m(new Set)):(h(new Set(u.map(b=>b.key))),m(new Set(d)))},{effective:g,total:y}=Ju(e);return o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:[l("skillGrid.globalHeading"),a&&o.jsx("span",{className:"ml-1 text-[10px] text-neutral-600 normal-case",children:l("skillGrid.readOnly")})]}),o.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[o.jsx(px,{effective:g,total:y}),o.jsxs("button",{onClick:w,className:"inline-flex items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-2 py-0.5 text-[11px] hover:bg-neutral-700",title:l(k?"skillGrid.collapseAllGroups":"skillGrid.expandAllGroups"),children:[k?o.jsx(zd,{className:"h-3 w-3"}):o.jsx(Ud,{className:"h-3 w-3"}),l(k?"skillGrid.collapseAll":"skillGrid.expandAll")]})]})]}),o.jsx("div",{className:"space-y-3",children:u.map(b=>{const S=b.namespace,M=S===void 0,E=!f.has(b.key),A=Ju(b.groups),R=b.groups.reduce((D,_)=>D+_.skills.length,0);return o.jsxs("div",{className:"rounded-2xl border border-edge/[0.08] bg-neutral-900/60 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>h(D=>fl(D,b.key)),onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),h(_=>fl(_,b.key)))},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-edge/[0.03] cursor-pointer",children:[E?o.jsx(ns,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Bn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(Xu,{className:"h-3.5 w-3.5 shrink-0 text-violet-400"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-200 truncate",children:M?l("repo.local"):S}),!M&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",title:l("repo.namespaceTip"),children:l("repo.packCount",{n:b.groups.length})}),M&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",title:l("repo.formTip"),children:l("repo.formLegend")}),o.jsx(Qe,{variant:"skill",className:"ml-1",children:R}),o.jsx(px,{effective:A.effective,total:A.total})]}),!E&&(M?o.jsx("div",{className:"px-3 pb-3 pt-1",children:R===0?o.jsx("p",{className:"text-xs text-neutral-600 py-2",children:l("common.empty")}):o.jsx("div",{className:"grid grid-cols-2 gap-3 items-start",children:b.groups.flatMap(D=>D.skills).map(D=>o.jsx(Lv,{row:D,update:c(D.name),canUninstall:!a,readOnly:a,onUninstallSkill:n,onOpenDetail:s},`${D.scope}-${D.agent??"claude"}-${D.name}`))})}):o.jsx("div",{className:"px-3 pb-3 pt-1 space-y-2",children:b.groups.map(D=>{const _=`${D.source}:${D.pluginKey??"-"}`;return o.jsx(_9,{group:D,collapsed:!p.has(_),onToggle:()=>m(z=>fl(z,_)),findUpdate:c,onUninstallSkill:n,onOpenDetail:s,onCyclePluginState:r,onUninstallPlugin:i,readOnly:a},_)})}))]},b.key)})})]})}function C9(e){const t=new Map;for(const n of e){const s=n.relPath.match(/^[^/]+\/skills\/([^/]+)\//);if(!s)continue;const r=s[1],i=`${n.agent??""}\0${r}`,a=t.get(i)??{name:r,agent:n.agent,files:[]};a.files.push(n),t.set(i,a)}return[...t.values()].map(({name:n,agent:s,files:r})=>({name:n,scope:"project",agent:s,files:r})).sort((n,s)=>n.name.localeCompare(s.name))}const T9={inherit:"on",on:"off",off:"inherit"},fS={inherit:"mcp.enableDefault",on:"mcp.enableOn",off:"mcp.enableOff"},A9=e=>e.scope==="user"?"user":"project";function M9({rows:e,scope:t,updates:n,empty:s,onUninstallMcp:r,onCycleMcpEnable:i}){const a=We(),{show:l}=an(),c=xn(),u=f=>{const h=`mcp-enable:${f.key}`;c.stateOf(h)!=="loading"&&c.run(h,async()=>i(f.key,T9[f.enable??"inherit"]),{fail:p=>a("mcp.enableFailed",{error:Ye(p)})})};if(e.length===0)return o.jsx("p",{className:"text-xs text-neutral-600 border border-dashed border-edge/[0.06] rounded-md p-3",children:s});const d=(f,h)=>!!(n!=null&&n.find(p=>p.name===f&&p.outdated&&(p.agent??"claude")===(h??"claude")));return o.jsxs("section",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:a(t==="user"?"mcp.headingGlobal":"mcp.headingProject")}),o.jsx("span",{className:"ml-auto rounded-full bg-neutral-800/60 text-neutral-400 px-2 py-0.5 text-[11px] font-medium tabular-nums",children:e.length})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 items-start",children:e.map(f=>{const h=d(f.key,f.harness),p=f.enable!==null,m=f.enable??"inherit",k=`mcp-enable:${f.key}`,w=c.stateOf(k),g=`mcp-uninstall:${f.harness}:${f.scope}:${f.key}`,y=c.stateOf(g);return o.jsxs(Ma,{children:[o.jsxs(_l,{className:"items-center gap-2",children:[o.jsx(am,{className:"h-3.5 w-3.5 shrink-0 text-pink-400"}),o.jsx(Cl,{className:"truncate",children:f.key}),o.jsx(mr,{agent:f.harness}),o.jsx(Qe,{variant:"settings",className:"ml-1",children:a(f.harness==="codex"||f.scope==="user"?"library.scopeGlobal":"library.scopeProject")}),h&&o.jsx(Qe,{variant:"warning",className:"ml-1",children:a("mcp.update")}),o.jsxs("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[p&&o.jsxs("button",{type:"button",disabled:w==="loading",onClick:()=>u(f),title:a("mcp.enableTip",{state:a(fS[m])}),className:me("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium disabled:cursor-not-allowed [&_svg]:pointer-events-none",m==="on"?"bg-emerald-900/40 text-emerald-300 hover:bg-emerald-900/60":"bg-neutral-800 text-neutral-500 hover:bg-neutral-700"),children:[o.jsx(ut,{state:w,className:"h-3 w-3",icon:o.jsx(Fl,{className:"h-3 w-3"})}),a(fS[m])]}),o.jsx("button",{type:"button",disabled:y==="loading",onClick:()=>void c.run(g,async()=>{await r(f.key,A9(f),f.harness),l("success",a("mcp.uninstalled",{name:f.key}))},{fail:b=>a("errors.mcpUninstallFailed",{error:Ye(b)})}),className:"text-neutral-500 hover:text-red-400 disabled:cursor-not-allowed [&_svg]:pointer-events-none",title:a("mcp.remove",{name:f.key}),children:o.jsx(ut,{state:y,className:"h-3.5 w-3.5",icon:o.jsx(Qs,{className:"h-3.5 w-3.5"})})})]})]}),o.jsxs(Tl,{className:"pt-0 text-xs font-mono text-neutral-400 break-all",children:[o.jsx("span",{className:"text-neutral-300",children:f.detail.command}),f.detail.args&&f.detail.args.length>0&&o.jsxs("span",{className:"text-neutral-500",children:[" ",f.detail.args.join(" ")]}),f.detail.env&&Object.keys(f.detail.env).length>0&&o.jsxs("div",{className:"mt-1 text-neutral-600",children:["env: ",Object.keys(f.detail.env).join(", ")]})]})]},`${f.harness}-${f.scope}-${f.key}`)})})]})}const mx=["skill","mcp","hooks","workflow","rules","command","agent","output-style","instructions","settings","plugin","mods","other"];function gx(e,t){switch(e){case"skill":case"mcp":case"workflow":case"command":case"agent":case"output-style":case"instructions":case"settings":case"plugin":return[e];case"helper":return["hooks"];case"rule":return["rules"];case"mods":return["plugin","mods"]}return e==="other"&&/(^|\/)hooks\//.test(t)?["hooks"]:["other"]}const hS={instructions:{on:"text-teal-200",off:"text-teal-300/50 hover:text-teal-200"},command:{on:"text-purple-200",off:"text-purple-300/50 hover:text-purple-200"},agent:{on:"text-emerald-200",off:"text-emerald-300/50 hover:text-emerald-200"},hooks:{on:"text-amber-200",off:"text-amber-300/50 hover:text-amber-200"},rules:{on:"text-rose-200",off:"text-rose-300/50 hover:text-rose-200"},"output-style":{on:"text-fuchsia-200",off:"text-fuchsia-300/50 hover:text-fuchsia-200"},workflow:{on:"text-orange-200",off:"text-orange-300/50 hover:text-orange-200"},settings:{on:"text-cyan-200",off:"text-cyan-300/50 hover:text-cyan-200"},plugin:{on:"text-indigo-200",off:"text-indigo-300/50 hover:text-indigo-200"},mods:{on:"text-violet-200",off:"text-violet-300/50 hover:text-violet-200"},other:{on:"text-neutral-200",off:"text-neutral-400/70 hover:text-neutral-200"},skill:{on:"text-lime-200",off:"text-lime-300/50 hover:text-lime-200"},mcp:{on:"text-sky-200",off:"text-sky-300/50 hover:text-sky-200"}},Pv=e=>hS[e]??hS.other,bx="shrink-0 rounded-full border border-transparent bg-neutral-800/60 px-1.5 py-0 text-[10px] font-medium font-sans",j9="border-neutral-700 bg-transparent text-neutral-400",R9="text-blue-200",O9="text-neutral-400 hover:text-neutral-300",D9="inline-flex items-center gap-1.5 rounded-full border border-transparent bg-neutral-800/60 px-2 py-0.5 text-[11px] font-medium transition-colors duration-150 hover:bg-neutral-700/60",I9="bg-neutral-700 ring-1 ring-blue-500/50 hover:bg-neutral-700";function bp(e){const t=e.lastIndexOf("/");return t<0?e:e.slice(t+1)}function pS(e){return bp(e).replace(/\.(md|js)$/u,"")}function L9(e){const t={children:[],fileCount:0};for(const s of e){const r=s.relPath.split("/");let i=t,a="";for(let l=0;l<r.length;l++){const c=r[l];if(a=a?`${a}/${c}`:c,l===r.length-1)i.children.push({type:"file",asset:s});else{let u=i.children.find(d=>d.type==="dir"&&d.name===c);u||(u={type:"dir",name:c,path:a,children:[],fileCount:0},i.children.push(u)),i=u}}}const n=s=>{s.children.sort((r,i)=>{const a=r.type==="dir",l=i.type==="dir";if(a!==l)return a?-1:1;const c=r.type==="file"?bp(r.asset.relPath):r.name,u=i.type==="file"?bp(i.asset.relPath):i.name;return c.localeCompare(u)}),s.children.forEach(r=>{r.type==="dir"&&n(r)}),s.fileCount=s.children.reduce((r,i)=>r+(i.type==="file"?1:i.fileCount),0)};return n(t),t.children}function mS({kind:e,active:t,onClick:n,children:s}){const r=e?Pv(e):{on:R9,off:O9};return o.jsx("button",{type:"button",onClick:n,"aria-pressed":t,className:me(D9,t&&I9,t?r.on:r.off),children:s})}function RM({node:e,depth:t,scope:n,capabilities:s,updateMap:r,collapsed:i,onToggle:a,onOpenFile:l,onUninstall:c}){const u=We(),{show:d}=an(),f=xn(),h=8+t*14;if(e.type==="file"){const m=e.asset,k=bp(m.relPath),w=m.relPath.toLowerCase().endsWith(".md"),g=r==null?void 0:r.get(`${pS(m.relPath)}::${m.category}`),y=p6(m.category,m.agent??"claude",n,s),b=gx(m.category,m.relPath),S={name:pS(m.relPath),category:m.category,relPath:m.relPath,...m.agent?{agent:m.agent}:{}},M=`uninstall:${m.relPath}`,E=f.stateOf(M);return o.jsxs("div",{className:"group/row relative",children:[o.jsxs("button",{type:"button",onClick:()=>l(m.relPath),style:{paddingLeft:h,paddingRight:30},className:"w-full flex items-center gap-1.5 rounded-md py-1 text-left text-xs font-mono text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800/50 [&_svg]:pointer-events-none",title:m.isSymlink?u("fileTree.symlinkTitle",{path:m.absPath}):m.absPath,children:[m.isSymlink?o.jsx(FP,{className:"h-3 w-3 shrink-0 text-amber-400"}):w?o.jsx(Fd,{className:"h-3 w-3 shrink-0 text-blue-400"}):o.jsx(Ta,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:k}),o.jsx(mr,{agent:m.agent,className:"shrink-0 px-1.5 py-0 text-[10px] font-sans"}),b.map(A=>o.jsx("span",{className:me(bx,Pv(A).on),children:A},A)),m.namespace&&o.jsx("span",{className:me(bx,j9),title:u("repo.namespaceTip"),children:m.namespace}),(g==null?void 0:g.outdated)&&o.jsx(Qe,{variant:"warning",className:"shrink-0 px-1.5 py-0 text-[10px] font-sans",children:u("fileTree.update")}),(g==null?void 0:g.custom)&&o.jsx(Qe,{variant:"other",className:"shrink-0 px-1.5 py-0 text-[10px] font-sans",children:u("fileTree.custom")})]}),y&&c&&o.jsx("button",{type:"button",disabled:E==="loading",onClick:()=>void f.run(M,async()=>{await(c==null?void 0:c(S)),d("success",u("fileTree.uninstalled",{name:k}))},{fail:A=>u("errors.uninstallFailed",{error:Ye(A)})}),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-1 text-neutral-500 opacity-0 group-hover/row:opacity-100 max-lg:opacity-100 hover:text-red-400 hover:bg-neutral-800 disabled:cursor-not-allowed [&_svg]:pointer-events-none",title:u("fileTree.uninstall",{name:k}),children:o.jsx(ut,{state:E,className:"h-3 w-3",icon:o.jsx(Qs,{className:"h-3 w-3"})})})]})}const p=i.has(e.path);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",onClick:()=>a(e.path),style:{paddingLeft:h},className:"w-full flex items-center gap-1.5 rounded-md py-1 pr-1.5 text-left text-xs text-neutral-300 hover:bg-neutral-800/50",children:[p?o.jsx(ns,{className:"h-3 w-3 shrink-0"}):o.jsx(Bn,{className:"h-3 w-3 shrink-0"}),o.jsx(ar,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:e.name}),o.jsx("span",{className:"text-[10px] text-neutral-600 tabular-nums",children:e.fileCount})]}),!p&&e.children.map(m=>o.jsx(RM,{node:m,depth:t+1,scope:n,capabilities:s,updateMap:r,collapsed:i,onToggle:a,onOpenFile:l,onUninstall:c},m.type==="dir"?m.path:m.asset.relPath))]})}function gS({scope:e,assets:t,capabilities:n,updates:s,onUninstall:r,onOpenFile:i}){const a=We(),l=x.useMemo(()=>{const R=new Map;for(const D of mx)R.set(D,0);for(const D of t)for(const _ of gx(D.category,D.relPath))R.set(_,(R.get(_)??0)+1);return R},[t]),[c,u]=x.useState(new Set),d=x.useMemo(()=>{const R=new Set;for(const D of c)l.has(D)&&R.add(D);return R},[c,l]),f=x.useMemo(()=>d.size?t.filter(R=>gx(R.category,R.relPath).some(D=>d.has(D))):t,[t,d]),h=x.useMemo(()=>L9(f),[f]),p=x.useMemo(()=>{if(!s)return;const R=new Map;for(const D of s)R.set(`${D.name}::${D.category}`,D);return R},[s]),[m,k]=x.useState(new Set),w=R=>k(D=>{const _=new Set(D);return _.has(R)?_.delete(R):_.add(R),_}),g=x.useMemo(()=>{const R=[],D=_=>{for(const z of _)z.type==="dir"&&(R.push(z.path),D(z.children))};return D(h),R},[h]),y=m.size>0,b=()=>k(y?new Set:new Set(g)),S=x.useMemo(()=>{const R=new Map;return mx.forEach((D,_)=>R.set(D,_)),[...l.keys()].sort((D,_)=>{const z=(l.get(_)??0)-(l.get(D)??0);return z!==0?z:(R.get(D)??1/0)-(R.get(_)??1/0)})},[l]),M=R=>{const D=new Set(d);D.delete(R)||D.add(R),u(D)},E=a(e==="user"?"fileTree.scopeGlobal":"fileTree.scopeProject"),A=nn.map(R=>e==="user"?`~/${Kn(R).dotDir}/`:`${Kn(R).dotDir}/`).join(" · ");return o.jsxs("section",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:[E," ",a("fileTree.title")," ",o.jsx("span",{className:"text-neutral-600 normal-case font-normal",children:e==="user"?A:a("fileTree.pathsProject",{dirs:A})})]}),o.jsx("span",{className:"ml-auto rounded-full bg-neutral-800/60 text-neutral-400 px-2 py-0.5 text-[11px] font-medium tabular-nums",children:d.size?`${f.length} / ${t.length}`:t.length}),g.length>0&&o.jsxs("button",{type:"button",onClick:b,className:"inline-flex items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-1.5 py-0.5 text-[10px] hover:bg-neutral-700 [&_svg]:pointer-events-none",title:a(y?"fileTree.expandAllDirs":"fileTree.collapseAllDirs"),children:[y?o.jsx(Ud,{className:"h-2.5 w-2.5"}):o.jsx(zd,{className:"h-2.5 w-2.5"}),a(y?"fileTree.expandAll":"fileTree.collapseAll")]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsxs(mS,{active:d.size===0,onClick:()=>u(new Set),children:[a("fileTree.all"),o.jsx("span",{className:"tabular-nums text-[10px] opacity-70",children:t.length})]}),S.map(R=>o.jsxs(mS,{kind:R,active:d.has(R),onClick:()=>M(R),children:[R,o.jsx("span",{className:"tabular-nums text-[10px] opacity-70",children:l.get(R)??0})]},R))]}),h.length===0?o.jsx("p",{className:"text-xs text-neutral-600 border border-dashed border-edge/[0.06] rounded-md p-3",children:a("fileTree.emptyFiltered")}):o.jsx("div",{className:"max-h-[45vh] overflow-y-auto rounded-lg border border-edge/[0.06] bg-neutral-900/40 p-2 space-y-0.5",children:h.map(R=>o.jsx(RM,{node:R,depth:0,scope:e,capabilities:n,updateMap:p,collapsed:m,onToggle:w,onOpenFile:i,onUninstall:r},R.type==="dir"?R.path:R.asset.relPath))})]})}const OM={gray:"#6b7280",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#d946ef",cyan:"#06b6d4"},P9={gray:"#d1d5db",red:"#fca5a5",green:"#86efac",yellow:"#fde68a",blue:"#bfdbfe",magenta:"#f5d0fe",cyan:"#a5f3fc"},z9=["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"];function zv(e){const t=Math.max(0,Math.min(255,Math.round(e)));if(t<16)return z9[t];const n=r=>r.toString(16).padStart(2,"0");if(t<232){const r=t-16,i=a=>a===0?0:55+a*40;return`#${n(i(Math.floor(r/36)))}${n(i(Math.floor(r%36/6)))}${n(i(r%6))}`}const s=8+(t-232)*10;return`#${n(s)}${n(s)}${n(s)}`}const dm=e=>e in OM;function Th(e){return dm(e)?P9[e]:e.startsWith("ansi256:")?zv(Number(e.slice(8))):e}function li(e){return dm(e)?OM[e]:e.startsWith("ansi256:")?zv(Number(e.slice(8))):e}function U9(e){return dm(e)?e:e.startsWith("ansi256:")?`ansi256 ${e.slice(8)}`:e}function F9(e){const t=e.trim();if(dm(t))return t;const n=/^ansi256:(\d{1,3})$/.exec(t);if(n){const r=Number(n[1]);return r>=0&&r<=255?`ansi256:${r}`:null}if(/^#[0-9a-fA-F]{6}$/.test(t))return t.toLowerCase();const s=/^#([0-9a-fA-F]{3})$/.exec(t);if(s){const r=s[1];return`#${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`.toLowerCase()}return null}const B9=Array.from({length:256},(e,t)=>zv(t));function nd({value:e,min:t,max:n,disabled:s,onChange:r,title:i}){const a=We(),l=c=>Math.min(n??Number.MAX_SAFE_INTEGER,Math.max(t,c));return o.jsxs("span",{role:"group","aria-label":i,className:me("inline-flex select-none items-stretch rounded border border-edge/[0.08] bg-neutral-950 focus-within:border-blue-500/40",s&&"opacity-40"),children:[o.jsx("button",{type:"button","aria-label":a("common.decrease"),title:a("common.decrease"),disabled:s||e<=t,onClick:()=>r(l(e-1)),className:"flex w-6 items-center justify-center rounded-l bg-edge/[0.04] text-neutral-400 transition-colors hover:bg-edge/[0.08] hover:text-neutral-100 disabled:pointer-events-none disabled:opacity-30",children:o.jsx(FA,{className:"h-3 w-3"})}),o.jsx("input",{type:"number",min:t,max:n,value:e,disabled:s,"aria-label":i,onChange:c=>r(l(Number(c.target.value)||t)),className:"w-14 bg-transparent px-1 text-center text-xs text-neutral-100 focus:outline-none disabled:opacity-40 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"}),o.jsx("button",{type:"button","aria-label":a("common.increase"),title:a("common.increase"),disabled:s||n!==void 0&&e>=n,onClick:()=>r(l(e+1)),className:"flex w-6 items-center justify-center rounded-r bg-edge/[0.04] text-neutral-400 transition-colors hover:bg-edge/[0.08] hover:text-neutral-100 disabled:pointer-events-none disabled:opacity-30",children:o.jsx(Bd,{className:"h-3 w-3"})})]})}const xx=[{key:"project",labelKey:"seg.project",sample:"my-project"},{key:"git",labelKey:"seg.git",sample:"main"},{key:"git_user",labelKey:"seg.gitUser",sample:"yao <yao@weave.dev>"},{key:"changes",labelKey:"seg.changes",sample:"3"},{key:"model",labelKey:"seg.model",sample:"claude-sonnet-5"},{key:"thinking",labelKey:"seg.thinking",sample:"high"},{key:"context",labelKey:"seg.context",sample:"78% ▰▰▰▰▰▰▰▱▱"},{key:"tokens",labelKey:"seg.tokens",sample:"12k"},{key:"cost",labelKey:"seg.cost",sample:"$0.42"},{key:"rate",labelKey:"seg.rate",sample:"5h 45%"},{key:"time",labelKey:"seg.time",sample:"12:30"},{key:"version",labelKey:"seg.version",sample:"2.1.286"},{key:"output_style",labelKey:"seg.output_style",sample:"explanatory"},{key:"session",labelKey:"seg.session",sample:"feat-statusline"},{key:"exceeds200k",labelKey:"seg.exceeds200k",sample:"200k"},{key:"fast_mode",labelKey:"seg.fast_mode",sample:"fast"},{key:"vim",labelKey:"seg.vim",sample:"INSERT"},{key:"pr",labelKey:"seg.pr",sample:"#482"},{key:"worktree",labelKey:"seg.worktree",sample:"weave-next"},{key:"agent",labelKey:"seg.agent",sample:"reviewer"}],H9=[...ZA],$9=[{key:"left",labelKey:"align.left"},{key:"center",labelKey:"align.center"},{key:"right",labelKey:"align.right"}],G9=[{key:"percent",labelKey:"statusline.barStyle.percent"},{key:"bar",labelKey:"statusline.barStyle.bar"},{key:"both",labelKey:"statusline.barStyle.both"}],K9=[{key:"session",labelKey:"statusline.metric.session",titleKey:"statusline.metric.sessionTitle"},{key:"context",labelKey:"statusline.metric.context",titleKey:"statusline.metric.contextTitle"}],q9=[{key:"five_hour",labelKey:"rateWin.fiveHour.label",titleKey:"rateWin.fiveHour.title"},{key:"seven_day",labelKey:"rateWin.sevenDay.label",titleKey:"rateWin.sevenDay.title"},{key:"spend",labelKey:"rateWin.spend.label",titleKey:"rateWin.spend.title"}],Ks=(e,t)=>({char:String.fromCodePoint(e),nameKey:t}),DM=String.fromCodePoint(57520),IM=String.fromCodePoint(57522),LM=String.fromCodePoint(57520),Y9=[Ks(57520,"statusline.glyph.triangleRight"),Ks(57522,"statusline.glyph.triangleLeft"),Ks(57524,"statusline.glyph.roundRight"),Ks(57526,"statusline.glyph.roundLeft")],V9=[Ks(57522,"statusline.glyph.triangle"),Ks(57526,"statusline.glyph.round"),Ks(57530,"statusline.glyph.lowerTriangle"),Ks(57534,"statusline.glyph.diagonal")],X9=[Ks(57520,"statusline.glyph.triangle"),Ks(57524,"statusline.glyph.round"),Ks(57528,"statusline.glyph.lowerTriangle"),Ks(57532,"statusline.glyph.diagonal")];function Tg({label:e,value:t,fallback:n,presets:s,editable:r,allowNone:i,onChange:a}){const l=We(),c=t??n;return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-neutral-500",children:e}),s.map(u=>o.jsx("button",{onClick:()=>a(u.char),disabled:!r,title:`${l(u.nameKey)} (U+${u.char.codePointAt(0).toString(16).toUpperCase()})`,className:me("nerd-font w-6 h-6 rounded flex items-center justify-center disabled:opacity-30",c===u.char?"bg-neutral-800 text-neutral-100 ring-1 ring-edge/30":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-900"),children:u.char},u.nameKey)),i&&o.jsx("button",{onClick:()=>a(""),disabled:!r,title:l("statusline.disableCap"),className:me("rounded px-1.5 h-6 text-[10px] disabled:opacity-30",t===""?"bg-neutral-800 text-neutral-100 ring-1 ring-edge/30":"text-neutral-500 hover:text-neutral-300"),children:l("statusline.none")})]})}function yx({value:e,editable:t,onChange:n,allowNone:s,noneSelected:r,onNone:i}){const[a,l]=x.useState(!1),[c,u]=x.useState(""),d=We(),f=()=>{const h=F9(c);h&&n(h),u("")};return o.jsxs("div",{className:"flex gap-1 items-center",children:[s&&o.jsx("button",{type:"button",onClick:i,disabled:!t,title:d("statusline.noBackground"),className:me("h-3.5 w-3.5 rounded border border-edge/20 disabled:opacity-30",r?"ring-2 ring-edge/60 bg-neutral-800":"opacity-40"),children:o.jsx("span",{className:"block h-px bg-neutral-500 rotate-45"})}),H9.map(h=>o.jsx("button",{type:"button",onClick:()=>n(h),disabled:!t,title:h,style:{backgroundColor:li(h)},className:me("h-3.5 w-3.5 rounded-full disabled:opacity-30",e===h?"ring-2 ring-edge/60":"opacity-50")},h)),o.jsx("button",{type:"button",onClick:()=>l(h=>!h),disabled:!t,title:e&&!Of(e)?d("statusline.moreColorsCurrent",{color:U9(e)}):d("statusline.moreColors"),style:e&&!Of(e)?{backgroundColor:li(e)}:void 0,className:me("h-3.5 w-3.5 rounded-full border border-edge/25 text-[8px] leading-none disabled:opacity-30",e&&!Of(e)?"ring-2 ring-edge/60":"opacity-50 text-neutral-400"),children:e&&!Of(e)?"":"+"}),a&&t&&o.jsx("div",{className:"relative",children:o.jsxs("div",{className:"absolute z-20 left-0 top-5 w-64 rounded border border-edge/15 bg-neutral-950 p-2 shadow-xl",children:[o.jsx("div",{className:"grid grid-cols-[repeat(16,minmax(0,1fr))] gap-[2px]",children:B9.map((h,p)=>o.jsx("button",{type:"button",title:`ansi256:${p}`,onClick:()=>{n(`ansi256:${p}`),l(!1)},style:{backgroundColor:h},className:"h-3 w-3 rounded-sm hover:ring-1 hover:ring-edge/70"},p))}),o.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[o.jsx("input",{type:"color",value:Q9(e),onChange:h=>n(h.target.value.toLowerCase()),className:"h-6 w-8 bg-transparent",title:d("statusline.pickTruecolor")}),o.jsx("input",{value:c,onChange:h=>u(h.target.value),onKeyDown:h=>{h.key==="Enter"&&f()},placeholder:d("statusline.colorPlaceholder"),className:"bg-neutral-900 rounded px-1.5 py-0.5 text-[11px] font-mono flex-1"}),o.jsx("button",{type:"button",onClick:f,className:"text-[11px] rounded bg-neutral-800 px-2 py-0.5 text-neutral-300 hover:bg-neutral-700",children:d("statusline.ok")})]})]})})]})}const Of=e=>ZA.includes(e);function Q9(e){return e?/^#[0-9a-fA-F]{6}$/.test(e)?e:li(e):"#000000"}const W9={project:{name:"my-project",path:"/workspace/my-project"},git:{branch:"main",repo:"acme/weave"},git_user:{user:"yao",email:"yao@weave.dev"},changes:{added:"1",deleted:"1",files:"3"},model:{model:"claude-sonnet-5"},thinking:{level:"high"},context:{percent:"78",used:"780k",total:"1.0M",remaining:"22"},tokens:{total:"960.9k",percent:"42"},cost:{cost:"$0.42",duration:"12m",api_duration:"3m",lines_added:"42",lines_removed:"7"},rate:{percent:"45",limit:"5h",resets:""},time:{time:"12:30"},version:{version:"2.1.286"},output_style:{style:"explanatory"},session:{name:"feat-statusline"},exceeds200k:{over:"200k"},fast_mode:{mode:"fast"},vim:{mode:"INSERT"},pr:{number:"482",state:"approved",url:"https://github.com/acme/weave/pull/482"},worktree:{name:"weave-next",branch:"feat/x"},agent:{name:"reviewer"}};function Z9(e,t){return t.format?t.format:e==="context"&&t.style?f6[t.style]:JA[e]}function PM(e,t,n){const s={...W9[e]};if(e==="context"){const a=Number(s.percent);let l=Math.round(a/100*n.bar.cells);a>0&&l===0&&(l=1),s.bar=n.bar.fill.repeat(l)+n.bar.empty.repeat(n.bar.cells-l)}const r=Z9(e,t).replace(/\{(\w+)\}/g,(a,l)=>s[l]??""),i=t.label?`${t.label}${n.labelSeparator}`:"";return(t.icon?`${t.icon} `:"")+i+r}function J9(e,t){const n=[];for(const i of t){const a=e.segments[i];if(!a.enabled)continue;const l=PM(i,a,e);l!==""&&n.push({text:l,fg:a.color,bold:a.bold,bg:a.backgroundColor,merge:a.merge})}const s=[];let r=[];for(const i of n){if(i.merge){r.push(i);continue}for(const a of r)a.bg=i.bg,a.joinsNext=!0;r=[],s.push(i)}for(const i of r)i.bg=null;return s.concat(r)}function bS(e,t,n,s,r){const i=e.map(l=>[...l]),a=i[t].indexOf(s);return a>=0&&i[t].splice(a,1),i[n].splice(Math.min(r,i[n].length),0,s),i}function eU({projectId:e,initialTab:t="project"}){const n=t==="global",s=We(),[r,i]=x.useState(null),[a,l]=x.useState(null),[c,u]=x.useState("idle"),[d,f]=x.useState(null),[h,p]=x.useState(!1),[m,k]=x.useState(null),[w,g]=x.useState(null),y=x.useRef(0),b=x.useRef(!1),[S,M]=x.useState(!0),E=yv(qu(Pd,{activationConstraint:{distance:5}})),A=x.useCallback(()=>{f(null),i(null),u("idle"),Ee.getStatusline(e).then(N=>{b.current=!0,l(N.globalConfig),i(n?N.globalConfig?structuredClone(N.globalConfig):null:N.config)}).catch(N=>f(String(N)))},[e,n]);x.useEffect(()=>{A()},[A]),x.useEffect(()=>ki("statusline",A),[A]),x.useEffect(()=>{if(!h)return;const N=setTimeout(()=>p(!1),5e3);return()=>clearTimeout(N)},[h]),x.useEffect(()=>{if(!m)return;const N=setTimeout(()=>k(null),5e3);return()=>clearTimeout(N)},[m]);const R=x.useCallback(async()=>{if(!h){p(!0);return}p(!1),f(null);try{const N=await Ee.getFactoryStatusline();u("idle"),i(structuredClone(N))}catch(N){f(String(N))}},[h]),D=x.useCallback(async()=>{if(r){u("saving"),f(null);try{const N=n?await Ee.putGlobalStatusline(r):await Ee.putStatusline(e,r);N.ok?u("saved"):(u("error"),f(s("statusline.saveFailed",{error:`${N.status} ${await N.text()}`})))}catch(N){u("error"),f(String(N))}}},[e,r,n,s]);if(x.useEffect(()=>{if(!r)return;if(b.current){b.current=!1;return}const N=setTimeout(()=>void D(),700);return()=>clearTimeout(N)},[r,D]),!r)return o.jsx("p",{className:"text-xs text-neutral-500",children:d??s("common.loading")});const _=n||r.source==="custom";function z(){a&&i({...structuredClone(a),source:"custom"})}function $(N,G){i(T=>T&&{...T,segments:{...T.segments,[N]:{...T.segments[N],...G}}})}function H(N){i(G=>G&&{...G,...N})}function I(){i(N=>N&&{...N,lines:[...N.lines,[]]})}function L(N){i(G=>{if(!G||G.lines.length<=1)return G;const T=G.lines.map(Q=>[...Q]),Z=T.splice(N,1)[0]??[],te=N>0?N-1:0;return T[te]=[...T[te],...Z],{...G,lines:T}})}function C(N,G){i(T=>{if(!T)return T;const Z=T.lines.map(te=>te.filter(Q=>Q!==G));return Z[N]=[...Z[N],G],{...T,lines:Z}})}function O(N,G,T){i(Z=>{if(!Z)return Z;const te=Z.lines.map(V=>V.filter(q=>q!==G&&q!==T)),Q=Z.lines[N].indexOf(G),pe=Math.min(Math.max(Q,0),te[N].length);return te[N]=[...te[N].slice(0,pe),T,...te[N].slice(pe)],{...Z,lines:te}})}function U(N,G){i(T=>T&&{...T,lines:T.lines.map((Z,te)=>te===N?Z.filter(Q=>Q!==G):Z)})}function F(N){y.current=Date.now();const{active:G,over:T}=N;if(!T)return;const Z=G.id;i(te=>{var J,ce,ke;if(!te)return te;const Q=((J=G.data.current)==null?void 0:J.line)??-1,pe=((ce=T.data.current)==null?void 0:ce.line)??-1,V=((ke=T.data.current)==null?void 0:ke.container)===!0;if(Q<0||pe<0)return te;if(V)return Q===pe?te:{...te,lines:bS(te.lines,Q,pe,Z,te.lines[pe].length)};if(G.id===T.id)return te;const q=te.lines[Q].indexOf(Z);if(q<0)return te;if(Q===pe){const Ae=te.lines[pe].indexOf(T.id);if(Ae<0)return te;const je=te.lines.map(ae=>[...ae]);return je[Q]=um(je[Q],q,Ae),{...te,lines:je}}const Y=te.lines[pe].indexOf(T.id);return{...te,lines:bS(te.lines,Q,pe,Z,Y<0?te.lines[pe].length:Y)}})}const j={text:`${r.logoText} v${Q1}`,fg:r.logoColor,bold:!0,bg:null,merge:!1};return o.jsxs(Ma,{className:me("flex flex-col",S&&"h-[600px] overflow-hidden"),children:[o.jsxs(_l,{className:"shrink-0 items-center",children:[o.jsxs("button",{type:"button",onClick:()=>M(N=>!N),className:"flex items-center gap-2 text-left",title:s(S?"common.collapse":"common.expand"),children:[S?o.jsx(Bn,{className:"h-4 w-4 text-neutral-500"}):o.jsx(ns,{className:"h-4 w-4 text-neutral-500"}),o.jsx(Cl,{children:s("statusline.title")}),o.jsx(mr,{agent:"claude"})]}),o.jsxs("div",{className:"ml-auto flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"rounded-full bg-neutral-800 px-2 py-0.5 text-neutral-400",children:s(n?"statusline.scopeGlobal":"statusline.scopeProject")}),n&&o.jsx("button",{onClick:()=>void R(),className:me("rounded px-2 py-1 transition-colors",h?"bg-red-900/60 text-red-200 ring-1 ring-red-500/60":"bg-neutral-800 text-neutral-400 hover:bg-neutral-700 hover:text-neutral-200"),title:s("statusline.resetHint"),children:s(h?"statusline.resetConfirm":"statusline.reset")}),o.jsx("button",{onClick:()=>void D(),disabled:c==="saving",className:me("rounded px-2 py-1 disabled:opacity-40",c==="saved"?"bg-emerald-900/40 text-emerald-300":c==="error"?"bg-red-900/40 text-red-300":"bg-blue-900/40 text-blue-300"),children:s(c==="saving"?"common.saving":c==="saved"?"statusline.saved":c==="error"?"statusline.retry":"common.save")})]})]}),S&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"shrink-0 border-b border-edge/[0.06] p-3",children:o.jsxs("div",{className:"nerd-font rounded-md bg-neutral-950 border border-edge/[0.06] px-3 py-2 text-xs text-neutral-300 whitespace-pre overflow-x-auto",children:[r.lines.map((N,G)=>{const T=J9(r,N);return G===0&&j&&T.unshift(j),o.jsxs("div",{children:[G>0&&o.jsx("div",{className:"text-neutral-600",children:"────────────────────────────"}),T.length?o.jsx(tU,{items:T,config:r}):o.jsx("span",{className:"text-neutral-600",children:s("statusline.emptyRow")})]},G)}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:s("statusline.preview")})]})}),o.jsxs(Tl,{className:"min-h-0 flex-1 space-y-3 overflow-y-auto",children:[d&&o.jsx("p",{className:"text-red-400 text-xs",children:d}),!n&&o.jsx("div",{className:"flex items-center gap-2 rounded-md border border-edge/[0.06] bg-neutral-900/60 px-2 py-1.5 text-xs",children:r.source==="global"?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"rounded-full bg-blue-900/50 px-2 py-0.5 text-blue-300",children:s("statusline.followingGlobal")}),o.jsx("span",{className:"text-neutral-600",children:s("statusline.editsDisabled")}),o.jsx("button",{onClick:z,className:"ml-auto shrink-0 rounded bg-blue-900/40 px-2 py-0.5 text-blue-300 hover:bg-blue-900/60",children:s("statusline.customizeLocally")})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"rounded-full bg-amber-900/50 px-2 py-0.5 text-amber-300",children:s("statusline.localCustom")}),o.jsx("span",{className:"text-neutral-600",children:s("statusline.ownConfig")}),o.jsx("button",{onClick:()=>{if(m!=="follow"){k("follow");return}k(null),H({source:"global"})},className:me("ml-auto shrink-0 rounded px-2 py-0.5 transition-colors",m==="follow"?"bg-red-900/60 text-red-200 ring-1 ring-red-500/60":"bg-neutral-800 text-neutral-300 hover:bg-neutral-700"),title:s("statusline.followHint"),children:s(m==="follow"?"statusline.followConfirm":"statusline.follow")}),o.jsx("button",{onClick:()=>{if(m!=="sync"){k("sync");return}k(null),z()},className:me("shrink-0 rounded px-2 py-0.5 transition-colors",m==="sync"?"bg-red-900/60 text-red-200 ring-1 ring-red-500/60":"bg-neutral-800 text-neutral-300 hover:bg-neutral-700"),title:s("statusline.syncHint"),children:s(m==="sync"?"statusline.syncConfirm":"statusline.sync")})]})}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-400 flex-wrap",children:[o.jsx("span",{className:"w-12",children:s("statusline.alignLabel")}),$9.map(N=>o.jsx("button",{onClick:()=>H({align:N.key}),disabled:!_,className:me("rounded px-2 py-0.5 disabled:opacity-30",r.align===N.key?"bg-neutral-800 text-neutral-100":"text-neutral-400 hover:text-neutral-200"),children:s(N.labelKey)},N.key)),o.jsx("span",{className:"text-neutral-600",children:"|"}),o.jsxs("label",{className:"flex items-center gap-1.5",children:[s("statusline.refresh"),o.jsx(nd,{value:r.refreshInterval,min:1,disabled:!_,onChange:N=>H({refreshInterval:N}),title:s("statusline.refresh")}),o.jsx("span",{className:"text-neutral-600",children:"s"}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:s("statusline.refreshNote")})]})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[o.jsx("input",{type:"checkbox",checked:r.powerline.enabled,disabled:!_,onChange:N=>H({powerline:{...r.powerline,enabled:N.target.checked}})}),s("statusline.powerlineStyle"),o.jsx("span",{className:"text-neutral-600",children:s("statusline.powerlineHint")})]}),r.powerline.enabled&&o.jsxs("div",{className:"flex items-center gap-4 text-xs text-neutral-400 flex-wrap pl-6",children:[o.jsx(Tg,{label:s("statusline.glyphSeparator"),value:r.powerline.separator,fallback:DM,presets:Y9,editable:_,onChange:N=>H({powerline:{...r.powerline,separator:N}})}),o.jsx(Tg,{label:s("statusline.glyphStartCap"),value:r.powerline.startCap,fallback:IM,presets:V9,editable:_,allowNone:!0,onChange:N=>H({powerline:{...r.powerline,startCap:N}})}),o.jsx(Tg,{label:s("statusline.glyphEndCap"),value:r.powerline.endCap,fallback:LM,presets:X9,editable:_,allowNone:!0,onChange:N=>H({powerline:{...r.powerline,endCap:N}})}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:s("statusline.nerdFontHint")})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[s("statusline.logo"),o.jsxs("span",{className:"rounded bg-neutral-900 px-2 py-0.5 font-mono text-neutral-300",children:[r.logoText," v",Q1]}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:s("statusline.logoHint")}),o.jsx("div",{className:"flex gap-1",children:o.jsx(yx,{value:r.logoColor,editable:_,onChange:N=>H({logoColor:N})})})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[s("statusline.separator"),o.jsx("input",{value:r.separator,disabled:!_,onChange:N=>H({separator:N.target.value}),className:"nerd-font bg-neutral-900 rounded px-2 py-0.5 w-20 disabled:opacity-40"}),o.jsx("span",{className:"text-neutral-600",children:s("statusline.separatorHint")})]}),o.jsxs("div",{className:"flex items-center gap-3 text-xs text-neutral-400",children:[o.jsxs("label",{className:"flex items-center gap-2",children:[s("statusline.bar"),o.jsx(nd,{value:r.bar.cells,min:1,max:40,disabled:!_,onChange:N=>H({bar:{...r.bar,cells:N}}),title:s("statusline.barCellsHint")})]}),o.jsxs("label",{className:"flex items-center gap-2",children:[s("statusline.fill"),o.jsx("input",{value:r.bar.fill,disabled:!_,onChange:N=>H({bar:{...r.bar,fill:N.target.value}}),className:"bg-neutral-900 rounded px-2 py-0.5 font-mono w-10 text-center disabled:opacity-40"})]}),o.jsxs("label",{className:"flex items-center gap-2",children:[s("statusline.emptyChar"),o.jsx("input",{value:r.bar.empty,disabled:!_,onChange:N=>H({bar:{...r.bar,empty:N.target.value}}),className:"bg-neutral-900 rounded px-2 py-0.5 font-mono w-10 text-center disabled:opacity-40"})]}),o.jsxs("label",{className:"flex items-center gap-2",children:[s("statusline.labelSep"),o.jsx("input",{value:r.labelSeparator,disabled:!_,onChange:N=>H({labelSeparator:N.target.value}),className:"bg-neutral-900 rounded px-2 py-0.5 font-mono w-14 disabled:opacity-40",title:s("statusline.labelSepHint")})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-[11px] text-neutral-500 uppercase tracking-wide",children:s("statusline.lines")}),o.jsx("button",{onClick:I,disabled:!_,className:"text-[11px] rounded bg-neutral-800 px-2 py-0.5 text-neutral-300 hover:bg-neutral-700 disabled:opacity-30",children:s("statusline.addRow")})]}),o.jsx(Nv,{sensors:E,collisionDetection:wL,onDragEnd:F,children:r.lines.map((N,G)=>o.jsx(sU,{li:G,row:N,linesLen:r.lines.length,editable:_,config:r,lastDragEnd:y,onRemoveRow:L,onOpen:(T,Z)=>g({line:T,key:Z}),onAdd:T=>g({line:T,key:null})},G))}),w&&o.jsx(rU,{editing:w,config:r,placedIn:N=>r.lines.findIndex(G=>G.includes(N)),onPick:N=>{w.key===null?C(w.line,N):w.key!==N&&O(w.line,w.key,N),g({line:w.line,key:N})},onPatch:$,onUnplace:()=>{w.key&&U(w.line,w.key),g(null)},onClose:()=>g(null)})]})]})]})]})}function tU({items:e,config:t}){if(!t.powerline.enabled)return o.jsx("span",{children:e.map(c=>o.jsx("span",{className:me(c.bold&&"font-bold"),style:{color:Th(c.fg)},children:c.text},c.text+c.fg)).reduce((c,u,d)=>(d>0&&c.push(o.jsx("span",{children:t.separator},`sep-${d}`)),c.push(u),c),[])});const n=t.powerline,s=n.separator??DM,r=n.startCap??IM,i=n.endCap??LM,a=e[0],l=e[e.length-1];return o.jsxs("span",{className:"inline-flex items-stretch",children:[r&&(a==null?void 0:a.bg)&&o.jsx("span",{className:"whitespace-pre",style:{color:li(a.bg)},children:r}),e.map((c,u)=>{const d=e[u-1],f=u>0&&!d.joinsNext,h=f&&!!c.bg&&!!d.bg&&s!=="";return o.jsxs("span",{className:"inline-flex items-stretch",children:[f&&(h?o.jsx("span",{className:"whitespace-pre",style:{backgroundColor:li(c.bg),color:d.bg===c.bg?Th(d.fg):li(d.bg)},children:s}):o.jsx("span",{className:"w-1"})),o.jsx("span",{className:me("px-1.5 whitespace-pre",c.bold&&"font-bold"),style:{...c.bg?{backgroundColor:li(c.bg)}:{},color:Th(c.fg)},children:c.text})]},u)}),i&&(l==null?void 0:l.bg)&&o.jsx("span",{className:"whitespace-pre",style:{color:li(l.bg)},children:i})]})}function nU({segKey:e,line:t,segment:n,config:s,editable:r,lastDragEnd:i,onOpen:a}){const l=We(),{attributes:c,listeners:u,setNodeRef:d,transform:f,transition:h,isDragging:p}=oM({id:e,disabled:!r,data:{line:t}}),m={transform:f?`translate3d(${f.x}px, ${f.y}px, 0)`:void 0,transition:h},k=xx.find(S=>S.key===e),w=n.enabled,g=PM(e,n,s)||l(k.labelKey),y=w&&n.backgroundColor?li(n.backgroundColor):void 0,b=w?Th(n.color):void 0;return o.jsx("div",{ref:d,style:m,className:me("shrink-0 max-w-[260px]",p&&"opacity-50 ring-1 ring-edge/30"),children:o.jsx("button",{...c,...u,onClick:()=>{Date.now()-i.current<250||a(t,e)},title:w?l("statusline.capsuleTitle",{name:l(k.labelKey)}):l("statusline.capsuleTitleOff",{name:l(k.labelKey)}),className:me("rounded-full px-2.5 py-1 text-xs whitespace-pre select-none transition",w?"shadow-mac-sm":"border border-dashed border-neutral-600 bg-neutral-800/60 text-neutral-500",r?"cursor-grab active:cursor-grabbing hover:brightness-110":"cursor-default"),style:y||b?{backgroundColor:y,color:b}:void 0,children:o.jsx("span",{className:"block truncate",children:g})})})}function sU({li:e,row:t,linesLen:n,editable:s,config:r,lastDragEnd:i,onRemoveRow:a,onOpen:l,onAdd:c}){const u=We(),{setNodeRef:d,isOver:f}=Ev({id:`line-${e}`,data:{line:e,container:!0},disabled:!s});return o.jsxs("div",{ref:d,className:me("rounded-lg border border-edge/[0.08] bg-neutral-900/30 px-2 py-1.5 transition-shadow",f&&"ring-2 ring-emerald-400/50"),children:[o.jsxs("div",{className:"flex items-center gap-2 pb-1",children:[o.jsx("span",{className:"text-[10px] text-neutral-600 font-mono",children:u("statusline.rowN",{n:e+1})}),o.jsx("span",{className:"text-[10px] text-neutral-600",children:u("statusline.blockCount",{n:t.length})}),n>1&&o.jsx("button",{onClick:()=>a(e),disabled:!s,className:"ml-auto text-neutral-500 hover:text-red-400 disabled:opacity-30",title:u("statusline.removeRow"),children:o.jsx("span",{className:"text-xs leading-none",children:"✕"})})]}),o.jsx(aM,{items:t,strategy:_6,children:o.jsxs("div",{className:"flex min-h-[34px] flex-wrap items-center gap-1.5",children:[t.length===0&&o.jsx("span",{className:"text-[11px] text-neutral-600",children:u("statusline.emptyRowHint")}),t.map(h=>o.jsx(nU,{segKey:h,line:e,segment:r.segments[h],config:r,editable:s,lastDragEnd:i,onOpen:l},h)),s&&o.jsx("button",{onClick:()=>c(e),className:"rounded-full border border-dashed border-neutral-600 px-2.5 py-1 text-xs text-neutral-400 transition-colors hover:border-neutral-400 hover:text-neutral-200",title:u("statusline.addBlockHint"),children:u("statusline.addBlock")})]})})]})}function rU({editing:e,config:t,placedIn:n,onPick:s,onPatch:r,onUnplace:i,onClose:a}){const l=e.key,c=l?t.segments[l]:null,u=We();return x.useEffect(()=>{const d=f=>{f.key==="Escape"&&a()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[a]),un.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onMouseDown:d=>{d.target===d.currentTarget&&a()},children:o.jsxs("div",{className:"w-full max-w-md space-y-3 rounded-xl border border-edge/10 bg-neutral-900 p-4 shadow-mac",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-semibold text-neutral-100",children:l?`${t.segments[l].icon?t.segments[l].icon+" ":""}${u(xx.find(d=>d.key===l).labelKey)}`:u("statusline.addBlockTitle")}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:u("statusline.rowN",{n:e.line+1})}),o.jsx("button",{onClick:a,className:"ml-auto text-neutral-500 hover:text-neutral-300",title:u("statusline.closeEsc"),children:"✕"})]}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:xx.map(d=>{const f=n(d.key),h=d.key===l,p=f>=0&&f!==e.line;return o.jsxs("button",{type:"button",onClick:()=>{h||s(d.key)},title:p?u("statusline.tagOtherRow",{n:f+1}):d.key,className:me("rounded-full border px-2 py-0.5 text-[11px] transition-colors",h?"border-blue-500/50 bg-blue-900/50 text-blue-200":p?"border-transparent bg-neutral-800/70 text-amber-400/80 hover:bg-neutral-700 hover:text-amber-300":"border-transparent bg-neutral-800/70 text-neutral-400 hover:bg-neutral-700 hover:text-neutral-200"),children:[u(d.labelKey),p&&o.jsx("span",{className:"ml-1 text-[9px] opacity-70",children:u("statusline.rowShort",{n:f+1})})]},d.key)})}),l===null&&o.jsx("p",{className:"text-xs text-neutral-500",children:u("statusline.pickHint")}),l&&c&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[o.jsx("button",{onClick:()=>r(l,{enabled:!c.enabled}),className:me("rounded px-2 py-0.5",c.enabled?"bg-emerald-900/50 text-emerald-300":"bg-neutral-800 text-neutral-500"),children:c.enabled?u("statusline.enabled"):u("statusline.disabled")}),o.jsx("button",{onClick:()=>r(l,{bold:!c.bold}),className:me("rounded px-2 py-0.5",c.bold?"bg-neutral-800 text-neutral-100 font-bold":"text-neutral-500 hover:text-neutral-300"),title:u("statusline.bold"),children:"B"}),o.jsxs("label",{className:me("flex cursor-pointer items-center gap-1 rounded px-2 py-0.5",c.merge?"bg-neutral-800 text-neutral-200":"text-neutral-500 hover:text-neutral-300"),title:u("statusline.mergeHint"),children:[o.jsx("input",{type:"checkbox",checked:c.merge,onChange:d=>r(l,{merge:d.target.checked}),className:"hidden"}),u("statusline.merge")]}),o.jsx("input",{value:c.icon,onChange:d=>r(l,{icon:d.target.value}),placeholder:u("statusline.iconPlaceholder"),className:"ml-auto w-14 rounded bg-neutral-800 px-1.5 py-0.5 text-center font-mono text-xs",title:u("statusline.iconHint")})]}),l==="context"&&o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-neutral-400",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fieldStyle")}),G9.map(d=>o.jsx("button",{onClick:()=>r(l,{style:d.key}),className:me("rounded px-1.5 py-0.5",(c.style??"both")===d.key?"bg-neutral-800 text-neutral-100":"text-neutral-500 hover:text-neutral-300"),title:u(d.labelKey),children:u(d.labelKey)},d.key))]}),l==="tokens"&&o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-neutral-400",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fieldMetric")}),K9.map(d=>o.jsx("button",{onClick:()=>r(l,{metric:d.key}),className:me("rounded px-1.5 py-0.5",(c.metric??"session")===d.key?"bg-neutral-800 text-neutral-100":"text-neutral-500 hover:text-neutral-300"),title:u(d.titleKey),children:u(d.labelKey)},d.key))]}),l==="rate"&&o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-neutral-400",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fieldWindow")}),q9.map(d=>o.jsx("button",{onClick:()=>r(l,{window:d.key}),className:me("rounded px-1.5 py-0.5",(c.window??"five_hour")===d.key?"bg-neutral-800 text-neutral-100":"text-neutral-500 hover:text-neutral-300"),title:u(d.titleKey),children:u(d.labelKey)},d.key))]}),o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fgBg")}),o.jsx(yx,{value:c.color,editable:!0,onChange:d=>r(l,{color:d})}),o.jsx(yx,{value:c.backgroundColor,editable:!0,allowNone:!0,noneSelected:c.backgroundColor===null,onNone:()=>r(l,{backgroundColor:null}),onChange:d=>r(l,{backgroundColor:d})})]}),o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"w-10 text-neutral-600",children:u("statusline.fieldLabel")}),o.jsx("input",{value:c.label??"",onChange:d=>r(l,{label:d.target.value}),placeholder:u("statusline.labelPlaceholder"),className:"w-24 rounded bg-neutral-800 px-1.5 py-0.5 font-mono",title:u("statusline.labelInputHint")}),o.jsx("span",{className:"text-neutral-600",children:u("statusline.fieldFormat")}),o.jsx("input",{value:c.format??"",onChange:d=>r(l,{format:d.target.value}),placeholder:JA[l],className:"min-w-0 flex-1 rounded bg-neutral-800 px-1.5 py-0.5 font-mono",title:u("statusline.tokensTitle",{tokens:d6[l].map(d=>"{"+d+"}").join(" ")})})]}),o.jsxs("div",{className:"flex items-center justify-between border-t border-edge/[0.06] pt-2",children:[o.jsx("button",{onClick:i,className:"rounded px-2 py-1 text-xs text-red-400/80 hover:bg-red-900/30 hover:text-red-300",title:u("statusline.unplaceHint"),children:u("statusline.unplace")}),o.jsx("button",{onClick:a,className:"rounded bg-blue-900/50 px-3 py-1 text-xs text-blue-200 hover:bg-blue-900/70",children:u("statusline.done")})]})]})]})}),document.body)}function yn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=yn(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var iU={value:()=>{}};function fm(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Ah(n)}function Ah(e){this._=e}function aU(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Ah.prototype=fm.prototype={constructor:Ah,on:function(e,t){var n=this._,s=aU(e+"",n),r,i=-1,a=s.length;if(arguments.length<2){for(;++i<a;)if((r=(e=s[i]).type)&&(r=lU(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<a;)if(r=(e=s[i]).type)n[r]=xS(n[r],e.name,t);else if(t==null)for(r in n)n[r]=xS(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ah(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function lU(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function xS(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=iU,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var vx="http://www.w3.org/1999/xhtml";const yS={svg:"http://www.w3.org/2000/svg",xhtml:vx,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function hm(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yS.hasOwnProperty(t)?{space:yS[t],local:e}:e}function oU(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===vx&&t.documentElement.namespaceURI===vx?t.createElement(e):t.createElementNS(n,e)}}function cU(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zM(e){var t=hm(e);return(t.local?cU:oU)(t)}function uU(){}function Uv(e){return e==null?uU:function(){return this.querySelector(e)}}function dU(e){typeof e!="function"&&(e=Uv(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],a=i.length,l=s[r]=new Array(a),c,u,d=0;d<a;++d)(c=i[d])&&(u=e.call(c,c.__data__,d,i))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new Rs(s,this._parents)}function fU(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function hU(){return[]}function UM(e){return e==null?hU:function(){return this.querySelectorAll(e)}}function pU(e){return function(){return fU(e.apply(this,arguments))}}function mU(e){typeof e=="function"?e=pU(e):e=UM(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var a=t[i],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(s.push(e.call(c,c.__data__,u,a)),r.push(c));return new Rs(s,r)}function FM(e){return function(){return this.matches(e)}}function BM(e){return function(t){return t.matches(e)}}var gU=Array.prototype.find;function bU(e){return function(){return gU.call(this.children,e)}}function xU(){return this.firstElementChild}function yU(e){return this.select(e==null?xU:bU(typeof e=="function"?e:BM(e)))}var vU=Array.prototype.filter;function kU(){return Array.from(this.children)}function wU(e){return function(){return vU.call(this.children,e)}}function SU(e){return this.selectAll(e==null?kU:wU(typeof e=="function"?e:BM(e)))}function NU(e){typeof e!="function"&&(e=FM(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],a=i.length,l=s[r]=[],c,u=0;u<a;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Rs(s,this._parents)}function HM(e){return new Array(e.length)}function EU(){return new Rs(this._enter||this._groups.map(HM),this._parents)}function xp(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}xp.prototype={constructor:xp,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function _U(e){return function(){return e}}function CU(e,t,n,s,r,i){for(var a=0,l,c=t.length,u=i.length;a<u;++a)(l=t[a])?(l.__data__=i[a],s[a]=l):n[a]=new xp(e,i[a]);for(;a<c;++a)(l=t[a])&&(r[a]=l)}function TU(e,t,n,s,r,i,a){var l,c,u=new Map,d=t.length,f=i.length,h=new Array(d),p;for(l=0;l<d;++l)(c=t[l])&&(h[l]=p=a.call(c,c.__data__,l,t)+"",u.has(p)?r[l]=c:u.set(p,c));for(l=0;l<f;++l)p=a.call(e,i[l],l,i)+"",(c=u.get(p))?(s[l]=c,c.__data__=i[l],u.delete(p)):n[l]=new xp(e,i[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(h[l])===c&&(r[l]=c)}function AU(e){return e.__data__}function MU(e,t){if(!arguments.length)return Array.from(this,AU);var n=t?TU:CU,s=this._parents,r=this._groups;typeof e!="function"&&(e=_U(e));for(var i=r.length,a=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=s[u],f=r[u],h=f.length,p=jU(e.call(d,d&&d.__data__,u,s)),m=p.length,k=l[u]=new Array(m),w=a[u]=new Array(m),g=c[u]=new Array(h);n(d,f,k,w,g,p,t);for(var y=0,b=0,S,M;y<m;++y)if(S=k[y]){for(y>=b&&(b=y+1);!(M=w[b])&&++b<m;);S._next=M||null}}return a=new Rs(a,s),a._enter=l,a._exit=c,a}function jU(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function RU(){return new Rs(this._exit||this._groups.map(HM),this._parents)}function OU(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function DU(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,a=Math.min(r,i),l=new Array(r),c=0;c<a;++c)for(var u=n[c],d=s[c],f=u.length,h=l[c]=new Array(f),p,m=0;m<f;++m)(p=u[m]||d[m])&&(h[m]=p);for(;c<r;++c)l[c]=n[c];return new Rs(l,this._parents)}function IU(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],a;--r>=0;)(a=s[r])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function LU(e){e||(e=PU);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var a=n[i],l=a.length,c=r[i]=new Array(l),u,d=0;d<l;++d)(u=a[d])&&(c[d]=u);c.sort(t)}return new Rs(r,this._parents).order()}function PU(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function zU(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function UU(){return Array.from(this)}function FU(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var a=s[r];if(a)return a}return null}function BU(){let e=0;for(const t of this)++e;return e}function HU(){return!this.node()}function $U(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,a=r.length,l;i<a;++i)(l=r[i])&&e.call(l,l.__data__,i,r);return this}function GU(e){return function(){this.removeAttribute(e)}}function KU(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qU(e,t){return function(){this.setAttribute(e,t)}}function YU(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function VU(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function XU(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function QU(e,t){var n=hm(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?KU:GU:typeof t=="function"?n.local?XU:VU:n.local?YU:qU)(n,t))}function $M(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function WU(e){return function(){this.style.removeProperty(e)}}function ZU(e,t,n){return function(){this.style.setProperty(e,t,n)}}function JU(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function e8(e,t,n){return arguments.length>1?this.each((t==null?WU:typeof t=="function"?JU:ZU)(e,t,n??"")):lc(this.node(),e)}function lc(e,t){return e.style.getPropertyValue(t)||$M(e).getComputedStyle(e,null).getPropertyValue(t)}function t8(e){return function(){delete this[e]}}function n8(e,t){return function(){this[e]=t}}function s8(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function r8(e,t){return arguments.length>1?this.each((t==null?t8:typeof t=="function"?s8:n8)(e,t)):this.node()[e]}function GM(e){return e.trim().split(/^|\s+/)}function Fv(e){return e.classList||new KM(e)}function KM(e){this._node=e,this._names=GM(e.getAttribute("class")||"")}KM.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function qM(e,t){for(var n=Fv(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function YM(e,t){for(var n=Fv(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function i8(e){return function(){qM(this,e)}}function a8(e){return function(){YM(this,e)}}function l8(e,t){return function(){(t.apply(this,arguments)?qM:YM)(this,e)}}function o8(e,t){var n=GM(e+"");if(arguments.length<2){for(var s=Fv(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?l8:t?i8:a8)(n,t))}function c8(){this.textContent=""}function u8(e){return function(){this.textContent=e}}function d8(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function f8(e){return arguments.length?this.each(e==null?c8:(typeof e=="function"?d8:u8)(e)):this.node().textContent}function h8(){this.innerHTML=""}function p8(e){return function(){this.innerHTML=e}}function m8(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function g8(e){return arguments.length?this.each(e==null?h8:(typeof e=="function"?m8:p8)(e)):this.node().innerHTML}function b8(){this.nextSibling&&this.parentNode.appendChild(this)}function x8(){return this.each(b8)}function y8(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function v8(){return this.each(y8)}function k8(e){var t=typeof e=="function"?e:zM(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function w8(){return null}function S8(e,t){var n=typeof e=="function"?e:zM(e),s=t==null?w8:typeof t=="function"?t:Uv(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function N8(){var e=this.parentNode;e&&e.removeChild(this)}function E8(){return this.each(N8)}function _8(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function C8(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function T8(e){return this.select(e?C8:_8)}function A8(e){return arguments.length?this.property("__data__",e):this.node().__data__}function M8(e){return function(t){e.call(this,t,this.__data__)}}function j8(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function R8(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function O8(e,t,n){return function(){var s=this.__on,r,i=M8(t);if(s){for(var a=0,l=s.length;a<l;++a)if((r=s[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function D8(e,t,n){var s=j8(e+""),r,i=s.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(r=0,d=l[c];r<i;++r)if((a=s[r]).type===d.type&&a.name===d.name)return d.value}return}for(l=t?O8:R8,r=0;r<i;++r)this.each(l(s[r],t,n));return this}function VM(e,t,n){var s=$M(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function I8(e,t){return function(){return VM(this,e,t)}}function L8(e,t){return function(){return VM(this,e,t.apply(this,arguments))}}function P8(e,t){return this.each((typeof t=="function"?L8:I8)(e,t))}function*z8(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,a;r<i;++r)(a=s[r])&&(yield a)}var XM=[null];function Rs(e,t){this._groups=e,this._parents=t}function qd(){return new Rs([[document.documentElement]],XM)}function U8(){return this}Rs.prototype=qd.prototype={constructor:Rs,select:dU,selectAll:mU,selectChild:yU,selectChildren:SU,filter:NU,data:MU,enter:EU,exit:RU,join:OU,merge:DU,selection:U8,order:IU,sort:LU,call:zU,nodes:UU,node:FU,size:BU,empty:HU,each:$U,attr:QU,style:e8,property:r8,classed:o8,text:f8,html:g8,raise:x8,lower:v8,append:k8,insert:S8,remove:E8,clone:T8,datum:A8,on:D8,dispatch:P8,[Symbol.iterator]:z8};function Ns(e){return typeof e=="string"?new Rs([[document.querySelector(e)]],[document.documentElement]):new Rs([[e]],XM)}function F8(e){let t;for(;t=e.sourceEvent;)e=t;return e}function sr(e,t){if(e=F8(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const B8={passive:!1},sd={capture:!0,passive:!1};function Ag(e){e.stopImmediatePropagation()}function Ao(e){e.preventDefault(),e.stopImmediatePropagation()}function QM(e){var t=e.document.documentElement,n=Ns(e).on("dragstart.drag",Ao,sd);"onselectstart"in t?n.on("selectstart.drag",Ao,sd):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function WM(e,t){var n=e.document.documentElement,s=Ns(e).on("dragstart.drag",null);t&&(s.on("click.drag",Ao,sd),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Df=e=>()=>e;function kx(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}kx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function H8(e){return!e.ctrlKey&&!e.button}function $8(){return this.parentNode}function G8(e,t){return t??{x:e.x,y:e.y}}function K8(){return navigator.maxTouchPoints||"ontouchstart"in this}function ZM(){var e=H8,t=$8,n=G8,s=K8,r={},i=fm("start","drag","end"),a=0,l,c,u,d,f=0;function h(S){S.on("mousedown.drag",p).filter(s).on("touchstart.drag",w).on("touchmove.drag",g,B8).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(S,M){if(!(d||!e.call(this,S,M))){var E=b(this,t.call(this,S,M),S,M,"mouse");E&&(Ns(S.view).on("mousemove.drag",m,sd).on("mouseup.drag",k,sd),QM(S.view),Ag(S),u=!1,l=S.clientX,c=S.clientY,E("start",S))}}function m(S){if(Ao(S),!u){var M=S.clientX-l,E=S.clientY-c;u=M*M+E*E>f}r.mouse("drag",S)}function k(S){Ns(S.view).on("mousemove.drag mouseup.drag",null),WM(S.view,u),Ao(S),r.mouse("end",S)}function w(S,M){if(e.call(this,S,M)){var E=S.changedTouches,A=t.call(this,S,M),R=E.length,D,_;for(D=0;D<R;++D)(_=b(this,A,S,M,E[D].identifier,E[D]))&&(Ag(S),_("start",S,E[D]))}}function g(S){var M=S.changedTouches,E=M.length,A,R;for(A=0;A<E;++A)(R=r[M[A].identifier])&&(Ao(S),R("drag",S,M[A]))}function y(S){var M=S.changedTouches,E=M.length,A,R;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),A=0;A<E;++A)(R=r[M[A].identifier])&&(Ag(S),R("end",S,M[A]))}function b(S,M,E,A,R,D){var _=i.copy(),z=sr(D||E,M),$,H,I;if((I=n.call(S,new kx("beforestart",{sourceEvent:E,target:h,identifier:R,active:a,x:z[0],y:z[1],dx:0,dy:0,dispatch:_}),A))!=null)return $=I.x-z[0]||0,H=I.y-z[1]||0,function L(C,O,U){var F=z,j;switch(C){case"start":r[R]=L,j=a++;break;case"end":delete r[R],--a;case"drag":z=sr(U||O,M),j=a;break}_.call(C,S,new kx(C,{sourceEvent:O,subject:I,target:h,identifier:R,active:j,x:z[0]+$,y:z[1]+H,dx:z[0]-F[0],dy:z[1]-F[1],dispatch:_}),A)}}return h.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Df(!!S),h):e},h.container=function(S){return arguments.length?(t=typeof S=="function"?S:Df(S),h):t},h.subject=function(S){return arguments.length?(n=typeof S=="function"?S:Df(S),h):n},h.touchable=function(S){return arguments.length?(s=typeof S=="function"?S:Df(!!S),h):s},h.on=function(){var S=i.on.apply(i,arguments);return S===i?h:S},h.clickDistance=function(S){return arguments.length?(f=(S=+S)*S,h):Math.sqrt(f)},h}function Bv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function JM(e,t){var n=Object.create(e.prototype);for(var s in t)n[s]=t[s];return n}function Yd(){}var rd=.7,yp=1/rd,Mo="\\s*([+-]?\\d+)\\s*",id="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ir="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",q8=/^#([0-9a-f]{3,8})$/,Y8=new RegExp(`^rgb\\(${Mo},${Mo},${Mo}\\)$`),V8=new RegExp(`^rgb\\(${Ir},${Ir},${Ir}\\)$`),X8=new RegExp(`^rgba\\(${Mo},${Mo},${Mo},${id}\\)$`),Q8=new RegExp(`^rgba\\(${Ir},${Ir},${Ir},${id}\\)$`),W8=new RegExp(`^hsl\\(${id},${Ir},${Ir}\\)$`),Z8=new RegExp(`^hsla\\(${id},${Ir},${Ir},${id}\\)$`),vS={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Bv(Yd,Al,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kS,formatHex:kS,formatHex8:J8,formatHsl:eF,formatRgb:wS,toString:wS});function kS(){return this.rgb().formatHex()}function J8(){return this.rgb().formatHex8()}function eF(){return ej(this).formatHsl()}function wS(){return this.rgb().formatRgb()}function Al(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=q8.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?SS(t):n===3?new fs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?If(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?If(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Y8.exec(e))?new fs(t[1],t[2],t[3],1):(t=V8.exec(e))?new fs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=X8.exec(e))?If(t[1],t[2],t[3],t[4]):(t=Q8.exec(e))?If(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=W8.exec(e))?_S(t[1],t[2]/100,t[3]/100,1):(t=Z8.exec(e))?_S(t[1],t[2]/100,t[3]/100,t[4]):vS.hasOwnProperty(e)?SS(vS[e]):e==="transparent"?new fs(NaN,NaN,NaN,0):null}function SS(e){return new fs(e>>16&255,e>>8&255,e&255,1)}function If(e,t,n,s){return s<=0&&(e=t=n=NaN),new fs(e,t,n,s)}function tF(e){return e instanceof Yd||(e=Al(e)),e?(e=e.rgb(),new fs(e.r,e.g,e.b,e.opacity)):new fs}function wx(e,t,n,s){return arguments.length===1?tF(e):new fs(e,t,n,s??1)}function fs(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}Bv(fs,wx,JM(Yd,{brighter(e){return e=e==null?yp:Math.pow(yp,e),new fs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?rd:Math.pow(rd,e),new fs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fs(hl(this.r),hl(this.g),hl(this.b),vp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:NS,formatHex:NS,formatHex8:nF,formatRgb:ES,toString:ES}));function NS(){return`#${Qa(this.r)}${Qa(this.g)}${Qa(this.b)}`}function nF(){return`#${Qa(this.r)}${Qa(this.g)}${Qa(this.b)}${Qa((isNaN(this.opacity)?1:this.opacity)*255)}`}function ES(){const e=vp(this.opacity);return`${e===1?"rgb(":"rgba("}${hl(this.r)}, ${hl(this.g)}, ${hl(this.b)}${e===1?")":`, ${e})`}`}function vp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qa(e){return e=hl(e),(e<16?"0":"")+e.toString(16)}function _S(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ir(e,t,n,s)}function ej(e){if(e instanceof ir)return new ir(e.h,e.s,e.l,e.opacity);if(e instanceof Yd||(e=Al(e)),!e)return new ir;if(e instanceof ir)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,r=Math.min(t,n,s),i=Math.max(t,n,s),a=NaN,l=i-r,c=(i+r)/2;return l?(t===i?a=(n-s)/l+(n<s)*6:n===i?a=(s-t)/l+2:a=(t-n)/l+4,l/=c<.5?i+r:2-i-r,a*=60):l=c>0&&c<1?0:a,new ir(a,l,c,e.opacity)}function sF(e,t,n,s){return arguments.length===1?ej(e):new ir(e,t,n,s??1)}function ir(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}Bv(ir,sF,JM(Yd,{brighter(e){return e=e==null?yp:Math.pow(yp,e),new ir(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?rd:Math.pow(rd,e),new ir(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*t,r=2*n-s;return new fs(Mg(e>=240?e-240:e+120,r,s),Mg(e,r,s),Mg(e<120?e+240:e-120,r,s),this.opacity)},clamp(){return new ir(CS(this.h),Lf(this.s),Lf(this.l),vp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=vp(this.opacity);return`${e===1?"hsl(":"hsla("}${CS(this.h)}, ${Lf(this.s)*100}%, ${Lf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function CS(e){return e=(e||0)%360,e<0?e+360:e}function Lf(e){return Math.max(0,Math.min(1,e||0))}function Mg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Hv=e=>()=>e;function rF(e,t){return function(n){return e+n*t}}function iF(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function aF(e){return(e=+e)==1?tj:function(t,n){return n-t?iF(t,n,e):Hv(isNaN(t)?n:t)}}function tj(e,t){var n=t-e;return n?rF(e,n):Hv(isNaN(e)?t:e)}const kp=function e(t){var n=aF(t);function s(r,i){var a=n((r=wx(r)).r,(i=wx(i)).r),l=n(r.g,i.g),c=n(r.b,i.b),u=tj(r.opacity,i.opacity);return function(d){return r.r=a(d),r.g=l(d),r.b=c(d),r.opacity=u(d),r+""}}return s.gamma=e,s}(1);function lF(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),r;return function(i){for(r=0;r<n;++r)s[r]=e[r]*(1-i)+t[r]*i;return s}}function oF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cF(e,t){var n=t?t.length:0,s=e?Math.min(n,e.length):0,r=new Array(s),i=new Array(n),a;for(a=0;a<s;++a)r[a]=Nu(e[a],t[a]);for(;a<n;++a)i[a]=t[a];return function(l){for(a=0;a<s;++a)i[a]=r[a](l);return i}}function uF(e,t){var n=new Date;return e=+e,t=+t,function(s){return n.setTime(e*(1-s)+t*s),n}}function Tr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function dF(e,t){var n={},s={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Nu(e[r],t[r]):s[r]=t[r];return function(i){for(r in n)s[r]=n[r](i);return s}}var Sx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jg=new RegExp(Sx.source,"g");function fF(e){return function(){return e}}function hF(e){return function(t){return e(t)+""}}function nj(e,t){var n=Sx.lastIndex=jg.lastIndex=0,s,r,i,a=-1,l=[],c=[];for(e=e+"",t=t+"";(s=Sx.exec(e))&&(r=jg.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),l[a]?l[a]+=i:l[++a]=i),(s=s[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,c.push({i:a,x:Tr(s,r)})),n=jg.lastIndex;return n<t.length&&(i=t.slice(n),l[a]?l[a]+=i:l[++a]=i),l.length<2?c[0]?hF(c[0].x):fF(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function Nu(e,t){var n=typeof t,s;return t==null||n==="boolean"?Hv(t):(n==="number"?Tr:n==="string"?(s=Al(t))?(t=s,kp):nj:t instanceof Al?kp:t instanceof Date?uF:oF(t)?lF:Array.isArray(t)?cF:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?dF:Tr)(e,t)}var TS=180/Math.PI,Nx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function sj(e,t,n,s,r,i){var a,l,c;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(c=e*n+t*s)&&(n-=e*c,s-=t*c),(l=Math.sqrt(n*n+s*s))&&(n/=l,s/=l,c/=l),e*s<t*n&&(e=-e,t=-t,c=-c,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*TS,skewX:Math.atan(c)*TS,scaleX:a,scaleY:l}}var Pf;function pF(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Nx:sj(t.a,t.b,t.c,t.d,t.e,t.f)}function mF(e){return e==null||(Pf||(Pf=document.createElementNS("http://www.w3.org/2000/svg","g")),Pf.setAttribute("transform",e),!(e=Pf.transform.baseVal.consolidate()))?Nx:(e=e.matrix,sj(e.a,e.b,e.c,e.d,e.e,e.f))}function rj(e,t,n,s){function r(u){return u.length?u.pop()+" ":""}function i(u,d,f,h,p,m){if(u!==f||d!==h){var k=p.push("translate(",null,t,null,n);m.push({i:k-4,x:Tr(u,f)},{i:k-2,x:Tr(d,h)})}else(f||h)&&p.push("translate("+f+t+h+n)}function a(u,d,f,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,s)-2,x:Tr(u,d)})):d&&f.push(r(f)+"rotate("+d+s)}function l(u,d,f,h){u!==d?h.push({i:f.push(r(f)+"skewX(",null,s)-2,x:Tr(u,d)}):d&&f.push(r(f)+"skewX("+d+s)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var k=p.push(r(p)+"scale(",null,",",null,")");m.push({i:k-4,x:Tr(u,f)},{i:k-2,x:Tr(d,h)})}else(f!==1||h!==1)&&p.push(r(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,k=h.length,w;++m<k;)f[(w=h[m]).i]=w.x(p);return f.join("")}}}var gF=rj(pF,"px, ","px)","deg)"),bF=rj(mF,", ",")",")"),xF=1e-12;function AS(e){return((e=Math.exp(e))+1/e)/2}function yF(e){return((e=Math.exp(e))-1/e)/2}function vF(e){return((e=Math.exp(2*e))-1)/(e+1)}const Mh=function e(t,n,s){function r(i,a){var l=i[0],c=i[1],u=i[2],d=a[0],f=a[1],h=a[2],p=d-l,m=f-c,k=p*p+m*m,w,g;if(k<xF)g=Math.log(h/u)/t,w=function(A){return[l+A*p,c+A*m,u*Math.exp(t*A*g)]};else{var y=Math.sqrt(k),b=(h*h-u*u+s*k)/(2*u*n*y),S=(h*h-u*u-s*k)/(2*h*n*y),M=Math.log(Math.sqrt(b*b+1)-b),E=Math.log(Math.sqrt(S*S+1)-S);g=(E-M)/t,w=function(A){var R=A*g,D=AS(M),_=u/(n*y)*(D*vF(t*R+M)-yF(M));return[l+_*p,c+_*m,u*D/AS(t*R+M)]}}return w.duration=g*1e3*t/Math.SQRT2,w}return r.rho=function(i){var a=Math.max(.001,+i),l=a*a,c=l*l;return e(a,l,c)},r}(Math.SQRT2,2,4);var oc=0,tu=0,$c=0,ij=1e3,wp,nu,Sp=0,Ml=0,pm=0,ad=typeof performance=="object"&&performance.now?performance:Date,aj=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $v(){return Ml||(aj(kF),Ml=ad.now()+pm)}function kF(){Ml=0}function Np(){this._call=this._time=this._next=null}Np.prototype=lj.prototype={constructor:Np,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$v():+n)+(t==null?0:+t),!this._next&&nu!==this&&(nu?nu._next=this:wp=this,nu=this),this._call=e,this._time=n,Ex()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ex())}};function lj(e,t,n){var s=new Np;return s.restart(e,t,n),s}function wF(){$v(),++oc;for(var e=wp,t;e;)(t=Ml-e._time)>=0&&e._call.call(void 0,t),e=e._next;--oc}function MS(){Ml=(Sp=ad.now())+pm,oc=tu=0;try{wF()}finally{oc=0,NF(),Ml=0}}function SF(){var e=ad.now(),t=e-Sp;t>ij&&(pm-=t,Sp=e)}function NF(){for(var e,t=wp,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:wp=n);nu=e,Ex(s)}function Ex(e){if(!oc){tu&&(tu=clearTimeout(tu));var t=e-Ml;t>24?(e<1/0&&(tu=setTimeout(MS,e-ad.now()-pm)),$c&&($c=clearInterval($c))):($c||(Sp=ad.now(),$c=setInterval(SF,ij)),oc=1,aj(MS))}}function jS(e,t,n){var s=new Np;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var EF=fm("start","end","cancel","interrupt"),_F=[],oj=0,RS=1,_x=2,jh=3,OS=4,Cx=5,Rh=6;function mm(e,t,n,s,r,i){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;CF(e,n,{name:t,index:s,group:r,on:EF,tween:_F,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:oj})}function Gv(e,t){var n=gr(e,t);if(n.state>oj)throw new Error("too late; already scheduled");return n}function Ur(e,t){var n=gr(e,t);if(n.state>jh)throw new Error("too late; already running");return n}function gr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function CF(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=lj(i,0,n.time);function i(u){n.state=RS,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,p;if(n.state!==RS)return c();for(d in s)if(p=s[d],p.name===n.name){if(p.state===jh)return jS(a);p.state===OS?(p.state=Rh,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete s[d]):+d<t&&(p.state=Rh,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete s[d])}if(jS(function(){n.state===jh&&(n.state=OS,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=_x,n.on.call("start",e,e.__data__,n.index,n.group),n.state===_x){for(n.state=jh,r=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(r[++f]=p);r.length=f+1}}function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=Cx,1),f=-1,h=r.length;++f<h;)r[f].call(e,d);n.state===Cx&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Rh,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function Oh(e,t){var n=e.__transition,s,r,i=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((s=n[a]).name!==t){i=!1;continue}r=s.state>_x&&s.state<Cx,s.state=Rh,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[a]}i&&delete e.__transition}}function TF(e){return this.each(function(){Oh(this,e)})}function AF(e,t){var n,s;return function(){var r=Ur(this,e),i=r.tween;if(i!==n){s=n=i;for(var a=0,l=s.length;a<l;++a)if(s[a].name===t){s=s.slice(),s.splice(a,1);break}}r.tween=s}}function MF(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=Ur(this,e),a=i.tween;if(a!==s){r=(s=a).slice();for(var l={name:t,value:n},c=0,u=r.length;c<u;++c)if(r[c].name===t){r[c]=l;break}c===u&&r.push(l)}i.tween=r}}function jF(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=gr(this.node(),n).tween,r=0,i=s.length,a;r<i;++r)if((a=s[r]).name===e)return a.value;return null}return this.each((t==null?AF:MF)(n,e,t))}function Kv(e,t,n){var s=e._id;return e.each(function(){var r=Ur(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return gr(r,s).value[t]}}function cj(e,t){var n;return(typeof t=="number"?Tr:t instanceof Al?kp:(n=Al(t))?(t=n,kp):nj)(e,t)}function RF(e){return function(){this.removeAttribute(e)}}function OF(e){return function(){this.removeAttributeNS(e.space,e.local)}}function DF(e,t,n){var s,r=n+"",i;return function(){var a=this.getAttribute(e);return a===r?null:a===s?i:i=t(s=a,n)}}function IF(e,t,n){var s,r=n+"",i;return function(){var a=this.getAttributeNS(e.space,e.local);return a===r?null:a===s?i:i=t(s=a,n)}}function LF(e,t,n){var s,r,i;return function(){var a,l=n(this),c;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=l+"",a===c?null:a===s&&c===r?i:(r=c,i=t(s=a,l)))}}function PF(e,t,n){var s,r,i;return function(){var a,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=l+"",a===c?null:a===s&&c===r?i:(r=c,i=t(s=a,l)))}}function zF(e,t){var n=hm(e),s=n==="transform"?bF:cj;return this.attrTween(e,typeof t=="function"?(n.local?PF:LF)(n,s,Kv(this,"attr."+e,t)):t==null?(n.local?OF:RF)(n):(n.local?IF:DF)(n,s,t))}function UF(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function FF(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function BF(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&FF(e,i)),n}return r._value=t,r}function HF(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&UF(e,i)),n}return r._value=t,r}function $F(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=hm(e);return this.tween(n,(s.local?BF:HF)(s,t))}function GF(e,t){return function(){Gv(this,e).delay=+t.apply(this,arguments)}}function KF(e,t){return t=+t,function(){Gv(this,e).delay=t}}function qF(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?GF:KF)(t,e)):gr(this.node(),t).delay}function YF(e,t){return function(){Ur(this,e).duration=+t.apply(this,arguments)}}function VF(e,t){return t=+t,function(){Ur(this,e).duration=t}}function XF(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?YF:VF)(t,e)):gr(this.node(),t).duration}function QF(e,t){if(typeof t!="function")throw new Error;return function(){Ur(this,e).ease=t}}function WF(e){var t=this._id;return arguments.length?this.each(QF(t,e)):gr(this.node(),t).ease}function ZF(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ur(this,e).ease=n}}function JF(e){if(typeof e!="function")throw new Error;return this.each(ZF(this._id,e))}function eB(e){typeof e!="function"&&(e=FM(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],a=i.length,l=s[r]=[],c,u=0;u<a;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new Si(s,this._parents,this._name,this._id)}function tB(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),a=new Array(s),l=0;l<i;++l)for(var c=t[l],u=n[l],d=c.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=c[p]||u[p])&&(f[p]=h);for(;l<s;++l)a[l]=t[l];return new Si(a,this._parents,this._name,this._id)}function nB(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function sB(e,t,n){var s,r,i=nB(t)?Gv:Ur;return function(){var a=i(this,e),l=a.on;l!==s&&(r=(s=l).copy()).on(t,n),a.on=r}}function rB(e,t){var n=this._id;return arguments.length<2?gr(this.node(),n).on.on(e):this.each(sB(n,e,t))}function iB(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function aB(){return this.on("end.remove",iB(this._id))}function lB(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Uv(e));for(var s=this._groups,r=s.length,i=new Array(r),a=0;a<r;++a)for(var l=s[a],c=l.length,u=i[a]=new Array(c),d,f,h=0;h<c;++h)(d=l[h])&&(f=e.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,mm(u[h],t,n,h,u,gr(d,n)));return new Si(i,this._parents,t,n)}function oB(e){var t=this._name,n=this._id;typeof e!="function"&&(e=UM(e));for(var s=this._groups,r=s.length,i=[],a=[],l=0;l<r;++l)for(var c=s[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var h=e.call(d,d.__data__,f,c),p,m=gr(d,n),k=0,w=h.length;k<w;++k)(p=h[k])&&mm(p,t,n,k,h,m);i.push(h),a.push(d)}return new Si(i,a,t,n)}var cB=qd.prototype.constructor;function uB(){return new cB(this._groups,this._parents)}function dB(e,t){var n,s,r;return function(){var i=lc(this,e),a=(this.style.removeProperty(e),lc(this,e));return i===a?null:i===n&&a===s?r:r=t(n=i,s=a)}}function uj(e){return function(){this.style.removeProperty(e)}}function fB(e,t,n){var s,r=n+"",i;return function(){var a=lc(this,e);return a===r?null:a===s?i:i=t(s=a,n)}}function hB(e,t,n){var s,r,i;return function(){var a=lc(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),lc(this,e))),a===c?null:a===s&&c===r?i:(r=c,i=t(s=a,l))}}function pB(e,t){var n,s,r,i="style."+t,a="end."+i,l;return function(){var c=Ur(this,e),u=c.on,d=c.value[i]==null?l||(l=uj(t)):void 0;(u!==n||r!==d)&&(s=(n=u).copy()).on(a,r=d),c.on=s}}function mB(e,t,n){var s=(e+="")=="transform"?gF:cj;return t==null?this.styleTween(e,dB(e,s)).on("end.style."+e,uj(e)):typeof t=="function"?this.styleTween(e,hB(e,s,Kv(this,"style."+e,t))).each(pB(this._id,e)):this.styleTween(e,fB(e,s,t),n).on("end.style."+e,null)}function gB(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function bB(e,t,n){var s,r;function i(){var a=t.apply(this,arguments);return a!==r&&(s=(r=a)&&gB(e,a,n)),s}return i._value=t,i}function xB(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,bB(e,t,n??""))}function yB(e){return function(){this.textContent=e}}function vB(e){return function(){var t=e(this);this.textContent=t??""}}function kB(e){return this.tween("text",typeof e=="function"?vB(Kv(this,"text",e)):yB(e==null?"":e+""))}function wB(e){return function(t){this.textContent=e.call(this,t)}}function SB(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&wB(r)),t}return s._value=e,s}function NB(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,SB(e))}function EB(){for(var e=this._name,t=this._id,n=dj(),s=this._groups,r=s.length,i=0;i<r;++i)for(var a=s[i],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var d=gr(c,t);mm(c,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Si(s,this._parents,e,n)}function _B(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,a){var l={value:a},c={value:function(){--r===0&&i()}};n.each(function(){var u=Ur(this,s),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),r===0&&i()})}var CB=0;function Si(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function dj(){return++CB}var Jr=qd.prototype;Si.prototype={constructor:Si,select:lB,selectAll:oB,selectChild:Jr.selectChild,selectChildren:Jr.selectChildren,filter:eB,merge:tB,selection:uB,transition:EB,call:Jr.call,nodes:Jr.nodes,node:Jr.node,size:Jr.size,empty:Jr.empty,each:Jr.each,on:rB,attr:zF,attrTween:$F,style:mB,styleTween:xB,text:kB,textTween:NB,remove:aB,tween:jF,delay:qF,duration:XF,ease:WF,easeVarying:JF,end:_B,[Symbol.iterator]:Jr[Symbol.iterator]};function TB(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var AB={time:null,delay:0,duration:250,ease:TB};function MB(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function jB(e){var t,n;e instanceof Si?(t=e._id,e=e._name):(t=dj(),(n=AB).time=$v(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var a=s[i],l=a.length,c,u=0;u<l;++u)(c=a[u])&&mm(c,e,t,u,a,n||MB(c,t));return new Si(s,this._parents,e,t)}qd.prototype.interrupt=TF;qd.prototype.transition=jB;const zf=e=>()=>e;function RB(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function di(e,t,n){this.k=e,this.x=t,this.y=n}di.prototype={constructor:di,scale:function(e){return e===1?this:new di(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new di(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var gm=new di(1,0,0);fj.prototype=di.prototype;function fj(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gm;return e.__zoom}function Rg(e){e.stopImmediatePropagation()}function Gc(e){e.preventDefault(),e.stopImmediatePropagation()}function OB(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function DB(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function DS(){return this.__zoom||gm}function IB(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function LB(){return navigator.maxTouchPoints||"ontouchstart"in this}function PB(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function hj(){var e=OB,t=DB,n=PB,s=IB,r=LB,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Mh,u=fm("start","zoom","end"),d,f,h,p=500,m=150,k=0,w=10;function g(I){I.property("__zoom",DS).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",_).filter(r).on("touchstart.zoom",z).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(I,L,C,O){var U=I.selection?I.selection():I;U.property("__zoom",DS),I!==U?M(I,L,C,O):U.interrupt().each(function(){E(this,arguments).event(O).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},g.scaleBy=function(I,L,C,O){g.scaleTo(I,function(){var U=this.__zoom.k,F=typeof L=="function"?L.apply(this,arguments):L;return U*F},C,O)},g.scaleTo=function(I,L,C,O){g.transform(I,function(){var U=t.apply(this,arguments),F=this.__zoom,j=C==null?S(U):typeof C=="function"?C.apply(this,arguments):C,N=F.invert(j),G=typeof L=="function"?L.apply(this,arguments):L;return n(b(y(F,G),j,N),U,a)},C,O)},g.translateBy=function(I,L,C,O){g.transform(I,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,O)},g.translateTo=function(I,L,C,O,U){g.transform(I,function(){var F=t.apply(this,arguments),j=this.__zoom,N=O==null?S(F):typeof O=="function"?O.apply(this,arguments):O;return n(gm.translate(N[0],N[1]).scale(j.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof C=="function"?-C.apply(this,arguments):-C),F,a)},O,U)};function y(I,L){return L=Math.max(i[0],Math.min(i[1],L)),L===I.k?I:new di(L,I.x,I.y)}function b(I,L,C){var O=L[0]-C[0]*I.k,U=L[1]-C[1]*I.k;return O===I.x&&U===I.y?I:new di(I.k,O,U)}function S(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function M(I,L,C,O){I.on("start.zoom",function(){E(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(O).end()}).tween("zoom",function(){var U=this,F=arguments,j=E(U,F).event(O),N=t.apply(U,F),G=C==null?S(N):typeof C=="function"?C.apply(U,F):C,T=Math.max(N[1][0]-N[0][0],N[1][1]-N[0][1]),Z=U.__zoom,te=typeof L=="function"?L.apply(U,F):L,Q=c(Z.invert(G).concat(T/Z.k),te.invert(G).concat(T/te.k));return function(pe){if(pe===1)pe=te;else{var V=Q(pe),q=T/V[2];pe=new di(q,G[0]-V[0]*q,G[1]-V[1]*q)}j.zoom(null,pe)}})}function E(I,L,C){return!C&&I.__zooming||new A(I,L)}function A(I,L){this.that=I,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(I,L),this.taps=0}A.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,L){return this.mouse&&I!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var L=Ns(this.that).datum();u.call(I,this.that,new RB(I,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),L)}};function R(I,...L){if(!e.apply(this,arguments))return;var C=E(this,L).event(I),O=this.__zoom,U=Math.max(i[0],Math.min(i[1],O.k*Math.pow(2,s.apply(this,arguments)))),F=sr(I);if(C.wheel)(C.mouse[0][0]!==F[0]||C.mouse[0][1]!==F[1])&&(C.mouse[1]=O.invert(C.mouse[0]=F)),clearTimeout(C.wheel);else{if(O.k===U)return;C.mouse=[F,O.invert(F)],Oh(this),C.start()}Gc(I),C.wheel=setTimeout(j,m),C.zoom("mouse",n(b(y(O,U),C.mouse[0],C.mouse[1]),C.extent,a));function j(){C.wheel=null,C.end()}}function D(I,...L){if(h||!e.apply(this,arguments))return;var C=I.currentTarget,O=E(this,L,!0).event(I),U=Ns(I.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",T,!0),F=sr(I,C),j=I.clientX,N=I.clientY;QM(I.view),Rg(I),O.mouse=[F,this.__zoom.invert(F)],Oh(this),O.start();function G(Z){if(Gc(Z),!O.moved){var te=Z.clientX-j,Q=Z.clientY-N;O.moved=te*te+Q*Q>k}O.event(Z).zoom("mouse",n(b(O.that.__zoom,O.mouse[0]=sr(Z,C),O.mouse[1]),O.extent,a))}function T(Z){U.on("mousemove.zoom mouseup.zoom",null),WM(Z.view,O.moved),Gc(Z),O.event(Z).end()}}function _(I,...L){if(e.apply(this,arguments)){var C=this.__zoom,O=sr(I.changedTouches?I.changedTouches[0]:I,this),U=C.invert(O),F=C.k*(I.shiftKey?.5:2),j=n(b(y(C,F),O,U),t.apply(this,L),a);Gc(I),l>0?Ns(this).transition().duration(l).call(M,j,O,I):Ns(this).call(g.transform,j,O,I)}}function z(I,...L){if(e.apply(this,arguments)){var C=I.touches,O=C.length,U=E(this,L,I.changedTouches.length===O).event(I),F,j,N,G;for(Rg(I),j=0;j<O;++j)N=C[j],G=sr(N,this),G=[G,this.__zoom.invert(G),N.identifier],U.touch0?!U.touch1&&U.touch0[2]!==G[2]&&(U.touch1=G,U.taps=0):(U.touch0=G,F=!0,U.taps=1+!!d);d&&(d=clearTimeout(d)),F&&(U.taps<2&&(f=G[0],d=setTimeout(function(){d=null},p)),Oh(this),U.start())}}function $(I,...L){if(this.__zooming){var C=E(this,L).event(I),O=I.changedTouches,U=O.length,F,j,N,G;for(Gc(I),F=0;F<U;++F)j=O[F],N=sr(j,this),C.touch0&&C.touch0[2]===j.identifier?C.touch0[0]=N:C.touch1&&C.touch1[2]===j.identifier&&(C.touch1[0]=N);if(j=C.that.__zoom,C.touch1){var T=C.touch0[0],Z=C.touch0[1],te=C.touch1[0],Q=C.touch1[1],pe=(pe=te[0]-T[0])*pe+(pe=te[1]-T[1])*pe,V=(V=Q[0]-Z[0])*V+(V=Q[1]-Z[1])*V;j=y(j,Math.sqrt(pe/V)),N=[(T[0]+te[0])/2,(T[1]+te[1])/2],G=[(Z[0]+Q[0])/2,(Z[1]+Q[1])/2]}else if(C.touch0)N=C.touch0[0],G=C.touch0[1];else return;C.zoom("touch",n(b(j,N,G),C.extent,a))}}function H(I,...L){if(this.__zooming){var C=E(this,L).event(I),O=I.changedTouches,U=O.length,F,j;for(Rg(I),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),F=0;F<U;++F)j=O[F],C.touch0&&C.touch0[2]===j.identifier?delete C.touch0:C.touch1&&C.touch1[2]===j.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(j=sr(j,this),Math.hypot(f[0]-j[0],f[1]-j[1])<w)){var N=Ns(this).on("dblclick.zoom");N&&N.apply(this,arguments)}}}return g.wheelDelta=function(I){return arguments.length?(s=typeof I=="function"?I:zf(+I),g):s},g.filter=function(I){return arguments.length?(e=typeof I=="function"?I:zf(!!I),g):e},g.touchable=function(I){return arguments.length?(r=typeof I=="function"?I:zf(!!I),g):r},g.extent=function(I){return arguments.length?(t=typeof I=="function"?I:zf([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),g):t},g.scaleExtent=function(I){return arguments.length?(i[0]=+I[0],i[1]=+I[1],g):[i[0],i[1]]},g.translateExtent=function(I){return arguments.length?(a[0][0]=+I[0][0],a[1][0]=+I[1][0],a[0][1]=+I[0][1],a[1][1]=+I[1][1],g):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},g.constrain=function(I){return arguments.length?(n=I,g):n},g.duration=function(I){return arguments.length?(l=+I,g):l},g.interpolate=function(I){return arguments.length?(c=I,g):c},g.on=function(){var I=u.on.apply(u,arguments);return I===u?g:I},g.clickDistance=function(I){return arguments.length?(k=(I=+I)*I,g):Math.sqrt(k)},g.tapDistance=function(I){return arguments.length?(w=+I,g):w},g}const hr={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},ld=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],pj=["Enter"," ","Escape"],mj={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var cc;(function(e){e.Strict="strict",e.Loose="loose"})(cc||(cc={}));var pl;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(pl||(pl={}));var od;(function(e){e.Partial="partial",e.Full="full"})(od||(od={}));const gj={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ea;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ea||(ea={}));var uc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(uc||(uc={}));var Xe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Xe||(Xe={}));const IS={[Xe.Left]:Xe.Right,[Xe.Right]:Xe.Left,[Xe.Top]:Xe.Bottom,[Xe.Bottom]:Xe.Top},bj=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,zB=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),qv=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Vd=(e,t=[0,0])=>{const{width:n,height:s}=br(e),r=e.origin??t,i=n*r[0],a=s*r[1];return{x:e.position.x-i,y:e.position.y-a}},UB=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const s=e.reduce((r,i)=>{const a=typeof i=="string";let l=!t.nodeLookup&&!a?i:void 0;return t.nodeLookup&&(l=a?t.nodeLookup.get(i):qv(i)?i:t.nodeLookup.get(i.id)),l?(n=!0,bm(r,Ep(l,t.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?xm(s):{x:0,y:0,width:0,height:0}},Xd=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=bm(n,Ep(r)),s=!0)}),s?xm(n):{x:0,y:0,width:0,height:0}},Yv=(e,t,[n,s,r]=[0,0,1],i=!1,a=!1)=>{const l=(t.x-n)/r,c=(t.y-s)/r,u=t.width/r,d=t.height/r,f=[];for(const h of e.values()){const{measured:p,selectable:m=!0,hidden:k=!1}=h;if(a&&!m||k)continue;const w=p.width??h.width??h.initialWidth??0,g=p.height??h.height??h.initialHeight??0,{x:y,y:b}=h.internals.positionAbsolute,S=kj(l,c,u,d,y,b,w,g),M=w*g,E=i&&S>0;(!h.internals.handleBounds||E||S>=M||h.dragging)&&f.push(h)}return f},FB=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function BB(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let i;if(t!=null&&t.includeHiddenNodes){const{width:a,height:l}=br(r);i=a>0&&l>0}else i=!!(r.measured.width&&r.measured.height&&!r.hidden);i&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function HB({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},a){if(e.size===0)return!0;const l=BB(e,a),c=Xd(l),u=Xv(c,t,n,(a==null?void 0:a.minZoom)??r,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await s.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function xj({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??s;let f=a.extent||r;if(a.extent==="parent"&&!a.expandParent)if(!l)i==null||i("005",hr.error005());else{const{width:p,height:m}=br(l);p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&Rl(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const h=Rl(f)?jl(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",hr.error015())),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function $B({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=i.has(h.id),m=!p&&h.parentId&&a.find(k=>k.id===h.parentId);(p||m)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=s.filter(h=>h.deletable!==!1),d=FB(a,c);for(const h of c)l.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!r)return{edges:d,nodes:a};const f=await r({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const dc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),jl=(e={x:0,y:0},t,n)=>({x:dc(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:dc(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function yj(e,t,n){const{width:s,height:r}=br(n),{x:i,y:a}=n.internals.positionAbsolute;return jl(e,[[i,a],[i+s,a+r]],t)}const LS=(e,t,n)=>e<t?dc(Math.abs(e-t),1,t)/t:e>n?-dc(Math.abs(e-n),1,t)/t:0,Vv=(e,t,n=15,s=40)=>{const r=LS(e.x,s,t.width-s)*n,i=LS(e.y,s,t.height-s)*n;return[r,i]},bm=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Tx=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),xm=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),cd=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=qv(e)?e.internals.positionAbsolute:Vd(e,t);return{x:n,y:s,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Ep=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=qv(e)?e.internals.positionAbsolute:Vd(e,t);return{x:n,y:s,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:s+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},vj=(e,t)=>xm(bm(Tx(e),Tx(t))),kj=(e,t,n,s,r,i,a,l)=>{const c=Math.max(0,Math.min(e+n,r+a)-Math.max(e,r)),u=Math.max(0,Math.min(t+s,i+l)-Math.max(t,i));return Math.ceil(c*u)},_p=(e,t)=>kj(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),PS=e=>lr(e.width)&&lr(e.height)&&lr(e.x)&&lr(e.y),lr=e=>!isNaN(e)&&isFinite(e),wj=(e,t)=>(n,s)=>{},Qd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Wd=({x:e,y:t},[n,s,r],i=!1,a=[1,1])=>{const l={x:(e-n)/r,y:(t-s)/r};return i?Qd(l,a):l},fc=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s});function ql(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function GB(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=ql(e,n),r=ql(e,t);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof e=="object"){const s=ql(e.top??e.y??0,n),r=ql(e.bottom??e.y??0,n),i=ql(e.left??e.x??0,t),a=ql(e.right??e.x??0,t);return{top:s,right:a,bottom:r,left:i,x:i+a,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function KB(e,t,n,s,r,i){const{x:a,y:l}=fc(e,[t,n,s]),{x:c,y:u}=fc({x:e.x+e.width,y:e.y+e.height},[t,n,s]),d=r-c,f=i-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const Xv=(e,t,n,s,r,i)=>{const a=GB(i,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=dc(u,s,r),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,k=KB(e,p,m,d,t,n),w={left:Math.min(k.left-a.left,0),top:Math.min(k.top-a.top,0),right:Math.min(k.right-a.right,0),bottom:Math.min(k.bottom-a.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:d}},ud=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Rl(e){return e!=null&&e!=="parent"}function br(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Sj(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Nj(e,t={width:0,height:0},n,s,r){const i={...e},a=s.get(n);if(a){const l=a.origin||r;i.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function zS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function qB(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function YB(e){return{...mj,...e||{}}}function Ej(e){return e===null?null:e?"valid":"invalid"}function Eu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:a}=or(e),l=Wd({x:i-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},s),{x:c,y:u}=n?Qd(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const Qv=e=>({width:e.offsetWidth,height:e.offsetHeight}),_j=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},VB=["INPUT","SELECT","TEXTAREA"];function Cj(e){var s,r;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:VB.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Tj=e=>"clientX"in e,or=(e,t)=>{var i,a;const n=Tj(e),s=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,r=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},US=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:r,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/s,y:(l.top-n.top)/s,...Qv(a)}})};function Aj({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:l}){const c=e*.125+r*.375+a*.375+n*.125,u=t*.125+i*.375+l*.375+s*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Uf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function FS({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case Xe.Left:return[t-Uf(t-s,i),n];case Xe.Right:return[t+Uf(s-t,i),n];case Xe.Top:return[t,n-Uf(n-r,i)];case Xe.Bottom:return[t,n+Uf(r-n,i)]}}function Mj({sourceX:e,sourceY:t,sourcePosition:n=Xe.Bottom,targetX:s,targetY:r,targetPosition:i=Xe.Top,curvature:a=.25}){const[l,c]=FS({pos:n,x1:e,y1:t,x2:s,y2:r,c:a}),[u,d]=FS({pos:i,x1:s,y1:r,x2:e,y2:t,c:a}),[f,h,p,m]=Aj({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${s},${r}`,f,h,p,m]}function jj({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,a=Math.abs(s-t)/2,l=s<t?s+a:s-a;return[i,l,r,a]}function XB({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return s;const a=r&&n?s+1e3:s,l=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return a+l}function QB({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=bm(Ep(e),Ep(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const a={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return _p(a,xm(i))>0}const WB=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,ZB=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),JB=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",hr.error006()),t;const s=n.getEdgeId||WB;let r;return bj(e)?r={...e}:r={...e,id:s(e)},ZB(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function Rj({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,a,l]=jj({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,a,l]}const BS={[Xe.Left]:{x:-1,y:0},[Xe.Right]:{x:1,y:0},[Xe.Top]:{x:0,y:-1},[Xe.Bottom]:{x:0,y:1}},eH=({source:e,sourcePosition:t=Xe.Bottom,target:n})=>t===Xe.Left||t===Xe.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},HS=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function tH({source:e,sourcePosition:t=Xe.Bottom,target:n,targetPosition:s=Xe.Top,center:r,offset:i,stepPosition:a}){const l=BS[t],c=BS[s],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=eH({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],k,w;const g={x:0,y:0},y={x:0,y:0},[,,b,S]=jj({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(k=r.x??u.x+(d.x-u.x)*a,w=r.y??(u.y+d.y)/2):(k=r.x??(u.x+d.x)/2,w=r.y??u.y+(d.y-u.y)*a);const R=[{x:k,y:u.y},{x:k,y:d.y}],D=[{x:u.x,y:w},{x:d.x,y:w}];l[h]===p?m=h==="x"?R:D:m=h==="x"?D:R}else{const R=[{x:u.x,y:d.y}],D=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?D:R:m=l.y===p?R:D,t===s){const I=Math.abs(e[h]-n[h]);if(I<=i){const L=Math.min(i-1,i-I);l[h]===p?g[h]=(u[h]>e[h]?-1:1)*L:y[h]=(d[h]>n[h]?-1:1)*L}}if(t!==s){const I=h==="x"?"y":"x",L=l[h]===c[I],C=u[I]>d[I],O=u[I]<d[I];(l[h]===1&&(!L&&C||L&&O)||l[h]!==1&&(!L&&O||L&&C))&&(m=h==="x"?R:D)}const _={x:u.x+g.x,y:u.y+g.y},z={x:d.x+y.x,y:d.y+y.y},$=Math.max(Math.abs(_.x-m[0].x),Math.abs(z.x-m[0].x)),H=Math.max(Math.abs(_.y-m[0].y),Math.abs(z.y-m[0].y));$>=H?(k=(_.x+z.x)/2,w=m[0].y):(k=m[0].x,w=(_.y+z.y)/2)}const M={x:u.x+g.x,y:u.y+g.y},E={x:d.x+y.x,y:d.y+y.y};return[[e,...M.x!==m[0].x||M.y!==m[0].y?[M]:[],...m,...E.x!==m[m.length-1].x||E.y!==m[m.length-1].y?[E]:[],n],k,w,b,S]}function nH(e,t,n,s){const r=Math.min(HS(e,t)/2,HS(t,n)/2,s),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+r*u},${a}Q ${i},${a} ${i},${a+r*d}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${a+r*c}Q ${i},${a} ${i+r*l},${a}`}function Ax({sourceX:e,sourceY:t,sourcePosition:n=Xe.Bottom,targetX:s,targetY:r,targetPosition:i=Xe.Top,borderRadius:a=5,centerX:l,centerY:c,offset:u=20,stepPosition:d=.5}){const[f,h,p,m,k]=tH({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:l,y:c},offset:u,stepPosition:d});let w=`M${f[0].x} ${f[0].y}`;for(let g=1;g<f.length-1;g++)w+=nH(f[g-1],f[g],f[g+1],a);return w+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[w,h,p,m,k]}function $S(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function sH(e){var f;const{sourceNode:t,targetNode:n}=e;if(!$S(t)||!$S(n))return null;const s=t.internals.handleBounds||GS(t.handles),r=n.internals.handleBounds||GS(n.handles),i=KS((s==null?void 0:s.source)??[],e.sourceHandle),a=KS(e.connectionMode===cc.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!i||!a)return(f=e.onError)==null||f.call(e,"008",hr.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Xe.Bottom,c=(a==null?void 0:a.position)||Xe.Top,u=Ol(t,i,l),d=Ol(n,a,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}function GS(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function Ol(e,t,n=Xe.Left,s=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??br(e);if(s)return{x:r+a/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Xe.Top:return{x:r+a/2,y:i};case Xe.Right:return{x:r+a,y:i+l/2};case Xe.Bottom:return{x:r+a/2,y:i+l};case Xe.Left:return{x:r,y:i+l/2}}}function KS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Mx(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function rH(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((a,l)=>([l.markerStart||s,l.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const u=Mx(c,t);i.has(u)||(a.push({id:u,color:c.color||n,...c}),i.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const Oj=1e3,iH=10,Wv={nodeOrigin:[0,0],nodeExtent:ld,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},aH={...Wv,checkEquality:!0};function Zv(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function lH(e,t,n){const s=Zv(Wv,n);for(const r of e.values())if(r.parentId)ek(r,e,t,s);else{const i=Vd(r,s.nodeOrigin),a=Rl(r.extent)?r.extent:s.nodeExtent,l=jl(i,a,br(r));r.internals.positionAbsolute=l}}function oH(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],s=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&s.push(i)}return{source:n,target:s}}function Jv(e){return e==="manual"}function jx(e,t,n,s={}){var d,f;const r=Zv(aH,s),i={i:0},a=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!Jv(r.zIndexMode)?Oj:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=a.get(h.id);if(r.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const m=Vd(h,r.nodeOrigin),k=Rl(h.extent)?h.extent:r.nodeExtent,w=jl(m,k,br(h));p={...r.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:oH(h,p),z:Dj(h,l,r.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(c=!1),h.parentId&&ek(p,t,n,s,i),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function cH(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function ek(e,t,n,s,r){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=Zv(Wv,s),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}cH(e,n),r&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++r.i,d.internals.z=d.internals.z+r.i*iH),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=i&&!Jv(c)?Oj:0,{x:h,y:p,z:m}=uH(e,d,a,l,f,c),{positionAbsolute:k}=e.internals,w=h!==k.x||p!==k.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:h,y:p}:k,z:m}})}function Dj(e,t,n){const s=lr(e.zIndex)?e.zIndex:0;return Jv(n)?s:s+(e.selected?t:0)}function uH(e,t,n,s,r,i){const{x:a,y:l}=t.internals.positionAbsolute,c=br(e),u=Vd(e,n),d=Rl(e.extent)?jl(u,e.extent,c):u;let f=jl({x:a+d.x,y:l+d.y},s,c);e.extent==="parent"&&(f=yj(f,c,t));const h=Dj(e,r,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function tk(e,t,n,s=[0,0]){var a;const r=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=i.get(l.parentId))==null?void 0:a.expandedRect)??cd(c),d=vj(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var b;const d=c.internals.positionAbsolute,f=br(c),h=c.origin??s,p=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,m=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,k=Math.max(f.width,Math.round(l.width)),w=Math.max(f.height,Math.round(l.height)),g=(k-f.width)*h[0],y=(w-f.height)*h[1];(p>0||m>0||g||y)&&(r.push({id:u,type:"position",position:{x:c.position.x-p+g,y:c.position.y-m+y}}),(b=n.get(u))==null||b.forEach(S=>{e.some(M=>M.id===S.id)||r.push({id:S.id,type:"position",position:{x:S.position.x+p,y:S.position.y+m}})})),(f.width<l.width||f.height<l.height||p||m)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:k+(p?h[0]*p-g:0),height:w+(m?h[1]*m-y:0)}})}),r}function dH(e,t,n,s,r,i,a){const l=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const u=[],d=window.getComputedStyle(l),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=[];for(const p of e.values()){const m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}const k=Qv(p.nodeElement),w=m.measured.width!==k.width||m.measured.height!==k.height;if(!!(k.width&&k.height&&(w||!m.internals.handleBounds||p.force))){const y=p.nodeElement.getBoundingClientRect(),b=Rl(m.extent)?m.extent:i;let{positionAbsolute:S}=m.internals;if(m.parentId&&m.extent==="parent"){const E=t.get(m.parentId);E&&(S=yj(S,k,E))}else b&&(S=jl(S,b,k));const M={...m,measured:k,internals:{...m.internals,positionAbsolute:S,handleBounds:{source:US("source",p.nodeElement,y,f,m.id),target:US("target",p.nodeElement,y,f,m.id)}}};t.set(m.id,M),m.parentId&&ek(M,t,n,{nodeOrigin:r,zIndexMode:a}),c=!0,w&&(u.push({id:m.id,type:"dimensions",dimensions:k}),m.expandParent&&m.parentId&&h.push({id:m.id,parentId:m.parentId,rect:cd(M,r)}))}}if(h.length>0){const p=tk(h,t,n,r);u.push(...p)}return{changes:u,updatedInternals:c}}async function fH({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],s);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function qS(e,t,n,s,r,i){let a=r;const l=s.get(a)||new Map;s.set(a,l.set(n,t)),a=`${r}-${e}`;const c=s.get(a)||new Map;if(s.set(a,c.set(n,t)),i){a=`${r}-${e}-${i}`;const u=s.get(a)||new Map;s.set(a,u.set(n,t))}}function Ij(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:a=null,targetHandle:l=null}=s,c={edgeId:s.id,source:r,target:i,sourceHandle:a,targetHandle:l},u=`${r}-${a}--${i}-${l}`,d=`${i}-${l}--${r}-${a}`;qS("source",c,d,e,r,a),qS("target",c,u,e,i,l),t.set(s.id,s)}}function Lj(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Lj(n,t):!1}function YS(e,t,n){var r;let s=e;do{if((r=s==null?void 0:s.matches)!=null&&r.call(s,t))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function hH(e,t,n,s){const r=new Map;for(const[i,a]of e)if((a.selected||a.id===s)&&(!a.parentId||!Lj(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(i);l&&r.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return r}function Og({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var a,l,c;const r=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&r.push({...f,position:d.position,dragging:s})}if(!e)return[r[0],r];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:s}:r[0],r]}function pH({dragItems:e,snapGrid:t,x:n,y:s}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:s-r.distance.y},a=Qd(i,t);return{x:a.x-i.x,y:a.y-i.y}}function mH({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,k=null;function w({noDragClassName:y,handleSelector:b,domNode:S,isSelectable:M,nodeId:E,nodeClickDistance:A=0}){h=Ns(S);function R({x:$,y:H}){const{nodeLookup:I,nodeExtent:L,snapGrid:C,snapToGrid:O,nodeOrigin:U,onNodeDrag:F,onSelectionDrag:j,onError:N,updateNodePositions:G}=t();i={x:$,y:H};let T=!1;const Z=l.size>1,te=Z&&L?Tx(Xd(l)):null,Q=Z&&O?pH({dragItems:l,snapGrid:C,x:$,y:H}):null;for(const[pe,V]of l){if(!I.has(pe))continue;let q={x:$-V.distance.x,y:H-V.distance.y};O&&(q=Q?{x:Math.round(q.x+Q.x),y:Math.round(q.y+Q.y)}:Qd(q,C));let Y=null;if(Z&&L&&!V.extent&&te){const{positionAbsolute:ke}=V.internals,Ae=ke.x-te.x+L[0][0],je=ke.x+V.measured.width-te.x2+L[1][0],ae=ke.y-te.y+L[0][1],Oe=ke.y+V.measured.height-te.y2+L[1][1];Y=[[Ae,ae],[je,Oe]]}const{position:J,positionAbsolute:ce}=xj({nodeId:pe,nextPosition:q,nodeLookup:I,nodeExtent:Y||L,nodeOrigin:U,onError:N});T=T||V.position.x!==J.x||V.position.y!==J.y,V.position=J,V.internals.positionAbsolute=ce}if(m=m||T,!!T&&(G(l,!0),k&&(s||F||!E&&j))){const[pe,V]=Og({nodeId:E,dragItems:l,nodeLookup:I});s==null||s(k,l,pe,V),F==null||F(k,pe,V),E||j==null||j(k,V)}}async function D(){if(!d)return;const{transform:$,panBy:H,autoPanSpeed:I,autoPanOnNodeDrag:L}=t();if(!L){c=!1,cancelAnimationFrame(a);return}const[C,O]=Vv(u,d,I);(C!==0||O!==0)&&(i.x=(i.x??0)-C/$[2],i.y=(i.y??0)-O/$[2],await H({x:C,y:O})&&R(i)),a=requestAnimationFrame(D)}function _($){var Z;const{nodeLookup:H,multiSelectionActive:I,nodesDraggable:L,transform:C,snapGrid:O,snapToGrid:U,selectNodesOnDrag:F,onNodeDragStart:j,onSelectionDragStart:N,unselectNodesAndEdges:G}=t();f=!0,(!F||!M)&&!I&&E&&((Z=H.get(E))!=null&&Z.selected||G()),M&&F&&E&&(e==null||e(E));const T=Eu($.sourceEvent,{transform:C,snapGrid:O,snapToGrid:U,containerBounds:d});if(i=T,l=hH(H,L,T,E),l.size>0&&(n||j||!E&&N)){const[te,Q]=Og({nodeId:E,dragItems:l,nodeLookup:H});n==null||n($.sourceEvent,l,te,Q),j==null||j($.sourceEvent,te,Q),E||N==null||N($.sourceEvent,Q)}}const z=ZM().clickDistance(A).on("start",$=>{const{domNode:H,nodeDragThreshold:I,transform:L,snapGrid:C,snapToGrid:O}=t();d=(H==null?void 0:H.getBoundingClientRect())||null,p=!1,m=!1,k=$.sourceEvent,I===0&&_($),i=Eu($.sourceEvent,{transform:L,snapGrid:C,snapToGrid:O,containerBounds:d}),u=or($.sourceEvent,d)}).on("drag",$=>{const{autoPanOnNodeDrag:H,transform:I,snapGrid:L,snapToGrid:C,nodeDragThreshold:O,nodeLookup:U}=t(),F=Eu($.sourceEvent,{transform:I,snapGrid:L,snapToGrid:C,containerBounds:d});if(k=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||E&&!U.has(E))&&(p=!0),!p){if(!c&&H&&f&&(c=!0,D()),!f){const j=or($.sourceEvent,d),N=j.x-u.x,G=j.y-u.y;Math.sqrt(N*N+G*G)>O&&_($)}(i.x!==F.xSnapped||i.y!==F.ySnapped)&&l&&f&&(u=or($.sourceEvent,d),R(F))}}).on("end",$=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:H,updateNodePositions:I,onNodeDragStop:L,onSelectionDragStop:C}=t();if(m&&(I(l,!1),m=!1),r||L||!E&&C){const[O,U]=Og({nodeId:E,dragItems:l,nodeLookup:H,dragging:!1});r==null||r($.sourceEvent,l,O,U),L==null||L($.sourceEvent,O,U),E||C==null||C($.sourceEvent,U)}}}).filter($=>{const H=$.target;return!$.button&&(!y||!YS(H,`.${y}`,S))&&(!b||YS(H,b,S))});h.call(z)}function g(){h==null||h.on(".drag",null)}return{update:w,destroy:g}}function gH(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())_p(r,cd(i))>0&&s.push(i);return s}const bH=250;function xH(e,t,n,s){var l,c;let r=[],i=1/0;const a=gH(e,n,t+bH);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(s.nodeId===f.nodeId&&s.type===f.type&&s.id===f.id)continue;const{x:h,y:p}=Ol(u,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m<i?(r=[{...f,x:h,y:p}],i=m):m===i&&r.push({...f,x:h,y:p}))}}if(!r.length)return null;if(r.length>1){const u=s.type==="source"?"target":"source";return r.find(d=>d.type===u)??r[0]}return r[0]}function Pj(e,t,n,s,r,i=!1){var u,d,f;const a=s.get(e);if(!a)return null;const l=r==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...Ol(a,c,c.position,!0)}:c}function zj(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function yH(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Uj=()=>!0;function vH(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:k,onConnectEnd:w,isValidConnection:g=Uj,onReconnectEnd:y,updateConnection:b,getTransform:S,getFromHandle:M,autoPanSpeed:E,dragThreshold:A=1,handleDomNode:R}){const D=_j(e.target);let _=0,z;const{x:$,y:H}=or(e),I=zj(i,R),L=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!L||!I)return;const O=Pj(r,I,s,c,t);if(!O)return;let U=or(e,L),F=!1,j=null,N=!1,G=null;function T(){if(!d||!L)return;const[J,ce]=Vv(U,L,E);h({x:J,y:ce}),_=requestAnimationFrame(T)}const Z={...O,nodeId:r,type:I,position:O.position},te=c.get(r);let pe={inProgress:!0,isValid:null,from:Ol(te,Z,Xe.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:te,to:U,toHandle:null,toPosition:IS[Z.position],toNode:null,pointer:U};function V(){C=!0,b(pe),m==null||m(e,{nodeId:r,handleId:s,handleType:I})}A===0&&V();function q(J){if(!C){const{x:Oe,y:ye}=or(J),ge=Oe-$,be=ye-H;if(!(ge*ge+be*be>A*A))return;V()}if(!M()||!Z){Y(J);return}const ce=S();U=or(J,L),z=xH(Wd(U,ce,!1,[1,1]),n,c,Z),F||(T(),F=!0);const ke=Fj(J,{handle:z,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:a?"target":"source",isValidConnection:g,doc:D,lib:u,flowId:f,nodeLookup:c});G=ke.handleDomNode,j=ke.connection,N=yH(!!z,ke.isValid);const Ae=c.get(r),je=Ae?Ol(Ae,Z,Xe.Left,!0):pe.from,ae={...pe,from:je,isValid:N,to:ke.toHandle&&N?fc({x:ke.toHandle.x,y:ke.toHandle.y},ce):U,toHandle:ke.toHandle,toPosition:N&&ke.toHandle?ke.toHandle.position:IS[Z.position],toNode:ke.toHandle?c.get(ke.toHandle.nodeId):null,pointer:U};b(ae),pe=ae}function Y(J){if(!("touches"in J&&J.touches.length>0)){if(C){(z||G)&&j&&N&&(k==null||k(j));const{inProgress:ce,...ke}=pe,Ae={...ke,toPosition:pe.toHandle?pe.toPosition:null};w==null||w(J,Ae),i&&(y==null||y(J,Ae))}p(),cancelAnimationFrame(_),F=!1,N=!1,j=null,G=null,D.removeEventListener("mousemove",q),D.removeEventListener("mouseup",Y),D.removeEventListener("touchmove",q),D.removeEventListener("touchend",Y)}}D.addEventListener("mousemove",q),D.addEventListener("mouseup",Y),D.addEventListener("touchmove",q),D.addEventListener("touchend",Y)}function Fj(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:a,lib:l,flowId:c,isValidConnection:u=Uj,nodeLookup:d}){const f=i==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=or(e),k=a.elementFromPoint(p,m),w=k!=null&&k.classList.contains(`${l}-flow__handle`)?k:h,g={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const y=zj(void 0,w),b=w.getAttribute("data-nodeid"),S=w.getAttribute("data-handleid"),M=w.classList.contains("connectable"),E=w.classList.contains("connectableend");if(!b||!y)return g;const A={source:f?b:s,sourceHandle:f?S:r,target:f?s:b,targetHandle:f?r:S};g.connection=A;const D=M&&E&&(n===cc.Strict?f&&y==="source"||!f&&y==="target":b!==s||S!==r);g.isValid=D&&u(A),g.toHandle=Pj(b,y,S,d,n,!0)}return g}const Rx={onPointerDown:vH,isValid:Fj};function kH({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=Ns(e);function i({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const S=n(),M=b.sourceEvent.ctrlKey&&ud()?10:1,E=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*d,A=S[2]*Math.pow(2,E*M);t.scaleTo(A)};let k=[0,0];const w=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(k=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},g=b=>{const S=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const M=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],E=[M[0]-k[0],M[1]-k[1]];k=M;const A=s()*Math.max(S[2],Math.log(S[2]))*(p?-1:1),R={x:S[0]-E[0]*A,y:S[1]-E[1]*A},D=[[0,0],[c,u]];t.setViewportConstrained({x:R.x,y:R.y,zoom:S[2]},D,l)},y=hj().on("start",w).on("zoom",f?g:null).on("zoom.wheel",h?m:null);r.call(y,{})}function a(){r.on("zoom",null)}return{update:i,destroy:a,pointer:sr}}const ym=e=>({x:e.x,y:e.y,zoom:e.k}),Dg=({x:e,y:t,zoom:n})=>gm.translate(e,t).scale(n),Xi=(e,t)=>e.target.closest(`.${t}`),Bj=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),wH=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ig=(e,t=0,n=wH,s=()=>{})=>{const r=typeof t=="number"&&t>0;return r||s(),r?e.transition().duration(t).ease(n).on("end",s):e},Hj=e=>{const t=e.ctrlKey&&ud()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function SH({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Xi(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const w=sr(d),g=Hj(d),y=f*Math.pow(2,g);s.scaleTo(n,y,w,d);return}const h=d.deltaMode===1?20:1;let p=r===pl.Vertical?0:d.deltaX*h,m=r===pl.Horizontal?0:d.deltaY*h;!ud()&&d.shiftKey&&r!==pl.Vertical&&(p=d.deltaY*h,m=0),s.translateBy(n,-(p/f)*i,-(m/f)*i,{internal:!0});const k=ym(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c==null||c(d,k):(e.isPanScrolling=!0,l==null||l(d,k)),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,k),e.isPanScrolling=!1},150)}}function NH({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){const i=s.type==="wheel",a=!t&&i&&!s.ctrlKey,l=Xi(s,e);if(s.ctrlKey&&i&&l&&s.preventDefault(),a||l)return null;s.preventDefault(),n.call(this,s,r)}}function EH({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,a,l;if((i=s.sourceEvent)!=null&&i.internal)return;const r=ym(s.transform);e.mouseButton=((a=s.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((l=s.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,r))}}function _H({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var a,l;e.usedRightMouseButton=!!(n&&Bj(t,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!((l=i.sourceEvent)!=null&&l.internal)&&(r==null||r(i.sourceEvent,ym(i.transform)))}}function CH({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&Bj(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,s(!1),r)){const c=ym(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,c)},n?150:0)}}}function TH({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:u,lib:d,connectionInProgress:f}){return h=>{var g;const p=t||n,m=s&&h.ctrlKey,k=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Xi(h,`${d}-flow__node`)||Xi(h,`${d}-flow__edge`)||Xi(h,`${d}-flow__selection`)||Xi(h,`${d}-flow__nodesselection`)))return!0;if(!r&&!p&&!i&&!a&&!s||l||f&&!k||Xi(h,c)&&k||Xi(h,u)&&(!k||i&&k&&!t)||!s&&h.ctrlKey&&k)return!1;if(!s&&h.type==="touchstart"&&((g=h.touches)==null?void 0:g.length)>1)return h.preventDefault(),!1;if(!p&&!i&&!m&&k||!r&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(r)&&!r.includes(h.button)&&h.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||k||e)&&w}}function AH({domNode:e,minZoom:t,maxZoom:n,translateExtent:s,viewport:r,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect();let f=[[0,0],[d.width,d.height]];const h=typeof ResizeObserver<"u"?new ResizeObserver(H=>{const I=H[0];I&&(f=[[0,0],[I.contentRect.width,I.contentRect.height]])}):null;h==null||h.observe(e);const p=hj().extent(()=>f).scaleExtent([t,n]).translateExtent(s),m=Ns(e).call(p);S({x:r.x,y:r.y,zoom:dc(r.zoom,t,n)},[[0,0],[d.width,d.height]],s);const k=m.on("wheel.zoom"),w=m.on("dblclick.zoom");p.wheelDelta(Hj);async function g(H,I){return m?new Promise(L=>{p==null||p.interpolate((I==null?void 0:I.interpolate)==="linear"?Nu:Mh).transform(Ig(m,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>L(!0)),H)}):!1}function y({noWheelClassName:H,noPanClassName:I,onPaneContextMenu:L,userSelectionActive:C,panOnScroll:O,panOnDrag:U,panOnScrollMode:F,panOnScrollSpeed:j,preventScrolling:N,zoomOnPinch:G,zoomOnScroll:T,zoomOnDoubleClick:Z,panActivationKeyPressed:te=!1,zoomActivationKeyPressed:Q,lib:pe,onTransformChange:V,connectionInProgress:q,paneClickDistance:Y,selectionOnDrag:J}){C&&!u.isZoomingOrPanning&&b();const ce=O&&!Q&&!C;p.clickDistance(J?1/0:!lr(Y)||Y<0?0:Y);const ke=ce?SH({zoomPanValues:u,noWheelClassName:H,d3Selection:m,d3Zoom:p,panOnScrollMode:F,panOnScrollSpeed:j,zoomOnPinch:G,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):NH({noWheelClassName:H,preventScrolling:N,d3ZoomHandler:k});m.on("wheel.zoom",ke,{passive:!1});const Ae=EH({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});p.on("start",Ae);const je=_H({zoomPanValues:u,panOnDrag:U,onPaneContextMenu:!!L,onPanZoom:i,onTransformChange:V});p.on("zoom",je);const ae=CH({zoomPanValues:u,panOnDrag:U,panOnScroll:O,onPaneContextMenu:L,onPanZoomEnd:l,onDraggingChange:c});p.on("end",ae);const Oe=TH({panActivationKeyPressed:te,zoomActivationKeyPressed:Q,panOnDrag:U,zoomOnScroll:T,panOnScroll:O,zoomOnDoubleClick:Z,zoomOnPinch:G,userSelectionActive:C,noPanClassName:I,noWheelClassName:H,lib:pe,connectionInProgress:q});p.filter(Oe),Z?m.on("dblclick.zoom",w):m.on("dblclick.zoom",null)}function b(){p.on("zoom",null)}async function S(H,I,L){const C=Dg(H),O=p==null?void 0:p.constrain()(C,I,L);return O&&await g(O),O}async function M(H,I){const L=Dg(H);return await g(L,I),L}function E(H){if(m){const I=Dg(H),L=m.property("__zoom");(L.k!==H.zoom||L.x!==H.x||L.y!==H.y)&&(p==null||p.transform(m,I,null,{sync:!0}))}}function A(){const H=m?fj(m.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function R(H,I){return m?new Promise(L=>{p==null||p.interpolate((I==null?void 0:I.interpolate)==="linear"?Nu:Mh).scaleTo(Ig(m,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>L(!0)),H)}):!1}async function D(H,I){return m?new Promise(L=>{p==null||p.interpolate((I==null?void 0:I.interpolate)==="linear"?Nu:Mh).scaleBy(Ig(m,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>L(!0)),H)}):!1}function _(H){p==null||p.scaleExtent(H)}function z(H){p==null||p.translateExtent(H)}function $(H){const I=!lr(H)||H<0?0:H;p==null||p.clickDistance(I)}return{update:y,destroy:b,setViewport:M,setViewportConstrained:S,getViewport:A,scaleTo:R,scaleBy:D,setScaleExtent:_,setTranslateExtent:z,syncViewport:E,setClickDistance:$}}var hc;(function(e){e.Line="line",e.Handle="handle"})(hc||(hc={}));function MH({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const a=e-t,l=n-s,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&r&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function VS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function zi(e,t){return Math.max(0,t-e)}function Ui(e,t){return Math.max(0,e-t)}function Ff(e,t,n){return Math.max(0,t-e,e-n)}function XS(e,t){return e?!t:t}function jH(e,t,n,s,r,i,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:k,maxWidth:w,minHeight:g,maxHeight:y}=s,{x:b,y:S,width:M,height:E,aspectRatio:A}=e;let R=Math.floor(d?p-e.pointerX:0),D=Math.floor(f?m-e.pointerY:0);const _=M+(c?-R:R),z=E+(u?-D:D),$=-i[0]*M,H=-i[1]*E;let I=Ff(_,k,w),L=Ff(z,g,y);if(a){let U=0,F=0;c&&R<0?U=zi(b+R+$,a[0][0]):!c&&R>0&&(U=Ui(b+_+$,a[1][0])),u&&D<0?F=zi(S+D+H,a[0][1]):!u&&D>0&&(F=Ui(S+z+H,a[1][1])),I=Math.max(I,U),L=Math.max(L,F)}if(l){let U=0,F=0;c&&R>0?U=Ui(b+R,l[0][0]):!c&&R<0&&(U=zi(b+_,l[1][0])),u&&D>0?F=Ui(S+D,l[0][1]):!u&&D<0&&(F=zi(S+z,l[1][1])),I=Math.max(I,U),L=Math.max(L,F)}if(r){if(d){const U=Ff(_/A,g,y)*A;if(I=Math.max(I,U),a){let F=0;!c&&!u||c&&!u&&h?F=Ui(S+H+_/A,a[1][1])*A:F=zi(S+H+(c?R:-R)/A,a[0][1])*A,I=Math.max(I,F)}if(l){let F=0;!c&&!u||c&&!u&&h?F=zi(S+_/A,l[1][1])*A:F=Ui(S+(c?R:-R)/A,l[0][1])*A,I=Math.max(I,F)}}if(f){const U=Ff(z*A,k,w)/A;if(L=Math.max(L,U),a){let F=0;!c&&!u||u&&!c&&h?F=Ui(b+z*A+$,a[1][0])/A:F=zi(b+(u?D:-D)*A+$,a[0][0])/A,L=Math.max(L,F)}if(l){let F=0;!c&&!u||u&&!c&&h?F=zi(b+z*A,l[1][0])/A:F=Ui(b+(u?D:-D)*A,l[0][0])/A,L=Math.max(L,F)}}}D=D+(D<0?L:-L),R=R+(R<0?I:-I),r&&(h?_>z*A?D=(XS(c,u)?-R:R)/A:R=(XS(c,u)?-D:D)*A:d?(D=R/A,u=c):(R=D*A,c=u));const C=c?b+R:b,O=u?S+D:S;return{width:M+(c?-R:R),height:E+(u?-D:D),x:i[0]*R*(c?-1:1)+C,y:i[1]*D*(u?-1:1)+O}}const $j={width:0,height:0,x:0,y:0},RH={...$j,pointerX:0,pointerY:0,aspectRatio:1};function OH(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,l=n[0]*i,c=n[1]*a;return[[s-l,r-c],[s+i-l,r+a-c]]}function DH({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=Ns(e);let a={controlDirection:VS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:k,shouldResize:w}){let g={...$j},y={...RH};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:VS(u)};let b,S=null,M=[],E,A,R;const D=ZM().on("start",_=>{const{nodeLookup:z,transform:$,snapGrid:H,snapToGrid:I,nodeOrigin:L,paneDomNode:C}=n();if(b=z.get(t),!b)return;S=(C==null?void 0:C.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:U}=Eu(_.sourceEvent,{transform:$,snapGrid:H,snapToGrid:I,containerBounds:S});g={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},y={...g,pointerX:O,pointerY:U,aspectRatio:g.width/g.height},E=void 0,A=Rl(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(E=z.get(b.parentId)),E&&b.extent==="parent"&&(A=[[0,0],[E.measured.width,E.measured.height]]),M=[],R=void 0;for(const[F,j]of z)if(j.parentId===t&&(M.push({id:F,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent)){const N=OH(j,b,j.origin??L);R?R=[[Math.min(N[0][0],R[0][0]),Math.min(N[0][1],R[0][1])],[Math.max(N[1][0],R[1][0]),Math.max(N[1][1],R[1][1])]]:R=N}p==null||p(_,{...g})}).on("drag",_=>{const{transform:z,snapGrid:$,snapToGrid:H,nodeOrigin:I}=n(),L=Eu(_.sourceEvent,{transform:z,snapGrid:$,snapToGrid:H,containerBounds:S}),C=[];if(!b)return;const{x:O,y:U,width:F,height:j}=g,N={},G=b.origin??I,{width:T,height:Z,x:te,y:Q}=jH(y,a.controlDirection,L,a.boundaries,a.keepAspectRatio,G,A,R),pe=T!==F,V=Z!==j,q=te!==O&&pe,Y=Q!==U&&V;if(!q&&!Y&&!pe&&!V)return;const J={prevValues:{...g},startX:y.x,startY:y.y,childNodes:M.map(je=>({...je,position:{...je.position}}))};if((q||Y||G[0]===1||G[1]===1)&&(N.x=q?te:g.x,N.y=Y?Q:g.y,g.x=N.x,g.y=N.y,M.length>0)){const je=te-O,ae=Q-U;for(const Oe of M)Oe.position={x:Oe.position.x-je+G[0]*(T-F),y:Oe.position.y-ae+G[1]*(Z-j)},C.push(Oe)}if((pe||V)&&(N.width=pe&&(!a.resizeDirection||a.resizeDirection==="horizontal")?T:g.width,N.height=V&&(!a.resizeDirection||a.resizeDirection==="vertical")?Z:g.height,g.width=N.width,g.height=N.height),E&&b.expandParent){const je=G[0]*(N.width??0);N.x&&N.x<je&&(g.x=je,y.x=y.x-(N.x-je));const ae=G[1]*(N.height??0);N.y&&N.y<ae&&(g.y=ae,y.y=y.y-(N.y-ae))}const ce=MH({width:g.width,prevWidth:F,height:g.height,prevHeight:j,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),ke={...g,direction:ce};if((w==null?void 0:w(_,ke))===!1){g=J.prevValues,y.x=J.startX,y.y=J.startY,M.forEach((je,ae)=>{je.position=J.childNodes[ae].position});return}m==null||m(_,ke),s(N,C)}).on("end",_=>{k==null||k(_,{...g}),r==null||r({...g})});i.call(D)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var Gj={exports:{}},Kj={},qj={exports:{}},Yj={};/**
485
+ * @license React
486
+ * use-sync-external-store-shim.production.min.js
487
+ *
488
+ * Copyright (c) Facebook, Inc. and its affiliates.
489
+ *
490
+ * This source code is licensed under the MIT license found in the
491
+ * LICENSE file in the root directory of this source tree.
492
+ */var pc=x;function IH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var LH=typeof Object.is=="function"?Object.is:IH,PH=pc.useState,zH=pc.useEffect,UH=pc.useLayoutEffect,FH=pc.useDebugValue;function BH(e,t){var n=t(),s=PH({inst:{value:n,getSnapshot:t}}),r=s[0].inst,i=s[1];return UH(function(){r.value=n,r.getSnapshot=t,Lg(r)&&i({inst:r})},[e,n,t]),zH(function(){return Lg(r)&&i({inst:r}),e(function(){Lg(r)&&i({inst:r})})},[e]),FH(n),n}function Lg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!LH(e,n)}catch{return!0}}function HH(e,t){return t()}var $H=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?HH:BH;Yj.useSyncExternalStore=pc.useSyncExternalStore!==void 0?pc.useSyncExternalStore:$H;qj.exports=Yj;var GH=qj.exports;/**
493
+ * @license React
494
+ * use-sync-external-store-shim/with-selector.production.min.js
495
+ *
496
+ * Copyright (c) Facebook, Inc. and its affiliates.
497
+ *
498
+ * This source code is licensed under the MIT license found in the
499
+ * LICENSE file in the root directory of this source tree.
500
+ */var vm=x,KH=GH;function qH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var YH=typeof Object.is=="function"?Object.is:qH,VH=KH.useSyncExternalStore,XH=vm.useRef,QH=vm.useEffect,WH=vm.useMemo,ZH=vm.useDebugValue;Kj.useSyncExternalStoreWithSelector=function(e,t,n,s,r){var i=XH(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=WH(function(){function c(p){if(!u){if(u=!0,d=p,p=s(p),r!==void 0&&a.hasValue){var m=a.value;if(r(m,p))return f=m}return f=p}if(m=f,YH(d,p))return m;var k=s(p);return r!==void 0&&r(m,k)?m:(d=p,f=k)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,s,r]);var l=VH(e,i[0],i[1]);return QH(function(){a.hasValue=!0,a.value=l},[l]),ZH(l),l};Gj.exports=Kj;var JH=Gj.exports;const e$=vd(JH),t$={},QS=e=>{let t;const n=new Set,s=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const f=t;t=u??typeof d!="object"?d:Object.assign({},t,d),n.forEach(h=>h(t,f))}},r=()=>t,l={setState:s,getState:r,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(t$?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(s,r,l),l},n$=e=>e?QS(e):QS,{useSyncExternalStoreWithSelector:s$}=e$;function Vj(e,t=e.getState,n){const s=s$(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return x.useDebugValue(s),s}const WS=(e,t)=>{const n=n$(e),s=(r,i=t)=>Vj(n,r,i);return Object.assign(s,n),s},r$=(e,t)=>e?WS(e,t):WS;function rn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let s=0;s<n.length;s++)if(!Object.prototype.hasOwnProperty.call(t,n[s])||!Object.is(e[n[s]],t[n[s]]))return!1;return!0}const km=x.createContext(null),i$=km.Provider,Xj=hr.error001("react");function Nt(e,t){const n=x.useContext(km);if(n===null)throw new Error(Xj);return Vj(n,e,t)}function Qt(){const e=x.useContext(km);if(e===null)throw new Error(Xj);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ZS={display:"none"},a$={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Qj="react-flow__node-desc",Wj="react-flow__edge-desc",l$="react-flow__aria-live",o$=e=>e.ariaLiveMessage,c$=e=>e.ariaLabelConfig;function u$({rfId:e}){const t=Nt(o$);return o.jsx("div",{id:`${l$}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:a$,children:t})}function d$({rfId:e,disableKeyboardA11y:t}){const n=Nt(c$);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${Qj}-${e}`,style:ZS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${Wj}-${e}`,style:ZS,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(u$,{rfId:e})]})}const Zd=x.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const a=`${e}`.split("-");return o.jsx("div",{className:yn(["react-flow__panel",n,...a]),style:s,ref:i,...r,children:t})});Zd.displayName="Panel";const JS="https://reactflow.dev?utm_source=attribution";function f$({proOptions:e,position:t="bottom-right"}){return x.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:o.jsx(Zd,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${JS}`,children:o.jsx("a",{href:JS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const h$=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},Bf=e=>e.id;function p$(e,t){return rn(e.selectedNodes.map(Bf),t.selectedNodes.map(Bf))&&rn(e.selectedEdges.map(Bf),t.selectedEdges.map(Bf))}function m$({onSelectionChange:e}){const t=Qt(),{selectedNodes:n,selectedEdges:s}=Nt(h$,p$);return x.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const g$=e=>!!e.onSelectionChangeHandlers;function b$({onSelectionChange:e}){const t=Nt(g$);return e||t?o.jsx(m$,{onSelectionChange:e}):null}const Zj=[0,0],x$={x:0,y:0,zoom:1},y$=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],eN=[...y$,"rfId"],v$=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),tN={translateExtent:ld,nodeOrigin:Zj,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function k$(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Nt(v$,rn),u=Qt();x.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=tN,l()}),[]);const d=x.useRef(tN);return x.useEffect(()=>{for(const f of eN){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?s(h):f==="maxZoom"?r(h):f==="translateExtent"?i(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:YB(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},eN.map(f=>e[f])),null}function nN(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function w$(e){var s;const[t,n]=x.useState(e==="system"?null:e);return x.useEffect(()=>{if(e!=="system"){n(e);return}const r=nN(),i=()=>n(r!=null&&r.matches?"dark":"light");return i(),r==null||r.addEventListener("change",i),()=>{r==null||r.removeEventListener("change",i)}},[e]),t!==null?t:(s=nN())!=null&&s.matches?"dark":"light"}const sN=typeof document<"u"?document:null;function dd(e=null,t={target:sN,actInsideInputWithModifier:!0}){const[n,s]=x.useState(!1),r=x.useRef(!1),i=x.useRef(new Set([])),[a,l]=x.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace(/\+/g,`
501
+ `).replace(`
502
+
503
+ `,`
504
+ +`).split(`
505
+ `)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return x.useEffect(()=>{const c=(t==null?void 0:t.target)??sN,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var w,g;if(r.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!r.current||r.current&&!u)&&Cj(p))return!1;const k=iN(p.code,l);if(i.current.add(p[k]),rN(a,i.current,!1)){const y=((g=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:g[0])||p.target,b=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(r.current||!b)&&p.preventDefault(),s(!0)}},f=p=>{const m=iN(p.code,l);rN(a,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(p[m]),p.key==="Meta"&&i.current.clear(),r.current=!1},h=()=>{i.current.clear(),s(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,s]),n}function rN(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function iN(e,t){return t.includes(e)?"code":"key"}const S$=()=>{const e=Qt();return x.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:a,panZoom:l}=e.getState(),c=Xv(t,s,r,i,a,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??r,f=n.snapToGrid??i;return Wd(u,s,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),a=fc(t,n);return{x:a.x+r,y:a.y+i}}}),[])};function Jj(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const a=s.get(i.id);a?a.push(i):s.set(i.id,[i])}for(const i of t){const a=s.get(i.id);if(!a){n.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...i};for(const c of a)N$(c,l);n.push(l)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function N$(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function e5(e,t){return Jj(e,t)}function E$(e,t){return Jj(e,t)}function qa(e,t){return{id:e,type:"select",selected:t}}function mo(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const a=t.has(r);!(i.selected===void 0&&!a)&&i.selected!==a&&(n&&(i.selected=a),s.push(qa(i.id,a)))}return s}function aN({items:e=[],lookup:t}){var r;const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const l=t.get(a.id),c=((r=l==null?void 0:l.internals)==null?void 0:r.userNode)??l;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===void 0&&n.push({item:a,type:"add",index:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function lN(e){return{id:e.id,type:"remove"}}const _$=wj();function C$(e,t,n={}){return JB(e,t,{...n,onError:n.onError??_$})}const oN=e=>zB(e),T$=e=>bj(e);function t5(e){return x.forwardRef(e)}const n5=typeof window<"u"?x.useLayoutEffect:x.useEffect;function cN(e){const[t,n]=x.useState(BigInt(0)),[s]=x.useState(()=>A$(()=>n(r=>r+BigInt(1))));return n5(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function A$(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const s5=x.createContext(null);function M$({children:e}){const t=Qt(),n=x.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let k=c;for(const g of l)k=typeof g=="function"?g(k):g;let w=aN({items:k,lookup:h});for(const g of m.values())w=g(w);d&&u(k),w.length>0?f==null||f(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:y,setNodes:b}=t.getState();g&&b(y)})},[]),s=cN(n),r=x.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(aN({items:p,lookup:h}))},[]),i=cN(r),a=x.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsx(s5.Provider,{value:a,children:e})}function j$(){const e=x.useContext(s5);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const R$=e=>!!e.panZoom;function nk(){const e=S$(),t=Qt(),n=j$(),s=Nt(R$),r=x.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var g,y;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=oN(f)?f:h.get(f.id),k=m.parentId?Nj(m.position,m.measured,m.parentId,h,p):m.position,w={...m,position:k,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((y=m.measured)==null?void 0:y.height)??m.height};return cd(w)},u=(f,h,p={replace:!1})=>{a(m=>m.map(k=>{if(k.id===f){const w=typeof h=="function"?h(k):h;return p.replace&&oN(w)?w:{...k,...w}}return k}))},d=(f,h,p={replace:!1})=>{l(m=>m.map(k=>{if(k.id===f){const w=typeof h=="function"?h(k):h;return p.replace&&T$(w)?w:{...k,...w}}return k}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=i(f))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:p}=t.getState(),[m,k,w]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y:k,zoom:w}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:k,onEdgesDelete:w,triggerNodeChanges:g,triggerEdgeChanges:y,onDelete:b,onBeforeDelete:S}=t.getState(),{nodes:M,edges:E}=await $B({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:S}),A=E.length>0,R=M.length>0;if(A){const D=E.map(lN);w==null||w(E),y(D)}if(R){const D=M.map(lN);k==null||k(M),g(D)}return(R||A)&&(b==null||b({nodes:M,edges:E})),{deletedNodes:M,deletedEdges:E}},getIntersectingNodes:(f,h=!0,p)=>{const m=PS(f),k=m?f:c(f),w=p!==void 0;return k?(p||t.getState().nodes).filter(g=>{const y=t.getState().nodeLookup.get(g.id);if(y&&!m&&(g.id===f.id||!y.internals.positionAbsolute))return!1;const b=cd(w?g:y),S=_p(b,k);return h&&S>0||S>=b.width*b.height||S>=k.width*k.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const k=PS(f)?f:c(f);if(!k)return!1;const w=_p(k,h);return p&&w>0||w>=h.width*h.height||w>=k.width*k.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const k=typeof h=="function"?h(m):h;return p.replace?{...m,data:k}:{...m,data:{...m.data,...k}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const k=typeof h=="function"?h(m):h;return p.replace?{...m,data:k}:{...m,data:{...m.data,...k}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return UB(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:m.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??qB();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return x.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const uN=e=>e.selected,O$=typeof window<"u"?window:void 0;function D$({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Qt(),{deleteElements:s}=nk(),r=dd(e,{actInsideInputWithModifier:!1}),i=dd(t,{target:O$});x.useEffect(()=>{if(r){const{edges:a,nodes:l}=n.getState();s({nodes:l.filter(uN),edges:a.filter(uN)}),n.setState({nodesSelectionActive:!1})}},[r]),x.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function I$(e){const t=Qt();x.useEffect(()=>{const n=()=>{var r,i,a,l;if(!e.current||!(((i=(r=e.current).checkVisibility)==null?void 0:i.call(r))??!0))return!1;const s=Qv(e.current);(s.height===0||s.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",hr.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const wm={position:"absolute",width:"100%",height:"100%",top:0,left:0},L$=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function P$({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panActivationKeyPressed:r,panOnScrollSpeed:i=.5,panOnScrollMode:a=pl.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:d,minZoom:f,maxZoom:h,zoomActivationKeyCode:p,preventScrolling:m=!0,children:k,noWheelClassName:w,noPanClassName:g,onViewportChange:y,isControlledViewport:b,paneClickDistance:S,selectionOnDrag:M}){const E=Qt(),A=x.useRef(null),{userSelectionActive:R,lib:D,connectionInProgress:_}=Nt(L$,rn),z=dd(p),$=x.useRef();I$(A);const H=x.useCallback(I=>{y==null||y({x:I[0],y:I[1],zoom:I[2]}),b||E.setState({transform:I})},[y,b]);return x.useEffect(()=>{if(A.current){$.current=AH({domNode:A.current,minZoom:f,maxZoom:h,translateExtent:d,viewport:u,onDraggingChange:O=>E.setState(U=>U.paneDragging===O?U:{paneDragging:O}),onPanZoomStart:(O,U)=>{const{onViewportChangeStart:F,onMoveStart:j}=E.getState();j==null||j(O,U),F==null||F(U)},onPanZoom:(O,U)=>{const{onViewportChange:F,onMove:j}=E.getState();j==null||j(O,U),F==null||F(U)},onPanZoomEnd:(O,U)=>{const{onViewportChangeEnd:F,onMoveEnd:j}=E.getState();j==null||j(O,U),F==null||F(U)}});const{x:I,y:L,zoom:C}=$.current.getViewport();return E.setState({panZoom:$.current,transform:[I,L,C],domNode:A.current.closest(".react-flow")}),()=>{var O;(O=$.current)==null||O.destroy()}}},[]),x.useEffect(()=>{var I;(I=$.current)==null||I.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panActivationKeyPressed:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:z,preventScrolling:m,noPanClassName:g,userSelectionActive:R,noWheelClassName:w,lib:D,onTransformChange:H,connectionInProgress:_,selectionOnDrag:M,paneClickDistance:S})},[e,t,n,s,r,i,a,l,c,z,m,g,R,w,D,H,_,M,S]),o.jsx("div",{className:"react-flow__renderer",ref:A,style:wm,children:k})}const z$=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function U$(){const{userSelectionActive:e,userSelectionRect:t}=Nt(z$,rn);return e&&t?o.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Pg=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},F$=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function B$({isSelecting:e,selectionKeyPressed:t,selectionMode:n=od.Full,panOnDrag:s,autoPanOnSelection:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:k}){const w=x.useRef(0),g=Qt(),{userSelectionActive:y,elementsSelectable:b,dragging:S,panBy:M,autoPanSpeed:E}=Nt(F$,rn),A=b&&(e||y),R=x.useRef(null),D=x.useRef(),_=x.useRef(new Set),z=x.useRef(new Set),$=x.useRef(!1),H=x.useRef(!1),I=x.useRef({x:0,y:0}),L=x.useRef(!1),C=V=>{if(H.current||$.current||g.getState().connection.inProgress){H.current=!1,$.current=!1;return}u==null||u(V),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},O=V=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){V.preventDefault();return}d==null||d(V)},U=f?V=>f(V):void 0,F=V=>{H.current&&(V.stopPropagation(),H.current=!1)},j=V=>{var Oe,ye;if(V.pointerType==="touch"&&s!==!1&&!t)return;const{domNode:q,transform:Y}=g.getState();if(D.current=q==null?void 0:q.getBoundingClientRect(),!D.current)return;const J=V.target===R.current;if(!J&&!!V.target.closest(".nokey")||!e||!(a&&J||t)||V.button!==0||!V.isPrimary)return;(ye=(Oe=V.target)==null?void 0:Oe.setPointerCapture)==null||ye.call(Oe,V.pointerId),H.current=!1;const{x:Ae,y:je}=or(V.nativeEvent,D.current),ae=Wd({x:Ae,y:je},Y);g.setState({userSelectionRect:{width:0,height:0,startX:ae.x,startY:ae.y,x:Ae,y:je}}),J||(V.stopPropagation(),V.preventDefault())};function N(V,q){const{userSelectionRect:Y}=g.getState();if(!Y)return;const{transform:J,nodeLookup:ce,edgeLookup:ke,connectionLookup:Ae,triggerNodeChanges:je,triggerEdgeChanges:ae,defaultEdgeOptions:Oe}=g.getState(),ye={x:Y.startX,y:Y.startY},{x:ge,y:be}=fc(ye,J),$e={startX:ye.x,startY:ye.y,x:V<ge?V:ge,y:q<be?q:be,width:Math.abs(V-ge),height:Math.abs(q-be)},ft=_.current,mt=z.current;_.current=new Set(Yv(ce,$e,J,n===od.Partial,!0).map(nt=>nt.id)),z.current=new Set;const rt=(Oe==null?void 0:Oe.selectable)??!0;for(const nt of _.current){const ee=Ae.get(nt);if(ee)for(const{edgeId:ne}of ee.values()){const Ce=ke.get(ne);Ce&&(Ce.selectable??rt)&&z.current.add(ne)}}if(!zS(ft,_.current)){const nt=mo(ce,_.current,!0);je(nt)}if(!zS(mt,z.current)){const nt=mo(ke,z.current);ae(nt)}g.setState({userSelectionRect:$e,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!r||!D.current)return;const[V,q]=Vv(I.current,D.current,E);M({x:V,y:q}).then(Y=>{if(!H.current||!Y){w.current=requestAnimationFrame(G);return}const{x:J,y:ce}=I.current;N(J,ce),w.current=requestAnimationFrame(G)})}const T=()=>{cancelAnimationFrame(w.current),w.current=0,L.current=!1};x.useEffect(()=>()=>T(),[]);const Z=V=>{const{userSelectionRect:q,transform:Y,resetSelectedElements:J}=g.getState();if(!D.current||!q)return;const{x:ce,y:ke}=or(V.nativeEvent,D.current);I.current={x:ce,y:ke};const Ae=fc({x:q.startX,y:q.startY},Y);if(!H.current){const je=t?0:i;if(Math.hypot(ce-Ae.x,ke-Ae.y)<=je)return;J(),l==null||l(V)}H.current=!0,L.current||(G(),L.current=!0),N(ce,ke)},te=V=>{var q,Y;if(!A){V.target===R.current&&g.getState().connection.inProgress&&($.current=!0);return}V.button===0&&((Y=(q=V.target)==null?void 0:q.releasePointerCapture)==null||Y.call(q,V.pointerId),!y&&V.target===R.current&&g.getState().userSelectionRect&&(C==null||C(V)),g.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(c==null||c(V),g.setState({nodesSelectionActive:_.current.size>0})),T())},Q=V=>{var q,Y;(Y=(q=V.target)==null?void 0:q.releasePointerCapture)==null||Y.call(q,V.pointerId),T()},pe=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxs("div",{className:yn(["react-flow__pane",{draggable:pe,dragging:S,selection:e}]),onClick:A?void 0:Pg(C,R),onContextMenu:Pg(O,R),onWheel:Pg(U,R),onPointerEnter:A?void 0:h,onPointerMove:A?Z:p,onPointerUp:te,onPointerCancel:A?Q:void 0,onPointerDownCapture:A?j:void 0,onClickCapture:A?F:void 0,onPointerLeave:m,ref:R,style:wm,children:[k,o.jsx(U$,{})]})}function Ox({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",hr.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):r([e])}function r5({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:a}){const l=Qt(),[c,u]=x.useState(!1),d=x.useRef();return x.useEffect(()=>{if(!t)return d.current=mH({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{Ox({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var f;(f=d.current)==null||f.destroy(),d.current=void 0}},[t,l,e]),x.useEffect(()=>{t||!e.current||!d.current||d.current.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:a})},[n,s,t,i,e,r,a]),c}const H$=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function i5(){const e=Qt();return x.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=H$(a),p=r?i[0]:5,m=r?i[1]:5,k=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,g]of u){if(!h(g))continue;let y={x:g.internals.positionAbsolute.x+k,y:g.internals.positionAbsolute.y+w};r&&(y=Qd(y,i));const{position:b,positionAbsolute:S}=xj({nodeId:g.id,nextPosition:y,nodeLookup:u,nodeExtent:s,nodeOrigin:d,onError:l});g.position=b,g.internals.positionAbsolute=S,f.set(g.id,g)}c(f)},[])}const sk=x.createContext(null),$$=sk.Provider;sk.Consumer;const a5=()=>x.useContext(sk),G$=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),l5=x.createContext(null);function K$({children:e}){const t=Nt(G$,rn);return o.jsx(l5.Provider,{value:t,children:e})}function q$(){const e=x.useContext(l5);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const Y$={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},V$=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:a}=s,{fromHandle:l,toHandle:c,isValid:u}=a;if(!l&&!r)return Y$;const d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===cc.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:d&&u}};function X$({type:e="source",position:t=Xe.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var L,C;const m=a||null,k=e==="target",w=Qt(),g=a5(),{connectOnClick:y,noPanClassName:b,rfId:S}=q$(),{connectingFrom:M,connectingTo:E,clickConnecting:A,isPossibleEndHandle:R,connectionInProcess:D,clickConnectionInProcess:_,valid:z}=Nt(V$(g,m,e),rn);g||(C=(L=w.getState()).onError)==null||C.call(L,"010",hr.error010());const $=O=>{const{defaultEdgeOptions:U,onConnect:F,hasDefaultEdges:j}=w.getState(),N={...U,...O};if(j){const{edges:G,setEdges:T,onError:Z}=w.getState();T(C$(N,G,{onError:Z}))}F==null||F(N),l==null||l(N)},H=O=>{if(!g)return;const U=Tj(O.nativeEvent);if(r&&(U&&O.button===0||!U)){const F=w.getState();Rx.onPointerDown(O.nativeEvent,{handleDomNode:O.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:k,handleId:m,nodeId:g,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:(...j)=>{var N,G;return(G=(N=w.getState()).onConnectEnd)==null?void 0:G.call(N,...j)},updateConnection:F.updateConnection,onConnect:$,isValidConnection:n||((...j)=>{var N,G;return((G=(N=w.getState()).isValidConnection)==null?void 0:G.call(N,...j))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}U?d==null||d(O):f==null||f(O)},I=O=>{const{onClickConnectStart:U,onClickConnectEnd:F,connectionClickStartHandle:j,connectionMode:N,isValidConnection:G,lib:T,rfId:Z,nodeLookup:te,connection:Q}=w.getState();if(!g||!j&&!r)return;if(!j){U==null||U(O.nativeEvent,{nodeId:g,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const pe=_j(O.target),V=n||G,{connection:q,isValid:Y}=Rx.isValid(O.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:N,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:V,flowId:Z,doc:pe,lib:T,nodeLookup:te});Y&&q&&$(q);const J=structuredClone(Q);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,F==null||F(O,J),w.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${S}-${g}-${m}-${e}`,className:yn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,u,{source:!k,target:k,connectable:s,connectablestart:r,connectableend:i,clickconnecting:A,connectingfrom:M,connectingto:E,valid:z,connectionindicator:s&&(!D||R)&&(D||_?i:r)}]),onMouseDown:H,onTouchStart:H,onClick:y?I:void 0,ref:p,...h,children:c})}const In=x.memo(t5(X$));function Q$({data:e,isConnectable:t,sourcePosition:n=Xe.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(In,{type:"source",position:n,isConnectable:t})]})}function W$({data:e,isConnectable:t,targetPosition:n=Xe.Top,sourcePosition:s=Xe.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(In,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(In,{type:"source",position:s,isConnectable:t})]})}function Z$(){return null}function J$({data:e,isConnectable:t,targetPosition:n=Xe.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(In,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Cp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},dN={input:Q$,default:W$,output:J$,group:Z$};function e7(e){var t,n,s,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const t7=e=>{const{width:t,height:n,x:s,y:r}=Xd(e.nodeLookup,{filter:i=>!!i.selected});return{width:lr(t)?t:null,height:lr(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function n7({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=Qt(),{width:r,height:i,transformString:a,userSelectionActive:l}=Nt(t7,rn),c=i5(),u=x.useRef(null);x.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&i!==null;if(r5({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=s.getState().nodes.filter(k=>k.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Cp,p.key)&&(p.preventDefault(),c({direction:Cp[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:yn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:i}})})}const fN=typeof window<"u"?window:void 0,s7=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function o5({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:k,zoomActivationKeyCode:w,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:S,panOnScrollSpeed:M,panOnScrollMode:E,zoomOnDoubleClick:A,panOnDrag:R,autoPanOnSelection:D,defaultViewport:_,translateExtent:z,minZoom:$,maxZoom:H,preventScrolling:I,onSelectionContextMenu:L,noWheelClassName:C,noPanClassName:O,disableKeyboardA11y:U,onViewportChange:F,isControlledViewport:j}){const{nodesSelectionActive:N,userSelectionActive:G}=Nt(s7,rn),T=dd(u,{target:fN}),Z=dd(k,{target:fN}),te=Z||R,Q=Z||S,pe=d&&te!==!0,V=T||G||pe;return D$({deleteKeyCode:c,multiSelectionKeyCode:m}),o.jsx(P$,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:Q,panActivationKeyPressed:Z,panOnScrollSpeed:M,panOnScrollMode:E,zoomOnDoubleClick:A,panOnDrag:!T&&te,defaultViewport:_,translateExtent:z,minZoom:$,maxZoom:H,zoomActivationKeyCode:w,preventScrolling:I,noWheelClassName:C,noPanClassName:O,onViewportChange:F,isControlledViewport:j,paneClickDistance:l,selectionOnDrag:pe,children:o.jsxs(B$,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:te,autoPanOnSelection:D,isSelecting:!!V,selectionMode:f,selectionKeyPressed:T,paneClickDistance:l,selectionOnDrag:pe,children:[e,N&&o.jsx(n7,{onSelectionContextMenu:L,noPanClassName:O,disableKeyboardA11y:U})]})})}o5.displayName="FlowRenderer";const r7=x.memo(o5),i7=e=>t=>e?Yv(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function a7(e){return Nt(x.useCallback(i7(e),[e]),rn)}const l7=e=>e.updateNodeInternals;function o7(){const e=Nt(l7),[t]=x.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return x.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function c7({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=Qt(),i=x.useRef(null),a=x.useRef(null),l=x.useRef(e.sourcePosition),c=x.useRef(e.targetPosition),u=x.useRef(t),d=n&&!!e.internals.handleBounds;return x.useEffect(()=>{i.current&&!e.hidden&&(!d||a.current!==i.current)&&(a.current&&(s==null||s.unobserve(a.current)),s==null||s.observe(i.current),a.current=i.current)},[d,e.hidden]),x.useEffect(()=>()=>{a.current&&(s==null||s.unobserve(a.current),a.current=null)},[]),x.useEffect(()=>{if(i.current){const f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function u7({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:k,nodeTypes:w,nodeClickDistance:g,onError:y}){const{node:b,internals:S,isParent:M}=Nt(V=>{const q=V.nodeLookup.get(e),Y=V.parentLookup.has(e);return{node:q,internals:q.internals,isParent:Y}},rn);let E=b.type||"default",A=(w==null?void 0:w[E])||dN[E];A===void 0&&(y==null||y("003",hr.error003(E)),E="default",A=(w==null?void 0:w.default)||dN.default);const R=!!(b.draggable||l&&typeof b.draggable>"u"),D=!!(b.selectable||c&&typeof b.selectable>"u"),_=!!(b.connectable||u&&typeof b.connectable>"u"),z=!!(b.focusable||d&&typeof b.focusable>"u"),$=Qt(),H=Sj(b),I=c7({node:b,nodeType:E,hasDimensions:H,resizeObserver:f}),L=r5({nodeRef:I,disabled:b.hidden||!R,noDragClassName:h,handleSelector:b.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:g}),C=i5();if(b.hidden)return null;const O=br(b),U=e7(b),F=D||R||t||n||s||r,j=n?V=>n(V,{...S.userNode}):void 0,N=s?V=>s(V,{...S.userNode}):void 0,G=r?V=>r(V,{...S.userNode}):void 0,T=i?V=>i(V,{...S.userNode}):void 0,Z=a?V=>a(V,{...S.userNode}):void 0,te=V=>{const{selectNodesOnDrag:q,nodeDragThreshold:Y}=$.getState();D&&(!q||!R||Y>0)&&Ox({id:e,store:$,nodeRef:I}),t&&t(V,{...S.userNode})},Q=V=>{if(!(Cj(V.nativeEvent)||m)){if(pj.includes(V.key)&&D){const q=V.key==="Escape";Ox({id:e,store:$,unselect:q,nodeRef:I})}else if(R&&b.selected&&Object.prototype.hasOwnProperty.call(Cp,V.key)){V.preventDefault();const{ariaLabelConfig:q}=$.getState();$.setState({ariaLiveMessage:q["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),C({direction:Cp[V.key],factor:V.shiftKey?4:1})}}},pe=()=>{var Ae;if(m||!((Ae=I.current)!=null&&Ae.matches(":focus-visible")))return;const{transform:V,width:q,height:Y,autoPanOnNodeFocus:J,setCenter:ce}=$.getState();if(!J)return;Yv(new Map([[e,b]]),{x:0,y:0,width:q,height:Y},V,!0).length>0||ce(b.position.x+O.width/2,b.position.y+O.height/2,{zoom:V[2]})};return o.jsx("div",{className:yn(["react-flow__node",`react-flow__node-${E}`,{[p]:R},b.className,{selected:b.selected,selectable:D,parent:M,draggable:R,dragging:L}]),ref:I,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:H?"visible":"hidden",...b.style,...U},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:N,onMouseLeave:G,onContextMenu:T,onClick:te,onDoubleClick:Z,onKeyDown:z?Q:void 0,tabIndex:z?0:void 0,onFocus:z?pe:void 0,role:b.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${Qj}-${k}`,"aria-label":b.ariaLabel,...b.domAttributes,children:o.jsx($$,{value:e,children:o.jsx(A,{id:e,data:b.data,type:E,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:b.selected??!1,selectable:D,draggable:R,deletable:b.deletable??!0,isConnectable:_,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:L,dragHandle:b.dragHandle,zIndex:S.z,parentId:b.parentId,...O})})})}var d7=x.memo(u7);const f7=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function c5(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:s,onError:r}=Nt(f7,rn),i=a7(e.onlyRenderVisibleElements),a=o7();return o.jsx("div",{className:"react-flow__nodes",style:wm,children:i.map(l=>o.jsx(d7,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:r},l))})}c5.displayName="NodeRenderer";const h7=x.memo(c5);function p7(e){return Nt(x.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),a=n.nodeLookup.get(r.target);i&&a&&QB({sourceNode:i,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),rn)}const m7=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},g7=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},hN={[uc.Arrow]:m7,[uc.ArrowClosed]:g7};function b7(e){const t=Qt();return x.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(hN,e)?hN[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",hr.error009(e)),null)},[e])}const x7=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=b7(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},u5=({defaultColor:e,rfId:t})=>{const n=Nt(i=>i.edges),s=Nt(i=>i.defaultEdgeOptions),r=x.useMemo(()=>rH(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return r.length?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:r.map(i=>o.jsx(x7,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};u5.displayName="MarkerDefinitions";var y7=x.memo(u5);function d5({x:e,y:t,label:n,labelStyle:s,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=x.useState({x:1,y:0,width:0,height:0}),p=yn(["react-flow__edge-textwrapper",u]),m=x.useRef(null);return x.useEffect(()=>{if(m.current){const k=m.current.getBBox();h({x:k.x,y:k.y,width:k.width,height:k.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[r&&o.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:s,children:n}),c]}):null}d5.displayName="EdgeText";const v7=x.memo(d5);function Jd({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:yn(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,s&&lr(t)&&lr(n)?o.jsx(v7,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function pN({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Xe.Left||e===Xe.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function f5({sourceX:e,sourceY:t,sourcePosition:n=Xe.Bottom,targetX:s,targetY:r,targetPosition:i=Xe.Top}){const[a,l]=pN({pos:n,x1:e,y1:t,x2:s,y2:r}),[c,u]=pN({pos:i,x1:s,y1:r,x2:e,y2:t}),[d,f,h,p]=Aj({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${s},${r}`,d,f,h,p]}function h5(e){return x.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:k,markerStart:w,interactionWidth:g})=>{const[y,b,S]=f5({sourceX:n,sourceY:s,sourcePosition:a,targetX:r,targetY:i,targetPosition:l}),M=e.isInternal?void 0:t;return o.jsx(Jd,{id:M,path:y,labelX:b,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:k,markerStart:w,interactionWidth:g})})}const k7=h5({isInternal:!1}),p5=h5({isInternal:!0});k7.displayName="SimpleBezierEdge";p5.displayName="SimpleBezierEdgeInternal";function m5(e){return x.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Xe.Bottom,targetPosition:m=Xe.Top,markerEnd:k,markerStart:w,pathOptions:g,interactionWidth:y})=>{const[b,S,M]=Ax({sourceX:n,sourceY:s,sourcePosition:p,targetX:r,targetY:i,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),E=e.isInternal?void 0:t;return o.jsx(Jd,{id:E,path:b,labelX:S,labelY:M,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:k,markerStart:w,interactionWidth:y})})}const g5=m5({isInternal:!1}),b5=m5({isInternal:!0});g5.displayName="SmoothStepEdge";b5.displayName="SmoothStepEdgeInternal";function x5(e){return x.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return o.jsx(g5,{...n,id:s,pathOptions:x.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const w7=x5({isInternal:!1}),y5=x5({isInternal:!0});w7.displayName="StepEdge";y5.displayName="StepEdgeInternal";function v5(e){return x.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:k})=>{const[w,g,y]=Rj({sourceX:n,sourceY:s,targetX:r,targetY:i}),b=e.isInternal?void 0:t;return o.jsx(Jd,{id:b,path:w,labelX:g,labelY:y,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:k})})}const S7=v5({isInternal:!1}),k5=v5({isInternal:!0});S7.displayName="StraightEdge";k5.displayName="StraightEdgeInternal";function w5(e){return x.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:a=Xe.Bottom,targetPosition:l=Xe.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:k,markerStart:w,pathOptions:g,interactionWidth:y})=>{const[b,S,M]=Mj({sourceX:n,sourceY:s,sourcePosition:a,targetX:r,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),E=e.isInternal?void 0:t;return o.jsx(Jd,{id:E,path:b,labelX:S,labelY:M,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:k,markerStart:w,interactionWidth:y})})}const N7=w5({isInternal:!1}),S5=w5({isInternal:!0});N7.displayName="BezierEdge";S5.displayName="BezierEdgeInternal";const mN={default:S5,straight:k5,step:y5,smoothstep:b5,simplebezier:p5},gN={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},E7=(e,t,n)=>n===Xe.Left?e-t:n===Xe.Right?e+t:e,_7=(e,t,n)=>n===Xe.Top?e-t:n===Xe.Bottom?e+t:e,bN="react-flow__edgeupdater";function xN({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:a,className:yn([bN,`${bN}-${l}`]),cx:E7(t,s,e),cy:_7(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function C7({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Qt(),k=(S,M)=>{if(S.button!==0)return;const{autoPanOnConnect:E,domNode:A,connectionMode:R,connectionRadius:D,lib:_,onConnectStart:z,cancelConnection:$,nodeLookup:H,rfId:I,panBy:L,updateConnection:C}=m.getState(),O=M.type==="target",U=(N,G)=>{h(!1),f==null||f(N,n,M.type,G)},F=N=>u==null?void 0:u(n,N),j=(N,G)=>{h(!0),d==null||d(S,n,M.type),z==null||z(N,G)};Rx.onPointerDown(S.nativeEvent,{autoPanOnConnect:E,connectionMode:R,connectionRadius:D,domNode:A,handleId:M.id,nodeId:M.nodeId,nodeLookup:H,isTarget:O,edgeUpdaterType:M.type,lib:_,flowId:I,cancelConnection:$,panBy:L,isValidConnection:(...N)=>{var G,T;return((T=(G=m.getState()).isValidConnection)==null?void 0:T.call(G,...N))??!0},onConnect:F,onConnectStart:j,onConnectEnd:(...N)=>{var G,T;return(T=(G=m.getState()).onConnectEnd)==null?void 0:T.call(G,...N)},onReconnectEnd:U,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},w=S=>k(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=S=>k(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>p(!0),b=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(xN,{position:l,centerX:s,centerY:r,radius:t,onMouseDown:w,onMouseEnter:y,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&o.jsx(xN,{position:c,centerX:i,centerY:a,radius:t,onMouseDown:g,onMouseEnter:y,onMouseOut:b,type:"target"})]})}function T7({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:k,noPanClassName:w,onError:g,disableKeyboardA11y:y}){let b=Nt(ce=>ce.edgeLookup.get(e));const S=Nt(ce=>ce.defaultEdgeOptions);b=S?{...S,...b}:b;let M=b.type||"default",E=(k==null?void 0:k[M])||mN[M];E===void 0&&(g==null||g("011",hr.error011(M)),M="default",E=(k==null?void 0:k.default)||mN.default);const A=!!(b.focusable||t&&typeof b.focusable>"u"),R=typeof f<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),D=!!(b.selectable||s&&typeof b.selectable>"u"),_=x.useRef(null),[z,$]=x.useState(!1),[H,I]=x.useState(!1),L=Qt(),{zIndex:C=b.zIndex,sourceX:O,sourceY:U,targetX:F,targetY:j,sourcePosition:N,targetPosition:G}=Nt(x.useCallback(ce=>{const ke=ce.nodeLookup.get(b.source),Ae=ce.nodeLookup.get(b.target);if(!ke||!Ae)return gN;const je=sH({id:e,sourceNode:ke,targetNode:Ae,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:ce.connectionMode,onError:g}),ae=XB({selected:b.selected,zIndex:b.zIndex,sourceNode:ke,targetNode:Ae,elevateOnSelect:ce.elevateEdgesOnSelect,zIndexMode:ce.zIndexMode});return{...je||gN,zIndex:ae}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,g]),rn),T=x.useMemo(()=>b.markerStart?`url('#${Mx(b.markerStart,m)}')`:void 0,[b.markerStart,m]),Z=x.useMemo(()=>b.markerEnd?`url('#${Mx(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||O===null||U===null||F===null||j===null)return null;const te=ce=>{var ae;const{addSelectedEdges:ke,unselectNodesAndEdges:Ae,multiSelectionActive:je}=L.getState();D&&(L.setState({nodesSelectionActive:!1}),b.selected&&je?(Ae({nodes:[],edges:[b]}),(ae=_.current)==null||ae.blur()):ke([e])),r&&r(ce,b)},Q=i?ce=>{i(ce,{...b})}:void 0,pe=a?ce=>{a(ce,{...b})}:void 0,V=l?ce=>{l(ce,{...b})}:void 0,q=c?ce=>{c(ce,{...b})}:void 0,Y=u?ce=>{u(ce,{...b})}:void 0,J=ce=>{var ke;if(!y&&pj.includes(ce.key)&&D){const{unselectNodesAndEdges:Ae,addSelectedEdges:je}=L.getState();ce.key==="Escape"?((ke=_.current)==null||ke.blur(),Ae({edges:[b]})):je([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:yn(["react-flow__edge",`react-flow__edge-${M}`,b.className,w,{selected:b.selected,animated:b.animated,inactive:!D&&!r,updating:z,selectable:D}]),onClick:te,onDoubleClick:Q,onContextMenu:pe,onMouseEnter:V,onMouseMove:q,onMouseLeave:Y,onKeyDown:A?J:void 0,tabIndex:A?0:void 0,role:b.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":A?`${Wj}-${m}`:void 0,ref:_,...b.domAttributes,children:[!H&&o.jsx(E,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:D,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:O,sourceY:U,targetX:F,targetY:j,sourcePosition:N,targetPosition:G,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:T,markerEnd:Z,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),R&&o.jsx(C7,{edge:b,isReconnectable:R,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:O,sourceY:U,targetX:F,targetY:j,sourcePosition:N,targetPosition:G,setUpdateHover:$,setReconnecting:I})]})})}var A7=x.memo(T7);const M7=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function N5({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:k}){const{edgesFocusable:w,edgesReconnectable:g,elementsSelectable:y,onError:b}=Nt(M7,rn),S=p7(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(y7,{defaultColor:e,rfId:n}),S.map(M=>o.jsx(A7,{id:M,edgesFocusable:w,edgesReconnectable:g,elementsSelectable:y,noPanClassName:r,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:b,edgeTypes:s,disableKeyboardA11y:k},M))]})}N5.displayName="EdgeRenderer";const j7=x.memo(N5),yN=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function R7({children:e}){const t=Qt(),n=x.useRef(null),[s]=x.useState(()=>t.getState().transform);return n5(()=>{let r=null;const i=()=>{const a=t.getState().transform;r&&a[0]===r[0]&&a[1]===r[1]&&a[2]===r[2]||(r=a,n.current&&(n.current.style.transform=yN(a)))};return i(),t.subscribe(i)},[t]),o.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:yN(s)},children:e})}function O7(e){const t=nk(),n=x.useRef(!1);x.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const D7=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function I7(e){const t=Nt(D7),n=Qt();return x.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function L7(e){return e.connection.inProgress?{...e.connection,to:Wd(e.connection.to,e.transform)}:{...e.connection}}function P7(e){return L7}function z7(e){const t=P7();return Nt(t,rn)}const U7=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function F7({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:a,isValid:l,inProgress:c}=Nt(U7,rn);return!(i&&r&&c)?null:o.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:yn(["react-flow__connection",Ej(l)]),children:o.jsx(E5,{style:t,type:n,CustomComponent:s,isValid:l})})})}const E5=({style:e,type:t=ea.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=z7();if(!r)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:Ej(s),toNode:d,toHandle:f,pointer:p});let m="";const k={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case ea.Bezier:[m]=Mj(k);break;case ea.SimpleBezier:[m]=f5(k);break;case ea.Step:[m]=Ax({...k,borderRadius:0});break;case ea.SmoothStep:[m]=Ax(k);break;default:[m]=Rj(k)}return o.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};E5.displayName="ConnectionLine";const B7={};function vN(e=B7){x.useRef(e),Qt(),x.useEffect(()=>{},[e])}function H7(){Qt(),x.useRef(!1),x.useEffect(()=>{},[])}function _5({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:k,connectionLineComponent:w,connectionLineContainerStyle:g,selectionKeyCode:y,selectionOnDrag:b,selectionMode:S,multiSelectionKeyCode:M,panActivationKeyCode:E,zoomActivationKeyCode:A,deleteKeyCode:R,onlyRenderVisibleElements:D,elementsSelectable:_,defaultViewport:z,translateExtent:$,minZoom:H,maxZoom:I,preventScrolling:L,defaultMarkerColor:C,zoomOnScroll:O,zoomOnPinch:U,panOnScroll:F,panOnScrollSpeed:j,panOnScrollMode:N,zoomOnDoubleClick:G,panOnDrag:T,autoPanOnSelection:Z,onPaneClick:te,onPaneMouseEnter:Q,onPaneMouseMove:pe,onPaneMouseLeave:V,onPaneScroll:q,onPaneContextMenu:Y,paneClickDistance:J,nodeClickDistance:ce,onEdgeContextMenu:ke,onEdgeMouseEnter:Ae,onEdgeMouseMove:je,onEdgeMouseLeave:ae,reconnectRadius:Oe,onReconnect:ye,onReconnectStart:ge,onReconnectEnd:be,noDragClassName:$e,noWheelClassName:ft,noPanClassName:mt,disableKeyboardA11y:rt,nodeExtent:nt,rfId:ee,viewport:ne,onViewportChange:Ce,nodesDraggable:v}){return vN(e),vN(t),H7(),O7(n),I7(ne),o.jsx(r7,{onPaneClick:te,onPaneMouseEnter:Q,onPaneMouseMove:pe,onPaneMouseLeave:V,onPaneContextMenu:Y,onPaneScroll:q,paneClickDistance:J,deleteKeyCode:R,selectionKeyCode:y,selectionOnDrag:b,selectionMode:S,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:M,panActivationKeyCode:E,zoomActivationKeyCode:A,elementsSelectable:_,zoomOnScroll:O,zoomOnPinch:U,zoomOnDoubleClick:G,panOnScroll:F,panOnScrollSpeed:j,panOnScrollMode:N,panOnDrag:T,autoPanOnSelection:Z,defaultViewport:z,translateExtent:$,minZoom:H,maxZoom:I,onSelectionContextMenu:f,preventScrolling:L,noDragClassName:$e,noWheelClassName:ft,noPanClassName:mt,disableKeyboardA11y:rt,onViewportChange:Ce,isControlledViewport:!!ne,children:o.jsxs(R7,{children:[o.jsx(j7,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:a,onReconnect:ye,onReconnectStart:ge,onReconnectEnd:be,onlyRenderVisibleElements:D,onEdgeContextMenu:ke,onEdgeMouseEnter:Ae,onEdgeMouseMove:je,onEdgeMouseLeave:ae,reconnectRadius:Oe,defaultMarkerColor:C,noPanClassName:mt,disableKeyboardA11y:rt,rfId:ee}),o.jsx(F7,{style:k,type:m,component:w,containerStyle:g}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(h7,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ce,onlyRenderVisibleElements:D,noPanClassName:mt,noDragClassName:$e,disableKeyboardA11y:rt,nodeExtent:nt,rfId:ee,nodesDraggable:v}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}_5.displayName="GraphView";const $7=x.memo(_5),G7=wj(),kN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,k=new Map,w=new Map,g=s??t??[],y=n??e??[],b=d??[0,0],S=f??ld;Ij(k,w,g);const{nodesInitialized:M}=jx(y,p,m,{nodeOrigin:b,nodeExtent:S,zIndexMode:h});let E=[0,0,1];if(a&&r&&i){const A=Xd(p,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:R,y:D,zoom:_}=Xv(A,r,i,c,u,(l==null?void 0:l.padding)??.1);E=[R,D,_]}return{rfId:"1",width:r??0,height:i??0,transform:E,nodes:y,nodesInitialized:M,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:w,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:ld,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:cc.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...gj},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:G7,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:mj,zIndexMode:h,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},K7=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>r$((p,m)=>{async function k(){const{nodeLookup:w,panZoom:g,fitViewOptions:y,fitViewResolver:b,width:S,height:M,minZoom:E,maxZoom:A}=m();g&&(await HB({nodes:w,width:S,height:M,panZoom:g,minZoom:E,maxZoom:A},y),b==null||b.resolve(!0),p({fitViewResolver:null}))}return{...kN({nodes:e,edges:t,width:r,height:i,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:s,zIndexMode:h}),setNodes:w=>{const{nodeLookup:g,parentLookup:y,nodeOrigin:b,nodeExtent:S,elevateNodesOnSelect:M,fitViewQueued:E,zIndexMode:A,nodesSelectionActive:R}=m(),{nodesInitialized:D,hasSelectedNodes:_}=jx(w,g,y,{nodeOrigin:b,nodeExtent:S,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:A}),z=R&&_;E&&D?(k(),p({nodes:w,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:z})):p({nodes:w,nodesInitialized:D,nodesSelectionActive:z})},setEdges:w=>{const{connectionLookup:g,edgeLookup:y}=m();Ij(g,y,w),p({edges:w})},setDefaultNodesAndEdges:(w,g)=>{if(w){const{setNodes:y}=m();y(w),p({hasDefaultNodes:!0})}if(g){const{setEdges:y}=m();y(g),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:g,nodeLookup:y,parentLookup:b,domNode:S,nodeOrigin:M,nodeExtent:E,debug:A,fitViewQueued:R,zIndexMode:D}=m(),{changes:_,updatedInternals:z}=dH(w,y,b,S,M,E,D);z&&(lH(y,b,{nodeOrigin:M,nodeExtent:E,zIndexMode:D}),R?(k(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(_==null?void 0:_.length)>0&&(A&&console.log("React Flow: trigger node changes",_),g==null||g(_)))},updateNodePositions:(w,g=!1)=>{const y=[];let b=[];const{nodeLookup:S,triggerNodeChanges:M,connection:E,updateConnection:A,onNodesChangeMiddlewareMap:R}=m();for(const[D,_]of w){const z=S.get(D),$=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(_!=null&&_.position)),H={id:D,type:"position",position:$?{x:Math.max(0,_.position.x),y:Math.max(0,_.position.y)}:_.position,dragging:g};if(z&&E.inProgress&&E.fromNode.id===z.id){const I=Ol(z,E.fromHandle,Xe.Left,!0);A({...E,from:I})}$&&z.parentId&&y.push({id:D,parentId:z.parentId,rect:{..._.internals.positionAbsolute,width:_.measured.width??0,height:_.measured.height??0}}),b.push(H)}if(y.length>0){const{parentLookup:D,nodeOrigin:_}=m(),z=tk(y,S,D,_);b.push(...z)}for(const D of R.values())b=D(b);M(b)},triggerNodeChanges:w=>{const{onNodesChange:g,setNodes:y,nodes:b,hasDefaultNodes:S,debug:M}=m();if(w!=null&&w.length){if(S){const E=e5(w,b);y(E)}M&&console.log("React Flow: trigger node changes",w),g==null||g(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:g,setEdges:y,edges:b,hasDefaultEdges:S,debug:M}=m();if(w!=null&&w.length){if(S){const E=E$(w,b);y(E)}M&&console.log("React Flow: trigger edge changes",w),g==null||g(w)}},addSelectedNodes:w=>{const{multiSelectionActive:g,edgeLookup:y,nodeLookup:b,triggerNodeChanges:S,triggerEdgeChanges:M}=m();if(g){const E=w.map(A=>qa(A,!0));S(E);return}S(mo(b,new Set([...w]),!0)),M(mo(y))},addSelectedEdges:w=>{const{multiSelectionActive:g,edgeLookup:y,nodeLookup:b,triggerNodeChanges:S,triggerEdgeChanges:M}=m();if(g){const E=w.map(A=>qa(A,!0));M(E);return}M(mo(y,new Set([...w]))),S(mo(b,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:g}={})=>{const{edges:y,nodes:b,nodeLookup:S,triggerNodeChanges:M,triggerEdgeChanges:E}=m(),A=w||b,R=g||y,D=[];for(const z of A){if(!z.selected)continue;const $=S.get(z.id);$&&($.selected=!1),D.push(qa(z.id,!1))}const _=[];for(const z of R)z.selected&&_.push(qa(z.id,!1));M(D),E(_)},setMinZoom:w=>{const{panZoom:g,maxZoom:y}=m();g==null||g.setScaleExtent([w,y]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:g,minZoom:y}=m();g==null||g.setScaleExtent([y,w]),p({maxZoom:w})},setTranslateExtent:w=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:g,triggerNodeChanges:y,triggerEdgeChanges:b,elementsSelectable:S}=m();if(!S)return;const M=g.reduce((A,R)=>R.selected?[...A,qa(R.id,!1)]:A,[]),E=w.reduce((A,R)=>R.selected?[...A,qa(R.id,!1)]:A,[]);y(M),b(E)},setNodeExtent:w=>{const{nodes:g,nodeLookup:y,parentLookup:b,nodeOrigin:S,elevateNodesOnSelect:M,nodeExtent:E,zIndexMode:A}=m();w[0][0]===E[0][0]&&w[0][1]===E[0][1]&&w[1][0]===E[1][0]&&w[1][1]===E[1][1]||(jx(g,y,b,{nodeOrigin:S,nodeExtent:w,elevateNodesOnSelect:M,checkEquality:!1,zIndexMode:A}),p({nodeExtent:w}))},panBy:w=>{const{transform:g,width:y,height:b,panZoom:S,translateExtent:M}=m();return fH({delta:w,panZoom:S,transform:g,translateExtent:M,width:y,height:b})},setCenter:async(w,g,y)=>{const{width:b,height:S,maxZoom:M,panZoom:E}=m();if(!E)return!1;const A=typeof(y==null?void 0:y.zoom)<"u"?y.zoom:M;return await E.setViewport({x:b/2-w*A,y:S/2-g*A,zoom:A},{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),!0},cancelConnection:()=>{p({connection:{...gj}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...kN()})}},Object.is);function q7({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=x.useState(()=>K7({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(i$,{value:m,children:o.jsx(M$,{children:o.jsx(K$,{children:p})})})}function Y7({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return x.useContext(km)?o.jsx(o.Fragment,{children:e}):o.jsx(q7,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const V7={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function X7({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:k,onClickConnectStart:w,onClickConnectEnd:g,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:S,onNodeContextMenu:M,onNodeDoubleClick:E,onNodeDragStart:A,onNodeDrag:R,onNodeDragStop:D,onNodesDelete:_,onEdgesDelete:z,onDelete:$,onSelectionChange:H,onSelectionDragStart:I,onSelectionDrag:L,onSelectionDragStop:C,onSelectionContextMenu:O,onSelectionStart:U,onSelectionEnd:F,onBeforeDelete:j,connectionMode:N,connectionLineType:G=ea.Bezier,connectionLineStyle:T,connectionLineComponent:Z,connectionLineContainerStyle:te,deleteKeyCode:Q="Backspace",selectionKeyCode:pe="Shift",selectionOnDrag:V=!1,selectionMode:q=od.Full,panActivationKeyCode:Y="Space",multiSelectionKeyCode:J=ud()?"Meta":"Control",zoomActivationKeyCode:ce=ud()?"Meta":"Control",snapToGrid:ke,snapGrid:Ae,onlyRenderVisibleElements:je=!1,selectNodesOnDrag:ae,nodesDraggable:Oe,autoPanOnNodeFocus:ye,nodesConnectable:ge,nodesFocusable:be,nodeOrigin:$e=Zj,edgesFocusable:ft,edgesReconnectable:mt,elementsSelectable:rt=!0,defaultViewport:nt=x$,minZoom:ee=.5,maxZoom:ne=2,translateExtent:Ce=ld,preventScrolling:v=!0,nodeExtent:X,defaultMarkerColor:de="#b1b1b7",zoomOnScroll:xe=!0,zoomOnPinch:fe=!0,panOnScroll:P=!1,panOnScrollSpeed:oe=.5,panOnScrollMode:le=pl.Free,zoomOnDoubleClick:ve=!0,panOnDrag:Se=!0,onPaneClick:Ne,onPaneMouseEnter:ue,onPaneMouseMove:_e,onPaneMouseLeave:Me,onPaneScroll:Fe,onPaneContextMenu:De,paneClickDistance:He=1,nodeClickDistance:Ge=0,children:xt,onReconnect:Mt,onReconnectStart:Ot,onReconnectEnd:Dt,onEdgeContextMenu:Wt,onEdgeDoubleClick:zt,onEdgeMouseEnter:Ht,onEdgeMouseMove:se,onEdgeMouseLeave:Pe,reconnectRadius:Be=10,onNodesChange:it,onEdgesChange:Ze,noDragClassName:_n="nodrag",noWheelClassName:yt="nowheel",noPanClassName:Br="nopan",fitView:Hr,fitViewOptions:Os,connectOnClick:Ci,attributionPosition:is,proOptions:$r,defaultEdgeOptions:Da,elevateNodesOnSelect:Gr=!0,elevateEdgesOnSelect:Ti=!1,disableKeyboardA11y:Kr=!1,autoPanOnConnect:xr,autoPanOnNodeDrag:Ai,autoPanOnSelection:qr=!0,autoPanSpeed:Mi,connectionRadius:Ws,isValidConnection:Hn,onError:ji,style:Ri,id:Yr,nodeDragThreshold:Oi,connectionDragThreshold:Ia,viewport:Zs,onViewportChange:yr,width:xs,height:La,colorMode:fn="light",debug:vr,onScroll:Zt,ariaLabelConfig:Di,zIndexMode:W="basic",...we},Re){const B=Yr||"1",re=w$(fn),Ie=x.useCallback(at=>{at.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Zt==null||Zt(at)},[Zt]);return o.jsx("div",{"data-testid":"rf__wrapper",...we,onScroll:Ie,style:{...Ri,...V7},ref:Re,className:yn(["react-flow",r,re]),id:Yr,role:"application",children:o.jsxs(Y7,{nodes:e,edges:t,width:xs,height:La,fitView:Hr,fitViewOptions:Os,minZoom:ee,maxZoom:ne,nodeOrigin:$e,nodeExtent:X,zIndexMode:W,children:[o.jsx(k$,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:p,onConnectStart:m,onConnectEnd:k,onClickConnectStart:w,onClickConnectEnd:g,nodesDraggable:Oe,autoPanOnNodeFocus:ye,nodesConnectable:ge,nodesFocusable:be,edgesFocusable:ft,edgesReconnectable:mt,elementsSelectable:rt,elevateNodesOnSelect:Gr,elevateEdgesOnSelect:Ti,minZoom:ee,maxZoom:ne,nodeExtent:X,onNodesChange:it,onEdgesChange:Ze,snapToGrid:ke,snapGrid:Ae,connectionMode:N,translateExtent:Ce,connectOnClick:Ci,defaultEdgeOptions:Da,fitView:Hr,fitViewOptions:Os,onNodesDelete:_,onEdgesDelete:z,onDelete:$,onNodeDragStart:A,onNodeDrag:R,onNodeDragStop:D,onSelectionDrag:L,onSelectionDragStart:I,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:Br,nodeOrigin:$e,rfId:B,autoPanOnConnect:xr,autoPanOnNodeDrag:Ai,autoPanSpeed:Mi,onError:ji,connectionRadius:Ws,isValidConnection:Hn,selectNodesOnDrag:ae,nodeDragThreshold:Oi,connectionDragThreshold:Ia,onBeforeDelete:j,debug:vr,ariaLabelConfig:Di,zIndexMode:W}),o.jsx($7,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:S,onNodeContextMenu:M,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:a,connectionLineType:G,connectionLineStyle:T,connectionLineComponent:Z,connectionLineContainerStyle:te,selectionKeyCode:pe,selectionOnDrag:V,selectionMode:q,deleteKeyCode:Q,multiSelectionKeyCode:J,panActivationKeyCode:Y,zoomActivationKeyCode:ce,onlyRenderVisibleElements:je,defaultViewport:nt,translateExtent:Ce,minZoom:ee,maxZoom:ne,preventScrolling:v,zoomOnScroll:xe,zoomOnPinch:fe,zoomOnDoubleClick:ve,panOnScroll:P,panOnScrollSpeed:oe,panOnScrollMode:le,panOnDrag:Se,autoPanOnSelection:qr,onPaneClick:Ne,onPaneMouseEnter:ue,onPaneMouseMove:_e,onPaneMouseLeave:Me,onPaneScroll:Fe,onPaneContextMenu:De,paneClickDistance:He,nodeClickDistance:Ge,onSelectionContextMenu:O,onSelectionStart:U,onSelectionEnd:F,onReconnect:Mt,onReconnectStart:Ot,onReconnectEnd:Dt,onEdgeContextMenu:Wt,onEdgeDoubleClick:zt,onEdgeMouseEnter:Ht,onEdgeMouseMove:se,onEdgeMouseLeave:Pe,reconnectRadius:Be,defaultMarkerColor:de,noDragClassName:_n,noWheelClassName:yt,noPanClassName:Br,rfId:B,disableKeyboardA11y:Kr,nodeExtent:X,viewport:Zs,onViewportChange:yr,nodesDraggable:Oe}),o.jsx(b$,{onSelectionChange:H}),xt,o.jsx(f$,{proOptions:$r,position:is}),o.jsx(d$,{rfId:B,disableKeyboardA11y:Kr})]})})}var rk=t5(X7);function Q7(e){const[t,n]=x.useState(e),s=x.useCallback(r=>n(i=>e5(r,i)),[]);return[t,n,s]}function W7({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:yn(["react-flow__background-pattern",n,s])})}function Z7({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:yn(["react-flow__background-pattern","dots",t])})}var ur;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ur||(ur={}));const J7={[ur.Dots]:1,[ur.Lines]:1,[ur.Cross]:6},eG=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function C5({id:e,variant:t=ur.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=x.useRef(null),{transform:h,patternId:p}=Nt(eG,rn),m=s||J7[t],k=t===ur.Dots,w=t===ur.Cross,g=Array.isArray(n)?n:[n,n],y=[g[0]*h[2]||1,g[1]*h[2]||1],b=m*h[2],S=Array.isArray(i)?i:[i,i],M=w?[b,b]:y,E=[S[0]*h[2]+M[0]/2,S[1]*h[2]+M[1]/2],A=`${p}${e||""}`;return o.jsxs("svg",{className:yn(["react-flow__background",u]),style:{...c,...wm,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:A,x:h[0]%y[0],y:h[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:k?o.jsx(Z7,{radius:b/2,className:d}):o.jsx(W7,{dimensions:M,lineWidth:r,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}C5.displayName="Background";const tG=x.memo(C5);function nG(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function sG(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function rG(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function iG(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function aG(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Hf({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:yn(["react-flow__controls-button",t]),...n,children:e})}const lG=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function T5({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Qt(),{isInteractive:k,minZoomReached:w,maxZoomReached:g,ariaLabelConfig:y}=Nt(lG,rn),{zoomIn:b,zoomOut:S,fitView:M}=nk(),E=()=>{b(),i==null||i()},A=()=>{S(),a==null||a()},R=()=>{M(r),l==null||l()},D=()=>{m.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},_=h==="horizontal"?"horizontal":"vertical";return o.jsxs(Zd,{className:yn(["react-flow__controls",_,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??y["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(Hf,{onClick:E,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:g,children:o.jsx(nG,{})}),o.jsx(Hf,{onClick:A,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:w,children:o.jsx(sG,{})})]}),n&&o.jsx(Hf,{className:"react-flow__controls-fitview",onClick:R,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:o.jsx(rG,{})}),s&&o.jsx(Hf,{className:"react-flow__controls-interactive",onClick:D,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:k?o.jsx(aG,{}):o.jsx(iG,{})}),d]})}T5.displayName="Controls";const ik=x.memo(T5);function oG({id:e,x:t,y:n,width:s,height:r,style:i,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:k}=i||{},w=a||m||k;return o.jsx("rect",{className:yn(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:s,height:r,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const cG=x.memo(oG),uG=e=>e.nodes.map(t=>t.id),zg=e=>e instanceof Function?e:()=>e;function dG({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=cG,onClick:a}){const l=Nt(uG,rn),c=zg(t),u=zg(e),d=zg(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(hG,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:a,shapeRendering:f},h))})}function fG({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=Nt(m=>{const k=m.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const w=k.internals.userNode,{x:g,y}=k.internals.positionAbsolute,{width:b,height:S}=br(w);return{node:w,x:g,y,width:b,height:S}},rn);return!u||u.hidden||!Sj(u)?null:o.jsx(l,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:i,shapeRendering:a,onClick:c,id:u.id})}const hG=x.memo(fG);var pG=x.memo(dG);const mG=200,gG=150,bG=e=>!e.hidden,xG=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};let n=!1;for(const s of e.nodeLookup.values())if(!s.hidden){n=!0;break}return{viewBB:t,boundingRect:n?vj(Xd(e.nodeLookup,{filter:bG}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},wN=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,yG=(e,t)=>wN(e.viewBB,t.viewBB)&&wN(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,vG="react-flow__minimap-desc";function A5({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:k=!1,zoomable:w=!1,ariaLabel:g,inversePan:y,zoomStep:b=1,offsetScale:S=5}){const M=Qt(),E=x.useRef(null),{boundingRect:A,panZoom:R,viewBB:D,rfId:_,translateExtent:z,flowWidth:$,flowHeight:H,ariaLabelConfig:I}=Nt(xG,yG),L=(e==null?void 0:e.width)??mG,C=(e==null?void 0:e.height)??gG,O=A.width/L,U=A.height/C,F=Math.max(O,U),j=F*L,N=F*C,G=S*F,T=A.x-(j-A.width)/2-G,Z=A.y-(N-A.height)/2-G,te=j+G*2,Q=N+G*2,pe=`${vG}-${_}`,V=x.useRef(0),q=x.useRef();V.current=F,x.useEffect(()=>{const Ae=M.getState().panZoom;if(E.current&&Ae)return q.current=kH({domNode:E.current,panZoom:Ae,getTransform:()=>M.getState().transform,getViewScale:()=>V.current}),()=>{var je;(je=q.current)==null||je.destroy()}},[R]),x.useEffect(()=>{var Ae;(Ae=q.current)==null||Ae.update({translateExtent:z,width:$,height:H,inversePan:y,pannable:k,zoomStep:b,zoomable:w})},[k,w,y,b,z,$,H]);const Y=p?Ae=>{var Oe;const[je,ae]=((Oe=q.current)==null?void 0:Oe.pointer(Ae))||[0,0];p(Ae,{x:je,y:ae})}:void 0,J=x.useCallback((Ae,je)=>{const ae=M.getState().nodeLookup.get(je).internals.userNode;m==null||m(Ae,ae)},[m]),ce=m?J:void 0,ke=g??I["minimap.ariaLabel"];return o.jsx(Zd,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*F:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:yn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:L,height:C,viewBox:`${T} ${Z} ${te} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":pe,ref:E,onClick:Y,children:[ke&&o.jsx("title",{id:pe,children:ke}),o.jsx(pG,{onClick:ce,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${T-G},${Z-G}h${te+G*2}v${Q+G*2}h${-te-G*2}z
506
+ M${D.x},${D.y}h${D.width}v${D.height}h${-D.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}A5.displayName="MiniMap";x.memo(A5);const kG=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,wG={[hc.Line]:"right",[hc.Handle]:"bottom-right"};function SG({nodeId:e,position:t,variant:n=hc.Handle,className:s,style:r=void 0,children:i,color:a,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:k,onResize:w,onResizeEnd:g}){const y=a5(),b=typeof e=="string"?e:y,S=Qt(),M=x.useRef(null),E=n===hc.Handle,A=Nt(x.useCallback(kG(E&&p),[E,p]),rn),R=x.useRef(null),D=t??wG[n];x.useEffect(()=>{if(!(!M.current||!b))return R.current||(R.current=DH({domNode:M.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:z,transform:$,snapGrid:H,snapToGrid:I,nodeOrigin:L,domNode:C}=S.getState();return{nodeLookup:z,transform:$,snapGrid:H,snapToGrid:I,nodeOrigin:L,paneDomNode:C}},onChange:(z,$)=>{const{triggerNodeChanges:H,nodeLookup:I,parentLookup:L,nodeOrigin:C}=S.getState(),O=[],U={x:z.x,y:z.y},F=I.get(b);if(F&&F.expandParent&&F.parentId){const j=F.origin??C,N=z.width??F.measured.width??0,G=z.height??F.measured.height??0,T={id:F.id,parentId:F.parentId,rect:{width:N,height:G,...Nj({x:z.x??F.position.x,y:z.y??F.position.y},{width:N,height:G},F.parentId,I,j)}},Z=tk([T],I,L,C);O.push(...Z),U.x=z.x?Math.max(j[0]*N,z.x):void 0,U.y=z.y?Math.max(j[1]*G,z.y):void 0}if(U.x!==void 0&&U.y!==void 0){const j={id:b,type:"position",position:{...U}};O.push(j)}if(z.width!==void 0&&z.height!==void 0){const N={id:b,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};O.push(N)}for(const j of $){const N={...j,type:"position"};O.push(N)}H(O)},onEnd:({width:z,height:$})=>{const H={id:b,type:"dimensions",resizing:!1,dimensions:{width:z,height:$}};S.getState().triggerNodeChanges([H])}})),R.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:k,onResize:w,onResizeEnd:g,shouldResize:m}),()=>{var z;(z=R.current)==null||z.destroy()}},[D,l,c,u,d,f,k,w,g,m]);const _=D.split("-");return o.jsx("div",{className:yn(["react-flow__resize-control","nodrag",..._,n,s]),ref:M,style:{...r,scale:A,...a&&{[E?"backgroundColor":"borderColor"]:a}},children:i})}x.memo(SG);function Gs({className:e}){return o.jsx("div",{className:me("animate-pulse rounded bg-neutral-800/70",e)})}function Sm({rows:e=5,className:t}){return o.jsx("div",{className:me("space-y-1.5 p-2",t),"aria-busy":"true",children:Array.from({length:e},(n,s)=>o.jsxs("div",{className:"flex items-center gap-2 rounded-lg px-2 py-1.5",children:[o.jsx(Gs,{className:"h-4 w-4 shrink-0 rounded"}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[o.jsx(Gs,{className:me("h-3",s%3===0?"w-2/3":"w-1/2")}),o.jsx(Gs,{className:"h-2.5 w-1/3"})]})]},s))})}function M5({count:e=6,className:t}){return o.jsx("div",{className:me("grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3",t),"aria-busy":"true",children:Array.from({length:e},(n,s)=>o.jsxs("div",{className:"space-y-2 rounded-xl border border-edge/[0.06] bg-neutral-900/40 p-3",children:[o.jsx(Gs,{className:"h-3.5 w-1/2"}),o.jsx(Gs,{className:"h-2.5 w-full"}),o.jsx(Gs,{className:"h-2.5 w-4/5"}),o.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[o.jsx(Gs,{className:"h-4 w-12 rounded-full"}),o.jsx(Gs,{className:"h-4 w-8 rounded-full"})]})]},s))})}function NG({lines:e=8,className:t}){return o.jsx("div",{className:me("space-y-2 p-3",t),"aria-busy":"true",children:Array.from({length:e},(n,s)=>o.jsx(Gs,{className:me("h-3",s%4===3?"w-1/2":s%5===0?"w-3/4":"w-full")},s))})}function EG(){return o.jsxs("div",{className:"flex-1 overflow-hidden p-3","aria-busy":"true",children:[o.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[o.jsx(Gs,{className:"h-6 w-24 rounded-lg"}),o.jsx(Gs,{className:"h-6 w-16 rounded-lg"}),o.jsx(Gs,{className:"h-6 w-20 rounded-lg"})]}),o.jsx(M5,{count:6})]})}function ml({checked:e,onChange:t,title:n,disabled:s}){return o.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-disabled":s||void 0,title:n,disabled:s,onClick:r=>{r.stopPropagation(),!s&&t(!e)},className:me("nodrag relative h-4 w-7 shrink-0 rounded-full transition-colors duration-200",e?"bg-emerald-500/80":"bg-neutral-600",s&&"opacity-50"),children:o.jsx("span",{className:me("absolute top-0.5 h-3 w-3 rounded-full bg-white shadow transition-all duration-200",e?"left-3.5":"left-0.5")})})}const _G={builtin:"bg-amber-900/40 text-amber-300",user:"bg-blue-900/40 text-blue-300",project:"bg-emerald-900/40 text-emerald-300"};function $f(){window.dispatchEvent(new Event("weave:rules-changed"))}function CG({projectId:e,renderRules:t}){const n=We(),[s,r]=x.useState(null),[i,a]=x.useState(null),[l,c]=x.useState(new Set),[u,d]=x.useState(null),{show:f}=an(),h=xn(),p=x.useCallback(()=>{Promise.all([Ee.listHookPlugins(e),e===void 0?Promise.resolve(null):Ee.listHookPlugins()]).then(([y,b])=>{r(y),a(b)}).catch(()=>r(y=>y??[]))},[e]);x.useEffect(()=>(p(),Aa(()=>{p(),$f()},["plugin.reloaded","plugin.toggled"])),[p]);const m=(y,b)=>{h.run(`toggle:${y.id}`,async()=>{await Ee.toggleHookPlugin(y.id,b,e),p(),$f()},{fail:S=>n("hooks.plugins.toggleFail",{error:Ye(S)})})},k=async y=>{await h.run(`uninstall:${y.id}`,async()=>{await Ee.uninstallHookPlugin(y.id),p(),$f(),f("success",n("hooks.plugins.uninstallOk",{id:y.id}))},{fail:b=>n("hooks.plugins.uninstallFail",{error:Ye(b)})})},w=()=>{h.run("rescan",async()=>{const y=await Ee.rescanHookPlugins();p(),$f(),f("success",n("hooks.plugins.rescanOk",{n:y}))},{fail:y=>n("hooks.plugins.rescanFail",{error:Ye(y)})})};if(s===null)return null;const g=new Map((i??[]).map(y=>[y.id,y.status]));return o.jsxs("div",{className:"space-y-2",children:[s.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:n("hooks.plugins.empty")}),s.map(y=>{const b=g.get(y.id),S=e!==void 0&&b!==void 0&&b!==y.status,M=l.has(y.id),E=!!t&&y.ruleCount>0;return o.jsxs("div",{className:"rounded-md border border-edge/[0.06] bg-edge/[0.015] overflow-hidden",children:[o.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[E&&o.jsx("button",{type:"button",onClick:()=>c(A=>fl(A,y.id)),title:n(M?"hooks.plugins.expand":"hooks.plugins.collapse"),className:"shrink-0 text-neutral-500 hover:text-neutral-300 [&_svg]:pointer-events-none",children:M?o.jsx(ns,{className:"h-3.5 w-3.5"}):o.jsx(Bn,{className:"h-3.5 w-3.5"})}),o.jsx(Xu,{className:me("h-3.5 w-3.5 shrink-0",y.status==="active"?"text-emerald-400":y.status==="disabled"?"text-neutral-600":"text-red-400")}),o.jsx("span",{className:"shrink-0 text-xs font-medium text-neutral-200",children:y.name}),o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",children:y.id}),o.jsx(Qe,{className:me("shrink-0",_G[y.scope]),children:y.scope}),o.jsxs("span",{className:"shrink-0 text-[10px] text-neutral-600",children:["v",y.version]}),o.jsx("span",{className:"shrink-0 text-[11px] text-neutral-500",children:n("hooks.plugins.rules",{n:y.ruleCount})}),y.status==="rejected"&&y.error&&o.jsx("span",{className:"min-w-0 truncate text-[11px] text-red-400/90",title:y.error,children:y.error}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[e!==void 0&&y.status!=="rejected"&&b!==void 0&&o.jsx(Qe,{variant:S?"warning":"default",title:n("hooks.plugins.projectHint"),children:n(S?"hooks.plugins.projectOverride":"hooks.plugins.followGlobal")}),e===void 0&&o.jsx("button",{type:"button",onClick:()=>d(y),title:n("hooks.plugins.uninstallTip"),className:"rounded px-1 text-[11px] text-neutral-600 hover:text-red-400 [&_svg]:pointer-events-none",children:o.jsx(ut,{state:h.stateOf(`uninstall:${y.id}`),className:"h-3 w-3",icon:o.jsx("span",{className:"text-[11px]",children:"✕"})})}),o.jsx(ml,{checked:y.status!=="disabled",onChange:A=>void m(y,A),title:y.status==="rejected"?n("hooks.plugins.rejectedTip"):n("hooks.plugins.toggleTip")})]})]}),E&&!M&&o.jsx("div",{className:"px-2 pb-2 pl-7",children:t(y)})]},y.id)}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[o.jsxs("p",{className:"flex items-center gap-1 text-[10px] text-neutral-600",children:[o.jsx(Y1,{className:"h-3 w-3"}),n("hooks.plugins.hotReload")]}),o.jsxs("button",{type:"button",onClick:w,title:n("hooks.plugins.rescanTip"),className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-neutral-500 hover:bg-edge/[0.06] hover:text-neutral-200",children:[o.jsx(ut,{state:h.stateOf("rescan"),className:"h-3 w-3",icon:o.jsx(Y1,{className:"h-3 w-3"})}),n("hooks.plugins.rescan")]})]}),o.jsx(wi,{open:u!==null,title:n("hooks.plugins.uninstallTitle"),message:u?n("hooks.plugins.uninstallConfirm",{id:u.id}):"",confirmLabel:n("common.confirm"),onConfirm:()=>{u&&k(u)},onClose:()=>d(null)})]})}const j5="weave:canvas-bg",R5=[{id:"lines",icon:$P,label:"common.canvas.lines"},{id:"dots",icon:GP,label:"common.canvas.dots"},{id:"cross",icon:Bd,label:"common.canvas.cross"},{id:"none",icon:RA,label:"common.canvas.none"}],TG={none:"bg-neutral-950/40",sky:"bg-sky-950/55",violet:"bg-violet-950/55",emerald:"bg-emerald-950/55",amber:"bg-amber-950/55"},O5=[{id:"none",dot:"bg-neutral-500",label:"common.canvas.tintNone"},{id:"sky",dot:"bg-sky-500",label:"common.canvas.tintSky"},{id:"violet",dot:"bg-violet-500",label:"common.canvas.tintViolet"},{id:"emerald",dot:"bg-emerald-500",label:"common.canvas.tintEmerald"},{id:"amber",dot:"bg-amber-500",label:"common.canvas.tintAmber"}],AG={lines:{variant:ur.Lines,gap:16,size:1},dots:{variant:ur.Dots,gap:14,size:1},cross:{variant:ur.Cross,gap:24,size:6}},MG="rgb(var(--w-edge) / 0.12)";function jG(){const e={pattern:"lines",tint:"none"};try{const t=JSON.parse(localStorage.getItem(j5)??"null");return{pattern:R5.some(n=>n.id===(t==null?void 0:t.pattern))?t.pattern:e.pattern,tint:O5.some(n=>n.id===(t==null?void 0:t.tint))?t.tint:e.tint}}catch{return e}}let Nm=jG();const Dx=new Set;function D5(e){Nm=e;try{localStorage.setItem(j5,JSON.stringify(e))}catch{}for(const t of Dx)t()}function RG(e){D5({...Nm,pattern:e})}function OG(e){D5({...Nm,tint:e})}function DG(e){return Dx.add(e),()=>Dx.delete(e)}function IG(){return Nm}function I5(){return x.useSyncExternalStore(DG,IG)}function ak(){return TG[I5().tint]}function lk(){const{pattern:e,tint:t}=I5(),n=We(),s=e==="none"?null:AG[e];return o.jsxs(o.Fragment,{children:[s&&o.jsx(tG,{variant:s.variant,gap:s.gap,size:s.size,color:MG}),o.jsxs(Zd,{position:"bottom-right",onClick:r=>r.stopPropagation(),className:"nopan flex items-center gap-0.5 rounded-md border border-edge/[0.08] bg-neutral-900/85 p-0.5 opacity-70 shadow-mac-sm backdrop-blur-sm transition-opacity hover:opacity-100 max-lg:opacity-100",children:[R5.map(({id:r,icon:i,label:a})=>o.jsx("button",{type:"button",title:n(a),"aria-label":n(a),"aria-pressed":e===r,onClick:()=>RG(r),className:me("flex h-5 w-5 items-center justify-center rounded",e===r?"bg-edge/[0.14] text-neutral-100":"text-neutral-500 hover:text-neutral-200"),children:o.jsx(i,{size:12})},r)),o.jsx("span",{className:"mx-0.5 h-3 w-px bg-edge/[0.12]"}),O5.map(({id:r,dot:i,label:a})=>o.jsx("button",{type:"button",title:n(a),"aria-label":n(a),"aria-pressed":t===r,onClick:()=>OG(r),className:me("flex h-5 w-5 items-center justify-center rounded-full border",t===r?"border-edge/50":"border-transparent hover:border-edge/25"),children:o.jsx("span",{className:me("h-2.5 w-2.5 rounded-full",i)})},r))]})]})}const L5=["log","webhook","inject","manual","plugin"],Tp={log:"hooks.handler.log",webhook:"hooks.handler.webhook",inject:"hooks.handler.inject",manual:"hooks.handler.manual",plugin:"hooks.handler.plugin"},LG={log:"hooks.handlerLogTip",webhook:"hooks.handlerWebhookTip",inject:"hooks.handlerInjectTip",manual:"hooks.handlerManualTip",plugin:"hooks.handlerPluginTip"},ok={log:BA,webhook:s6,inject:tx,manual:KP,plugin:ix},PG=["hook-event","claude-event"],zG=[...nn,"any"];function Ug(e){return e instanceof Error?e.message:String(e)}function SN(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function NN(){window.dispatchEvent(new Event("weave:rules-changed"))}function UG({data:e}){return o.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-neutral-900/90 px-2.5 py-1.5 shadow-mac-sm",children:[o.jsx(om,{className:"h-3 w-3 shrink-0 text-amber-400"}),o.jsx("span",{className:"text-[11px] font-medium text-neutral-200",children:e.event}),o.jsx(In,{type:"source",position:Xe.Right,className:"!bg-amber-400/80"})]})}function FG({data:e}){const t=We(),n=e.rule,s=ok[n.handler.type],r=Wu(n.source),i=r.kind==="webhook"?r.routeId:r.event;return o.jsxs("div",{className:me("w-[220px] rounded-lg border bg-neutral-900/90 px-3 py-2 shadow-mac-sm transition-opacity",n.enabled?"border-blue-500/40":"border-edge/[0.08] opacity-60"),children:[o.jsx(In,{type:"target",position:Xe.Left,className:"!bg-blue-400/80"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-100",children:n.name})}),o.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[o.jsxs(Qe,{variant:"command",className:"gap-1",children:[o.jsx(s,{className:"h-3 w-3"}),t(Tp[n.handler.type])]}),o.jsxs("span",{className:"truncate text-[10px] text-neutral-500",title:e.scopeLabel,children:[i," · ",e.scopeLabel]})]}),o.jsx(In,{type:"source",position:Xe.Right,className:"!bg-blue-400/80"})]})}function BG({data:e}){const t=We(),n=ok[e.handlerType];return o.jsxs("div",{className:"flex w-[170px] items-center gap-2 rounded-lg border border-edge/[0.08] bg-neutral-900/90 px-3 py-2 shadow-mac-sm",children:[o.jsx(In,{type:"target",position:Xe.Left,className:"!bg-blue-400/80"}),o.jsx(n,{className:"h-3.5 w-3.5 shrink-0 text-purple-300"}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-neutral-200",children:t(Tp[e.handlerType])}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:e.count}),o.jsx(In,{type:"source",position:Xe.Right,className:"!bg-blue-400/80"})]})}const HG={source:UG,rule:FG,handler:BG},$G=[],Fg={source:0,rule:320,handler:640},Bg=100;function GG(e,t,n){const s=[],r=[],i=new Set;for(const a of e){const l=Wu(a.source);l.kind==="hook-event"&&i.add(l.event)}return QA.filter(a=>i.has(a)).forEach((a,l)=>{s.push({id:`src:${a}`,type:"source",position:{x:Fg.source,y:l*Bg},data:{event:a}})}),e.forEach((a,l)=>{const c=a.projectId===null?n("hooks.scopeGlobal"):t.get(a.projectId)??n("hooks.scopeProjectId",{id:a.projectId});s.push({id:`rule:${a.id}`,type:"rule",position:{x:Fg.rule,y:l*Bg},data:{rule:a,scopeLabel:c}});const u=Wu(a.source);u.kind==="hook-event"&&r.push({id:`e:${u.event}->${a.id}`,source:`src:${u.event}`,target:`rule:${a.id}`,data:{ruleId:a.id}}),r.push({id:`e:${a.id}->${a.handler.type}`,source:`rule:${a.id}`,target:`h:${a.handler.type}`,data:{ruleId:a.id}})}),L5.filter(a=>e.some(l=>l.handler.type===a)).forEach((a,l)=>{s.push({id:`h:${a}`,type:"handler",position:{x:Fg.handler,y:l*Bg},data:{handlerType:a,count:e.filter(c=>c.handler.type===a).length}})}),{nodes:s,edges:r}}function KG(e){return{name:"",projectId:e,sourceKind:"hook-event",harness:"claude",event:"PostToolUse",toolNames:"",pathGlobs:"",crossProjectOnly:!1,handlerType:"manual",template:"",url:"",secret:"",pluginId:"",pluginHandlerType:"",record:!0,enabled:!0}}function qG(e){const t=e.handler,n=Wu(e.source);return{name:e.name,projectId:e.projectId,sourceKind:e.source.kind==="claude-event"?"claude-event":"hook-event",harness:u6(e.source)??"claude",event:n.kind==="hook-event"?n.event:"PostToolUse",toolNames:(e.filter.toolNames??[]).join(", "),pathGlobs:(e.filter.pathGlobs??[]).join(", "),crossProjectOnly:e.filter.crossProjectOnly??!1,handlerType:t.type,template:t.type==="inject"||t.type==="manual"?t.template:"",url:t.type==="webhook"?t.url:"",secret:t.type==="webhook"?t.secret??"":"",pluginId:t.type==="plugin"?t.pluginId:"",pluginHandlerType:t.type==="plugin"?t.handlerType:"",record:e.record,enabled:e.enabled}}function YG(){const e=We(),{show:t}=an(),n=xn(),[s,r]=x.useState(null),i=x.useCallback(()=>{Ee.getCapture().then(r).catch(()=>{})},[]);if(x.useEffect(()=>ki("capture",i),[i]),s===null||s.length===0)return null;const a=(l,c)=>{n.run(`capture:${l.harness}`,async()=>{const u=await Ee.putCapture(l.harness,c);r(d=>(d==null?void 0:d.map(f=>f.harness===u.harness?u:f))??d),t("success",e(c?"hooks.capture.onOk":"hooks.capture.offOk"))},{fail:u=>e("hooks.capture.fail",{error:Ye(u)})})};return o.jsxs(Ma,{children:[o.jsxs(_l,{className:"flex-row items-center gap-2 space-y-0",children:[o.jsx(Cl,{className:"text-sm",children:e("hooks.capture.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:e("hooks.capture.hint")})]}),o.jsxs(Tl,{className:"space-y-2",children:[s.map(l=>o.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-edge/[0.06] bg-edge/[0.015] px-2 py-1.5",children:[o.jsx(om,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),o.jsx("span",{className:"shrink-0 text-xs font-medium text-neutral-200",children:Kn(l.harness).label}),l.installed&&!l.helperPresent&&o.jsx(Qe,{variant:"warning",title:e("hooks.capture.halfTip"),children:e("hooks.capture.half")}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-2",children:[o.jsx(ut,{state:n.stateOf(`capture:${l.harness}`),className:"h-3 w-3"}),o.jsx(ml,{checked:l.installed,onChange:c=>a(l,c),title:e("hooks.capture.toggleTip")})]})]},l.harness)),o.jsx("p",{className:"text-[10px] text-neutral-600",children:e("hooks.capture.note")})]})]})}function VG({projectId:e,mode:t}){const n=We(),s=ak(),[r,i]=x.useState(null),[a,l]=x.useState(new Map),[c,u]=x.useState([]),[d,f]=x.useState(null),[h,p]=x.useState(null),[m,k]=x.useState(null),[w,g]=x.useState(null),y=x.useMemo(()=>new Map(c.map(N=>[N.id,N.name])),[c]),b=x.useCallback(async()=>{try{const N=t==="project",[G,T]=await Promise.all([Ee.listHooksRules(N?e:void 0),N?Ee.listHookPlugins(e):Promise.resolve(null)]);i(G),l(new Map((T==null?void 0:T.map(Z=>[Z.id,Z.status]))??[]))}catch(N){f(Ug(N))}},[t,e]),S=x.useCallback(N=>t==="project"&&N.pluginId!=null?a.get(N.pluginId)==="active":N.enabled,[t,a]);x.useEffect(()=>{b(),Ee.listProjects().then(u).catch(()=>{})},[b]),x.useEffect(()=>{const N=()=>{b()};return window.addEventListener("weave:rules-changed",N),()=>window.removeEventListener("weave:rules-changed",N)},[b]);const M=x.useCallback(async N=>{if(w!==N){g(N);return}try{await Ee.deleteHookRule(N),g(null),(h==null?void 0:h.editingId)===N&&p(null),NN()}catch(G){f(Ug(G))}},[w,h]),[E,A,R]=Q7([]),D=x.useMemo(()=>r?GG(r.filter(S),y,n):null,[r,S,y,n]),_=(D==null?void 0:D.edges)??$G;x.useEffect(()=>{D&&A(N=>{const G=new Map(N.map(T=>[T.id,T.position]));return D.nodes.map(T=>{const Z=G.get(T.id);return Z?{...T,position:Z}:T})})},[D,A]);const z=()=>{k(null),p({editingId:null,state:KG(t==="project"?e:null)})},$=N=>{k(null),p({editingId:N.id,state:qG(N)})},H=()=>{p(null),k(null)},I=N=>p(G=>G&&{...G,state:{...G.state,...N}}),L=N=>p(G=>{if(!G)return G;let T=G.state.event;return N==="inject"&&!Eg.includes(T)&&(T="PostToolUse"),{...G,state:{...G.state,handlerType:N,event:T,record:N==="log"?!1:G.state.record}}}),C=()=>{h&&(k(null),p({...h,state:{...h.state,name:n("hooks.quickTemplateName"),event:"PostToolUse",toolNames:"",pathGlobs:"**/*.md",crossProjectOnly:!1,handlerType:"inject",template:n("hooks.quickTemplatePrompt"),url:"",secret:"",record:!0,enabled:!1}}))},O=async()=>{if(!h)return;const N=h.state,G=N.name.trim();if(!G){k(n("hooks.errNameRequired"));return}if((N.handlerType==="inject"||N.handlerType==="manual")&&!N.template.trim()){k(n("hooks.errTemplateRequired"));return}if(N.handlerType==="webhook")try{new URL(N.url.trim())}catch{k(n("hooks.errUrlRequired"));return}if(N.handlerType==="plugin"&&(!N.pluginId.trim()||!N.pluginHandlerType.trim())){k(n("hooks.errPluginRequired"));return}const T=N.handlerType==="log"?{type:"log"}:N.handlerType==="webhook"?{type:"webhook",url:N.url.trim(),...N.secret.trim()?{secret:N.secret.trim()}:{}}:N.handlerType==="plugin"?{type:"plugin",pluginId:N.pluginId.trim(),handlerType:N.pluginHandlerType.trim()}:{type:N.handlerType,template:N.template.trim()},Z={},te=SN(N.toolNames),Q=SN(N.pathGlobs);te.length&&(Z.toolNames=te),Q.length&&(Z.pathGlobs=Q),N.crossProjectOnly&&(Z.crossProjectOnly=!0);const pe=N.sourceKind==="claude-event"?{kind:"claude-event",event:N.event}:{kind:"hook-event",harness:N.harness,event:N.event},V={name:G,enabled:N.enabled,projectId:N.projectId,source:pe,filter:Z,handler:T,record:N.record};try{h.editingId?await Ee.updateHookRule(h.editingId,V):await Ee.createHookRule(V),H(),f(null),NN()}catch(q){k(Ug(q))}},U=N=>{const G=N.filter.toolNames??[],T=N.filter.pathGlobs??[],Z=Wu(N.source),te=Z.kind==="webhook"?Z.routeId:Z.event,Q=ok[N.handler.type];return o.jsxs("div",{className:me("rounded-lg border px-3 py-2 transition-colors",N.enabled?"border-edge/[0.08] bg-neutral-900/40":"border-edge/[0.05] bg-neutral-900/20 opacity-70"),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-100",children:N.name}),o.jsx(Qe,{variant:"helper",children:te}),o.jsx("button",{type:"button",title:n("hooks.edit"),onClick:()=>$(N),className:"rounded p-1 text-neutral-500 transition-colors hover:text-neutral-200",children:o.jsx(Cv,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",title:w===N.id?n("hooks.confirmDelete"):n("hooks.delete"),onClick:()=>void M(N.id),className:me("rounded px-1.5 py-1 text-[11px] font-medium transition-colors",w===N.id?"bg-red-900/60 text-red-300":"text-neutral-500 hover:text-red-300"),children:w===N.id?n("hooks.confirmDelete"):o.jsx(Qs,{className:"h-3.5 w-3.5"})})]}),o.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[10px] text-neutral-500",children:[o.jsxs(Qe,{variant:"command",className:"gap-1",children:[o.jsx(Q,{className:"h-3 w-3"}),n(Tp[N.handler.type])]}),o.jsx(Qe,{variant:"default",children:N.projectId===null?n("hooks.scopeGlobal"):y.has(N.projectId)?n("hooks.scopeProjectName",{name:y.get(N.projectId)}):n("hooks.scopeProjectId",{id:N.projectId})}),G.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-0.5",title:n("hooks.filterToolTip",{names:G.join(", ")}),children:[o.jsx(r6,{className:"h-3 w-3"}),G.length]}),T.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-0.5",title:n("hooks.filterPathTip",{paths:T.join(", ")}),children:[o.jsx(Fd,{className:"h-3 w-3"}),T.length]}),N.filter.crossProjectOnly&&o.jsx("span",{className:"inline-flex items-center gap-0.5",title:n("hooks.filterCrossTip"),children:o.jsx(nx,{className:"h-3 w-3"})}),G.length===0&&T.length===0&&!N.filter.crossProjectOnly&&o.jsx("span",{children:n("hooks.filterNone")})]})]},N.id)},F=(r??[]).filter(N=>!N.pluginId),j=new Map;for(const N of r??[]){if(!N.pluginId)continue;const G=j.get(N.pluginId)??[];G.push(N),j.set(N.pluginId,G)}return o.jsxs("div",{className:"space-y-3",children:[d&&o.jsx("p",{className:"rounded-lg border border-red-500/30 bg-red-950/30 px-3 py-2 text-xs text-red-300",children:d}),t==="global"&&o.jsx(YG,{}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold tracking-tight",children:n("hooks.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:r===null?n("hooks.loading"):n("catbar.items",{n:r.length})}),t==="global"&&o.jsx("button",{type:"button",onClick:()=>h&&h.editingId===null?H():z(),className:"ml-auto inline-flex items-center gap-1 rounded-lg bg-blue-600/80 px-2.5 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:h&&h.editingId===null?o.jsxs(o.Fragment,{children:[o.jsx(tn,{className:"h-3.5 w-3.5"}),n("hooks.cancel")]}):o.jsxs(o.Fragment,{children:[o.jsx(Bd,{className:"h-3.5 w-3.5"}),n("hooks.newRule")]})})]}),o.jsxs(Ma,{children:[o.jsxs(_l,{className:"flex-row items-center gap-2 space-y-0",children:[o.jsx(Cl,{className:"text-sm",children:n("hooks.pluginsAndRules")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:n(t==="project"?"hooks.plugins.projectHint":"hooks.plugins.hint")})]}),o.jsxs(Tl,{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-md border border-edge/[0.06] bg-edge/[0.015]",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[o.jsx(Ta,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("span",{className:"text-xs font-medium text-neutral-200",children:n("hooks.localRules")}),o.jsx(Qe,{variant:"skill",children:F.length})]}),o.jsx("div",{className:"space-y-2 px-3 pb-3",children:r===null?o.jsx(Sm,{rows:6,className:"p-0"}):F.length===0?o.jsx("p",{className:"py-2 text-center text-xs text-neutral-500",children:n("hooks.rulesEmpty")}):F.map(U)})]}),o.jsx(CG,{projectId:t==="project"?e:void 0,renderRules:N=>(j.get(N.id)??[]).length===0?null:o.jsx("div",{className:"space-y-2",children:(j.get(N.id)??[]).map(U)})})]})]}),o.jsxs(Ma,{children:[o.jsxs(_l,{className:"flex-col gap-1.5",children:[o.jsxs("div",{className:"flex w-full items-center gap-2",children:[o.jsx(Cl,{children:n("hooks.flowTitle")}),r&&r.length===0&&o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.emptyFlow")}),r&&r.length>0&&!r.some(S)&&o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.emptyFlowDisabled")})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-neutral-500",children:[o.jsx(Hg,{icon:om,tone:"text-amber-400",label:n("hooks.colSource")}),o.jsx(Hg,{icon:KA,tone:"text-blue-400",label:n("hooks.colRule")}),o.jsx(Hg,{icon:BA,tone:"text-purple-300",label:n("hooks.colHandler")})]})]}),o.jsx(Tl,{className:"p-2",children:o.jsx("div",{className:me("h-80 rounded-lg border border-edge/[0.06]",s),children:E.length>0?o.jsxs(rk,{nodes:E,onNodesChange:R,edges:_,nodeTypes:HG,fitView:!0,minZoom:.15,maxZoom:1.5,nodesDraggable:!0,nodesConnectable:!1,deleteKeyCode:null,defaultEdgeOptions:{type:"smoothstep",style:{stroke:"rgb(var(--w-edge) / 0.25)",strokeWidth:1.5}},children:[o.jsx(lk,{}),o.jsx(ik,{showInteractive:!1})]}):o.jsx("div",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:r!==null&&!r.some(S)?n(r.length===0?"hooks.emptyFlow":"hooks.emptyFlowDisabled"):n("hooks.loading")})})})]}),h&&un.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),o.jsxs("div",{className:"relative flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-edge/[0.08] bg-neutral-900 shadow-mac",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-edge/[0.06] px-4 py-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx("h3",{className:"truncate text-sm font-semibold text-neutral-200",children:h.editingId?n("hooks.form.editTitle"):n("hooks.form.createTitle")}),!h.editingId&&o.jsx("button",{type:"button",onClick:C,title:n("hooks.quickTemplateTip"),className:"rounded-md border border-edge/[0.08] px-2 py-1 text-[11px] text-neutral-300 transition-colors hover:bg-neutral-800",children:n("hooks.quickTemplate")})]}),o.jsx("button",{type:"button",onClick:H,title:n("hooks.cancel"),className:"rounded-md p-1 text-neutral-500 transition-colors hover:text-neutral-200",children:o.jsx(tn,{className:"h-3.5 w-3.5"})})]}),o.jsxs("div",{className:"space-y-3 overflow-y-auto px-4 py-3",children:[m&&o.jsx("p",{className:"text-xs text-red-400",children:m}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.name")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.name,onChange:N=>I({name:N.target.value}),placeholder:n("hooks.namePlaceholder")})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.project")}),o.jsxs("select",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.projectId===null?"":String(h.state.projectId),onChange:N=>I({projectId:N.target.value===""?null:Number(N.target.value)}),children:[o.jsx("option",{value:"",children:n("hooks.projectGlobal")}),c.map(N=>o.jsx("option",{value:String(N.id),children:N.name},N.id))]})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.sourceKind")}),o.jsx("select",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.sourceKind,onChange:N=>I({sourceKind:N.target.value}),children:PG.map(N=>o.jsx("option",{value:N,children:n(N==="hook-event"?"hooks.sourceKind.hookEvent":"hooks.sourceKind.legacy")},N))})]}),h.state.sourceKind==="hook-event"&&o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.harness")}),o.jsx("select",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.harness,onChange:N=>I({harness:N.target.value}),children:zG.map(N=>o.jsx("option",{value:N,children:N==="any"?n("hooks.harness.any"):Kn(N).label},N))})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.event")}),o.jsx("select",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.event,onChange:N=>I({event:N.target.value}),children:(h.state.handlerType==="inject"?Eg:QA).map(N=>o.jsx("option",{value:N,children:N},N))}),h.state.handlerType==="inject"&&o.jsx("span",{className:"block text-[10px] text-amber-400/80",children:n("hooks.eventInjectHint",{events:Eg.join(", ")})})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.handler")}),o.jsx("div",{className:"flex w-fit max-w-full flex-wrap rounded-lg border border-edge/[0.06] bg-neutral-900/60 p-0.5",children:L5.map(N=>o.jsx("button",{type:"button",title:n(LG[N]),onClick:()=>L(N),className:me("rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",h.state.handlerType===N?"bg-neutral-800 text-neutral-100 shadow-mac-sm":"text-neutral-500 hover:text-neutral-300"),children:n(Tp[N])},N))})]})]}),h.state.handlerType==="webhook"&&o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.url")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.url,onChange:N=>I({url:N.target.value}),placeholder:n("hooks.urlPlaceholder")})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.secret")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.secret,onChange:N=>I({secret:N.target.value})})]})]}),h.state.handlerType==="plugin"&&o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.pluginId")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.pluginId,onChange:N=>I({pluginId:N.target.value}),placeholder:n("hooks.pluginIdPlaceholder")})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.pluginHandlerType")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.pluginHandlerType,onChange:N=>I({pluginHandlerType:N.target.value}),placeholder:n("hooks.pluginHandlerPlaceholder")})]})]}),(h.state.handlerType==="inject"||h.state.handlerType==="manual")&&o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.template")}),o.jsx("textarea",{rows:3,className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.template,onChange:N=>I({template:N.target.value}),placeholder:n("hooks.templatePlaceholder")})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.toolNames")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.toolNames,onChange:N=>I({toolNames:N.target.value}),placeholder:n("hooks.toolNamesPlaceholder")})]}),o.jsxs("label",{className:"block space-y-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:n("hooks.field.pathGlobs")}),o.jsx("input",{className:"w-full rounded-lg border border-edge/[0.08] bg-neutral-800 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500",value:h.state.pathGlobs,onChange:N=>I({pathGlobs:N.target.value}),placeholder:n("hooks.pathGlobsPlaceholder")})]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[o.jsx($g,{label:n("hooks.field.crossProjectOnly"),checked:h.state.crossProjectOnly,onChange:N=>I({crossProjectOnly:N})}),o.jsx($g,{label:n("hooks.field.record"),checked:h.state.record,onChange:N=>I({record:N})}),o.jsx($g,{label:n("hooks.field.enabled"),checked:h.state.enabled,onChange:N=>I({enabled:N})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:()=>void O(),className:"rounded-lg bg-blue-600/80 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:n("hooks.save")}),o.jsx("button",{type:"button",onClick:H,className:"rounded-lg border border-edge/[0.08] px-3 py-1.5 text-xs text-neutral-300 transition-colors hover:bg-neutral-800",children:n("hooks.cancel")})]})]})]})]}),document.body)]})}function Hg({icon:e,tone:t,label:n}){return o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(e,{className:me("h-3 w-3",t)}),n]})}function $g({label:e,checked:t,onChange:n}){return o.jsxs("label",{className:"inline-flex cursor-pointer items-center gap-1.5 text-[11px] text-neutral-300",children:[o.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-blue-500",checked:t,onChange:s=>n(s.target.checked)}),e]})}const P5={skill:"toolkit.kind.skill",hook:"toolkit.kind.hook",mod:"toolkit.kind.mod",rule:"toolkit.kind.rule",surface:"toolkit.kind.surface"},z5={skill:"bg-emerald-900/40 text-emerald-300",hook:"bg-blue-900/40 text-blue-300",mod:"bg-purple-900/40 text-purple-300",rule:"bg-amber-900/40 text-amber-300",surface:"bg-neutral-800 text-neutral-300"},XG={builtin:"toolkit.prov.builtin",market:"toolkit.prov.market"},QG={inherit:"on",on:"off",off:"inherit"},EN={inherit:"toolkit.enableDefault",on:"toolkit.enableOn",off:"toolkit.enableOff"},Ix="__root__";function WG(e){const t=new Map;for(const n of e){const s=n.scope||Ix,r=t.get(s)??{key:s,scope:n.scope,packs:[]};r.packs.push(n),t.set(s,r)}return[...t.values()]}function ZG({projectId:e,runtimeTab:t="all",scope:n="project"}){const s=We(),[r,i]=x.useState(null),[a,l]=x.useState([]),[c,u]=x.useState([]),[d,f]=x.useState(new Set),{show:h}=an(),p=xn(),m=L=>`${L.provenance}:${L.sourceRoot}:${L.id}`,k=L=>p.stateOf(L)==="loading",w=x.useCallback(()=>{Ee.listToolkit(e).then(L=>{i(L.packs),u(L.legacyCopies??[])}).catch(L=>{i(C=>C??[]),h("error",s("toolkit.loadFailed",{error:Ye(L)}))}),n==="user"&&Ee.listPluginState(e).then(l).catch(()=>{})},[e,n,s,h]);x.useEffect(()=>{w()},[w]),x.useEffect(()=>ki("toolkit",w),[w]);const g=async(L,C)=>{const O=m(L);k(O)||await p.run(O,async()=>{const U=await Ee.toggleToolkit(e,L.id,C,L.sourceRoot);U.warnings.length>0&&h("info",U.warnings.join(";")),w()},{fail:U=>s("toolkit.toggleFailed",{error:Ye(U)})})},y=async L=>{const C=m(L);k(C)||await p.run(C,async()=>{const O=await Ee.install(e,{category:"plugin",name:L.name,sourceDir:L.dir,version:L.version,description:L.description,scope:"user",agent:"claude"});if(!O.ok)throw new Error(`${O.status} ${await O.text()}`);w(),h("success",s("toolkit.userInstalled",{key:L.key??L.name}))},{fail:O=>s("toolkit.installFailed",{error:Ye(O)})})},b=async(L,C)=>{const O=m(L);k(O)||await p.run(O,async()=>{await Ee.putPluginState(e,"claude",L.key,"user",C),w()},{fail:U=>s("toolkit.toggleFailed",{error:Ye(U)})})},S=async L=>{const C=m(L);k(C)||await p.run(C,async()=>{const O=await Ee.uninstallToolkit(e,L.id,L.sourceRoot);O.warnings.length>0&&h("info",O.warnings.join(";")),w(),h("success",s("toolkit.uninstalled",{name:L.name}))},{fail:O=>s("toolkit.uninstallFailed",{error:Ye(O)})})},M=async()=>{await p.run("legacy-cleanup",async()=>{await Ee.cleanupToolkitLegacyCopies(e),w(),h("success",s("toolkit.legacyCleaned"))},{fail:L=>s("toolkit.toggleFailed",{error:Ye(L)})})},E=x.useMemo(()=>r?r.filter(L=>!L.weavePack&&(t==="all"||L.targets.includes(t))):[],[r,t]),A=x.useMemo(()=>jM(E),[E]),R=L=>WG(L.groups),D=L=>{const C=R(L);return C.length===1&&C[0].key===Ix},_=A.flatMap(L=>[L.key,...D(L)?[]:R(L).map(C=>`${L.key}:${C.key}`)]),z=d.size===0,$=x.useRef(!1);x.useEffect(()=>{$.current||_.length===0||f(new Set(_))},[_.join("|")]);const H=L=>{$.current=!0,f(C=>fl(C,L))};if(r===null)return o.jsx("p",{className:"text-xs text-neutral-600",children:s("toolkit.loading")});const I=L=>{var N;const C=k(m(L)),O=n==="user"&&!!L.key,U=O?a.find(G=>G.harness==="claude"&&G.key===L.key&&G.scope==="user"):void 0,F=(U==null?void 0:U.enable)??"inherit",j=O?(U==null?void 0:U.effective)??!1:L.enabled;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-edge/[0.06] bg-edge/[0.015] px-2 py-1.5",children:[o.jsx(Xu,{className:me("h-3.5 w-3.5 shrink-0",j?"text-emerald-400":"text-neutral-600")}),o.jsx("span",{className:"shrink-0 text-xs font-medium text-neutral-200",title:L.key?s("toolkit.keyTip",{scopes:((N=L.scopes)==null?void 0:N.join("+"))||s("toolkit.scopesNone")}):void 0,children:L.key??L.name}),L.id!==L.name&&o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",children:L.id}),o.jsx(Qe,{className:me("shrink-0",z5[L.kind]),children:s(P5[L.kind])}),o.jsx(Qe,{className:me("shrink-0",L.provenance==="builtin"?"bg-amber-900/40 text-amber-300":"bg-neutral-800 text-neutral-300"),children:s(XG[L.provenance])}),o.jsxs("span",{className:"shrink-0 text-[10px] text-neutral-600",children:["v",L.version]}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:s("toolkit.targets",{targets:L.targets.join("+")})}),L.weave&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:s("toolkit.weaveRules",{n:L.weave.ruleCount})}),L.description&&o.jsx("span",{className:"min-w-0 truncate text-[11px] text-neutral-500",title:L.description,children:L.description}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[o.jsx("button",{type:"button",title:s("toolkit.uninstallTip"),disabled:C,onClick:()=>void S(L),className:"rounded p-1 text-neutral-500 hover:bg-red-950/40 hover:text-red-300 disabled:opacity-40 [&_svg]:pointer-events-none",children:o.jsx(ut,{state:p.stateOf(m(L)),className:"h-3.5 w-3.5",icon:o.jsx(Qs,{className:"h-3.5 w-3.5"})})}),O?L.installed?o.jsxs("button",{type:"button",disabled:C,onClick:()=>void b(L,QG[F]),title:s("toolkit.enableTip",{state:s(EN[F])}),className:me("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium disabled:cursor-not-allowed [&_svg]:pointer-events-none",F==="on"?"bg-emerald-900/40 text-emerald-300 hover:bg-emerald-900/60":"bg-neutral-800 text-neutral-500 hover:bg-neutral-700"),children:[o.jsx(ut,{state:p.stateOf(m(L)),className:"h-3 w-3",icon:o.jsx(Fl,{className:"h-3 w-3"})}),s(EN[F])]}):o.jsx("button",{type:"button",disabled:C,onClick:()=>void y(L),title:s("toolkit.installTip"),className:"rounded bg-blue-900/50 px-2 py-0.5 text-[10px] text-blue-200 hover:bg-blue-800/60 disabled:opacity-40",children:s(C?"toolkit.installing":"toolkit.install")}):o.jsx(ml,{checked:L.enabled,disabled:C,onChange:G=>void g(L,G),title:s("toolkit.toggleTip")})]})]},`${L.provenance}:${L.sourceRoot}:${L.id}`)};return o.jsxs("div",{className:"space-y-2",children:[c.length>0&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2 py-1.5",children:[o.jsx(lm,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-[11px] font-medium text-amber-300",children:s("toolkit.legacyTitle",{n:c.length})}),o.jsx("p",{className:"truncate text-[10px] text-amber-200/60",title:c.join(`
507
+ `),children:s("toolkit.legacyHint")})]}),o.jsx("button",{type:"button",className:"shrink-0 rounded border border-amber-500/40 px-2 py-0.5 text-[10px] text-amber-200 hover:bg-amber-500/20",onClick:()=>void M(),children:s("toolkit.legacyCleanup")})]}),E.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:s("toolkit.empty")}),E.length>0&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:s("toolkit.hint")}),o.jsxs("button",{type:"button",onClick:()=>{$.current=!0,f(z?new Set(_):new Set)},className:"ml-auto inline-flex shrink-0 items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-2 py-0.5 text-[11px] hover:bg-neutral-700",title:s(z?"toolkit.collapseAllGroups":"toolkit.expandAllGroups"),children:[z?o.jsx(zd,{className:"h-3 w-3"}):o.jsx(Ud,{className:"h-3 w-3"}),s(z?"toolkit.collapseAll":"toolkit.expandAll")]})]}),A.map(L=>{const C=L.namespace===void 0,O=d.has(L.key),U=L.groups.length,F=L.groups.every(j=>j.provenance==="builtin");return o.jsxs("div",{className:"rounded-2xl border border-edge/[0.08] bg-neutral-900/60 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>H(L.key),onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),f(N=>fl(N,L.key)))},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-edge/[0.03] cursor-pointer",children:[O?o.jsx(ns,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Bn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(Xu,{className:"h-3.5 w-3.5 shrink-0 text-violet-400"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-200 truncate",children:C?s("repo.local"):L.namespace}),F&&o.jsx(Qe,{className:"bg-amber-900/40 text-amber-300",children:s("toolkit.prov.builtin")}),o.jsx(td,{tone:ed(L.groups.filter(j=>j.enabled).length,L.groups.length),children:s("repo.enabledCount",{done:L.groups.filter(j=>j.enabled).length,total:L.groups.length})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",title:s("repo.namespaceTip"),children:s("repo.packCount",{n:U})})]}),!O&&o.jsx("div",{className:"px-3 pb-3 pt-1 space-y-2",children:D(L)?o.jsx("div",{className:"space-y-1.5",children:L.groups.map(I)}):R(L).map(j=>{const N=`${L.key}:${j.key}`,G=d.has(N);return o.jsxs("div",{className:"rounded-xl border border-edge/[0.06] bg-neutral-900/40 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>H(N),onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f(Z=>fl(Z,N)))},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-edge/[0.02] cursor-pointer",children:[G?o.jsx(ns,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Bn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(LA,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-300 truncate",children:j.key===Ix?s("toolkit.scopeRoot"):j.scope}),o.jsx(Qe,{variant:"skill",children:j.packs.length}),[...new Set(j.packs.flatMap(T=>T.targets))].sort((T,Z)=>nn.indexOf(T)-nn.indexOf(Z)).map(T=>o.jsx(mr,{agent:T},T))]}),!G&&o.jsx("div",{className:"px-3 pb-3 pt-1 space-y-1.5",children:j.packs.map(I)})]},N)})})]},L.key)})]})}function JG({projectId:e,mode:t,runtimeTab:n}){return o.jsx("div",{className:"space-y-4",children:o.jsx(Ma,{children:o.jsx(Tl,{className:"space-y-1 pt-4",children:o.jsx(ZG,{projectId:e,runtimeTab:n,scope:t==="global"?"user":"project"})})})},t)}const eK="application/x-weave-dispatch";function tK(e){const t=e.getData(eK);if(!t)return null;const n=Number(t);return Number.isInteger(n)&&n>0?n:null}async function Em(e){var t;if((t=navigator.clipboard)!=null&&t.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}return sK(e)}async function nK(e){const t=navigator.clipboard;if(!(t!=null&&t.write)||typeof ClipboardItem>"u")return!1;try{return await t.write([new ClipboardItem({[e.type||"image/png"]:e})]),!0}catch{return!1}}function sK(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.top="-1000px",document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length);let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return document.body.removeChild(t),n}const Gg=["idle","turnEnd","messageFailed"],rK={idle:"tasks.watchKindIdle",turnEnd:"tasks.watchKindTurnEnd",messageFailed:"tasks.watchKindMessageFailed"},iK={idle:"tasks.watchKindIdleHint",turnEnd:"tasks.watchKindTurnEndHint",messageFailed:"tasks.watchKindMessageFailedHint"};function aK({label:e,current:t,busy:n,onSubscribe:s,onUnwatch:r,onClose:i}){const a=We(),[l,c]=x.useState(()=>new Set(t!=null&&t.onEvents.length?t.onEvents:Gg)),[u,d]=x.useState(()=>(t==null?void 0:t.remaining)??1),[f,h]=x.useState(()=>t!=null&&t.remaining===null);x.useEffect(()=>{const m=k=>{k.key==="Escape"&&i()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i]);const p=m=>{c(k=>{const w=new Set(k);return w.has(m)?w.delete(m):w.add(m),w})};return un.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:i,children:o.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-edge/[0.08] bg-neutral-900 p-3 shadow-mac",onClick:m=>m.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsxs("p",{className:"min-w-0 truncate text-xs font-medium text-neutral-200",children:[a("tasks.watchPickerTitle")," · ",e]}),o.jsx("button",{type:"button",title:a("tasks.messagesClose"),"aria-label":a("tasks.messagesClose"),onClick:i,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(tn,{className:"h-3.5 w-3.5"})})]}),o.jsx("p",{className:"pb-2 text-[11px] leading-relaxed text-neutral-500",children:a("tasks.watchPickerHint")}),o.jsx("ul",{className:"space-y-1",children:Gg.map(m=>{const k=l.has(m);return o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>p(m),className:me("flex w-full items-start gap-2 rounded-lg border px-2.5 py-2 text-left transition-colors",k?"border-amber-400/40 bg-amber-500/10":"border-edge/[0.06] bg-edge/[0.02] hover:border-edge/[0.16] hover:bg-edge/[0.06]"),children:[o.jsx("span",{className:me("mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border",k?"border-amber-400 bg-amber-500 text-black":"border-edge/20"),children:k&&o.jsx(cr,{className:"h-2.5 w-2.5"})}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-xs text-neutral-200",children:a(rK[m])}),o.jsx("span",{className:"mt-0.5 block text-[10px] text-neutral-500",children:a(iK[m])})]})]})},m)})}),o.jsxs("div",{className:"mt-3 flex items-center gap-2 border-t border-edge/[0.06] pt-2.5",children:[o.jsx("span",{className:"text-[11px] text-neutral-400",children:a(t?"tasks.watchTimesLeft":"tasks.watchTimes")}),o.jsx(nd,{value:u,min:1,max:100,disabled:f,onChange:d,title:a(t?"tasks.watchTimesLeft":"tasks.watchTimes")}),o.jsxs("label",{className:"flex cursor-pointer items-center gap-1 text-[11px] text-neutral-300",children:[o.jsx("input",{type:"checkbox",checked:f,onChange:m=>h(m.target.checked),className:"h-3 w-3 accent-blue-500"}),a("tasks.watchPersistent")]})]}),o.jsxs("div",{className:"mt-2 flex gap-1.5",children:[o.jsx("button",{type:"button",disabled:n||l.size===0,onClick:()=>s(Gg.filter(m=>l.has(m)),f?null:u),className:"flex-1 rounded bg-blue-600/80 px-2.5 py-1 text-[11px] font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:a(t?"tasks.watchUpdate":"tasks.watchSubscribe")}),t&&o.jsx("button",{type:"button",disabled:n,onClick:r,className:"rounded border border-edge/[0.08] px-2.5 py-1 text-[11px] text-neutral-300 transition-colors hover:border-red-400/40 hover:text-red-300 disabled:opacity-40",children:a("tasks.watchUnwatch")})]})]})}),document.body)}const _N={plain:{w:448,h:0},preview:{w:880,h:560}},Gf={w:320,h:220},U5=(e,t)=>({w:Math.min(Math.max(Math.round(e),Gf.w),Math.max(Gf.w+40,innerWidth-32)),h:t>0?Math.min(Math.max(Math.round(t),Gf.h),Math.max(Gf.h+40,innerHeight-32)):0});function CN(e){try{const t=JSON.parse(localStorage.getItem(`weave:answer-size:${e}`)??"null");return!t||typeof t.w!="number"||typeof t.h!="number"?_N[e]:U5(t.w,t.h)}catch{return _N[e]}}function lK(e,t,n){const s=t.filter(a=>{var l;return!((l=e[a])!=null&&l.input)}),r=e.findIndex(a=>a.input),i=n.trim();return s.length===0?i&&r>=0?[r]:null:i&&r>=0?[...s,r]:s}function oK({label:e,entry:t,busy:n,onAnswer:s,onClose:r}){const i=We(),a=Nl("(min-width: 1024px)"),[l,c]=x.useState({}),[u,d]=x.useState({}),[f,h]=x.useState({});x.useEffect(()=>{const O=U=>{U.key==="Escape"&&r()};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[r]);const p=t.questions.find(O=>O.submit)??null,m=t.questions.filter(O=>O!==p),k=m.some(O=>O.previewMode),w=m.length===1&&m[0].previewMode===!0,g=k?"preview":"plain",[y,b]=x.useState(()=>CN(g));x.useEffect(()=>b(CN(g)),[g]);const S=x.useRef(null),M=x.useRef(null),E=O=>{var F;const U=(F=S.current)==null?void 0:F.getBoundingClientRect();M.current={x:O.clientX,y:O.clientY,w:y.w,h:y.h||Math.round((U==null?void 0:U.height)??0)},O.currentTarget.setPointerCapture(O.pointerId)},A=O=>{const U=M.current;U&&b(U5(U.w+(O.clientX-U.x),U.h+(O.clientY-U.y)))},R=()=>{M.current&&(M.current=null,b(O=>(localStorage.setItem(`weave:answer-size:${g}`,JSON.stringify(O)),O)))},D=(O,U)=>{n||c(F=>{const j=F[O.key]??[];return O.multiSelect?{...F,[O.key]:j.includes(U)?j.filter(N=>N!==U):[...j,U]}:{...F,[O.key]:[U]}})},_=(O,U)=>{n||!p||(l[O.key]??[]).includes(U)||c(F=>({...F,[O.key]:O.multiSelect?[...F[O.key]??[],U]:[U]}))},z=O=>lK(O.options,l[O.key]??[],u[O.key]??""),$=O=>O.previewMode?z(O)??[]:l[O.key]??[],H=()=>m.filter(O=>O.previewMode?z(O)!==null:(l[O.key]??[]).length>0).map(O=>({questionKey:O.key,options:$(O),text:u[O.key]})),I=p?m.filter(O=>{if(O.options.length===0)return!1;if(O.previewMode)return z(O)===null;const U=l[O.key]??[];if(U.length===0)return!0;const F=O.options.findIndex(j=>j.input);return F>=0&&U.includes(F)&&!(u[O.key]??"").trim()}):[],L=(O,U,F)=>{n||s([...H(),{questionKey:O,options:U,text:F}])},C=(O,U)=>{const F=O.options[U];return F&&!F.input&&!F.chat?F:null};return un.createPortal(o.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:r,children:o.jsxs("div",{ref:S,style:a?{width:y.w,height:y.h||void 0}:void 0,className:me("relative flex w-full flex-col overflow-hidden rounded-xl border border-edge/[0.08] bg-neutral-900 p-3 shadow-mac",a?"max-h-[calc(100dvh_-_2rem)]":"h-[90dvh]"),onClick:O=>O.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsxs("p",{className:"min-w-0 truncate text-xs font-medium text-neutral-200",children:[i("tasks.answerPickerTitle")," · ",e]}),o.jsx("button",{type:"button",title:i("tasks.messagesClose"),"aria-label":i("tasks.messagesClose"),onClick:r,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(tn,{className:"h-3.5 w-3.5"})})]}),o.jsx("p",{className:"pb-2 text-[11px] leading-relaxed text-neutral-500",children:i(k?"tasks.answerPickerHintPreview":"tasks.answerPickerHint")}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto",children:m.map(O=>{var Z;const U=l[O.key]??[],F=u[O.key]??"",j=O.previewMode?O.options.findIndex(te=>te.input):-1,N=O.previewMode?O.options.findIndex(te=>te.chat):-1,G=j>=0?O.options[j]:void 0,T=f[O.key]??U[0]??0;return o.jsxs("div",{className:me("rounded-lg border border-edge/[0.06] bg-edge/[0.02] p-2.5",w&&"flex min-h-0 flex-1 flex-col"),children:[O.header&&o.jsx("span",{className:"mb-1 inline-block rounded bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-medium text-blue-300",children:O.header}),o.jsx("p",{className:"whitespace-pre-wrap break-words text-xs leading-relaxed text-neutral-200",children:O.question}),O.previewMode&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:me("mt-2 flex flex-col gap-2 lg:flex-row",w&&"lg:min-h-0 lg:flex-1"),children:[o.jsx("ul",{className:"flex flex-col gap-1 lg:w-2/5 lg:shrink-0",children:O.options.map((te,Q)=>{if(!C(O,Q))return null;const pe=T===Q,V=U.includes(Q);return o.jsx("li",{children:o.jsxs("button",{type:"button",disabled:n,onMouseEnter:()=>h(q=>({...q,[O.key]:Q})),onFocus:()=>h(q=>({...q,[O.key]:Q})),onClick:()=>D(O,Q),className:me("flex w-full items-center gap-2 rounded-lg border px-2 py-1.5 text-left transition-colors disabled:opacity-50",V?"border-blue-400/50 bg-blue-500/10":pe?"border-edge/15 bg-edge/[0.04]":"border-edge/[0.06] bg-edge/[0.02] hover:bg-edge/[0.04]"),children:[o.jsx("span",{className:"w-2.5 shrink-0 text-neutral-500",children:pe?"›":""}),o.jsxs("span",{className:"shrink-0 text-[11px] text-neutral-500",children:[Q+1,"."]}),o.jsx("span",{className:me("min-w-0 flex-1 truncate text-xs",V?"text-blue-200":"text-neutral-200"),children:te.label}),V&&o.jsx(cr,{className:"h-3 w-3 shrink-0 text-blue-300"})]})},Q)})}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5 lg:min-h-0",children:[o.jsx("pre",{className:me("overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-edge/[0.06] bg-neutral-950 px-2.5 py-2 font-mono text-[11px] leading-relaxed text-neutral-300",w?"h-40 lg:min-h-0 lg:flex-1":"h-40 lg:h-60"),children:((Z=O.options[T])==null?void 0:Z.preview)??""}),G&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"shrink-0 text-[11px] text-neutral-400",children:G.label}),o.jsx("input",{value:F,disabled:n,placeholder:G.description??G.label,onChange:te=>{const Q=te.target.value;d(pe=>({...pe,[O.key]:Q}))},onKeyDown:te=>{if(te.key!=="Enter"||n)return;te.preventDefault();const Q=z(O);!p&&Q&&L(O.key,Q,F)},className:"min-w-0 flex-1 rounded border border-edge/[0.08] bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-edge/20 focus:outline-none disabled:opacity-50"})]})]})]}),N>=0&&o.jsxs("button",{type:"button",disabled:n,onClick:()=>L(O.key,[N]),className:"mt-2 flex w-full items-center gap-2 rounded-lg px-2 py-1 text-left text-xs text-neutral-400 transition-colors hover:bg-edge/[0.06] hover:text-neutral-200 disabled:opacity-50",children:[o.jsx("span",{className:"w-2.5 shrink-0",children:"·"}),o.jsx("span",{children:O.options[N].label}),n&&o.jsx(zn,{className:"h-3 w-3 animate-spin text-blue-300"})]}),!p&&o.jsx("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-edge/[0.06] pt-2",children:o.jsxs("button",{type:"button",disabled:n||z(O)===null,onClick:()=>{const te=z(O);te&&L(O.key,te,F)},className:"flex items-center gap-1 rounded bg-blue-700/80 px-2.5 py-1 text-[11px] font-medium text-white transition-colors hover:bg-blue-600 disabled:opacity-40",children:[i("tasks.answerSend"),n&&o.jsx(zn,{className:"h-3 w-3 animate-spin"})]})})]}),!O.previewMode&&O.options.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:O.options.map((te,Q)=>{const pe=U.includes(Q),V=o.jsx("span",{className:me("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border text-[10px] font-semibold leading-none",pe?"border-blue-400/40 bg-blue-500/15 text-blue-200":"border-edge/15 bg-neutral-950 text-neutral-300"),children:Q+1});return te.input?o.jsx("li",{children:o.jsxs("div",{onClick:()=>_(O,Q),className:me("flex items-center gap-2 rounded-lg border px-2.5 py-1.5",pe?"border-blue-400/50 bg-blue-500/10":"border-edge/[0.06] bg-edge/[0.02]"),children:[p?o.jsx("button",{type:"button",disabled:n,onClick:q=>{q.stopPropagation(),D(O,Q)},"aria-label":te.label,className:"shrink-0 disabled:opacity-50",children:V}):V,o.jsx("input",{value:F,disabled:n,placeholder:te.description??te.label,onChange:q=>{const Y=q.target.value;d(J=>({...J,[O.key]:Y})),p&&_(O,Q)},onKeyDown:q=>{q.key!=="Enter"||n||(q.preventDefault(),!p&&F.trim()&&L(O.key,[Q],F))},className:"min-w-0 flex-1 rounded border border-edge/[0.08] bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-edge/20 focus:outline-none disabled:opacity-50"}),!p&&o.jsx("button",{type:"button",disabled:n||!F.trim(),onClick:()=>L(O.key,[Q],F),className:"shrink-0 rounded bg-blue-700/80 px-2 py-0.5 text-[10px] font-medium text-white transition-colors hover:bg-blue-600 disabled:opacity-40",children:i("tasks.answerSend")}),n&&o.jsx(zn,{className:"h-3 w-3 shrink-0 animate-spin text-blue-300"})]})},Q):o.jsx("li",{children:o.jsxs("button",{type:"button",disabled:n,onClick:()=>p&&!te.chat?D(O,Q):L(O.key,[Q]),className:me("flex w-full items-start gap-2 rounded-lg border px-2.5 py-1.5 text-left transition-colors disabled:opacity-50",pe?"border-blue-400/50 bg-blue-500/10":"border-edge/[0.06] bg-edge/[0.02] hover:border-blue-400/40 hover:bg-blue-500/10"),children:[V,o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-xs text-neutral-200",children:te.label}),te.description&&o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-neutral-500",children:te.description})]}),(pe||n)&&o.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-1",children:[pe&&!te.chat&&o.jsx(cr,{className:"h-3 w-3 text-blue-300"}),n&&o.jsx(zn,{className:"h-3 w-3 animate-spin text-blue-300"})]})]})},Q)})})]},O.key)})}),p&&o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 border-t border-edge/[0.06] pt-2",children:[I.length>0&&o.jsx("span",{className:"min-w-0 flex-1 text-[10px] leading-relaxed text-amber-300/80",children:i("tasks.answerIncomplete",{n:I.length})}),o.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:p.options.map((O,U)=>o.jsxs("button",{type:"button",disabled:n||U===0&&I.length>0,onClick:()=>L(p.key,[U]),className:me("flex items-center gap-1 rounded px-2.5 py-1 text-[11px] font-medium transition-colors disabled:opacity-40",U===0?"bg-blue-700/80 text-white hover:bg-blue-600":"border border-edge/[0.08] bg-edge/[0.02] text-neutral-300 hover:bg-edge/[0.08]"),children:[O.label,n&&U===0&&o.jsx(zn,{className:"h-3 w-3 animate-spin"})]},U))})]}),a&&o.jsx("div",{role:"separator",title:i("app.resizeDialog"),"aria-label":i("app.resizeDialog"),onPointerDown:E,onPointerMove:A,onPointerUp:R,onPointerCancel:R,onClick:O=>O.stopPropagation(),className:"absolute bottom-0 right-0 h-4 w-4 cursor-nwse-resize touch-none",children:o.jsx("span",{className:"pointer-events-none absolute bottom-1 right-1 h-2 w-2 rounded-br border-b border-r border-edge/20"})})]})}),document.body)}function ck({status:e,harness:t}){return e==="open"||To(e)?o.jsx(El,{harness:t,running:To(e)}):o.jsx("span",{className:me("h-2 w-2 shrink-0 rounded-full",b9[e])})}const Ua="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-edge/[0.08] bg-edge/[0.02] text-neutral-500 transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08] hover:text-neutral-200",cK=1e4,uK=450;function dK(e,t){return e.autoDeleteAt==null?0:Date.parse(e.autoDeleteAt)-Math.max(t,Date.parse(e.lastSeenAt))}function Lx(e,t,n){const s=new Date(t),r=new Date(n);if(s.toDateString()===r.toDateString())return s.toLocaleTimeString();const i=new Date(n);return i.setDate(i.getDate()-1),s.toDateString()===i.toDateString()?e("tasks.yesterday"):s.getFullYear()===r.getFullYear()?`${s.getMonth()+1}/${s.getDate()}`:`${s.getFullYear()}/${s.getMonth()+1}/${s.getDate()}`}function fK(e,t){const n=Math.max(0,t);if(n<6e4)return e("tasks.autoDeleteSoon");const s=Math.ceil(n/36e5);if(s>=24)return e("tasks.autoDeleteInDays",{n:Math.ceil(n/864e5)});const r=Math.ceil(n/6e4);return r>=60?e("tasks.autoDeleteInHours",{n:s}):e("tasks.autoDeleteInMinutes",{n:r})}function F5(e,t){return Date.parse(t.lastSeenAt)-Date.parse(e.lastSeenAt)||Date.parse(t.createdAt)-Date.parse(e.createdAt)}function hK(e){const t=[],n=new Map;for(const s of e){const r=s.terminal;if(!r){t.push({kind:"row",row:s});continue}let i=n.get(r.id);i||(i={kind:"block",terminal:r,rows:[]},n.set(r.id,i),t.push(i)),i.rows.push(s)}return t.map(s=>s.kind==="block"&&s.rows.length===1?{kind:"row",row:s.rows[0]}:s)}function pK(e,t){const n=new Set(t),s=e.filter(a=>n.has(a)),r=new Set(s);return[...t.filter(a=>!r.has(a)),...s]}function TN(e,t){return e.length===t.length&&e.every((n,s)=>n===t[s])}function B5(e,t){const n=x.useRef(e);n.current=e;const[s,r]=x.useState(e),i=x.useRef(t);return x.useLayoutEffect(()=>{if(i.current!==t){i.current=t,r(e);return}r(a=>{const l=pK(a,e);return TN(a,l)?a:l})},[e,t]),x.useEffect(()=>{const a=window.setInterval(()=>{r(l=>TN(l,n.current)?l:n.current)},cK);return()=>window.clearInterval(a)},[]),s}function H5(e){const t=x.useRef(new Map);x.useLayoutEffect(()=>{const n=e.current;if(n.size===0){t.current=new Map;return}const s=t.current,r=new Map,i=[];for(const[a,l]of n){const c=l.offsetTop;r.set(a,c);const u=s.get(a);u!==void 0&&Math.abs(u-c)>=1&&i.push([l,u-c])}if(t.current=r,i.length!==0){for(const[a]of i)a.style.transition="none";for(const[a,l]of i)a.style.transform=`translateY(${l}px)`;i[0][0].offsetHeight;for(const[a]of i)a.style.transition=`transform ${uK}ms cubic-bezier(0.2, 0, 0, 1)`,a.style.transform=""}})}function mK({sessions:e,statuses:t,selectedId:n,highlightId:s,onSelect:r,onRename:i,onDropDispatch:a,onOpenTerminal:l,openTerminalStateOf:c,onClosePane:u,closePaneStateOf:d,capabilities:f,inflightOf:h,questionOf:p,onAnswer:m,answerStateOf:k,answerFor:w,onSetAnswerFor:g,watchOf:y,watchStateOf:b,onSubscribeWatch:S,onUnwatch:M,onDelete:E,deleteStateOf:A}){var je;const R=We(),{show:D}=an(),_=ae=>ae.tabsInWindow>1?R("tasks.terminalBlockTab",{w:ae.windowId,t:ae.tabId}):R("tasks.terminalBlock",{w:ae.windowId}),[z,$]=x.useState(null),[H,I]=x.useState(null),[L,C]=x.useState(""),[O,U]=x.useState(null),[F,j]=x.useState(null),N=x.useRef(null),G=x.useMemo(()=>e.slice().sort(F5).map(ae=>ae.sessionId),[e]),T=B5(G),Z=x.useMemo(()=>{const ae=new Map(e.map(be=>[be.sessionId,be])),Oe=[];for(const be of T){const $e=ae.get(be);$e&&Oe.push($e)}const ye=new Set(Oe.map(be=>be.sessionId));return[...e.filter(be=>!ye.has(be.sessionId)),...Oe]},[e,T]),te=x.useRef(new Map);H5(te);const[Q,pe]=x.useState(()=>Date.now()),V=e.some(ae=>ae.autoDeleteAt!=null);x.useEffect(()=>{if(!V)return;const ae=window.setInterval(()=>pe(Date.now()),3e4);return()=>window.clearInterval(ae)},[V]),x.useEffect(()=>{var ae;H&&((ae=N.current)==null||ae.focus())},[H]);const q=ae=>{I(ae.sessionId),C(ae.title??"")},Y=()=>{H&&L.trim()&&i(H,L.trim()),I(null)},J=ae=>{Em(ae).then(Oe=>{if(!Oe){D("error",R("common.copyFailed"));return}U(ae),window.setTimeout(()=>U(null),1500)})},ce=ae=>Oe=>{Oe?te.current.set(ae,Oe):te.current.delete(ae)},ke=ae=>{var ee;const Oe=t.get(ae.sessionId)??"open",ye=ae.sessionId===n,ge=ae.harness!=null?f==null?void 0:f.get(ae.harness):void 0,be=y==null?void 0:y(ae.sessionId),$e=h(ae.sessionId),ft=(c==null?void 0:c(ae.sessionId))??"idle",mt=(d==null?void 0:d(ae.sessionId))??"idle",rt=(((ee=p==null?void 0:p(ae.sessionId))==null?void 0:ee.questions)??[]).filter(ne=>!ne.submit).length,nt=ae.transcriptPresent===!1;return o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>r(ae.sessionId),onKeyDown:ne=>{(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),r(ae.sessionId))},onDoubleClick:ne=>{ne.stopPropagation(),H!==ae.sessionId&&q(ae)},onDragOver:ne=>{ne.preventDefault(),j(ae.sessionId)},onDragLeave:()=>j(ne=>ne===ae.sessionId?null:ne),onDrop:ne=>{ne.preventDefault(),j(null);const Ce=tK(ne.dataTransfer);Ce!==null&&a(Ce,ae.sessionId)},title:F===ae.sessionId?R("tasks.dropTip"):Sn(ae.title,ae.sessionId),className:me("group flex flex-wrap cursor-pointer items-center gap-x-2 gap-y-1 rounded-xl border p-2 transition-colors",ye?"border-blue-500/50 bg-blue-500/10":"border-edge/[0.06] bg-neutral-900/50 hover:border-edge/[0.10] hover:bg-edge/[0.04]",s===ae.sessionId&&"border-rose-400/70",F===ae.sessionId&&"border-dashed border-blue-400/70 bg-blue-500/10"),children:[o.jsx(ck,{status:Oe,harness:ae.harness}),$e>0&&o.jsxs("span",{title:R("tasks.messageInflight",{n:$e}),className:"inline-flex shrink-0 items-center gap-0.5 rounded border border-amber-400/40 bg-amber-500/10 px-1 py-0.5 text-[10px] font-semibold leading-none text-amber-300",children:[o.jsx(UA,{className:"h-3 w-3"}),$e>9?"9+":$e]}),H===ae.sessionId?o.jsx("input",{ref:N,value:L,onChange:ne=>C(ne.target.value),onBlur:Y,onKeyDown:ne=>{ne.key==="Enter"&&Y(),ne.key==="Escape"&&I(null)},onClick:ne=>ne.stopPropagation(),placeholder:R("tasks.renamePlaceholder"),className:"min-w-0 flex-1 rounded border border-blue-500/40 bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-100 focus:outline-none"}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-200",children:Sn(ae.title,ae.sessionId)}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 [&_svg]:pointer-events-none",children:[ae.harness==="claude"&&o.jsx("button",{type:"button",disabled:nt||!!ae.pidAlive||ft==="loading",title:nt?R("tasks.transcriptMissingTip"):ae.pidAlive?R("tasks.sessionTerminalRunning"):R("tasks.openSessionTerminal"),onClick:ne=>{ne.stopPropagation(),l(ae.sessionId)},className:me(Ua,(nt||ae.pidAlive||ft==="loading")&&"disabled:cursor-not-allowed hover:border-edge/[0.08] hover:bg-edge/[0.02] hover:text-neutral-500"),children:o.jsx(ut,{state:ft,className:"h-3 w-3",icon:o.jsx(V1,{className:me("h-3 w-3",ae.pidAlive&&"text-emerald-400")})})}),!!ae.pidAlive&&o.jsx("button",{type:"button",title:R("tasks.closePaneTooltip"),onClick:ne=>{ne.stopPropagation(),u(ae.sessionId)},className:me(Ua,"text-red-400 hover:border-red-500/30 hover:bg-red-500/10 hover:text-red-300"),children:o.jsx(ut,{state:mt,className:"h-3 w-3",icon:o.jsx(Fl,{className:"h-3 w-3"})})}),(p==null?void 0:p(ae.sessionId))&&o.jsxs("button",{type:"button",title:R("tasks.answerActiveTooltip",{n:rt}),onClick:ne=>{ne.stopPropagation(),g(ae.sessionId)},className:me(Ua,"relative","border-amber-400/40 bg-amber-500/10 text-amber-300 hover:border-amber-400/60 hover:text-amber-200"),children:[o.jsx(DA,{className:"h-3 w-3 text-amber-300"}),o.jsx("span",{"aria-hidden":!0,className:"absolute -right-1 -top-1 flex h-3 min-w-3 items-center justify-center rounded-full bg-amber-500 px-0.5 text-[8px] font-semibold leading-none text-black",children:rt})]}),(ge==null?void 0:ge.watch)&&o.jsxs("button",{type:"button",title:be?R("tasks.watchActiveTooltip",{n:be.remaining===null?"∞":String(be.remaining)}):R("tasks.watchTooltip"),onClick:ne=>{ne.stopPropagation(),$(ae.sessionId)},className:me(Ua,"relative"),children:[o.jsx(ut,{state:(b==null?void 0:b(ae.sessionId))??"idle",className:"h-3 w-3",icon:be?o.jsx(MP,{className:"h-3 w-3 text-amber-300"}):o.jsx(OA,{className:"h-3 w-3"})}),be&&o.jsx("span",{"aria-hidden":!0,className:"absolute -right-1.5 -top-1 flex h-3 min-w-3 items-center justify-center rounded-full bg-amber-500 px-0.5 text-[8px] font-semibold leading-none text-black",children:be.remaining===null?"∞":be.remaining})]}),o.jsx("button",{type:"button",title:R("tasks.renameTip"),onClick:ne=>{ne.stopPropagation(),q(ae)},className:Ua,children:o.jsx(Cv,{className:"h-3 w-3"})}),o.jsx("button",{type:"button",title:O===ae.sessionId?R("tasks.copied"):R("tasks.copySessionId"),onClick:ne=>{ne.stopPropagation(),J(ae.sessionId)},className:Ua,children:O===ae.sessionId?o.jsx(cr,{className:"h-3 w-3 text-emerald-400"}):o.jsx(Vu,{className:"h-3 w-3"})}),o.jsx("button",{type:"button",title:R("tasks.deleteTooltip"),"aria-label":R("tasks.deleteSession"),onClick:ne=>{ne.stopPropagation(),E(ae.sessionId)},className:me(Ua,"hover:text-red-400"),children:o.jsx(ut,{state:(A==null?void 0:A(ae.sessionId))??"idle",className:"h-3 w-3",icon:o.jsx(Qs,{className:"h-3 w-3"})})})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 basis-full",children:[ae.pendingTitle&&o.jsx(Qe,{title:R("tasks.renamePendingTip"),className:"shrink-0 bg-amber-900/40 text-amber-300",children:R("tasks.pendingTitle")}),nt&&o.jsxs(Qe,{title:R("tasks.transcriptMissingTip"),className:"shrink-0 gap-1 bg-rose-900/40 text-rose-300",children:[o.jsx(BP,{className:"h-3 w-3"}),R("tasks.transcriptMissing")]}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:R("tasks.events",{n:ae.eventCount??0})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:Lx(R,ae.lastSeenAt,Q)}),ae.harness&&o.jsx(mr,{agent:ae.harness,className:"shrink-0 px-1 text-[10px]"}),o.jsx(Qe,{className:me("shrink-0",CM[Oe]),children:R(_M[Oe])}),ae.autoDeleteAt&&o.jsx(Qe,{className:"shrink-0 bg-neutral-800/80 text-neutral-400",children:fK(R,dK(ae,Q))})]})]})]})},Ae=x.useMemo(()=>hK(Z),[Z]);return o.jsxs("ul",{className:"space-y-1.5",children:[Ae.map(ae=>ae.kind==="row"?o.jsx("li",{ref:ce(ae.row.sessionId),children:ke(ae.row)},ae.row.sessionId):o.jsxs("li",{className:"rounded-xl border border-edge/[0.06] bg-edge/[0.02] p-2",children:[o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 text-[10px] text-neutral-400",children:[o.jsx(V1,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"font-medium",children:_(ae.terminal)}),o.jsx("span",{className:"text-neutral-500",children:R("tasks.terminalBlockSessions",{n:ae.rows.length})})]}),o.jsx("ul",{className:"space-y-1.5",children:ae.rows.map(Oe=>o.jsx("li",{ref:ce(Oe.sessionId),children:ke(Oe)},Oe.sessionId))})]},`terminal:${ae.terminal.id}`)),w&&(()=>{var Oe;const ae=p==null?void 0:p(w);return!ae||ae.questions.length===0?null:o.jsx(oK,{label:Sn(((Oe=e.find(ye=>ye.sessionId===w))==null?void 0:Oe.title)??null,w),entry:ae,busy:(k==null?void 0:k(w))==="loading",onAnswer:ye=>m==null?void 0:m(w,ye),onClose:()=>g(null)})})(),z&&o.jsx(aK,{label:Sn(((je=e.find(ae=>ae.sessionId===z))==null?void 0:je.title)??null,z),current:(y==null?void 0:y(z))??null,busy:(b==null?void 0:b(z))==="loading",onSubscribe:(ae,Oe)=>{$(null),S(z,ae,Oe)},onUnwatch:()=>{$(null),M(z)},onClose:()=>$(null)})]})}function gK(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const bK=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xK=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yK={};function AN(e,t){return(yK.jsx?xK:bK).test(e)}const vK=/[ \t\n\f\r]/g;function kK(e){return typeof e=="object"?e.type==="text"?MN(e.value):!1:MN(e)}function MN(e){return e.replace(vK,"")===""}let ef=class{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}};ef.prototype.normal={};ef.prototype.property={};ef.prototype.space=void 0;function $5(e,t){const n={},s={};for(const r of e)Object.assign(n,r.property),Object.assign(s,r.normal);return new ef(n,s,t)}function Px(e){return e.toLowerCase()}class bs{constructor(t,n){this.attribute=n,this.property=t}}bs.prototype.attribute="";bs.prototype.booleanish=!1;bs.prototype.boolean=!1;bs.prototype.commaOrSpaceSeparated=!1;bs.prototype.commaSeparated=!1;bs.prototype.defined=!1;bs.prototype.mustUseProperty=!1;bs.prototype.number=!1;bs.prototype.overloadedBoolean=!1;bs.prototype.property="";bs.prototype.spaceSeparated=!1;bs.prototype.space=void 0;let wK=0;const st=Bl(),hn=Bl(),zx=Bl(),Le=Bl(),Ut=Bl(),gl=Bl(),vs=Bl();function Bl(){return 2**++wK}const Ux=Object.freeze(Object.defineProperty({__proto__:null,boolean:st,booleanish:hn,commaOrSpaceSeparated:vs,commaSeparated:gl,number:Le,overloadedBoolean:zx,spaceSeparated:Ut},Symbol.toStringTag,{value:"Module"})),Kg=Object.keys(Ux);class uk extends bs{constructor(t,n,s,r){let i=-1;if(super(t,n),jN(this,"space",r),typeof s=="number")for(;++i<Kg.length;){const a=Kg[i];jN(this,Kg[i],(s&Ux[a])===Ux[a])}}}uk.prototype.defined=!0;function jN(e,t,n){n&&(e[t]=n)}function Tc(e){const t={},n={};for(const[s,r]of Object.entries(e.properties)){const i=new uk(s,e.transform(e.attributes||{},s),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(i.mustUseProperty=!0),t[s]=i,n[Px(s)]=s,n[Px(i.attribute)]=s}return new ef(t,n,e.space)}const G5=Tc({properties:{ariaActiveDescendant:null,ariaAtomic:hn,ariaAutoComplete:null,ariaBusy:hn,ariaChecked:hn,ariaColCount:Le,ariaColIndex:Le,ariaColSpan:Le,ariaControls:Ut,ariaCurrent:null,ariaDescribedBy:Ut,ariaDetails:null,ariaDisabled:hn,ariaDropEffect:Ut,ariaErrorMessage:null,ariaExpanded:hn,ariaFlowTo:Ut,ariaGrabbed:hn,ariaHasPopup:null,ariaHidden:hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ut,ariaLevel:Le,ariaLive:null,ariaModal:hn,ariaMultiLine:hn,ariaMultiSelectable:hn,ariaOrientation:null,ariaOwns:Ut,ariaPlaceholder:null,ariaPosInSet:Le,ariaPressed:hn,ariaReadOnly:hn,ariaRelevant:null,ariaRequired:hn,ariaRoleDescription:Ut,ariaRowCount:Le,ariaRowIndex:Le,ariaRowSpan:Le,ariaSelected:hn,ariaSetSize:Le,ariaSort:null,ariaValueMax:Le,ariaValueMin:Le,ariaValueNow:Le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function K5(e,t){return t in e?e[t]:t}function q5(e,t){return K5(e,t.toLowerCase())}const SK=Tc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gl,acceptCharset:Ut,accessKey:Ut,action:null,allow:null,allowFullScreen:st,allowPaymentRequest:st,allowUserMedia:st,alpha:st,alt:null,as:null,async:st,autoCapitalize:null,autoComplete:Ut,autoFocus:st,autoPlay:st,blocking:Ut,capture:null,charSet:null,checked:st,cite:null,className:Ut,closedBy:null,colorSpace:null,cols:Le,colSpan:Le,command:null,commandFor:null,content:null,contentEditable:hn,controls:st,controlsList:Ut,coords:Le|gl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:st,defer:st,dir:null,dirName:null,disabled:st,download:zx,draggable:hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:st,formTarget:null,headers:Ut,height:Le,hidden:zx,high:Le,href:null,hrefLang:null,htmlFor:Ut,httpEquiv:Ut,id:null,imageSizes:null,imageSrcSet:null,inert:st,inputMode:null,integrity:null,is:null,isMap:st,itemId:null,itemProp:Ut,itemRef:Ut,itemScope:st,itemType:Ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:st,low:Le,manifest:null,max:null,maxLength:Le,media:null,method:null,min:null,minLength:Le,multiple:st,muted:st,name:null,nonce:null,noModule:st,noValidate:st,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:st,optimum:Le,pattern:null,ping:Ut,placeholder:null,playsInline:st,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:st,referrerPolicy:null,rel:Ut,required:st,reversed:st,rows:Le,rowSpan:Le,sandbox:Ut,scope:null,scoped:st,seamless:st,selected:st,shadowRootClonable:st,shadowRootCustomElementRegistry:st,shadowRootDelegatesFocus:st,shadowRootMode:null,shadowRootSerializable:st,shape:null,size:Le,sizes:null,slot:null,span:Le,spellCheck:hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Le,step:null,style:null,tabIndex:Le,target:null,title:null,translate:null,type:null,typeMustMatch:st,useMap:null,value:hn,width:Le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ut,axis:null,background:null,bgColor:null,border:Le,borderColor:null,bottomMargin:Le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:st,declare:st,event:null,face:null,frame:null,frameBorder:null,hSpace:Le,leftMargin:Le,link:null,longDesc:null,lowSrc:null,marginHeight:Le,marginWidth:Le,noResize:st,noHref:st,noShade:st,noWrap:st,object:null,profile:null,prompt:null,rev:null,rightMargin:Le,rules:null,scheme:null,scrolling:hn,standby:null,summary:null,text:null,topMargin:Le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:st,disablePictureInPicture:st,disableRemotePlayback:st,exportParts:gl,part:Ut,prefix:null,property:null,results:Le,security:null,unselectable:null},space:"html",transform:q5}),NK=Tc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:vs,accentHeight:Le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Le,amplitude:Le,arabicForm:null,ascent:Le,attributeName:null,attributeType:null,azimuth:Le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Le,by:null,calcMode:null,capHeight:Le,className:Ut,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Le,diffuseConstant:Le,direction:null,display:null,dur:null,divisor:Le,dominantBaseline:null,download:st,dx:null,dy:null,edgeMode:null,editable:null,elevation:Le,enableBackground:null,end:null,event:null,exponent:Le,externalResourcesRequired:null,fill:null,fillOpacity:Le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gl,g2:gl,glyphName:gl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Le,horizOriginX:Le,horizOriginY:Le,id:null,ideographic:Le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Le,k:Le,k1:Le,k2:Le,k3:Le,k4:Le,kernelMatrix:vs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Le,overlineThickness:Le,paintOrder:null,panose1:null,path:null,pathLength:Le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Le,pointsAtY:Le,pointsAtZ:Le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vs,rev:vs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vs,requiredFeatures:vs,requiredFonts:vs,requiredFormats:vs,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Le,specularExponent:Le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Le,strikethroughThickness:Le,string:null,stroke:null,strokeDashArray:vs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Le,strokeOpacity:Le,strokeWidth:null,style:null,surfaceScale:Le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vs,tabIndex:Le,tableValues:null,target:null,targetX:Le,targetY:Le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Le,underlineThickness:Le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Le,values:null,vAlphabetic:Le,vMathematical:Le,vectorEffect:null,vHanging:Le,vIdeographic:Le,version:null,vertAdvY:Le,vertOriginX:Le,vertOriginY:Le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:K5}),Y5=Tc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),V5=Tc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:q5}),X5=Tc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),EK={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},_K=/[A-Z]/g,RN=/-[a-z]/g,CK=/^data[-\w.:]+$/i;function TK(e,t){const n=Px(t);let s=t,r=bs;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&CK.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(RN,MK);s="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!RN.test(i)){let a=i.replace(_K,AK);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}r=uk}return new r(s,t)}function AK(e){return"-"+e.toLowerCase()}function MK(e){return e.charAt(1).toUpperCase()}const jK=$5([G5,SK,Y5,V5,X5],"html"),dk=$5([G5,NK,Y5,V5,X5],"svg");function RK(e){return e.join(" ").trim()}var Q5={},ON=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,OK=/\n/g,DK=/^\s*/,IK=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,LK=/^:\s*/,PK=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,zK=/^[;\s]*/,UK=/^\s+|\s+$/g,FK=`
508
+ `,DN="/",IN="*",Va="",BK="comment",HK="declaration",$K=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,s=1;function r(m){var k=m.match(OK);k&&(n+=k.length);var w=m.lastIndexOf(FK);s=~w?m.length-w:s+m.length}function i(){var m={line:n,column:s};return function(k){return k.position=new a(m),u(),k}}function a(m){this.start=m,this.end={line:n,column:s},this.source=t.source}a.prototype.content=e;function l(m){var k=new Error(t.source+":"+n+":"+s+": "+m);if(k.reason=m,k.filename=t.source,k.line=n,k.column=s,k.source=e,!t.silent)throw k}function c(m){var k=m.exec(e);if(k){var w=k[0];return r(w),e=e.slice(w.length),k}}function u(){c(DK)}function d(m){var k;for(m=m||[];k=f();)k!==!1&&m.push(k);return m}function f(){var m=i();if(!(DN!=e.charAt(0)||IN!=e.charAt(1))){for(var k=2;Va!=e.charAt(k)&&(IN!=e.charAt(k)||DN!=e.charAt(k+1));)++k;if(k+=2,Va===e.charAt(k-1))return l("End of comment missing");var w=e.slice(2,k-2);return s+=2,r(w),e=e.slice(k),s+=2,m({type:BK,comment:w})}}function h(){var m=i(),k=c(IK);if(k){if(f(),!c(LK))return l("property missing ':'");var w=c(PK),g=m({type:HK,property:LN(k[0].replace(ON,Va)),value:w?LN(w[0].replace(ON,Va)):Va});return c(zK),g}}function p(){var m=[];d(m);for(var k;k=h();)k!==!1&&(m.push(k),d(m));return m}return u(),p()};function LN(e){return e?e.replace(UK,Va):Va}var GK=$K;function KK(e,t){var n=null;if(!e||typeof e!="string")return n;for(var s,r=GK(e),i=typeof t=="function",a,l,c=0,u=r.length;c<u;c++)s=r[c],a=s.property,l=s.value,i?t(a,l,s):l&&(n||(n={}),n[a]=l);return n}var qK=KK,_m={};_m.__esModule=!0;_m.camelCase=void 0;var YK=/^--[a-zA-Z0-9-]+$/,VK=/-([a-z])/g,XK=/^[^-]+$/,QK=/^-(webkit|moz|ms|o)-/,WK=function(e){return!e||XK.test(e)||YK.test(e)?e:e.toLowerCase().replace(QK,function(t,n){return n+"-"}).replace(VK,function(t,n){return n.toUpperCase()})};_m.camelCase=WK;(function(e){var t=Wk&&Wk.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};e.__esModule=!0;var n=t(qK),s=_m;function r(i){if(!i||typeof i!="string")return{};var a={};return n.default(i,function(l,c){l&&c&&(a[s.camelCase(l)]=c)}),a}e.default=r})(Q5);const ZK=vd(Q5),W5=Z5("end"),fk=Z5("start");function Z5(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function JK(e){const t=fk(e),n=W5(e);if(t&&n)return{start:t,end:n}}function _u(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?PN(e.position):"start"in e||"end"in e?PN(e):"line"in e||"column"in e?Fx(e):""}function Fx(e){return zN(e&&e.line)+":"+zN(e&&e.column)}function PN(e){return Fx(e&&e.start)+"-"+Fx(e&&e.end)}function zN(e){return e&&typeof e=="number"?e:1}class Yn extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let r="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?r=t:!i.cause&&t&&(a=!0,r=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?i.ruleId=s:(i.source=s.slice(0,c),i.ruleId=s.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=_u(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Yn.prototype.file="";Yn.prototype.name="";Yn.prototype.reason="";Yn.prototype.message="";Yn.prototype.stack="";Yn.prototype.column=void 0;Yn.prototype.line=void 0;Yn.prototype.ancestors=void 0;Yn.prototype.cause=void 0;Yn.prototype.fatal=void 0;Yn.prototype.place=void 0;Yn.prototype.ruleId=void 0;Yn.prototype.source=void 0;const hk={}.hasOwnProperty,eq=new Map,tq=/[A-Z]/g,nq=new Set(["table","tbody","thead","tfoot","tr"]),sq=new Set(["td","th"]),J5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function rq(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=fq(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=dq(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?dk:jK,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=e3(r,e,void 0);return i&&typeof i!="string"?i:r.create(e,r.Fragment,{children:i||void 0},void 0)}function e3(e,t,n){if(t.type==="element")return iq(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return aq(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return oq(e,t,n);if(t.type==="mdxjsEsm")return lq(e,t);if(t.type==="root")return cq(e,t,n);if(t.type==="text")return uq(e,t)}function iq(e,t,n){const s=e.schema;let r=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(r=dk,e.schema=r),e.ancestors.push(t);const i=n3(e,t.tagName,!1),a=hq(e,t);let l=mk(e,t);return nq.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!kK(c):!0})),t3(e,a,i,t),pk(a,l),e.ancestors.pop(),e.schema=s,e.create(t,i,a,n)}function aq(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}fd(e,t.position)}function lq(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fd(e,t.position)}function oq(e,t,n){const s=e.schema;let r=s;t.name==="svg"&&s.space==="html"&&(r=dk,e.schema=r),e.ancestors.push(t);const i=t.name===null?e.Fragment:n3(e,t.name,!0),a=pq(e,t),l=mk(e,t);return t3(e,a,i,t),pk(a,l),e.ancestors.pop(),e.schema=s,e.create(t,i,a,n)}function cq(e,t,n){const s={};return pk(s,mk(e,t)),e.create(t,e.Fragment,s,n)}function uq(e,t){return t.value}function t3(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function pk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dq(e,t,n){return s;function s(r,i,a,l){const u=Array.isArray(a.children)?n:t;return l?u(i,a,l):u(i,a)}}function fq(e,t){return n;function n(s,r,i,a){const l=Array.isArray(i.children),c=fk(s);return t(r,i,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function hq(e,t){const n={};let s,r;for(r in t.properties)if(r!=="children"&&hk.call(t.properties,r)){const i=mq(e,r,t.properties[r]);if(i){const[a,l]=i;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&sq.has(t.tagName)?s=l:n[a]=l}}if(s){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function pq(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const i=s.data.estree.body[0];i.type;const a=i.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else fd(e,t.position);else{const r=s.name;let i;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const l=s.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else fd(e,t.position);else i=s.value===null?!0:s.value;n[r]=i}return n}function mk(e,t){const n=[];let s=-1;const r=e.passKeys?new Map:eq;for(;++s<t.children.length;){const i=t.children[s];let a;if(e.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const u=r.get(c)||0;a=c+"-"+u,r.set(c,u+1)}}const l=e3(e,i,a);l!==void 0&&n.push(l)}return n}function mq(e,t,n){const s=TK(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?gK(n):RK(n)),s.property==="style"){let r=typeof n=="object"?n:gq(e,String(n));return e.stylePropertyNameCase==="css"&&(r=bq(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&s.space?EK[s.property]||s.property:s.attribute,n]}}function gq(e,t){try{return ZK(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,r=new Yn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=J5+"#cannot-parse-style-attribute",r}}function n3(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let i=-1,a;for(;++i<r.length;){const l=AN(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(i&&l.type==="Literal"),optional:!1}:l}s=a}else s=AN(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const r=s.value;return hk.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(s);fd(e)}function fd(e,t){const n=new Yn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=J5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function bq(e){const t={};let n;for(n in e)hk.call(e,n)&&(t[xq(n)]=e[n]);return t}function xq(e){let t=e.replace(tq,yq);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function yq(e){return"-"+e.toLowerCase()}const qg={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},vq={};function gk(e,t){const n=vq,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return s3(e,s,r)}function s3(e,t,n){if(kq(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return UN(e.children,t,n)}return Array.isArray(e)?UN(e,t,n):""}function UN(e,t,n){const s=[];let r=-1;for(;++r<e.length;)s[r]=s3(e[r],t,n);return s.join("")}function kq(e){return!!(e&&typeof e=="object")}const FN=document.createElement("i");function bk(e){const t="&"+e+";";FN.innerHTML=t;const n=FN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Vs(e,t,n,s){const r=e.length;let i=0,a;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,s.length<1e4)a=Array.from(s),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<s.length;)a=s.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function Fs(e,t){return e.length>0?(Vs(e,e.length,0,t),e):t}const BN={}.hasOwnProperty;function r3(e){const t={};let n=-1;for(;++n<e.length;)wq(t,e[n]);return t}function wq(e,t){let n;for(n in t){const r=(BN.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){BN.call(r,a)||(r[a]=[]);const l=i[a];Sq(r[a],Array.isArray(l)?l:l?[l]:[])}}}function Sq(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);Vs(e,0,0,s)}function i3(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}function dr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const es=Oa(/[A-Za-z]/),qn=Oa(/[\dA-Za-z]/),Nq=Oa(/[#-'*+\--9=?A-Z^-~]/);function Ap(e){return e!==null&&(e<32||e===127)}const Bx=Oa(/\d/),Eq=Oa(/[\dA-Fa-f]/),_q=Oa(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function Bt(e){return e!==null&&(e<0||e===32)}function dt(e){return e===-2||e===-1||e===32}const Cm=Oa(new RegExp("\\p{P}","u")),Dl=Oa(/\s/);function Oa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ac(e){const t=[];let n=-1,s=0,r=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&qn(e.charCodeAt(n+1))&&qn(e.charCodeAt(n+2)))r=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),r=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(s,n),encodeURIComponent(a)),s=n+r+1,a=""),r&&(n+=r,r=0)}return t.join("")+e.slice(s)}function Et(e,t,n,s){const r=s?s-1:1/0;let i=0;return a;function a(c){return dt(c)?(e.enter(n),l(c)):t(c)}function l(c){return dt(c)&&i++<r?(e.consume(c),l):(e.exit(n),t(c))}}function a3(e,t,n,s,r,i){let a=0;return l;function l(d){return dt(d)?(e.enter(s),c(d)):u(d)}function c(d){return dt(d)&&a<i?(e.consume(d),a++,c):(e.exit(s),u(d))}function u(d){return a>=r?t(d):n(d)}}const Cq={tokenize:Tq};function Tq(e){const t=e.attempt(this.parser.constructs.contentInitial,s,r);let n;return t;function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Et(e,t,"linePrefix")}function r(l){return e.enter("paragraph"),i(l)}function i(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return et(l)?(e.consume(l),e.exit("chunkText"),i):(e.consume(l),a)}}let Mp=class{constructor(){this.index=new Map,this.map=[]}add(t,n,s){HN(this,t,n,s,!1)}addBefore(t,n,s){HN(this,t,n,s,!0)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let r=s.pop();for(;r;){for(const i of r)t.push(i);r=s.pop()}this.map.length=0,this.index.clear()}};function HN(e,t,n,s,r){if(n===0&&s.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,r?(s.push(...i[2]),i[2]=s):i[2].push(...s);return}const a=[t,n,s];e.map.push(a),e.index.set(t,a)}const Aq={tokenize:Mq},$N={tokenize:jq};function Mq(e){const t=this,n=[];let s=0,r,i,a;return l;function l(b){if(s<n.length){const S=n[s];return t.containerState=S[1],e.attempt(S[0].continuation,c,u)(b)}return u(b)}function c(b){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const S=t.events.length;let M=S,E;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){E=t.events[M][1].end;break}g(s);let A=S;for(;A<t.events.length;)t.events[A][1].end={...E},A++;const R=new Mp;return R.add(M+1,0,t.events.slice(S)),R.add(S,A-S,[]),R.consume(t.events),u(b)}return l(b)}function u(b){if(s===n.length){if(!r)return h(b);if(r.currentConstruct&&r.currentConstruct.concrete)return m(b);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($N,d,f)(b)}function d(b){return r&&y(),g(s),h(b)}function f(b){return t.parser.lazy[t.now().line]=s!==n.length,a=t.now().offset,m(b)}function h(b){return t.containerState={},e.attempt($N,p,m)(b)}function p(b){return s++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){r&&y(),g(0),e.consume(b);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:i}),k(b)}function k(b){if(b===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(b);return}return et(b)?(e.consume(b),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,l):(e.consume(b),k)}function w(b,S){const M=t.sliceStream(b);if(S&&M.push(null),b.previous=i,i&&(i.next=b),i=b,r.defineSkip(b.start),r.write(M),t.parser.lazy[b.start.line]){let E=r.events.length;for(;E--;)if(r.events[E][1].start.offset<a&&(!r.events[E][1].end||r.events[E][1].end.offset>a))return;const A=t.events.length;let R=A,D,_;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(D){_=t.events[R][1].end;break}D=!0}for(g(s),E=A;E<t.events.length;)t.events[E][1].end={..._},E++;const z=new Mp;z.add(R+1,0,t.events.slice(A)),z.add(A,E-A,[]),z.consume(t.events)}}function g(b){let S=n.length;for(;S-- >b;){const M=n[S];t.containerState=M[1],M[0].exit.call(t,e)}n.length=b}function y(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}function jq(e,t,n){return Et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function jp(e){if(e===null||Bt(e)||Dl(e))return 1;if(Cm(e))return 2}function Tm(e,t,n){const s=[];let r=-1;for(;++r<e.length;){const i=e[r].resolveAll;i&&!s.includes(i)&&(t=i(t,n),s.push(i))}return t}const Hx={name:"attention",resolveAll:Rq,tokenize:Oq};function Rq(e,t){let n=-1,s;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const i=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,a={...e[r][1].end},l={...e[n][1].start};GN(a,-i),GN(l,i);const c={type:i>1?"strongSequence":"emphasisSequence",start:a,end:{...e[r][1].end}},u={type:i>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:l},d={type:i>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},f={type:i>1?"strong":"emphasis",start:{...c.start},end:{...u.end}};e[r][1].end={...c.start},e[n][1].start={...u.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=Fs(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=Fs(s,[["enter",f,t],["enter",c,t],["exit",c,t],["enter",d,t]]),s=Fs(s,Tm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=Fs(s,[["exit",d,t],["enter",u,t],["exit",u,t],["exit",f,t]]);let h=0;e[n][1].end.offset-e[n][1].start.offset&&(h=2,s=Fs(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),Vs(e,r-1,n-r+3,s),n=r+s.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Oq(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,r=jp(s);let i;return a;function a(c){return i=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===i)return e.consume(c),l;const u=e.exit("attentionSequence"),d=jp(c),f=!d||d===2&&r||n.includes(c)&&c!==42&&c!==95,h=!r||r===2&&d||n.includes(s)&&s!==42&&s!==95;return u._open=!!(i===42?f:f&&(r||!h)),u._close=!!(i===42?h:h&&(d||!f)),t(c)}}function GN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Dq={name:"autolink",tokenize:Iq};function Iq(e,t,n){let s=0;return r;function r(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return es(p)?(e.consume(p),a):p===64?n(p):u(p)}function a(p){return p===43||p===45||p===46||qn(p)?(s=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),s=0,c):(p===43||p===45||p===46||qn(p))&&s++<32?(e.consume(p),l):(s=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Ap(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):Nq(p)?(e.consume(p),u):n(p)}function d(p){return qn(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),s=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||qn(p))&&s++<63){const m=p===45?h:f;return e.consume(p),m}return n(p)}}const tf={partial:!0,tokenize:Lq};function Lq(e,t,n){return s;function s(i){return dt(i)?Et(e,r,"linePrefix")(i):r(i)}function r(i){return i===null||et(i)?t(i):n(i)}}const l3={continuation:{tokenize:zq},exit:Uq,name:"blockQuote",tokenize:Pq};function Pq(e,t,n){const s=this;return r;function r(a){if(a===62){const l=s.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return n(a)}function i(a){return dt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function zq(e,t,n){const s=this;return r;function r(a){return dt(a)?Et(e,i,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(l3,t,n)(a)}}function Uq(e){e.exit("blockQuote")}const o3={name:"characterEscape",tokenize:Fq};function Fq(e,t,n){return s;function s(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),r}function r(i){return _q(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const c3={name:"characterReference",tokenize:Bq};function Bq(e,t,n){const s=this;let r=0,i,a;return l;function l(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,a=qn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=Eq,d):(e.enter("characterReferenceValue"),i=7,a=Bx,d(f))}function d(f){if(f===59&&r){const h=e.exit("characterReferenceValue");return a===qn&&!bk(s.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(f)&&r++<i?(e.consume(f),d):n(f)}}const $x={partial:!0,tokenize:Hq};function Hq(e,t,n){const s=this;return r;function r(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return s.parser.lazy[s.now().line]?n(a):t(a)}}const KN={concrete:!0,name:"codeFenced",tokenize:$q};function $q(e,t,n){const s=this,r={partial:!0,tokenize:M};let i=0,a=0,l;return c;function c(E){return u(E)}function u(E){const A=s.events[s.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(E)}function d(E){return E===l?(a++,e.consume(E),d):a<3?n(E):(e.exit("codeFencedFenceSequence"),dt(E)?Et(e,f,"whitespace")(E):f(E))}function f(E){return E===null||et(E)?(e.exit("codeFencedFence"),s.interrupt?t(E):e.check($x,k,S)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||et(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(E)):dt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Et(e,p,"whitespace")(E)):E===96&&E===l?n(E):(e.consume(E),h)}function p(E){return E===null||et(E)?f(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||et(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(E)):E===96&&E===l?n(E):(e.consume(E),m)}function k(E){return e.attempt(r,S,w)(E)}function w(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),g}function g(E){return i>0&&dt(E)?Et(e,y,"linePrefix",i+1)(E):y(E)}function y(E){return E===null||et(E)?e.check($x,k,S)(E):(e.enter("codeFlowValue"),b(E))}function b(E){return E===null||et(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),b)}function S(E){return e.exit("codeFenced"),t(E)}function M(E,A,R){let D=0;return _;function _(L){return E.enter("lineEnding"),E.consume(L),E.exit("lineEnding"),z}function z(L){return E.enter("codeFencedFence"),dt(L)?Et(E,$,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):$(L)}function $(L){return L===l?(E.enter("codeFencedFenceSequence"),H(L)):R(L)}function H(L){return L===l?(D++,E.consume(L),H):D>=a?(E.exit("codeFencedFenceSequence"),dt(L)?Et(E,I,"whitespace")(L):I(L)):R(L)}function I(L){return L===null||et(L)?(E.exit("codeFencedFence"),A(L)):R(L)}}}const Yg={name:"codeIndented",tokenize:Kq},Gq={partial:!0,tokenize:qq};function Kq(e,t,n){return s;function s(l){return e.enter("codeIndented"),a3(e,r,n,"linePrefix",4,4)(l)}function r(l){return l===null?a(l):et(l)?e.attempt(Gq,r,a)(l):(e.enter("codeFlowValue"),i(l))}function i(l){return l===null||et(l)?(e.exit("codeFlowValue"),r(l)):(e.consume(l),i)}function a(l){return e.exit("codeIndented"),t(l)}}function qq(e,t,n){const s=this;return r;function r(a){return s.parser.lazy[s.now().line]?n(a):et(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r):a3(e,t,i,"linePrefix",4,4)(a)}function i(a){return et(a)?r(a):n(a)}}const Yq={name:"codeText",previous:Xq,resolve:Vq,tokenize:Qq};function Vq(e){let t=e.length-4,n=3,s,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)r===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(r=s):(s===t||e[s][1].type==="lineEnding")&&(e[r][1].type="codeTextData",s!==r+2&&(e[r][1].end=e[s-1][1].end,e.splice(r+2,s-r-2),t-=s-r-2,s=r+2),r=void 0);return e}function Xq(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Qq(e,t,n){let s=0,r,i;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),s++,l):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(i=e.enter("codeTextSequence"),r=0,d(f)):et(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||et(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),r++,d):r===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",u(f))}}function u3(e){const t={};let n=-1,s,r,i,a,l,c,u;for(;++n<e.length;){for(;n in t;)n=t[n];if(s=e[n],n&&s[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(c=s[1]._tokenizer.events,i=0,i<c.length&&c[i][1].type==="lineEndingBlank"&&(i+=2),i<c.length&&c[i][1].type==="content"))for(;++i<c.length&&c[i][1].type!=="content";)c[i][1].type==="chunkText"&&(c[i][1]._isInFirstContentOfListItem=!0,i++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,Wq(e,n)),n=t[n],u=!0);else if(s[1]._container){for(i=n,r=void 0;i--&&(a=e[i],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(r&&(e[r][1].type="lineEndingBlank"),a[1].type="lineEnding",r=i);r&&(s[1].end=Object.assign({},e[r][1].start),l=e.slice(r,n),l.unshift(s),Vs(e,r,n-r+1,l))}}return!u}function Wq(e,t){const n=e[t][1],s=e[t][2];let r=t-1;const i=[],a=n._tokenizer||s.parser[n.contentType](n.start),l=a.events,c=[],u={};let d,f,h=-1,p=n,m=0,k=0;const w=[k];for(;p;){for(;e[++r][1]!==p;);i.push(r),p._tokenizer||(d=s.sliceStream(p),p.next||d.push(null),f&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(k=h+1,w.push(k),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):w.pop(),h=w.length;h--;){const g=l.slice(w[h],w[h+1]),y=i.pop();c.unshift([y,y+g.length-1]),Vs(e,y,2,g)}for(h=-1;++h<c.length;)u[m+c[h][0]]=m+c[h][1],m+=c[h][1]-c[h][0]-1;return u}const Zq={resolve:eY,tokenize:tY},Jq={partial:!0,tokenize:nY};function eY(e){return u3(e),e}function tY(e,t){let n;return s;function s(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(l)}function r(l){return l===null?i(l):et(l)?e.check(Jq,a,i)(l):(e.consume(l),r)}function i(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function a(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function nY(e,t,n){const s=this;return r;function r(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Et(e,i,"linePrefix")}function i(a){if(a===null||et(a))return n(a);const l=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):e.interrupt(s.parser.constructs.flow,n,t)(a)}}function d3(e,t,n,s,r,i,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(s),e.enter(r),e.enter(i),e.consume(g),e.exit(i),h):g===null||g===32||g===41||Ap(g)?n(g):(e.enter(s),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(g))}function h(g){return g===62?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),e.exit(s),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(l),h(g)):g===null||g===60||et(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function k(g){return!d&&(g===null||g===41||Bt(g))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(s),t(g)):d<u&&g===40?(e.consume(g),d++,k):g===41?(e.consume(g),d--,k):g===null||g===32||g===40||Ap(g)?n(g):(e.consume(g),g===92?w:k)}function w(g){return g===40||g===41||g===92?(e.consume(g),k):k(g)}}function f3(e,t,n,s,r,i){const a=this;let l=0,c;return u;function u(p){return e.enter(s),e.enter(r),e.consume(p),e.exit(r),e.enter(i),d}function d(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(r),e.consume(p),e.exit(r),e.exit(s),t):et(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||et(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!dt(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function h3(e,t,n,s,r,i){let a;return l;function l(h){return h===34||h===39||h===40?(e.enter(s),e.enter(r),e.consume(h),e.exit(r),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(r),e.consume(h),e.exit(r),e.exit(s),t):(e.enter(i),u(h))}function u(h){return h===a?(e.exit(i),c(a)):h===null?n(h):et(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Et(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||et(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Cu(e,t){let n;return s;function s(r){return et(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,s):dt(r)?Et(e,s,n?"linePrefix":"lineSuffix")(r):t(r)}}const sY={name:"definition",tokenize:iY},rY={partial:!0,tokenize:aY};function iY(e,t,n){const s=this;let r;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return f3.call(s,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return r=dr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return Bt(p)?Cu(e,u)(p):u(p)}function u(p){return d3(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(rY,f,f)(p)}function f(p){return dt(p)?Et(e,h,"whitespace")(p):h(p)}function h(p){return p===null||et(p)?(e.exit("definition"),s.parser.defined.push(r),t(p)):n(p)}}function aY(e,t,n){return s;function s(l){return Bt(l)?Cu(e,r)(l):n(l)}function r(l){return h3(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return dt(l)?Et(e,a,"whitespace")(l):a(l)}function a(l){return l===null||et(l)?t(l):n(l)}}const lY={name:"hardBreakEscape",tokenize:oY};function oY(e,t,n){return s;function s(i){return e.enter("hardBreakEscape"),e.consume(i),r}function r(i){return et(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const cY={name:"headingAtx",resolve:uY,tokenize:dY};function uY(e,t){let n=e.length-2,s=3;if(e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s){const r={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},i={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"};Vs(e,s,n-s+1,[["enter",r,t],["enter",i,t],["exit",i,t],["exit",r,t]])}return e}function dY(e,t,n){let s=0;return r;function r(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&s++<6?(e.consume(d),a):d===null||Bt(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||et(d)?(e.exit("atxHeading"),t(d)):dt(d)?Et(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Bt(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const fY=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],qN=["pre","script","style","textarea"],hY={concrete:!0,name:"htmlFlow",resolveTo:mY,tokenize:gY},pY={partial:!0,tokenize:bY};function mY(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function gY(e,t,n){const s=this;let r,i,a,l,c;return u;function u(T){return d(T)}function d(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),f}function f(T){return T===33?(e.consume(T),h):T===47?(e.consume(T),i=!0,k):T===63?(e.consume(T),r=3,s.interrupt?t:j):es(T)?(e.consume(T),a=String.fromCharCode(T),w):n(T)}function h(T){return T===45?(e.consume(T),r=2,p):T===91?(e.consume(T),r=5,l=0,m):es(T)?(e.consume(T),r=4,s.interrupt?t:j):n(T)}function p(T){return T===45?(e.consume(T),s.interrupt?t:j):n(T)}function m(T){const Z="CDATA[";return T===Z.charCodeAt(l++)?(e.consume(T),l===Z.length?s.interrupt?t:$:m):n(T)}function k(T){return es(T)?(e.consume(T),a=String.fromCharCode(T),w):n(T)}function w(T){if(T===null||T===47||T===62||Bt(T)){const Z=T===47,te=a.toLowerCase();return!Z&&!i&&qN.includes(te)?(r=1,s.interrupt?t(T):$(T)):fY.includes(a.toLowerCase())?(r=6,Z?(e.consume(T),g):s.interrupt?t(T):$(T)):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(T):i?y(T):b(T))}return T===45||qn(T)?(e.consume(T),a+=String.fromCharCode(T),w):n(T)}function g(T){return T===62?(e.consume(T),s.interrupt?t:$):n(T)}function y(T){return dt(T)?(e.consume(T),y):_(T)}function b(T){return T===47?(e.consume(T),_):T===58||T===95||es(T)?(e.consume(T),S):dt(T)?(e.consume(T),b):_(T)}function S(T){return T===45||T===46||T===58||T===95||qn(T)?(e.consume(T),S):M(T)}function M(T){return T===61?(e.consume(T),E):dt(T)?(e.consume(T),M):b(T)}function E(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),c=T,A):dt(T)?(e.consume(T),E):R(T)}function A(T){return T===c?(e.consume(T),c=null,D):T===null||et(T)?n(T):(e.consume(T),A)}function R(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||Bt(T)?M(T):(e.consume(T),R)}function D(T){return T===47||T===62||dt(T)?b(T):n(T)}function _(T){return T===62?(e.consume(T),z):n(T)}function z(T){return T===null||et(T)?$(T):dt(T)?(e.consume(T),z):n(T)}function $(T){return T===45&&r===2?(e.consume(T),C):T===60&&r===1?(e.consume(T),O):T===62&&r===4?(e.consume(T),N):T===63&&r===3?(e.consume(T),j):T===93&&r===5?(e.consume(T),F):et(T)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(pY,G,H)(T)):T===null||et(T)?(e.exit("htmlFlowData"),H(T)):(e.consume(T),$)}function H(T){return e.check($x,I,G)(T)}function I(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),L}function L(T){return T===null||et(T)?H(T):(e.enter("htmlFlowData"),$(T))}function C(T){return T===45?(e.consume(T),j):$(T)}function O(T){return T===47?(e.consume(T),a="",U):$(T)}function U(T){if(T===62){const Z=a.toLowerCase();return qN.includes(Z)?(e.consume(T),N):$(T)}return es(T)&&a.length<8?(e.consume(T),a+=String.fromCharCode(T),U):$(T)}function F(T){return T===93?(e.consume(T),j):$(T)}function j(T){return T===62?(e.consume(T),N):T===45&&r===2?(e.consume(T),j):$(T)}function N(T){return T===null||et(T)?(e.exit("htmlFlowData"),G(T)):(e.consume(T),N)}function G(T){return e.exit("htmlFlow"),t(T)}}function bY(e,t,n){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tf,t,n)}}const xY={name:"htmlText",tokenize:yY};function yY(e,t,n){const s=this;let r,i,a;return l;function l(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),c}function c(j){return j===33?(e.consume(j),u):j===47?(e.consume(j),M):j===63?(e.consume(j),b):es(j)?(e.consume(j),R):n(j)}function u(j){return j===45?(e.consume(j),d):j===91?(e.consume(j),i=0,m):es(j)?(e.consume(j),y):n(j)}function d(j){return j===45?(e.consume(j),p):n(j)}function f(j){return j===null?n(j):j===45?(e.consume(j),h):et(j)?(a=f,O(j)):(e.consume(j),f)}function h(j){return j===45?(e.consume(j),p):f(j)}function p(j){return j===62?C(j):j===45?h(j):f(j)}function m(j){const N="CDATA[";return j===N.charCodeAt(i++)?(e.consume(j),i===N.length?k:m):n(j)}function k(j){return j===null?n(j):j===93?(e.consume(j),w):et(j)?(a=k,O(j)):(e.consume(j),k)}function w(j){return j===93?(e.consume(j),g):k(j)}function g(j){return j===62?C(j):j===93?(e.consume(j),g):k(j)}function y(j){return j===null||j===62?C(j):et(j)?(a=y,O(j)):(e.consume(j),y)}function b(j){return j===null?n(j):j===63?(e.consume(j),S):et(j)?(a=b,O(j)):(e.consume(j),b)}function S(j){return j===62?C(j):b(j)}function M(j){return es(j)?(e.consume(j),E):n(j)}function E(j){return j===45||qn(j)?(e.consume(j),E):A(j)}function A(j){return et(j)?(a=A,O(j)):dt(j)?(e.consume(j),A):C(j)}function R(j){return j===45||qn(j)?(e.consume(j),R):j===47||j===62||Bt(j)?D(j):n(j)}function D(j){return j===47?(e.consume(j),C):j===58||j===95||es(j)?(e.consume(j),_):et(j)?(a=D,O(j)):dt(j)?(e.consume(j),D):C(j)}function _(j){return j===45||j===46||j===58||j===95||qn(j)?(e.consume(j),_):z(j)}function z(j){return j===61?(e.consume(j),$):et(j)?(a=z,O(j)):dt(j)?(e.consume(j),z):D(j)}function $(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),r=j,H):et(j)?(a=$,O(j)):dt(j)?(e.consume(j),$):(e.consume(j),I)}function H(j){return j===r?(e.consume(j),r=void 0,L):j===null?n(j):et(j)?(a=H,O(j)):(e.consume(j),H)}function I(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||Bt(j)?D(j):(e.consume(j),I)}function L(j){return j===47||j===62||Bt(j)?D(j):n(j)}function C(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function O(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),U}function U(j){return dt(j)?Et(e,F,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return e.enter("htmlTextData"),a(j)}}const xk={name:"labelEnd",resolveAll:SY,resolveTo:NY,tokenize:EY},vY={tokenize:_Y},kY={tokenize:CY},wY={tokenize:TY};function SY(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const r=s.type==="labelImage"?4:2;s.type="data",t+=r}}return e.length!==n.length&&Vs(e,0,e.length,n),e}function NY(e,t){let n=e.length,s=0,r,i,a;for(;n--;){const d=e[n][1];if(r){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;e[n][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(i){if(e[n][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(r=n,d.type!=="labelLink")){s=2;break}}else d.type==="labelEnd"&&(i=n)}const l={type:e[r][1].type==="labelLink"?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[i-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=Fs(a,e.slice(r+1,r+s+3)),a=Fs(a,[["enter",u,t]]),a=Fs(a,Tm(t.parser.constructs.insideSpan.null,e.slice(r+s+4,i-3),t)),a=Fs(a,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),a=Fs(a,e.slice(i+1)),a=Fs(a,[["exit",l,t]]),Vs(e,r,e.length,a),e}function EY(e,t,n){const s=this,r=s._labelStarts;let i,a;if(r){for(;r.length>0&&r[r.length-1]._balanced;)r.pop();i=r[r.length-1]}return l;function l(h){return i?i._inactive?f(h):(a=s.parser.defined.includes(dr(s.sliceSerialize({start:i.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(vY,d,a?d:f)(h):h===91?e.attempt(kY,d,a?u:f)(h):a?d(h):f(h)}function u(h){return e.attempt(wY,d,f)(h)}function d(h){return r.pop(),t(h)}function f(h){return i._balanced=!0,n(h)}}function _Y(e,t,n){return s;function s(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),r}function r(f){return Bt(f)?Cu(e,i)(f):i(f)}function i(f){return f===41?d(f):d3(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return Bt(f)?Cu(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?h3(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return Bt(f)?Cu(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function CY(e,t,n){const s=this;return r;function r(l){return f3.call(s,e,i,a,"reference","referenceMarker","referenceString")(l)}function i(l){return s.parser.defined.includes(dr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function a(l){return n(l)}}function TY(e,t,n){return s;function s(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),r}function r(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const AY={name:"labelStartImage",resolveAll:xk.resolveAll,tokenize:MY};function MY(e,t,n){const s=this;let r;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),r=e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(c):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(r),t(c))}}const jY={name:"labelStartLink",resolveAll:xk.resolveAll,tokenize:RY};function RY(e,t,n){const s=this;let r;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),r=e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(l):(s._labelStarts=s._labelStarts||[],s._labelStarts.push(r),t(l))}}const Vg={name:"lineEnding",tokenize:OY};function OY(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Et(e,t,"linePrefix")}}const Dh={name:"thematicBreak",tokenize:DY};function DY(e,t,n){let s=0,r;return i;function i(u){return e.enter("thematicBreak"),a(u)}function a(u){return r=u,l(u)}function l(u){return u===r?(e.enter("thematicBreakSequence"),c(u)):s>=3&&(u===null||et(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),s++,c):(e.exit("thematicBreakSequence"),dt(u)?Et(e,l,"whitespace")(u):l(u))}}const os={continuation:{tokenize:zY},exit:FY,name:"list",tokenize:PY},IY={partial:!0,tokenize:BY},LY={partial:!0,tokenize:UY};function PY(e,t,n){const s=this,r=s.events[s.events.length-1];let i=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,a=0;return l;function l(p){const m=s.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!s.containerState.marker||p===s.containerState.marker:Bx(p)){if(s.containerState.type||(s.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Dh,n,u)(p):u(p);if(!s.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return Bx(p)&&++a<10?(e.consume(p),c):(!s.interrupt||a<2)&&(s.containerState.marker?p===s.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||p,e.check(tf,s.interrupt?n:d,e.attempt(IY,h,f))}function d(p){return s.containerState.initialBlankLine=!0,i++,h(p)}function f(p){return dt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return s.containerState.size=i+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function zY(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(tf,r,i);function r(l){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Et(e,t,"listItemIndent",s.containerState.size+1)(l)}function i(l){return s.containerState.furtherBlankLines||!dt(l)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,a(l)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(LY,t,a)(l))}function a(l){return s.containerState._closeFlow=!0,s.interrupt=void 0,Et(e,e.attempt(os,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function UY(e,t,n){const s=this;return Et(e,r,"listItemIndent",s.containerState.size+1);function r(i){const a=s.events[s.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===s.containerState.size?t(i):n(i)}}function FY(e){e.exit(this.containerState.type)}function BY(e,t,n){const s=this;return Et(e,r,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(i){const a=s.events[s.events.length-1];return!dt(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const YN={name:"setextUnderline",resolveTo:HY,tokenize:$Y};function HY(e,t){const n=new Mp;let s=e.length,r,i,a;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){r=s;break}e[s][1].type==="paragraph"&&(i=s)}else e[s][1].type==="content"&&n.add(s,1,[]),!a&&e[s][1].type==="definition"&&(a=s);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(n.add(i,0,[["enter",l,t]]),n.add(a+1,0,[["exit",e[r][1],t]]),e[r][1].end={...e[a][1].end}):e[r][1]=l,n.add(e.length,0,[["exit",l,t]]),n.consume(e),e}function $Y(e,t,n){const s=this;let r;return i;function i(u){let d=s.events.length,f;for(;d--;)if(s.events[d][1].type!=="lineEnding"&&s.events[d][1].type!=="linePrefix"&&s.events[d][1].type!=="content"){f=s.events[d][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||f)?(e.enter("setextHeadingLine"),r=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===r?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),dt(u)?Et(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||et(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const GY={tokenize:KY};function KY(e){const t=this,n=e.attempt(tf,s,e.attempt(this.parser.constructs.flowInitial,r,Et(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Zq,r)),"linePrefix")));return n;function s(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const qY={resolveAll:m3()},YY=p3("string"),VY=p3("text");function p3(e){return{resolveAll:m3(e==="text"?XY:void 0),tokenize:t};function t(n){const s=this,r=this.parser.constructs[e],i=n.attempt(r,a,l);return a;function a(d){return u(d)?i(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=r[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(s,s.previous))return!0}return!1}}}function m3(e){return t;function t(n,s){let r=-1,i;for(;++r<=n.length;)i===void 0?n[r]&&n[r][1].type==="data"&&(i=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==i+2&&(n[i][1].end=n[r-1][1].end,n.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(n,s):n}}function XY(e,t){const n=new Mp;let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const r=e[s-1][1],i=t.sliceStream(r);let a=i.length,l=-1,c=0,u;for(;a--;){const d=i[a];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)u=!0,c++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&s===e.length&&(c=0),c){const d={type:s===e.length||u||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):n.add(s,0,[["enter",d,t],["exit",d,t]])}s++}return n.consume(e),e}const QY={42:os,43:os,45:os,48:os,49:os,50:os,51:os,52:os,53:os,54:os,55:os,56:os,57:os,62:l3},WY={91:sY},ZY={[-2]:Yg,[-1]:Yg,32:Yg},JY={35:cY,42:Dh,45:[YN,Dh],60:hY,61:YN,95:Dh,96:KN,126:KN},eV={38:c3,92:o3},tV={[-5]:Vg,[-4]:Vg,[-3]:Vg,33:AY,38:c3,42:Hx,60:[Dq,xY],91:jY,92:[lY,o3],93:xk,95:Hx,96:Yq},nV={null:[Hx,qY]},sV={null:[42,95]},rV={null:[]},iV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:sV,contentInitial:WY,disable:rV,document:QY,flow:JY,flowInitial:ZY,insideSpan:nV,string:eV,text:tV},Symbol.toStringTag,{value:"Module"}));function aV(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},i=[];let a=[],l=[];const c={attempt:A(M),check:A(E),consume:y,enter:b,exit:S,interrupt:A(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&i.push(t),u;function f(z){return a=Fs(a,z),w(),a[a.length-1]!==null?[]:(R(t,0),u.events=Tm(i,u.events,u),u.events)}function h(z,$){return oV(p(z),$)}function p(z){return lV(a,z)}function m(){const{_bufferIndex:z,_index:$,line:H,column:I,offset:L}=s;return{_bufferIndex:z,_index:$,line:H,column:I,offset:L}}function k(z){r[z.line]=z.column,_()}function w(){for(;s._index<a.length;){const z=a[s._index];if(typeof z=="string"){const $=s._index;for(s._bufferIndex<0&&(s._bufferIndex=0);s._index===$&&s._bufferIndex<z.length;)g(z.charCodeAt(s._bufferIndex))}else g(z)}}function g(z){d=d(z)}function y(z){et(z)?(s.line++,s.column=1,s.offset+=z===-3?2:1,_()):z!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===a[s._index].length&&(s._bufferIndex=-1,s._index++)),u.previous=z}function b(z,$){const H=$||{};return H.type=z,H.start=m(),u.events.push(["enter",H,u]),l.push(H),H}function S(z){const $=l.pop();return $.end=m(),u.events.push(["exit",$,u]),$}function M(z,$){R(z,$.from)}function E(z,$){$.restore()}function A(z,$){return H;function H(I,L,C){let O,U,F,j;return Array.isArray(I)?G(I):"tokenize"in I?G([I]):N(I);function N(Q){return pe;function pe(V){const q=V!==null&&Q[V],Y=V!==null&&Q.null,J=[...Array.isArray(q)?q:q?[q]:[],...Array.isArray(Y)?Y:Y?[Y]:[]];return G(J)(V)}}function G(Q){return O=Q,U=0,Q.length===0?C:T(Q[U])}function T(Q){return pe;function pe(V){return j=D(),F=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?te():Q.tokenize.call($?Object.assign(Object.create(u),$):u,c,Z,te)(V)}}function Z(Q){return z(F,j),L}function te(Q){return j.restore(),++U<O.length?T(O[U]):C}}}function R(z,$){z.resolveAll&&!i.includes(z)&&i.push(z),z.resolve&&Vs(u.events,$,u.events.length-$,z.resolve(u.events.slice($),u)),z.resolveTo&&(u.events=z.resolveTo(u.events,u))}function D(){const z=m(),$=u.previous,H=u.currentConstruct,I=u.events.length,L=Array.from(l);return{from:I,restore:C};function C(){s=z,u.previous=$,u.currentConstruct=H,u.events.length=I,l=L,_()}}function _(){s.line in r&&s.column<2&&(s.column=r[s.line],s.offset+=r[s.line]-1)}}function lV(e,t){const n=t.start._index,s=t.start._bufferIndex,r=t.end._index,i=t.end._bufferIndex;let a;if(n===r)a=[e[n].slice(s,i)];else{if(a=e.slice(n,r),s>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(s):a.shift()}i>0&&a.push(e[r].slice(0,i))}return a}function oV(e,t){let n=-1;const s=[];let r;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
509
+ `;break}case-3:{a=`\r
510
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&r)continue;a=" ";break}default:a=String.fromCharCode(i)}r=i===-2,s.push(a)}return s.join("")}function cV(e){const s={constructs:r3([iV,...(e||{}).extensions||[]]),content:r(Cq),defined:[],document:r(Aq),flow:r(GY),lazy:{},string:r(YY),text:r(VY)};return s;function r(i){return a;function a(l){return aV(s,i,l)}}}function uV(e){for(;!u3(e););return e}const VN=/[\0\t\n\r]/g;function dV(){let e=1,t="",n=!0,s;return r;function r(i,a,l){i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i));const c=[];let u=0;for(t="",n&&(i.charCodeAt(0)===65279&&u++,n=void 0);u<i.length;){VN.lastIndex=u;const d=VN.exec(i),f=d&&d.index!==void 0?d.index:i.length,h=i.charCodeAt(f);if(!d){t=i.slice(u);break}if(h===10&&u===f&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),u<f&&(c.push(i.slice(u,f)),e+=f-u),h){case 0:{c.push(65533),e++;break}case 9:{const p=Math.ceil(e/4)*4;for(c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}u=f+1}return l&&(s&&c.push(-5),t&&c.push(t),c.push(null)),c}}const fV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hV(e){return e.replace(fV,pV)}function pV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),i=r===120||r===88;return i3(n.slice(i?2:1),i?16:10)}return bk(n)||e}const g3={}.hasOwnProperty;function mV(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),gV(n)(uV(cV(n).document().write(dV()(e,t,!0))))}function gV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ge),autolinkProtocol:D,autolinkEmail:D,atxHeading:i(je),blockQuote:i(Y),characterEscape:D,characterReference:D,codeFenced:i(J),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(J,a),codeText:i(ce,a),codeTextData:D,data:D,codeFlowValue:D,definition:i(ke),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Ae),hardBreakEscape:i(ae),hardBreakTrailing:i(ae),htmlFlow:i(Oe,a),htmlFlowData:D,htmlText:i(Oe,a),htmlTextData:D,image:i(ye),label:a,link:i(ge),listItem:i($e),listItemValue:h,listOrdered:i(be,f),listUnordered:i(be),paragraph:i(ft),reference:T,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(je),strong:i(mt),thematicBreak:i(nt)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:q,autolinkProtocol:V,blockQuote:c(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:Q,characterReference:pe,codeFenced:c(w),codeFencedFence:k,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:_,codeIndented:c(g),codeText:c(L),codeTextData:_,data:_,definition:c(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:b,emphasis:c(),hardBreakEscape:c($),hardBreakTrailing:c($),htmlFlow:c(H),htmlFlowData:_,htmlText:c(I),htmlTextData:_,image:c(O),label:F,labelText:U,lineEnding:z,link:c(C),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:j,resourceTitleString:N,resource:G,setextHeading:c(R),setextHeadingLineSequence:A,setextHeadingText:E,strong:c(),thematicBreak:c()}};b3(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(ee){let ne={type:"root",children:[]};const Ce={stack:[ne],tokenStack:[],config:t,enter:l,exit:u,buffer:a,resume:d,data:n},v=[];let X=-1;for(;++X<ee.length;)if(ee[X][1].type==="listOrdered"||ee[X][1].type==="listUnordered")if(ee[X][0]==="enter")v.push(X);else{const de=v.pop();X=r(ee,de,X)}for(X=-1;++X<ee.length;){const de=t[ee[X][0]];g3.call(de,ee[X][1].type)&&de[ee[X][1].type].call(Object.assign({sliceSerialize:ee[X][2].sliceSerialize},Ce),ee[X][1])}if(Ce.tokenStack.length>0){const de=Ce.tokenStack[Ce.tokenStack.length-1];(de[1]||XN).call(Ce,void 0,de[0])}for(ne.position={start:Fi(ee.length>0?ee[0][1].start:{line:1,column:1,offset:0}),end:Fi(ee.length>0?ee[ee.length-2][1].end:{line:1,column:1,offset:0})},X=-1;++X<t.transforms.length;)ne=t.transforms[X](ne)||ne;return ne}function r(ee,ne,Ce){let v=ne-1,X=-1,de=!1,xe,fe,P,oe;for(;++v<=Ce;){const le=ee[v];switch(le[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{le[0]==="enter"?X++:X--,oe=void 0;break}case"lineEndingBlank":{le[0]==="enter"&&(xe&&!oe&&!X&&!P&&(P=v),oe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:oe=void 0}if(!X&&le[0]==="enter"&&le[1].type==="listItemPrefix"||X===-1&&le[0]==="exit"&&(le[1].type==="listUnordered"||le[1].type==="listOrdered")){if(xe){let ve=v;for(fe=void 0;ve--;){const Se=ee[ve];if(Se[1].type==="lineEnding"||Se[1].type==="lineEndingBlank"){if(Se[0]==="exit")continue;fe&&(ee[fe][1].type="lineEndingBlank",de=!0),Se[1].type="lineEnding",fe=ve}else if(!(Se[1].type==="linePrefix"||Se[1].type==="blockQuotePrefix"||Se[1].type==="blockQuotePrefixWhitespace"||Se[1].type==="blockQuoteMarker"||Se[1].type==="listItemIndent"))break}P&&(!fe||P<fe)&&(xe._spread=!0),xe.end=Object.assign({},fe?ee[fe][1].start:le[1].end),ee.splice(fe||v,0,["exit",xe,le[2]]),v++,Ce++}if(le[1].type==="listItemPrefix"){const ve={type:"listItem",_spread:!1,start:Object.assign({},le[1].start),end:void 0};xe=ve,ee.splice(v,0,["enter",ve,le[2]]),v++,Ce++,P=void 0,oe=!0}}}return ee[ne][1]._spread=de,Ce}function i(ee,ne){return Ce;function Ce(v){l.call(this,ee(v),v),ne&&ne.call(this,v)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(ee,ne,Ce){this.stack[this.stack.length-1].children.push(ee),this.stack.push(ee),this.tokenStack.push([ne,Ce||void 0]),ee.position={start:Fi(ne.start),end:void 0}}function c(ee){return ne;function ne(Ce){ee&&ee.call(this,Ce),u.call(this,Ce)}}function u(ee,ne){const Ce=this.stack.pop(),v=this.tokenStack.pop();if(v)v[0].type!==ee.type&&(ne?ne.call(this,ee,v[0]):(v[1]||XN).call(this,ee,v[0]));else throw new Error("Cannot close `"+ee.type+"` ("+_u({start:ee.start,end:ee.end})+"): it’s not open");Ce.position.end=Fi(ee.end)}function d(){return gk(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(ee){if(this.data.expectingFirstListItemValue){const ne=this.stack[this.stack.length-2];ne.start=Number.parseInt(this.sliceSerialize(ee),10),this.data.expectingFirstListItemValue=void 0}}function p(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.lang=ee}function m(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.meta=ee}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ee.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ee.replace(/(\r?\n|\r)$/g,"")}function y(ee){const ne=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ne,Ce.identifier=dr(this.sliceSerialize(ee)).toLowerCase()}function b(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.title=ee}function S(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.url=ee}function M(ee){const ne=this.stack[this.stack.length-1];if(!ne.depth){const Ce=this.sliceSerialize(ee).length;ne.depth=Ce}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function A(ee){const ne=this.stack[this.stack.length-1];ne.depth=this.sliceSerialize(ee).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function D(ee){const Ce=this.stack[this.stack.length-1].children;let v=Ce[Ce.length-1];(!v||v.type!=="text")&&(v=rt(),v.position={start:Fi(ee.start),end:void 0},Ce.push(v)),this.stack.push(v)}function _(ee){const ne=this.stack.pop();ne.value+=this.sliceSerialize(ee),ne.position.end=Fi(ee.end)}function z(ee){const ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=ne.children[ne.children.length-1];Ce.position.end=Fi(ee.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ne.type)&&(D.call(this,ee),_.call(this,ee))}function $(){this.data.atHardBreak=!0}function H(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ee}function I(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ee}function L(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.value=ee}function C(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=ne,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function O(){const ee=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";ee.type+="Reference",ee.referenceType=ne,delete ee.url,delete ee.title}else delete ee.identifier,delete ee.label;this.data.referenceType=void 0}function U(ee){const ne=this.sliceSerialize(ee),Ce=this.stack[this.stack.length-2];Ce.label=hV(ne),Ce.identifier=dr(ne).toLowerCase()}function F(){const ee=this.stack[this.stack.length-1],ne=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const v=ee.children;Ce.children=v}else Ce.alt=ne}function j(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.url=ee}function N(){const ee=this.resume(),ne=this.stack[this.stack.length-1];ne.title=ee}function G(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function Z(ee){const ne=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ne,Ce.identifier=dr(this.sliceSerialize(ee)).toLowerCase(),this.data.referenceType="full"}function te(ee){this.data.characterReferenceType=ee.type}function Q(ee){const ne=this.sliceSerialize(ee),Ce=this.data.characterReferenceType;let v;Ce?(v=i3(ne,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):v=bk(ne);const X=this.stack[this.stack.length-1];X.value+=v}function pe(ee){const ne=this.stack.pop();ne.position.end=Fi(ee.end)}function V(ee){_.call(this,ee);const ne=this.stack[this.stack.length-1];ne.url=this.sliceSerialize(ee)}function q(ee){_.call(this,ee);const ne=this.stack[this.stack.length-1];ne.url="mailto:"+this.sliceSerialize(ee)}function Y(){return{type:"blockquote",children:[]}}function J(){return{type:"code",lang:null,meta:null,value:""}}function ce(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function ae(){return{type:"break"}}function Oe(){return{type:"html",value:""}}function ye(){return{type:"image",title:null,url:"",alt:null}}function ge(){return{type:"link",title:null,url:"",children:[]}}function be(ee){return{type:"list",ordered:ee.type==="listOrdered",start:null,spread:ee._spread,children:[]}}function $e(ee){return{type:"listItem",spread:ee._spread,checked:null,children:[]}}function ft(){return{type:"paragraph",children:[]}}function mt(){return{type:"strong",children:[]}}function rt(){return{type:"text",value:""}}function nt(){return{type:"thematicBreak"}}}function Fi(e){return{line:e.line,column:e.column,offset:e.offset}}function b3(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?b3(e,s):bV(e,s)}}function bV(e,t){let n;for(n in t)if(g3.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function XN(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_u({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_u({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_u({start:t.start,end:t.end})+") is still open")}function xV(e){const t=this;t.parser=n;function n(s){return mV(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function yV(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function vV(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
511
+ `}]}function kV(e,t){const n=t.value?t.value+`
512
+ `:"",s={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(s.className=["language-"+r[0]]);let i={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function wV(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SV(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NV(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),r=Ac(s.toLowerCase()),i=e.footnoteOrder.indexOf(s);let a,l=e.footnoteCounts.get(s);l===void 0?(l=0,e.footnoteOrder.push(s),a=e.footnoteOrder.length):a=i+1,l+=1,e.footnoteCounts.set(s,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function EV(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _V(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function x3(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const r=e.all(t),i=r[0];i&&i.type==="text"?i.value="["+i.value:r.unshift({type:"text",value:"["});const a=r[r.length-1];return a&&a.type==="text"?a.value+=s:r.push({type:"text",value:s}),r}function CV(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return x3(e,t);const r={src:Ac(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(r.title=s.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function TV(e,t){const n={src:Ac(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function AV(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function MV(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return x3(e,t);const r={href:Ac(s.url||"")};s.title!==null&&s.title!==void 0&&(r.title=s.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function jV(e,t){const n={href:Ac(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function RV(e,t,n){const s=e.all(t),r=n?OV(n):y3(t),i={},a=[];if(typeof t.checked=="boolean"){const d=s[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},s.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<s.length;){const d=s[l];(r||l!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
513
+ `}),d.type==="element"&&d.tagName==="p"&&!r?a.push(...d.children):a.push(d)}const c=s[s.length-1];c&&(r||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
514
+ `});const u={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,u),e.applyData(t,u)}function OV(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s<n.length;)t=y3(n[s])}return t}function y3(e){const t=e.spread;return t??e.children.length>1}function DV(e,t){const n={},s=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r<s.length;){const a=s[r];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function IV(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LV(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function PV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zV(e,t){const n=e.all(t),s=n.shift(),r=[];if(s){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],a),r.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=fk(t.children[1]),c=W5(t.children[t.children.length-1]);l&&c&&(a.position={start:l,end:c}),r.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function UV(e,t,n){const s=n?n.children:void 0,i=(s?s.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const f=t.children[c],h={},p=a?a[c]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),u.push(m)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function FV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const QN=9,WN=32;function BV(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),r=0;const i=[];for(;s;)i.push(ZN(t.slice(r,s.index),r>0,!0),s[0]),r=s.index+s[0].length,s=n.exec(t);return i.push(ZN(t.slice(r),r>0,!1)),i.join("")}function ZN(e,t,n){let s=0,r=e.length;if(t){let i=e.codePointAt(s);for(;i===QN||i===WN;)s++,i=e.codePointAt(s)}if(n){let i=e.codePointAt(r-1);for(;i===QN||i===WN;)r--,i=e.codePointAt(r-1)}return r>s?e.slice(s,r):""}function HV(e,t){const n={type:"text",value:BV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $V(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const GV={blockquote:yV,break:vV,code:kV,delete:wV,emphasis:SV,footnoteReference:NV,heading:EV,html:_V,imageReference:CV,image:TV,inlineCode:AV,linkReference:MV,link:jV,listItem:RV,list:DV,paragraph:IV,root:LV,strong:PV,table:zV,tableCell:FV,tableRow:UV,text:HV,thematicBreak:$V,toml:Kf,yaml:Kf,definition:Kf,footnoteDefinition:Kf};function Kf(){}const v3=-1,Am=0,Tu=1,Rp=2,yk=3,vk=4,kk=5,wk=6,k3=7,w3=8,S3=typeof self=="object"?self:globalThis,JN=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new S3[e](t)},KV=(e,t)=>{const n=(r,i)=>(e.set(i,r),r),s=r=>{if(e.has(r))return e.get(r);const[i,a]=t[r];switch(i){case Am:case v3:return n(a,r);case Tu:{const l=n([],r);for(const c of a)l.push(s(c));return l}case Rp:{const l=n({},r);for(const[c,u]of a)l[s(c)]=s(u);return l}case yk:return n(new Date(a),r);case vk:{const{source:l,flags:c}=a;return n(new RegExp(l,c),r)}case kk:{const l=n(new Map,r);for(const[c,u]of a)l.set(s(c),s(u));return l}case wk:{const l=n(new Set,r);for(const c of a)l.add(s(c));return l}case k3:{const{name:l,message:c}=a;return n(typeof S3[l]=="function"?JN(l,c):new Error(c),r)}case w3:return n(BigInt(a),r);case"BigInt":return n(Object(BigInt(a)),r);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(JN(i,a),r)};return s},eE=e=>KV(new Map,e)(0),Ya="",{toString:qV}={},{keys:YV}=Object,Kc=e=>{const t=typeof e;if(t!=="object"||!e)return[Am,t];const n=qV.call(e).slice(8,-1);switch(n){case"Array":return[Tu,Ya];case"Object":return[Rp,Ya];case"Date":return[yk,Ya];case"RegExp":return[vk,Ya];case"Map":return[kk,Ya];case"Set":return[wk,Ya];case"DataView":return[Tu,n]}return n.includes("Array")?[Tu,n]:e instanceof Error?[k3,e.name||"Error"]:[Rp,n]},qf=([e,t])=>e===Am&&(t==="function"||t==="symbol"),VV=(e,t,n,s)=>{const r=(a,l)=>{const c=s.push(a)-1;return n.set(l,c),c},i=a=>{if(n.has(a))return n.get(a);let[l,c]=Kc(a);switch(l){case Am:{let d=a;switch(c){case"bigint":l=w3,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([v3],a)}return r([l,d],a)}case Tu:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),r([c,[...h]],a)}const d=[],f=r([l,d],a);for(const h of a)d.push(i(h));return f}case Rp:{if(c)switch(c){case"BigInt":return r([c,a.toString()],a);case"Boolean":case"Number":case"String":return r([c,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const d=[],f=r([l,d],a);for(const h of YV(a))(e||!qf(Kc(a[h])))&&d.push([i(h),i(a[h])]);return f}case yk:return r([l,isNaN(a.getTime())?Ya:a.toISOString()],a);case vk:{const{source:d,flags:f}=a;return r([l,{source:d,flags:f}],a)}case kk:{const d=[],f=r([l,d],a);for(const[h,p]of a)(e||!(qf(Kc(h))||qf(Kc(p))))&&d.push([i(h),i(p)]);return f}case wk:{const d=[],f=r([l,d],a);for(const h of a)(e||!qf(Kc(h)))&&d.push(i(h));return f}}const{message:u}=a;return r([l,{name:c,message:u}],a)};return i},tE=(e,{json:t,lossy:n}={})=>{const s=[];return VV(!(t||n),!!t,new Map,s)(e),s},bl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?eE(tE(e,t)):structuredClone(e):(e,t)=>eE(tE(e,t));function XV(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function QV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function WV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||XV,s=e.options.footnoteBackLabel||QV,r=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=Ac(f.toLowerCase());let p=0;const m=[],k=e.footnoteCounts.get(f);for(;k!==void 0&&++p<=k;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(c,p);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(c,p),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const y=w.children[w.children.length-1];y&&y.type==="text"?y.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else d.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,g),l.push(g)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...bl(a),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
515
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
516
+ `}]}}const nf=function(e){if(e==null)return tX;if(typeof e=="function")return Mm(e);if(typeof e=="object")return Array.isArray(e)?ZV(e):JV(e);if(typeof e=="string")return eX(e);throw new Error("Expected function, string, or object as test")};function ZV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=nf(e[n]);return Mm(s);function s(...r){let i=-1;for(;++i<t.length;)if(t[i].apply(this,r))return!0;return!1}}function JV(e){const t=e;return Mm(n);function n(s){const r=s;let i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function eX(e){return Mm(t);function t(n){return n&&n.type===e}}function Mm(e){return t;function t(n,s,r){return!!(nX(n)&&e.call(this,n,typeof s=="number"?s:void 0,r||void 0))}}function tX(){return!0}function nX(e){return e!==null&&typeof e=="object"&&"type"in e}const N3=[],sX=!0,Gx=!1,rX="skip";function E3(e,t,n,s){let r;typeof t=="function"&&typeof n!="function"?(s=n,n=t):r=t;const i=nf(r),a=s?-1:1;l(e,void 0,[])();function l(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=N3,m,k,w;if((!t||i(c,u,d[d.length-1]||void 0))&&(p=iX(n(c,d)),p[0]===Gx))return p;if("children"in c&&c.children){const g=c;if(g.children&&p[0]!==rX)for(k=(s?g.children.length:-1)+a,w=d.concat(g);k>-1&&k<g.children.length;){const y=g.children[k];if(m=l(y,k,w)(),m[0]===Gx)return m;k=typeof m[1]=="number"?m[1]:k+a}}return p}}}function iX(e){return Array.isArray(e)?e:typeof e=="number"?[sX,e]:e==null?N3:[e]}function jm(e,t,n,s){let r,i,a;typeof t=="function"&&typeof n!="function"?(i=void 0,a=t,r=n):(i=t,a=n,r=s),E3(e,i,l,r);function l(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return a(c,f,d)}}const Kx={}.hasOwnProperty,aX={};function lX(e,t){const n=t||aX,s=new Map,r=new Map,i=new Map,a={...GV,...n.handlers},l={all:u,applyData:cX,definitionById:s,footnoteById:r,footnoteCounts:i,footnoteOrder:[],handlers:a,one:c,options:n,patch:oX,wrap:dX};return jm(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?s:r,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),l;function c(d,f){const h=d.type,p=l.handlers[h];if(Kx.call(l.handlers,h)&&p)return p(l,d,f);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in d){const{children:k,...w}=d,g=bl(w);return g.children=l.all(d),g}return bl(d)}return(l.options.unknownHandler||uX)(l,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const m=l.one(h[p],d);if(m){if(p&&h[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=nE(m.value)),!Array.isArray(m)&&m.type==="element")){const k=m.children[0];k&&k.type==="text"&&(k.value=nE(k.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function oX(e,t){e.position&&(t.position=JK(e))}function cX(e,t){let n=t;if(e&&e.data){const s=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const a="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:a}}n.type==="element"&&i&&Object.assign(n.properties,bl(i)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function uX(e,t){const n=t.data||{},s="value"in t&&!(Kx.call(n,"hProperties")||Kx.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function dX(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
517
+ `});++s<e.length;)s&&n.push({type:"text",value:`
518
+ `}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
519
+ `}),n}function nE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sE(e,t){const n=lX(e,t),s=n.one(e,void 0),r=WV(n),i=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return r&&i.children.push({type:"text",value:`
520
+ `},r),i}function fX(e,t){return e&&"run"in e?async function(n,s){const r=sE(n,{file:s,...t});await e.run(r,s)}:function(n,s){return sE(n,{file:s,...e||t})}}function rE(e){if(e)throw e}function qx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function hX(){const e=[],t={run:n,use:s};return t;function n(...r){let i=-1;const a=r.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...r);function l(c,...u){const d=e[++i];let f=-1;if(c){a(c);return}for(;++f<r.length;)(u[f]===null||u[f]===void 0)&&(u[f]=r[f]);r=u,d?pX(d,l)(...u):a(null,...u)}}function s(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function pX(e,t){let n;return s;function s(...a){const l=e.length>a.length;let c;l&&a.push(r);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,r):c instanceof Error?r(c):i(c))}function r(a,...l){n||(n=!0,t(a,...l))}function i(a){r(null,a)}}const Sr={basename:mX,dirname:gX,extname:bX,join:xX,sep:"/"};function mX(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');sf(e);let n=0,s=-1,r=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(i){n=r+1;break}}else s<0&&(i=!0,s=r+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let a=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(i){n=r+1;break}}else a<0&&(i=!0,a=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(s=r):(l=-1,s=a));return n===s?s=a:s<0&&(s=e.length),e.slice(n,s)}function gX(e){if(sf(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function bX(e){sf(e);let t=e.length,n=-1,s=0,r=-1,i=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){s=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?r<0?r=t:i!==1&&(i=1):r>-1&&(i=-1)}return r<0||n<0||i===0||i===1&&r===n-1&&r===s+1?"":e.slice(r,n)}function xX(...e){let t=-1,n;for(;++t<e.length;)sf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":yX(n)}function yX(e){sf(e);const t=e.codePointAt(0)===47;let n=vX(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vX(e,t){let n="",s=0,r=-1,i=0,a=-1,l,c;for(;++a<=e.length;){if(a<e.length)l=e.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(r===a-1||i===1))if(r!==a-1&&i===2){if(n.length<2||s!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",s=0):(n=n.slice(0,c),s=n.length-1-n.lastIndexOf("/")),r=a,i=0;continue}}else if(n.length>0){n="",s=0,r=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(r+1,a):n=e.slice(r+1,a),s=a-r-1;r=a,i=0}else l===46&&i>-1?i++:i=-1}return n}function sf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kX={cwd:wX};function wX(){return"/"}function Yx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function SX(e){if(typeof e=="string")e=new URL(e);else if(!Yx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return NX(e)}function NX(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const Xg=["history","path","basename","stem","extname","dirname"];class _3{constructor(t){let n;t?Yx(t)?n={path:t}:typeof t=="string"||EX(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":kX.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Xg.length;){const i=Xg[s];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let r;for(r in n)Xg.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?Sr.basename(this.path):void 0}set basename(t){Wg(t,"basename"),Qg(t,"basename"),this.path=Sr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Sr.dirname(this.path):void 0}set dirname(t){iE(this.basename,"dirname"),this.path=Sr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Sr.extname(this.path):void 0}set extname(t){if(Qg(t,"extname"),iE(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Sr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Yx(t)&&(t=SX(t)),Wg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Sr.basename(this.path,this.extname):void 0}set stem(t){Wg(t,"stem"),Qg(t,"stem"),this.path=Sr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const r=this.message(t,n,s);throw r.fatal=!0,r}info(t,n,s){const r=this.message(t,n,s);return r.fatal=void 0,r}message(t,n,s){const r=new Yn(t,n,s);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Qg(e,t){if(e&&e.includes(Sr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Sr.sep+"`")}function Wg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function iE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function EX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _X=function(e){const s=this.constructor.prototype,r=s[e],i=function(){return r.apply(i,arguments)};Object.setPrototypeOf(i,s);const a=Object.getOwnPropertyNames(r);for(const l of a){const c=Object.getOwnPropertyDescriptor(r,l);c&&Object.defineProperty(i,l,c)}return i},CX={}.hasOwnProperty;class Sk extends _X{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=hX()}copy(){const t=new Sk;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(bl(this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(e0("data",this.frozen),this.namespace[t]=n,this):CX.call(this.namespace,t)&&this.namespace[t]||void 0:t?(e0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const r=n.call(t,...s);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Yf(t),s=this.parser||this.Parser;return Zg("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),Zg("process",this.parser||this.Parser),Jg("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(i,a){const l=Yf(t),c=s.parse(l);s.run(c,l,function(d,f,h){if(d||!f||!h)return u(d);const p=f,m=s.stringify(p,h);MX(m)?h.value=m:h.result=m,u(d,h)});function u(d,f){d||!f?a(d):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,s;return this.freeze(),Zg("processSync",this.parser||this.Parser),Jg("processSync",this.compiler||this.Compiler),this.process(t,r),lE("processSync","process",n),s;function r(i,a){n=!0,rE(i),s=a}}run(t,n,s){aE(t),this.freeze();const r=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?i(void 0,s):new Promise(i);function i(a,l){const c=Yf(n);r.run(t,c,u);function u(d,f,h){const p=f||t;d?l(d):a?a(p):s(void 0,p,h)}}}runSync(t,n){let s=!1,r;return this.run(t,n,i),lE("runSync","run",s),r;function i(a,l){rE(a),r=l,s=!0}}stringify(t,n){this.freeze();const s=Yf(n),r=this.compiler||this.Compiler;return Jg("stringify",r),aE(t),r(t,s)}use(t,...n){const s=this.attachers,r=this.namespace;if(e0("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(r.settings={...r.settings,...bl(u.settings)})}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];i(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<s.length;)if(s[f][0]===u){h=f;break}if(h===-1)s.push([u,...d]);else if(d.length>0){let[p,...m]=d;const k=s[h][1];qx(k)&&qx(p)&&(p=bl({...k,...p})),s[h]=[u,p,...m]}}}}const TX=new Sk().freeze();function Zg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function e0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function aE(e){if(!qx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function lE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Yf(e){return AX(e)?e:new _3(e)}function AX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function MX(e){return typeof e=="string"||jX(e)}function jX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const RX="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",oE=[],cE={allowDangerousHtml:!0},OX=/^(https?|ircs?|mailto|xmpp)$/i,DX=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Nk(e){const t=IX(e),n=LX(e);return PX(t.runSync(t.parse(n),n),e)}function IX(e){const t=e.rehypePlugins||oE,n=e.remarkPlugins||oE,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cE}:cE;return TX().use(xV).use(n).use(fX,s).use(t)}function LX(e){const t=e.children||"",n=new _3;return typeof t=="string"&&(n.value=t),n}function PX(e,t){const n=t.allowedElements,s=t.allowElement,r=t.components,i=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||zX;for(const d of DX)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+RX+d.id,void 0);return jm(e,u),rq(e,{Fragment:o.Fragment,components:r,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in qg)if(Object.hasOwn(qg,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],k=qg[p];(k===null||k.includes(d.tagName))&&(d.properties[p]=c(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!p&&s&&typeof f=="number"&&(p=!s(d,f,h)),p&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function zX(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||s!==-1&&t>s||OX.test(e.slice(0,t))?e:""}function uE(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,r=n.indexOf(t);for(;r!==-1;)s++,r=n.indexOf(t,r+t.length);return s}function UX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function FX(e,t,n){const r=nf((n||{}).ignore||[]),i=BX(t);let a=-1;for(;++a<i.length;)E3(e,"text",l);function l(u,d){let f=-1,h;for(;++f<d.length;){const p=d[f],m=h?h.children:void 0;if(r(p,m?m.indexOf(p):void 0,h))return;h=p}if(h)return c(u,d)}function c(u,d){const f=d[d.length-1],h=i[a][0],p=i[a][1];let m=0;const w=f.children.indexOf(u);let g=!1,y=[];h.lastIndex=0;let b=h.exec(u.value);for(;b;){const S=b.index,M={index:b.index,input:b.input,stack:[...d,u]};let E=p(...b,M);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=S+1:(m!==S&&y.push({type:"text",value:u.value.slice(m,S)}),Array.isArray(E)?y.push(...E):E&&y.push(E),m=S+b[0].length,g=!0),!h.global)break;b=h.exec(u.value)}return g?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),f.children.splice(w,1,...y)):y=[u],w+y.length}}function BX(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<n.length;){const r=n[s];t.push([HX(r[0]),$X(r[1])])}return t}function HX(e){return typeof e=="string"?new RegExp(UX(e),"g"):e}function $X(e){return typeof e=="function"?e:function(){return e}}const t0="phrasing",n0=["autolink","link","image","label"];function GX(){return{transforms:[WX],enter:{literalAutolink:qX,literalAutolinkEmail:s0,literalAutolinkHttp:s0,literalAutolinkWww:s0},exit:{literalAutolink:QX,literalAutolinkEmail:XX,literalAutolinkHttp:YX,literalAutolinkWww:VX}}}function KX(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:t0,notInConstruct:n0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:t0,notInConstruct:n0},{character:":",before:"[ps]",after:"\\/",inConstruct:t0,notInConstruct:n0}]}}function qX(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function s0(e){this.config.enter.autolinkProtocol.call(this,e)}function YX(e){this.config.exit.autolinkProtocol.call(this,e)}function VX(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function XX(e){this.config.exit.autolinkEmail.call(this,e)}function QX(e){this.exit(e)}function WX(e){FX(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ZX],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),JX]],{ignore:["link","linkReference"]})}function ZX(e,t,n,s,r){let i="";if(!C3(r)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!eQ(n)))return!1;const a=tQ(n+s);if(!a[0])return!1;const l={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[l,{type:"text",value:a[1]}]:l}function JX(e,t,n,s){return!C3(s,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function eQ(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function tQ(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],s=n.indexOf(")");const r=uE(e,"(");let i=uE(e,")");for(;s!==-1&&r>i;)e+=n.slice(0,s+1),n=n.slice(s+1),s=n.indexOf(")"),i++;return[e,n]}function C3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Dl(n)||Cm(n))&&(!t||n!==47)}T3.peek=uQ;function nQ(){this.buffer()}function sQ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rQ(){this.buffer()}function iQ(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function aQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function lQ(e){this.exit(e)}function oQ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cQ(e){this.exit(e)}function uQ(){return"["}function T3(e,t,n,s){const r=n.createTracker(s);let i=r.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=r.move(n.safe(n.associationId(e),{after:"]",before:i})),l(),a(),i+=r.move("]"),i}function dQ(){return{enter:{gfmFootnoteCallString:nQ,gfmFootnoteCall:sQ,gfmFootnoteDefinitionLabelString:rQ,gfmFootnoteDefinition:iQ},exit:{gfmFootnoteCallString:aQ,gfmFootnoteCall:lQ,gfmFootnoteDefinitionLabelString:oQ,gfmFootnoteDefinition:cQ}}}function fQ(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:T3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(s,r,i,a){const l=i.createTracker(a);let c=l.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=l.move(i.safe(i.associationId(s),{before:c,after:"]"})),d(),c+=l.move("]:"),s.children&&s.children.length>0&&(l.shift(4),c+=l.move((t?`
521
+ `:" ")+i.indentLines(i.containerFlow(s,l.current()),t?A3:hQ))),u(),c}}function hQ(e,t,n){return t===0?e:A3(e,t,n)}function A3(e,t,n){return(n?"":" ")+e}const pQ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ek.attention=yQ;Ek.peek=vQ;function mQ(){return{canContainEols:["delete"],enter:{strikethrough:bQ},exit:{strikethrough:xQ}}}function gQ(){return{handlers:{delete:Ek},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:pQ}]}}function bQ(e){this.enter({type:"delete",children:[],position:void 0},e)}function xQ(e){this.exit(e)}function Ek(e,t,n,s){const r=n.createTracker(s),i=n.stack.includes("strikethrough")?"~":"~~",a=n.enter("strikethrough");let l=r.move(i);return l+=n.containerPhrasing(e,{...r.current(),before:l,after:"~"}),l+=r.move(i),a(),l}function yQ(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function vQ(){return"~"}function kQ(e){return e.length}function wQ(e,t){const n=t||{},s=(n.align||[]).concat(),r=n.stringLength||kQ,i=[],a=[],l=[],c=[];let u=0,d=-1;for(;++d<e.length;){const k=[],w=[];let g=-1;for(e[d].length>u&&(u=e[d].length);++g<e[d].length;){const y=SQ(e[d][g]);if(n.alignDelimiters!==!1){const b=r(y);w[g]=b,(c[g]===void 0||b>c[g])&&(c[g]=b)}k.push(y)}a[d]=k,l[d]=w}let f=-1;if(typeof s=="object"&&"length"in s)for(;++f<u;)i[f]=dE(s[f]);else{const k=dE(s);for(;++f<u;)i[f]=k}f=-1;const h=[],p=[];for(;++f<u;){const k=i[f];let w="",g="";k===99?(w=":",g=":"):k===108?w=":":k===114&&(g=":");let y=n.alignDelimiters===!1?1:Math.max(1,c[f]-w.length-g.length);const b=w+"-".repeat(y)+g;n.alignDelimiters!==!1&&(y=w.length+y+g.length,y>c[f]&&(c[f]=y),p[f]=y),h[f]=b}a.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d<a.length;){const k=a[d],w=l[d];f=-1;const g=[];for(;++f<u;){const y=k[f]||"";let b="",S="";if(n.alignDelimiters!==!1){const M=c[f]-(w[f]||0),E=i[f];E===114?b=" ".repeat(M):E===99?M%2?(b=" ".repeat(M/2+.5),S=" ".repeat(M/2-.5)):(b=" ".repeat(M/2),S=b):S=" ".repeat(M)}n.delimiterStart!==!1&&!f&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||f)&&g.push(" "),n.alignDelimiters!==!1&&g.push(b),g.push(y),n.alignDelimiters!==!1&&g.push(S),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&g.push("|")}m.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return m.join(`
522
+ `)}function SQ(e){return e==null?"":String(e)}function dE(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const NQ=nf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function EQ(e,t,n,s){const r=n.enter("blockquote"),i=n.createTracker(s);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),_Q);return r(),a}function _Q(e,t,n){return">"+(n?"":" ")+e}function CQ(e,t){return fE(e,t.inConstruct,!0)&&!fE(e,t.notInConstruct,!1)}function fE(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function hE(e,t,n,s){let r=-1;for(;++r<n.unsafe.length;){const i=n.unsafe[r];if(i.character===`
523
+ `&&!i.before&&!i.after&&CQ(n.stack,i))return/[\t ]/.test(s.before)?"":" "}return`\\
524
+ `}function TQ(e,t){const n=String(e);let s=n.indexOf(t),r=s,i=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===r?++i>a&&(a=i):i=1,r=s+t.length,s=n.indexOf(t,r);return a}function AQ(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function MQ(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function jQ(e,t,n,s){const r=MQ(n),i=e.value||"";if(AQ(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,RQ);return f(),h}const a=n.createTracker(s),l=r.repeat(Math.max(TQ(i,r)+1,3)),c=n.enter("codeFenced"),u=r==="`"?"GraveAccent":"Tilde";let d=a.move(l);if(e.lang){const f=n.enter(`codeFencedLang${u}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${u}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
525
+ `,encode:["`"],...a.current()})),f()}return d+=a.move(`
526
+ `),i&&(d+=a.move(i+`
527
+ `)),d+=a.move(l),c(),d}function RQ(e,t,n){return(n?"":" ")+e}function _k(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function OQ(e,t,n,s){const r=_k(n),i=r==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(s);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
528
+ `,...c.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),a(),u}function DQ(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Ck.attention=IQ;Ck.peek=LQ;function Ck(e,t,n,s){const r=n.enter("phrasing"),i=n.containerPhrasing({type:"root",children:[e]},s);return r(),i}function IQ(e,t){return{construct:"emphasis",markers:DQ(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function LQ(e,t,n){return n.options.emphasis||"*"}function PQ(e){return"&#x"+e.toString(16).toUpperCase()+";"}function zQ(e,t){let n=!1;return jm(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return n=!0,Gx}),!!((!e.depth||e.depth<3)&&gk(e)&&(t.options.setext||n))}function UQ(e,t,n,s){const r=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(s);if(zQ(e,n)){const f=n.enter("headingSetext"),h=n.enter("phrasing"),p=n.containerPhrasing(e,{...i.current(),before:`
529
+ `,after:`
530
+ `});return h(),f(),p+`
531
+ `+(r===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
532
+ `))+1))}const a="#".repeat(r),l=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
533
+ `,...i.current()});const d=u.charCodeAt(0);return(d===9||d===32)&&(u=PQ(d)+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}M3.peek=FQ;function M3(e){return e.value||""}function FQ(){return"<"}j3.peek=BQ;function j3(e,t,n,s){const r=_k(n),i=r==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(s);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),a(),u}function BQ(){return"!"}R3.peek=HQ;function R3(e,t,n,s){const r=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(s);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=d.filter(function(h){return h!=="phrasing"}),a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function HQ(){return"!"}O3.peek=$Q;function O3(e,t,n){let s=e.value||"",r="`",i=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(s);)r+="`";for(/[^\n\r ]/.test(s)&&(/^[\n\r ]/.test(s)&&/[\n\r ]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++i<n.unsafe.length;){const a=n.unsafe[i],l=n.compilePattern(a);if(!a.atBreak)continue;let c;for(;c=l.exec(s);){let u=c.index;s.charCodeAt(u)===10&&s.charCodeAt(u-1)===13&&u--,s=s.slice(0,u)+" "+s.slice(c.index+1)}}return r+s+r}function $Q(){return"`"}function D3(e,t){const n=gk(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}I3.peek=GQ;function I3(e,t,n,s){const r=_k(n),i=r==='"'?"Quote":"Apostrophe",a=n.createTracker(s);if(D3(e,n)){const d=n.stack;n.stack=d.filter(function(p){return p!=="phrasing"});const f=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),f(),n.stack=d,h}const l=n.enter("link");let c=n.enter("label"),u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${i}`),u+=a.move(" "+r),u+=a.move(n.safe(e.title,{before:u,after:r,...a.current()})),u+=a.move(r),c()),u+=a.move(")"),l(),u}function GQ(e,t,n){return D3(e,n)?"<":"["}L3.peek=KQ;function L3(e,t,n,s){const r=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(s);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=d.filter(function(h){return h!=="phrasing"}),a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,i(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function KQ(){return"["}function Tk(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function qQ(e){const t=Tk(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function YQ(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function P3(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function VQ(e,t,n,s){const r=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?YQ(n):Tk(n);const l=e.ordered?a==="."?")":".":qQ(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),P3(n)===a&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=l),n.bulletCurrent=a;const u=n.containerFlow(e,s);return n.bulletLastUsed=a,n.bulletCurrent=i,r(),u}function XQ(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function QQ(e,t,n,s){const r=XQ(n);let i=n.bulletCurrent||Tk(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(s);l.move(i+" ".repeat(a-i.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?i:i+" ".repeat(a-i.length))+f}}function WQ(e,t,n,s){const r=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,s);return i(),r(),a}function ZQ(e,t,n,s){if(!e.children.some(function(l){return NQ(l)}))return n.containerFlow(e,s);const i=n.enter("phrasing"),a=n.containerPhrasing(e,s);return i(),a}function JQ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ak.attention=eW;Ak.peek=tW;function Ak(e,t,n,s){const r=n.enter("phrasing"),i=n.containerPhrasing({type:"root",children:[e]},s);return r(),i}function eW(e,t){return{construct:"strong",markers:JQ(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function tW(e,t,n){return n.options.strong||"*"}function nW(e,t,n,s){return n.safe(e.value,s)}function sW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function rW(e,t,n){const s=(P3(n)+(n.options.ruleSpaces?" ":"")).repeat(sW(n));return n.options.ruleSpaces?s.slice(0,-1):s}const z3={blockquote:EQ,break:hE,code:jQ,definition:OQ,emphasis:Ck,hardBreak:hE,heading:UQ,html:M3,image:j3,imageReference:R3,inlineCode:O3,link:I3,linkReference:L3,list:VQ,listItem:QQ,paragraph:WQ,root:ZQ,strong:Ak,text:nW,thematicBreak:rW};function iW(){return{enter:{table:aW,tableData:pE,tableHeader:pE,tableRow:oW},exit:{codeText:cW,table:lW,tableData:r0,tableHeader:r0,tableRow:r0}}}function aW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function lW(e){this.exit(e),this.data.inTable=void 0}function oW(e){this.enter({type:"tableRow",children:[]},e)}function r0(e){this.exit(e)}function pE(e){this.enter({type:"tableCell",children:[]},e)}function cW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,uW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function uW(e,t){return t==="|"?t:e}function dW(e){const t=e||{},n=t.tableCellPadding,s=t.tablePipeAlign,r=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
534
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:c,tableRow:l}};function a(p,m,k,w){return u(d(p,k,w),p.align)}function l(p,m,k,w){const g=f(p,k,w),y=u([g]);return y.slice(0,y.indexOf(`
535
+ `))}function c(p,m,k,w){const g=k.enter("tableCell"),y=k.enter("phrasing"),b=k.containerPhrasing(p,{...w,before:i,after:i});return y(),g(),b}function u(p,m){return wQ(p,{align:m,alignDelimiters:s,padding:n,stringLength:r})}function d(p,m,k){const w=p.children;let g=-1;const y=[],b=m.enter("table");for(;++g<w.length;)y[g]=f(w[g],m,k);return b(),y}function f(p,m,k){const w=p.children;let g=-1;const y=[],b=m.enter("tableRow");for(;++g<w.length;)y[g]=c(w[g],p,m,k);return b(),y}function h(p,m,k){let w=z3.inlineCode(p,m,k);return k.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function fW(){return{exit:{taskListCheckValueChecked:mE,taskListCheckValueUnchecked:mE,paragraph:pW}}}function hW(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:mW}}}function mE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function pW(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const s=n.children[0];if(s&&s.type==="text"){const r=t.children;let i=-1,a;for(;++i<r.length;){const l=r[i];if(l.type==="paragraph"){a=l;break}}a===n&&(s.value=s.value.slice(1),s.value.length===0?n.children.shift():n.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,n.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function mW(e,t,n,s){const r=e.children[0],i=typeof e.checked=="boolean"&&r&&r.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",l=n.createTracker(s);i&&l.move(a);let c=z3.listItem(e,t,n,{...s,...l.current()});return i&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+a}}function gW(){return[GX(),dQ(),mQ(),iW(),fW()]}function bW(e){return{extensions:[KX(),fQ(e),gQ(),dW(e),hW()]}}const xW={tokenize:NW,partial:!0},U3={tokenize:EW,partial:!0},F3={tokenize:_W,partial:!0},B3={tokenize:CW,partial:!0},yW={tokenize:TW,partial:!0},H3={name:"wwwAutolink",tokenize:wW,previous:G3},$3={name:"protocolAutolink",tokenize:SW,previous:K3},_i={name:"emailAutolink",tokenize:kW,previous:q3},Fr={};function vW(){return{text:Fr}}let Fa=48;for(;Fa<123;)Fr[Fa]=_i,Fa++,Fa===58?Fa=65:Fa===91&&(Fa=97);Fr[43]=_i;Fr[45]=_i;Fr[46]=_i;Fr[95]=_i;Fr[72]=[_i,$3];Fr[104]=[_i,$3];Fr[87]=[_i,H3];Fr[119]=[_i,H3];function kW(e,t,n){const s=this;let r,i;return a;function a(f){return!Vx(f)||!q3.call(s,s.previous)||Mk(s.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return Vx(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(yW,d,u)(f):f===45||f===95||qn(f)?(i=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),r=!0,c}function d(f){return i&&r&&es(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function wW(e,t,n){const s=this;return r;function r(a){return a!==87&&a!==119||!G3.call(s,s.previous)||Mk(s.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(xW,e.attempt(U3,e.attempt(F3,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function SW(e,t,n){const s=this;let r="",i=!1;return a;function a(f){return(f===72||f===104)&&K3.call(s,s.previous)&&!Mk(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(es(f)&&r.length<5)return r+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const h=r.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),i?u:(i=!0,c)):n(f)}function u(f){return f===null||Ap(f)||Bt(f)||Dl(f)||Cm(f)?n(f):e.attempt(U3,e.attempt(F3,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function NW(e,t,n){let s=0;return r;function r(a){return(a===87||a===119)&&s<3?(s++,e.consume(a),r):a===46&&s===3?(e.consume(a),i):n(a)}function i(a){return a===null?n(a):t(a)}}function EW(e,t,n){let s,r,i;return a;function a(u){return u===46||u===95?e.check(B3,c,l)(u):u===null||Bt(u)||Dl(u)||u!==45&&Cm(u)?c(u):(i=!0,e.consume(u),a)}function l(u){return u===95?s=!0:(r=s,s=void 0),e.consume(u),a}function c(u){return r||s||!i?n(u):t(u)}}function _W(e,t){let n=0,s=0;return r;function r(a){return a===40?(n++,e.consume(a),r):a===41&&s<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(B3,t,i)(a):a===null||Bt(a)||Dl(a)?t(a):(e.consume(a),r)}function i(a){return a===41&&s++,e.consume(a),r}}function CW(e,t,n){return s;function s(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),s):l===38?(e.consume(l),i):l===93?(e.consume(l),r):l===60||l===null||Bt(l)||Dl(l)?t(l):n(l)}function r(l){return l===null||l===40||l===91||Bt(l)||Dl(l)?t(l):s(l)}function i(l){return es(l)?a(l):n(l)}function a(l){return l===59?(e.consume(l),s):es(l)?(e.consume(l),a):n(l)}}function TW(e,t,n){return s;function s(i){return e.consume(i),r}function r(i){return qn(i)?n(i):t(i)}}function G3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Bt(e)}function K3(e){return!es(e)}function q3(e){return!(e===47||Vx(e))}function Vx(e){return e===43||e===45||e===46||e===95||qn(e)}function Mk(e){let t=e.length,n=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){n=!0;break}if(s._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const AW={tokenize:PW,partial:!0};function MW(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:DW,continuation:{tokenize:IW},exit:LW}},text:{91:{name:"gfmFootnoteCall",tokenize:OW},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jW,resolveTo:RW}}}}function jW(e,t,n){const s=this;let r=s.events.length;const i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let a;for(;r--;){const c=s.events[r][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const u=dr(s.sliceSerialize({start:a.end,end:s.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function RW(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...l),e}function OW(e,t,n){const s=this,r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let i=0,a;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!a||f===null||f===91||Bt(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(dr(s.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Bt(f)||(a=!0),i++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function DW(e,t,n){const s=this,r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let i,a=0,l;return c;function c(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(a>999||m===93&&!l||m===null||m===91||Bt(m))return n(m);if(m===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return i=dr(s.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Bt(m)||(l=!0),a++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),r.includes(i)||r.push(i),Et(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function IW(e,t,n){return e.check(tf,t,e.attempt(AW,t,n))}function LW(e){e.exit("gfmFootnoteDefinition")}function PW(e,t,n){const s=this;return Et(e,r,"gfmFootnoteDefinitionIndent",5);function r(i){const a=s.events[s.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function zW(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:i,resolveAll:r};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function r(a,l){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let u=c;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[c][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[c][1].start)},h=[["enter",d,l],["enter",a[u][1],l],["exit",a[u][1],l],["enter",f,l]],p=l.parser.constructs.insideSpan.null;p&&Vs(h,h.length,0,Tm(p,a.slice(u+1,c),l)),Vs(h,h.length,0,[["exit",f,l],["enter",a[c][1],l],["exit",a[c][1],l],["exit",d,l]]),Vs(a,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function i(a,l,c){const u=this.previous,d=this.events;let f=0;return h;function h(m){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(m):(a.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const k=jp(u);if(m===126)return f>1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const w=a.exit("strikethroughSequenceTemporary"),g=jp(m);return w._open=!g||g===2&&!!k,w._close=!k||k===2&&!!g,l(m)}}}class UW{constructor(){this.map=[],this.index=new Map}add(t,n,s){FW(this,t,n,s)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let r=s.pop();for(;r;){for(const i of r)t.push(i);r=s.pop()}this.map.length=0,this.index.clear()}}function FW(e,t,n,s){if(n===0&&s.length===0)return;const r=e.index.get(t);if(r){r[1]+=n,r[2].push(...s);return}const i=[t,n,s];e.map.push(i),e.index.set(t,i)}function BW(e,t){let n=!1;const s=[];for(;t<e.length;){const r=e[t];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=s.length-1;s[i]=s[i]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return s}function HW(){return{flow:{null:{name:"table",tokenize:$W,resolveAll:GW}}}}function $W(e,t,n){const s=this;let r=0,i=0,a;return l;function l(_){let z=s.events.length-1;for(;z>-1;){const{type:I}=s.events[z][1];if(I==="lineEnding"||I==="linePrefix")z--;else break}const $=z>-1?s.events[z][1].type:null,H=$==="tableHead"||$==="tableRow"?E:c;return H===E&&s.parser.lazy[s.now().line]?n(_):H(_)}function c(_){return e.enter("tableHead"),e.enter("tableRow"),u(_)}function u(_){return _===124||(a=!0,i+=1),d(_)}function d(_){return _===null?n(_):et(_)?i>1?(i=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),p):n(_):dt(_)?Et(e,d,"whitespace")(_):(i+=1,a&&(a=!1,r+=1),_===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(_)))}function f(_){return _===null||_===124||Bt(_)?(e.exit("data"),d(_)):(e.consume(_),_===92?h:f)}function h(_){return _===92||_===124?(e.consume(_),f):f(_)}function p(_){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(_):(e.enter("tableDelimiterRow"),a=!1,dt(_)?Et(e,m,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):m(_))}function m(_){return _===45||_===58?w(_):_===124?(a=!0,e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),k):M(_)}function k(_){return dt(_)?Et(e,w,"whitespace")(_):w(_)}function w(_){return _===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),g):_===45?(i+=1,g(_)):_===null||et(_)?S(_):M(_)}function g(_){return _===45?(e.enter("tableDelimiterFiller"),y(_)):M(_)}function y(_){return _===45?(e.consume(_),y):_===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(_),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(_))}function b(_){return dt(_)?Et(e,S,"whitespace")(_):S(_)}function S(_){return _===124?m(_):_===null||et(_)?!a||r!==i?M(_):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(_)):M(_)}function M(_){return n(_)}function E(_){return e.enter("tableRow"),A(_)}function A(_){return _===124?(e.enter("tableCellDivider"),e.consume(_),e.exit("tableCellDivider"),A):_===null||et(_)?(e.exit("tableRow"),t(_)):dt(_)?Et(e,A,"whitespace")(_):(e.enter("data"),R(_))}function R(_){return _===null||_===124||Bt(_)?(e.exit("data"),A(_)):(e.consume(_),_===92?D:R)}function D(_){return _===92||_===124?(e.consume(_),R):R(_)}}function GW(e,t){let n=-1,s=!0,r=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new UW;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,c!==0&&(gE(h,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(s=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",d,t]])),r=m.type==="tableDelimiterRow"?2:d?3:1):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(s=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=Vf(h,t,i,r,void 0,f),i=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(s?s=!1:(i[1]!==0&&(a[0]=a[1],f=Vf(h,t,i,r,void 0,f)),i=a,a=[i[1],n,0,0])):m.type==="tableHead"?(l=!0,c=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(c=n,i[1]!==0?(a[0]=a[1],f=Vf(h,t,i,r,n,f)):a[1]!==0&&(f=Vf(h,t,a,r,n,f)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&gE(h,t,c,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=BW(t.events,n))}return e}function Vf(e,t,n,s,r,i){const a=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(i.end=Object.assign({},Zl(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const c=Zl(t.events,n[1]);if(i={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const u=Zl(t.events,n[2]),d=Zl(t.events,n[3]),f={type:l,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),s!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,k=n[3]-n[2]-1;e.add(m,k,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return r!==void 0&&(i.end=Object.assign({},Zl(t.events,r)),e.add(r,0,[["exit",i,t]]),i=void 0),i}function gE(e,t,n,s,r){const i=[],a=Zl(t.events,n);r&&(r.end=Object.assign({},a),i.push(["exit",r,t])),s.end=Object.assign({},a),i.push(["exit",s,t]),e.add(n+1,0,i)}function Zl(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const KW={name:"tasklistCheck",tokenize:YW};function qW(){return{text:{91:KW}}}function YW(e,t,n){const s=this;return r;function r(c){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Bt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return et(c)?t(c):dt(c)?e.check({tokenize:VW},t,n)(c):n(c)}}function VW(e,t,n){return Et(e,s,"whitespace");function s(r){return r===null?n(r):t(r)}}function XW(e){return r3([vW(),MW(),zW(e),HW(),qW()])}const QW={};function jk(e){const t=this,n=e||QW,s=t.data(),r=s.micromarkExtensions||(s.micromarkExtensions=[]),i=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),a=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);r.push(XW(n)),i.push(gW()),a.push(bW(n))}async function WW(){const e=await fetch(`${mi}/ai/status`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return await e.json()}async function ZW(e){const t=await fetch(`${mi}/ai/models`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})});if(!t.ok){const n=await t.text();let s=n;try{const r=JSON.parse(n);typeof r.error=="string"&&r.error&&(s=r.error)}catch{}throw new Error(s||`HTTP ${t.status}`)}return await t.json()}async function JW(e,t){const n=await fetch(`${mi}/ai/chat`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({messages:e}),...t.signal?{signal:t.signal}:{}});if(!n.ok||!n.body){const a=await n.text().catch(()=>"");throw new Error(a||`HTTP ${n.status}`)}const s=n.body.getReader(),r=new TextDecoder;let i="";for(;;){const{done:a,value:l}=await s.read();if(a)break;i+=r.decode(l,{stream:!0});let c;for(;(c=i.indexOf(`
536
+ `))>=0;){const u=i.slice(0,c).trim();if(i=i.slice(c+1),!u.startsWith("data:"))continue;const d=u.slice(5).trim();if(!d)continue;let f;try{f=JSON.parse(d)}catch{continue}if(typeof f.error=="string"&&f.error!=="")throw new Error(f.error);if(typeof f.delta=="string"&&t.onDelta(f.delta),f.done===!0)return}}}let Xx=!1;const Qx=new Set;function bE(e){if(Xx!==e){Xx=e;for(const t of Qx)t()}}function eZ(){return Xx}function tZ(e){return Qx.add(e),()=>Qx.delete(e)}function nZ(){return x.useSyncExternalStore(tZ,eZ)}function Op({text:e}){return o.jsx("div",{className:"text-xs leading-relaxed text-neutral-200 [&_p]:my-1 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0 [&_strong]:font-semibold [&_strong]:text-neutral-100 [&_em]:italic [&_ul]:my-1 [&_ul]:list-disc [&_ul]:pl-4 [&_ol]:my-1 [&_ol]:list-decimal [&_ol]:pl-4 [&_li]:my-0.5 [&_code]:rounded [&_code]:bg-neutral-950/60 [&_code]:px-1 [&_code]:py-px [&_code]:text-[11px] [&_code]:text-neutral-300 [&_pre]:my-1.5 [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_pre]:rounded [&_pre]:border [&_pre]:border-edge/[0.06] [&_pre]:bg-neutral-950/60 [&_pre]:p-2 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-[11px] [&_h1]:mt-2 [&_h1]:mb-1 [&_h1]:text-[13px] [&_h1]:font-semibold [&_h2]:mt-2 [&_h2]:mb-1 [&_h2]:text-xs [&_h2]:font-semibold [&_h3]:mt-1.5 [&_h3]:mb-1 [&_h3]:text-xs [&_h3]:font-medium [&_blockquote]:my-1.5 [&_blockquote]:border-l-2 [&_blockquote]:border-neutral-700 [&_blockquote]:pl-2 [&_blockquote]:text-neutral-400 [&_a]:text-blue-400 [&_a]:underline [&_table]:my-0 [&_table]:w-full [&_table]:border-collapse [&_table]:text-[11px] [&_th]:border [&_th]:border-edge/[0.08] [&_th]:bg-neutral-950/40 [&_th]:px-1.5 [&_th]:py-1 [&_th]:text-left [&_th]:font-medium [&_td]:border [&_td]:border-edge/[0.08] [&_td]:px-1.5 [&_td]:py-1 [&_td]:align-top [&_hr]:my-2 [&_hr]:border-edge/[0.08]",children:o.jsx(Nk,{remarkPlugins:[jk],components:{a:({node:t,...n})=>o.jsx("a",{...n,target:"_blank",rel:"noreferrer"}),table:({node:t,...n})=>o.jsx("div",{className:"my-1.5 max-w-full overflow-x-auto",children:o.jsx("table",{...n})})},children:e})})}function sZ(){const e=We(),{show:t}=an(),n=nZ(),[s,r]=x.useState(null),[i,a]=x.useState(!1),[l,c]=x.useState([]),[u,d]=x.useState(""),[f,h]=x.useState(""),[p,m]=x.useState(!1),k=x.useRef(null),w=x.useRef(null),g=x.useCallback(()=>{WW().then(r).catch(()=>{})},[]);x.useEffect(()=>{g()},[g]),x.useEffect(()=>ki("settings",g),[g]),x.useEffect(()=>{const b=w.current;b&&(b.scrollTop=b.scrollHeight)},[l,f,i]);const y=x.useCallback(async()=>{const b=u.trim();if(b===""||p)return;const S=[...l,{role:"user",content:b}];c(S),d(""),h(""),m(!0);const M=new AbortController;k.current=M;let E="";try{await JW(S,{signal:M.signal,onDelta:A=>{E+=A,h(E)}}),c([...S,{role:"assistant",content:E!==""?E:e("ai.emptyAnswer")}]),h("")}catch(A){h(""),A.name==="AbortError"?E!==""&&c([...S,{role:"assistant",content:E}]):t("error",e("ai.failed",{error:Ye(A)}))}finally{k.current=null,m(!1)}},[p,u,l,t,e]);return(s==null?void 0:s.configured)!==!0||n?null:o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:()=>a(b=>!b),title:e(i?"ai.close":"ai.open"),className:"fixed bottom-4 right-4 z-50 grid h-11 w-11 place-items-center rounded-full border border-edge/[0.08] bg-neutral-900/90 text-neutral-300 shadow-mac backdrop-blur transition-colors hover:bg-neutral-800 hover:text-neutral-100",children:o.jsx(tx,{className:"h-5 w-5"})}),i&&un.createPortal(o.jsxs("div",{className:"fixed bottom-20 right-4 z-[55] flex h-[520px] max-h-[70dvh] w-[380px] max-w-[calc(100vw-2rem)] flex-col overflow-hidden rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 border-b border-edge/[0.06] px-4 frosted",children:[o.jsx(tx,{className:"h-4 w-4 text-violet-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:e("ai.title")}),o.jsx("button",{type:"button",onClick:()=>c([]),title:e("ai.clear"),className:"ml-auto rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",children:o.jsx(Qs,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",onClick:()=>a(!1),title:e("ai.close"),className:"rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",children:o.jsx(tn,{className:"h-4 w-4"})})]}),o.jsxs("div",{ref:w,className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-3",children:[l.length===0&&f===""&&o.jsxs("div",{className:"text-[11px] leading-relaxed text-neutral-500",children:[e("ai.empty"),o.jsxs("div",{className:"mt-1 text-neutral-600",children:[e("ai.intro"),s.docsFound?"":e("ai.docsMissing")]})]}),l.map((b,S)=>o.jsx("div",{className:b.role==="user"?"flex justify-end":"flex justify-start",children:b.role==="user"?o.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-lg bg-blue-600/25 px-2.5 py-1.5 text-xs text-blue-50",children:b.content}):o.jsx("div",{className:"max-w-[92%] break-words rounded-lg bg-neutral-800/70 px-2.5 py-1.5 text-xs text-neutral-200",children:o.jsx(Op,{text:b.content})})},S)),p&&f===""&&o.jsx("div",{className:"flex justify-start",children:o.jsx("div",{className:"animate-pulse rounded-lg bg-neutral-800/70 px-2.5 py-1.5 text-xs text-neutral-400",children:e("ai.thinking")})}),f!==""&&o.jsx("div",{className:"flex justify-start",children:o.jsx("div",{className:"max-w-[92%] break-words rounded-lg bg-neutral-800/70 px-2.5 py-1.5 text-xs text-neutral-200",children:o.jsx(Op,{text:f})})})]}),o.jsxs("form",{className:"shrink-0 flex items-end gap-2 border-t border-edge/[0.06] p-2",onSubmit:b=>{b.preventDefault(),y()},children:[o.jsx("textarea",{value:u,rows:2,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),y())},placeholder:e("ai.placeholder"),className:"min-h-0 flex-1 resize-none rounded-lg border border-neutral-800 bg-neutral-950 px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-neutral-600 focus:outline-none"}),p?o.jsx("button",{type:"button",onClick:()=>{var b;return(b=k.current)==null?void 0:b.abort()},title:e("ai.stop"),className:"grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-neutral-800 text-neutral-300 hover:bg-neutral-700",children:o.jsx(Tv,{className:"h-3.5 w-3.5"})}):o.jsx("button",{type:"submit",disabled:u.trim()==="",title:e("ai.send"),className:"grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-blue-600 text-white hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-40",children:o.jsx(HA,{className:"h-3.5 w-3.5"})})]})]}),document.body)]})}function Yl(e,t){return e==="plain"?t:t==="plain"?e:e==="code"||t==="code"?"code":e==="link"||t==="link"?"link":e==="del"||t==="del"?"del":"strongEm"}const rZ=/(`+)([\s\S]*?)\1|~{2}([\s\S]+?)~{2}|\*{2}([\s\S]+?)\*{2}|_{2}([\s\S]+?)_{2}|\*([^*\n]+?)\*|_([^_\n]+?)_|\[([^\]\n]*)\]\(([^)\s]*)\)|(https?:\/\/[^\s<>()]+)|(\\(?:[\\`*_~{}[\]()#+\-.!>|]))/;function Or(e,t="plain"){var a;const n=[];let s="",r=e;const i=()=>{s!==""&&(n.push({text:s,style:t}),s="")};for(;r!=="";){const l=rZ.exec(r);if(!l||l.index===void 0)break;s+=r.slice(0,l.index);const c=l.slice(1);if(c[1]!==void 0)i(),n.push({text:c[1],style:Yl(t,"code")});else if(c[2]!==void 0)i(),n.push(...Or(c[2],Yl(t,"del")));else if(c[3]!==void 0||c[4]!==void 0)i(),n.push(...Or(c[3]??c[4],Yl(t,"strong")));else if(c[5]!==void 0||c[6]!==void 0)i(),n.push(...Or(c[5]??c[6],Yl(t,"em")));else if(c[7]!==void 0){const u=c[7],d=c[8]??"";i();const f=d!==""&&d!==u?`${u||d} (${d})`:u||d;f!==""&&n.push(...Or(f,Yl(t,"link")))}else if(c[9]!==void 0){const u=((a=/[.,;:!?]+$/.exec(c[9]))==null?void 0:a[0])??"",d=c[9].slice(0,c[9].length-u.length);i(),n.push({text:d,style:Yl(t,"link")}),s=u}else c[10]!==void 0&&(s+=c[10].slice(1));r=r.slice(l.index+l[0].length)}return s+=r,i(),n}const iZ=/^ {0,3}(`{3,}|~{3,})/,aZ=/^ {0,3}(`{3,}|~{3,})\s*$/,lZ=/^ {0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,oZ=/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/,xE=/^ {0,3}>\s?(.*)$/,Y3=/^(\s*)([-*+])\s+(.*)$/,V3=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,cZ=/^\[([ xX])\]\s+(.*)$/,uZ=/^ {0,3}(#{1,6}\s|>|`{3,}|~{3,}|[-*+]\s|\d{1,9}[.)]\s)/;function X3(e){let t=e.trim();t.startsWith("|")&&(t=t.slice(1));const n=[];let s="";for(let i=0;i<t.length;i++){const a=t[i];if(a==="\\"&&t[i+1]==="|"){s+="|",i++;continue}if(a==="|"){n.push(s),s="";continue}s+=a}n.push(s);const r=n[n.length-1];return n.length>1&&r.trim()===""&&n.pop(),n.map(i=>i.trim())}function Q3(e){if(!e.includes("-"))return!1;const t=X3(e);return t.length>=1&&t.every(n=>/^:?-+:?$/.test(n))}function dZ(e,t,n){const s=[];let r=t;for(;r<e.length;){const i=e[r];if(i.trim()===""||!i.includes("|"))break;r++,!Q3(i)&&s.push(X3(i).map(a=>Or(a)))}return s.length>0&&n.push({kind:"table",rows:s}),r}function fZ(e,t,n){const s=[];let r=t;for(;r<e.length;){const i=e[r],a=Y3.exec(i),l=a?null:V3.exec(i);if(!a&&!l){const f=s[s.length-1];if(f&&i.trim()!==""&&/^\s{2,}/.test(i)&&!uZ.test(i)){f.spans=[...f.spans,{text:" ",style:"plain"},...Or(i.trim())],r++;continue}break}const c=Math.min(3,Math.floor((a??l)[1].length/2));let u,d;if(a){const f=cZ.exec(a[3]);f?(u=f[1].toLowerCase()==="x"?"☑":"☐",d=f[2]):(u="•",d=a[3])}else u=`${l[2]}.`,d=l[3];s.push({marker:u,level:c,spans:Or(d)}),r++}return n.push({kind:"list",items:s}),r}function hZ(e){const t=e.replace(/\r\n?/g,`
537
+ `).replace(/\t/g," ").split(`
538
+ `),n=[],s=[],r=()=>{s.length>0&&(n.push({kind:"p",spans:Or(s.join(" ").replace(/ {2,}/g," "))}),s.length=0)};let i=0;for(;i<t.length;){const a=t[i],l=iZ.exec(a);if(l){r();const u=[];for(i++;i<t.length;){const d=aZ.exec(t[i]);if(d&&d[1][0]===l[1][0]&&d[1].length>=l[1].length){i++;break}u.push(t[i]),i++}n.push({kind:"code",lines:u});continue}if(a.trim()===""){r(),i++;continue}const c=lZ.exec(a);if(c){r(),n.push({kind:"h",level:c[1].length,spans:Or(c[2])}),i++;continue}if(oZ.test(a)){r(),n.push({kind:"hr"}),i++;continue}if(a.includes("|")&&i+1<t.length&&Q3(t[i+1])){r(),i=dZ(t,i,n);continue}if(xE.test(a)){r();const u=[];for(;i<t.length;){const d=xE.exec(t[i]);if(!d)break;u.push(d[1].trim()===""?[]:Or(d[1])),i++}n.push({kind:"quote",lines:u});continue}if(Y3.test(a)||V3.test(a)){r(),i=fZ(t,i,n);continue}s.push(a.trim()),i++}return r(),n}const Ih=880,Ar=24,W3=26,i0=15,jo=10,a0=12,Z3=Math.round((Ih-Ar*2)*.78),Bi=Z3-jo*2,Xf=19,su=16,pZ=21,mZ=4,gZ=8,yE=2,bZ=16,qc=8,Qf=6,Wx=2,Au=6,xZ=44,yZ=16e6,ei='ui-sans-serif, system-ui, "Segoe UI", "Microsoft YaHei", sans-serif',vZ='ui-monospace, SFMono-Regular, Menlo, Consolas, "Microsoft YaHei", monospace',Ro={title:`600 17px ${ei}`,meta:`11px ${ei}`,body:`12px ${ei}`,small:`11px ${ei}`,strong:`600 12px ${ei}`,em:`italic 12px ${ei}`,strongEm:`600 italic 12px ${ei}`,h1:`600 13px ${ei}`,h3:`500 12px ${ei}`,mono:`11px ${vZ}`},vE="#737373",kZ="#f5f5f5",J3="rgba(0,0,0,0.45)",wZ="rgba(255,255,255,0.06)",kE="rgba(255,255,255,0.08)",SZ="rgba(0,0,0,0.35)",NZ="#404040",wE="rgba(255,255,255,0.08)",eR={user:{fill:"rgba(59,130,246,0.14)",stroke:"rgba(59,130,246,0.35)",fg:"#dbeafe",strong:"#eff6ff",code:"#bfdbfe",link:"#93c5fd",quote:"rgba(219,234,254,0.75)"},assistant:{fill:"rgba(255,255,255,0.06)",stroke:"rgba(255,255,255,0.10)",fg:"#e5e5e5",strong:"#fafafa",code:"#d4d4d4",link:"#60a5fa",quote:"#a3a3a3"}};function EZ(e,t,n){switch(e){case"strong":return{font:n??"strong",fg:t.strong};case"em":return{font:n||"em",fg:t.fg};case"strongEm":return{font:n??"strongEm",fg:t.strong};case"code":return{font:"mono",fg:t.code,bg:J3};case"link":return{font:n??"body",fg:t.link,underline:!0};case"del":return{font:n??"body",fg:t.fg,strike:!0};default:return{font:n??"body",fg:t.fg}}}const _Z=/[A-Za-z0-9@._/:%+~=?#&$'"-]+|\s+|[\s\S]/g;function CZ(e,t){return e.font===t.font&&e.fg===t.fg&&e.bg===t.bg&&e.underline===t.underline&&e.strike===t.strike}function Ba(e,t,n,s,r,i={}){const a=[];let l=[],c=0;const u=()=>{const f=l[l.length-1];if(f){const h=f.text.replace(/\s+$/,"");h===""?l.pop():h!==f.text&&(f.w-=e(f.font,f.text.slice(h.length)),f.text=h)}a.push({spans:l,indent:0,lh:r,gap:0}),l=[],c=0},d=(f,h,p)=>{const m=l[l.length-1];if(m&&CZ(m,h)){m.text+=f,m.w+=p;return}l.push({...h,text:f,w:p})};for(const f of t){const h=EZ(f.style,n,i.base);for(const p of f.text.match(_Z)??[]){const m=/^\s+$/.test(p);if(m&&l.length===0&&!i.keepSpace)continue;const k=e(h.font,p);if(!(l.length>0&&c+k>s&&(u(),m&&!i.keepSpace))){if(l.length===0&&k>s){for(const w of p){const g=e(h.font,w);l.length>0&&c+g>s&&u(),d(w,h,g),c+=g}continue}d(p,h,k),c+=k}}}return(l.length>0||a.length===0)&&u(),a}function SE(e){var t;return e.indent+(((t=e.marker)==null?void 0:t.w)??0)+e.spans.reduce((n,s)=>n+s.w,0)}function l0(e){return e.reduce((t,n)=>t+n.gap+n.lh,0)}function TZ(e){return e==="flow"?mZ:gZ}function AZ(e,t,n){const s=[];let r=0;const i=l=>{const c=s.length===0?0:TZ(l.kind);s.push({...l,y:r,gap:c}),r+=c+l.h},a=l=>({kind:"flow",h:l0(l),w:Math.max(0,...l.map(SE)),lines:l});for(const l of hZ(t))switch(l.kind){case"hr":i({kind:"rule",h:1,w:Bi});break;case"h":{const c=l.level===1?"h1":l.level===2?"strong":"h3";i(a(Ba(e,l.spans,n,Bi,c==="h1"?pZ:Xf,{base:c})));break}case"p":i(a(Ba(e,l.spans,n,Bi,Xf)));break;case"list":{const c=[];for(const u of l.items){const d=`${u.marker} `,f=e("body",d),h=u.level*bZ;Ba(e,u.spans,n,Bi-h-f,Xf).forEach((m,k)=>{m.indent=k===0?h:h+f,m.gap=k===0&&c.length>0?yE:0,k===0&&(m.marker={text:d,font:"body",fg:n.fg,w:f}),c.push(m)})}i(a(c));break}case"quote":{const c={...n,fg:n.quote,strong:n.quote},u=[];for(const[d,f]of l.lines.entries())Ba(e,f,c,Bi-Qf-Wx,Xf).forEach((p,m)=>{p.indent=Qf+Wx,p.gap=d>0&&m===0?yE:0,u.push(p)});i({kind:"box",h:l0(u)+Qf,w:Math.max(0,...u.map(SE)),leftBar:NZ,pad:Qf/2,lines:u});break}case"code":{const c={...n,fg:n.code},u=[];for(const d of l.lines.length>0?l.lines:[""]){const f=Ba(e,[{text:d,style:"plain"}],c,Bi-qc*2,su,{base:"mono",keepSpace:!0});for(const h of f)h.indent=qc,u.push(h)}i({kind:"box",h:l0(u)+qc*2,w:Math.max(0,...u.map(d=>d.spans.reduce((f,h)=>f+h.w,0)))+qc*2,fill:J3,border:wZ,pad:qc,lines:u});break}case"table":{const c=l.rows;if(c.length===0)break;const u=Math.max(...c.map(k=>k.length)),d=Array.from({length:u},(k,w)=>{let g=0;for(const y of c){const b=y[w];if(!b)continue;const S=Ba(e,b,n,Number.MAX_SAFE_INTEGER,su,{base:"small"})[0];g=Math.max(g,S?S.spans.reduce((M,E)=>M+E.w,0):0)}return g+Au*2}),f=d.reduce((k,w)=>k+w,0),h=f>Bi?Bi/f:1,p=d.map(k=>Math.max(xZ,k*h)),m=c.map((k,w)=>{const g=p.map((b,S)=>Ba(e,k[S]??[],n,Math.max(10,b-Au*2),su,{base:"small"})),y=Math.max(...g.map(b=>b.length))*su+Au*2;return{head:w===0,h:y,cells:g}});i({kind:"table",h:m.reduce((k,w)=>k+w.h,0),w:p.reduce((k,w)=>k+w,0),colW:p,rows:m});break}}return s}function MZ(e,t,n=2){for(const s of[n,1])if(e*s*t*s<=yZ)return s;return 1}function jZ(e,t,n){const s=W3+i0+8,r={y:Ar,h:s,title:n.title,subtitle:n.subtitle};let i=Ar+s+a0;const a=[];for(const c of t){const u=AZ(e,c.text,eR[c.role]),d=Math.max(0,...u.map(m=>m.w)),f=u.reduce((m,k)=>m+k.gap+k.h,0),h=Math.min(Z3,d+jo*2),p=f+jo*2;a.push({role:c.role,meta:`${n.stamp(c.at)} · ${c.role==="user"?n.labels.user:n.labels.assistant}`,metaY:i,x:c.role==="user"?Ih-Ar-h:Ar,y:i+i0,w:h,h:p,blocks:u}),i+=i0+p+a0}const l=Math.round(t.length>0?i-a0+Ar:i);return{width:Ih,height:l,scale:MZ(Ih,l,n.scale),header:r,bubbles:a}}function Zx(e,t,n,s,r,i){e.beginPath(),e.moveTo(t+i,n),e.arcTo(t+s,n,t+s,n+r,i),e.arcTo(t+s,n+r,t,n+r,i),e.arcTo(t,n+r,t,n,i),e.arcTo(t,n,t+s,n,i),e.closePath()}function o0(e,t,n,s){var i;let r=s;for(const a of t){r+=a.gap,a.marker&&(e.font=Ro[a.marker.font],e.fillStyle=a.marker.fg,e.fillText(a.marker.text,n+a.indent,r));let l=n+a.indent+(((i=a.marker)==null?void 0:i.w)??0);for(const c of a.spans){if(e.font=Ro[c.font],c.bg&&(e.fillStyle=c.bg,Zx(e,l-2,r-1,c.w+4,a.lh-4,3),e.fill()),e.fillStyle=c.fg,e.fillText(c.text,l,r),c.underline||c.strike){e.strokeStyle=c.fg,e.beginPath();const u=c.underline?r+a.lh-4:r+a.lh/2+1;e.moveTo(l,u),e.lineTo(l+c.w,u),e.stroke()}l+=c.w}r+=a.lh}}function RZ(e,t){e.fillStyle="#0a0a0a",e.fillRect(0,0,t.width,t.height),e.textBaseline="top",e.textAlign="left",e.lineWidth=1;const{y:n,h:s,title:r,subtitle:i}=t.header;e.font=Ro.title,e.fillStyle=kZ,e.fillText(r,Ar,n),e.font=Ro.meta,e.fillStyle=vE,e.fillText(i,Ar,n+W3),e.strokeStyle=wE,e.beginPath(),e.moveTo(Ar,n+s+.5),e.lineTo(t.width-Ar,n+s+.5),e.stroke();for(const a of t.bubbles){const l=eR[a.role];e.font=Ro.meta,e.fillStyle=vE,e.textAlign=a.role==="user"?"right":"left",e.fillText(a.meta,a.role==="user"?a.x+a.w:a.x,a.metaY),e.textAlign="left",Zx(e,a.x,a.y,a.w,a.h,8),e.fillStyle=l.fill,e.fill(),e.strokeStyle=l.stroke,e.stroke();const c=a.x+jo,u=a.y+jo;for(const d of a.blocks){const f=u+d.y;if(d.kind==="rule"){e.strokeStyle=wE,e.beginPath(),e.moveTo(c,f+.5),e.lineTo(c+a.w-jo*2,f+.5),e.stroke();continue}if(d.kind==="flow"){o0(e,d.lines,c,f);continue}if(d.kind==="box"){(d.fill||d.border)&&(Zx(e,c,f,d.w,d.h,4),d.fill&&(e.fillStyle=d.fill,e.fill()),d.border&&(e.strokeStyle=d.border,e.stroke())),d.leftBar&&(e.fillStyle=d.leftBar,e.fillRect(c,f,Wx,d.h)),o0(e,d.lines,c,f+d.pad);continue}let h=f;for(const m of d.rows){m.head&&(e.fillStyle=SZ,e.fillRect(c,h,d.w,m.h));let k=c;m.cells.forEach((w,g)=>{w.forEach((y,b)=>o0(e,[{...y,indent:Au,gap:0}],k,h+Au+b*su)),k+=d.colW[g]??0}),e.strokeStyle=kE,e.beginPath(),e.moveTo(c,h+.5),e.lineTo(c+d.w,h+.5),e.moveTo(c,h+m.h+.5),e.lineTo(c+d.w,h+m.h+.5),e.stroke(),h+=m.h}let p=c;e.strokeStyle=kE;for(const m of d.colW)e.beginPath(),e.moveTo(p+.5,f),e.lineTo(p+.5,f+d.h),e.stroke(),p+=m;e.beginPath(),e.moveTo(p+.5,f),e.lineTo(p+.5,f+d.h),e.stroke()}}}async function OZ(e,t){const n=document.createElement("canvas").getContext("2d");if(!n)throw new Error("canvas 2d context unavailable");const r=jZ((c,u)=>(n.font=Ro[c],n.measureText(u).width),e,t),i=document.createElement("canvas");i.width=Math.round(r.width*r.scale),i.height=Math.round(r.height*r.scale);const a=i.getContext("2d");if(!a)throw new Error("canvas 2d context unavailable");a.scale(r.scale,r.scale),RZ(a,r);const l=await new Promise(c=>i.toBlob(c,"image/png"));if(!l)throw new Error("image encoding failed");return l}function DZ(e,t=new Date){const n=i=>String(i).padStart(2,"0"),s=e.replace(/[\\/:*?"<>|\s]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40),r=`${t.getFullYear()}${n(t.getMonth()+1)}${n(t.getDate())}-${n(t.getHours())}${n(t.getMinutes())}${n(t.getSeconds())}`;return`weave-${s||"conversation"}-${r}.png`}function IZ(e,t){const n=URL.createObjectURL(e),s=document.createElement("a");s.href=n,s.download=t,s.click(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}const LZ=120,tR=40,PZ=500;function zZ(e,t,n){const s=t===1?e*16:e,r=n==="top"?-s:s;return Math.max(0,Math.min(tR,r))}function UZ(e,t){const n=t==="top"?e:-e;return Math.max(0,Math.min(tR,n))}function FZ(e=LZ){let t=0,n=!1,s=!1;return{setEdge(r){n=r,r||(t=0,s=!1)},add(r){return!n||r<=0?{value:t,fired:!1}:(t+=r,s||t<e?{value:t,fired:!1}:(s=!0,t=0,{value:0,fired:!0}))},reset(){t=0,s=!1}}}function nR(e){const[t,n]=x.useState(0),s=x.useRef(FZ()),r=x.useRef(null),i=x.useRef(null),a=x.useRef(e);a.current=e;const l=x.useCallback(()=>{i.current!==null&&(window.clearTimeout(i.current),i.current=null),s.current.reset(),n(0)},[]),c=x.useCallback(d=>{if(!a.current.enabled||d<=0)return;const f=s.current;f.setEdge(a.current.getEdge());const h=f.add(d);if(h.fired){l(),a.current.onFire();return}n(h.value),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(l,PZ)},[l]),u=x.useCallback(d=>{const f=r.current;r.current=d,f!==null&&c(UZ(d-f,a.current.axis))},[c]);return x.useEffect(()=>{e.enabled||l()},[e.enabled,l]),{px:t,syncEdge:x.useCallback(()=>s.current.setEdge(a.current.getEdge()),[]),wheel:x.useCallback((d,f)=>c(zZ(d,f,a.current.axis)),[c]),touchStart:x.useCallback(d=>{r.current=d},[]),touchMove:u,touchEnd:x.useCallback(()=>{r.current=null,l()},[l])}}const Wf=10,NE=["image/png","image/jpeg","image/gif","image/webp"],BZ=10*1024*1024,EE=8,HZ=40,$Z=/\.(png|jpe?g|gif|webp)$/i,sR=e=>e.type.startsWith("image/")||!e.type&&$Z.test(e.name);function _E(e){if(!e)return[];const t=Array.from(e.items??[]).filter(s=>s.kind==="file").map(s=>s.getAsFile()).filter(s=>!!s);return(t.length>0?t:Array.from(e.files??[])).filter(sR)}const GZ=10*6e4,KZ=10*6e4,qZ=60;function YZ(e){var t;try{const n=sessionStorage.getItem(`weave:conv:${e}`);if(!n)return null;const s=JSON.parse(n);return typeof s.at!="number"||Date.now()-s.at>KZ?null:(t=s.entries)!=null&&t.length?s.entries:null}catch{return null}}function VZ(e,t){try{sessionStorage.setItem(`weave:conv:${e}`,JSON.stringify({at:Date.now(),entries:t.slice(-qZ).map(({pipe:n,...s})=>s)}))}catch{}}const CE={socket:"tasks.msgViaSocket",relay:"tasks.msgViaRelay",terminal:"tasks.msgViaTerminal"},c0={pending:"bg-amber-900/40 text-amber-300",delivering:"bg-sky-900/40 text-sky-300",running:"bg-sky-900/40 text-sky-300",injected:"bg-sky-900/40 text-sky-300",delivered:"bg-emerald-900/40 text-emerald-300",succeeded:"bg-emerald-900/40 text-emerald-300",failed:"bg-red-900/40 text-red-300",timeout:"bg-red-900/40 text-red-300"},rR={pending:"tasks.msgStatusQueued",delivering:"tasks.msgStatusDelivering",running:"tasks.msgStatusRunning",injected:"tasks.msgStatusInjected",delivered:"tasks.msgStatusDelivered",succeeded:"tasks.msgStatusSucceeded",failed:"tasks.msgStatusFailed",timeout:"tasks.msgStatusTimeout"},TE=e=>e==="delivered"?"tasks.msgStatusSent":rR[e];function AE(e,t,n){var r,i;const s=[];for(const a of e)if(Iv(n,a.eventType,Ei(a).source))s.push({key:`e${a.id}`,eventId:a.id,role:"compaction",at:a.createdAt,text:""});else if(a.eventType===t.open){if(cm(a))continue;const l=k6(a);if(!l)continue;const{text:c,fromWeave:u,fromName:d}=tM(l);s.push({key:`e${a.id}`,eventId:a.id,role:"user",at:a.createdAt,text:(r=a.images)!=null&&r.length?c.replace(iR,"").trim():c,fromWeave:u,fromName:d,...(i=a.images)!=null&&i.length?{images:a.images}:{}})}else if(t.close.includes(a.eventType)){const l=w6(a);l&&s.push({key:`e${a.id}`,eventId:a.id,role:"assistant",at:a.createdAt,text:l})}return s}function ME(e){return tM(e).text.replace(/\s+/g," ").trim()}const iR=/\[Image #\d+\]/gi;function XZ(e,t,n=!1){const s=ME(e),r=ME(t);if(s===r)return!0;if(!n)return!1;const i=a=>a.replace(iR,"").replace(/\s+/g,"");return i(s)===i(r)}function QZ(e,t){const n=new Set,s=a=>{var u;if(a.eventId!==void 0){const d=t.filter(f=>!n.has(f.id)&&f.ackedEventId===a.eventId);if(d.length>0){for(const f of d)n.add(f.id);return d[0]}}let l,c=GZ;for(const d of t){if(n.has(d.id)||!XZ(a.text,d.text,(((u=d.images)==null?void 0:u.length)??0)>0))continue;const f=Math.abs(Date.parse(d.at)-Date.parse(a.at));f<c&&(l=d,c=f)}return l&&n.add(l.id),l},r=e.map(a=>{if(a.role!=="user")return a;const l=s(a);return l?{...a,pipe:l}:a}),i=t.filter(a=>!n.has(a.id)).sort((a,l)=>a.at.localeCompare(l.at));return{thread:r,outbox:i}}function jE(e){return e.status!=="delivering"&&e.status!=="running"&&e.status!=="delivered"}const WZ=["all","user","assistant"],ZZ={all:"tasks.convFilterAll",user:"tasks.convFilterSent",assistant:"tasks.convFilterRecv"};function JZ(e,t){return e==="compacting"||e==="running"&&(t==="user"||t==="compaction")}function eJ(e,t,n){return{text:e.slice(0,t)+`
539
+ `+e.slice(n),caret:t+1}}function tJ(e,t){return t==="all"?[...e]:e.filter(n=>n.role===t)}function Jx(e){const t=new Date(e),n=s=>String(s).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function nJ(e,t){return e.filter(n=>n.role!=="compaction").map(n=>{var i;const s=((i=n.images)==null?void 0:i.map((a,l)=>`[Image #${l+1}] ${a.name}`).join(`
540
+ `))??"",r=[n.text,s].filter(Boolean).join(`
541
+ `);return`[${Jx(n.at)}] ${n.role==="user"?t.user:t.assistant}
542
+ ${r}`}).join(`
543
+
544
+ `)}const sJ=300,RE=8,aR="weave:send-via";function rJ(){try{return localStorage.getItem(aR)==="terminal"?"terminal":"auto"}catch{return"auto"}}const OE=168,DE=72,iJ=e=>e.filter(t=>t.role!=="compaction").map(t=>({role:t.role,at:t.at,text:t.text})),lR="weave:conv-size",Zf={w:320,h:220},Rk=(e,t)=>({w:Math.min(Math.max(Math.round(e),Zf.w),Math.max(Zf.w+40,innerWidth-32)),h:t>0?Math.min(Math.max(Math.round(t),Zf.h),Math.max(Zf.h+40,innerHeight-32)):0}),IE=()=>Rk(Math.min(1100,Math.round(innerWidth*.62)),0);function aJ(){try{const e=JSON.parse(localStorage.getItem(lR)??"null");return!e||typeof e.w!="number"||typeof e.h!="number"?IE():Rk(e.w,e.h)}catch{return IE()}}function LE({on:e,className:t}){return o.jsx("span",{className:me("inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center self-start rounded border",e?"border-blue-400 bg-blue-500 text-white":"border-neutral-600 bg-neutral-900",t),children:e&&o.jsx(cr,{className:"h-2.5 w-2.5",strokeWidth:3})})}function lJ({text:e}){return o.jsx("span",{className:"relative min-w-0 flex-1 overflow-hidden",children:o.jsx("span",{className:"weave-ticker-in block truncate whitespace-nowrap",children:e},e)})}function oR({sessionId:e,projectId:t,label:n,projectLabel:s,capability:r,answerPending:i,onOpenAnswer:a,onInterrupt:l,interruptStateOf:c,minimized:u,onMinimize:d,onClose:f,embedded:h,onOpenChain:p}){var Gk,Kk,qk,Yk,Vk,Xk;const m=We(),{show:k}=an(),w=xn(),{statuses:g,sessions:y,refresh:b,modelCatalog:S}=Kd(),M=Gd[r.harness],E=x.useMemo(()=>{var K;return[M.open,...M.close,((K=Dv[r.harness])==null?void 0:K.end)??""].filter(Boolean)},[r.harness,M]),[A,R]=x.useState(()=>YZ(e)),[D,_]=x.useState(!1),[z,$]=x.useState(!1),[H,I]=x.useState(null),[L,C]=x.useState(""),[O,U]=x.useState([]),[F,j]=x.useState(0),[N,G]=x.useState(null),T=x.useRef(null),Z=x.useRef(null),[te,Q]=x.useState(null),[pe,V]=x.useState("all"),[q,Y]=x.useState(!1),[J,ce]=x.useState(!1),[ke,Ae]=x.useState(!1),[je,ae]=x.useState([]),[Oe,ye]=x.useState(()=>new Set),[ge,be]=x.useState(null),[$e,ft]=x.useState(rJ),[mt,rt]=x.useState(null),[nt,ee]=x.useState(()=>aJ()),[ne,Ce]=x.useState({x:0,y:0}),v=x.useRef(null),X=x.useRef(null),de=x.useRef(null),xe=x.useRef(null),fe=x.useRef(null),P=x.useRef(null),oe=x.useRef(null),le=Nl("(min-width: 1024px)"),ve=Nl("(pointer: coarse)"),Se=x.useCallback(K=>{Q(K instanceof Error?K.message:String(K))},[]),Ne=x.useCallback(async()=>{try{if(E.length===0){R([]),_(!0);return}const K=await Ee.listSessionHooks(t,e,Wf,void 0,E),he=AE(K,M,r.harness);_(K.length<Wf),R(Ke=>{var Vn;const Ve=Ke!=null&&Ke.length?Ke[Ke.length-1].eventId:void 0,kt=(Vn=he[0])==null?void 0:Vn.eventId;return Ve===void 0||kt===void 0||kt>Ve?he:[...Ke.filter(ys=>(ys.eventId??0)<kt),...he]}),Q(null)}catch(K){Se(K)}},[r.harness,E,Se,M,t,e]),ue=x.useCallback(async()=>{try{I(await Ee.listSessionMessages(e)),Q(null)}catch(K){Se(K)}},[Se,e]),_e=x.useCallback(async()=>{try{ae(await Ee.listSessionHooks(t,e,HZ))}catch{}},[t,e]);x.useEffect(()=>{Ne(),ue()},[Ne,ue]),x.useEffect(()=>{A&&A.length>0&&VZ(e,A)},[A,e]),x.useEffect(()=>{let K=null,he=!1,Ke=!1,Ve=!1;const Vn=Aa(ys=>{var Rc;if(ys.sessionId!==e)return;const jc=ys.kind==="event.ingested";!jc&&!((Rc=ys.kind)!=null&&Rc.startsWith("message."))||(jc?(Ve=!0,(ys.eventType===M.open||M.close.includes(ys.eventType??""))&&(he=!0)):Ke=!0,K!==null&&window.clearTimeout(K),K=window.setTimeout(()=>{K=null;const lf=he,Om=Ke,wO=Ve;he=Ke=Ve=!1,lf&&Ne(),Om&&ue(),wO&&_e()},500))});return()=>{Vn(),K!==null&&window.clearTimeout(K)}},[M,_e,Ne,ue,e]),x.useEffect(()=>{if(u)return;const K=he=>{he.key==="Escape"&&(ge?be(null):q?(Y(!1),ye(new Set)):ke?Ae(!1):J?ce(!1):d==null||d())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[ge,q,ke,J,u,d]),x.useEffect(()=>{if(!ge)return;const K=Ke=>{var Ve,kt;(kt=(Ve=Ke.target)==null?void 0:Ve.closest)!=null&&kt.call(Ve,"[data-conv-menu]")||(Ke.stopPropagation(),be(null))},he=()=>be(null);return window.addEventListener("pointerdown",K,!0),window.addEventListener("contextmenu",K,!0),window.addEventListener("wheel",he,{capture:!0,passive:!0}),window.addEventListener("resize",he),()=>{window.removeEventListener("pointerdown",K,!0),window.removeEventListener("contextmenu",K,!0),window.removeEventListener("wheel",he,!0),window.removeEventListener("resize",he)}},[ge]);const Me=x.useCallback(async()=>{var he,Ke;const K=(he=A==null?void 0:A[0])==null?void 0:he.eventId;if(!(K===void 0||z||D)){$(!0);try{const Ve=await Ee.listSessionHooks(t,e,Wf,K,E);_(Ve.length<Wf);const kt=AE(Ve,M,r.harness);kt.length>0&&(de.current=((Ke=v.current)==null?void 0:Ke.scrollHeight)??null,R(Vn=>[...kt,...Vn??[]]))}catch(Ve){Se(Ve)}finally{$(!1)}}},[r.harness,E,A,Se,D,M,z,t,e]);x.useLayoutEffect(()=>{const K=v.current;!K||de.current===null||(K.scrollTop+=K.scrollHeight-de.current,de.current=null)},[A]);const Fe=x.useMemo(()=>(H??[]).filter(K=>K.mode==="prompt"),[H]),{thread:De,outbox:He}=x.useMemo(()=>QZ(A??[],Fe),[A,Fe]),Ge=(Gk=[...He].reverse().find(jE))==null?void 0:Gk.id,xt=x.useRef(!0),Mt=()=>{const K=v.current;return!!K&&K.scrollHeight-K.scrollTop-K.clientHeight<=40},Ot=x.useRef({top:0,atBottom:!0});x.useEffect(()=>{const K=v.current;if(!K)return;let he=K.clientHeight>0;const Ke=new ResizeObserver(()=>{const Ve=K.clientHeight>0;Ve&&!he&&(K.scrollTop=Ot.current.atBottom?K.scrollHeight:Ot.current.top),he=Ve});return Ke.observe(K),()=>Ke.disconnect()},[]);const Dt=(Kk=De[De.length-1])==null?void 0:Kk.key,Wt=g.get(e),zt=Wt==="compacting",Ht=Wt==="interrupted",se=JZ(Wt,(qk=De[De.length-1])==null?void 0:qk.role),Pe=x.useMemo(()=>{var he;const K=((he=[...De].reverse().find(Ke=>Ke.role==="user"))==null?void 0:he.eventId)??0;for(let Ke=je.length-1;Ke>=0;Ke--){const Ve=je[Ke];if(Ve.id<=K)break;const kt=Su(Ve).trim();if(kt)return kt}return null},[je,De]),Be=He.map(K=>`${K.id}:${K.status}${K.stalled===!0?"!":""}`).join(","),it=`${Dt??""}|${Be}|${se?"g":""}${Ht?"i":""}${i?"a":""}`,Ze=x.useRef(void 0);x.useLayoutEffect(()=>{if(u||A===null||it===Ze.current||(Ze.current=it,!xt.current))return;const K=v.current;K&&(K.scrollTop=K.scrollHeight)},[A,it,u]);const _n=x.useMemo(()=>tJ(De,pe),[De,pe]),yt=nR({axis:"top",getEdge:()=>{var K;return(((K=v.current)==null?void 0:K.scrollTop)??1)<=1},onFire:()=>void Me(),enabled:A!==null&&!D&&!z}),Br=EM(Wt??"open",NM(r.harness)?(Yk=y==null?void 0:y.find(K=>K.sessionId===e))==null?void 0:Yk.turnOpen:void 0),Hr=K=>ye(he=>{const Ke=new Set(he);return Ke.delete(K)||Ke.add(K),Ke}),Os=K=>{be(null),Y(!0),K!==void 0&&ye(new Set([K]))},Ci=()=>De.filter(K=>Oe.has(K.key)),is=De.filter(K=>K.role!=="compaction"),$r=is.length>0&&is.every(K=>Oe.has(K.key)),Da=()=>ye($r?new Set:new Set(is.map(K=>K.key))),Gr=()=>{const K=Ci();if(K.length===0)return;const he=nJ(K,{user:m("tasks.convRoleUser"),assistant:m("tasks.convRoleAssistant")});Em(he).then(Ke=>k(Ke?"success":"error",Ke?m("tasks.convCopyOk",{n:K.length}):m("tasks.convCopyFailed")))},Ti=K=>{const he=Ci();he.length!==0&&(be(null),w.run(`convImg:${e}`,async()=>{let Ke;try{Ke=await OZ(iJ(he),{title:n,subtitle:`${s} · ${m("tasks.convImgSubtitle",{at:Jx(new Date().toISOString()),n:he.length})}`,labels:{user:m("tasks.convRoleUser"),assistant:m("tasks.convRoleAssistant")},stamp:Jx})}catch(Ve){throw new Error(m("tasks.convImgFailed",{error:Ye(Ve)}))}if(K==="download")IZ(Ke,DZ(n)),k("success",m("tasks.convImgSaved"));else if(await nK(Ke))k("success",m("tasks.convImgOk",{n:he.length}));else throw new Error(m("tasks.convImgCopyFailed"))},{fail:Ye}))},Kr=K=>{const he=K.currentTarget.getBoundingClientRect();be({kind:"share",x:he.right-OE,y:he.top-DE})},xr=()=>be({kind:"send"}),Ai=K=>{ft(K);try{localStorage.setItem(aR,K)}catch{}be(null)},qr=K=>he=>{!ve||q||he.button!==0||(P.current={key:K,x:he.clientX,y:he.clientY})},Mi=K=>{const he=P.current;he&&(Math.abs(K.clientX-he.x)>RE||Math.abs(K.clientY-he.y)>RE)&&(P.current=null)},Ws=K=>he=>{const Ke=P.current;if(P.current=null,!Ke||Ke.key!==K)return;const Ve=Date.now(),kt=oe.current;oe.current={key:K,at:Ve},!(!kt||kt.key!==K||Ve-kt.at>sJ)&&(oe.current=null,be({kind:"bubble",x:he.clientX,y:he.clientY,key:K}))},Hn=()=>{P.current=null},ji=(K,he,Ke)=>{var ys;const Ve=(ys=X.current)==null?void 0:ys.getBoundingClientRect(),kt=Math.max(0,(innerWidth-((Ve==null?void 0:Ve.width)??Ke.w))/2-12),Vn=Math.max(0,(innerHeight-((Ve==null?void 0:Ve.height)??0))/2-12);return{x:Math.max(-kt,Math.min(kt,K)),y:Math.max(-Vn,Math.min(Vn,he))}},Ri=K=>{var Ke;const he=(Ke=X.current)==null?void 0:Ke.getBoundingClientRect();xe.current={x:K.clientX,y:K.clientY,w:nt.w,h:nt.h||Math.round((he==null?void 0:he.height)??0)},K.currentTarget.setPointerCapture(K.pointerId)},Yr=K=>{const he=xe.current;if(!he)return;const Ke=Rk(he.w+(K.clientX-he.x),he.h+(K.clientY-he.y));ee(Ke),Ce(Ve=>ji(Ve.x,Ve.y,Ke))},Oi=()=>{xe.current&&(xe.current=null,ee(K=>{try{localStorage.setItem(lR,JSON.stringify(K))}catch{}return K}))},Ia=K=>{!le||K.target.closest("button")||(fe.current={x:K.clientX,y:K.clientY,px:ne.x,py:ne.y},K.currentTarget.setPointerCapture(K.pointerId))},Zs=K=>{const he=fe.current;he&&Ce(ji(he.px+(K.clientX-he.x),he.py+(K.clientY-he.y),nt))},yr=()=>{fe.current=null},xs=K=>({onContextMenu:he=>{q||ve||(he.preventDefault(),be({kind:"bubble",x:he.clientX,y:he.clientY,key:K}))},onPointerDown:qr(K),onPointerMove:Mi,onPointerUp:Ws(K),onPointerCancel:Hn,onClick:q?()=>Hr(K):void 0}),La=K=>new Promise((he,Ke)=>{const Ve=new FileReader;Ve.onerror=()=>Ke(new Error(K.name)),Ve.onload=()=>{const kt=String(Ve.result??""),Vn=kt.indexOf(",");Ee.uploadImage({name:K.name||"image",mediaType:K.type,data:Vn>=0?kt.slice(Vn+1):kt}).then(he,Ke)},Ve.readAsDataURL(K)}),fn=K=>{const he=Array.from(K).filter(sR);he.length!==0&&(j(Ke=>Ke+he.length),(async()=>{for(const Ke of he)try{if(!NE.includes(Ke.type)){k("error",m("tasks.msgImageBadType"));continue}if(Ke.size>BZ){k("error",m("tasks.msgImageTooLarge"));continue}const Ve=await La(Ke);U(kt=>kt.length>=EE?(k("error",m("tasks.msgImageTooMany")),kt):[...kt,Ve])}catch(Ve){k("error",m("tasks.msgImageUploadFailed",{error:Ye(Ve)}))}finally{j(Ve=>Ve-1)}})())},vr=()=>{const K=Z.current,he=(K==null?void 0:K.selectionStart)??L.length,Ke=(K==null?void 0:K.selectionEnd)??he,Ve=eJ(L,he,Ke);C(Ve.text),requestAnimationFrame(()=>{K&&(K.selectionStart=K.selectionEnd=Ve.caret)})},Zt=()=>{const K=L.trim(),he=O;!K&&he.length===0||(C(""),U([]),xt.current=!0,w.run(`sendMsg:${e}`,async()=>{var Ve;((Ve=(await Ee.sendSessionMessage(e,{text:K,...he.length>0?{images:he.map(kt=>kt.id)}:{},...$e==="terminal"?{forceTerminal:!0}:{}})).message)==null?void 0:Ve.reason)==="offline"&&k("error",m("tasks.msgOfflineToast")),await ue()},{fail:Ke=>m("tasks.msgSendFailed",{error:Ye(Ke)})}))},Di=K=>{w.run(`dequeue:${K.id}`,async()=>{await Ee.dismissSessionMessage(e,K.id),C(he=>he.trim()?`${he}
545
+ ${K.text}`:K.text),U(he=>[...he,...K.images??[]].slice(0,EE)),await ue()},{fail:he=>m("tasks.msgDequeueFailed",{error:Ye(he)})})},W=K=>o.jsxs(o.Fragment,{children:[(K.status==="failed"||K.stalled===!0)&&o.jsx("button",{type:"button",title:m("tasks.msgResend"),"aria-label":m("tasks.msgResend"),disabled:w.stateOf(`resend:${K.id}`)==="loading",onClick:()=>void w.run(`resend:${K.id}`,async()=>{await Ee.resendSessionMessage(e,K.id),await ue()},{fail:he=>m("tasks.msgResendFailed",{error:Ye(he)})}),className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-amber-500/30 bg-amber-950/30 text-amber-300 transition-colors hover:border-amber-500/50 disabled:opacity-40",children:o.jsx(ut,{state:w.stateOf(`resend:${K.id}`),className:"h-3 w-3",icon:o.jsx(Sg,{className:"h-3 w-3"})})}),K.id===Ge&&o.jsx("button",{type:"button",title:m("tasks.outboxDequeueHint"),"aria-label":m("tasks.outboxDequeue"),disabled:w.stateOf(`dequeue:${K.id}`)==="loading",onClick:()=>Di(K),className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-blue-500/30 bg-blue-500/10 text-blue-300 transition-colors hover:border-blue-500/50 disabled:opacity-40",children:o.jsx(ut,{state:w.stateOf(`dequeue:${K.id}`),className:"h-3 w-3",icon:o.jsx(Cv,{className:"h-3 w-3"})})}),jE(K)&&o.jsx("button",{type:"button",title:m(K.status==="pending"?"tasks.msgDismissQueuedHint":"tasks.msgDismissHint"),"aria-label":m("tasks.msgDismiss"),disabled:w.stateOf(`dismiss:${K.id}`)==="loading",onClick:()=>void w.run(`dismiss:${K.id}`,async()=>{await Ee.dismissSessionMessage(e,K.id),await ue()},{fail:he=>m("tasks.msgDismissFailed",{error:Ye(he)})}),className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-edge/[0.12] text-neutral-400 transition-colors hover:border-edge/20 hover:text-neutral-200 disabled:opacity-40",children:o.jsx(ut,{state:w.stateOf(`dismiss:${K.id}`),className:"h-3 w-3",icon:o.jsx(Qs,{className:"h-3 w-3"})})})]}),we=y==null?void 0:y.find(K=>K.sessionId===e),Re=SM(r.harness),B=u9(r.harness),re=S[r.harness]??[],Ie=(we==null?void 0:we.mode)??null,at=(we==null?void 0:we.model)??null,vt=d9(r.harness,Ie),Cn=()=>{w.run(`cycleMode:${e}`,async()=>{await Ee.cycleSessionMode(e),await b(),k("success",m("tasks.modeCycled"))},{fail:K=>m("tasks.modeCycleFailed",{error:Ye(K)})})},kr=K=>{w.run(`setModel:${e}`,async()=>{await Ee.setSessionModel(e,K),await b(),k("success",m("tasks.modelSet"))},{fail:he=>m("tasks.modelSetFailed",{error:Ye(he)})})},Mc=re.length>0?re.map(K=>({value:K.alias,label:K.actual===K.alias?K.alias:`${K.alias} — ${K.actual}`})):B.map(K=>({value:K,label:K})),Tn=(we==null?void 0:we.modelAlias)??at??"",kO=()=>{L.trim()||O.length>0?ce(!0):f==null||f()},$k=o.jsxs("div",{ref:X,style:!h&&le?{width:nt.w,height:nt.h||void 0,transform:ne.x||ne.y?`translate(${ne.x}px, ${ne.y}px)`:void 0}:void 0,className:me("relative min-h-0 w-full flex-col overflow-hidden p-3",h?me("flex-1",u?"hidden":"flex"):"flex h-[70dvh] max-lg:h-[88dvh] rounded-xl border border-edge/[0.08] bg-neutral-900 shadow-mac"),onClick:K=>K.stopPropagation(),onDragOver:K=>K.preventDefault(),onDrop:K=>{K.preventDefault();const he=_E(K.dataTransfer);he.length>0&&fn(he)},children:[o.jsxs("div",{...h?{}:{onPointerDown:Ia,onPointerMove:Zs,onPointerUp:yr,onPointerCancel:yr},className:me("flex items-center justify-between gap-2 pb-2",!h&&le&&"cursor-grab active:cursor-grabbing"),children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("p",{className:"truncate text-xs font-medium text-neutral-200",children:[m("tasks.messagesTitle")," · ",n]}),o.jsx("p",{className:"truncate text-[10px] text-neutral-500",children:s})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[h&&o.jsxs("button",{type:"button",title:m("tasks.chainTitle"),onClick:p,className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.08] px-1.5 py-0.5 text-[10px] text-neutral-400 transition-colors hover:border-edge/[0.16] hover:text-neutral-200 max-lg:py-1.5",children:[o.jsx(jA,{className:"h-3 w-3 text-rose-400"}),m("tasks.chainTitle")]}),!h&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",title:m("tasks.messagesMinimize"),"aria-label":m("tasks.messagesMinimize"),onClick:d,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(FA,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",title:m("tasks.messagesClose"),"aria-label":m("tasks.messagesClose"),onClick:kO,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(tn,{className:"h-3.5 w-3.5"})})]})]})]}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1 pb-2",children:[WZ.map(K=>o.jsx("button",{type:"button",onClick:()=>V(K),className:me("rounded border px-1.5 py-0.5 text-[10px] transition-colors",pe===K?"border-blue-500/40 bg-blue-500/10 text-blue-300":"border-edge/[0.08] text-neutral-500 hover:text-neutral-300"),children:m(ZZ[K])},K)),o.jsx("span",{className:"ml-auto text-[10px] text-neutral-600",children:m("tasks.convCount",{n:De.length})})]}),o.jsxs("div",{ref:v,onScroll:()=>{const K=v.current;if(K&&K.clientHeight>0){const he=Mt();Ot.current={top:K.scrollTop,atBottom:he},xt.current=he}Hn(),yt.syncEdge()},onWheel:K=>yt.wheel(K.deltaY,K.deltaMode),onTouchStart:K=>{var he;return yt.touchStart(((he=K.touches[0])==null?void 0:he.clientY)??0)},onTouchMove:K=>{var he;return yt.touchMove(((he=K.touches[0])==null?void 0:he.clientY)??0)},onTouchEnd:yt.touchEnd,onTouchCancel:yt.touchEnd,className:"relative min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain pr-1",children:[yt.px>0&&o.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 right-0 top-1 flex justify-center",style:{transform:`translateY(${yt.px}px)`},children:o.jsx("span",{className:"text-[10px] text-neutral-600",children:m("tasks.pullMore")})}),o.jsx("div",{className:"space-y-2",style:yt.px>0?{transform:`translateY(${yt.px}px)`}:void 0,children:A===null?o.jsxs("p",{className:"flex items-center justify-center gap-1.5 pt-6 text-xs text-neutral-600",children:[o.jsx(zn,{className:"h-3.5 w-3.5 animate-spin"}),m("hooks.loading")]}):De.length===0&&He.length===0?o.jsx("p",{className:"pt-6 text-center text-xs text-neutral-600",children:m("tasks.messagesEmpty")}):o.jsxs(o.Fragment,{children:[z&&o.jsxs("p",{className:"flex items-center justify-center gap-1.5 pt-1 text-[10px] text-neutral-600",children:[o.jsx(zn,{className:"h-3 w-3 animate-spin"}),m("tasks.msgEarlier")]}),_n.length===0&&o.jsx("p",{className:"pt-6 text-center text-xs text-neutral-600",children:m("tasks.convFilterEmpty")}),_n.map(K=>{var Ke;if(K.role==="compaction")return o.jsxs("div",{className:"flex items-center gap-2 py-1 text-[10px] text-neutral-600",children:[o.jsx("span",{className:"h-px flex-1 bg-edge/[0.08]"}),o.jsxs("span",{className:"shrink-0",children:[m("hooks.mindmap.compactTag")," · ",Fc(K.at)]}),o.jsx("span",{className:"h-px flex-1 bg-edge/[0.08]"})]},K.key);if(K.role==="assistant")return o.jsxs("div",{...xs(K.key),className:me("flex touch-manipulation justify-start",q&&"select-none"),children:[o.jsxs("div",{className:"min-w-0 max-w-[92%] overflow-x-auto rounded-lg border border-edge/[0.08] bg-neutral-800/50 px-2 py-1.5",children:[o.jsx("span",{className:"mb-0.5 block text-[10px] text-neutral-600",children:Fc(K.at)}),o.jsx(Op,{text:K.text})]}),q&&o.jsx(LE,{on:Oe.has(K.key),className:"ml-1.5 mt-1"})]},K.key);const he=K.pipe;return o.jsxs("div",{...xs(K.key),className:me("flex touch-manipulation items-end justify-end gap-1",q&&"select-none"),children:[q&&o.jsx(LE,{on:Oe.has(K.key),className:"mr-1.5 mt-1"}),(he==null?void 0:he.acked)===!0&&o.jsx("span",{title:m("tasks.msgAcked"),className:"mb-0.5 inline-flex h-3 w-3 shrink-0 items-center justify-center rounded-full bg-neutral-500 text-neutral-900",children:o.jsx(cr,{className:"h-2 w-2",strokeWidth:3})}),he&&he.acked!==!0&&he.status==="delivered"&&o.jsx("span",{title:m("tasks.msgDeliveredHint"),className:"mb-0.5 h-3 w-3 shrink-0 rounded-full border border-neutral-500"}),o.jsxs("div",{className:me("min-w-0 max-w-[85%] overflow-x-auto rounded-lg border px-2 py-1.5",he?"border-blue-500/30 bg-blue-500/[0.12]":"border-blue-500/15 bg-blue-500/[0.05]"),children:[o.jsxs("div",{className:"mb-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5",children:[K.fromWeave&&o.jsx("span",{className:"shrink-0 rounded bg-blue-500/15 px-1 py-px text-[10px] font-medium text-blue-300",children:"weave"}),K.fromWeave!==!0&&K.fromName!=null&&o.jsx("span",{className:"shrink-0 rounded border border-edge/[0.12] px-1 py-px text-[10px] text-neutral-400",children:K.fromName}),he!==void 0&&he.status!=="delivered"&&o.jsx(Qe,{className:me("shrink-0",c0[he.status]),children:m(rR[he.status])}),he!==void 0&&he.via!=null&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:m(CE[he.via])}),(he==null?void 0:he.stalled)===!0&&o.jsx("span",{className:"shrink-0 text-[10px] text-amber-400",children:m("tasks.msgStalled")}),o.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-neutral-600",children:Fc(K.at)})]}),(Ke=K.images)!=null&&Ke.length?o.jsx("div",{className:"mb-1 flex flex-wrap gap-1.5",children:K.images.map(Ve=>o.jsx("button",{type:"button",title:Ve.name,onClick:kt=>{q||(kt.stopPropagation(),G(Ve))},className:"block h-14 w-14 overflow-hidden rounded border border-edge/[0.12] bg-neutral-950",children:o.jsx("img",{src:`${mi}/images/${Ve.id}`,alt:Ve.name,className:"h-full w-full object-cover",loading:"lazy"})},Ve.id))}):null,o.jsx("div",{className:"[&_p]:whitespace-pre-wrap",children:o.jsx(Op,{text:K.text})}),(he==null?void 0:he.reason)==="offline"?o.jsx("p",{className:"mt-1 break-words text-[11px] text-amber-400",children:m("tasks.msgOffline")}):(he==null?void 0:he.error)&&o.jsx("p",{className:"mt-1 break-words text-[11px] text-red-400",children:he.error}),!q&&he&&(he.status==="failed"||he.status==="pending"||he.stalled===!0)&&o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(he.status==="failed"||he.stalled===!0)&&o.jsxs("button",{type:"button",disabled:w.stateOf(`resend:${he.id}`)==="loading",onClick:()=>void w.run(`resend:${he.id}`,async()=>{await Ee.resendSessionMessage(e,he.id),await ue()},{fail:Ve=>m("tasks.msgResendFailed",{error:Ye(Ve)})}),className:"inline-flex items-center gap-1 rounded border border-amber-500/30 bg-amber-950/30 px-1.5 py-0.5 text-[10px] text-amber-300 transition-colors hover:border-amber-500/50 disabled:opacity-40",children:[o.jsx(ut,{state:w.stateOf(`resend:${he.id}`),className:"h-3 w-3",icon:o.jsx(Sg,{className:"h-3 w-3"})}),m("tasks.msgResend")]}),o.jsxs("button",{type:"button",title:m(he.status==="pending"?"tasks.msgDismissQueuedHint":"tasks.msgDismissHint"),disabled:w.stateOf(`dismiss:${he.id}`)==="loading",onClick:()=>void w.run(`dismiss:${he.id}`,async()=>{await Ee.dismissSessionMessage(e,he.id),await ue()},{fail:Ve=>m("tasks.msgDismissFailed",{error:Ye(Ve)})}),className:"inline-flex items-center gap-1 rounded border border-edge/[0.1] px-1.5 py-0.5 text-[10px] text-neutral-400 transition-colors hover:border-edge/20 hover:text-neutral-200 disabled:opacity-40",children:[o.jsx(ut,{state:w.stateOf(`dismiss:${he.id}`),className:"h-3 w-3",icon:o.jsx(Qs,{className:"h-3 w-3"})}),m("tasks.msgDismiss")]})]})]})]},K.key)}),!q&&He.length>0&&o.jsx("div",{className:"flex justify-end",children:o.jsx("div",{className:"min-w-0 max-w-[95%] overflow-x-auto rounded-lg border border-dashed border-blue-500/30 bg-blue-500/[0.07] px-2 py-1.5",children:He.map((K,he)=>{var kt,Vn,ys,jc,Rc,lf;const Ke=He.length===1||mt===K.id,Ve=()=>{He.length>1&&rt(Om=>Om===K.id?null:K.id)};return o.jsxs("div",{className:me("flex gap-1.5",Ke?"items-start":"items-center",he>0&&"mt-1 border-t border-blue-500/10 pt-1"),children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[Ke?o.jsxs("div",{onClick:Ve,className:me("mb-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5",He.length>1&&"cursor-pointer"),children:[o.jsx(Qe,{className:me("shrink-0",c0[K.status]),children:m(TE(K.status))}),K.via!=null&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:m(CE[K.via])}),K.stalled===!0&&o.jsx("span",{className:"shrink-0 text-[10px] text-amber-400",children:m("tasks.msgStalled")}),(kt=K.images)!=null&&kt.length?o.jsx(Cf,{className:"h-3 w-3 shrink-0 text-neutral-500"}):null,o.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-neutral-600",children:Fc(K.at)})]}):o.jsxs("button",{type:"button",title:K.text,onClick:Ve,className:"flex w-full min-w-0 items-center gap-1.5 text-left",children:[o.jsx(Qe,{className:me("shrink-0",c0[K.status]),children:m(TE(K.status))}),K.stalled===!0&&o.jsx(lm,{className:"h-3 w-3 shrink-0 text-amber-400"}),(Vn=K.images)!=null&&Vn.length?o.jsx(Cf,{className:"h-3 w-3 shrink-0 text-neutral-500"}):null,o.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] text-neutral-200",children:K.text||((jc=(ys=K.images)==null?void 0:ys[0])==null?void 0:jc.name)}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:Fc(K.at)})]}),Ke&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"whitespace-pre-wrap break-words text-[12px] text-neutral-200",children:K.text||((lf=(Rc=K.images)==null?void 0:Rc[0])==null?void 0:lf.name)}),K.reason==="offline"?o.jsx("p",{className:"mt-1 break-words text-[11px] text-amber-400",children:m("tasks.msgOffline")}):K.error?o.jsx("p",{className:"mt-1 break-words text-[11px] text-red-400",children:K.error}):null]})]}),o.jsx("div",{className:me("flex shrink-0 items-center gap-1",Ke&&"pt-0.5"),children:W(K)})]},`q:${K.id}`)})})}),(i||se||Ht)&&o.jsxs("div",{className:"flex flex-wrap items-center justify-start gap-1.5",children:[i&&o.jsxs("button",{type:"button",title:m("tasks.answerTooltip"),onClick:()=>a==null?void 0:a(),className:"flex items-center gap-1.5 rounded-lg border border-amber-400/40 bg-amber-500/10 px-2 py-1.5 text-[10px] font-medium text-amber-300 transition-colors hover:border-amber-400/60 hover:text-amber-200",children:[o.jsx(DA,{className:"h-3 w-3"}),m("tasks.convAnswer")]}),(se||Ht)&&o.jsxs("div",{className:"flex min-w-0 grow basis-48 items-center gap-1.5 rounded-lg border border-edge/[0.08] bg-neutral-800/50 px-2 py-1.5 text-[10px] text-neutral-500",children:[Ht?o.jsx(RA,{className:"h-3 w-3 shrink-0"}):o.jsx(zn,{className:"h-3 w-3 shrink-0 animate-spin"}),Ht?m("tasks.msgInterrupted"):zt?m("tasks.msgCompacting"):Pe?o.jsx(lJ,{text:Pe}):m("tasks.msgGenerating")]})]})]})})]}),te&&o.jsx("p",{className:"mt-1 shrink-0 rounded border border-red-500/30 bg-red-950/30 px-2 py-1 text-[11px] text-red-300",children:te}),q?o.jsxs("div",{className:"mt-2 flex shrink-0 flex-wrap items-center gap-x-1.5 gap-y-1",children:[o.jsx("span",{className:"min-w-0 truncate text-[11px] text-neutral-400",children:m("tasks.convSelected",{n:Oe.size})}),o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[o.jsxs("button",{type:"button",disabled:De.length===0,onClick:Da,className:me("inline-flex shrink-0 items-center gap-1 rounded border px-2 py-1 text-[11px] transition-colors disabled:opacity-40",$r?"border-blue-500/40 bg-blue-500/10 text-blue-300":"border-edge/[0.1] text-neutral-200 hover:border-edge/20"),children:[o.jsx(jP,{className:"h-3 w-3"}),m($r?"tasks.convDeselectAll":"tasks.convSelectAll")]}),o.jsxs("button",{type:"button",disabled:Oe.size===0,onClick:Gr,className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-2 py-1 text-[11px] text-neutral-200 transition-colors hover:border-edge/20 disabled:opacity-40",children:[o.jsx(Vu,{className:"h-3 w-3"}),m("tasks.convCopy")]}),o.jsxs("button",{type:"button",disabled:Oe.size===0,onClick:Kr,title:m("tasks.convShare"),className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-2 py-1 text-[11px] text-neutral-200 transition-colors hover:border-edge/20 disabled:opacity-40",children:[o.jsx(ut,{state:w.stateOf(`convImg:${e}`),className:"h-3 w-3",icon:o.jsx(Cf,{className:"h-3 w-3"})}),m("tasks.convShare")]}),o.jsx("button",{type:"button",onClick:()=>{Y(!1),ye(new Set)},className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-2 py-1 text-[11px] text-neutral-400 transition-colors hover:border-edge/20 hover:text-neutral-200",children:m("tasks.convCancel")})]})]}):o.jsxs("div",{className:"mt-2 flex shrink-0 flex-col gap-1.5",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("input",{ref:T,type:"file",accept:NE.join(","),multiple:!0,className:"hidden",onChange:K=>{var he;(he=K.target.files)!=null&&he.length&&fn(K.target.files),K.target.value=""}}),o.jsxs("button",{type:"button",disabled:!r.imageAttach||F>0,title:r.imageAttach?m("tasks.msgImageAttach"):((Vk=r.unsupportedReasons)==null?void 0:Vk.prompt)??m("tasks.msgImageUnsupported"),"aria-label":m("tasks.msgImageAttach"),onClick:()=>{var K;return(K=T.current)==null?void 0:K.click()},className:"inline-flex shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-1.5 py-0.5 text-[11px] text-neutral-300 transition-colors hover:border-blue-500/40 hover:text-blue-300 disabled:opacity-40 max-lg:px-2.5 max-lg:py-1.5",children:[F>0?o.jsx(zn,{className:"h-3 w-3 animate-spin"}):o.jsx(Cf,{className:"h-3 w-3"}),m("tasks.msgImageAttach")]}),O.map(K=>o.jsxs("span",{className:"relative inline-flex shrink-0",children:[o.jsx("button",{type:"button",title:K.name,onClick:()=>G(K),className:"block h-10 w-10 overflow-hidden rounded border border-edge/[0.12] bg-neutral-950",children:o.jsx("img",{src:`${mi}/images/${K.id}`,alt:K.name,className:"h-full w-full object-cover",loading:"lazy"})}),o.jsx("button",{type:"button",title:m("tasks.msgImageRemove"),"aria-label":m("tasks.msgImageRemove"),onClick:()=>U(he=>he.filter(Ke=>Ke.id!==K.id)),className:"absolute -right-1 -top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full border border-edge/[0.15] bg-neutral-800 text-neutral-300 hover:border-red-500/50 hover:text-red-300 max-lg:h-5 max-lg:w-5",children:o.jsx(tn,{className:"h-2.5 w-2.5"})})]},K.id))]}),(Re.length>0||B.length>0)&&o.jsxs("div",{className:"ml-auto flex max-w-full shrink-0 flex-wrap items-center gap-x-2 gap-y-1 max-lg:ml-0 max-lg:basis-full max-lg:justify-between",children:[Re.length>0&&o.jsxs("button",{type:"button",title:m("tasks.modeCycle"),"aria-label":m("tasks.modeCycle"),onClick:()=>Ae(!0),className:"inline-flex min-w-0 shrink-0 items-center gap-1 rounded border border-edge/[0.1] px-1.5 py-0.5 transition-colors hover:border-blue-500/40",children:[o.jsx(ut,{state:w.stateOf(`cycleMode:${e}`),className:"h-3 w-3 text-neutral-500",icon:o.jsx(Sg,{className:"h-3 w-3"})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:m("tasks.modeLabel")}),o.jsx("span",{title:Ie??m("tasks.modeLastKnown"),style:{color:vt??void 0},className:me("truncate font-mono text-[11px] max-lg:max-w-[7rem]",!vt&&"text-neutral-400"),children:Ie??m("tasks.modeUnknown")})]}),B.length>0&&o.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:m("tasks.modelLabel")}),o.jsxs("div",{className:"relative min-w-0",children:[o.jsxs("select",{value:Tn,onChange:K=>{const he=K.target.value;he&&kr(he)},title:m("tasks.modelLastKnown"),"aria-label":m("tasks.modelLabel"),className:"max-w-[12rem] appearance-none rounded border border-edge/[0.1] bg-neutral-950 py-0.5 pl-1.5 pr-6 font-mono text-[11px] text-neutral-200 focus:border-blue-500/40 focus:outline-none max-lg:max-w-[8rem]",children:[!Tn&&o.jsx("option",{value:"",children:m("tasks.modelUnknown")}),Mc.map(K=>o.jsx("option",{value:K.value,children:K.label},K.value)),Tn&&!Mc.some(K=>K.value===Tn)&&o.jsx("option",{value:Tn,children:Tn})]}),o.jsx(Bn,{className:"pointer-events-none absolute right-1 top-1/2 h-3 w-3 -translate-y-1/2 text-neutral-500"})]})]})]})]}),o.jsxs("div",{className:"flex items-end gap-1.5",children:[o.jsx("textarea",{ref:Z,value:L,onChange:K=>C(K.target.value),onKeyDown:K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),Zt())},onPaste:K=>{const he=_E(K.clipboardData);he.length!==0&&(K.preventDefault(),fn(he))},placeholder:m("tasks.messagesPlaceholder"),rows:2,className:"min-w-0 flex-1 resize-none rounded border border-edge/[0.1] bg-neutral-950 px-2 py-1.5 text-xs text-neutral-100 focus:outline-none focus:border-blue-500/40"}),o.jsx("button",{type:"button",title:m("tasks.msgNewline"),"aria-label":m("tasks.msgNewline"),onClick:vr,className:"hidden max-lg:inline-flex shrink-0 items-center justify-center rounded border border-edge/[0.1] px-2.5 py-1 text-neutral-400 transition-colors hover:border-blue-500/40 hover:text-blue-300",children:o.jsx(LP,{className:"h-3.5 w-3.5"})}),o.jsxs("div",{className:"flex shrink-0 items-center gap-1 max-lg:flex-col max-lg:items-stretch",children:[Br&&o.jsxs("button",{type:"button",title:m("tasks.stopTooltip"),"aria-label":m("tasks.stopTooltip"),onClick:()=>l(e),className:"inline-flex shrink-0 items-center justify-center gap-1 rounded border border-edge/[0.1] px-2.5 py-1 text-[11px] text-neutral-400 transition-colors hover:border-red-500/40 hover:text-red-300 max-lg:px-3 max-lg:py-2",children:[o.jsx(ut,{state:c(e),className:"h-3 w-3",icon:o.jsx(Tv,{className:"h-3 w-3"})}),o.jsx("span",{className:"max-lg:hidden",children:m("tasks.stop")})]}),o.jsxs("div",{className:"relative inline-flex shrink-0",children:[o.jsxs("div",{className:"inline-flex items-stretch overflow-hidden rounded bg-blue-600/80 transition-colors hover:bg-blue-500",children:[o.jsxs("button",{type:"button",disabled:!r.prompt||!L.trim()&&O.length===0||w.stateOf(`sendMsg:${e}`)==="loading",title:r.prompt?void 0:((Xk=r.unsupportedReasons)==null?void 0:Xk.prompt)??m("tasks.msgUnsupported"),"aria-label":m("tasks.messagesSend"),onClick:Zt,className:"inline-flex items-center justify-center gap-1 px-2.5 py-1 text-[11px] font-medium text-white disabled:opacity-40 max-lg:px-3 max-lg:py-2",children:[o.jsx(ut,{state:w.stateOf(`sendMsg:${e}`),className:"h-3 w-3",icon:o.jsx(HA,{className:"h-3 w-3"})}),o.jsx("span",{className:"max-lg:hidden",children:m("tasks.messagesSend")})]}),o.jsxs("button",{type:"button",title:m("tasks.msgChannelCurrent",{via:m($e==="terminal"?"tasks.msgChannelTerminal":"tasks.msgChannelAuto")}),"aria-label":m("tasks.msgChannelTitle"),onClick:xr,className:me("inline-flex items-center justify-center gap-1 border-l px-1 transition-colors max-lg:px-2 max-lg:py-2",$e==="terminal"?"border-white/40 bg-white/20 text-white":"border-white/20 text-white/70 hover:bg-white/10 hover:text-white"),children:[o.jsx("span",{className:"text-[9px] font-normal leading-none",children:m($e==="terminal"?"tasks.msgChannelTerminal":"tasks.msgChannelAuto")}),o.jsx(Bn,{className:"h-3 w-3"})]})]}),(ge==null?void 0:ge.kind)==="send"&&o.jsx("div",{"data-conv-menu":!0,onClick:K=>K.stopPropagation(),className:"absolute bottom-full right-0 z-20 mb-1 w-[168px] rounded-lg border border-edge/[0.1] bg-neutral-900 py-1 shadow-mac",children:["auto","terminal"].map(K=>o.jsxs("button",{type:"button",title:m(K==="auto"?"tasks.msgChannelAutoHint":"tasks.msgChannelTerminalHint"),onClick:()=>Ai(K),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(cr,{className:me("h-3 w-3",$e===K?"text-blue-300":"text-transparent")}),m(K==="auto"?"tasks.msgChannelAuto":"tasks.msgChannelTerminal")]},K))})]})]})]})]}),!h&&le&&o.jsx("div",{role:"separator",title:m("app.resizeDialog"),"aria-label":m("app.resizeDialog"),onPointerDown:Ri,onPointerMove:Yr,onPointerUp:Oi,onPointerCancel:Oi,onClick:K=>K.stopPropagation(),className:"absolute bottom-0 right-0 h-4 w-4 cursor-nwse-resize touch-none",children:o.jsx("span",{className:"pointer-events-none absolute bottom-1 right-1 h-2 w-2 rounded-br border-b border-r border-edge/20"})}),ge&&ge.kind!=="send"&&un.createPortal(o.jsx("div",{"data-conv-menu":!0,className:"fixed z-[60] rounded-lg border border-edge/[0.1] bg-neutral-900 py-1 shadow-mac",style:{left:Math.max(8,Math.min(ge.x,window.innerWidth-OE-8)),top:Math.max(8,Math.min(ge.y,window.innerHeight-DE))},onClick:K=>K.stopPropagation(),children:ge.kind==="bubble"?o.jsxs("button",{type:"button",onClick:()=>Os(ge.key),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(cr,{className:"h-3 w-3 text-neutral-500"}),m("tasks.convSelect")]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>Ti("clipboard"),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(Vu,{className:"h-3 w-3 text-neutral-500"}),m("tasks.convShareCopy")]}),o.jsxs("button",{type:"button",onClick:()=>Ti("download"),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-edge/[0.06]",children:[o.jsx(_v,{className:"h-3 w-3 text-neutral-500"}),m("tasks.convShareDownload")]})]})}),document.body),N&&un.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/70 p-6",onClick:()=>G(null),children:[o.jsx("button",{type:"button",title:m("tasks.msgImagePreview"),"aria-label":m("tasks.msgImagePreview"),onClick:()=>G(null),className:"absolute right-4 top-4 inline-flex h-8 w-8 items-center justify-center rounded-full border border-edge/[0.15] bg-neutral-900 text-neutral-300 hover:text-neutral-100",children:o.jsx(tn,{className:"h-4 w-4"})}),o.jsx("img",{src:`${mi}/images/${N.id}`,alt:N.name,onClick:K=>K.stopPropagation(),className:"max-h-full max-w-full rounded-lg border border-edge/[0.12] object-contain"})]}),document.body),o.jsx(wi,{open:J,title:m("tasks.msgCloseConfirmTitle"),message:m("tasks.msgCloseConfirm"),confirmLabel:m("tasks.messagesClose"),onConfirm:()=>f==null?void 0:f(),onClose:()=>ce(!1)}),o.jsx(wi,{open:ke,title:m("tasks.modeConfirmTitle"),message:m("tasks.modeConfirm"),confirmLabel:m("tasks.modeConfirmAction"),onConfirm:Cn,onClose:()=>Ae(!1)})]});return h?$k:un.createPortal(o.jsx("div",{className:me("fixed inset-0 z-50 items-center justify-center bg-black/50 p-4",u?"hidden":"flex"),onClick:d,children:$k}),document.body)}function oJ({harnesses:e,onPick:t,onClose:n}){const s=We();return x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[n]),un.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:n,children:o.jsxs("div",{className:"w-full max-w-xs rounded-xl border border-edge/[0.08] bg-neutral-900 p-3 shadow-mac",onClick:r=>r.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsx("p",{className:"text-xs font-medium text-neutral-200",children:s("tasks.harnessPickTitle")}),o.jsx("button",{type:"button",title:s("tasks.terminalPickCancel"),"aria-label":s("tasks.terminalPickCancel"),onClick:n,className:"rounded p-0.5 text-neutral-500 hover:text-neutral-200",children:o.jsx(tn,{className:"h-3.5 w-3.5"})})]}),o.jsx("ul",{className:"max-h-72 space-y-1 overflow-y-auto",children:e.map(r=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>t(r),className:"flex w-full items-center gap-2 rounded-lg border border-edge/[0.06] bg-edge/[0.02] px-2.5 py-2 text-left transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.06]",children:[o.jsx(El,{harness:r}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",children:Kn(r).label})]})},r))})]})}),document.body)}const cJ="pre-session",Ok="orphan";function cR(e,t,n){const s=[],r=w=>(s.push(w),w),i=new Set;let a=null,l=null,c=null;const u=new Map,d=new Map,f=new Map,h=(w,g)=>{i.has(w)||(i.add(w),g&&(w.open=!0),c=w,l===w&&(l=null))},p=(w,g)=>{let S=(g?u.get(g):void 0)??l??c??a;S||(S=a=r({id:cJ,events:[],dispatches:[],preSession:!0,subagentStops:0,agentsDispatched:0,questions:0}),i.add(S)),S.events.push(w),w.eventType===n.subagentStop&&S.subagentStops++,w.eventType==="PreToolUse"&&n.questionTools.includes(Zu(w.payload).toolName??"")&&S.questions++;const M=dx(w);M&&(S.agentsDispatched++,d.set(M.agentId,S),M.toolUseId&&f.set(M.toolUseId,S))};for(const w of e){const g=w.eventType,y=dJ(w.payload);if(g===n.open){const b=cm(w);if(b){const E=(b.toolUseId?f.get(b.toolUseId):void 0)??(b.taskId?d.get(b.taskId):void 0);E?E.events.push(w):p(w,y);continue}if(y){const E=u.get(y);if(E){l=E,E.events.push(w);continue}}const S=r({id:`turn:${w.id}`,events:[],dispatches:[],subagentStops:0,agentsDispatched:0,questions:0});y&&(S.promptId=y,u.set(y,S)),l=S;const M=uJ(w.payload);M!==void 0&&(S.prompt=M),S.events.push(w);continue}if(n.close.includes(g)){const S=(y?u.get(y):void 0)??l;S?(S.events.push(w),h(S,n.closeFailed.includes(g))):p(w,y);continue}if(n.sessionMarkers.includes(g)){const b=y?u.get(y):void 0,S=b!==void 0&&b===l,M=b??l;M?M.events.push(w):p(w,y),!S&&l&&!i.has(l)&&h(l,!0);continue}p(w,y)}for(const w of s)i.has(w)||(w.open=!0,i.add(w));const m=new Map;for(const w of s)for(const g of w.events)m.set(g.id,w);let k=null;for(const w of t){const g=w.eventId!=null?m.get(w.eventId):void 0;if(g){g.dispatches.push(w);continue}k??(k=r({id:Ok,events:[],dispatches:[],subagentStops:0,agentsDispatched:0,questions:0})),i.add(k),k.dispatches.push(w)}return s}function uJ(e){try{const t=JSON.parse(e).raw;if(t&&typeof t=="object"){const n=t.prompt;if(typeof n=="string"&&n.length>0)return n}}catch{}}function dJ(e){try{const t=JSON.parse(e).raw;if(t&&typeof t=="object"){const n=t.prompt_id;if(typeof n=="string"&&n.length>0)return n}}catch{}}const go=400,ru=280,iu=56,fJ=128;function hJ(e){const t=new Set;let n=0;for(const s of e){const r=Ei(s).tool_use_id;if(typeof r!="string"||!r){n+=s.eventType==="PreToolUse"?1:-1;continue}s.eventType==="PostToolUse"?t.delete(r):t.add(r)}return t.size>0||n>0}function uR(e){if(e.eventType!=="SessionStart")return;const t=Ei(e).model;return typeof t=="string"&&t?t:void 0}function pJ(e,t,n=new Map,s,r=Gd[nn[0]??"claude"]){var w;const i=g=>g.map(y=>{const b=y.status==="pending";return{key:`d:${y.id}`,kind:"dispatch",dispatch:y,children:[],hasPotential:!1,highlight:b}}),a=(g,y)=>{const b=new Map;for(const M of y){const E=b.get(M.ruleId)??[];E.push(M),b.set(M.ruleId,E)}const S=[];for(const[M,E]of b){const A=`e:${g}:r:${M}`,R=n.get(M),D=E.some($=>$.status==="pending"),_=i(E);let z;R!=null&&R.handlerType?z=[{key:`${A}:h`,kind:"handler",handlerType:R.handlerType,children:_,hasPotential:_.length>0,highlight:D}]:z=_,S.push({key:A,kind:"rule",ruleId:M,ruleName:R?R.name:null,children:z,hasPotential:z.length>0,highlight:D})}return S},l=[],c=[];for(const g of e){const y=`g:${g.id}`,b=[];if(t.has(y))if(g.events.length>0){const M=[],E=new Map,A=new Map,R=new Map;let D=null;const _=H=>{const I=`e:${H.id}`,L=g.dispatches.filter(N=>N.eventId===H.id),C=t.has(I)?a(H.id,L):[],O=H.eventType===r.subagentStop,U=dx(H),F=cm(H);if(F||O){const N=Ei(H),G=(F==null?void 0:F.taskId)??(typeof N.agent_id=="string"?N.agent_id:null),T=(F!=null&&F.toolUseId?A.get(F.toolUseId):void 0)??(G?A.get(G):void 0);if(T){const Z={key:I,kind:F?"notification":"subagent",event:H,children:C,hasPotential:C.length>0,highlight:C.some(Q=>Q.highlight),model:T.model,agentId:T.agentId},te=R.get(T)??[];te.push(Z),R.set(T,te),E.set(H.id,Z),F&&(T.agentRunning=!1);return}}const j={key:I,kind:F?"notification":O?"subagent":"event",event:H,children:C,hasPotential:L.length>0,highlight:C.some(N=>N.highlight),agentId:(U==null?void 0:U.agentId)??(F==null?void 0:F.taskId)??void 0,model:(U==null?void 0:U.model)??uR(H),agentRunning:U?!0:void 0};if(U&&(A.set(U.agentId,j),U.toolUseId&&A.set(U.toolUseId,j),R.set(j,[])),O){const N=D?E.get(D.id):void 0;if(N){N.children.unshift(j),N.highlight=N.highlight||j.highlight,D=H,E.set(H.id,j);return}}M.push(j),E.set(H.id,j),D=H};let z=[];const $=()=>{if(z.length!==0){if(z.length>=2){const H=`c:${z[0].id}`;M.push({key:H,kind:"cluster",children:t.has(H)?z.map(I=>({key:`e:${I.id}`,kind:"event",event:I,children:[],hasPotential:!1,highlight:!1})):[],hasPotential:!0,highlight:!1,clusterEvents:z}),D=null}else _(z[0]);z=[]}};for(const H of g.events){if((H.eventType==="PreToolUse"||H.eventType==="PostToolUse")&&!dx(H)&&!g.dispatches.some(L=>L.eventId===H.id)){z.push(H);continue}$(),_(H)}$();for(const[H,I]of R)I.length===0&&H.agentRunning&&I.push({key:`${H.key}:agent`,kind:"subagent",children:[],hasPotential:!1,highlight:!1,agentId:H.agentId,model:H.model,agentRunning:!0}),I.length>0&&(H.children=[...I,...H.children],H.highlight=H.highlight||I.some(L=>L.highlight),c.push({anchor:H,members:I,closed:!H.agentRunning}));b.push(...M)}else b.push(...i(g.dispatches));const S=b.some(M=>M.highlight)||g.dispatches.some(M=>M.status==="pending");l.push({key:y,kind:"group",group:g,children:b,hasPotential:g.events.length>0||g.dispatches.length>0,highlight:S,model:s})}const u=[],d=[];let f=0;const h=(g,y,b)=>{b&&d.push({id:`${b}->${g.key}`,source:b,target:g.key});let S;if(g.children.length===0)S=f*fJ,f+=1;else{const M=h(g.children[0],y+1,g.key);let E=M;for(let A=1;A<g.children.length;A++)E=h(g.children[A],y+1,g.key);S=(M+E)/2}return u.push({key:g.key,kind:g.kind,depth:y,y:S,group:g.group,event:g.event,dispatch:g.dispatch,ruleId:g.ruleId,ruleName:g.ruleName,handlerType:g.handlerType,clusterEvents:g.clusterEvents,agentId:g.agentId,model:g.model,agentRunning:g.agentRunning,expandable:g.hasPotential,expanded:t.has(g.key),highlight:g.highlight}),S};for(const g of l)h(g,0,null);for(const g of l){if(g.kind!=="group")continue;const y=g.children.filter(S=>S.kind==="event"||S.kind==="cluster"||S.kind==="subagent"||S.kind==="notification");if(y.length===0)continue;const b=new Set(y.map(S=>S.key));for(let S=d.length-1;S>=0;S--){const M=d[S];M.source===g.key&&b.has(M.target)&&d.splice(S,1)}d.push({id:`${g.key}->${y[0].key}`,source:g.key,target:y[0].key});for(let S=0;S+1<y.length;S++)d.push({id:`${y[S].key}->${y[S+1].key}`,source:y[S].key,target:y[S+1].key,vertical:!0});(w=g.group)!=null&&w.open||d.push({id:`${y[y.length-1].key}->${g.key}`,source:y[y.length-1].key,target:g.key,closure:!0})}const p=g=>[...g.kind==="cluster"?[g]:[],...g.children.flatMap(p)],m=new Map(u.map(g=>[g.key,g.y])),k=new Map(u.map(g=>[g.key,g.depth]));for(const g of l.flatMap(p)){if(g.children.length===0)continue;const y=new Set(g.children.map(R=>R.key));for(let R=d.length-1;R>=0;R--){const D=d[R];D.source===g.key&&y.has(D.target)&&d.splice(R,1)}d.push({id:`${g.key}->${g.children[0].key}`,source:g.key,target:g.children[0].key,dashed:!0});for(let R=0;R+1<g.children.length;R++)d.push({id:`${g.children[R].key}->${g.children[R+1].key}`,source:g.children[R].key,target:g.children[R+1].key,vertical:!0});if(hJ(g.clusterEvents??[]))continue;const b=g.children[g.children.length-1],S=(m.get(b.key)??0)+iu/2,M=(m.get(g.key)??0)+iu*.78,A=(k.get(g.key)??0)*go+ru+(go-ru)/2;d.push({id:`${b.key}->${g.key}`,source:b.key,target:g.key,clusterLoop:!0,waypoints:[{x:A,y:S},{x:A,y:M}]})}for(const{anchor:g,members:y,closed:b}of c){const S=new Set(y.map(E=>E.key));for(let E=d.length-1;E>=0;E--){const A=d[E];A.source===g.key&&S.has(A.target)&&d.splice(E,1)}let M=g.key;for(const E of y)d.push({id:`${M}->${E.key}`,source:M,target:E.key,vertical:M!==g.key}),M=E.key;if(b){const E=k.get(g.key)??0,A=(m.get(M)??0)+iu/2,R=(m.get(g.key)??0)+iu*.78,D=E*go+ru+(go-ru)/2;d.push({id:`${M}->${g.key}`,source:M,target:g.key,ringLoop:!0,waypoints:[{x:D,y:A},{x:D,y:R}]})}}return{nodes:u,edges:d}}const dR=x.createContext(new Set);function qt(e){return`${e} rounded px-1 py-px text-[10px] leading-tight`}function Oo({model:e}){const t=e.replace(/\[.*$/,"");return o.jsx("span",{className:"rounded border border-indigo-500/40 bg-indigo-500/15 px-1 py-px text-[10px] font-medium leading-tight text-indigo-200",title:e,children:t})}function mJ({data:e}){var f;const t=We(),n=x.useContext(dR),{node:s,flash:r,onToggle:i,onOpenDetail:a,answerable:l,onOpenAnswer:c}=e,u=s.expandable?o.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),i(s.key)},className:"shrink-0 rounded p-0.5 text-neutral-500 transition-colors hover:bg-edge/[0.08] hover:text-neutral-200","aria-expanded":s.expanded,children:s.expanded?o.jsx(Bn,{className:"h-3.5 w-3.5"}):o.jsx(ns,{className:"h-3.5 w-3.5"})}):o.jsx("span",{className:"w-4 shrink-0"});let d=null;if(s.kind==="group"&&s.group){const h=s.group,p=h.preSession?t("hooks.mindmap.preSession"):h.prompt??"",m=(f=h.events[0])==null?void 0:f.createdAt;d=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"block truncate text-xs text-neutral-100",title:h.prompt??p,children:p}),o.jsxs("span",{className:"mt-1 flex flex-wrap items-center gap-1",children:[h.preSession?o.jsx("span",{className:qt("bg-neutral-800 text-neutral-300"),children:p}):o.jsx("span",{className:qt("bg-cyan-900/40 text-cyan-300"),children:"prompt"}),h.open&&(n.has(h.id)?o.jsx("span",{className:qt("bg-emerald-900/40 text-emerald-300"),children:t("hooks.mindmap.runningTag")}):o.jsx("span",{className:qt("bg-red-900/40 text-red-300"),children:t("hooks.mindmap.openTag")})),l&&o.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),c==null||c()},className:qt("bg-amber-900/50 font-medium text-amber-300 transition-colors hover:bg-amber-800/60 hover:text-amber-200"),children:t("tasks.answerPendingTag")}),h.subagentStops>0&&o.jsx("span",{className:qt("bg-orange-900/40 text-orange-300"),children:t("hooks.mindmap.subagentCount",{n:h.subagentStops})}),h.agentsDispatched>0&&o.jsx("span",{className:qt("bg-fuchsia-900/40 text-fuchsia-300"),children:t("hooks.mindmap.agentDispatched",{n:h.agentsDispatched})}),h.dispatches.length>0&&o.jsx("span",{className:qt("bg-emerald-900/40 text-emerald-300"),children:t("hooks.mindmap.dispatchCount",{n:h.dispatches.length})}),s.model&&o.jsx(Oo,{model:s.model}),o.jsxs("span",{className:"text-[10px] text-neutral-500",children:[t("catbar.items",{n:h.events.length}),m?` · ${rr(m)}`:""]})]})]})}else if((s.kind==="event"||s.kind==="subagent"||s.kind==="notification")&&s.event){const h=s.event,p=s.kind==="subagent",m=Su(h),k=Iv(h.source,h.eventType,Ei(h).source);d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("span",{className:qt(eM[h.eventType]??"bg-neutral-800 text-neutral-300"),children:h.eventType}),k&&o.jsx("span",{className:qt("bg-amber-900/40 text-amber-300"),children:t("hooks.mindmap.compactTag")}),p&&o.jsx("span",{className:qt("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:"subagent"}),s.kind==="notification"&&o.jsx("span",{className:qt("border border-teal-700/50 bg-teal-950/60 text-teal-300"),children:t("hooks.mindmap.notifyTag")}),s.agentId&&o.jsxs("span",{className:"text-[10px] text-neutral-500",children:["agent …",s.agentId.slice(-8)]}),s.model&&o.jsx(Oo,{model:s.model}),s.agentRunning&&o.jsx("span",{className:qt("bg-amber-900/50 text-amber-300"),children:t("hooks.mindmap.agentRunning")}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:rr(h.createdAt)})]}),m&&o.jsx("span",{className:me("mt-0.5 block text-[11px] text-neutral-400",p?"line-clamp-2 text-orange-100/70":"truncate"),title:m,children:m})]})}else if(s.kind==="cluster"&&s.clusterEvents){const h=s.clusterEvents,p=new Map;for(const g of h){const y=Zu(g.payload).toolName??g.eventType;p.set(y,(p.get(y)??0)+1)}const m=[...p.entries()].sort((g,y)=>y[1]-g[1]),k=m.map(([g,y])=>`${g} ×${y}`).join(" · "),w=m.slice(0,3).map(([g,y])=>y>1?`${g} ×${y}`:g).join(" · ");d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("span",{className:qt("bg-amber-900/40 text-amber-300"),children:t("hooks.mindmap.toolCluster")}),o.jsxs("span",{className:"text-[10px] text-neutral-400",children:["×",h.length]}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:rr(h[0].createdAt)})]}),o.jsxs("span",{className:"mt-0.5 block truncate text-[11px] text-neutral-400",title:k,children:[w,m.length>3?` · +${m.length-3}`:""]})]})}else if(s.kind==="subagent"&&!s.event)d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("span",{className:qt("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:"subagent"}),s.agentId&&o.jsxs("span",{className:"text-[10px] text-neutral-500",children:["agent …",s.agentId.slice(-8)]}),s.model&&o.jsx(Oo,{model:s.model}),s.agentRunning&&o.jsx("span",{className:qt("bg-amber-900/50 text-amber-300"),children:t("hooks.mindmap.agentRunning")})]}),o.jsx("span",{className:"mt-0.5 block text-[11px] text-neutral-400",children:t("hooks.mindmap.agentPending")})]});else if(s.kind==="rule")d=o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:qt("bg-blue-900/40 text-blue-300"),children:"rule"}),o.jsx("span",{className:"truncate text-xs text-blue-200",title:s.ruleName??s.ruleId??"",children:s.ruleName??(s.ruleId?`#${s.ruleId.slice(0,12)}`:"")})]});else if(s.kind==="handler")d=o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:qt("bg-purple-900/40 text-purple-300"),children:"handler"}),o.jsx("span",{className:"truncate text-xs text-purple-200",children:s.handlerType})]});else if(s.kind==="dispatch"&&s.dispatch){const h=s.dispatch;d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:qt("bg-emerald-900/40 text-emerald-300"),children:t("hooks.mindmap.dispatchTag")}),o.jsx("span",{className:"truncate text-[10px] text-neutral-400",title:e.ruleName??h.ruleId,children:e.ruleName??h.ruleId}),o.jsx(fR,{status:h.status})]}),o.jsx("span",{className:"mt-0.5 block truncate text-[11px] text-neutral-400",title:h.prompt,children:h.prompt})]})}return o.jsxs("div",{className:me("flex w-[280px] cursor-pointer items-start gap-1 rounded-lg border border-edge/[0.08] bg-neutral-900/95 px-2 py-1.5 shadow-mac transition-colors hover:border-edge/[0.18]",s.highlight&&"ring-1 ring-amber-400/70",r&&"weave-node-flash"),title:s.highlight?t("hooks.mindmap.pendingTip"):void 0,onClick:h=>{h.stopPropagation(),a(s)},children:[o.jsx(In,{type:"target",id:"l",position:Xe.Left,style:{visibility:"hidden"}}),o.jsx(In,{type:"target",id:"t",position:Xe.Top,style:{visibility:"hidden"}}),o.jsx(In,{type:"target",id:"rt",position:Xe.Right,style:{visibility:"hidden",top:"78%"}}),o.jsx(In,{type:"source",id:"r",position:Xe.Right,style:{visibility:"hidden"}}),o.jsx(In,{type:"source",id:"b",position:Xe.Bottom,style:{visibility:"hidden"}}),o.jsx(In,{type:"source",id:"c",position:Xe.Left,style:{visibility:"hidden"}}),u,o.jsx("div",{className:"min-w-0 flex-1",children:d})]})}const gJ={pending:"hooks.status.pending",injected:"hooks.status.injected",running:"hooks.status.running",succeeded:"hooks.status.succeeded",failed:"hooks.status.failed",timeout:"hooks.status.timeout"};function fR({status:e}){const t=We(),n=e==="succeeded"?"bg-emerald-500":e==="failed"||e==="timeout"?"bg-red-400":e==="running"?"bg-blue-400 animate-pulse":e==="injected"?"bg-cyan-400":"bg-amber-400",s=gJ[e];return o.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-neutral-500",children:[o.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${n}`}),s?t(s):e]})}const bJ={mindmap:mJ};function xJ(e,t=14){let n=`M${e[0].x} ${e[0].y}`;for(let r=1;r<e.length-1;r++){const i=e[r-1],a=e[r],l=e[r+1],c=(h,p)=>Math.hypot(p.x-h.x,p.y-h.y),u=Math.min(t,c(i,a)/2,c(a,l)/2),d={x:a.x+(i.x-a.x)*(u/c(i,a)),y:a.y+(i.y-a.y)*(u/c(i,a))},f={x:a.x+(l.x-a.x)*(u/c(a,l)),y:a.y+(l.y-a.y)*(u/c(a,l))};n+=` L${d.x} ${d.y} Q${a.x} ${a.y} ${f.x} ${f.y}`}const s=e[e.length-1];return`${n} L${s.x} ${s.y}`}function yJ({id:e,sourceX:t,sourceY:n,targetX:s,targetY:r,markerEnd:i,style:a,data:l}){const c=(l==null?void 0:l.waypoints)??[],u=[{x:t,y:n},...c,{x:s,y:r}];return o.jsx(Jd,{id:e,path:xJ(u),markerEnd:i,style:a})}const vJ={waypoint:yJ};function kJ({projectId:e,sessionId:t,sessions:n,harness:s,onSelect:r,focusGroupId:i,focusGroup:a,running:l,answerable:c,onOpenAnswer:u}){const d=We(),f=ak(),h=Gd[s??nn[0]??"claude"],[p,m]=x.useState(null),[k,w]=x.useState(null),[g,y]=x.useState(new Map),[b,S]=x.useState(new Set),[M,E]=x.useState(null),[A,R]=x.useState(null),D=x.useRef(null),_=x.useRef(null),z=x.useCallback(async()=>{try{const[T,Z,te]=await Promise.all([Ee.listSessionHooks(e,t,300),Ee.listHookDispatches({limit:200}),Ee.listHooksRules(e)]);m(T),w(Z),y(new Map(te.map(Q=>[Q.id,{name:Q.name,handlerType:Q.handler.type}])))}catch{}},[e,t]);x.useEffect(()=>{m(null),w(null),S(i?new Set([`g:${i}`]):new Set),R(null),z()},[z,i]),x.useEffect(()=>{const Z=Aa(te=>{te.kind==="dispatch.created"&&te.dispatchId!=null&&(E(`d:${te.dispatchId}`),D.current&&window.clearTimeout(D.current),D.current=window.setTimeout(()=>E(null),900)),_.current&&window.clearTimeout(_.current),_.current=window.setTimeout(()=>void z(),500)});return()=>{Z(),D.current&&window.clearTimeout(D.current),_.current&&window.clearTimeout(_.current)}},[z]);const $=x.useMemo(()=>{if(i&&a)return[a];if(!p||!k)return[];const T=new Set(p.map(pe=>pe.id)),Z=k.filter(pe=>pe.sessionId===t||pe.eventId!=null&&T.has(pe.eventId)).sort((pe,V)=>pe.id-V.id),te=p.length>=300,Q=cR(p,Z,h).filter(pe=>pe.id!==Ok&&!(pe.preSession&&te));return i?Q.filter(pe=>pe.id===i):Q},[p,k,t,i,a,h]),H=x.useMemo(()=>{const T=$[$.length-1];return l&&T?new Set([T.id]):new Set},[$,l]),I=x.useMemo(()=>{if(p)for(let T=p.length-1;T>=0;T--){const Z=uR(p[T]);if(Z)return Z}},[p]),L=x.useMemo(()=>pJ($,b,g,I,h),[$,b,g,I,h]),C=x.useRef(null),O=x.useRef(null),U=x.useCallback(T=>{O.current=T,S(Z=>{const te=new Set(Z);return te.delete(T)||te.add(T),te})},[]),F=x.useCallback(T=>R(T),[]);x.useEffect(()=>{const T=O.current;if(!T)return;O.current=null;const Z=L.nodes.find(Q=>Q.key===T),te=C.current;!Z||!te||te.setCenter(Z.depth*go+ru/2,Z.y+iu/2,{zoom:te.getZoom(),duration:250})},[L]);const j=x.useMemo(()=>L.nodes.map(T=>{var Z;return{id:T.key,type:"mindmap",position:{x:T.depth*go,y:T.y},data:{node:T,flash:M===T.key,ruleName:T.dispatch?((Z=g.get(T.dispatch.ruleId))==null?void 0:Z.name)??void 0:void 0,onToggle:U,onOpenDetail:F,answerable:T.kind==="group"&&(c??!1),onOpenAnswer:u},draggable:!0}}),[L.nodes,M,g,U,F,c,u]),N=x.useMemo(()=>L.edges.map(T=>({id:T.id,...T.waypoints?{data:{waypoints:T.waypoints}}:{},source:T.source,target:T.target,sourceHandle:T.closure||T.clusterLoop||T.ringLoop?"c":T.vertical?"b":"r",targetHandle:T.closure?"l":T.clusterLoop||T.ringLoop?"rt":T.vertical?"t":"l",type:T.waypoints?"waypoint":"smoothstep",markerEnd:{type:uc.ArrowClosed,width:16,height:16},style:T.dashed||T.clusterLoop?{stroke:"rgba(96,165,250,0.55)",strokeWidth:1.5,strokeDasharray:"7 5"}:{stroke:"rgba(96,165,250,0.8)",strokeWidth:2}})),[L.edges]),G=T=>{const Z=(Q,pe)=>o.jsxs("p",{className:"flex gap-2",children:[o.jsx("span",{className:"shrink-0 text-neutral-500",children:Q}),o.jsx("span",{className:"min-w-0 break-all text-neutral-300",children:pe})]}),te=Q=>Q==null?"—":typeof Q=="string"?Q:JSON.stringify(Q,null,2);if(T.kind==="group"&&T.group){const Q=T.group;return o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"whitespace-pre-wrap break-all text-neutral-100",children:Q.prompt??d("hooks.mindmap.preSession")}),o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[Q.open&&(H.has(Q.id)?o.jsx("span",{className:"rounded bg-emerald-900/40 px-1 text-[10px] text-emerald-300",children:d("hooks.mindmap.runningTag")}):o.jsx("span",{className:"rounded bg-red-900/40 px-1 text-[10px] text-red-300",children:d("hooks.mindmap.openTag")})),Q.subagentStops>0&&o.jsx("span",{className:"rounded bg-orange-900/40 px-1 text-[10px] text-orange-300",children:d("hooks.mindmap.subagentCount",{n:Q.subagentStops})}),Q.agentsDispatched>0&&o.jsx("span",{className:"rounded bg-fuchsia-900/40 px-1 text-[10px] text-fuchsia-300",children:d("hooks.mindmap.agentDispatched",{n:Q.agentsDispatched})}),T.model&&o.jsx(Oo,{model:T.model})]}),Z(d("tasks.events",{n:Q.events.length}),""),Z(d("tasks.groupDispatches",{n:Q.dispatches.length}),"")]})}if(T.kind==="subagent"&&!T.event)return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:qt("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:"subagent"}),T.agentId&&o.jsxs("span",{className:"text-neutral-500",children:["agent …",T.agentId.slice(-8)]}),T.model&&o.jsx(Oo,{model:T.model}),T.agentRunning&&o.jsx("span",{className:qt("bg-amber-900/50 text-amber-300"),children:d("hooks.mindmap.agentRunning")})]}),o.jsx("p",{className:"text-neutral-400",children:d("hooks.mindmap.agentPending")})]});if((T.kind==="event"||T.kind==="subagent"||T.kind==="notification")&&T.event){const Q=T.event,pe=Zu(Q.payload);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:qt(eM[Q.eventType]??"bg-neutral-800 text-neutral-300"),children:Q.eventType}),Iv(Q.source,Q.eventType,Ei(Q).source)&&o.jsx("span",{className:qt("bg-amber-900/40 text-amber-300"),children:d("hooks.mindmap.compactTag")}),T.agentId&&o.jsxs("span",{className:qt("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:["agent …",T.agentId.slice(-8)]}),T.model&&o.jsx(Oo,{model:T.model}),T.agentRunning&&o.jsx("span",{className:qt("bg-amber-900/50 text-amber-300"),children:d("hooks.mindmap.agentRunning")}),o.jsx("span",{className:"text-neutral-500",children:rr(Q.createdAt)})]}),o.jsx("p",{className:"whitespace-pre-wrap break-all text-neutral-100",children:Su(Q)}),pe.toolInput!=null&&o.jsxs("div",{children:[o.jsx("p",{className:"text-[9px] uppercase tracking-wide text-neutral-600",children:"input"}),o.jsx("pre",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap break-all text-neutral-400",children:te(pe.toolInput)})]}),pe.toolResponse!=null&&o.jsxs("div",{children:[o.jsx("p",{className:"text-[9px] uppercase tracking-wide text-neutral-600",children:"response"}),o.jsx("pre",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap break-all text-neutral-400",children:te(pe.toolResponse)})]})]})}if(T.kind==="cluster"&&T.clusterEvents){const Q=T.clusterEvents,pe=new Map;for(const V of Q){const q=Zu(V.payload).toolName??V.eventType;pe.set(q,(pe.get(q)??0)+1)}return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex flex-wrap gap-1.5",children:[...pe.entries()].map(([V,q])=>o.jsxs("span",{className:"rounded bg-amber-900/40 px-1 text-[10px] text-amber-300",children:[V," ×",q]},V))}),o.jsxs("p",{className:"text-neutral-500",children:[rr(Q[0].createdAt)," → ",rr(Q[Q.length-1].createdAt)]}),o.jsx("ul",{className:"space-y-1",children:Q.map(V=>o.jsxs("li",{className:"truncate text-neutral-300",title:Su(V),children:[o.jsx("span",{className:"text-neutral-600",children:rr(V.createdAt)})," ",Su(V)||V.eventType]},V.id))})]})}if(T.kind==="dispatch"&&T.dispatch){const Q=T.dispatch;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(fR,{status:Q.status}),o.jsx("span",{className:"text-neutral-500",children:rr(Q.startedAt)}),Q.finishedAt&&o.jsxs("span",{className:"text-neutral-600",children:["→ ",rr(Q.finishedAt)]})]}),Z("rule",T.ruleName??Q.ruleId),o.jsx("p",{className:"whitespace-pre-wrap break-all text-neutral-100",children:Q.prompt}),Q.output&&o.jsxs("div",{children:[o.jsx("p",{className:"text-[9px] uppercase tracking-wide text-neutral-600",children:"output"}),o.jsx("pre",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap break-all text-neutral-500",children:Q.output})]}),Q.error&&o.jsx("p",{className:"whitespace-pre-wrap break-all text-red-400/80",children:Q.error})]})}return T.kind==="rule"?Z("rule",T.ruleName??T.ruleId??"—"):T.kind==="handler"?Z("handler",T.handlerType??"—"):null};return o.jsx(dR.Provider,{value:H,children:o.jsxs("div",{className:me("space-y-2",i&&"h-full"),children:[!i&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("label",{className:"text-[11px] text-neutral-500",children:d("hooks.mindmap.pickSession")}),o.jsx("select",{value:t,onChange:T=>r==null?void 0:r(T.target.value),className:"rounded-md border border-edge/[0.08] bg-neutral-900 px-2 py-1 text-xs text-neutral-200",children:(n??[]).map(T=>o.jsx("option",{value:T.sessionId,children:Sn(T.title,T.sessionId)},T.sessionId))}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:p===null?d("hooks.loading"):d("catbar.items",{n:$.length})}),o.jsx("span",{className:"ml-auto text-[11px] text-neutral-600",children:d("hooks.mindmap.hint")})]}),o.jsxs("div",{className:me("relative rounded-lg",f,i?"h-full border-0":"h-96 border border-edge/[0.06]"),onClick:()=>R(null),children:[p===null&&!a?o.jsx("div",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:d("hooks.loading")}):j.length===0?o.jsx("div",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:d("hooks.mindmap.empty")}):o.jsxs(rk,{onInit:T=>{C.current=T},nodes:j,edges:N,nodeTypes:bJ,edgeTypes:vJ,fitView:!i,fitViewOptions:{maxZoom:1,padding:.12},...i?{defaultViewport:{x:24,y:12,zoom:.75}}:{},minZoom:.15,maxZoom:1.5,nodesDraggable:!0,nodesConnectable:!1,deleteKeyCode:null,defaultEdgeOptions:{type:"smoothstep",markerEnd:{type:uc.ArrowClosed,width:16,height:16},style:{stroke:"rgba(96,165,250,0.8)",strokeWidth:2}},children:[o.jsx(lk,{}),o.jsx(ik,{showInteractive:!1})]}),A&&o.jsxs("div",{className:"absolute right-2 top-2 z-20 flex max-h-[78%] w-80 flex-col overflow-hidden rounded-lg border border-edge/[0.14] bg-neutral-900/95 shadow-mac",onClick:T=>T.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center gap-2 border-b border-edge/[0.08] px-3 py-2",children:[o.jsx("span",{className:"text-xs font-semibold text-neutral-200",children:d("hooks.mindmap.detailTitle")}),o.jsx("button",{type:"button",onClick:()=>R(null),title:d("hooks.mindmap.closeDetail"),"aria-label":d("hooks.mindmap.closeDetail"),className:"ml-auto rounded p-0.5 text-neutral-500 transition-colors hover:text-neutral-100",children:o.jsx(tn,{className:"h-3.5 w-3.5"})})]}),o.jsx("div",{className:"space-y-2 overflow-y-auto px-3 py-2 text-[11px]",children:G(A)})]})]})]})})}const wJ=300;function Dk({onClick:e,title:t,className:n}){const[s,r]=x.useState(!1);return o.jsx("button",{type:"button",title:t,"aria-label":t,disabled:s,onClick:()=>{const i=e();i instanceof Promise&&(r(!0),Promise.all([i.then(()=>{},()=>{}),new Promise(a=>setTimeout(a,wJ))]).then(()=>r(!1)))},className:me("pointer-events-auto inline-flex items-center text-neutral-500 transition-colors hover:text-neutral-200","disabled:pointer-events-none [&_svg]:pointer-events-none",n),children:o.jsx(ic,{className:me("h-3.5 w-3.5",s&&"animate-spin")})})}function ey({onResize:e,orientation:t="horizontal",className:n,title:s}){const r=t==="vertical",i=x.useRef(null),a=x.useRef(0),l=x.useCallback(d=>{i.current=r?d.clientY:d.clientX,a.current=0,d.currentTarget.setPointerCapture(d.pointerId)},[r]),c=x.useCallback(d=>{if(i.current==null)return;const h=(r?d.clientY:d.clientX)-i.current;e(h-a.current),a.current=h},[e,r]),u=x.useCallback(()=>{i.current=null},[]);return o.jsx("div",{role:"separator","aria-orientation":r?"horizontal":"vertical",title:s,onPointerDown:l,onPointerMove:c,onPointerUp:u,onPointerCancel:u,className:me("shrink-0 touch-none bg-transparent transition-colors","hover:bg-blue-500/40 active:bg-blue-500/60",r?"h-1.5 w-full cursor-row-resize":"w-1.5 cursor-col-resize",n)})}const SJ=8e3,NJ=10*6e4;let PE=0;function EJ(e){const t="=".repeat((4-e.length%4)%4),n=atob((e+t).replace(/-/g,"+").replace(/_/g,"/")),s=new Uint8Array(n.length);for(let r=0;r<n.length;r++)s[r]=n.charCodeAt(r);return s}function _J(e){if(e==null)return null;const t=new Uint8Array(e);let n="";for(const s of t)n+=String.fromCharCode(s);return btoa(n)}async function Ik(){if(typeof navigator>"u"||!("serviceWorker"in navigator)||globalThis.isSecureContext===!1)return null;try{const e=await navigator.serviceWorker.getRegistration()??await navigator.serviceWorker.register("/sw.js");return e.pushManager?e:null}catch{return null}}function hR(e){return Promise.race([e,new Promise(t=>setTimeout(()=>t(null),SJ))])}async function pR(e){if(!(e!=null&&e.force)&&Date.now()<PE)return"unavailable";try{const t=await hR(CJ());return t===null?(PE=Date.now()+NJ,"unavailable"):t}catch{return"failed"}}async function CJ(){var i,a;const e=await Ik();if(!e||typeof Notification>"u"||Notification.permission!=="granted")return"unavailable";const{publicKey:t}=await Ee.pushPublicKey(),n=await e.pushManager.getSubscription();let s=n;n&&_J(n.options.applicationServerKey)!==t&&(await n.unsubscribe(),s=null),s??(s=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:EJ(t)}));const r=s.toJSON();return!r.endpoint||!((i=r.keys)!=null&&i.p256dh)||!((a=r.keys)!=null&&a.auth)?"failed":(await Ee.pushSubscribe({endpoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}}),"ok")}async function TJ(){try{const e=await Ik();if(!e)return;const t=await e.pushManager.getSubscription();if(!t)return;await Ee.pushUnsubscribe(t.endpoint),await hR(t.unsubscribe())}catch{}}async function Jf(){if(globalThis.isSecureContext===!1)return"insecure";if(typeof navigator>"u"||!("serviceWorker"in navigator))return"unsupported";try{const e=await Ik();return e?await e.pushManager.getSubscription()?"on":"off":"unsupported"}catch{return"unsupported"}}function mR(e){const t=new Map;return{wait(n,s){return s()?Promise.resolve():new Promise(r=>{const i=setTimeout(()=>{t.delete(n),r()},e);t.set(n,{hit:s,release:()=>{clearTimeout(i),r()}})})},poke(){for(const[n,s]of t)s.hit()&&(t.delete(n),s.release())},releaseAll(){for(const n of t.values())n.release();t.clear()}}}const zE=200,UE=420,AJ={denied:"tasks.notifyDenied",unsupported:"tasks.notifyUnsupported",insecure:"tasks.notifyInsecure"},MJ=3e4;function jJ({projectId:e,initialSessionId:t,onSelectSession:n,projectLabel:s,harnesses:r}){var Re;const i=We(),{show:a}=an(),l=xn(),{sessions:c,dispatches:u,statuses:d,inflight:f,questions:h,refresh:p}=Kd(),m=Nl("(min-width: 1024px)"),[k,w]=x.useState(()=>{const B=Number(localStorage.getItem("weave:tasks-list"));return Number.isFinite(B)&&B>0?Math.min(UE,Math.max(zE,B)):288});x.useEffect(()=>localStorage.setItem("weave:tasks-list",String(k)),[k]);const[g,y]=x.useState(!1),[b,S]=x.useState(!1),[M,E]=x.useState([]),[A,R]=x.useState([]),[D,_]=x.useState(null),z=x.useRef({project:e,sessionId:t??null}),[$,H]=x.useState(null),[I,L]=x.useState(null),[C,O]=x.useState(""),[U,F]=x.useState(null),[j,N]=x.useState(10),[G,T]=x.useState(""),[Z,te]=x.useState(null),[Q,pe]=x.useState(!1),[V,q]=x.useState(!1),Y=x.useRef(null),J=x.useMemo(()=>c===null?null:c.filter(B=>B.projectId===e),[c,e]),ce=x.useRef(J);ce.current=J;const ke=x.useRef(mR(MJ));x.useEffect(()=>{ke.current.poke()},[J]),x.useEffect(()=>()=>ke.current.releaseAll(),[]);const Ae=x.useCallback(B=>ke.current.wait(`alive:${B}`,()=>{var re;return((re=ce.current)==null?void 0:re.some(Ie=>Ie.sessionId===B&&Ie.pidAlive))===!0}),[]),je=x.useCallback(B=>ke.current.wait(`closed:${B}`,()=>{var re;return((re=ce.current)==null?void 0:re.some(Ie=>Ie.sessionId===B&&!Ie.pidAlive))===!0}),[]),ae=x.useCallback(B=>ke.current.wait(`new:${e}`,()=>{var re;return((re=ce.current)==null?void 0:re.some(Ie=>!B.has(Ie.sessionId)))===!0}),[e]),Oe=x.useCallback(async B=>{q(!0);try{const re=await Ee.listSessionHooks(e,B);R(Ie=>{var vt;if(Ie.length===0)return re;const at=((vt=re[0])==null?void 0:vt.id)??Number.POSITIVE_INFINITY;return[...Ie.filter(Cn=>Cn.id<at),...re]}),pe(Ie=>Ie||re.length<300)}catch(re){H(re instanceof Error?re.message:String(re))}finally{q(!1)}},[e]);x.useEffect(()=>{const B=t??null,re=z.current;re.project===e&&re.sessionId===B||(z.current={project:e,sessionId:B},_(B),B&&(te(B),window.setTimeout(()=>te(Ie=>Ie===B?null:Ie),3e3)))},[e,t]),x.useEffect(()=>{Ee.listHooksRules(e).then(E).catch(()=>{})},[e]);const[ye,ge]=x.useState(null),be=x.useCallback(()=>{Ee.messagingCapabilities().then(ge).catch(()=>{})},[]);x.useEffect(()=>{be()},[be]),x.useEffect(()=>ki("settings",be),[be]);const $e=x.useMemo(()=>{const B=new Map;for(const re of ye??[])B.set(re.harness,re);return B},[ye]),[ft,mt]=x.useState(null),rt=x.useCallback(()=>{Ee.listSessionWatches().then(mt).catch(()=>{})},[]);x.useEffect(()=>{rt()},[rt]);const nt=x.useMemo(()=>{const B=new Map;for(const re of ft??[])re.watcherSessionId===null&&B.set(re.targetSessionId,re);return B},[ft]),ee=x.useCallback(B=>nt.get(B),[nt]),ne=x.useCallback(B=>l.stateOf(`watch:${B}`),[l]),Ce=x.useCallback(B=>f.get(B)??0,[f]),v=x.useCallback(B=>h.get(B),[h]),X=x.useCallback((B,re)=>{l.run(`answer:${B}`,async()=>{await Ee.answerQuestion(B,re),await p()},{fail:Ie=>i("tasks.answerFailed",{error:Ye(Ie)})})},[l,i,p]),de=x.useCallback(B=>l.stateOf(`answer:${B}`),[l]),xe=x.useCallback(B=>{l.run(`interrupt:${B}`,async()=>{await Ee.interruptSession(B),a("success",i("tasks.stopOk"))},{fail:re=>i("tasks.stopFail",{error:Ye(re)})})},[l,i,a]),fe=x.useCallback(B=>l.stateOf(`interrupt:${B}`),[l]),P=x.useCallback((B,re,Ie)=>{l.run(`watch:${B}`,async()=>{const at=await nM();at!=="granted"&&a("info",i(AJ[at])),await pR(),await Ee.createSessionWatch(B,{on:re,times:Ie}),rt()},{fail:at=>i("tasks.watchFailed",{error:Ye(at)})})},[l,i,a,rt]),oe=x.useCallback(B=>{const re=nt.get(B);re&&l.run(`watch:${B}`,async()=>{await Ee.deleteSessionWatch(B,re.id),rt()},{fail:Ie=>i("tasks.unwatchFailed",{error:Ye(Ie)})})},[l,i,nt,rt]);x.useEffect(()=>Aa(()=>rt(),["watch.fired"]),[rt]),x.useEffect(()=>{var B;U&&!((B=v(U))!=null&&B.questions.length)&&F(null)},[U,v]),x.useEffect(()=>{_(B=>{var re;return B??((re=J==null?void 0:J[0])==null?void 0:re.sessionId)??null})},[J]),x.useEffect(()=>{R([]),pe(!1),O(""),N(10),T(""),D&&Oe(D)},[D,Oe]),x.useEffect(()=>{let B=null;const Ie=Aa(at=>{!D||at.sessionId!==D||(B!==null&&window.clearTimeout(B),B=window.setTimeout(()=>{B=null,Oe(D)},500))});return()=>{Ie(),B!==null&&window.clearTimeout(B)}},[Oe,D]);const le=x.useMemo(()=>{const B=new Map;for(const re of u){if(!re.sessionId)continue;const Ie=B.get(re.sessionId)??[];Ie.push(re),B.set(re.sessionId,Ie)}return B},[u]),ve=((Re=J==null?void 0:J.find(B=>B.sessionId===D))==null?void 0:Re.harness)??null,Se=Gd[ve??nn[0]??"claude"],Ne=x.useMemo(()=>D?cR(A,le.get(D)??[],Se).filter(B=>B.id!==Ok).filter(B=>!(B.preSession&&!Q)):[],[D,A,le,Q,Se]),ue=x.useMemo(()=>C&&Ne.some(B=>B.id===C)?C:null,[Ne,C]),_e=G.trim().toLowerCase(),Me=x.useMemo(()=>_e?Ne.filter(B=>{var re;return(B.prompt??(B.preSession?"":((re=B.events[0])==null?void 0:re.eventType)??"")).toLowerCase().includes(_e)}):null,[Ne,_e]),Fe=async(B,re)=>{try{const Ie=await Ee.renameSession(B,re);if(Ie.pendingTitle!==re&&Ie.title!==re){H(i("tasks.renameVerifyFail"));return}await p()}catch(Ie){H(Ie instanceof Error?Ie.message:String(Ie))}},De=x.useCallback((B,re)=>{l.run(`openTerm:${B}`,async()=>{await Ee.openSessionTerminal(B,re),await p(),await Ae(B)},{fail:Ie=>i("errors.openFailed",{error:Ye(Ie)})})},[l,i,p,Ae]),He=x.useCallback(B=>{l.run(`newSession:${e}`,async()=>{const re=new Set((ce.current??[]).map(Ie=>Ie.sessionId));await Ee.startProjectSession(e,B),await ae(re)},{fail:re=>i("tasks.newSessionFailed",{error:Ye(re)})})},[l,e,i,ae]),Ge=x.useMemo(()=>r.filter(B=>B.canStartSession).map(B=>B.id),[r]),[xt,Mt]=x.useState(!1),Ot=Ge.length>0,Dt=l.stateOf(`newSession:${e}`)==="loading",Wt=x.useCallback(()=>{if(Ge.length>1){Mt(!0);return}He(Ge[0])},[Ge,He]),[zt,Ht]=x.useState(null),se=x.useCallback(B=>{var Ie;const re=((Ie=J==null?void 0:J.find(at=>at.sessionId===B))==null?void 0:Ie.projectId)??null;if(re==null){De(B);return}Ee.listProjectTerminals(re).then(at=>{at.filter(vt=>!vt.full).length>1?Ht({sessionId:B,targets:at}):De(B)}).catch(()=>De(B))},[J,De]),Pe=x.useCallback(B=>l.stateOf(`openTerm:${B}`),[l]),[Be,it]=x.useState(null),Ze=x.useCallback(B=>{const re=J==null?void 0:J.find(at=>at.sessionId===B),Ie=re?Sn(re.title,re.sessionId):B.slice(0,8);it({sessionId:B,label:Ie})},[J]),_n=x.useCallback(B=>{l.run(`closePane:${B}`,async()=>{await Ee.closeSessionPane(B),await p(),await je(B),a("success",i("toast.sessionPaneClosed"))},{fail:re=>i("tasks.closePaneFailed",{error:Ye(re)})})},[l,i,p,je]),yt=x.useCallback(B=>l.stateOf(`closePane:${B}`),[l]),[Br,Hr]=x.useState(new Map),Os=x.useCallback(B=>{var at;const re=(at=ce.current)==null?void 0:at.find(vt=>vt.sessionId===B),Ie=re!=null&&re.harness?$e.get(re.harness):void 0;Ie&&Hr(vt=>{if(vt.has(B))return vt;const Cn=new Map(vt);return Cn.set(B,{sessionId:B,projectId:(re==null?void 0:re.projectId)??e,label:Sn((re==null?void 0:re.title)??null,B),capability:Ie}),Cn})},[$e,e]);x.useEffect(()=>{D&&Os(D)},[D,Os]);const Ci=x.useCallback(B=>{_(B),z.current={project:e,sessionId:B},n==null||n(B),Os(B),m||y(!0)},[Os,m,n,e]),is=D!==null&&Br.has(D);x.useEffect(()=>{bE(!m&&g&&is)},[m,g,is]),x.useEffect(()=>()=>bE(!1),[]),x.useEffect(()=>{is||S(!1)},[is]);const[$r,Da]=x.useState({}),Gr=x.useMemo(()=>u.filter(B=>B.status==="pending"&&B.sessionId===null&&M.some(re=>re.id===B.ruleId)),[u,M]),Ti=x.useCallback((B,re)=>{l.run(`dispatch:${B}`,async()=>{await Ee.runHookDispatch(B,re),await p()},{fail:Ie=>i("tasks.dispatchRunFailed",{error:Ye(Ie)})})},[l,p,i]),Kr=Me?Me.slice().reverse():Ne.slice(-j).reverse(),xr=Ne.length-Kr.length,Ai=!Q&&A.length>0,qr=xr>0||Ai,Mi=B=>!!B&&B.scrollHeight-B.scrollTop-B.clientHeight<=1,Ws=async()=>{var B;if(xr>0){N(re=>re+10);return}if(!(!Ai||!D))try{const re=await Ee.listSessionHooks(e,D,300,(B=A[0])==null?void 0:B.id);if(re.length===0){pe(!0);return}const Ie=new Set(A.map(vt=>vt.id));if(re.filter(vt=>!Ie.has(vt.id)).length===0){pe(!0);return}re.length<300&&pe(!0),R(vt=>{const Cn=new Set(vt.map(kr=>kr.id));return[...re.filter(kr=>!Cn.has(kr.id)),...vt]}),N(vt=>vt+10)}catch(re){H(re instanceof Error?re.message:String(re))}},Hn=nR({axis:"bottom",getEdge:()=>Mi(Y.current),onFire:()=>void Ws(),enabled:qr});x.useEffect(()=>{!D||Q||A.length===0||Ne.length>=10||Ws()},[D,Ne.length,Q,A.length]),x.useEffect(()=>{if(!_e||!D||Q||A.length===0)return;if(Ne.length>j){N(Ne.length);return}const B=window.setTimeout(()=>{Ws()},250);return()=>window.clearTimeout(B)},[_e,D,Q,A.length,Ne.length,j]);const ji=(B,re)=>{const Ie=(J??[]).find(at=>at.sessionId===re);L({dispatchId:B,sessionId:re,sessionLabel:Sn((Ie==null?void 0:Ie.title)??null,re)})},[Ri,Yr]=x.useState(null),Oi=B=>{B.prompt&&Em(B.prompt).then(re=>{if(!re){a("error",i("common.copyFailed"));return}Yr(B.id),window.setTimeout(()=>Yr(null),1500)})},Ia=()=>{if(!I)return;const{dispatchId:B,sessionId:re}=I;L(null),l.run(`dispatch:${B}`,async()=>{await Ee.runHookDispatch(B,re),await p()},{fail:Ie=>i("tasks.dispatchRunFailed",{error:Ye(Ie)})})},[Zs,yr]=x.useState(null),xs=x.useCallback(B=>{const re=J==null?void 0:J.find(at=>at.sessionId===B),Ie=re?Sn(re.title,re.sessionId):B.slice(0,8);yr({sessionId:B,label:Ie})},[J]),La=()=>{if(!Zs)return;const{sessionId:B}=Zs;yr(null),l.run(`del:${B}`,async()=>{const re=await Ee.deleteSession(B);D===B&&(_(null),z.current={project:e,sessionId:null},n==null||n(null)),await p(),a("success",i("toast.sessionDeleted",{n:re.events}))},{fail:re=>i("tasks.deleteFailed",{error:Ye(re)})})},fn=x.useCallback(B=>l.stateOf(`del:${B}`),[l]),vr=d.get(D??"")??"open",Zt=J==null?void 0:J.find(B=>B.sessionId===D),Di=EM(vr,NM(Zt==null?void 0:Zt.harness)?Zt==null?void 0:Zt.turnOpen:void 0),W=o.jsxs("section",{className:"flex min-w-0 min-h-0 flex-1 flex-col",children:[o.jsxs("div",{className:"flex items-center gap-2 pb-2",children:[o.jsx(jA,{className:"h-3.5 w-3.5 shrink-0 text-rose-400"}),o.jsx("h3",{className:"shrink-0 text-sm font-semibold text-neutral-200",children:i("tasks.chainTitle")}),o.jsxs("div",{className:"relative w-36 shrink-0 lg:w-44",children:[o.jsx(t6,{className:"pointer-events-none absolute left-1.5 top-1/2 h-3 w-3 -translate-y-1/2 text-neutral-600"}),o.jsx("input",{value:G,onChange:B=>T(B.target.value),placeholder:i("tasks.searchPlaceholder"),className:"h-6 w-full rounded border border-edge/[0.08] bg-neutral-900 pl-6 pr-5 text-[11px] text-neutral-200 placeholder:text-neutral-600 focus:border-edge/20 focus:outline-none"}),G&&o.jsx("button",{type:"button",onClick:()=>T(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-0.5 text-neutral-600 transition-colors hover:text-neutral-200",children:o.jsx(tn,{className:"h-3 w-3"})})]}),Me&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:i("tasks.searchMatches",{n:Me.length})}),o.jsx("span",{className:"ml-auto text-[10px] text-neutral-600",children:i("tasks.legendNote")})]}),Gr.length>0&&o.jsxs("div",{className:"mb-2 shrink-0 rounded-lg border border-amber-500/20 bg-amber-500/[0.04] px-2 py-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-[11px] font-medium text-amber-300",children:i("tasks.dispatchQueue",{n:Gr.length})}),o.jsx("span",{className:"text-[10px] text-amber-200/50",children:i("tasks.dispatchHint")})]}),o.jsx("ul",{className:"mt-1 space-y-1",children:Gr.map(B=>{var Ie;const re=$r[B.id]??((Ie=J==null?void 0:J[0])==null?void 0:Ie.sessionId)??"";return o.jsxs("li",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-neutral-300",title:B.prompt,children:B.prompt}),o.jsx("select",{value:re,onChange:at=>Da(vt=>({...vt,[B.id]:at.target.value})),className:"shrink-0 rounded border border-edge/[0.08] bg-neutral-900 px-1.5 py-0.5 text-[11px] text-neutral-200",children:(J??[]).map(at=>o.jsx("option",{value:at.sessionId,children:Sn(at.title,at.sessionId)},at.sessionId))}),o.jsxs("button",{type:"button",disabled:!re||l.stateOf(`dispatch:${B.id}`)==="loading",onClick:()=>Ti(B.id,re),className:"inline-flex shrink-0 items-center gap-1 rounded bg-emerald-700/80 px-2 py-0.5 text-[11px] font-medium text-white transition-colors hover:bg-emerald-600 disabled:opacity-40",children:[o.jsx(ut,{state:l.stateOf(`dispatch:${B.id}`),className:"h-3 w-3"}),i("tasks.dispatchRun")]})]},B.id)})})]}),D?V&&A.length===0?o.jsxs("p",{className:"flex min-h-0 flex-1 items-center justify-center gap-1.5 text-xs text-neutral-600",children:[o.jsx(zn,{className:"h-3.5 w-3.5 animate-spin"}),i("hooks.loading")]}):A.length===0?o.jsx("p",{className:"flex min-h-0 flex-1 items-center justify-center text-xs text-neutral-600",children:i("tasks.chainEmpty")}):Ne.length===0?o.jsxs("p",{className:"flex min-h-0 flex-1 items-center justify-center gap-1.5 text-xs text-neutral-600",children:[o.jsx(zn,{className:"h-3.5 w-3.5 animate-spin"}),i("tasks.chainCatchUp")]}):Me&&Me.length===0?o.jsx("p",{className:"flex min-h-0 flex-1 items-center justify-center gap-1.5 text-xs text-neutral-600",children:Q?i("tasks.searchNoMatch"):o.jsxs(o.Fragment,{children:[o.jsx(zn,{className:"h-3.5 w-3.5 animate-spin"}),i("tasks.chainCatchUp")]})}):o.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[o.jsx("div",{ref:Y,className:"flex min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain pr-1",onScroll:Hn.syncEdge,onWheel:B=>Hn.wheel(B.deltaY,B.deltaMode),onTouchStart:B=>{var re;return Hn.touchStart(((re=B.touches[0])==null?void 0:re.clientY)??0)},onTouchMove:B=>{var re;return Hn.touchMove(((re=B.touches[0])==null?void 0:re.clientY)??0)},onTouchEnd:Hn.touchEnd,onTouchCancel:Hn.touchEnd,children:o.jsx("div",{className:"flex shrink-0 flex-col gap-1",style:Hn.px>0?{transform:`translateY(-${Hn.px}px)`}:void 0,children:Kr.map(B=>{var kr,Mc;const re=B.prompt??(B.preSession?null:((kr=B.events[0])==null?void 0:kr.eventType)??B.id),Ie=B.events[B.events.length-1],at=(Ie==null?void 0:Ie.createdAt)??((Mc=B.dispatches[0])==null?void 0:Mc.startedAt),vt=ue===B.id,Cn=Ne.length>0&&B.id===Ne[Ne.length-1].id;return o.jsxs("div",{className:"shrink-0 rounded-lg border border-edge/[0.06] bg-edge/[0.015]",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>O(vt?"":B.id),onKeyDown:Tn=>{(Tn.key==="Enter"||Tn.key===" ")&&(Tn.preventDefault(),O(vt?"":B.id))},className:"flex w-full flex-wrap cursor-pointer items-center gap-2 px-2 py-1.5 text-left hover:bg-edge/[0.03]",children:[vt?o.jsx(Bn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(ns,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-200",title:re??void 0,children:re??""}),B.preSession&&o.jsx(Qe,{className:"shrink-0 bg-sky-900/40 text-sky-300",children:i("tasks.groupPreSession")}),B.open&&(Cn&&To(vr)?o.jsx(Qe,{className:"shrink-0 bg-emerald-900/40 text-emerald-300",children:i("tasks.groupRunning")}):o.jsx(Qe,{className:"shrink-0 bg-amber-900/40 text-amber-300",children:i("tasks.groupOpen")})),Cn&&v(D)&&o.jsx("button",{type:"button",title:i("tasks.answerActiveTooltip",{n:v(D).questions.filter(Tn=>!Tn.submit).length}),onClick:Tn=>{Tn.stopPropagation(),F(D)},className:"shrink-0 rounded bg-amber-900/50 px-1 py-px text-[10px] font-medium leading-tight text-amber-300 transition-colors hover:bg-amber-900/70 hover:text-amber-200",children:i("tasks.answerPendingTag")}),B.questions>0&&o.jsx(Qe,{className:"shrink-0 bg-teal-900/40 text-teal-300",children:i("tasks.groupQuestions",{n:B.questions})}),B.subagentStops>0&&o.jsx(Qe,{className:"shrink-0 bg-purple-900/40 text-purple-300",children:i("tasks.groupSubagent",{n:B.subagentStops})}),B.agentsDispatched>0&&o.jsx(Qe,{className:"shrink-0 bg-fuchsia-900/40 text-fuchsia-300",children:i("tasks.groupAgents",{n:B.agentsDispatched})}),at&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:rr(at)}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:i("tasks.events",{n:B.events.length})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:i("tasks.groupDispatches",{n:B.dispatches.length})}),B.prompt&&o.jsx("button",{type:"button",title:Ri===B.id?i("tasks.copied"):i("tasks.copyPrompt"),onClick:Tn=>{Tn.stopPropagation(),Oi(B)},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-edge/[0.08] bg-edge/[0.02] text-neutral-500 transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08] hover:text-neutral-200",children:Ri===B.id?o.jsx(cr,{className:"h-3 w-3 text-emerald-400"}):o.jsx(Vu,{className:"h-3 w-3"})}),Cn&&B.open&&To(vr)&&o.jsx("span",{className:"shrink-0",children:o.jsx(El,{harness:ve,running:!0})}),Cn&&Di&&o.jsx("button",{type:"button",title:i("tasks.stopTooltip"),onClick:Tn=>{Tn.stopPropagation(),xe(D)},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-edge/[0.08] bg-edge/[0.02] text-neutral-500 transition-colors hover:border-edge/[0.16] hover:bg-edge/[0.08] hover:text-red-300",children:o.jsx(ut,{state:l.stateOf(`interrupt:${D}`),className:"h-3 w-3",icon:o.jsx(Tv,{className:"h-3 w-3"})})})]}),vt&&o.jsx("div",{className:"h-[52dvh] min-h-[280px] lg:h-[calc(100dvh-330px)] lg:min-h-[420px] max-h-[760px] shrink-0 border-t border-edge/[0.06] p-1.5",children:o.jsxs("div",{className:"relative h-full rounded-md border border-edge/[0.04] bg-neutral-950/40",children:[o.jsx(kJ,{projectId:e,sessionId:D,harness:ve,focusGroupId:B.id,focusGroup:B,running:Cn&&To(vr),answerable:Cn&&!!v(D),onOpenAnswer:()=>F(D)},`${D}:${B.id}`),o.jsx("p",{className:"pointer-events-none absolute bottom-1 left-2 text-[10px] text-neutral-600",children:i("tasks.legendNote")})]})})]},B.id)})})}),qr&&o.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-neutral-950/95 via-neutral-950/70 to-transparent px-1 pb-1 pt-6 text-center",children:[o.jsx("p",{className:"text-[10px] text-neutral-500",children:Hn.px>0?i("tasks.pullMoreEvents"):i("tasks.olderHint")}),o.jsxs("span",{className:"pointer-events-auto mt-1 inline-flex gap-2",children:[o.jsx("button",{type:"button",onClick:()=>void Ws(),className:"rounded-md border border-edge/[0.1] bg-neutral-900/90 px-2 py-0.5 text-[11px] text-neutral-200 transition-colors hover:bg-neutral-800",children:xr>0?i("tasks.loadOlder",{n:Math.min(10,xr)}):i("tasks.loadOlderEvents")}),o.jsx("button",{type:"button",onClick:()=>N(B=>B+Ne.length),className:"rounded-md border border-edge/[0.1] bg-neutral-900/90 px-2 py-0.5 text-[11px] text-neutral-400 transition-colors hover:bg-neutral-800 hover:text-neutral-200",children:i("tasks.loadAll")})]})]})]}):o.jsx("p",{className:"flex min-h-0 flex-1 items-center justify-center text-xs text-neutral-600",children:i("tasks.selectHint")})]}),we=o.jsxs("div",{className:"flex min-w-0 min-h-0 flex-1 flex-col",children:[[...Br.values()].map(B=>o.jsx(oR,{embedded:!0,sessionId:B.sessionId,projectId:B.projectId,label:B.label,projectLabel:s,capability:B.capability,minimized:B.sessionId!==D,answerPending:!!v(B.sessionId),onOpenAnswer:()=>F(B.sessionId),onInterrupt:xe,interruptStateOf:fe,onOpenChain:()=>S(!0)},B.sessionId)),!is&&W]});return o.jsxs("div",{className:"flex flex-col lg:flex-row h-full min-h-0 gap-3 lg:gap-0",children:[o.jsxs("aside",{style:m?{width:k}:void 0,className:"flex w-full max-lg:min-h-0 max-lg:flex-1 lg:shrink-0 flex-col gap-2 overflow-y-auto border-r-0 lg:border-r border-edge/[0.06] pr-0 lg:pr-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold text-neutral-200",children:i("tasks.listTitle")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:J===null?i("hooks.loading"):String(J.length)}),o.jsxs("button",{type:"button",disabled:!Ot||Dt,title:Dt?i("tasks.newSessionStarting"):Ge.length===0?i("tasks.newSessionNoHarness"):i("tasks.newSessionTip"),onClick:Wt,className:me("inline-flex items-center gap-1 rounded-md border border-edge/[0.1] bg-neutral-900/90 px-2 py-0.5 text-[11px] transition-colors",Ot?"text-neutral-200 hover:bg-neutral-800":"cursor-not-allowed text-neutral-600",Dt&&"cursor-progress opacity-70 hover:bg-neutral-900/90"),children:[o.jsx(ut,{state:l.stateOf(`newSession:${e}`),className:"h-3 w-3",icon:o.jsx(Bd,{className:"h-3 w-3"})}),i("tasks.newSession")]}),o.jsx(Dk,{className:"ml-auto",title:i("tasks.refresh"),onClick:async()=>{const B=await p();a(B?"error":"success",B??i("tasks.refreshed"))}})]}),$&&o.jsx("p",{className:"rounded border border-red-500/30 bg-red-950/30 px-2 py-1 text-[11px] text-red-300",children:$}),J===null?o.jsx(Sm,{rows:8,className:"p-0"}):J.length===0?o.jsx("p",{className:"text-xs text-neutral-600",children:i("tasks.emptySessions")}):o.jsx(mK,{sessions:J,statuses:d,selectedId:D,highlightId:Z,onSelect:Ci,onRename:(B,re)=>void Fe(B,re),onDropDispatch:ji,onOpenTerminal:se,openTerminalStateOf:Pe,onClosePane:Ze,closePaneStateOf:yt,capabilities:ye===null?null:$e,inflightOf:Ce,questionOf:v,onAnswer:X,answerStateOf:de,answerFor:U,onSetAnswerFor:F,watchOf:ee,watchStateOf:ne,onSubscribeWatch:P,onUnwatch:oe,onDelete:xs,deleteStateOf:fn})]}),m&&o.jsxs(o.Fragment,{children:[o.jsx(ey,{onResize:B=>w(re=>Math.min(UE,Math.max(zE,re+B))),title:i("tasks.resizeList")}),we]}),!m&&D&&o.jsx("div",{className:g?"fixed inset-0 z-40":"hidden",children:o.jsxs("div",{className:"absolute inset-0 flex flex-col bg-neutral-950 drawer-right",children:[o.jsxs("div",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx("span",{className:"truncate text-sm font-semibold text-neutral-200",children:Sn((Zt==null?void 0:Zt.title)??null,D)}),(Zt==null?void 0:Zt.harness)&&o.jsx("span",{className:"shrink-0",children:o.jsx(El,{harness:Zt.harness})}),o.jsx("button",{onClick:()=>y(!1),className:"ml-auto rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:i("app.mobileDrawerClose"),children:o.jsx(tn,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col p-3",children:we})]})}),I&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:o.jsxs("div",{className:"w-80 rounded-lg border border-edge/[0.1] bg-neutral-900 p-4 shadow-xl",children:[o.jsx("p",{className:"text-sm text-neutral-200",children:i("hooks.runConfirm",{id:I.dispatchId,session:I.sessionLabel})}),o.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[o.jsx("button",{type:"button",onClick:()=>L(null),className:"rounded-md px-3 py-1.5 text-xs text-neutral-400 hover:bg-edge/[0.06]",children:i("hooks.cancel")}),o.jsx("button",{type:"button",onClick:Ia,className:"rounded-md bg-blue-600/80 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-500",children:i("hooks.runConfirmYes")})]})]})}),o.jsx(wi,{open:Zs!==null,title:i("tasks.deleteSession"),message:Zs?i("tasks.deleteConfirm",{id:Zs.label}):"",confirmLabel:i("common.confirm"),onConfirm:La,onClose:()=>yr(null)}),o.jsx(wi,{open:Be!==null,title:i("tasks.closePaneTitle"),message:Be?i("tasks.closePaneConfirm",{id:Be.label}):"",confirmLabel:i("common.confirm"),onConfirm:()=>{Be&&_n(Be.sessionId)},onClose:()=>it(null)}),zt&&o.jsx(Vz,{targets:zt.targets,busy:l.stateOf(`openTerm:${zt.sessionId}`)==="loading",onPick:B=>{const{sessionId:re}=zt;Ht(null),De(re,B)},onClose:()=>Ht(null)}),xt&&o.jsx(oJ,{harnesses:Ge,onPick:B=>{Mt(!1),He(B)},onClose:()=>Mt(!1)}),b&&is&&o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:()=>S(!1),children:o.jsxs("div",{className:"flex h-[86dvh] w-full max-w-6xl flex-col overflow-hidden rounded-xl border border-edge/[0.08] bg-neutral-950 p-3 shadow-mac",onClick:B=>B.stopPropagation(),children:[o.jsx("div",{className:"flex shrink-0 items-center justify-end",children:o.jsx("button",{type:"button",title:i("app.mobileDrawerClose"),"aria-label":i("app.mobileDrawerClose"),onClick:()=>S(!1),className:"rounded-lg p-1.5 text-neutral-500 transition-colors hover:bg-neutral-800/60 hover:text-neutral-200",children:o.jsx(tn,{className:"h-4 w-4"})})}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:W})]})})]})}const RJ=["all","today","1d","3d","7d","30d","over30","custom"],OJ={all:"tasks.rangeAll",today:"tasks.rangeToday","1d":"tasks.range1d","3d":"tasks.range3d","7d":"tasks.range7d","30d":"tasks.range30d",over30:"tasks.rangeOver30",custom:"tasks.rangeCustom"};function DJ(e,t){const n=new Map(e.map(i=>[i.sessionId,i])),s=[];for(const i of t){const a=n.get(i);a&&s.push(a)}const r=new Set(s.map(i=>i.sessionId));return[...e.filter(i=>!r.has(i.sessionId)),...s]}function IJ({projects:e,onOpenSession:t}){const n=We(),{show:s}=an(),{sessions:r,statuses:i,error:a,refresh:l}=Kd(),[c,u]=x.useState("all"),[d,f]=x.useState("all"),[h,p]=x.useState(""),[m,k]=x.useState(""),w=x.useMemo(()=>{const E=r??[],A=Date.now(),R=new Date;return R.setHours(0,0,0,0),E.filter(D=>{if(c!=="all"&&D.projectId!==c)return!1;const _=Date.parse(D.lastSeenAt);switch(d){case"today":return _>=R.getTime();case"1d":return _>=A-864e5;case"3d":return _>=A-3*864e5;case"7d":return _>=A-7*864e5;case"30d":return _>=A-30*864e5;case"over30":return _<A-30*864e5;case"custom":{if(h){const z=Date.parse(`${h}T00:00:00`);if(Number.isFinite(z)&&_<z)return!1}if(m){const z=Date.parse(`${m}T23:59:59.999`);if(Number.isFinite(z)&&_>z)return!1}return!0}default:return!0}})},[r,c,d,h,m]),g=`${c}|${d}|${h}|${m}`,y=x.useMemo(()=>w.slice().sort(F5).map(E=>E.sessionId),[w]),b=B5(y,g),S=x.useMemo(()=>{const E=new Map(e.map(A=>[A.id,A.name]));return DJ(w,b).map(A=>({session:A,projectName:A.projectId==null?n("tasks.overviewUnknownProject"):E.get(A.projectId)??n("tasks.overviewUnknownProject")}))},[w,b,e,n]),M=x.useRef(new Map);return H5(M),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(dl,{className:"h-3.5 w-3.5 text-sky-400"}),o.jsx("h3",{className:"text-sm font-semibold text-neutral-200",children:n("tasks.overviewTitle")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:r===null?n("hooks.loading"):w.length===((r==null?void 0:r.length)??0)?String(w.length):`${w.length} / ${(r==null?void 0:r.length)??0}`}),o.jsx(Dk,{className:"ml-auto",title:n("tasks.refresh"),onClick:async()=>{const E=await l();s(E?"error":"success",E??n("tasks.refreshed"))}})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 px-2",children:[o.jsxs("select",{value:c==="all"?"":String(c),onChange:E=>u(E.target.value===""?"all":Number(E.target.value)),className:"rounded-md border border-edge/[0.08] bg-neutral-900 px-2 py-1 text-xs text-neutral-200",children:[o.jsx("option",{value:"",children:n("tasks.overviewAllProjects")}),e.map(E=>o.jsx("option",{value:String(E.id),children:E.name},E.id))]}),o.jsx("span",{className:"flex overflow-hidden rounded-md border border-edge/[0.08]",children:RJ.map(E=>o.jsx("button",{type:"button",onClick:()=>f(E),className:me("px-2 py-1 text-[11px] transition-colors",d===E?"bg-neutral-800 text-neutral-100":"text-neutral-500 hover:bg-neutral-800/50"),children:n(OJ[E])},E))}),d==="custom"&&o.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-neutral-500",children:[o.jsx("input",{type:"date",value:h,onChange:E=>p(E.target.value),"aria-label":n("tasks.rangeFrom"),className:"rounded-md border border-edge/[0.08] bg-neutral-900 px-1.5 py-0.5 text-[11px] text-neutral-200"}),"—",o.jsx("input",{type:"date",value:m,onChange:E=>k(E.target.value),"aria-label":n("tasks.rangeTo"),className:"rounded-md border border-edge/[0.08] bg-neutral-900 px-1.5 py-0.5 text-[11px] text-neutral-200"})]})]}),a&&o.jsx("p",{className:"rounded border border-red-500/30 bg-red-950/30 px-2 py-1 text-[11px] text-red-300",children:a}),r===null?o.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-neutral-600",children:[o.jsx(zn,{className:"h-3 w-3 animate-spin"}),n("hooks.loading")]}):S.length===0?o.jsx("p",{className:"text-xs text-neutral-600",children:n("tasks.overviewEmpty")}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-3 px-2 text-[10px] text-neutral-600",children:[o.jsx("span",{className:"w-32 max-lg:w-24 shrink-0",children:n("tasks.overviewProject")}),o.jsx("span",{className:"min-w-0 flex-1",children:n("tasks.overviewSession")}),o.jsx("span",{className:"w-20 max-lg:w-auto shrink-0",children:n("tasks.overviewStatus")}),o.jsx("span",{className:"w-16 shrink-0 text-right hidden lg:block",children:n("tasks.overviewEvents")}),o.jsx("span",{className:"w-16 shrink-0 text-right hidden lg:block",children:n("tasks.overviewTime")})]}),o.jsx("ul",{className:"space-y-1",children:S.map(({session:E,projectName:A})=>{const R=i.get(E.sessionId)??"open",D=E.projectId!=null;return o.jsx("li",{ref:_=>{_?M.current.set(E.sessionId,_):M.current.delete(E.sessionId)},children:o.jsxs("div",{role:D?"button":void 0,tabIndex:D?0:void 0,onClick:D?()=>t(E.projectId,E.sessionId):void 0,onKeyDown:D?_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),t(E.projectId,E.sessionId))}:void 0,title:D?Sn(E.title,E.sessionId):void 0,className:me("flex flex-wrap lg:flex-nowrap items-center gap-3 rounded-md border px-2 py-1.5",D?"cursor-pointer border-edge/[0.06] bg-edge/[0.015] hover:bg-edge/[0.04]":"border-edge/[0.04] opacity-60"),children:[o.jsx("span",{className:"w-32 max-lg:w-24 shrink-0 truncate rounded bg-neutral-800/80 px-1.5 py-0.5 text-[10px] text-neutral-300",title:A,children:A}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-200",children:Sn(E.title,E.sessionId)}),E.harness&&o.jsx(mr,{agent:E.harness,className:"shrink-0 px-1 text-[10px]"}),o.jsxs("span",{className:"flex w-20 max-lg:w-auto shrink-0 items-center gap-1.5",children:[o.jsx(ck,{status:R,harness:E.harness}),o.jsx("span",{className:me("text-[10px]",CM[R].split(" ")[1]),children:n(_M[R])})]}),o.jsx("span",{className:"hidden lg:block w-16 shrink-0 text-right text-[10px] text-neutral-500",children:n("tasks.events",{n:E.eventCount??0})}),o.jsx("span",{className:"hidden lg:block w-16 shrink-0 text-right text-[10px] text-neutral-500",children:Lx(n,E.lastSeenAt,Date.now())}),o.jsxs("span",{className:"lg:hidden flex basis-full gap-3 text-[10px] text-neutral-500",children:[o.jsx("span",{children:n("tasks.events",{n:E.eventCount??0})}),o.jsx("span",{children:Lx(n,E.lastSeenAt,Date.now())})]})]})},E.sessionId)})})]})]})}const LJ=92,FE=380,PJ=56;function BE(e){return e!=null&&nn.includes(e)?nn.indexOf(e):nn.length}function zJ(e){const t=new Map;for(const l of e){const c=BE(l.harness),u=t.get(c)??{harness:l.harness??null,count:0};u.count+=1,t.set(c,u)}const n=[...t.keys()].sort((l,c)=>l-c),s=new Map(n.map((l,c)=>[l,c])),r=n.map((l,c)=>({harness:t.get(l).harness,x:c*FE,count:t.get(l).count})),i=r.map(()=>0),a=[];for(const l of e){const c=s.get(BE(l.harness))??0,u=i[c];i[c]=u+1;const d={key:`s:${l.sessionId}`,session:l,lane:c,row:u,x:c*FE,y:PJ+u*LJ};a.push(d)}return{nodes:a,lanes:r}}const UJ={running:"tasks.statusRunning",failed:"tasks.statusFailed",done:"orch.seqDone",cancelled:"orch.seqCancelled"},FJ={running:"bg-orange-900/50 text-orange-300",failed:"bg-red-900/50 text-red-300",done:"bg-emerald-900/40 text-emerald-300",cancelled:"bg-neutral-800 text-neutral-400"},BJ={prompt:"tasks.msgModePrompt",auto:"tasks.msgModeAuto",inject:"tasks.msgModeInject",headless:"tasks.msgModeHeadless"},HJ={pending:"tasks.msgStatusQueued",delivering:"tasks.msgStatusDelivering",injected:"tasks.msgStatusInjected",delivered:"tasks.msgStatusDelivered",running:"tasks.msgStatusRunning",succeeded:"tasks.msgStatusSucceeded",failed:"tasks.msgStatusFailed",timeout:"tasks.msgStatusTimeout"};function $J({data:e}){const t=We(),{session:n,status:s,capable:r,received:i,onOpenMessages:a}=e;return o.jsxs("div",{className:me("flex w-[260px] items-center gap-2 rounded-lg border border-edge/[0.08] bg-neutral-900/95 px-2 py-1.5 shadow-mac transition-colors",r?"cursor-pointer hover:border-blue-500/40":"cursor-default"),onClick:()=>r&&a(n.sessionId),title:r?t("tasks.messageTooltip"):n.sessionId,children:[o.jsx(In,{type:"target",id:"l",position:Xe.Left,style:{visibility:"hidden"}}),o.jsx(In,{type:"source",id:"r",position:Xe.Right,style:{visibility:"hidden"}}),o.jsx(ck,{status:s,harness:n.harness}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-xs font-medium text-neutral-100",children:Sn(n.title,n.sessionId)}),o.jsx("span",{className:"block truncate text-[10px] text-neutral-500",children:t("orch.received",{n:i})})]}),r&&o.jsx(UA,{className:"h-3 w-3 shrink-0 text-teal-400/70"})]})}function GJ({data:e}){const t=We(),{lane:n}=e;return o.jsxs("div",{className:"flex w-[260px] items-center gap-2 border-b border-dashed border-edge/[0.1] pb-1.5",children:[o.jsx(El,{harness:n.harness}),o.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-neutral-400",children:n.harness==null?t("orch.unknownLane"):Kn(n.harness).label}),o.jsx("span",{className:"text-[10px] text-neutral-600",children:t("catbar.items",{n:n.count})})]})}const KJ={seqSession:$J,seqLane:GJ};function qJ({projectId:e,projectLabel:t}){const n=We(),s=ak(),r=xn(),{show:i}=an(),{sessions:a,statuses:l}=Kd(),c=x.useMemo(()=>a===null?null:a.filter(q=>q.projectId===e),[a,e]),u=x.useMemo(()=>(c??[]).map(q=>q.sessionId).sort().join(","),[c]),d=x.useRef(null);d.current=c;const[f,h]=x.useState(null);x.useEffect(()=>{Ee.messagingCapabilities().then(h).catch(()=>{})},[]);const p=x.useMemo(()=>{const q=new Map;for(const Y of f??[])q.set(Y.harness,Y);return q},[f]),m=x.useCallback(q=>{var J;const Y=(J=d.current)==null?void 0:J.find(ce=>ce.sessionId===q);return(Y==null?void 0:Y.harness)!=null?p.get(Y.harness):void 0},[p]),k=x.useCallback(q=>{r.run(`interrupt:${q}`,async()=>{await Ee.interruptSession(q),i("success",n("tasks.stopOk"))},{fail:Y=>n("tasks.stopFail",{error:Ye(Y)})})},[r,n,i]),w=x.useCallback(q=>r.stateOf(`interrupt:${q}`),[r]),[g,y]=x.useState(null),b=x.useCallback(async()=>{const q=d.current;if(q)try{const Y=new Map;await Promise.all(q.map(async J=>{Y.set(J.sessionId,await Ee.listSessionMessages(J.sessionId))})),y(Y)}catch{}},[]);x.useEffect(()=>{y(null),b()},[b,u]);const[S,M]=x.useState(null),E=x.useCallback(()=>{Ee.listSessionSequences().then(M).catch(()=>{})},[]);x.useEffect(()=>{E()},[E,u]);const A=x.useMemo(()=>{if(!S)return null;const q=new Set((c??[]).map(Y=>Y.sessionId));return S.filter(Y=>Y.steps.some(J=>q.has(J.to)))},[S,c]),R=x.useMemo(()=>{const q=new Map;for(const Y of(g==null?void 0:g.values())??[])for(const J of Y)q.set(J.id,J);return q},[g]);x.useEffect(()=>{let q=null,Y=null;const ce=Aa(ke=>{var Ae,je;if((Ae=ke.kind)!=null&&Ae.startsWith("message.")){if(!(!ke.sessionId||(d.current??[]).some(Oe=>Oe.sessionId===ke.sessionId)))return;q!==null&&window.clearTimeout(q),q=window.setTimeout(()=>{q=null,b()},500)}else(je=ke.kind)!=null&&je.startsWith("sequence.")&&(Y!==null&&window.clearTimeout(Y),Y=window.setTimeout(()=>{Y=null,E()},500))},["message.","sequence."]);return()=>{ce(),q!==null&&window.clearTimeout(q),Y!==null&&window.clearTimeout(Y)}},[b,E]);const D=x.useMemo(()=>zJ(c??[]),[c]),_=x.useMemo(()=>{let q=0;for(const Y of(g==null?void 0:g.values())??[])q+=Y.length;return q},[g]),z=x.useCallback(q=>{var ce;const Y=(ce=d.current)==null?void 0:ce.find(ke=>ke.sessionId===q),J=(Y==null?void 0:Y.harness)!=null?p.get(Y.harness):void 0;!Y||!J||pe({sessionId:q,projectId:Y.projectId??e,label:Sn(Y.title,q),capability:J,minimized:!1})},[p,e]),$=x.useMemo(()=>{const q=D.lanes.map((J,ce)=>({id:`lane:${ce}`,type:"seqLane",position:{x:J.x,y:0},data:{lane:J},draggable:!1,selectable:!1})),Y=D.nodes.map(J=>{const ce=J.session,ke=ce.harness!=null?p.get(ce.harness):void 0,Ae=g==null?void 0:g.get(ce.sessionId);return{id:J.key,type:"seqSession",position:{x:J.x,y:J.y},data:{session:ce,status:l.get(ce.sessionId)??"open",capable:!!ke&&(ke.inject||ke.headless),received:(Ae==null?void 0:Ae.length)??0,onOpenMessages:z},draggable:!0}});return[...q,...Y]},[D,p,l,g,z]),[H,I]=x.useState(""),[L,C]=x.useState([{to:"",text:"",mode:"auto"}]),O=x.useMemo(()=>(c??[]).filter(q=>{if(q.harness==null)return!1;const Y=p.get(q.harness);return!!Y&&(Y.prompt||Y.inject||Y.headless)}),[c,p]),U=O.map(q=>q.sessionId).join(",");x.useEffect(()=>{const q=new Set(U?U.split(","):[]);C(Y=>Y.some(J=>J.to!==""&&!q.has(J.to))?Y.map(J=>J.to!==""&&!q.has(J.to)?{to:"",text:J.text,mode:"auto"}:J):Y)},[U]);const F=(q,Y)=>{C(J=>J.map((ce,ke)=>ke===q?{...ce,...Y}:ce))},j=(q,Y)=>{const J=Y?m(Y):void 0;C(ce=>ce.map((ke,Ae)=>Ae!==q?ke:ke.mode==="auto"||ke.mode==="prompt"&&!!(J!=null&&J.prompt)||ke.mode==="inject"&&!!(J!=null&&J.inject)||ke.mode==="headless"&&!!(J!=null&&J.headless)?{...ke,to:Y}:{...ke,to:Y,mode:"auto"}))},N=L.length>0&&L.every(q=>q.to!==""&&q.text.trim()!==""),G=()=>{N&&r.run("seq:create",async()=>{await Ee.createSequence({name:H.trim()||void 0,steps:L.map(q=>({to:q.to,text:q.text.trim(),mode:q.mode}))}),I(""),C([{to:"",text:"",mode:"auto"}]),await Promise.all([E(),b()])},{fail:q=>n("orch.triggerFailed",{error:Ye(q)})})},T=q=>{r.run(`seqCancel:${q}`,async()=>{await Ee.cancelSequence(q),await E()},{fail:Y=>n("orch.seqCancelFailed",{error:Ye(Y)})})},[Z,te]=x.useState(null),[Q,pe]=x.useState(null),V=q=>{const Y=(c??[]).find(J=>J.sessionId===q);return Sn((Y==null?void 0:Y.title)??null,q)};return o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ax,{className:"h-3.5 w-3.5 text-teal-400"}),o.jsx("h3",{className:"text-sm font-semibold text-neutral-200",children:n("orch.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:g===null?n("hooks.loading"):n("orch.messages",{n:_})}),o.jsx(Dk,{className:"ml-auto",title:n("tasks.refresh"),onClick:()=>{b(),E()}})]}),o.jsxs("div",{className:me("relative h-[420px] rounded-lg border border-edge/[0.06]",s),children:[c===null?o.jsx("p",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:n("hooks.loading")}):c.length===0?o.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-neutral-600",children:n("orch.canvasEmpty")}):o.jsxs(rk,{nodes:$,nodeTypes:KJ,fitView:!0,fitViewOptions:{maxZoom:1,padding:.12},minZoom:.15,maxZoom:1.5,nodesDraggable:!0,nodesConnectable:!1,deleteKeyCode:null,children:[o.jsx(lk,{}),o.jsx(ik,{showInteractive:!1})]}),o.jsx("p",{className:"pointer-events-none absolute bottom-1 left-2 text-[10px] text-neutral-600",children:n("orch.hint")})]}),o.jsxs("div",{className:"rounded-lg border border-edge/[0.06] bg-edge/[0.015] p-2",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 pb-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-neutral-200",children:n("orch.builderTitle")}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:n("orch.builderHint")})]}),O.length===0?o.jsx("p",{className:"py-1 text-[11px] text-neutral-600",children:n("orch.noCapableSessions")}):o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("input",{value:H,onChange:q=>I(q.target.value),placeholder:n("orch.namePlaceholder"),className:"w-56 rounded border border-edge/[0.1] bg-neutral-950 px-2 py-1 text-[11px] text-neutral-100 placeholder:text-neutral-600 focus:outline-none focus:border-blue-500/40"}),L.map((q,Y)=>{const J=q.to?m(q.to):void 0;return o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:"shrink-0 rounded bg-teal-900/40 px-1.5 py-0.5 text-[10px] font-medium text-teal-300",children:Y+1}),o.jsxs("select",{value:q.to,onChange:ce=>j(Y,ce.target.value),title:n("orch.stepTarget"),className:"shrink-0 rounded border border-edge/[0.08] bg-neutral-900 px-1.5 py-1 text-[11px] text-neutral-200",children:[o.jsxs("option",{value:"",children:[n("orch.stepTarget"),"…"]}),O.map(ce=>o.jsx("option",{value:ce.sessionId,children:Sn(ce.title,ce.sessionId)},ce.sessionId))]}),o.jsxs("select",{value:q.mode,onChange:ce=>F(Y,{mode:ce.target.value}),title:n("orch.stepMode"),className:"shrink-0 rounded border border-edge/[0.08] bg-neutral-900 px-1.5 py-1 text-[11px] text-neutral-200",children:[o.jsx("option",{value:"auto",children:n("tasks.msgModeAutoHint")}),(J==null?void 0:J.prompt)&&o.jsx("option",{value:"prompt",children:n("tasks.msgModePromptHint")}),(J==null?void 0:J.inject)&&o.jsx("option",{value:"inject",children:n("tasks.msgModeInjectHint")}),(J==null?void 0:J.headless)&&o.jsx("option",{value:"headless",children:n("tasks.msgModeHeadlessHint")})]}),o.jsx("input",{value:q.text,onChange:ce=>F(Y,{text:ce.target.value}),onKeyDown:ce=>{ce.key==="Enter"&&(ce.preventDefault(),G())},placeholder:n("orch.stepText"),className:"min-w-[12rem] flex-1 rounded border border-edge/[0.1] bg-neutral-950 px-2 py-1 text-[11px] text-neutral-100 placeholder:text-neutral-600 focus:outline-none focus:border-blue-500/40"}),L.length>1&&o.jsx("button",{type:"button",title:n("orch.removeStep"),onClick:()=>C(ce=>ce.filter((ke,Ae)=>Ae!==Y)),className:"shrink-0 rounded p-1 text-neutral-500 transition-colors hover:bg-edge/[0.08] hover:text-neutral-200",children:o.jsx(tn,{className:"h-3 w-3"})})]},Y)}),o.jsxs("div",{className:"flex items-center gap-2 pt-0.5",children:[o.jsxs("button",{type:"button",disabled:L.length>=3,onClick:()=>C(q=>q.length>=3?q:[...q,{to:"",text:"",mode:"auto"}]),className:"inline-flex items-center gap-1 rounded-md border border-edge/[0.1] bg-neutral-900/90 px-2 py-1 text-[11px] text-neutral-300 transition-colors hover:bg-neutral-800 disabled:opacity-40",children:[o.jsx(Bd,{className:"h-3 w-3"}),n("orch.addStep")]}),o.jsxs("button",{type:"button",disabled:!N||r.stateOf("seq:create")==="loading",onClick:G,className:"inline-flex items-center gap-1 rounded bg-teal-700/80 px-2.5 py-1 text-[11px] font-medium text-white transition-colors hover:bg-teal-600 disabled:opacity-40",children:[o.jsx(ut,{state:r.stateOf("seq:create"),className:"h-3 w-3",icon:o.jsx(ax,{className:"h-3 w-3"})}),n("orch.trigger")]})]})]})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 pb-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-neutral-200",children:n("orch.sequencesTitle")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:A===null?"":String(A.length)})]}),A===null?o.jsx("p",{className:"text-xs text-neutral-600",children:n("hooks.loading")}):A.length===0?o.jsx("p",{className:"text-xs text-neutral-600",children:n("orch.seqEmpty")}):o.jsx("ul",{className:"space-y-1.5",children:A.map(q=>{const Y=Z===q.id,J=q.steps.length,ce=q.status==="done"?J:Math.min(q.cursor+1,J);return o.jsxs("li",{className:"rounded-lg border border-edge/[0.06] bg-edge/[0.015]",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>te(Y?null:q.id),onKeyDown:ke=>{(ke.key==="Enter"||ke.key===" ")&&(ke.preventDefault(),te(Y?null:q.id))},className:"flex w-full cursor-pointer flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1.5 text-left hover:bg-edge/[0.03]",children:[o.jsx(Qe,{className:me("shrink-0",FJ[q.status]),children:n(UJ[q.status])}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",title:q.name||`#${q.id}`,children:q.name||n("orch.seqNameFallback",{id:q.id})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:n("orch.seqProgress",{cur:ce,n:J})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:rr(q.createdAt)}),q.status==="running"&&o.jsx("button",{type:"button",onClick:ke=>{ke.stopPropagation(),T(q.id)},disabled:r.stateOf(`seqCancel:${q.id}`)==="loading",className:"inline-flex shrink-0 items-center gap-1 rounded border border-red-500/30 px-1.5 py-0.5 text-[10px] text-red-300 transition-colors hover:bg-red-950/40 disabled:opacity-40",children:n("orch.seqCancel")})]}),q.error&&o.jsx("p",{className:"break-words border-t border-edge/[0.04] px-2 py-1 text-[11px] text-red-400/80",children:q.error}),Y&&o.jsx("ul",{className:"space-y-1 border-t border-edge/[0.04] px-2 py-1.5",children:q.steps.map((ke,Ae)=>{const je=ke.messageId!=null?R.get(ke.messageId):void 0;return o.jsxs("li",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[o.jsx("span",{className:"shrink-0 rounded bg-teal-900/40 px-1.5 py-px text-[10px] font-medium text-teal-300",children:Ae+1}),o.jsx("span",{className:"shrink-0 truncate text-[11px] text-neutral-300",children:V(ke.to)}),o.jsx(Qe,{className:"shrink-0 bg-neutral-800 text-neutral-400",children:n(BJ[ke.mode])}),o.jsx(Qe,{className:me("shrink-0",je?je.status==="succeeded"?"bg-emerald-900/40 text-emerald-300":je.status==="failed"||je.status==="timeout"?"bg-red-900/40 text-red-300":"bg-sky-900/40 text-sky-300":"bg-neutral-900 text-neutral-500"),children:n(je?HJ[je.status]:"orch.seqStepPending")}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-neutral-500",title:ke.text,children:ke.text})]},Ae)})})]},q.id)})})]}),Q&&o.jsx(oR,{sessionId:Q.sessionId,projectId:Q.projectId,label:Q.label,projectLabel:t,capability:Q.capability,minimized:Q.minimized,onInterrupt:k,interruptStateOf:w,onMinimize:()=>pe(q=>q&&{...q,minimized:!0}),onClose:()=>pe(null)},Q.sessionId)]})}const YJ=[{key:"packs",label:"assetView.packs"},{key:"files",label:"assetView.files"}];function ty(e){return e.filter(t=>!t.pluginKey)}function VJ(e,t,n){return(n?Ju(ty(n)).effective:e.length)+t.filter(r=>r.effective!==!1).length}function XJ({title:e,note:t,tag:n,children:s}){const r=We(),[i,a]=x.useState(!1);return o.jsxs("section",{className:"rounded-xl border border-edge/[0.06] bg-neutral-900/40",children:[o.jsxs("button",{type:"button",onClick:()=>a(l=>!l),title:r(i?"common.collapse":"common.expand"),className:"flex w-full items-center gap-1.5 px-3 py-2 text-left [&_svg]:pointer-events-none",children:[i?o.jsx(Bn,{className:"h-3 w-3 text-neutral-500"}):o.jsx(ns,{className:"h-3 w-3 text-neutral-500"}),o.jsx("span",{className:"text-xs font-semibold text-neutral-300",children:e}),n,o.jsx("span",{className:"text-[11px] text-neutral-500",children:t})]}),i&&o.jsx("div",{className:"space-y-2 px-3 pb-3",children:s})]})}const QJ=[...nn,"all"],WJ={global:["user"],project:["project","local"]};function ZJ({projectId:e,mode:t,category:n,resourceView:s,onResourceViewChange:r,statuslineNonce:i,assets:a,globalAssets:l,mcpRows:c,updates:u,globalSkillGroups:d,pluginRows:f,statuslineSource:h,onUninstallSkill:p,onUninstallMcp:m,onCycleMcpEnable:k,onCyclePluginState:w,onUninstallPlugin:g,onOpenFile:y,onOpenSkillDetail:b,projects:S,onOpenSession:M,onSelectSession:E,initialSessionId:A,dragPayload:R}){var pe,V,q;const{setNodeRef:D,isOver:_}=Ev({id:"project-assets"}),z=t==="global",$=z?"user":"project",H=We(),I=R?_o(R.attrs,{scope:$,agent:R.targetAgent}):null,L=R!==null&&I!==null&&!I.ok,[C,O]=x.useState(nn[0]??"claude"),U=n==="files"||n==="personalization",F=x.useMemo(()=>z?[]:C9(a).filter(Y=>C==="all"||Y.agent===C),[z,C,a]),j=x.useMemo(()=>(C==="all"?d:d.filter(J=>J.source.startsWith(C))).map(J=>{const ce=Hd(J.source),ke=ye=>ye.harness===ce&&ye.key===J.pluginKey,Ae=J.pluginKey&&ce?f.filter(ke):[],je=J.pluginKey&&ce?Ae.some(ye=>ye.effective):void 0,ae=WJ[t],Oe=Ae.filter(ye=>ae.includes(ye.scope)&&ye.enable!==null).map(ye=>({scope:ye.scope,enable:ye.enable,installScopes:ye.installScopes}));return{label:J.label,source:J.source,pluginKey:J.pluginKey,namespace:J.namespace,enabled:je,installSurface:J.pluginKey&&ce?Ae.some(ye=>ye.installScopes.length>0):void 0,...Oe.length>0?{scopeStates:Oe}:{},skills:J.skills.map(ye=>({name:ye.name,scope:"user",files:[],source:J.source,pluginKey:J.pluginKey,form:ye.form,...ce?{agent:ce}:{}}))}}),[t,d,f,C]),N=x.useMemo(()=>{const Y=J=>{const ce=c.filter(Ae=>Ae.harness===J);if(ce.length===0)return[];const ke=ce[0].installScopes.includes($)?$:ce[0].installScopes[0];return ce.filter(Ae=>Ae.scope===ke)};return C==="all"?nn.flatMap(Y):Y(C)},[c,$,C]),G=u==null?void 0:u.skills.filter(Y=>Y.scope===$),T=u==null?void 0:u.mcp.filter(Y=>{const J=Y.agent&&Y.agent!=="claude"?Y.agent:null;return J?C==="all"||C===J:Y.scope===$&&(C==="all"||C==="claude")}),Z=u==null?void 0:u.files.filter(Y=>Y.scope===$),te=x.useMemo(()=>a.filter(Y=>C==="all"||Y.agent===C),[a,C]),Q=x.useMemo(()=>l.filter(Y=>C==="all"||Y.agent===C),[l,C]);return o.jsxs("div",{ref:D,className:me("space-y-4 h-full px-2 pt-2",L?"ring-1 ring-red-500/60 rounded-md -m-2 bg-red-950/20 cursor-not-allowed":_&&"ring-1 ring-blue-500/60 rounded-md -m-2 bg-blue-950/20"),children:[U&&o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/60 border border-edge/[0.06] p-0.5 w-fit",children:QJ.map(Y=>o.jsx("button",{onClick:()=>O(Y),className:me("rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",C===Y?"bg-neutral-800 text-neutral-100 shadow-mac-sm":"text-neutral-500 hover:text-neutral-300"),title:Y==="all"?H("category.tabAllTip"):H("category.tabToolTip",{tool:Kn(Y).tooltip}),children:Y==="all"?H("category.tabAll"):Kn(Y).label},Y))}),n==="files"&&o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/60 border border-edge/[0.06] p-0.5 w-fit",children:YJ.map(Y=>o.jsx("button",{onClick:()=>r(Y.key),className:me("rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",s===Y.key?"bg-neutral-800 text-neutral-100 shadow-mac-sm":"text-neutral-500 hover:text-neutral-300"),children:H(Y.label)},Y.key))}),n==="files"&&s==="files"&&!z&&(te.length===0?C!=="claude"&&C!=="all"?o.jsx(HE,{harness:C,text:C==="codex"?H("category.codexFilesPlaceholder"):H("category.emptyFilesOtherHarness",{harness:Kn(C).label})}):o.jsxs("div",{className:"rounded-xl border border-dashed border-edge/[0.1] bg-neutral-900/40 p-8 flex flex-col items-center justify-center text-center gap-3",children:[o.jsx(rx,{className:"h-8 w-8 text-neutral-600"}),o.jsx("p",{className:"text-xs text-neutral-500",children:H("category.emptyFilesProject")})]}):o.jsx(gS,{scope:$,assets:te,updates:Z,onOpenFile:y})),n==="files"&&s==="files"&&z&&(Q.length===0?o.jsxs("div",{className:"rounded-xl border border-dashed border-edge/[0.1] bg-neutral-900/40 p-8 flex flex-col items-center justify-center text-center gap-3",children:[o.jsx(rx,{className:"h-8 w-8 text-neutral-600"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-neutral-300",children:H("category.globalFilesTitle")}),o.jsx("p",{className:"text-xs text-neutral-500 mt-1 max-w-xs",children:H("category.emptyFilesGlobalDesc")})]})]}):o.jsx(gS,{scope:$,assets:Q,updates:Z,onOpenFile:y})),n==="files"&&s==="packs"&&o.jsxs(o.Fragment,{children:[o.jsx(JG,{projectId:e,mode:t,runtimeTab:C}),o.jsxs(XJ,{title:H("category.externalAssets"),note:H("category.externalAssetsNote"),tag:o.jsx(td,{tone:ed(VJ(F,N,z?j:void 0),F.length+N.length),children:H("category.externalAssetsSummary",{skills:F.length,mcp:N.length})}),children:[o.jsx(E9,{skills:F,groups:z?ty(j):void 0,globalGroupsReadOnly:z?void 0:ty(j),updates:G,empty:H(C==="codex"?z?"category.emptySkillsGlobalCodex":"category.emptySkillsProjectCodex":z?"category.emptySkillsGlobal":"category.emptySkillsProject"),onUninstallSkill:p,onOpenDetail:b,onCyclePluginState:w,onUninstallPlugin:g}),o.jsx(M9,{rows:N,scope:$,updates:T,empty:H(C==="codex"?"category.emptyMcpCodex":z?"category.emptyMcpGlobal":"category.emptyMcpProject"),onUninstallMcp:m,onCycleMcpEnable:k})]})]}),n==="weave"&&o.jsx(VG,{projectId:e,mode:t}),n==="tasks"&&(z?o.jsx(IJ,{projects:S,onOpenSession:M}):o.jsx(jJ,{projectId:e,initialSessionId:A,onSelectSession:E,projectLabel:((pe=S.find(Y=>Y.id===e))==null?void 0:pe.name)??"",harnesses:((V=S.find(Y=>Y.id===e))==null?void 0:V.harnesses)??[]})),n==="orchestrate"&&(z?o.jsx("p",{className:"pt-6 text-center text-xs text-neutral-600",children:H("orch.globalHint")}):o.jsx(qJ,{projectId:e,projectLabel:((q=S.find(Y=>Y.id===e))==null?void 0:q.name)??""})),n==="personalization"&&(C==="claude"||C==="all")&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("p",{className:"text-[11px] text-neutral-500",children:[H(z?"category.personalizationGlobal":"category.personalizationProject"),h&&o.jsx("span",{className:"ml-2",children:H("category.statuslineSource",{source:H(h==="custom"?"category.statuslineCustom":"category.statuslineFollowGlobal")})})]}),o.jsx(eU,{projectId:e,initialTab:z?"global":"project"},`${e}-${z?"global":"project"}-${i}`)]}),n==="personalization"&&C!=="claude"&&o.jsx(HE,{harness:C==="all"?"codex":C,text:C==="all"||C==="codex"?H("category.codexPersonalizationPlaceholder"):H("category.personalizationUnsupported",{harness:Kn(C).label})}),L&&(I==null?void 0:I.reasonKey)&&o.jsx("p",{className:"text-xs text-red-300",children:H(I.reasonKey)}),!L&&_&&o.jsx("p",{className:"text-xs text-blue-300",children:H("category.dropToInstall")})]})}function HE({harness:e,text:t}){return o.jsxs("div",{className:"rounded-xl border border-dashed border-edge/[0.1] bg-neutral-900/40 p-8 flex flex-col items-center justify-center text-center gap-3",children:[o.jsx(IP,{className:"h-8 w-8 text-neutral-600"}),o.jsx(mr,{agent:e}),o.jsx("p",{className:"text-xs text-neutral-500 max-w-xs",children:t})]})}const $E=function(e,t,n){const s=nf(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(s(e.children[t],t,e))return e.children[t]},Hl=function(e){if(e==null)return tee;if(typeof e=="string")return eee(e);if(typeof e=="object")return JJ(e);if(typeof e=="function")return Lk(e);throw new Error("Expected function, string, or array as `test`")};function JJ(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Hl(e[n]);return Lk(s);function s(...r){let i=-1;for(;++i<t.length;)if(t[i].apply(this,r))return!0;return!1}}function eee(e){return Lk(t);function t(n){return n.tagName===e}}function Lk(e){return t;function t(n,s,r){return!!(nee(n)&&e.call(this,n,typeof s=="number"?s:void 0,r||void 0))}}function tee(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function nee(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const GE=/\n/g,KE=/[\t ]+/g,ny=Hl("br"),qE=Hl(uee),see=Hl("p"),YE=Hl("tr"),ree=Hl(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",cee,dee]),gR=Hl(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function iee(e,t){const n=t||{},s="children"in e?e.children:[],r=gR(e),i=yR(e,{whitespace:n.whitespace||"normal"}),a=[];(e.type==="text"||e.type==="comment")&&a.push(...xR(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<s.length;)a.push(...bR(s[l],e,{whitespace:i,breakBefore:l?void 0:r,breakAfter:l<s.length-1?ny(s[l+1]):r}));const c=[];let u;for(l=-1;++l<a.length;){const d=a[l];typeof d=="number"?u!==void 0&&d>u&&(u=d):d&&(u!==void 0&&u>-1&&c.push(`
546
+ `.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function bR(e,t,n){return e.type==="element"?aee(e,t,n):e.type==="text"?n.whitespace==="normal"?xR(e,n):lee(e):[]}function aee(e,t,n){const s=yR(e,n),r=e.children||[];let i=-1,a=[];if(ree(e))return a;let l,c;for(ny(e)||YE(e)&&$E(t,e,YE)?c=`
547
+ `:see(e)?(l=2,c=2):gR(e)&&(l=1,c=1);++i<r.length;)a=a.concat(bR(r[i],e,{whitespace:s,breakBefore:i?void 0:l,breakAfter:i<r.length-1?ny(r[i+1]):c}));return qE(e)&&$E(t,e,qE)&&a.push(" "),l&&a.unshift(l),c&&a.push(c),a}function xR(e,t){const n=String(e.value),s=[],r=[];let i=0;for(;i<=n.length;){GE.lastIndex=i;const c=GE.exec(n),u=c&&"index"in c?c.index:n.length;s.push(oee(n.slice(i,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),i=u+1}let a=-1,l;for(;++a<s.length;)s[a].charCodeAt(s[a].length-1)===8203||a<s.length-1&&s[a+1].charCodeAt(0)===8203?(r.push(s[a]),l=void 0):s[a]?(typeof l=="number"&&r.push(l),r.push(s[a]),l=0):(a===0||a===s.length-1)&&r.push(0);return r}function lee(e){return[String(e.value)]}function oee(e,t,n){const s=[];let r=0,i;for(;r<e.length;){KE.lastIndex=r;const a=KE.exec(e);i=a?a.index:e.length,!r&&!i&&a&&!t&&s.push(""),r!==i&&s.push(e.slice(r,i)),r=a?i+a[0].length:i}return r!==i&&!n&&s.push(""),s.join(" ")}function yR(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function cee(e){return!!(e.properties||{}).hidden}function uee(e){return e.tagName==="td"||e.tagName==="th"}function dee(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function fee(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+s+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],k=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],S={type:k,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},M={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,`(?!${m.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},E=[M,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:E.concat([{begin:/\(/,end:/\)/,keywords:S,contains:E.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:S,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:S,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(A,R,M,E,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:S,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function hee(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=fee(e),s=n.keywords;return s.type=[...s.type,...t.type],s.literal=[...s.literal,...t.literal],s.built_in=[...s.built_in,...t.built_in],s._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function pee(e){const t=e.regex,n={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},k=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],g={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],S=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:k,literal:w,built_in:[...y,...b,"set","shopt",...S,...M]},contains:[p,e.SHEBANG(),m,f,i,a,g,l,c,u,d,n]}}function mee(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="("+s+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},g=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:g.concat([{begin:/\(/,end:/\)/,keywords:w,contains:g.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"</",contains:[].concat(y,b,g,[f,{begin:e.IDENT_RE+"::",keywords:w},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}function gee(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",a="(?!struct)("+s+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},p=t.optional(r)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],k=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],S={type:k,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},M={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,`(?!${m.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},E=[M,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:E.concat([{begin:/\(/,end:/\)/,keywords:S,contains:E.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:S,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:S,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(A,R,M,E,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:S,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function bee(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],r=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:r.concat(i),built_in:t,literal:s},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=e.inherit(h,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},k={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=e.inherit(k,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[k,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[w,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[u,k,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",S={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,y],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},S]}}const xee=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),yee=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],vee=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],kee=[...yee,...vee],wee=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),See=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Nee=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Eee=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function _ee(e){const t=e.regex,n=xee(e),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,s,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+See.join("|")+")"},{begin:":(:)?("+Nee.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Eee.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:wee.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+kee.join("|")+")\\b"}]}}function Cee(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Tee(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}function Aee(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Mee(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},s=e.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[s,i,r,a,n,"self"],relevance:0},c=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,d=/'[^']*'/,f=t.either(c,u,d),h=t.concat(f,"(\\s*\\.\\s*",f,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:h,className:"attr",starts:{end:/$/,contains:[s,l,i,r,a,n]}}]}}var Jl="[0-9](_*[0-9])*",eh=`\\.(${Jl})`,th="[0-9a-fA-F](_*[0-9a-fA-F])*",VE={className:"number",variants:[{begin:`(\\b(${Jl})((${eh})|\\.)?|(${eh}))[eE][+-]?(${Jl})[fFdD]?\\b`},{begin:`\\b(${Jl})((${eh})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${eh})[fFdD]?\\b`},{begin:`\\b(${Jl})[fFdD]\\b`},{begin:`\\b0[xX]((${th})\\.?|(${th})?\\.(${th}))[pP][+-]?(${Jl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${th})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function vR(e,t,n){return n===-1?"":e.replace(t,s=>vR(e,t,n-1))}function jee(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",s=n+vR("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+s+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,VE,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},VE,u]}}const XE="[A-Za-z$_][0-9A-Za-z$_]*",Ree=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Oee=["true","false","null","undefined","NaN","Infinity"],kR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],wR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],SR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Dee=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Iee=[].concat(SR,kR,wR);function Lee(e){const t=e.regex,n=(U,{after:F})=>{const j="</"+U[0].slice(1);return U.input.indexOf(j,F)!==-1},s=XE,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,F)=>{const j=U[0].length+U.index,N=U.input[j];if(N==="<"||N===","){F.ignoreMatch();return}N===">"&&(n(U,{after:j})||F.ignoreMatch());let G;const T=U.input.substring(j);if(G=T.match(/^\s*=/)){F.ignoreMatch();return}if((G=T.match(/^\s+extends\s+/))&&G.index===0){F.ignoreMatch();return}}},l={$pattern:XE,keyword:Ree,literal:Oee,built_in:Iee,"variable.language":Dee},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,k,w,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(b)});const S=[].concat(y,h.contains),M=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),E={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:M},A={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...kR,...wR]}},D={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},z={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(U){return t.concat("(?!",U.join("|"),")")}const H={match:t.concat(/\b/,$([...SR,"super","import","await"].map(U=>`${U}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},L={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:R},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),D,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,k,w,y,{match:/\$\d+/},f,R,{scope:"attr",match:s+t.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},H,z,A,L,{match:/\$[(.]/}]}}const Pee="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",zee={scope:"number",match:Pee,relevance:0};function Uee(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],r={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:s},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,zee,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var eo="[0-9](_*[0-9])*",nh=`\\.(${eo})`,sh="[0-9a-fA-F](_*[0-9a-fA-F])*",Fee={className:"number",variants:[{begin:`(\\b(${eo})((${nh})|\\.)?|(${nh}))[eE][+-]?(${eo})[fFdD]?\\b`},{begin:`\\b(${eo})((${nh})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${nh})[fFdD]?\\b`},{begin:`\\b(${eo})[fFdD]\\b`},{begin:`\\b0[xX]((${sh})\\.?|(${sh})?\\.(${sh}))[pP][+-]?(${eo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${sh})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Bee(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},s={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(a);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=Fee,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,s,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
548
+ `},u]}}const Hee=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),$ee=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Gee=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Kee=[...$ee,...Gee],qee=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),NR=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ER=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Yee=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Vee=NR.concat(ER).sort().reverse();function Xee(e){const t=Hee(e),n=Vee,s="and or not only",r="[\\w-]+",i="("+r+"|@\\{"+r+"\\})",a=[],l=[],c=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},u=function(b,S,M){return{className:b,begin:S,relevance:M}},d={$pattern:/[a-z-]+/,keyword:s,attribute:qee.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.UNICODE_RANGE,t.HEXCOLOR,f,u("variable","@@?"+r,10),u("variable","@\\{"+r+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Yee.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},k={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:h}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+r+"\\}"),{begin:"\\b("+Kee.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",i,0),u("selector-id","#"+i),u("selector-class","\\."+i,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+NR.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ER.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},y={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,k,w,y,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function Qee(e){const t="\\[=*\\[",n="\\]=*\\]",s={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[s],relevance:5}])}}function Wee(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},r={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},a={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,s,r,i,a]}}function Zee(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,c];return[u,d,f,h].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,i,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},r,s,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Jee(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function ete(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:n.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},a={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,i,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(k,w,g="\\1")=>{const y=g==="\\1"?g:t.concat(g,w);return t.concat(t.concat("(?:",k,")"),w,/(?:\\.|[^\\\/])*?/,y,/(?:\\.|[^\\\/])*?/,g,s)},p=(k,w,g)=>t.concat(t.concat("(?:",k,")"),w,/(?:\\.|[^\\\/])*?/,g,s),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:m}}function tte(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,s=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+s},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(I,L)=>{L.data._beginMatch=I[1]||I[2]},"on:end":(I,L)=>{L.data._beginMatch!==I[1]&&L.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
549
+ ]`,m={scope:"string",variants:[d,u,f,h]},k={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],S={keyword:g,literal:(I=>{const L=[];return I.forEach(C=>{L.push(C),C.toLowerCase()===C?L.push(C.toUpperCase()):L.push(C.toLowerCase())}),L})(w),built_in:y},M=I=>I.map(L=>L.replace(/\|\d+$/,"")),E={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",M(y).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(s,"\\b(?!\\()"),R={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},D={scope:"attr",match:t.concat(s,t.lookahead(":"),t.lookahead(/(?!::)/))},_={relevance:0,begin:/\(/,end:/\)/,keywords:S,contains:[D,a,R,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,k,E]},z={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",M(g).join("\\b|"),"|",M(y).join("\\b|"),"\\b)"),s,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[_]};_.contains.push(z);const $=[D,R,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,k,E],H={begin:t.concat(/#\[\s*\\?/,t.either(r,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...$]},...$,{scope:"meta",variants:[{match:r},{match:i}]}]};return{case_insensitive:!1,keywords:S,contains:[H,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,z,R,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},E,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:S,contains:["self",H,a,R,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,m,k]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,k]}}function nte(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function ste(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function rte(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${s.join("|")}`,k={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,k,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,k,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,k,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[k,g,f]}]}}function ite(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function ate(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[i,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function lte(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(s,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},k={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},E=[f,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:a},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[k]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=E,k.contains=E;const _=[{begin:/^\s*=>/,starts:{end:"$",contains:E}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:E}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(_).concat(u).concat(E)}}function ote(e){const t=e.regex,n=/(r#)?/,s=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:d}},{className:"punctuation",begin:"->"},i]}}const cte=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ute=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],dte=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],fte=[...ute,...dte],hte=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),pte=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),mte=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),gte=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function bte(e){const t=cte(e),n=mte,s=pte,r="@[a-z-]+",i="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+fte.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+s.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gte.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,t.UNICODE_RANGE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:hte.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function xte(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function yte(e){const t=e.regex,n=e.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...c].filter(M=>!d.includes(M)),k={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function y(M){return t.concat(/\b/,t.either(...M.map(E=>E.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:y(h),relevance:0};function S(M,{exceptions:E,when:A}={}){const R=A;return E=E||[],M.map(D=>D.match(/\|\d+$/)||E.includes(D)?D:R(D)?`${D}|0`:D)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:S(m,{when:M=>M.length<3}),literal:i,type:l,built_in:f},contains:[{scope:"type",match:y(a)},b,g,k,s,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function _R(e){return e?typeof e=="string"?e:e.source:null}function Yc(e){return It("(?=",e,")")}function It(...e){return e.map(n=>_R(n)).join("")}function vte(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Zn(...e){return"("+(vte(e).capture?"":"?:")+e.map(s=>_R(s)).join("|")+")"}const Pk=e=>It(/\b/,e,/\w$/.test(e)?/\b/:/\B/),kte=["Protocol","Type"].map(Pk),QE=["init","self"].map(Pk),wte=["Any","Self"],u0=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],WE=["false","nil","true"],Ste=["assignment","associativity","higherThan","left","lowerThan","none","right"],Nte=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ZE=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],CR=Zn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),TR=Zn(CR,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),d0=It(CR,TR,"*"),AR=Zn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Dp=Zn(AR,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),wr=It(AR,Dp,"*"),rh=It(/[A-Z]/,Dp,"*"),Ete=["attached","autoclosure",It(/convention\(/,Zn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",It(/objc\(/,wr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],_te=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Cte(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Zn(...kte,...QE)],className:{2:"keyword"}},i={match:It(/\./,Zn(...u0)),relevance:0},a=u0.filter(ae=>typeof ae=="string").concat(["_|0"]),l=u0.filter(ae=>typeof ae!="string").concat(wte).map(Pk),c={variants:[{className:"keyword",match:Zn(...l,...QE)}]},u={$pattern:Zn(/\b\w+/,/#\w+/),keyword:a.concat(Nte),literal:WE},d=[r,i,c],f={match:It(/\./,Zn(...ZE)),relevance:0},h={className:"built_in",match:It(/\b/,Zn(...ZE),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},k={className:"operator",relevance:0,variants:[{match:d0},{match:`\\.(\\.|${TR})+`}]},w=[m,k],g="([0-9]_*)+",y="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${y})(\\.(${y}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(ae="")=>({className:"subst",variants:[{match:It(/\\/,ae,/[0\\tnr"']/)},{match:It(/\\/,ae,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(ae="")=>({className:"subst",match:It(/\\/,ae,/[\t ]*(?:[\r\n]|\r\n)/)}),E=(ae="")=>({className:"subst",label:"interpol",begin:It(/\\/,ae,/\(/),end:/\)/}),A=(ae="")=>({begin:It(ae,/"""/),end:It(/"""/,ae),contains:[S(ae),M(ae),E(ae)]}),R=(ae="")=>({begin:It(ae,/"/),end:It(/"/,ae),contains:[S(ae),E(ae)]}),D={className:"string",variants:[A(),A("#"),A("##"),A("###"),R(),R("#"),R("##"),R("###")]},_=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],z={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:_},$=ae=>{const Oe=It(ae,/\//),ye=It(/\//,ae);return{begin:Oe,end:ye,contains:[..._,{scope:"comment",begin:`#(?!.*${ye})`,end:/$/}]}},H={scope:"regexp",variants:[$("###"),$("##"),$("#"),z]},I={match:It(/`/,wr,/`/)},L={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${Dp}+`},O=[I,L,C],U={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:_te,contains:[...w,b,D]}]}},F={scope:"keyword",match:It(/@/,Zn(...Ete),Yc(Zn(/\(/,/\s+/)))},j={scope:"meta",match:It(/@/,wr)},N=[U,F,j],G={match:Yc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:It(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Dp,"+")},{className:"type",match:rh,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:It(/\s+&\s+/,Yc(rh)),relevance:0}]},T={begin:/</,end:/>/,keywords:u,contains:[...s,...d,...N,m,G]};G.contains.push(T);const Z={match:It(wr,/\s*:/),keywords:"_|0",relevance:0},te={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Z,...s,H,...d,...p,...w,b,D,...O,...N,G]},Q={begin:/</,end:/>/,keywords:"repeat each",contains:[...s,G]},pe={begin:Zn(Yc(It(wr,/\s*:/)),Yc(It(wr,/\s+/,wr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:wr}]},V={begin:/\(/,end:/\)/,keywords:u,contains:[pe,...s,...d,...w,b,D,...N,G,te],endsParent:!0,illegal:/["']/},q={match:[/(func|macro)/,/\s+/,Zn(I.match,wr,d0)],className:{1:"keyword",3:"title.function"},contains:[Q,V,t],illegal:[/\[/,/%/]},Y={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Q,V,t],illegal:/\[|%/},J={match:[/operator/,/\s+/,d0],className:{1:"keyword",3:"title"}},ce={begin:[/precedencegroup/,/\s+/,rh],className:{1:"keyword",3:"title"},contains:[G],keywords:[...Ste,...WE],end:/}/},ke={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ae={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},je={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,wr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[Q,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:rh},...d],relevance:0}]};for(const ae of D.variants){const Oe=ae.contains.find(ge=>ge.label==="interpol");Oe.keywords=u;const ye=[...d,...p,...w,b,D,...O];Oe.contains=[...ye,{begin:/\(/,end:/\)/,contains:["self",...ye]}]}return{name:"Swift",keywords:u,contains:[...s,q,Y,ke,Ae,je,J,ce,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},H,...d,...p,...w,b,D,...O,...N,G,te]}}const Ip="[A-Za-z$_][0-9A-Za-z$_]*",MR=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],jR=["true","false","null","undefined","NaN","Infinity"],RR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],OR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],DR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],IR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],LR=[].concat(DR,RR,OR);function Tte(e){const t=e.regex,n=(U,{after:F})=>{const j="</"+U[0].slice(1);return U.input.indexOf(j,F)!==-1},s=Ip,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,F)=>{const j=U[0].length+U.index,N=U.input[j];if(N==="<"||N===","){F.ignoreMatch();return}N===">"&&(n(U,{after:j})||F.ignoreMatch());let G;const T=U.input.substring(j);if(G=T.match(/^\s*=/)){F.ignoreMatch();return}if((G=T.match(/^\s+extends\s+/))&&G.index===0){F.ignoreMatch();return}}},l={$pattern:Ip,keyword:MR,literal:jR,built_in:LR,"variable.language":IR},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,k,w,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(b)});const S=[].concat(y,h.contains),M=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),E={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:M},A={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...RR,...OR]}},D={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},_={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},z={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(U){return t.concat("(?!",U.join("|"),")")}const H={match:t.concat(/\b/,$([...DR,"super","import","await"].map(U=>`${U}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},L={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:R},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),D,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,k,w,y,{match:/\$\d+/},f,R,{scope:"attr",match:s+t.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},H,z,A,L,{match:/\$[(.]/}]}}function Ate(e){const t=e.regex,n=Tte(e),s=Ip,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Ip,keyword:MR.concat(c),literal:jR,built_in:LR.concat(r),"variable.language":IR},d={className:"meta",begin:"@"+s},f=(k,w,g)=>{const y=k.contains.findIndex(b=>b.label===w);if(y===-1)throw new Error("can not find mode to replace");k.contains.splice(y,1,g)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(k=>k.scope==="attr"),p=Object.assign({},h,{match:t.concat(s,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,i,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const m=n.contains.find(k=>k.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Mte(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},r=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,r),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,r),/ +/,t.either(a,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,s,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function jte(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],r={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,a,r,e.QUOTE_STRING_MODE,c,u,l]}}function Rte(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Ote(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},k={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},w=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,k,i,a],g=[...w];return g.pop(),g.push(l),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const Dte={arduino:hee,bash:pee,c:mee,cpp:gee,csharp:bee,css:_ee,diff:Cee,go:Tee,graphql:Aee,ini:Mee,java:jee,javascript:Lee,json:Uee,kotlin:Bee,less:Xee,lua:Qee,makefile:Wee,markdown:Zee,objectivec:Jee,perl:ete,php:tte,"php-template":nte,plaintext:ste,python:rte,"python-repl":ite,r:ate,ruby:lte,rust:ote,scss:bte,shell:xte,sql:yte,swift:Cte,typescript:Ate,vbnet:Mte,wasm:jte,xml:Rte,yaml:Ote};function PR(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],s=typeof n;(s==="object"||s==="function")&&!Object.isFrozen(n)&&PR(n)}),e}class JE{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function zR(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function pa(e,...t){const n=Object.create(null);for(const s in e)n[s]=e[s];return t.forEach(function(s){for(const r in s)n[r]=s[r]}),n}const Ite="</span>",e_=e=>!!e.scope,Lte=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((s,r)=>`${s}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`};class Pte{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=zR(t)}openNode(t){if(!e_(t))return;const n=Lte(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){e_(t)&&(this.buffer+=Ite)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const t_=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class zk{constructor(){this.rootNode=t_(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=t_({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(s=>this._walk(t,s)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{zk._collapse(n)}))}}class zte extends zk{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const s=t.root;n&&(s.scope=`language:${n}`),this.add(s)}toHTML(){return new Pte(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function hd(e){return e?typeof e=="string"?e:e.source:null}function UR(e){return $l("(?=",e,")")}function Ute(e){return $l("(?:",e,")*")}function Fte(e){return $l("(?:",e,")?")}function $l(...e){return e.map(n=>hd(n)).join("")}function Bte(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Uk(...e){return"("+(Bte(e).capture?"":"?:")+e.map(s=>hd(s)).join("|")+")"}function FR(e){return new RegExp(e.toString()+"|").exec("").length-1}function Hte(e,t){const n=e&&e.exec(t);return n&&n.index===0}const $te=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Fk(e,{joinWith:t}){let n=0;return e.map(s=>{n+=1;const r=n;let i=hd(s),a="";for(;i.length>0;){const l=$te.exec(i);if(!l){a+=i;break}a+=i.substring(0,l.index),i=i.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+r):(a+=l[0],l[0]==="("&&n++)}return a}).map(s=>`(${s})`).join(t)}const Gte=/\b\B/,BR="[a-zA-Z]\\w*",Bk="[a-zA-Z_]\\w*",HR="\\b\\d+(\\.\\d+)?",$R="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",GR="\\b(0b[01]+)",Kte="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",qte=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=$l(t,/.*\b/,e.binary,/\b.*/)),pa({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,s)=>{n.index!==0&&s.ignoreMatch()}},e)},pd={begin:"\\\\[\\s\\S]",relevance:0},Yte={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[pd]},Vte={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[pd]},Xte={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Rm=function(e,t,n={}){const s=pa({scope:"comment",begin:e,end:t,contains:[]},n);s.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=Uk("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return s.contains.push({begin:$l(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s},Qte=Rm("//","$"),Wte=Rm("/\\*","\\*/"),Zte=Rm("#","$"),Jte={scope:"number",begin:HR,relevance:0},ene={scope:"number",begin:$R,relevance:0},tne={scope:"number",begin:GR,relevance:0},nne={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[pd,{begin:/\[/,end:/\]/,relevance:0,contains:[pd]}]},sne={scope:"title",begin:BR,relevance:0},rne={scope:"title",begin:Bk,relevance:0},ine={begin:"\\.\\s*"+Bk,relevance:0},ane=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var ih=Object.freeze({__proto__:null,APOS_STRING_MODE:Yte,BACKSLASH_ESCAPE:pd,BINARY_NUMBER_MODE:tne,BINARY_NUMBER_RE:GR,COMMENT:Rm,C_BLOCK_COMMENT_MODE:Wte,C_LINE_COMMENT_MODE:Qte,C_NUMBER_MODE:ene,C_NUMBER_RE:$R,END_SAME_AS_BEGIN:ane,HASH_COMMENT_MODE:Zte,IDENT_RE:BR,MATCH_NOTHING_RE:Gte,METHOD_GUARD:ine,NUMBER_MODE:Jte,NUMBER_RE:HR,PHRASAL_WORDS_MODE:Xte,QUOTE_STRING_MODE:Vte,REGEXP_MODE:nne,RE_STARTERS_RE:Kte,SHEBANG:qte,TITLE_MODE:sne,UNDERSCORE_IDENT_RE:Bk,UNDERSCORE_TITLE_MODE:rne});function lne(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function one(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function cne(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=lne,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function une(e,t){Array.isArray(e.illegal)&&(e.illegal=Uk(...e.illegal))}function dne(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function fne(e,t){e.relevance===void 0&&(e.relevance=1)}const hne=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(s=>{delete e[s]}),e.keywords=n.keywords,e.begin=$l(n.beforeMatch,UR(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},pne=["of","and","for","in","not","or","if","then","parent","list","value"],mne="keyword";function KR(e,t,n=mne){const s=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(i){Object.assign(s,KR(e[i],t,i))}),s;function r(i,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");s[c[0]]=[i,gne(c[0],c[1])]})}}function gne(e,t){return t?Number(t):bne(e)?0:1}function bne(e){return pne.includes(e.toLowerCase())}const n_={},xl=e=>{console.error(e)},s_=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Vl=(e,t)=>{n_[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),n_[`${e}/${t}`]=!0)},Lp=new Error;function qR(e,t,{key:n}){let s=0;const r=e[n],i={},a={};for(let l=1;l<=t.length;l++)a[l+s]=r[l],i[l+s]=!0,s+=FR(t[l-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function xne(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw xl("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Lp;if(typeof e.beginScope!="object"||e.beginScope===null)throw xl("beginScope must be object"),Lp;qR(e,e.begin,{key:"beginScope"}),e.begin=Fk(e.begin,{joinWith:""})}}function yne(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw xl("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Lp;if(typeof e.endScope!="object"||e.endScope===null)throw xl("endScope must be object"),Lp;qR(e,e.end,{key:"endScope"}),e.end=Fk(e.end,{joinWith:""})}}function vne(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function kne(e){vne(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),xne(e),yne(e)}function wne(e){function t(a,l){return new RegExp(hd(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=FR(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(Fk(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(a){const l=new s;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function i(a,l){const c=a;if(a.isCompiled)return c;[one,dne,kne,hne].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[cne,une,fne].forEach(d=>d(a,l)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=KR(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=hd(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return Sne(d==="self"?a:d)})),a.contains.forEach(function(d){i(d,c)}),a.starts&&i(a.starts,l),c.matcher=r(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=pa(e.classNameAliases||{}),i(e)}function YR(e){return e?e.endsWithParent||YR(e.starts):!1}function Sne(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return pa(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:YR(e)?pa(e,{starts:e.starts?pa(e.starts):null}):Object.isFrozen(e)?pa(e):e}var Nne="11.11.2";class Ene extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const f0=zR,r_=pa,i_=Symbol("nomatch"),_ne=7,VR=function(e){const t=Object.create(null),n=Object.create(null),s=[];let r=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:zte};function c(C){return l.noHighlightRe.test(C)}function u(C){let O=C.className+" ";O+=C.parentNode?C.parentNode.className:"";const U=l.languageDetectRe.exec(O);if(U){const F=R(U[1]);return F||(s_(i.replace("{}",U[1])),s_("Falling back to no-highlight mode for this block.",C)),F?U[1]:"no-highlight"}return O.split(/\s+/).find(F=>c(F)||R(F))}function d(C,O,U){let F="",j="";typeof O=="object"?(F=C,U=O.ignoreIllegals,j=O.language):(Vl("10.7.0","highlight(lang, code, ...args) has been deprecated."),Vl("10.7.0",`Please use highlight(code, options) instead.
550
+ https://github.com/highlightjs/highlight.js/issues/2277`),j=C,F=O),U===void 0&&(U=!0);const N={code:F,language:j};I("before:highlight",N);const G=N.result?N.result:f(N.language,N.code,U);return G.code=N.code,I("after:highlight",G),G}function f(C,O,U,F){const j=Object.create(null);function N(ee,ne){return ee.keywords[ne]}function G(){if(!ye.keywords){be.addText($e);return}let ee=0;ye.keywordPatternRe.lastIndex=0;let ne=ye.keywordPatternRe.exec($e),Ce="";for(;ne;){Ce+=$e.substring(ee,ne.index);const v=je.case_insensitive?ne[0].toLowerCase():ne[0],X=N(ye,v);if(X){const[de,xe]=X;if(be.addText(Ce),Ce="",j[v]=(j[v]||0)+1,j[v]<=_ne&&(ft+=xe),de.startsWith("_"))Ce+=ne[0];else{const fe=je.classNameAliases[de]||de;te(ne[0],fe)}}else Ce+=ne[0];ee=ye.keywordPatternRe.lastIndex,ne=ye.keywordPatternRe.exec($e)}Ce+=$e.substring(ee),be.addText(Ce)}function T(){if($e==="")return;let ee=null;if(typeof ye.subLanguage=="string"){if(!t[ye.subLanguage]){be.addText($e);return}ee=f(ye.subLanguage,$e,!0,ge[ye.subLanguage]),ge[ye.subLanguage]=ee._top}else ee=p($e,ye.subLanguage.length?ye.subLanguage:null);ye.relevance>0&&(ft+=ee.relevance),be.__addSublanguage(ee._emitter,ee.language)}function Z(){ye.subLanguage!=null?T():G(),$e=""}function te(ee,ne){ee!==""&&(be.startScope(ne),be.addText(ee),be.endScope())}function Q(ee,ne){let Ce=1;const v=ne.length-1;for(;Ce<=v;){if(!ee._emit[Ce]){Ce++;continue}const X=je.classNameAliases[ee[Ce]]||ee[Ce],de=ne[Ce];X?te(de,X):($e=de,G(),$e=""),Ce++}}function pe(ee,ne){return ee.scope&&typeof ee.scope=="string"&&be.openNode(je.classNameAliases[ee.scope]||ee.scope),ee.beginScope&&(ee.beginScope._wrap?(te($e,je.classNameAliases[ee.beginScope._wrap]||ee.beginScope._wrap),$e=""):ee.beginScope._multi&&(Q(ee.beginScope,ne),$e="")),ye=Object.create(ee,{parent:{value:ye}}),ye}function V(ee,ne,Ce){let v=Hte(ee.endRe,Ce);if(v){if(ee["on:end"]){const X=new JE(ee);ee["on:end"](ne,X),X.isMatchIgnored&&(v=!1)}if(v){for(;ee.endsParent&&ee.parent;)ee=ee.parent;return ee}}if(ee.endsWithParent)return V(ee.parent,ne,Ce)}function q(ee){return ye.matcher.regexIndex===0?($e+=ee[0],1):(nt=!0,0)}function Y(ee){const ne=ee[0],Ce=ee.rule,v=new JE(Ce),X=[Ce.__beforeBegin,Ce["on:begin"]];for(const de of X)if(de&&(de(ee,v),v.isMatchIgnored))return q(ne);return Ce.skip?$e+=ne:(Ce.excludeBegin&&($e+=ne),Z(),!Ce.returnBegin&&!Ce.excludeBegin&&($e=ne)),pe(Ce,ee),Ce.returnBegin?0:ne.length}function J(ee){const ne=ee[0],Ce=O.substring(ee.index),v=V(ye,ee,Ce);if(!v)return i_;const X=ye;ye.endScope&&ye.endScope._wrap?(Z(),te(ne,ye.endScope._wrap)):ye.endScope&&ye.endScope._multi?(Z(),Q(ye.endScope,ee)):X.skip?$e+=ne:(X.returnEnd||X.excludeEnd||($e+=ne),Z(),X.excludeEnd&&($e=ne));do ye.scope&&be.closeNode(),!ye.skip&&!ye.subLanguage&&(ft+=ye.relevance),ye=ye.parent;while(ye!==v.parent);return v.starts&&pe(v.starts,ee),X.returnEnd?0:ne.length}function ce(){const ee=[];for(let ne=ye;ne!==je;ne=ne.parent)ne.scope&&ee.unshift(ne.scope);ee.forEach(ne=>be.openNode(ne))}let ke={};function Ae(ee,ne){const Ce=ne&&ne[0];if($e+=ee,Ce==null)return Z(),0;if(ke.type==="begin"&&ne.type==="end"&&ke.index===ne.index&&Ce===""){if($e+=O.slice(ne.index,ne.index+1),!r){const v=new Error(`0 width match regex (${C})`);throw v.languageName=C,v.badRule=ke.rule,v}return 1}if(ke=ne,ne.type==="begin")return Y(ne);if(ne.type==="illegal"&&!U){const v=new Error('Illegal lexeme "'+Ce+'" for mode "'+(ye.scope||"<unnamed>")+'"');throw v.mode=ye,v}else if(ne.type==="end"){const v=J(ne);if(v!==i_)return v}if(ne.type==="illegal"&&Ce==="")return ne.index===O.length||($e+=`
551
+ `),1;if(rt>1e5&&rt>ne.index*3)throw new Error("potential infinite loop, way more iterations than matches");return $e+=Ce,Ce.length}const je=R(C);if(!je)throw xl(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');const ae=wne(je);let Oe="",ye=F||ae;const ge={},be=new l.__emitter(l);ce();let $e="",ft=0,mt=0,rt=0,nt=!1;try{if(je.__emitTokens)je.__emitTokens(O,be);else{for(ye.matcher.considerAll();;){rt++,nt?nt=!1:ye.matcher.considerAll(),ye.matcher.lastIndex=mt;const ee=ye.matcher.exec(O);if(!ee)break;const ne=O.substring(mt,ee.index),Ce=Ae(ne,ee);mt=ee.index+Ce}Ae(O.substring(mt))}return be.finalize(),Oe=be.toHTML(),{language:C,value:Oe,relevance:ft,illegal:!1,_emitter:be,_top:ye}}catch(ee){if(ee.message&&ee.message.includes("Illegal"))return{language:C,value:f0(O),illegal:!0,relevance:0,_illegalBy:{message:ee.message,index:mt,context:O.slice(mt-100,mt+100),mode:ee.mode,resultSoFar:Oe},_emitter:be};if(r)return{language:C,value:f0(O),illegal:!1,relevance:0,errorRaised:ee,_emitter:be,_top:ye};throw ee}}function h(C){const O={value:f0(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return O._emitter.addText(C),O}function p(C,O){O=O||l.languages||Object.keys(t);const U=h(C),F=O.filter(R).filter(_).map(Z=>f(Z,C,!1));F.unshift(U);const j=F.sort((Z,te)=>{if(Z.relevance!==te.relevance)return te.relevance-Z.relevance;if(Z.language&&te.language){if(R(Z.language).supersetOf===te.language)return 1;if(R(te.language).supersetOf===Z.language)return-1}return 0}),[N,G]=j,T=N;return T.secondBest=G,T}function m(C,O,U){const F=O&&n[O]||U;C.classList.add("hljs"),C.classList.add(`language-${F}`)}function k(C){let O=null;const U=u(C);if(c(U))return;if(I("before:highlightElement",{el:C,language:U}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new Ene("One of your code blocks includes unescaped HTML.",C.innerHTML);O=C;const F=O.textContent,j=U?d(F,{language:U,ignoreIllegals:!0}):p(F);C.innerHTML=j.value,C.dataset.highlighted="yes",m(C,U,j.language),C.result={language:j.language,re:j.relevance,relevance:j.relevance},j.secondBest&&(C.secondBest={language:j.secondBest.language,relevance:j.secondBest.relevance}),I("after:highlightElement",{el:C,result:j,text:F})}function w(C){l=r_(l,C)}const g=()=>{S(),Vl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){S(),Vl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function S(){function C(){S()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",C,!1),b=!0;return}document.querySelectorAll(l.cssSelector).forEach(k)}function M(C,O){let U=null;try{U=O(e)}catch(F){if(xl("Language definition for '{}' could not be registered.".replace("{}",C)),r)xl(F);else throw F;U=a}U.name||(U.name=C),t[C]=U,U.rawDefinition=O.bind(null,e),U.aliases&&D(U.aliases,{languageName:C})}function E(C){delete t[C];for(const O of Object.keys(n))n[O]===C&&delete n[O]}function A(){return Object.keys(t)}function R(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function D(C,{languageName:O}){typeof C=="string"&&(C=[C]),C.forEach(U=>{n[U.toLowerCase()]=O})}function _(C){const O=R(C);return O&&!O.disableAutodetect}function z(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=O=>{C["before:highlightBlock"](Object.assign({block:O.el},O))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=O=>{C["after:highlightBlock"](Object.assign({block:O.el},O))})}function $(C){z(C),s.push(C)}function H(C){const O=s.indexOf(C);O!==-1&&s.splice(O,1)}function I(C,O){const U=C;s.forEach(function(F){F[U]&&F[U](O)})}function L(C){return Vl("10.7.0","highlightBlock will be removed entirely in v12.0"),Vl("10.7.0","Please use highlightElement now."),k(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:S,highlightElement:k,highlightBlock:L,configure:w,initHighlighting:g,initHighlightingOnLoad:y,registerLanguage:M,unregisterLanguage:E,listLanguages:A,getLanguage:R,registerAliases:D,autoDetection:_,inherit:r_,addPlugin:$,removePlugin:H}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=Nne,e.regex={concat:$l,lookahead:UR,either:Uk,optional:Fte,anyNumberOfTimes:Ute};for(const C in ih)typeof ih[C]=="object"&&PR(ih[C]);return Object.assign(e,ih),e},mc=VR({});mc.newInstance=()=>VR({});var Cne=mc;mc.HighlightJS=mc;mc.default=mc;const Tne=vd(Cne),a_={},Ane="hljs-";function Mne(e){const t=Tne.newInstance();return e&&i(e),{highlight:n,highlightAuto:s,listLanguages:r,register:i,registerAlias:a,registered:l};function n(c,u,d){const f=d||a_,h=typeof f.prefix=="string"?f.prefix:Ane;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:jne,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:c});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,k=m.data;return k.language=p.language,k.relevance=p.relevance,m}function s(c,u){const f=(u||a_).subset||r();let h=-1,p=0,m;for(;++h<f.length;){const k=f[h];if(!t.getLanguage(k))continue;const w=n(k,c,u);w.data&&w.data.relevance!==void 0&&w.data.relevance>p&&(p=w.data.relevance,m=w)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function r(){return t.listLanguages()}function i(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function a(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class jne{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],s=n.children[n.children.length-1];s&&s.type==="text"?s.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const s=this.stack[this.stack.length-1],r=t.root.children;n?s.children.push({type:"element",tagName:"span",properties:{className:[n]},children:r}):s.children.push(...r)}openNode(t){const n=this,s=t.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:s},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Rne={};function XR(e){const t=e||Rne,n=t.aliases,s=t.detect||!1,r=t.languages||Dte,i=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=Mne(r);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){jm(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const k=One(h);if(k===!1||!k&&!s||k&&i&&i.includes(k))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const w=iee(h,{whitespace:"pre"});let g;try{g=k?u.highlight(k,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:l})}catch(y){const b=y;if(k&&/Unknown language/.test(b.message)){f.message("Cannot highlight as `"+k+"`, it’s not registered",{ancestors:[m,h],cause:b,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!k&&g.data&&g.data.language&&h.properties.className.push("language-"+g.data.language),g.children.length>0&&(h.children=g.children)})}}function One(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let s;for(;++n<t.length;){const r=String(t[n]);if(r==="no-highlight"||r==="nohighlight")return!1;!s&&r.slice(0,5)==="lang-"&&(s=r.slice(5)),!s&&r.slice(0,9)==="language-"&&(s=r.slice(9))}return s}function Dne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $n={},ah={},Hi={},l_;function rf(){if(l_)return Hi;l_=1;function e(a){return typeof a>"u"||a===null}function t(a){return typeof a=="object"&&a!==null}function n(a){return Array.isArray(a)?a:e(a)?[]:[a]}function s(a,l){if(l){const c=Object.keys(l);for(let u=0,d=c.length;u<d;u+=1){const f=c[u];a[f]=l[f]}}return a}function r(a,l){let c="";for(let u=0;u<l;u+=1)c+=a;return c}function i(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return Hi.isNothing=e,Hi.isObject=t,Hi.toArray=n,Hi.repeat=r,Hi.isNegativeZero=i,Hi.extend=s,Hi}var h0,o_;function af(){if(o_)return h0;o_=1;function e(n,s){let r="";const i=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(r+='in "'+n.mark.name+'" '),r+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!s&&n.mark.snippet&&(r+=`
552
+
553
+ `+n.mark.snippet),i+" "+r):i}function t(n,s){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=s,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(s){return this.name+": "+e(this,s)},h0=t,h0}var p0,c_;function Ine(){if(c_)return p0;c_=1;const e=rf();function t(r,i,a,l,c){let u="",d="";const f=Math.floor(c/2)-1;return l-i>f&&(u=" ... ",i=l-f+u.length),a-l>f&&(d=" ...",a=l+f-d.length),{str:u+r.slice(i,a).replace(/\t/g,"→")+d,pos:l-i+u.length}}function n(r,i){return e.repeat(" ",i-r.length)+r}function s(r,i){if(i=Object.create(i||null),!r.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!="number"&&(i.indent=1),typeof i.linesBefore!="number"&&(i.linesBefore=3),typeof i.linesAfter!="number"&&(i.linesAfter=2);const a=/\r?\n|\r|\0/g,l=[0],c=[];let u,d=-1;for(;u=a.exec(r.buffer);)c.push(u.index),l.push(u.index+u[0].length),r.position<=u.index&&d<0&&(d=l.length-2);d<0&&(d=l.length-1);let f="";const h=Math.min(r.line+i.linesAfter,c.length).toString().length,p=i.maxLength-(i.indent+h+3);for(let k=1;k<=i.linesBefore&&!(d-k<0);k++){const w=t(r.buffer,l[d-k],c[d-k],r.position-(l[d]-l[d-k]),p);f=e.repeat(" ",i.indent)+n((r.line-k+1).toString(),h)+" | "+w.str+`
554
+ `+f}const m=t(r.buffer,l[d],c[d],r.position,p);f+=e.repeat(" ",i.indent)+n((r.line+1).toString(),h)+" | "+m.str+`
555
+ `,f+=e.repeat("-",i.indent+h+3+m.pos)+`^
556
+ `;for(let k=1;k<=i.linesAfter&&!(d+k>=c.length);k++){const w=t(r.buffer,l[d+k],c[d+k],r.position-(l[d]-l[d+k]),p);f+=e.repeat(" ",i.indent)+n((r.line+k+1).toString(),h)+" | "+w.str+`
557
+ `}return f.replace(/\n$/,"")}return p0=s,p0}var m0,u_;function rs(){if(u_)return m0;u_=1;const e=af(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],n=["scalar","sequence","mapping"];function s(i){const a={};return i!==null&&Object.keys(i).forEach(function(l){i[l].forEach(function(c){a[String(c)]=l})}),a}function r(i,a){if(a=a||{},Object.keys(a).forEach(function(l){if(t.indexOf(l)===-1)throw new e('Unknown option "'+l+'" is met in definition of "'+i+'" YAML type.')}),this.options=a,this.tag=i,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(l){return l},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=s(a.styleAliases||null),n.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+i+'" YAML type.')}return m0=r,m0}var g0,d_;function QR(){if(d_)return g0;d_=1;const e=af(),t=rs();function n(i,a){const l=[];return i[a].forEach(function(c){let u=l.length;l.forEach(function(d,f){d.tag===c.tag&&d.kind===c.kind&&d.multi===c.multi&&(u=f)}),l[u]=c}),l}function s(){const i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(l){l.multi?(i.multi[l.kind].push(l),i.multi.fallback.push(l)):i[l.kind][l.tag]=i.fallback[l.tag]=l}for(let l=0,c=arguments.length;l<c;l+=1)arguments[l].forEach(a);return i}function r(i){return this.extend(i)}return r.prototype.extend=function(a){let l=[],c=[];if(a instanceof t)c.push(a);else if(Array.isArray(a))c=c.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(l=l.concat(a.implicit)),a.explicit&&(c=c.concat(a.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");l.forEach(function(d){if(!(d instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(d.loadKind&&d.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(d.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),c.forEach(function(d){if(!(d instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const u=Object.create(r.prototype);return u.implicit=(this.implicit||[]).concat(l),u.explicit=(this.explicit||[]).concat(c),u.compiledImplicit=n(u,"implicit"),u.compiledExplicit=n(u,"explicit"),u.compiledTypeMap=s(u.compiledImplicit,u.compiledExplicit),u},g0=r,g0}var b0,f_;function WR(){if(f_)return b0;f_=1;const e=rs();return b0=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),b0}var x0,h_;function ZR(){if(h_)return x0;h_=1;const e=rs();return x0=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),x0}var y0,p_;function JR(){if(p_)return y0;p_=1;const e=rs();return y0=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),y0}var v0,m_;function eO(){if(m_)return v0;m_=1;const e=QR();return v0=new e({explicit:[WR(),ZR(),JR()]}),v0}var k0,g_;function tO(){if(g_)return k0;g_=1;const e=rs();function t(r){if(r===null)return!0;const i=r.length;return i===1&&r==="~"||i===4&&(r==="null"||r==="Null"||r==="NULL")}function n(){return null}function s(r){return r===null}return k0=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:n,predicate:s,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),k0}var w0,b_;function nO(){if(b_)return w0;b_=1;const e=rs();function t(r){if(r===null)return!1;const i=r.length;return i===4&&(r==="true"||r==="True"||r==="TRUE")||i===5&&(r==="false"||r==="False"||r==="FALSE")}function n(r){return r==="true"||r==="True"||r==="TRUE"}function s(r){return Object.prototype.toString.call(r)==="[object Boolean]"}return w0=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:n,predicate:s,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE":"FALSE"},camelcase:function(r){return r?"True":"False"}},defaultStyle:"lowercase"}),w0}var S0,x_;function sO(){if(x_)return S0;x_=1;const e=rf(),t=rs();function n(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}function s(u){return u>=48&&u<=55}function r(u){return u>=48&&u<=57}function i(u){if(u===null)return!1;const d=u.length;let f=0,h=!1;if(!d)return!1;let p=u[f];if((p==="-"||p==="+")&&(p=u[++f]),p==="0"){if(f+1===d)return!0;if(p=u[++f],p==="b"){for(f++;f<d;f++){if(p=u[f],p!=="0"&&p!=="1")return!1;h=!0}return h&&isFinite(a(u))}if(p==="x"){for(f++;f<d;f++){if(!n(u.charCodeAt(f)))return!1;h=!0}return h&&isFinite(a(u))}if(p==="o"){for(f++;f<d;f++){if(!s(u.charCodeAt(f)))return!1;h=!0}return h&&isFinite(a(u))}}for(;f<d;f++){if(!r(u.charCodeAt(f)))return!1;h=!0}return h?isFinite(a(u)):!1}function a(u){let d=u,f=1,h=d[0];if((h==="-"||h==="+")&&(h==="-"&&(f=-1),d=d.slice(1),h=d[0]),d==="0")return 0;if(h==="0"){if(d[1]==="b")return f*parseInt(d.slice(2),2);if(d[1]==="x")return f*parseInt(d.slice(2),16);if(d[1]==="o")return f*parseInt(d.slice(2),8)}return f*parseInt(d,10)}function l(u){return a(u)}function c(u){return Object.prototype.toString.call(u)==="[object Number]"&&u%1===0&&!e.isNegativeZero(u)}return S0=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:i,construct:l,predicate:c,represent:{binary:function(u){return u>=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},octal:function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},decimal:function(u){return u.toString(10)},hexadecimal:function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),S0}var N0,y_;function rO(){if(y_)return N0;y_=1;const e=rf(),t=rs(),n=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function r(u){return u===null||!n.test(u)?!1:isFinite(parseFloat(u,10))?!0:s.test(u)}function i(u){let d=u.toLowerCase();const f=d[0]==="-"?-1:1;return"+-".indexOf(d[0])>=0&&(d=d.slice(1)),d===".inf"?f===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:d===".nan"?NaN:f*parseFloat(d,10)}const a=/^[-+]?[0-9]+e/;function l(u,d){if(isNaN(u))switch(d){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(d){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(d){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(u))return"-0.0";const f=u.toString(10);return a.test(f)?f.replace("e",".e"):f}function c(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||e.isNegativeZero(u))}return N0=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:r,construct:i,predicate:c,represent:l,defaultStyle:"lowercase"}),N0}var E0,v_;function iO(){return v_||(v_=1,E0=eO().extend({implicit:[tO(),nO(),sO(),rO()]})),E0}var _0,k_;function aO(){return k_||(k_=1,_0=iO()),_0}var C0,w_;function lO(){if(w_)return C0;w_=1;const e=rs(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function s(a){return a===null?!1:t.exec(a)!==null||n.exec(a)!==null}function r(a){let l=0,c=null,u=t.exec(a);if(u===null&&(u=n.exec(a)),u===null)throw new Error("Date resolve error");const d=+u[1],f=+u[2]-1,h=+u[3];if(!u[4])return new Date(Date.UTC(d,f,h));const p=+u[4],m=+u[5],k=+u[6];if(u[7]){for(l=u[7].slice(0,3);l.length<3;)l+="0";l=+l}if(u[9]){const g=+u[10],y=+(u[11]||0);c=(g*60+y)*6e4,u[9]==="-"&&(c=-c)}const w=new Date(Date.UTC(d,f,h,p,m,k,l));return c&&w.setTime(w.getTime()-c),w}function i(a){return a.toISOString()}return C0=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:s,construct:r,instanceOf:Date,represent:i}),C0}var T0,S_;function oO(){if(S_)return T0;S_=1;const e=rs();function t(n){return n==="<<"||n===null}return T0=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),T0}var A0,N_;function cO(){if(N_)return A0;N_=1;const e=rs(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
558
+ \r`;function n(a){if(a===null)return!1;let l=0;const c=a.length,u=t;for(let d=0;d<c;d++){const f=u.indexOf(a.charAt(d));if(!(f>64)){if(f<0)return!1;l+=6}}return l%8===0}function s(a){const l=a.replace(/[\r\n=]/g,""),c=l.length,u=t;let d=0;const f=[];for(let p=0;p<c;p++)p%4===0&&p&&(f.push(d>>16&255),f.push(d>>8&255),f.push(d&255)),d=d<<6|u.indexOf(l.charAt(p));const h=c%4*6;return h===0?(f.push(d>>16&255),f.push(d>>8&255),f.push(d&255)):h===18?(f.push(d>>10&255),f.push(d>>2&255)):h===12&&f.push(d>>4&255),new Uint8Array(f)}function r(a){let l="",c=0;const u=a.length,d=t;for(let h=0;h<u;h++)h%3===0&&h&&(l+=d[c>>18&63],l+=d[c>>12&63],l+=d[c>>6&63],l+=d[c&63]),c=(c<<8)+a[h];const f=u%3;return f===0?(l+=d[c>>18&63],l+=d[c>>12&63],l+=d[c>>6&63],l+=d[c&63]):f===2?(l+=d[c>>10&63],l+=d[c>>4&63],l+=d[c<<2&63],l+=d[64]):f===1&&(l+=d[c>>2&63],l+=d[c<<4&63],l+=d[64],l+=d[64]),l}function i(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return A0=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:s,predicate:i,represent:r}),A0}var M0,E_;function uO(){if(E_)return M0;E_=1;const e=rs(),t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function s(i){if(i===null)return!0;const a={},l=i;for(let c=0,u=l.length;c<u;c+=1){const d=l[c];let f=!1;if(n.call(d)!=="[object Object]")return!1;let h;for(h in d)if(t.call(d,h))if(!f)f=!0;else return!1;if(!f||t.call(a,h))return!1;Object.defineProperty(a,h,{value:!0})}return!0}function r(i){return i!==null?i:[]}return M0=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:s,construct:r}),M0}var j0,__;function dO(){if(__)return j0;__=1;const e=rs(),t=Object.prototype.toString;function n(r){if(r===null)return!0;const i=r,a=new Array(i.length);for(let l=0,c=i.length;l<c;l+=1){const u=i[l];if(t.call(u)!=="[object Object]")return!1;const d=Object.keys(u);if(d.length!==1)return!1;a[l]=[d[0],u[d[0]]]}return!0}function s(r){if(r===null)return[];const i=r,a=new Array(i.length);for(let l=0,c=i.length;l<c;l+=1){const u=i[l],d=Object.keys(u);a[l]=[d[0],u[d[0]]]}return a}return j0=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:s}),j0}var R0,C_;function fO(){if(C_)return R0;C_=1;const e=rs(),t=Object.prototype.hasOwnProperty;function n(r){if(r===null)return!0;const i=r;for(const a in i)if(t.call(i,a)&&i[a]!==null)return!1;return!0}function s(r){return r!==null?r:{}}return R0=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:n,construct:s}),R0}var O0,T_;function Hk(){return T_||(T_=1,O0=aO().extend({implicit:[lO(),oO()],explicit:[cO(),uO(),dO(),fO()]})),O0}var A_;function Lne(){if(A_)return ah;A_=1;const e=rf(),t=af(),n=Ine(),s=Hk(),r=Object.prototype.hasOwnProperty,i=1,a=2,l=3,c=4,u=1,d=2,f=3,h=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,p=/[\x85\u2028\u2029]/,m=/[,\[\]{}]/,k=/^(?:!|!!|![0-9A-Za-z-]+!)$/,w=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function g(v){return Object.prototype.toString.call(v)}function y(v){return v===10||v===13}function b(v){return v===9||v===32}function S(v){return v===9||v===32||v===10||v===13}function M(v){return v===44||v===91||v===93||v===123||v===125}function E(v){if(v>=48&&v<=57)return v-48;const X=v|32;return X>=97&&X<=102?X-97+10:-1}function A(v){return v===120?2:v===117?4:v===85?8:0}function R(v){return v>=48&&v<=57?v-48:-1}function D(v){switch(v){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
559
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function _(v){return v<=65535?String.fromCharCode(v):String.fromCharCode((v-65536>>10)+55296,(v-65536&1023)+56320)}function z(v,X,de){X==="__proto__"?Object.defineProperty(v,X,{configurable:!0,enumerable:!0,writable:!0,value:de}):v[X]=de}const $=new Array(256),H=new Array(256);for(let v=0;v<256;v++)$[v]=D(v)?1:0,H[v]=D(v);function I(v,X){this.input=v,this.filename=X.filename||null,this.schema=X.schema||s,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,this.maxDepth=typeof X.maxDepth=="number"?X.maxDepth:100,this.maxTotalMergeKeys=typeof X.maxTotalMergeKeys=="number"?X.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=v.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function L(v,X){const de={name:v.filename,buffer:v.input.slice(0,-1),position:v.position,line:v.line,column:v.position-v.lineStart};return de.snippet=n(de),new t(X,de)}function C(v,X){throw L(v,X)}function O(v,X){v.onWarning&&v.onWarning.call(null,L(v,X))}function U(v,X,de){const xe=v.anchorMapTransactions;if(xe.length!==0){const fe=xe[xe.length-1];r.call(fe,X)||(fe[X]={existed:r.call(v.anchorMap,X),value:v.anchorMap[X]})}v.anchorMap[X]=de}function F(v){v.anchorMapTransactions.push(Object.create(null))}function j(v){const X=v.anchorMapTransactions.pop(),de=v.anchorMapTransactions;if(de.length===0)return;const xe=de[de.length-1],fe=Object.keys(X);for(let P=0,oe=fe.length;P<oe;P+=1){const le=fe[P];r.call(xe,le)||(xe[le]=X[le])}}function N(v){const X=v.anchorMapTransactions.pop(),de=Object.keys(X);for(let xe=de.length-1;xe>=0;xe-=1){const fe=X[de[xe]];fe.existed?v.anchorMap[de[xe]]=fe.value:delete v.anchorMap[de[xe]]}}function G(v){return{position:v.position,line:v.line,lineStart:v.lineStart,lineIndent:v.lineIndent,firstTabInLine:v.firstTabInLine,tag:v.tag,anchor:v.anchor,kind:v.kind,result:v.result}}function T(v,X){v.position=X.position,v.line=X.line,v.lineStart=X.lineStart,v.lineIndent=X.lineIndent,v.firstTabInLine=X.firstTabInLine,v.tag=X.tag,v.anchor=X.anchor,v.kind=X.kind,v.result=X.result}const Z={YAML:function(X,de,xe){X.version!==null&&C(X,"duplication of %YAML directive"),xe.length!==1&&C(X,"YAML directive accepts exactly one argument");const fe=/^([0-9]+)\.([0-9]+)$/.exec(xe[0]);fe===null&&C(X,"ill-formed argument of the YAML directive");const P=parseInt(fe[1],10),oe=parseInt(fe[2],10);P!==1&&C(X,"unacceptable YAML version of the document"),X.version=xe[0],X.checkLineBreaks=oe<2,oe!==1&&oe!==2&&O(X,"unsupported YAML version of the document")},TAG:function(X,de,xe){let fe;xe.length!==2&&C(X,"TAG directive accepts exactly two arguments");const P=xe[0];fe=xe[1],k.test(P)||C(X,"ill-formed tag handle (first argument) of the TAG directive"),r.call(X.tagMap,P)&&C(X,'there is a previously declared suffix for "'+P+'" tag handle'),w.test(fe)||C(X,"ill-formed tag prefix (second argument) of the TAG directive");try{fe=decodeURIComponent(fe)}catch{C(X,"tag prefix is malformed: "+fe)}X.tagMap[P]=fe}};function te(v,X,de,xe){if(X<de){const fe=v.input.slice(X,de);if(xe)for(let P=0,oe=fe.length;P<oe;P+=1){const le=fe.charCodeAt(P);le===9||le>=32&&le<=1114111||C(v,"expected valid JSON character")}else h.test(fe)&&C(v,"the stream contains non-printable characters");v.result+=fe}}function Q(v){v.totalMergeKeys++,v.maxTotalMergeKeys!==-1&&v.totalMergeKeys>v.maxTotalMergeKeys&&C(v,"merge keys exceeded maxTotalMergeKeys ("+v.maxTotalMergeKeys+")")}function pe(v,X,de,xe){e.isObject(de)||C(v,"cannot merge mappings; the provided source object is unacceptable"),Q(v);const fe=Object.keys(de);for(let P=0,oe=fe.length;P<oe;P+=1){const le=fe[P];Q(v),r.call(X,le)||(z(X,le,de[le]),xe[le]=!0)}}function V(v,X,de,xe,fe,P,oe,le,ve){if(Array.isArray(fe)){fe=Array.prototype.slice.call(fe);for(let Se=0,Ne=fe.length;Se<Ne;Se+=1)Array.isArray(fe[Se])&&C(v,"nested arrays are not supported inside keys"),typeof fe=="object"&&g(fe[Se])==="[object Object]"&&(fe[Se]="[object Object]")}if(typeof fe=="object"&&g(fe)==="[object Object]"&&(fe="[object Object]"),fe=String(fe),X===null&&(X={}),xe==="tag:yaml.org,2002:merge")if(Array.isArray(P)){P.length>100&&C(v,"abnormal merge sequence size");for(let Se=0,Ne=P.length;Se<Ne;Se+=1)pe(v,X,P[Se],de)}else pe(v,X,P,de);else!v.json&&!r.call(de,fe)&&r.call(X,fe)&&(v.line=oe||v.line,v.lineStart=le||v.lineStart,v.position=ve||v.position,C(v,"duplicated mapping key")),z(X,fe,P),delete de[fe];return X}function q(v){const X=v.input.charCodeAt(v.position);X===10?v.position++:X===13?(v.position++,v.input.charCodeAt(v.position)===10&&v.position++):C(v,"a line break is expected"),v.line+=1,v.lineStart=v.position,v.firstTabInLine=-1}function Y(v,X,de){let xe=0,fe=v.input.charCodeAt(v.position);for(;fe!==0;){for(;b(fe);)fe===9&&v.firstTabInLine===-1&&(v.firstTabInLine=v.position),fe=v.input.charCodeAt(++v.position);if(X&&fe===35)do fe=v.input.charCodeAt(++v.position);while(fe!==10&&fe!==13&&fe!==0);if(y(fe))for(q(v),fe=v.input.charCodeAt(v.position),xe++,v.lineIndent=0;fe===32;)v.lineIndent++,fe=v.input.charCodeAt(++v.position);else break}return de!==-1&&xe!==0&&v.lineIndent<de&&O(v,"deficient indentation"),xe}function J(v){let X=v.position,de=v.input.charCodeAt(X);return!!((de===45||de===46)&&de===v.input.charCodeAt(X+1)&&de===v.input.charCodeAt(X+2)&&(X+=3,de=v.input.charCodeAt(X),de===0||S(de)))}function ce(v,X){X===1?v.result+=" ":X>1&&(v.result+=e.repeat(`
560
+ `,X-1))}function ke(v,X,de){let xe,fe,P,oe,le,ve;const Se=v.kind,Ne=v.result;let ue=v.input.charCodeAt(v.position);if(S(ue)||M(ue)||ue===35||ue===38||ue===42||ue===33||ue===124||ue===62||ue===39||ue===34||ue===37||ue===64||ue===96)return!1;if(ue===63||ue===45){const _e=v.input.charCodeAt(v.position+1);if(S(_e)||de&&M(_e))return!1}for(v.kind="scalar",v.result="",xe=fe=v.position,P=!1;ue!==0;){if(ue===58){const _e=v.input.charCodeAt(v.position+1);if(S(_e)||de&&M(_e))break}else if(ue===35){const _e=v.input.charCodeAt(v.position-1);if(S(_e))break}else{if(v.position===v.lineStart&&J(v)||de&&M(ue))break;if(y(ue))if(oe=v.line,le=v.lineStart,ve=v.lineIndent,Y(v,!1,-1),v.lineIndent>=X){P=!0,ue=v.input.charCodeAt(v.position);continue}else{v.position=fe,v.line=oe,v.lineStart=le,v.lineIndent=ve;break}}P&&(te(v,xe,fe,!1),ce(v,v.line-oe),xe=fe=v.position,P=!1),b(ue)||(fe=v.position+1),ue=v.input.charCodeAt(++v.position)}return te(v,xe,fe,!1),v.result?!0:(v.kind=Se,v.result=Ne,!1)}function Ae(v,X){let de,xe,fe=v.input.charCodeAt(v.position);if(fe!==39)return!1;for(v.kind="scalar",v.result="",v.position++,de=xe=v.position;(fe=v.input.charCodeAt(v.position))!==0;)if(fe===39)if(te(v,de,v.position,!0),fe=v.input.charCodeAt(++v.position),fe===39)de=v.position,v.position++,xe=v.position;else return!0;else y(fe)?(te(v,de,xe,!0),ce(v,Y(v,!1,X)),de=xe=v.position):v.position===v.lineStart&&J(v)?C(v,"unexpected end of the document within a single quoted scalar"):(v.position++,b(fe)||(xe=v.position));C(v,"unexpected end of the stream within a single quoted scalar")}function je(v,X){let de,xe,fe,P=v.input.charCodeAt(v.position);if(P!==34)return!1;for(v.kind="scalar",v.result="",v.position++,de=xe=v.position;(P=v.input.charCodeAt(v.position))!==0;){if(P===34)return te(v,de,v.position,!0),v.position++,!0;if(P===92){if(te(v,de,v.position,!0),P=v.input.charCodeAt(++v.position),y(P))Y(v,!1,X);else if(P<256&&$[P])v.result+=H[P],v.position++;else if((fe=A(P))>0){let oe=fe,le=0;for(;oe>0;oe--)P=v.input.charCodeAt(++v.position),(fe=E(P))>=0?le=(le<<4)+fe:C(v,"expected hexadecimal character");v.result+=_(le),v.position++}else C(v,"unknown escape sequence");de=xe=v.position}else y(P)?(te(v,de,xe,!0),ce(v,Y(v,!1,X)),de=xe=v.position):v.position===v.lineStart&&J(v)?C(v,"unexpected end of the document within a double quoted scalar"):(v.position++,b(P)||(xe=v.position))}C(v,"unexpected end of the stream within a double quoted scalar")}function ae(v,X){let de=!0,xe,fe,P;const oe=v.tag;let le;const ve=v.anchor;let Se,Ne,ue,_e;const Me=Object.create(null);let Fe,De,He,Ge=v.input.charCodeAt(v.position);if(Ge===91)Se=93,_e=!1,le=[];else if(Ge===123)Se=125,_e=!0,le={};else return!1;for(v.anchor!==null&&U(v,v.anchor,le),Ge=v.input.charCodeAt(++v.position);Ge!==0;){if(Y(v,!0,X),Ge=v.input.charCodeAt(v.position),Ge===Se)return v.position++,v.tag=oe,v.anchor=ve,v.kind=_e?"mapping":"sequence",v.result=le,!0;if(de?Ge===44&&C(v,"expected the node content, but found ','"):C(v,"missed comma between flow collection entries"),De=Fe=He=null,Ne=ue=!1,Ge===63){const xt=v.input.charCodeAt(v.position+1);S(xt)&&(Ne=ue=!0,v.position++,Y(v,!0,X))}xe=v.line,fe=v.lineStart,P=v.position,rt(v,X,i,!1,!0),De=v.tag,Fe=v.result,Y(v,!0,X),Ge=v.input.charCodeAt(v.position),(ue||v.line===xe)&&Ge===58&&(Ne=!0,Ge=v.input.charCodeAt(++v.position),Y(v,!0,X),rt(v,X,i,!1,!0),He=v.result),_e?V(v,le,Me,De,Fe,He,xe,fe,P):Ne?le.push(V(v,null,Me,De,Fe,He,xe,fe,P)):le.push(Fe),Y(v,!0,X),Ge=v.input.charCodeAt(v.position),Ge===44?(de=!0,Ge=v.input.charCodeAt(++v.position)):de=!1}C(v,"unexpected end of the stream within a flow collection")}function Oe(v,X){let de,xe=u,fe=!1,P=!1,oe=X,le=0,ve=!1,Se,Ne=v.input.charCodeAt(v.position);if(Ne===124)de=!1;else if(Ne===62)de=!0;else return!1;for(v.kind="scalar",v.result="";Ne!==0;)if(Ne=v.input.charCodeAt(++v.position),Ne===43||Ne===45)u===xe?xe=Ne===43?f:d:C(v,"repeat of a chomping mode identifier");else if((Se=R(Ne))>=0)Se===0?C(v,"bad explicit indentation width of a block scalar; it cannot be less than one"):P?C(v,"repeat of an indentation width identifier"):(oe=X+Se-1,P=!0);else break;if(b(Ne)){do Ne=v.input.charCodeAt(++v.position);while(b(Ne));if(Ne===35)do Ne=v.input.charCodeAt(++v.position);while(!y(Ne)&&Ne!==0)}for(;Ne!==0;){for(q(v),v.lineIndent=0,Ne=v.input.charCodeAt(v.position);(!P||v.lineIndent<oe)&&Ne===32;)v.lineIndent++,Ne=v.input.charCodeAt(++v.position);if(!P&&v.lineIndent>oe&&(oe=v.lineIndent),y(Ne)){le++;continue}if(!P&&oe===0&&C(v,"missing indentation for block scalar"),v.lineIndent<oe){xe===f?v.result+=e.repeat(`
561
+ `,fe?1+le:le):xe===u&&fe&&(v.result+=`
562
+ `);break}de?b(Ne)?(ve=!0,v.result+=e.repeat(`
563
+ `,fe?1+le:le)):ve?(ve=!1,v.result+=e.repeat(`
564
+ `,le+1)):le===0?fe&&(v.result+=" "):v.result+=e.repeat(`
565
+ `,le):v.result+=e.repeat(`
566
+ `,fe?1+le:le),fe=!0,P=!0,le=0;const ue=v.position;for(;!y(Ne)&&Ne!==0;)Ne=v.input.charCodeAt(++v.position);te(v,ue,v.position,!1)}return!0}function ye(v,X){const de=v.tag,xe=v.anchor,fe=[];let P=!1;if(v.firstTabInLine!==-1)return!1;v.anchor!==null&&U(v,v.anchor,fe);let oe=v.input.charCodeAt(v.position);for(;oe!==0&&(v.firstTabInLine!==-1&&(v.position=v.firstTabInLine,C(v,"tab characters must not be used in indentation")),oe===45);){const le=v.input.charCodeAt(v.position+1);if(!S(le))break;if(P=!0,v.position++,Y(v,!0,-1)&&v.lineIndent<=X){fe.push(null),oe=v.input.charCodeAt(v.position);continue}const ve=v.line;if(rt(v,X,l,!1,!0),fe.push(v.result),Y(v,!0,-1),oe=v.input.charCodeAt(v.position),(v.line===ve||v.lineIndent>X)&&oe!==0)C(v,"bad indentation of a sequence entry");else if(v.lineIndent<X)break}return P?(v.tag=de,v.anchor=xe,v.kind="sequence",v.result=fe,!0):!1}function ge(v,X,de){let xe,fe,P,oe;const le=v.tag,ve=v.anchor,Se={},Ne=Object.create(null);let ue=null,_e=null,Me=null,Fe=!1,De=!1;if(v.firstTabInLine!==-1)return!1;v.anchor!==null&&U(v,v.anchor,Se);let He=v.input.charCodeAt(v.position);for(;He!==0;){!Fe&&v.firstTabInLine!==-1&&(v.position=v.firstTabInLine,C(v,"tab characters must not be used in indentation"));const Ge=v.input.charCodeAt(v.position+1),xt=v.line;if((He===63||He===58)&&S(Ge))He===63?(Fe&&(V(v,Se,Ne,ue,_e,null,fe,P,oe),ue=_e=Me=null),De=!0,Fe=!0,xe=!0):Fe?(Fe=!1,xe=!0):C(v,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),v.position+=1,He=Ge;else{if(fe=v.line,P=v.lineStart,oe=v.position,!rt(v,de,a,!1,!0))break;if(v.line===xt){for(He=v.input.charCodeAt(v.position);b(He);)He=v.input.charCodeAt(++v.position);if(He===58)He=v.input.charCodeAt(++v.position),S(He)||C(v,"a whitespace character is expected after the key-value separator within a block mapping"),Fe&&(V(v,Se,Ne,ue,_e,null,fe,P,oe),ue=_e=Me=null),De=!0,Fe=!1,xe=!1,ue=v.tag,_e=v.result;else if(De)C(v,"can not read an implicit mapping pair; a colon is missed");else return v.tag=le,v.anchor=ve,!0}else if(De)C(v,"can not read a block mapping entry; a multiline key may not be an implicit key");else return v.tag=le,v.anchor=ve,!0}if((v.line===xt||v.lineIndent>X)&&(Fe&&(fe=v.line,P=v.lineStart,oe=v.position),rt(v,X,c,!0,xe)&&(Fe?_e=v.result:Me=v.result),Fe||(V(v,Se,Ne,ue,_e,Me,fe,P,oe),ue=_e=Me=null),Y(v,!0,-1),He=v.input.charCodeAt(v.position)),(v.line===xt||v.lineIndent>X)&&He!==0)C(v,"bad indentation of a mapping entry");else if(v.lineIndent<X)break}return Fe&&V(v,Se,Ne,ue,_e,null,fe,P,oe),De&&(v.tag=le,v.anchor=ve,v.kind="mapping",v.result=Se),De}function be(v){let X=!1,de=!1,xe,fe,P=v.input.charCodeAt(v.position);if(P!==33)return!1;v.tag!==null&&C(v,"duplication of a tag property"),P=v.input.charCodeAt(++v.position),P===60?(X=!0,P=v.input.charCodeAt(++v.position)):P===33?(de=!0,xe="!!",P=v.input.charCodeAt(++v.position)):xe="!";let oe=v.position;if(X){do P=v.input.charCodeAt(++v.position);while(P!==0&&P!==62);v.position<v.length?(fe=v.input.slice(oe,v.position),P=v.input.charCodeAt(++v.position)):C(v,"unexpected end of the stream within a verbatim tag")}else{for(;P!==0&&!S(P);)P===33&&(de?C(v,"tag suffix cannot contain exclamation marks"):(xe=v.input.slice(oe-1,v.position+1),k.test(xe)||C(v,"named tag handle cannot contain such characters"),de=!0,oe=v.position+1)),P=v.input.charCodeAt(++v.position);fe=v.input.slice(oe,v.position),m.test(fe)&&C(v,"tag suffix cannot contain flow indicator characters")}fe&&!w.test(fe)&&C(v,"tag name cannot contain such characters: "+fe);try{fe=decodeURIComponent(fe)}catch{C(v,"tag name is malformed: "+fe)}return X?v.tag=fe:r.call(v.tagMap,xe)?v.tag=v.tagMap[xe]+fe:xe==="!"?v.tag="!"+fe:xe==="!!"?v.tag="tag:yaml.org,2002:"+fe:C(v,'undeclared tag handle "'+xe+'"'),!0}function $e(v){let X=v.input.charCodeAt(v.position);if(X!==38)return!1;v.anchor!==null&&C(v,"duplication of an anchor property"),X=v.input.charCodeAt(++v.position);const de=v.position;for(;X!==0&&!S(X)&&!M(X);)X=v.input.charCodeAt(++v.position);return v.position===de&&C(v,"name of an anchor node must contain at least one character"),v.anchor=v.input.slice(de,v.position),!0}function ft(v){let X=v.input.charCodeAt(v.position);if(X!==42)return!1;X=v.input.charCodeAt(++v.position);const de=v.position;for(;X!==0&&!S(X)&&!M(X);)X=v.input.charCodeAt(++v.position);v.position===de&&C(v,"name of an alias node must contain at least one character");const xe=v.input.slice(de,v.position);return r.call(v.anchorMap,xe)||C(v,'unidentified alias "'+xe+'"'),v.result=v.anchorMap[xe],Y(v,!0,-1),!0}function mt(v,X,de,xe){const fe=G(v);return F(v),T(v,X),v.tag=null,v.anchor=null,v.kind=null,v.result=null,ge(v,de,xe)&&v.kind==="mapping"?(j(v),!0):(N(v),T(v,fe),!1)}function rt(v,X,de,xe,fe){let P,oe,le=1,ve=!1,Se=!1,Ne=null,ue,_e,Me;v.depth>=v.maxDepth&&C(v,"nesting exceeded maxDepth ("+v.maxDepth+")"),v.depth+=1,v.listener!==null&&v.listener("open",v),v.tag=null,v.anchor=null,v.kind=null,v.result=null;const Fe=P=oe=c===de||l===de;if(xe&&Y(v,!0,-1)&&(ve=!0,v.lineIndent>X?le=1:v.lineIndent===X?le=0:v.lineIndent<X&&(le=-1)),le===1)for(;;){const De=v.input.charCodeAt(v.position),He=G(v);if(ve&&(De===33&&v.tag!==null||De===38&&v.anchor!==null)||!be(v)&&!$e(v))break;Ne===null&&(Ne=He),Y(v,!0,-1)?(ve=!0,oe=Fe,v.lineIndent>X?le=1:v.lineIndent===X?le=0:v.lineIndent<X&&(le=-1)):oe=!1}if(oe&&(oe=ve||fe),le===1||c===de)if(i===de||a===de?_e=X:_e=X+1,Me=v.position-v.lineStart,le===1)if(oe&&(ye(v,Me)||ge(v,Me,_e))||ae(v,_e))Se=!0;else{const De=v.input.charCodeAt(v.position);Ne!==null&&Fe&&!oe&&De!==124&&De!==62&&mt(v,Ne,Ne.position-Ne.lineStart,_e)||P&&Oe(v,_e)||Ae(v,_e)||je(v,_e)?Se=!0:ft(v)?(Se=!0,(v.tag!==null||v.anchor!==null)&&C(v,"alias node should not have any properties")):ke(v,_e,i===de)&&(Se=!0,v.tag===null&&(v.tag="?")),v.anchor!==null&&U(v,v.anchor,v.result)}else le===0&&(Se=oe&&ye(v,Me));if(v.tag===null)v.anchor!==null&&U(v,v.anchor,v.result);else if(v.tag==="?"){v.result!==null&&v.kind!=="scalar"&&C(v,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+v.kind+'"');for(let De=0,He=v.implicitTypes.length;De<He;De+=1)if(ue=v.implicitTypes[De],ue.resolve(v.result)){v.result=ue.construct(v.result),v.tag=ue.tag,v.anchor!==null&&U(v,v.anchor,v.result);break}}else if(v.tag!=="!"){if(r.call(v.typeMap[v.kind||"fallback"],v.tag))ue=v.typeMap[v.kind||"fallback"][v.tag];else{ue=null;const De=v.typeMap.multi[v.kind||"fallback"];for(let He=0,Ge=De.length;He<Ge;He+=1)if(v.tag.slice(0,De[He].tag.length)===De[He].tag){ue=De[He];break}}ue||C(v,"unknown tag !<"+v.tag+">"),v.result!==null&&ue.kind!==v.kind&&C(v,"unacceptable node kind for !<"+v.tag+'> tag; it should be "'+ue.kind+'", not "'+v.kind+'"'),ue.resolve(v.result,v.tag)?(v.result=ue.construct(v.result,v.tag),v.anchor!==null&&U(v,v.anchor,v.result)):C(v,"cannot resolve a node with !<"+v.tag+"> explicit tag")}return v.listener!==null&&v.listener("close",v),v.depth-=1,v.tag!==null||v.anchor!==null||Se}function nt(v){const X=v.position;let de=!1,xe;for(v.version=null,v.checkLineBreaks=v.legacy,v.tagMap=Object.create(null),v.anchorMap=Object.create(null);(xe=v.input.charCodeAt(v.position))!==0&&(Y(v,!0,-1),xe=v.input.charCodeAt(v.position),!(v.lineIndent>0||xe!==37));){de=!0,xe=v.input.charCodeAt(++v.position);let fe=v.position;for(;xe!==0&&!S(xe);)xe=v.input.charCodeAt(++v.position);const P=v.input.slice(fe,v.position),oe=[];for(P.length<1&&C(v,"directive name must not be less than one character in length");xe!==0;){for(;b(xe);)xe=v.input.charCodeAt(++v.position);if(xe===35){do xe=v.input.charCodeAt(++v.position);while(xe!==0&&!y(xe));break}if(y(xe))break;for(fe=v.position;xe!==0&&!S(xe);)xe=v.input.charCodeAt(++v.position);oe.push(v.input.slice(fe,v.position))}xe!==0&&q(v),r.call(Z,P)?Z[P](v,P,oe):O(v,'unknown document directive "'+P+'"')}if(Y(v,!0,-1),v.lineIndent===0&&v.input.charCodeAt(v.position)===45&&v.input.charCodeAt(v.position+1)===45&&v.input.charCodeAt(v.position+2)===45?(v.position+=3,Y(v,!0,-1)):de&&C(v,"directives end mark is expected"),rt(v,v.lineIndent-1,c,!1,!0),Y(v,!0,-1),v.checkLineBreaks&&p.test(v.input.slice(X,v.position))&&O(v,"non-ASCII line breaks are interpreted as content"),v.documents.push(v.result),v.position===v.lineStart&&J(v)){v.input.charCodeAt(v.position)===46&&(v.position+=3,Y(v,!0,-1));return}v.position<v.length-1&&C(v,"end of the stream or a document separator is expected")}function ee(v,X){v=String(v),X=X||{},v.length!==0&&(v.charCodeAt(v.length-1)!==10&&v.charCodeAt(v.length-1)!==13&&(v+=`
567
+ `),v.charCodeAt(0)===65279&&(v=v.slice(1)));const de=new I(v,X),xe=v.indexOf("\0");for(xe!==-1&&(de.position=xe,C(de,"null byte is not allowed in input")),de.input+="\0";de.input.charCodeAt(de.position)===32;)de.lineIndent+=1,de.position+=1;for(;de.position<de.length-1;)nt(de);return de.documents}function ne(v,X,de){X!==null&&typeof X=="object"&&typeof de>"u"&&(de=X,X=null);const xe=ee(v,de);if(typeof X!="function")return xe;for(let fe=0,P=xe.length;fe<P;fe+=1)X(xe[fe])}function Ce(v,X){const de=ee(v,X);if(de.length!==0){if(de.length===1)return de[0];throw new t("expected a single document in the stream, but found more")}}return ah.loadAll=ne,ah.load=Ce,ah}var D0={},M_;function Pne(){if(M_)return D0;M_=1;const e=rf(),t=af(),n=Hk(),s=Object.prototype.toString,r=Object.prototype.hasOwnProperty,i=65279,a=9,l=10,c=13,u=32,d=33,f=34,h=35,p=37,m=38,k=39,w=42,g=44,y=45,b=58,S=61,M=62,E=63,A=64,R=91,D=93,_=96,z=123,$=124,H=125,I={};I[0]="\\0",I[7]="\\a",I[8]="\\b",I[9]="\\t",I[10]="\\n",I[11]="\\v",I[12]="\\f",I[13]="\\r",I[27]="\\e",I[34]='\\"',I[92]="\\\\",I[133]="\\N",I[160]="\\_",I[8232]="\\L",I[8233]="\\P";const L=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],C=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function O(P,oe){if(oe===null)return{};const le={},ve=Object.keys(oe);for(let Se=0,Ne=ve.length;Se<Ne;Se+=1){let ue=ve[Se],_e=String(oe[ue]);ue.slice(0,2)==="!!"&&(ue="tag:yaml.org,2002:"+ue.slice(2));const Me=P.compiledTypeMap.fallback[ue];Me&&r.call(Me.styleAliases,_e)&&(_e=Me.styleAliases[_e]),le[ue]=_e}return le}function U(P){let oe,le;const ve=P.toString(16).toUpperCase();if(P<=255)oe="x",le=2;else if(P<=65535)oe="u",le=4;else if(P<=4294967295)oe="U",le=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+oe+e.repeat("0",le-ve.length)+ve}const F=1,j=2;function N(P){this.schema=P.schema||n,this.indent=Math.max(1,P.indent||2),this.noArrayIndent=P.noArrayIndent||!1,this.skipInvalid=P.skipInvalid||!1,this.flowLevel=e.isNothing(P.flowLevel)?-1:P.flowLevel,this.styleMap=O(this.schema,P.styles||null),this.sortKeys=P.sortKeys||!1,this.lineWidth=P.lineWidth||80,this.noRefs=P.noRefs||!1,this.noCompatMode=P.noCompatMode||!1,this.condenseFlow=P.condenseFlow||!1,this.quotingType=P.quotingType==='"'?j:F,this.forceQuotes=P.forceQuotes||!1,this.replacer=typeof P.replacer=="function"?P.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function G(P,oe){const le=e.repeat(" ",oe);let ve=0,Se="";const Ne=P.length;for(;ve<Ne;){let ue;const _e=P.indexOf(`
568
+ `,ve);_e===-1?(ue=P.slice(ve),ve=Ne):(ue=P.slice(ve,_e+1),ve=_e+1),ue.length&&ue!==`
569
+ `&&(Se+=le),Se+=ue}return Se}function T(P,oe){return`
570
+ `+e.repeat(" ",P.indent*oe)}function Z(P,oe){for(let le=0,ve=P.implicitTypes.length;le<ve;le+=1)if(P.implicitTypes[le].resolve(oe))return!0;return!1}function te(P){return P===u||P===a}function Q(P){return P>=32&&P<=126||P>=161&&P<=55295&&P!==8232&&P!==8233||P>=57344&&P<=65533&&P!==i||P>=65536&&P<=1114111}function pe(P){return Q(P)&&P!==i&&P!==c&&P!==l}function V(P,oe,le){const ve=pe(P),Se=ve&&!te(P);return(le?ve:ve&&P!==g&&P!==R&&P!==D&&P!==z&&P!==H)&&P!==h&&!(oe===b&&!Se)||pe(oe)&&!te(oe)&&P===h||oe===b&&Se}function q(P){return Q(P)&&P!==i&&!te(P)&&P!==y&&P!==E&&P!==b&&P!==g&&P!==R&&P!==D&&P!==z&&P!==H&&P!==h&&P!==m&&P!==w&&P!==d&&P!==$&&P!==S&&P!==M&&P!==k&&P!==f&&P!==p&&P!==A&&P!==_}function Y(P){return!te(P)&&P!==b}function J(P,oe){const le=P.charCodeAt(oe);let ve;return le>=55296&&le<=56319&&oe+1<P.length&&(ve=P.charCodeAt(oe+1),ve>=56320&&ve<=57343)?(le-55296)*1024+ve-56320+65536:le}function ce(P){return/^\n* /.test(P)}const ke=1,Ae=2,je=3,ae=4,Oe=5;function ye(P,oe,le,ve,Se,Ne,ue,_e){let Me,Fe=0,De=null,He=!1,Ge=!1;const xt=ve!==-1;let Mt=-1,Ot=q(J(P,0))&&Y(J(P,P.length-1));if(oe||ue)for(Me=0;Me<P.length;Fe>=65536?Me+=2:Me++){if(Fe=J(P,Me),!Q(Fe))return Oe;Ot=Ot&&V(Fe,De,_e),De=Fe}else{for(Me=0;Me<P.length;Fe>=65536?Me+=2:Me++){if(Fe=J(P,Me),Fe===l)He=!0,xt&&(Ge=Ge||Me-Mt-1>ve&&P[Mt+1]!==" ",Mt=Me);else if(!Q(Fe))return Oe;Ot=Ot&&V(Fe,De,_e),De=Fe}Ge=Ge||xt&&Me-Mt-1>ve&&P[Mt+1]!==" "}return!He&&!Ge?Ot&&!ue&&!Se(P)?ke:Ne===j?Oe:Ae:le>9&&ce(P)?Oe:ue?Ne===j?Oe:Ae:Ge?ae:je}function ge(P,oe,le,ve,Se){P.dump=function(){if(oe.length===0)return P.quotingType===j?'""':"''";if(!P.noCompatMode&&(L.indexOf(oe)!==-1||C.test(oe)))return P.quotingType===j?'"'+oe+'"':"'"+oe+"'";const Ne=P.indent*Math.max(1,le),ue=P.lineWidth===-1?-1:Math.max(Math.min(P.lineWidth,40),P.lineWidth-Ne),_e=ve||P.flowLevel>-1&&le>=P.flowLevel;function Me(Fe){return Z(P,Fe)}switch(ye(oe,_e,P.indent,ue,Me,P.quotingType,P.forceQuotes&&!ve,Se)){case ke:return oe;case Ae:return"'"+oe.replace(/'/g,"''")+"'";case je:return"|"+be(oe,P.indent)+$e(G(oe,Ne));case ae:return">"+be(oe,P.indent)+$e(G(ft(oe,ue),Ne));case Oe:return'"'+rt(oe)+'"';default:throw new t("impossible error: invalid scalar style")}}()}function be(P,oe){const le=ce(P)?String(oe):"",ve=P[P.length-1]===`
571
+ `,Ne=ve&&(P[P.length-2]===`
572
+ `||P===`
573
+ `)?"+":ve?"":"-";return le+Ne+`
574
+ `}function $e(P){return P[P.length-1]===`
575
+ `?P.slice(0,-1):P}function ft(P,oe){const le=/(\n+)([^\n]*)/g;let ve=function(){let _e=P.indexOf(`
576
+ `);return _e=_e!==-1?_e:P.length,le.lastIndex=_e,mt(P.slice(0,_e),oe)}(),Se=P[0]===`
577
+ `||P[0]===" ",Ne,ue;for(;ue=le.exec(P);){const _e=ue[1],Me=ue[2];Ne=Me[0]===" ",ve+=_e+(!Se&&!Ne&&Me!==""?`
578
+ `:"")+mt(Me,oe),Se=Ne}return ve}function mt(P,oe){if(P===""||P[0]===" ")return P;const le=/ [^ ]/g;let ve,Se=0,Ne,ue=0,_e=0,Me="";for(;ve=le.exec(P);)_e=ve.index,_e-Se>oe&&(Ne=ue>Se?ue:_e,Me+=`
579
+ `+P.slice(Se,Ne),Se=Ne+1),ue=_e;return Me+=`
580
+ `,P.length-Se>oe&&ue>Se?Me+=P.slice(Se,ue)+`
581
+ `+P.slice(ue+1):Me+=P.slice(Se),Me.slice(1)}function rt(P){let oe="",le=0;for(let ve=0;ve<P.length;le>=65536?ve+=2:ve++){le=J(P,ve);const Se=I[le];!Se&&Q(le)?(oe+=P[ve],le>=65536&&(oe+=P[ve+1])):oe+=Se||U(le)}return oe}function nt(P,oe,le){let ve="";const Se=P.tag;for(let Ne=0,ue=le.length;Ne<ue;Ne+=1){let _e=le[Ne];P.replacer&&(_e=P.replacer.call(le,String(Ne),_e)),(X(P,oe,_e,!1,!1)||typeof _e>"u"&&X(P,oe,null,!1,!1))&&(ve!==""&&(ve+=","+(P.condenseFlow?"":" ")),ve+=P.dump)}P.tag=Se,P.dump="["+ve+"]"}function ee(P,oe,le,ve){let Se="";const Ne=P.tag;for(let ue=0,_e=le.length;ue<_e;ue+=1){let Me=le[ue];P.replacer&&(Me=P.replacer.call(le,String(ue),Me)),(X(P,oe+1,Me,!0,!0,!1,!0)||typeof Me>"u"&&X(P,oe+1,null,!0,!0,!1,!0))&&((!ve||Se!=="")&&(Se+=T(P,oe)),P.dump&&l===P.dump.charCodeAt(0)?Se+="-":Se+="- ",Se+=P.dump)}P.tag=Ne,P.dump=Se||"[]"}function ne(P,oe,le){let ve="";const Se=P.tag,Ne=Object.keys(le);for(let ue=0,_e=Ne.length;ue<_e;ue+=1){let Me="";ve!==""&&(Me+=", "),P.condenseFlow&&(Me+='"');const Fe=Ne[ue];let De=le[Fe];P.replacer&&(De=P.replacer.call(le,Fe,De)),X(P,oe,Fe,!1,!1)&&(P.dump.length>1024&&(Me+="? "),Me+=P.dump+(P.condenseFlow?'"':"")+":"+(P.condenseFlow?"":" "),X(P,oe,De,!1,!1)&&(Me+=P.dump,ve+=Me))}P.tag=Se,P.dump="{"+ve+"}"}function Ce(P,oe,le,ve){let Se="";const Ne=P.tag,ue=Object.keys(le);if(P.sortKeys===!0)ue.sort();else if(typeof P.sortKeys=="function")ue.sort(P.sortKeys);else if(P.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let _e=0,Me=ue.length;_e<Me;_e+=1){let Fe="";(!ve||Se!=="")&&(Fe+=T(P,oe));const De=ue[_e];let He=le[De];if(P.replacer&&(He=P.replacer.call(le,De,He)),!X(P,oe+1,De,!0,!0,!0))continue;const Ge=P.tag!==null&&P.tag!=="?"||P.dump&&P.dump.length>1024;Ge&&(P.dump&&l===P.dump.charCodeAt(0)?Fe+="?":Fe+="? "),Fe+=P.dump,Ge&&(Fe+=T(P,oe)),X(P,oe+1,He,!0,Ge)&&(P.dump&&l===P.dump.charCodeAt(0)?Fe+=":":Fe+=": ",Fe+=P.dump,Se+=Fe)}P.tag=Ne,P.dump=Se||"{}"}function v(P,oe,le){const ve=le?P.explicitTypes:P.implicitTypes;for(let Se=0,Ne=ve.length;Se<Ne;Se+=1){const ue=ve[Se];if((ue.instanceOf||ue.predicate)&&(!ue.instanceOf||typeof oe=="object"&&oe instanceof ue.instanceOf)&&(!ue.predicate||ue.predicate(oe))){if(le?ue.multi&&ue.representName?P.tag=ue.representName(oe):P.tag=ue.tag:P.tag="?",ue.represent){const _e=P.styleMap[ue.tag]||ue.defaultStyle;let Me;if(s.call(ue.represent)==="[object Function]")Me=ue.represent(oe,_e);else if(r.call(ue.represent,_e))Me=ue.represent[_e](oe,_e);else throw new t("!<"+ue.tag+'> tag resolver accepts not "'+_e+'" style');P.dump=Me}return!0}}return!1}function X(P,oe,le,ve,Se,Ne,ue){P.tag=null,P.dump=le,v(P,le,!1)||v(P,le,!0);const _e=s.call(P.dump),Me=ve;ve&&(ve=P.flowLevel<0||P.flowLevel>oe);const Fe=_e==="[object Object]"||_e==="[object Array]";let De,He;if(Fe&&(De=P.duplicates.indexOf(le),He=De!==-1),(P.tag!==null&&P.tag!=="?"||He||P.indent!==2&&oe>0)&&(Se=!1),He&&P.usedDuplicates[De])P.dump="*ref_"+De;else{if(Fe&&He&&!P.usedDuplicates[De]&&(P.usedDuplicates[De]=!0),_e==="[object Object]")ve&&Object.keys(P.dump).length!==0?(Ce(P,oe,P.dump,Se),He&&(P.dump="&ref_"+De+P.dump)):(ne(P,oe,P.dump),He&&(P.dump="&ref_"+De+" "+P.dump));else if(_e==="[object Array]")ve&&P.dump.length!==0?(P.noArrayIndent&&!ue&&oe>0?ee(P,oe-1,P.dump,Se):ee(P,oe,P.dump,Se),He&&(P.dump="&ref_"+De+P.dump)):(nt(P,oe,P.dump),He&&(P.dump="&ref_"+De+" "+P.dump));else if(_e==="[object String]")P.tag!=="?"&&ge(P,P.dump,oe,Ne,Me);else{if(_e==="[object Undefined]")return!1;if(P.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+_e)}if(P.tag!==null&&P.tag!=="?"){let Ge=encodeURI(P.tag[0]==="!"?P.tag.slice(1):P.tag).replace(/!/g,"%21");P.tag[0]==="!"?Ge="!"+Ge:Ge.slice(0,18)==="tag:yaml.org,2002:"?Ge="!!"+Ge.slice(18):Ge="!<"+Ge+">",P.dump=Ge+" "+P.dump}}return!0}function de(P,oe){const le=[],ve=[];xe(P,le,ve);const Se=ve.length;for(let Ne=0;Ne<Se;Ne+=1)oe.duplicates.push(le[ve[Ne]]);oe.usedDuplicates=new Array(Se)}function xe(P,oe,le){if(P!==null&&typeof P=="object"){const ve=oe.indexOf(P);if(ve!==-1)le.indexOf(ve)===-1&&le.push(ve);else if(oe.push(P),Array.isArray(P))for(let Se=0,Ne=P.length;Se<Ne;Se+=1)xe(P[Se],oe,le);else{const Se=Object.keys(P);for(let Ne=0,ue=Se.length;Ne<ue;Ne+=1)xe(P[Se[Ne]],oe,le)}}}function fe(P,oe){oe=oe||{};const le=new N(oe);le.noRefs||de(P,le);let ve=P;return le.replacer&&(ve=le.replacer.call({"":ve},"",ve)),X(le,0,ve,!0,!0)?le.dump+`
582
+ `:""}return D0.dump=fe,D0}var j_;function zne(){if(j_)return $n;j_=1;const e=Lne(),t=Pne();function n(s,r){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}return $n.Type=rs(),$n.Schema=QR(),$n.FAILSAFE_SCHEMA=eO(),$n.JSON_SCHEMA=iO(),$n.CORE_SCHEMA=aO(),$n.DEFAULT_SCHEMA=Hk(),$n.load=e.load,$n.loadAll=e.loadAll,$n.dump=t.dump,$n.YAMLException=af(),$n.types={binary:cO(),float:rO(),map:JR(),null:tO(),pairs:dO(),set:fO(),timestamp:lO(),bool:nO(),int:sO(),merge:oO(),omap:uO(),seq:ZR(),str:WR()},$n.safeLoad=n("safeLoad","load"),$n.safeLoadAll=n("safeLoadAll","loadAll"),$n.safeDump=n("safeDump","dump"),$n}var Une=zne();const hO=Dne(Une),{Type:Ise,Schema:Lse,FAILSAFE_SCHEMA:Pse,JSON_SCHEMA:zse,CORE_SCHEMA:Use,DEFAULT_SCHEMA:Fse,load:Bse,loadAll:Hse,dump:$se,YAMLException:Gse,types:Kse,safeLoad:qse,safeLoadAll:Yse,safeDump:Vse}=hO;function pO(e){const t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);if(!t)return{frontmatter:null,body:e};const n=e.slice(t[0].length);try{const s=hO.load(t[1]);if(s&&typeof s=="object"&&!Array.isArray(s))return{frontmatter:s,body:n}}catch{}return{frontmatter:null,body:e}}function mO({data:e}){const t=We(),n=Object.entries(e);return n.length?o.jsxs("div",{className:"mb-4 rounded-md border border-edge/[0.06] bg-neutral-900/60 p-3",children:[o.jsx("div",{className:"text-xs font-semibold text-neutral-400 uppercase mb-2",children:t("fm.title")}),o.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs",children:n.map(([s,r])=>o.jsxs("div",{className:"contents",children:[o.jsx("dt",{className:"font-mono text-neutral-500",children:s}),o.jsx("dd",{className:"font-mono text-neutral-200 break-all",children:Fne(r)})]},s))})]}):null}function Fne(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e)}const Bne=/^[^/]+\/skills\/[^/]+\//;function sy(e){const t=e.lastIndexOf("/");return t<0?e:e.slice(t+1)}function Hne(e){const t={children:[]};for(const s of e){const i=s.relPath.replace(Bne,"").split("/");let a=t,l="";for(let c=0;c<i.length;c++){const u=i[c];if(l=l?`${l}/${u}`:u,c===i.length-1)a.children.push({type:"file",file:s});else{let d=a.children.find(f=>f.type==="dir"&&f.name===u);d||(d={type:"dir",name:u,path:l,children:[]},a.children.push(d)),a=d}}}const n=s=>{s.children.sort((r,i)=>{const a=r.type==="dir",l=i.type==="dir";if(a!==l)return a?-1:1;if(r.type==="file"&&i.type==="file"){const d=r.file.relPath.endsWith("/SKILL.md")?0:1,f=i.file.relPath.endsWith("/SKILL.md")?0:1;if(d!==f)return d-f}const c=r.type==="file"?sy(r.file.relPath):r.name,u=i.type==="file"?sy(i.file.relPath):i.name;return c.localeCompare(u)}),s.children.forEach(r=>{r.type==="dir"&&n(r)})};return n(t),t.children}function gO({node:e,depth:t,selectedRel:n,onSelect:s,collapsed:r,onToggle:i}){const a=8+t*12;if(e.type==="file"){const c=n===e.file.relPath,u=e.file.relPath.endsWith("/SKILL.md");return o.jsxs("button",{onClick:()=>s(e.file),style:{paddingLeft:a},className:me("w-full flex items-center gap-1.5 rounded-md py-1 pr-1.5 text-left text-xs font-mono truncate [&_svg]:pointer-events-none",c?"bg-neutral-800 text-neutral-100":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-800/50"),title:e.file.absPath,children:[u?o.jsx(Fd,{className:"h-3 w-3 shrink-0 text-blue-400"}):o.jsx(Ta,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:sy(e.file.relPath)})]})}const l=r.has(e.path);return o.jsxs("div",{children:[o.jsxs("button",{onClick:()=>i(e.path),style:{paddingLeft:a},className:"w-full flex items-center gap-1.5 rounded-md py-1 pr-1.5 text-left text-xs text-neutral-300 hover:bg-neutral-800/50",children:[l?o.jsx(ns,{className:"h-3 w-3 shrink-0"}):o.jsx(Bn,{className:"h-3 w-3 shrink-0"}),o.jsx(ar,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:e.name})]}),!l&&e.children.map(c=>o.jsx(gO,{node:c,depth:t+1,selectedRel:n,onSelect:s,collapsed:r,onToggle:i},c.type==="dir"?c.path:c.file.relPath))]})}function $ne({projectId:e,name:t,scope:n,source:s,pluginKey:r,agent:i,files:a,readOnly:l,outdated:c,custom:u,onUninstall:d,onClose:f}){var N;const h=We(),p=n==="user"&&!!s,[m,k]=x.useState(a),[w,g]=x.useState(()=>a.find(T=>T.relPath.endsWith("/SKILL.md"))??a[0]??null),[y,b]=x.useState(null),[S,M]=x.useState(null),[E,A]=x.useState(0),R=x.useRef(w);R.current=w;const D=x.useMemo(()=>Hne(m),[m]),[_,z]=x.useState(new Set),$=G=>z(T=>{const Z=new Set(T);return Z.has(G)?Z.delete(G):Z.add(G),Z}),H=x.useMemo(()=>{const G=[],T=Z=>{for(const te of Z)te.type==="dir"&&(G.push(te.path),T(te.children))};return T(D),G},[D]),I=_.size>0,L=()=>z(I?new Set:new Set(H));x.useEffect(()=>{if(!p)return;let G=!1;return Ee.listGlobalSkillFiles(e,{source:s,name:t,pluginKey:r}).then(T=>{if(G)return;k(T);const Z=T.find(te=>te.relPath.endsWith("/SKILL.md"));g(te=>te??Z??T[0]??null)}).catch(T=>{G||M(String(T))}),()=>{G=!0}},[e,p,s,t,r]),x.useEffect(()=>{if(!w){b(null),M(null);return}let G=!1;return b(null),M(null),(p?Ee.readGlobalSkillFile(e,{source:s,name:t,pluginKey:r,path:w.relPath}):Ee.readFile(e,w.relPath)).then(Z=>{G||b(Z.content)}).catch(Z=>{G||M(String(Z))}),()=>{G=!0}},[e,p,s,t,r,w,E]),x.useEffect(()=>{if(p)return ux("asset",G=>{const T=R.current;T&&G.absPath===T.absPath&&A(Z=>Z+1)})},[p]);const C=(w==null?void 0:w.relPath.toLowerCase().endsWith(".md"))??!1,O=y!=null&&C?pO(y):null,U=(s==null?void 0:s.endsWith("-plugin"))??!1,F=s?Kn(Hd(s)).label:"",j=((N=a[0])==null?void 0:N.relPath.split("/")[0])??"";return o.jsxs("div",{className:"absolute right-0 top-0 h-full w-full lg:w-[min(720px,88%)] z-30 flex flex-col frosted-strong border-l border-edge/[0.08] shadow-mac",children:[o.jsxs("div",{className:"flex items-center gap-2 p-3 border-b border-edge/[0.06]",children:[o.jsx(Ta,{className:"h-4 w-4 shrink-0 text-blue-400"}),o.jsx("span",{className:"text-sm font-semibold truncate",children:t}),r&&o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",title:h("skillGrid.keyTip"),children:r}),n==="project"?o.jsx(Qe,{variant:"default",children:"project"}):o.jsxs(o.Fragment,{children:[o.jsx(Qe,{variant:"skill",children:"global"}),l&&o.jsx(Qe,{variant:"settings",children:h("skillDetail.readOnly")})]}),p&&o.jsxs(o.Fragment,{children:[o.jsx(Qe,{variant:U?"mcp":"skill",children:h(U?"skillDetail.plugin":"skillDetail.local")}),o.jsx(Qe,{variant:"other",children:F})]}),o.jsx(Qe,{children:h("skillDetail.fileCount",{n:m.length})}),c&&o.jsx(Qe,{variant:"warning",children:h("skillDetail.update")}),u&&o.jsx(Qe,{variant:"other",children:h("skillDetail.custom")}),o.jsxs("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:[!l&&o.jsx("button",{onClick:d,className:"text-neutral-500 hover:text-red-400 [&_svg]:pointer-events-none",title:h("skillDetail.uninstallTitle"),children:o.jsx(Qs,{className:"h-4 w-4"})}),o.jsx("button",{onClick:f,className:"text-neutral-500 hover:text-neutral-300",children:o.jsx(tn,{className:"h-4 w-4"})})]})]}),o.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[o.jsxs("aside",{className:"w-56 shrink-0 border-r border-edge/[0.06] overflow-y-auto p-2 space-y-0.5",children:[D.length>0&&o.jsx("div",{className:"flex items-center gap-1 pb-1.5 mb-1 border-b border-edge/[0.06]",children:o.jsxs("button",{onClick:L,className:"inline-flex items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-1.5 py-0.5 text-[10px] hover:bg-neutral-700 [&_svg]:pointer-events-none",title:h(I?"skillDetail.expandAllDirs":"skillDetail.collapseAllDirs"),children:[I?o.jsx(Ud,{className:"h-2.5 w-2.5"}):o.jsx(zd,{className:"h-2.5 w-2.5"}),h(I?"skillDetail.expandAll":"skillDetail.collapseAll")]})}),D.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:h(p?"common.loading":"skillDetail.noFiles")}),D.map(G=>o.jsx(gO,{node:G,depth:0,selectedRel:w==null?void 0:w.relPath,onSelect:g,collapsed:_,onToggle:$},G.type==="dir"?G.path:G.file.relPath))]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[S&&o.jsx("p",{className:"text-red-400 text-xs",children:S}),y==null&&!S&&o.jsx("p",{className:"text-xs text-neutral-500",children:h("common.loading")}),O&&o.jsxs(o.Fragment,{children:[O.frontmatter&&o.jsx(mO,{data:O.frontmatter}),o.jsx("div",{className:"prose prose-invert prose-sm max-w-none",children:o.jsx(Nk,{remarkPlugins:[jk],rehypePlugins:[XR],children:O.body})})]}),y!=null&&!C&&o.jsx("pre",{className:"text-xs font-mono text-neutral-300 whitespace-pre-wrap break-all bg-neutral-900 rounded-md p-3 border border-edge/[0.06]",children:y}),(w==null?void 0:w.relPath.endsWith("/SKILL.md"))&&y===""&&o.jsx("p",{className:"text-xs text-neutral-600",children:h("skillDetail.emptySkillMd")})]})]}),o.jsx("div",{className:"flex items-center gap-2 p-2 border-t border-edge/[0.06] text-[11px] text-neutral-500",children:n==="project"?o.jsxs(o.Fragment,{children:[o.jsx(ar,{className:"h-3 w-3"}),h("skillDetail.projectScopeHint",{root:j||(i?Kn(i).label:"")})]}):l?o.jsxs(o.Fragment,{children:[o.jsx(dl,{className:"h-3 w-3"}),h("skillDetail.globalReadOnlyHint")]}):U?o.jsxs(o.Fragment,{children:[o.jsx(dl,{className:"h-3 w-3"}),h("skillDetail.globalPluginHint",{runtime:F})]}):o.jsxs(o.Fragment,{children:[o.jsx(dl,{className:"h-3 w-3"}),h("skillDetail.globalLocalHint",{runtime:F})]})})]})}const R_={home:{labelKey:"picker.home",icon:YP},desktop:{labelKey:"picker.desktop",icon:ZP},downloads:{labelKey:"picker.downloads",icon:_v},documents:{labelKey:"picker.documents",icon:Fd},"library-parent":{labelKey:"picker.libraryParent",icon:zA},drive:{labelKey:"picker.drive",icon:sx},root:{labelKey:"picker.root",icon:sx}},Gne=["home","desktop","downloads","documents","library-parent","drive","root"];function Kne(e){const t=e.trim().replace(/^"(.*)"$/s,"$1");return/^[a-zA-Z]:[\\/]$/.test(t)?t:t.replace(/[\\/]+$/,"").trim()}function qne({open:e,onClose:t,onConfirm:n,existingPaths:s=[]}){const[r,i]=x.useState([]),[a,l]=x.useState(new Map),[c,u]=x.useState(new Set),[d,f]=x.useState(new Set),[h,p]=x.useState([]),[m,k]=x.useState(""),[w,g]=x.useState(null),y=We();x.useEffect(()=>{!e||r.length>0||Ee.listFsRoots().then(_=>{const z=new Map(Gne.map(($,H)=>[$,H]));i([..._].sort(($,H)=>(z.get($.kind)??99)-(z.get(H.kind)??99)))}).catch(_=>g(String(_)))},[e,r.length]);const b=x.useCallback(async _=>{u(z=>new Set(z).add(_)),g(null);try{const z=await Ee.listFsChildren(_);l($=>new Map($).set(_,z))}catch(z){g(String(z))}finally{u(z=>{const $=new Set(z);return $.delete(_),$})}},[]),S=x.useCallback(_=>{f(z=>{const $=new Set(z);return $.has(_)?$.delete(_):($.add(_),!a.has(_)&&!c.has(_)&&b(_)),$})},[a,c,b]),M=x.useCallback(_=>{const $=!h.includes(_)?[...h,_]:h.filter(H=>H!==_);p($),k($.length>0?$[$.length-1]:"")},[h]),E=x.useMemo(()=>new Set(s),[s]),A=x.useCallback(()=>{const _=Kne(m);k(_),!(!_||h.includes(_)||E.has(_))&&p([...h,_])},[m,h,E]);function R(_,z){const $=[];for(const H of _){const I=d.has(H.path),L=h.includes(H.path),C=E.has(H.path),O=H.rootKind==="library-parent",U=!C&&!O,F=H.rootKind?R_[H.rootKind]:null,j=a.get(H.path),N=c.has(H.path);$.push(o.jsxs("div",{className:"group flex items-center gap-1 pr-2 rounded hover:bg-edge/[0.04]",style:{paddingLeft:z*14+6},children:[o.jsx("button",{onClick:()=>S(H.path),className:"shrink-0 p-0.5 text-neutral-500 hover:text-neutral-200",title:y(I?"common.collapse":"common.expand"),children:I?o.jsx(Bn,{className:"h-3.5 w-3.5"}):o.jsx(ns,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{onClick:()=>S(H.path),className:me("flex-1 min-w-0 flex items-center gap-1.5 text-left py-1 truncate",U?"text-neutral-200":"text-neutral-500"),title:H.path,children:[F?o.jsx(F.icon,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}):o.jsx(ar,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("span",{className:"truncate text-xs",children:H.rootKind==="drive"?H.name:F?y(F.labelKey):H.name}),C&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:y("picker.alreadyAdded")})]}),o.jsx("button",{onClick:()=>M(H.path),disabled:!U,className:me("shrink-0 w-4 h-4 rounded border flex items-center justify-center transition-colors",L?"bg-blue-500 border-blue-500 text-white":"border-neutral-600 text-transparent group-hover:border-neutral-400",!U&&"opacity-30 cursor-not-allowed"),title:y(O?"picker.anchorTip":L?"picker.unselect":"picker.selectFolder"),children:o.jsx(cr,{className:"h-3 w-3"})})]},H.path)),I&&(N||!j?$.push(o.jsxs("div",{className:"flex items-center gap-1.5 text-neutral-500 py-1",style:{paddingLeft:(z+1)*14+24},children:[o.jsx(zn,{className:"h-3 w-3 animate-spin"}),o.jsx("span",{className:"text-[11px]",children:y("common.loading")})]},`${H.path}__loading`)):j.length>0?$.push(...R(j,z+1)):$.push(o.jsx("div",{className:"text-neutral-600 py-1",style:{paddingLeft:(z+1)*14+24},children:o.jsx("span",{className:"text-[11px]",children:y("common.empty")})},`${H.path}__empty`)))}return $}const D=r.map(_=>({path:_.path,name:_.path,rootKind:_.kind}));return e?un.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),o.jsxs("div",{className:"relative w-[720px] max-w-full h-[560px] max-h-full rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac overflow-hidden flex flex-col",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx(ar,{className:"h-4 w-4 text-blue-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:y("picker.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:y("picker.subtitle")}),o.jsx("button",{onClick:t,className:"ml-auto p-1 rounded text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",title:y("common.close"),children:o.jsx(tn,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 px-4 py-2 border-b border-edge/[0.06]",children:[o.jsx(ar,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("input",{value:m,onChange:_=>k(_.target.value),onKeyDown:_=>{_.key==="Enter"&&A()},placeholder:y("picker.pathPlaceholder"),spellCheck:!1,className:"flex-1 min-w-0 bg-neutral-900 rounded px-2 py-1 text-xs font-mono text-neutral-200"}),o.jsx("button",{onClick:A,disabled:!m.trim(),title:y("picker.addPathTip"),className:"shrink-0 rounded bg-neutral-800 px-2 py-1 text-xs text-neutral-300 hover:bg-neutral-700 disabled:opacity-40",children:y("picker.add")})]}),o.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[o.jsxs("aside",{className:"w-44 shrink-0 border-r border-edge/[0.06] overflow-y-auto p-2 space-y-0.5 frosted",children:[o.jsx("p",{className:"px-2 pb-1 text-[10px] font-medium uppercase tracking-wide text-neutral-500",children:y("picker.quickAccess")}),r.map(_=>{const z=R_[_.kind];return o.jsxs("button",{onClick:()=>S(_.path),className:"w-full flex items-center gap-1.5 px-2 py-1 rounded text-left hover:bg-edge/[0.06]",title:_.path,children:[_.kind==="drive"||_.kind==="root"?o.jsx(sx,{className:"h-3.5 w-3.5 shrink-0 text-neutral-400"}):o.jsx(z.icon,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsxs("span",{className:"text-xs text-neutral-300 truncate",children:[y(z.labelKey),_.kind==="home"||_.kind==="drive"?o.jsx("span",{className:"ml-1 text-neutral-500",children:_.path}):null]})]},_.path)}),r.length===0&&o.jsx(Sm,{rows:8,className:"p-0"})]}),o.jsx("main",{className:"flex-1 overflow-y-auto p-1.5",children:D.length>0?R(D,0):o.jsx("div",{className:"flex items-center justify-center h-full text-neutral-500 text-xs",children:w??y("common.loading")})})]}),o.jsxs("footer",{className:"shrink-0 border-t border-edge/[0.06] px-4 py-2.5 flex items-center gap-3 frosted",children:[o.jsxs("div",{className:"flex-1 min-w-0 flex flex-wrap gap-1 max-h-12 overflow-y-auto",children:[h.length===0&&o.jsx("span",{className:"text-[11px] text-neutral-500",children:y("picker.noneSelected")}),h.map(_=>o.jsxs("button",{onClick:()=>M(_),className:"inline-flex items-center gap-1 rounded-full bg-blue-900/40 text-blue-200 pl-2 pr-1 py-0.5 text-[11px] hover:bg-blue-900/60",title:y("picker.clickRemove"),children:[o.jsx(ar,{className:"h-3 w-3"}),o.jsx("span",{className:"max-w-[220px] truncate",children:_}),o.jsx(tn,{className:"h-3 w-3"})]},_))]}),w&&o.jsx("span",{className:"text-[11px] text-red-400 max-w-[200px] truncate",children:w}),o.jsx("span",{className:"text-[11px] text-neutral-500 shrink-0",children:y("picker.selectedCount",{count:h.length})}),o.jsx("button",{onClick:t,className:"shrink-0 rounded-lg bg-neutral-800 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-700",children:y("common.cancel")}),o.jsx("button",{onClick:()=>{n(h),p([]),k("")},disabled:h.length===0,className:"shrink-0 rounded-lg bg-blue-600 px-3 py-1.5 text-xs text-white hover:bg-blue-500 disabled:opacity-40 disabled:cursor-not-allowed",children:h.length>0?y("picker.addCount",{count:h.length}):y("picker.add")})]})]})]}),document.body):null}const lh=e=>e.replace(/\\/g,"/"),O_=e=>`${e.provenance}:${e.sourceRoot}:${e.id}`;function Yne({installedSkillNames:e,onInstallSkill:t,onInstallFileAsset:n,onInstallMcp:s,updates:r,onUpdateAsset:i,category:a,scope:l,capabilities:c,projectId:u,onSyncAll:d}){const[f,h]=x.useState([]),[p,m]=x.useState(null),[k,w]=x.useState([]),[g,y]=x.useState([]),[b,S]=x.useState([]),[M,E]=x.useState([]),[A,R]=x.useState(!1),[D,_]=x.useState(!1),[z,$]=x.useState(""),[H,I]=x.useState(nn[0]??"claude"),[L,C]=x.useState(0),[O,U]=x.useState(new Map),[F,j]=x.useState(null),N=We(),{show:G}=an(),T=xn(),Z=se=>{se&&G("error",se)},te=T.stateOf("lib-git-import")==="loading",Q=T.stateOf("lib-check-updates")==="loading",pe=T.stateOf("lib-refresh-all")==="loading",V=_o(ha("skill",c),{scope:l,agent:H}),q=_o(ha("mcp",c),{scope:l,agent:H}),Y=se=>se.ok||!se.reasonKey?void 0:N(se.reasonKey),J=x.useCallback(()=>Ee.listMarket().then(h).catch(se=>Z(String(se))),[]);x.useEffect(()=>{J()},[J]),x.useEffect(()=>ki("market",()=>void J()),[J]),x.useEffect(()=>{if(p===null){w([]),y([]),S([]),E([]);return}R(!0),Z(null),Ee.listLibraryAssets(p).then(se=>{const Pe=(se.plugins??[]).map(it=>it.relPath),Be=it=>Pe.some(Ze=>Ze===""||it===Ze||it.startsWith(`${Ze}/`));w(se.skills.filter(it=>!Be(it.relPath))),y(se.files??[]),S(se.mcp??[]),E(se.plugins??[])}).catch(se=>Z(String(se))).finally(()=>R(!1))},[p,L]),x.useEffect(()=>{Ee.listToolkit(u).then(se=>j(se.packs)).catch(()=>j([]))},[u,L,p]);async function ce(){Q||await T.run("lib-check-updates",async()=>{const se=await Ee.checkMarketUpdates();U(new Map(se.map(Pe=>[Pe.id,Pe.status]))),G("success",N("library.checkDone",{n:se.filter(Pe=>Pe.status==="update-available").length}))},{fail:se=>N("library.checkFailed",{error:Ye(se)})})}async function ke(){const se=[...O.entries()].filter(([,Pe])=>Pe==="update-available").map(([Pe])=>Pe);!se.length||pe||await T.run("lib-refresh-all",async()=>{await Ee.refreshMarketCache(se),await d(),await J(),C(Be=>Be+1);const Pe=await Ee.checkMarketUpdates(se);U(Be=>{const it=new Map(Be);for(const Ze of Pe)it.set(Ze.id,Ze.status);return it}),G("success",N("library.refreshDone",{n:se.length}))},{fail:Pe=>N("library.refreshFailed",{error:Ye(Pe)})})}async function Ae(se,Pe,Be){const it=O_(se);T.stateOf(it)!=="loading"&&await T.run(it,async()=>{const Ze=await Ee.toggleToolkit(u,se.id,Pe,se.sourceRoot);Ze.warnings.length>0&&G("info",Ze.warnings.join(";"));const _n=await Ee.listToolkit(u);j(_n.packs),Be==null||Be()},{fail:Ze=>N("toolkit.toggleFailed",{error:Ye(Ze)})})}async function je(se){await T.run("lib-import-dirs",async()=>{let Pe=null,Be=0;for(const it of se)try{Pe=(await Ee.importMarketDir(it)).id,Be++}catch(Ze){G("error",N("library.importDirFail",{path:it,error:Ye(Ze)}))}Be>0&&G("success",N("library.importDirOk",{n:Be})),await J(),C(it=>it+1),Pe!==null&&m(Pe)},{fail:Pe=>N("library.importFailed",{error:Ye(Pe)})})}async function ae(){const se=z.trim();!se||te||await T.run("lib-git-import",async()=>{const Pe=await Ee.importMarketGit(se);$(""),await J(),C(Be=>Be+1),m(Pe.id),G("success",N("library.importGitOk",{name:Pe.resourceId??Pe.path}))},{fail:Pe=>N("library.importFailed",{error:Ye(Pe)})})}async function Oe(se){const Pe=`lib-migrate:${se.id}`;T.stateOf(Pe)!=="loading"&&await T.run(Pe,async()=>{const Be=await Ee.migrateLibrary(se.id);await J(),m(Be.id),G("success",N("library.migratedOk",{name:se.resourceId??se.path}))},{fail:Be=>N("library.migrateFailed",{error:Ye(Be)})})}const[ye,ge]=x.useState(null);async function be(se){const Pe=`lib-remove:${se.id}`;T.stateOf(Pe)!=="loading"&&await T.run(Pe,async()=>{let Be;se.managed?Be=(await Ee.removeMarket(se.id)).warning:await Ee.removeLibrary(se.id),p===se.id&&m(null),await J(),G("success",N("library.removedOk",{name:se.resourceId??se.path})),Be&&G("info",N("library.removeDeregWarn",{error:Be}))},{fail:Be=>N("library.removeFailed",{error:Ye(Be)})})}const[$e,ft]=x.useState(new Set),mt=se=>ft(Pe=>{const Be=new Set(Pe);return Be.has(se)?Be.delete(se):Be.add(se),Be}),[rt,nt]=x.useState(new Set),ee=se=>nt(Pe=>{const Be=new Set(Pe);return Be.has(se)?Be.delete(se):Be.add(se),Be}),[ne,Ce]=x.useState(new Set),v=se=>ne.has(se),X=se=>Ce(Pe=>{const Be=new Set(Pe);return Be.has(se)?Be.delete(se):Be.add(se),Be}),de=f.filter(se=>se.source==="builtin"),xe=f.filter(se=>se.source==="dir"||se.source==="legacy"),fe=f.filter(se=>se.source==="git"),P=se=>o.jsx(Wne,{item:se,selected:p===se.id,status:O.get(se.id),onSelect:m,onMigrate:Pe=>void Oe(Pe),onRemove:Pe=>Pe.managed?ge(Pe):void be(Pe)},se.id),oe=((r==null?void 0:r.skills)??[]).filter(se=>se.outdated),le=((r==null?void 0:r.mcp)??[]).filter(se=>se.outdated),ve=((r==null?void 0:r.files)??[]).filter(se=>se.outdated),Se=[...O.values()].filter(se=>se==="update-available").length,Ne=a==="files",ue=Ne,_e=Ne,Me=Ne,Fe=Ne,De=!ue&&!Me&&!_e&&!Fe,He=[...ue?[I0]:[],..._e?[L0]:[],...Me?[P0]:[],...Fe?[z0]:[],...oe.length>0||le.length>0||ve.length>0?[U0]:[]],Ge=D_(k).map(([se])=>se||"__root__"),xt=M.map(se=>`plugin:${se.relPath||se.name}`),Mt=k.filter(se=>e.has(se.name)).length,Ot=M.filter(se=>{const Pe=(F==null?void 0:F.find(Be=>lh(Be.dir)===lh(se.dirPath)))??null;return(Pe==null?void 0:Pe.installed)===!0}).length,Wt=[...[...de.length>0?["builtin"]:[],...xe.length>0?["local"]:[],...fe.length>0?["git"]:[]],...He],zt=Wt.some(se=>!ne.has(se))||Ge.some(se=>$e.has(se))||xt.some(se=>!rt.has(se));function Ht(){zt?(Ce(new Set(Wt)),ft(new Set),nt(new Set(xt))):(Ce(new Set),ft(new Set(Ge)),nt(new Set))}return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"p-3 border-b border-edge/[0.06] space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h2",{className:"text-xs font-semibold text-neutral-400 uppercase",children:N("library.heading")}),!De&&o.jsxs("button",{onClick:Ht,className:"ml-auto inline-flex items-center gap-1 rounded-full bg-neutral-800 text-neutral-400 px-1.5 py-0.5 text-[10px] hover:bg-neutral-700 [&_svg]:pointer-events-none",title:N(zt?"library.expandAllTip":"library.collapseAllTip"),children:[zt?o.jsx(Ud,{className:"h-2.5 w-2.5"}):o.jsx(zd,{className:"h-2.5 w-2.5"}),N(zt?"library.expandAll":"library.collapseAll")]})]}),o.jsxs("div",{className:"rounded-md border border-edge/[0.06] bg-neutral-900/60 p-2 flex items-center gap-2",children:[l==="user"?o.jsx(dl,{className:"h-3.5 w-3.5 shrink-0 text-emerald-400"}):o.jsx(ar,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsxs("span",{className:"text-[11px] text-neutral-400",children:[N("library.installTo")," ",o.jsx("span",{className:me("font-semibold",l==="user"?"text-emerald-300":"text-blue-300"),children:N(l==="user"?"library.scopeGlobal":"library.scopeProject")})]}),o.jsx("span",{className:"ml-auto text-[11px] text-neutral-600",children:N("library.followsSelection")})]}),o.jsxs("button",{onClick:()=>_(!0),className:"w-full flex items-center justify-center gap-1.5 rounded bg-neutral-800 px-2 py-1.5 text-xs hover:bg-neutral-700 [&_svg]:pointer-events-none",title:N("library.addFoldersTip"),children:[o.jsx(ut,{state:T.stateOf("lib-import-dirs"),className:"h-3.5 w-3.5",icon:o.jsx(IA,{className:"h-3.5 w-3.5"})}),N("library.addFolders")]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{value:z,onChange:se=>$(se.target.value),onKeyDown:se=>{se.key==="Enter"&&ae()},placeholder:N("library.gitPlaceholder"),className:"flex-1 min-w-0 bg-neutral-900 rounded px-2 py-1.5 text-xs font-mono"}),o.jsxs("button",{onClick:()=>void ae(),disabled:!z.trim()||te,className:"shrink-0 inline-flex items-center gap-1 rounded bg-neutral-800 px-2 py-1.5 text-xs hover:bg-neutral-700 disabled:opacity-40 [&_svg]:pointer-events-none",title:N("library.importGitTip"),children:[o.jsx(ut,{state:T.stateOf("lib-git-import"),className:"h-3.5 w-3.5",icon:o.jsx(nx,{className:"h-3.5 w-3.5"})}),N(te?"library.scanning":"library.importGit")]})]}),o.jsx(qne,{open:D,onClose:()=>_(!1),onConfirm:se=>{_(!1),je(se)},existingPaths:f.map(se=>se.path)}),o.jsx(wi,{open:ye!==null,title:N("library.removeMarketTitle"),message:N("library.removeMarketConfirm",{name:(ye==null?void 0:ye.resourceId)??(ye==null?void 0:ye.path)??""}),confirmLabel:N("common.confirm"),onConfirm:()=>{ye&&be(ye)},onClose:()=>ge(null)}),f.length>0&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs("button",{onClick:()=>void ce(),disabled:Q,title:N("library.checkUpdatesTip"),className:"flex-1 inline-flex items-center justify-center gap-1 rounded bg-neutral-800 px-2 py-1.5 text-xs hover:bg-neutral-700 disabled:opacity-40 [&_svg]:pointer-events-none",children:[o.jsx(ut,{state:T.stateOf("lib-check-updates"),className:"h-3.5 w-3.5",icon:o.jsx(ic,{className:"h-3.5 w-3.5"})}),N(Q?"library.checking":"library.checkUpdates")]}),o.jsxs("button",{onClick:()=>void ke(),disabled:Se===0||pe,title:N("library.refreshUpdatesTip"),className:"flex-1 inline-flex items-center justify-center gap-1 rounded bg-blue-900/40 text-blue-300 px-2 py-1.5 text-xs hover:bg-blue-900/60 disabled:opacity-40 [&_svg]:pointer-events-none",children:[o.jsx(ut,{state:T.stateOf("lib-refresh-all"),className:"h-3.5 w-3.5",icon:o.jsx(_v,{className:"h-3.5 w-3.5"})}),N(pe?"library.scanning":"library.refreshUpdates"),Se>0&&o.jsx(Qe,{variant:"other",className:"px-1",children:Se})]})]})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-4",children:[A&&f.length===0&&o.jsx(M5,{count:3}),de.length>0&&o.jsx($i,{icon:o.jsx(Xu,{className:"h-3.5 w-3.5 text-emerald-400"}),title:N("library.marketSectionBuiltin"),count:de.length,open:v("builtin"),onToggle:()=>X("builtin"),children:de.map(P)}),xe.length>0&&o.jsx($i,{icon:o.jsx(ar,{className:"h-3.5 w-3.5 text-blue-400"}),title:N("library.marketSectionLocal"),count:xe.length,open:v("local"),onToggle:()=>X("local"),children:xe.map(P)}),fe.length>0&&o.jsx($i,{icon:o.jsx(nx,{className:"h-3.5 w-3.5 text-violet-400"}),title:N("library.marketSectionGit"),count:fe.length,open:v("git"),onToggle:()=>X("git"),children:fe.map(P)}),De&&o.jsxs("div",{className:"rounded-md border border-dashed border-edge/[0.08] bg-neutral-900/40 p-4 text-center",children:[o.jsx(rx,{className:"h-5 w-5 mx-auto text-neutral-600 mb-1"}),o.jsx("p",{className:"text-xs text-neutral-500",children:N("library.noTemplates",{name:Vne(a,N)})}),o.jsx("p",{className:"text-[11px] text-neutral-600 mt-0.5",children:N("library.noTemplatesHint")})]}),ue&&o.jsxs($i,{icon:o.jsx(Ta,{className:"h-3.5 w-3.5 text-emerald-400"}),title:N("library.sectionSkills"),hint:N("library.hintDragInstall"),count:k.length,tag:o.jsx(td,{tone:ed(Mt,k.length),children:N("library.tagInstalled",{done:Mt,total:k.length})}),open:v(I0),onToggle:()=>X(I0),children:[A&&o.jsx("p",{className:"text-xs text-neutral-500",children:N("library.scanning")}),!A&&p===null&&o.jsx("p",{className:"text-xs text-neutral-600",children:N("library.addLibrarySkills")}),!A&&p!==null&&k.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:N("library.noSkillsFound")}),o.jsx(I_,{agent:H,onChange:I,kind:"skills",scope:l,capabilities:c}),D_(k).map(([se,Pe])=>{const Be=se||"__root__",it=$e.has(Be);return o.jsxs("div",{className:"mb-1",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>mt(Be),onKeyDown:Ze=>{(Ze.key==="Enter"||Ze.key===" ")&&(Ze.preventDefault(),mt(Be))},className:"flex items-center gap-1 text-[11px] text-neutral-600 font-mono mb-0.5 cursor-pointer select-none hover:text-neutral-400 rounded focus:outline-none focus-visible:ring-1 focus-visible:ring-edge/20 [&_svg]:pointer-events-none",title:se||N("library.rootName"),children:[it?o.jsx(ns,{className:"h-3 w-3 shrink-0"}):o.jsx(Bn,{className:"h-3 w-3 shrink-0"}),o.jsx(ar,{className:"h-3 w-3 shrink-0 text-emerald-500/60"}),o.jsx("span",{className:"truncate",children:se||N("library.rootName")}),o.jsx(Qe,{variant:"skill",className:"shrink-0",children:N("library.localBadge")}),o.jsx(Qe,{className:"shrink-0",children:Pe.length})]}),!it&&o.jsx("div",{className:"space-y-0.5",children:Pe.map(Ze=>o.jsx(Zne,{skill:Ze,payload:_g({installKind:"skill",category:"skill",name:Ze.name,sourceDir:Ze.dirPath,targetAgent:H},c),installed:e.has(Ze.name),onInstall:()=>t(Ze,l,H),installDisabled:!V.ok,installReason:Y(V)},Ze.name))})]},Be)})]}),_e&&o.jsxs($i,{icon:o.jsx(Ta,{className:"h-3.5 w-3.5 text-blue-400"}),title:N("library.sectionFiles"),hint:N("library.hintClickInstall"),count:g.length,open:v(L0),onToggle:()=>X(L0),children:[A&&o.jsx("p",{className:"text-xs text-neutral-500",children:N("library.scanning")}),!A&&p===null&&o.jsx("p",{className:"text-xs text-neutral-600",children:N("library.addLibraryTemplates")}),!A&&p!==null&&g.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:N("library.noFileTemplates")}),WA.map(se=>{var it;const Pe=g.filter(Ze=>Ze.category===se);if(!Pe.length)return null;const Be=((it=ha(se,c).surfaces[0])==null?void 0:it.harness)??"claude";return o.jsxs("div",{className:"mb-1",children:[o.jsxs("div",{className:"flex items-center gap-1 text-[11px] text-neutral-600 font-mono mb-0.5",children:[o.jsx(ar,{className:"h-3 w-3 shrink-0 text-emerald-500/60"}),o.jsx("span",{className:"truncate",children:se}),o.jsx(Qe,{className:"shrink-0",children:Pe.length})]}),o.jsx("div",{className:"space-y-0.5",children:Pe.map(Ze=>{const _n=_o(ha(Ze.category,c),{scope:l,agent:Be});return o.jsx(Jne,{file:Ze,payload:_g({installKind:"file",category:Ze.category,name:Ze.name,sourceFile:Ze.filePath,targetAgent:Be},c),verdict:_n,reason:Y(_n),onInstall:()=>n(Ze,l)},Ze.filePath)})})]},se)})]}),Me&&o.jsxs($i,{icon:o.jsx(am,{className:"h-3.5 w-3.5 text-blue-400"}),title:N("library.sectionMcp"),hint:N("library.hintClickAdd"),count:b.length,open:v(P0),onToggle:()=>X(P0),children:[b.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:N("library.noMcpTemplates")}),o.jsx(I_,{agent:H,onChange:I,kind:"mcp",scope:l,capabilities:c}),b.map(se=>o.jsx(ese,{srv:se,payload:_g({installKind:"mcp",category:"mcp",name:se.name,mcpConfig:{command:se.command,...se.args&&{args:se.args},...se.env&&{env:se.env}},targetAgent:H},c),verdict:q,reason:Y(q),onInstall:()=>s(se.name,{command:se.command,...se.args&&{args:se.args},...se.env&&{env:se.env}},l,H)},se.name))]}),Fe&&o.jsxs($i,{icon:o.jsx(ix,{className:"h-3.5 w-3.5 text-violet-400"}),title:N("library.sectionPlugins"),hint:N("library.pluginsSectionHint"),count:M.length,tag:o.jsx(td,{tone:ed(Ot,M.length),children:N("library.tagInstalled",{done:Ot,total:M.length})}),open:v(z0),onToggle:()=>X(z0),children:[A&&o.jsx("p",{className:"text-xs text-neutral-500",children:N("library.scanning")}),!A&&p===null&&o.jsx("p",{className:"text-xs text-neutral-600",children:N("library.addLibraryPlugins")}),!A&&p!==null&&M.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:N("library.noPlugins")}),M.map(se=>{var _n;const Pe=(F==null?void 0:F.find(yt=>lh(yt.dir)===lh(se.dirPath)))??null,Be=`plugin:${se.relPath||se.name}`,it=rt.has(Be),Ze=Pe!==null&&T.stateOf(O_(Pe))==="loading";return o.jsxs("div",{className:"rounded-md border border-edge/[0.06] bg-edge/[0.015] px-2 py-1.5 space-y-1",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>ee(Be),onKeyDown:yt=>{(yt.key==="Enter"||yt.key===" ")&&(yt.preventDefault(),ee(Be))},className:"flex flex-wrap items-center gap-1.5 cursor-pointer select-none rounded focus:outline-none focus-visible:ring-1 focus-visible:ring-edge/20",children:[it?o.jsx(Bn,{className:"h-3 w-3 shrink-0 text-neutral-600"}):o.jsx(ns,{className:"h-3 w-3 shrink-0 text-neutral-600"}),o.jsx(ix,{className:me("h-3.5 w-3.5 shrink-0",Pe!=null&&Pe.enabled?"text-violet-400":"text-neutral-600")}),o.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-neutral-200",title:se.key?N("toolkit.keyTip",{scopes:((_n=Pe==null?void 0:Pe.scopes)==null?void 0:_n.join("+"))||N("toolkit.scopesNone")}):void 0,children:se.key??se.name}),o.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",children:["v",se.version]}),(se.ccPack||se.kind==="mod")&&o.jsx("span",{className:"shrink-0",title:N("library.ccPluginTip"),children:o.jsx(Qe,{className:"bg-blue-900/40 text-blue-300",children:N("library.badgeCcPlugin")})}),se.weavePack&&o.jsx("span",{className:"shrink-0",title:N("library.weavePluginTip"),children:o.jsx(Qe,{className:"bg-violet-900/40 text-violet-300",children:N("library.badgeWeavePlugin")})}),o.jsx(Qe,{className:me("shrink-0",z5[se.kind]),children:N(P5[se.kind])}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:N("toolkit.targets",{targets:se.targets.join("+")})}),o.jsx("span",{className:"ml-auto shrink-0",onClick:yt=>yt.stopPropagation(),onKeyDown:yt=>yt.stopPropagation(),children:Pe?se.weavePack&&!(se.ccPack||se.kind==="mod")?o.jsx(ml,{checked:Pe.enabled,disabled:Ze,onChange:yt=>void Ae(Pe,yt),title:N("library.weavePluginTip")}):Pe.installed?o.jsxs(Qe,{className:"bg-emerald-900/40 text-emerald-300",title:N("library.installedManageTip"),children:[N("library.installed")," ✓"]}):o.jsx("button",{type:"button",disabled:Ze,title:N("library.installPackTip"),onClick:()=>void Ae(Pe,!0,()=>G("success",N("library.packInstalled",{name:Pe.name}))),className:"rounded bg-blue-900/50 px-2 py-0.5 text-[10px] text-blue-200 hover:bg-blue-800/60 disabled:opacity-40",children:N(Ze?"library.installing":"library.install")}):o.jsx("span",{className:"text-[10px] text-neutral-600",title:N("library.pluginNotInToolkit"),children:"—"})})]}),it&&o.jsxs("div",{className:"pl-4 space-y-1",children:[se.description?o.jsx("p",{className:"text-[11px] text-neutral-500",title:se.description,children:se.description}):null,o.jsx("div",{className:"flex flex-wrap items-center gap-1",children:se.components.map(yt=>o.jsx(Qe,{variant:"other",className:"px-1 text-[10px]",children:yt},yt))}),se.skills.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"mb-0.5 text-[10px] text-neutral-600",title:N("library.pluginSkillsFollowTip"),children:N("library.pluginSkillsLabel")}),o.jsx("div",{className:"flex flex-wrap gap-1",children:se.skills.map(yt=>o.jsx(Qe,{variant:"skill",className:"px-1.5 text-[10px]",title:N("library.pluginSkillsFollowTip"),children:yt},yt))})]}),o.jsxs("p",{className:"text-[10px] text-neutral-600",children:[o.jsx("span",{className:"text-neutral-500",children:N("library.pluginSourceDir")})," ",o.jsx("span",{className:"font-mono",title:se.dirPath,children:se.relPath||"."})]})]})]},Be)})]}),(oe.length>0||le.length>0||ve.length>0)&&o.jsxs($i,{icon:o.jsx(ic,{className:"h-3.5 w-3.5 text-orange-400"}),title:N("library.sectionUpdates"),hint:N("library.hintOverwrite"),count:oe.length+le.length+ve.length,open:v(U0),onToggle:()=>X(U0),children:[oe.map(se=>o.jsx(F0,{label:se.name,scope:se.scope,agent:se.agent,onUpdate:()=>i("skill",se.name,se.scope,se.agent)},`skill-${se.agent??"claude"}-${se.scope}-${se.name}`)),ve.map(se=>o.jsx(F0,{label:`${se.category}/${se.name}`,scope:se.scope,onUpdate:()=>i(se.category,se.name,se.scope)},`file-${se.category}-${se.name}`)),le.map(se=>o.jsx(F0,{label:se.name,scope:se.scope,agent:se.agent,onUpdate:()=>i("mcp",se.name,se.scope,se.agent)},`mcp-${se.agent??"claude"}-${se.scope}-${se.name}`))]})]}),Me&&o.jsx(tse,{onInstall:(se,Pe)=>s(se,Pe,l,H),blockedTitle:Y(q)})]})}function Vne(e,t){switch(e){case"files":return t("catbar.files");case"personalization":return t("library.catPersonalization");case"weave":return t("catbar.hooks");case"tasks":return t("catbar.tasks");case"orchestrate":return t("catbar.orchestrate")}}function Xne({source:e}){const t=We(),n={git:{label:t("library.badgeGit"),variant:"command"},dir:{label:t("library.badgeDir"),variant:"skill"},legacy:{label:t("library.badgeExternal"),variant:"other"},builtin:{label:t("toolkit.prov.builtin"),variant:"helper"}}[e];return o.jsx(Qe,{variant:n.variant,className:"shrink-0 px-1.5 text-[10px]",children:n.label})}const I0="skill-templates",L0="file-templates",P0="mcp-templates",z0="plugin-packs",U0="update-hints";function Qne({status:e}){const t=We();if(!e)return null;const n={uptodate:{label:t("library.statusUptodate"),cls:"text-emerald-300 bg-emerald-900/30"},"update-available":{label:t("library.statusUpdateAvailable"),cls:"text-orange-300 bg-orange-900/30"},"origin-missing":{label:t("library.statusOriginMissing"),cls:"text-amber-300 bg-amber-900/30"},unknown:{label:t("library.statusUnknown"),cls:"text-neutral-400 bg-neutral-800"}}[e];return o.jsx(Qe,{className:me("shrink-0 px-1.5 text-[10px]",n.cls),children:n.label})}function Wne({item:e,selected:t,status:n,onSelect:s,onMigrate:r,onRemove:i}){const a=We(),l=xn(),c=l.stateOf(`lib-migrate:${e.id}`)==="loading",u=l.stateOf(`lib-remove:${e.id}`);return o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(e.id),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),s(e.id))},className:me("rounded-md border px-2 py-1.5 space-y-1 cursor-pointer select-none","focus:outline-none focus-visible:ring-1 focus-visible:ring-edge/20 [&_svg]:pointer-events-none",t?"border-neutral-700 bg-neutral-800/80":"border-edge/[0.06] bg-edge/[0.015] hover:bg-edge/[0.04]"),title:e.path,children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-neutral-200",title:a("repo.namespaceTip"),children:e.managed&&e.resourceId?e.resourceId:e.path}),o.jsxs("span",{className:"ml-auto shrink-0 flex items-center gap-1",children:[o.jsx(Qne,{status:n}),e.legacy&&o.jsx("button",{onClick:d=>{d.stopPropagation(),r(e)},disabled:c,title:a("library.migrateTip"),className:"rounded px-1.5 py-0.5 text-[10px] text-amber-300 bg-amber-900/30 hover:bg-amber-900/50 disabled:opacity-40",children:a(c?"library.migrating":"library.migrate")}),!e.builtin&&o.jsx("button",{onClick:d=>{d.stopPropagation(),i(e)},disabled:u==="loading",title:e.managed?a("library.removeMarketTip"):a("library.removeLegacyTip"),className:"text-neutral-500 hover:text-red-400 disabled:cursor-not-allowed",children:o.jsx(ut,{state:u,className:"h-3 w-3",icon:o.jsx(Qs,{className:"h-3 w-3"})})})]})]}),o.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-wrap",children:[o.jsx(Xne,{source:e.source}),e.tags&&mx.filter(d=>e.tags[d]!==void 0).map(d=>o.jsxs("span",{className:me(bx,Pv(d).on),children:[d,e.tags[d]>1&&o.jsxs("span",{className:"ml-1 tabular-nums text-[10px] opacity-70",children:["×",e.tags[d]]})]},d)),e.source==="git"&&(e.origin||e.importedAt)&&o.jsxs("span",{className:"ml-auto text-[10px] text-neutral-600 truncate",children:[e.origin,e.origin&&e.importedAt?" · ":"",e.importedAt?a("library.importedAt",{date:e.importedAt.slice(0,10)}):""]})]})]})}function D_(e){const t=new Map;for(const n of e){const s=t.get(n.group)??[];s.push(n),t.set(n.group,s)}return[...t.entries()].sort((n,s)=>n[0]?s[0]?n[0].localeCompare(s[0]):-1:1)}function I_({agent:e,onChange:t,kind:n,scope:s,capabilities:r}){var c,u;const i=We(),a=n==="skills"?{claude:i("library.tipSkillsClaude"),codex:i("library.tipSkillsCodex")}:{claude:i("library.tipMcpClaude"),codex:i("library.tipMcpCodex")},l=(u=(c=ha(n==="skills"?"skill":"mcp",r).surfaces.find(d=>d.harness===e))==null?void 0:c.dest)==null?void 0:u[s];return o.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500 shrink-0",children:i("library.installTarget")}),nn.map(d=>o.jsx("button",{onClick:()=>t(d),className:me("rounded px-1.5 py-0.5 text-[11px]",e===d?"bg-neutral-700 text-neutral-100":"text-neutral-500 hover:text-neutral-300"),title:a[d],children:Kn(d).label},d)),l&&o.jsxs("span",{className:"text-[10px] text-neutral-600",children:["→ ",l]})]})}function $i({icon:e,title:t,hint:n,count:s,tag:r,open:i,onToggle:a,children:l}){const c=We();return o.jsxs("section",{children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:a,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a())},className:"flex items-center gap-1.5 mb-1.5 cursor-pointer select-none rounded focus:outline-none focus-visible:ring-1 focus-visible:ring-edge/20 [&_svg]:pointer-events-none",title:c(i?"common.collapse":"common.expand"),children:[i?o.jsx(Bn,{className:"h-3 w-3 text-neutral-500"}):o.jsx(ns,{className:"h-3 w-3 text-neutral-500"}),e,o.jsx("span",{className:"text-xs font-semibold text-neutral-300",children:t}),r??(s!==void 0&&o.jsx(Qe,{variant:"other",children:s})),n&&o.jsx("span",{className:"text-[11px] text-neutral-500 ml-auto",children:n})]}),i&&o.jsx("div",{className:"space-y-0.5",children:l})]})}function F0({label:e,scope:t,agent:n,onUpdate:s}){const r=We(),{show:i}=an(),a=xn(),l=a.stateOf("update");return o.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-neutral-900",children:[o.jsx(ic,{className:"h-3 w-3 shrink-0 text-orange-400"}),o.jsx("span",{className:"truncate",children:e}),n&&n!==nn[0]&&o.jsx(Qe,{variant:"other",className:"shrink-0",children:Kn(n).label}),o.jsx(Qe,{variant:"skill",className:"shrink-0",children:t}),o.jsx("button",{onClick:()=>void a.run("update",async()=>{await s(),i("success",r("library.updatedOk",{name:e}))},{fail:c=>r("errors.updateFailed",{error:Ye(c)})}),disabled:l==="loading",className:"ml-auto text-xs text-blue-400 hover:text-blue-300 shrink-0 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-blue-400",children:r("library.update")})]})}function Zne({skill:e,payload:t,installed:n,onInstall:s,installDisabled:r,installReason:i}){const{attributes:a,listeners:l,setNodeRef:c,transform:u,isDragging:d}=im({id:`lib-skill-${e.name}`,data:t}),f=We(),{show:h}=an(),p=xn(),m=p.stateOf("install"),k=u?{transform:`translate3d(${u.x}px, ${u.y}px, 0)`}:void 0;return o.jsxs("div",{ref:c,style:k,...a,...l,className:me("flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm cursor-grab transition-colors duration-200",d&&"opacity-40","hover:bg-neutral-800/50"),title:e.dirPath,children:[o.jsx(PA,{className:"h-3 w-3 shrink-0 text-neutral-600"}),o.jsx("span",{className:"truncate",children:e.name}),n?o.jsx(Qe,{variant:"skill",className:"ml-auto",children:f("library.installed")}):o.jsx("button",{onPointerDown:w=>w.stopPropagation(),onClick:w=>{w.stopPropagation(),p.run("install",async()=>{await s(),h("success",f("library.installedOk",{name:e.name}))},{fail:g=>f("errors.installFailed",{error:Ye(g)})})},disabled:r||m==="loading",title:i,className:"ml-auto text-xs text-blue-400 hover:text-blue-300 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-blue-400",children:f("library.install")})]})}function Jne({file:e,payload:t,verdict:n,reason:s,onInstall:r}){const i=We(),{attributes:a,listeners:l,setNodeRef:c,transform:u,isDragging:d}=im({id:`lib-file-${e.filePath}`,data:t}),{show:f}=an(),h=xn(),p=h.stateOf("install"),m=u?{transform:`translate3d(${u.x}px, ${u.y}px, 0)`}:void 0;return o.jsxs("div",{ref:c,style:m,...a,...l,className:me("flex items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-neutral-900 cursor-grab transition-colors duration-200",d&&"opacity-40"),title:e.filePath,children:[o.jsx(Ta,{className:"h-3 w-3 shrink-0 text-blue-400"}),o.jsx("span",{className:"truncate",children:e.name}),o.jsx("button",{onPointerDown:k=>k.stopPropagation(),onClick:k=>{k.stopPropagation(),h.run("install",async()=>{await r(),f("success",i("library.installedOk",{name:e.name}))},{fail:w=>i("errors.installFailed",{error:Ye(w)})})},disabled:!n.ok||p==="loading",title:s,className:"ml-auto text-xs text-blue-400 hover:text-blue-300 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-blue-400",children:i("library.install")})]})}function ese({srv:e,payload:t,verdict:n,reason:s,onInstall:r}){const i=We(),{attributes:a,listeners:l,setNodeRef:c,transform:u,isDragging:d}=im({id:`lib-mcp-${e.name}`,data:t}),{show:f}=an(),h=xn(),p=h.stateOf("install"),m=u?{transform:`translate3d(${u.x}px, ${u.y}px, 0)`}:void 0;return o.jsxs("div",{ref:c,style:m,...a,...l,className:me("flex items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-neutral-900 cursor-grab transition-colors duration-200",d&&"opacity-40"),title:e.sourcePath,children:[o.jsx(am,{className:"h-3 w-3 shrink-0 text-blue-400"}),o.jsx("span",{className:"truncate",children:e.name}),o.jsx("button",{onPointerDown:k=>k.stopPropagation(),onClick:k=>{k.stopPropagation(),h.run("install",async()=>{await r(),f("success",i("library.installedOk",{name:e.name}))},{fail:w=>i("errors.mcpInstallFailed",{error:Ye(w)})})},disabled:!n.ok||p==="loading",title:s,className:"ml-auto text-xs text-blue-400 hover:text-blue-300 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-blue-400",children:i("library.install")})]})}function tse({onInstall:e,blockedTitle:t}){const[n,s]=x.useState(""),[r,i]=x.useState(""),[a,l]=x.useState(""),[c,u]=x.useState(""),d=We(),{show:f}=an(),h=xn(),p=h.stateOf("submit");function m(){if(t)return;const k=n.trim(),w=r.trim();if(!k||!w||p==="loading")return;const g=a.trim()?a.trim().split(/\s+/):void 0,y=nse(c);h.run("submit",async()=>{await e(k,{command:w,...g&&{args:g},...y&&{env:y}}),f("success",d("library.installedOk",{name:k}))},{fail:b=>d("errors.mcpInstallFailed",{error:Ye(b)})}),s(""),i(""),l(""),u("")}return o.jsxs("div",{className:"border-t border-edge/[0.06] p-3 space-y-1.5",children:[o.jsxs("h3",{className:"text-xs font-semibold text-neutral-400 uppercase flex items-center gap-1",children:[o.jsx(am,{className:"h-3 w-3"})," ",d("library.addMcpServer")]}),o.jsx("input",{value:n,onChange:k=>s(k.target.value),placeholder:d("library.mcpNamePlaceholder"),className:"w-full bg-neutral-900 rounded px-2 py-1 text-xs font-mono"}),o.jsx("input",{value:r,onChange:k=>i(k.target.value),placeholder:d("library.mcpCommandPlaceholder"),className:"w-full bg-neutral-900 rounded px-2 py-1 text-xs font-mono"}),o.jsx("input",{value:a,onChange:k=>l(k.target.value),placeholder:d("library.mcpArgsPlaceholder"),className:"w-full bg-neutral-900 rounded px-2 py-1 text-xs font-mono"}),o.jsx("textarea",{value:c,onChange:k=>u(k.target.value),placeholder:d("library.mcpEnvPlaceholder"),rows:2,className:"w-full bg-neutral-900 rounded px-2 py-1 text-xs font-mono"}),o.jsx("button",{onClick:m,disabled:!n.trim()||!r.trim()||!!t||p==="loading",title:t,className:"w-full rounded bg-blue-900/40 text-blue-300 py-1 text-xs disabled:opacity-40 disabled:cursor-not-allowed",children:d("library.addMcpServer")})]})}function nse(e){const t=e.split(`
583
+ `).map(s=>s.trim()).filter(Boolean);if(!t.length)return;const n={};for(const s of t){const r=s.indexOf("=");r>0&&(n[s.slice(0,r)]=s.slice(r+1))}return Object.keys(n).length?n:void 0}function sse({projectId:e,relPath:t,global:n,agent:s,onClose:r}){const[i,a]=x.useState(null),[l,c]=x.useState(null);x.useEffect(()=>{a(null),c(null),(n?Ee.readGlobalFile(t):Ee.readFile(e,t)).then(h=>a(h.content)).catch(h=>c(String(h)))},[e,t,n]);const u=t.endsWith(".md")||t.endsWith(".markdown"),d=i!=null&&u?pO(i):null;return o.jsxs("div",{className:"absolute right-0 top-0 h-full w-full lg:w-[min(720px,88%)] z-30 flex flex-col frosted-strong border-l border-edge/[0.08] shadow-mac",children:[o.jsxs("div",{className:"flex items-center gap-2 p-3 border-b border-edge/[0.06]",children:[o.jsx(Fd,{className:"h-4 w-4 shrink-0 text-neutral-500"}),o.jsx("span",{className:"text-xs font-mono text-neutral-300 truncate",children:t}),s&&o.jsx(mr,{agent:s,className:"shrink-0"}),o.jsx("button",{onClick:r,className:"ml-auto text-neutral-500 hover:text-neutral-300",children:o.jsx(tn,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[l&&o.jsx("p",{className:"text-red-400 text-xs",children:l}),i==null&&!l&&o.jsx(NG,{lines:14,className:"p-0"}),d&&o.jsxs(o.Fragment,{children:[d.frontmatter&&o.jsx(mO,{data:d.frontmatter}),o.jsx("div",{className:"prose prose-invert prose-sm max-w-none",children:o.jsx(Nk,{remarkPlugins:[jk],rehypePlugins:[XR],children:d.body})})]}),i!=null&&!u&&o.jsx("pre",{className:"text-xs font-mono text-neutral-300 whitespace-pre-wrap break-all bg-neutral-900 rounded-md p-3 border border-edge/[0.06]",children:i})]})]})}const rse=90,L_=90,ise={denied:"tasks.notifyDenied",unsupported:"tasks.notifyUnsupported",insecure:"tasks.notifyInsecure"};function ase({open:e,onClose:t}){var Z,te,Q,pe,V,q,Y,J,ce,ke,Ae,je,ae,Oe,ye;const{locale:n,t:s,setLocale:r}=yM(),[i,a]=x.useState(null),[l,c]=x.useState([]),[u,d]=x.useState([]),[f,h]=x.useState(null),[p,m]=x.useState(!1),[k,w]=x.useState(""),[g,y]=x.useState(!1),[b,S]=x.useState(!1),[M,E]=x.useState([]),[A,R]=x.useState(null),[D,_]=x.useState(null),z=xn(),{show:$}=an();x.useEffect(()=>{e&&Jf().then(_)},[e]);const H=x.useCallback(ge=>{(async()=>{if(ge){const be=await nM();if(be!=="granted"){$("info",s(ise[be])),_(await Jf());return}if(await pR({force:!0})!=="ok"){$("info",s("settings.pushFailed")),_(await Jf());return}}else await TJ();_(await Jf())})()},[s,$]),I=x.useCallback(async ge=>{try{const be=await ZW(ge&&(ge.baseUrl!==void 0||ge.apiKey!==void 0)?{...ge.baseUrl?{baseUrl:ge.baseUrl}:{},...ge.apiKey?{apiKey:ge.apiKey}:{}}:void 0);E(be.models)}catch(be){if(ge!=null&&ge.silent)return;throw be}},[]),[L,C]=x.useState(!1),O=x.useCallback(()=>{h(null),w(""),y(!1),S(!1),Ee.getDaemonSettings().then(ge=>{a(ge.settings),c(ge.presets),d(ge.urls??[])}).catch(ge=>h(String(ge)))},[]);x.useEffect(()=>{e&&O()},[e,O]),x.useEffect(()=>{if(e)return ki("settings",O)},[e,O]);const U=!!((Z=i==null?void 0:i.ai)!=null&&Z.baseUrl&&((te=i==null?void 0:i.ai)!=null&&te.apiKeySet)),F=((pe=(Q=i==null?void 0:i.ai)==null?void 0:Q.baseUrl)==null?void 0:pe.trim())??"",j=k.trim();if(x.useEffect(()=>{if(!e||U||F===""||j==="")return;const ge=setTimeout(()=>{I({baseUrl:F,apiKey:j,silent:!0})},700);return()=>clearTimeout(ge)},[e,U,F,j,I]),!e)return null;const N=(i==null?void 0:i.terminal.preset)??"auto",G=(i==null?void 0:i.terminal.customCommand)??"";async function T(){if(i){m(!0),h(null);try{const ge={...i,...i.ai?{ai:{baseUrl:i.ai.baseUrl,model:i.ai.model,...k!==""?{apiKey:k}:g?{apiKey:null}:{}}}:{}},be=await Ee.putDaemonSettings(ge);a(be),w(""),y(!1),r(be.locale),t()}catch(ge){h(String(ge))}finally{m(!1)}}}return un.createPortal(o.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 lg:p-6",children:[o.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),o.jsxs("div",{className:"relative w-[440px] max-w-full max-h-[calc(100dvh-1.5rem)] lg:max-h-[calc(100dvh-3rem)] rounded-2xl border border-edge/[0.08] bg-neutral-900 shadow-mac overflow-hidden flex flex-col",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx($A,{className:"h-4 w-4 text-blue-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:s("settings.title")}),o.jsx("button",{onClick:t,className:"ml-auto p-1 rounded text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",title:s("common.close"),children:o.jsx(tn,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 space-y-4",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(XP,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.language")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.languageHint")}),o.jsx("select",{value:(i==null?void 0:i.locale)??n,onChange:ge=>a(be=>be&&{...be,locale:ge.target.value}),className:"w-full rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",children:mM.map(ge=>o.jsx("option",{value:ge,children:gz[ge]},ge))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(Av,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.defaultTerminal")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.defaultTerminalHint")}),o.jsx("select",{value:N,onChange:ge=>a(be=>be&&{...be,terminal:{...be.terminal,preset:ge.target.value}}),className:"w-full rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(ge=>{const be=`preset.${ge.id}`;return o.jsx("option",{value:ge.id,children:be in bM?s(be):ge.label},ge.id)})})]}),N==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:s("settings.customCommand")}),o.jsxs("p",{className:"text-[11px] text-neutral-500",children:[o.jsx("code",{className:"text-neutral-400",children:"{path}"})," ",s("settings.pathHint"),o.jsxs("code",{className:"text-neutral-400",children:[" alacritty -e cd ","{path}"]})]}),o.jsx("input",{type:"text",value:G,onChange:ge=>a(be=>be&&{...be,terminal:{...be.terminal,customCommand:ge.target.value}}),placeholder:"my-terminal --dir {path}",className:"w-full rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:outline-none focus:ring-1 focus:ring-blue-500"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(om,{className:"h-3.5 w-3.5 text-neutral-500"}),o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:s("settings.hooks")}),o.jsx("span",{className:"ml-auto",children:o.jsx(ml,{checked:(i==null?void 0:i.hooks.enabled)??!0,onChange:ge=>a(be=>be&&{...be,hooks:{...be.hooks,enabled:ge}}),title:s("settings.hooks")})})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.hooksHint")})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Fl,{className:"h-3.5 w-3.5 text-neutral-500"}),o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:s("settings.launchOnLogin")}),o.jsx("span",{className:"ml-auto",children:o.jsx(ml,{checked:((V=i==null?void 0:i.startup)==null?void 0:V.launchOnLogin)??!1,onChange:ge=>a(be=>be&&{...be,startup:{launchOnLogin:ge}}),title:s("settings.launchOnLogin")})})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.launchOnLoginHint")})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(PP,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.retentionDays")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.retentionDaysHint")}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(nd,{value:((q=i==null?void 0:i.events)==null?void 0:q.retentionDays)??rse,min:1,max:3650,onChange:ge=>a(be=>be&&{...be,events:{retentionDays:ge}}),title:s("settings.retentionDays")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:s("settings.daysUnit")})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(DP,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.sessionIdleDays")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.sessionIdleDaysHint",{n:((Y=i==null?void 0:i.sessions)==null?void 0:Y.idleDays)??L_})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(nd,{value:((J=i==null?void 0:i.sessions)==null?void 0:J.idleDays)??L_,min:1,max:3650,onChange:ge=>a(be=>be&&{...be,sessions:{idleDays:ge}}),title:s("settings.sessionIdleDays")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:s("settings.daysUnit")})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(OA,{className:"h-3.5 w-3.5 text-neutral-500"}),o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:s("settings.push")}),o.jsx("span",{className:"ml-auto",children:o.jsx(ml,{checked:D==="on",disabled:D==null||D==="insecure"||D==="unsupported",onChange:H,title:s("settings.push")})})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s(D==="insecure"?"settings.pushInsecure":D==="unsupported"?"settings.pushUnsupported":"settings.pushHint")})]}),u.length>0&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(dl,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.accessUrls")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.accessUrlsHint")}),o.jsx("ul",{className:"space-y-1",children:u.map(ge=>o.jsxs("li",{className:"flex items-center gap-1.5",children:[o.jsxs("span",{className:ge.protocol==="https"?"rounded bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-400":"rounded bg-edge/[0.06] px-1.5 py-0.5 text-[10px] font-medium text-neutral-400",children:[ge.scope==="lan"?s("settings.urlLan"):s("settings.urlLocal")," ·"," ",ge.protocol.toUpperCase()]}),o.jsx("code",{className:"min-w-0 flex-1 truncate rounded bg-neutral-950 border border-edge/[0.06] px-2 py-1 text-[11px] text-neutral-300",children:ge.url}),o.jsx("button",{type:"button",onClick:()=>{Em(ge.url).then(be=>{if(!be){$("error",s("common.copyFailed"));return}R(ge.url),window.setTimeout(()=>R(null),1500)})},title:s("common.copy"),className:"shrink-0 rounded p-1 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",children:A===ge.url?o.jsx("span",{className:"text-[10px] text-emerald-400",children:"✓"}):o.jsx(Vu,{className:"h-3 w-3"})})]},ge.url))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-medium text-neutral-300",children:[o.jsx(GA,{className:"h-3.5 w-3.5 text-neutral-500"}),s("settings.ai")]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx("input",{value:((ce=i==null?void 0:i.ai)==null?void 0:ce.baseUrl)??"",onChange:ge=>a(be=>be===null?be:{...be,ai:{...be.ai??{model:""},baseUrl:ge.target.value}}),placeholder:s("settings.aiBaseUrlPlaceholder"),className:"min-w-0 rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500"}),o.jsxs("div",{className:"flex items-center gap-1",children:[M.length>0?o.jsxs("select",{value:((ke=i==null?void 0:i.ai)==null?void 0:ke.model)??"",onChange:ge=>a(be=>be===null?be:{...be,ai:{...be.ai??{baseUrl:""},model:ge.target.value}}),className:"min-w-0 flex-1 rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[(((Ae=i==null?void 0:i.ai)==null?void 0:Ae.model)??"")===""&&o.jsx("option",{value:"",children:s("settings.aiModelPlaceholder")}),((je=i==null?void 0:i.ai)==null?void 0:je.model)&&!M.includes(i.ai.model)&&o.jsx("option",{value:i.ai.model,children:i.ai.model}),M.map(ge=>o.jsx("option",{value:ge,children:ge},ge))]}):o.jsx("input",{value:((ae=i==null?void 0:i.ai)==null?void 0:ae.model)??"",onChange:ge=>a(be=>be===null?be:{...be,ai:{...be.ai??{baseUrl:""},model:ge.target.value}}),placeholder:s("settings.aiModelPlaceholder"),className:"min-w-0 flex-1 rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500"}),o.jsxs("button",{type:"button",onClick:()=>void z.run("ai-models",()=>{var ge;return I({baseUrl:((ge=i==null?void 0:i.ai)==null?void 0:ge.baseUrl)??"",...k!==""?{apiKey:k}:{}})},{fail:ge=>Ye(ge)}),disabled:z.stateOf("ai-models")==="loading",title:s("settings.aiModelFetchTip"),className:"shrink-0 inline-flex items-center gap-1 rounded-lg bg-neutral-800 px-2 py-1.5 text-[11px] text-neutral-300 hover:bg-neutral-700 disabled:opacity-40",children:[o.jsx(ut,{state:z.stateOf("ai-models"),className:"h-3 w-3",icon:o.jsx(ic,{className:"h-3 w-3"})}),s("settings.aiModelFetch")]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("input",{type:b?"text":"password",value:k,readOnly:!L,onFocus:()=>C(!0),onBlur:()=>C(!1),onChange:ge=>{w(ge.target.value),ge.target.value!==""&&y(!1)},name:"weaveAiApiKey",autoComplete:"one-time-code",spellCheck:!1,autoCorrect:"off",autoCapitalize:"off","data-1p-ignore":!0,"data-lpignore":"true","data-bwignore":!0,placeholder:(Oe=i==null?void 0:i.ai)!=null&&Oe.apiKeySet?s("settings.aiApiKeySet"):s("settings.aiApiKeyUnset"),className:"min-w-0 flex-1 cursor-text rounded-lg bg-neutral-800 border border-edge/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500"}),o.jsx("button",{type:"button",onClick:()=>S(ge=>!ge),title:s(b?"settings.aiApiKeyHide":"settings.aiApiKeyShow"),className:"shrink-0 rounded-lg bg-neutral-800 px-2 py-1.5 text-neutral-300 hover:bg-neutral-700",children:b?o.jsx(zP,{className:"h-3.5 w-3.5"}):o.jsx(UP,{className:"h-3.5 w-3.5"})}),((ye=i==null?void 0:i.ai)==null?void 0:ye.apiKeySet)===!0&&o.jsx("button",{type:"button",onClick:()=>{w(""),y(!0)},className:"shrink-0 rounded-lg bg-neutral-800 px-2 py-1.5 text-[11px] text-neutral-300 hover:bg-neutral-700",children:s("settings.aiApiKeyClear")})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:s("settings.aiHint")})]}),f&&o.jsx("p",{className:"text-[11px] text-red-400 break-all",children:f})]}),o.jsxs("footer",{className:"shrink-0 border-t border-edge/[0.06] px-4 py-2.5 flex items-center gap-2 frosted",children:[o.jsx("span",{className:"flex-1 text-[11px] text-neutral-500",children:i===null&&!f?s("common.loading"):""}),o.jsx("button",{onClick:t,className:"rounded-lg bg-neutral-800 px-3 py-1.5 text-xs text-neutral-300 hover:bg-neutral-700",children:s("common.cancel")}),o.jsx("button",{onClick:()=>void T(),disabled:i===null||p,className:"rounded-lg bg-blue-600 px-3 py-1.5 text-xs text-white hover:bg-blue-500 disabled:opacity-40 disabled:cursor-not-allowed",children:s(p?"common.saving":"common.save")})]})]})]}),document.body)}const lse="tasks",ose=AM.map(e=>e.key);function P_(e){return e!==void 0&&ose.includes(e)?e:lse}function z_(e){const t=e.split("/").filter(Boolean);if(t[0]==="g")return{kind:"global",category:P_(t[1])};if(t[0]==="p"){const n=Number(t[1]);return!Number.isInteger(n)||n<=0?{kind:"none"}:{kind:"project",projectId:n,category:P_(t[2]),sessionId:t[3]?decodeURIComponent(t[3]):null}}return{kind:"none"}}function cse(e){if(e.kind==="none")return"/";if(e.kind==="global")return`/g/${e.category}`;const t=`/p/${e.projectId}/${e.category}`;return e.sessionId===null?t:`${t}/${encodeURIComponent(e.sessionId)}`}let ry=typeof window>"u"?"/":window.location.pathname;const iy=new Set;function ay(e){if(ry!==e){ry=e;for(const t of iy)t()}}typeof window<"u"&&window.addEventListener("popstate",()=>ay(window.location.pathname));function use(){return ry}function dse(e){return iy.add(e),()=>iy.delete(e)}function fse(){return x.useSyncExternalStore(dse,use)}function Gi(e,t){const n=cse(e);if(typeof window>"u"||n===window.location.pathname){ay(n);return}t!=null&&t.replace?window.history.replaceState(null,"",n):window.history.pushState(null,"",n),ay(n)}const bO="weave:theme",hse={dark:"#0a0a0a",light:"#fafafa"};function pse(){try{const e=localStorage.getItem(bO);return e==="dark"||e==="light"?e:null}catch{return null}}function mse(){var e;return(e=window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"}let bo=pse()??mse();const ly=new Set;function xO(e){var t;document.documentElement.dataset.theme=e,(t=document.querySelector('meta[name="theme-color"]'))==null||t.setAttribute("content",hse[e])}function gse(){return bo}function bse(){bo=bo==="dark"?"light":"dark";try{localStorage.setItem(bO,bo)}catch{}xO(bo);for(const e of ly)e()}function xse(e){return ly.add(e),()=>ly.delete(e)}function yse(){return x.useSyncExternalStore(xse,gse)}xO(bo);const yO="zijing66/weave",vse=`https://github.com/${yO}`,vO="weave.github.stars",kse=6*60*60*1e3;function wse(e){if(e<1e3)return String(e);const t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1).replace(/\.0$/,"")}k`}function U_(){try{const e=localStorage.getItem(vO);if(!e)return null;const t=JSON.parse(e);return typeof t.count!="number"||typeof t.at!="number"||Date.now()-t.at>kse?null:t.count}catch{return null}}function Sse(e){try{localStorage.setItem(vO,JSON.stringify({count:e,at:Date.now()}))}catch{}}function Nse(){const[e,t]=x.useState(()=>U_());return x.useEffect(()=>{if(U_()!==null)return;let n=!1;return(async()=>{try{const s=await fetch(`https://api.github.com/repos/${yO}`,{headers:{accept:"application/vnd.github+json"}});if(!s.ok)return;const r=await s.json();if(n||typeof r.stargazers_count!="number")return;Sse(r.stargazers_count),t(r.stargazers_count)}catch{}})(),()=>{n=!0}},[]),e}function Ese(){const e=We(),t=xn(),[n,s]=x.useState(""),r=t.stateOf("login"),i=()=>{n&&t.run("login",async()=>{await a6(n)},{fail:a=>a instanceof qA&&a.status===401?e("auth.wrongPassword"):Ye(a)})};return o.jsx("div",{className:"grid min-h-dvh place-items-center bg-neutral-950 px-4",children:o.jsxs("form",{className:"w-full max-w-xs rounded-2xl border border-neutral-800 bg-neutral-900/60 p-6",onSubmit:a=>{a.preventDefault(),i()},children:[o.jsxs("div",{className:"mb-5 flex items-center gap-2 text-neutral-200",children:[o.jsx("img",{src:"/weave-logo.svg",alt:"",className:"h-[18px] w-[18px] shrink-0"}),o.jsx("span",{className:"text-sm font-medium",children:e("auth.title")})]}),o.jsx("input",{type:"password",value:n,autoFocus:!0,autoComplete:"current-password",name:"weaveDashboardPassword",spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",onChange:a=>s(a.target.value),placeholder:e("auth.passwordPlaceholder"),className:"w-full rounded-lg border border-neutral-800 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 placeholder:text-neutral-600 focus:border-neutral-600 focus:outline-none"}),o.jsxs("button",{type:"submit",disabled:r==="loading"||n==="",className:"mt-3 flex w-full items-center justify-center gap-2 rounded-lg bg-neutral-200 px-3 py-2 text-sm font-medium text-neutral-900 transition-colors hover:bg-neutral-100 disabled:opacity-50",children:[o.jsx(ut,{state:r}),e("auth.login")]}),o.jsx("p",{className:"mt-4 text-[11px] leading-relaxed text-neutral-600",children:e("auth.hint")})]})})}const F_=176,B_=320,H_=260,$_=440,_se=8e3,oh=(e,t,n)=>Math.min(n,Math.max(t,e)),Cse=(e,t,n)=>e.some(s=>s.harness===t&&s.key===n&&s.effective);function Tse(){const e=VA();return x.useEffect(()=>{XA()},[]),e==="unknown"?o.jsx("div",{className:"grid min-h-dvh place-items-center bg-neutral-950 text-xs text-neutral-600",children:"weave"}):e==="anonymous"?o.jsx(Ese,{}):o.jsx(Ase,{})}function Ase(){const e=We(),t=sA(),n=Xb({queryKey:["projects"],queryFn:()=>Ee.listProjects(),staleTime:1/0,refetchOnWindowFocus:"always",retry:!1}),s=Xb({queryKey:["projects","archived"],queryFn:()=>Ee.listArchivedProjects(),staleTime:1/0,refetchOnWindowFocus:"always",retry:!1}),r=n.data??[],i=s.data??[],a=x.useCallback(()=>{t.invalidateQueries({queryKey:["projects"]})},[t]),l=!n.isPending,c=fse(),u=Nse(),[d,f]=x.useState(null),[h,p]=x.useState(!1),[m,k]=x.useState([]),[w,g]=x.useState([]),{sessions:y,projectStats:b}=Kd(),[S,M]=x.useState(null),[E,A]=x.useState([]),[R,D]=x.useState([]),[_,z]=x.useState(null),[$,H]=x.useState([]),[I,L]=x.useState([]),[C,O]=x.useState({}),[U,F]=x.useState(null),{show:j}=an(),N=x.useCallback(W=>{W&&j("error",W)},[j]),G=xn(),[T,Z]=x.useState(!1),te=yse(),Q=Nl("(min-width: 1024px)"),pe=Nl("(pointer: fine)"),[V,q]=x.useState(null),[Y,J]=x.useState("tasks"),[ce,ke]=x.useState("packs"),[Ae,je]=x.useState(0),[ae,Oe]=x.useState(null),[ye,ge]=x.useState(null),[be,$e]=x.useState(()=>{const W=Number(localStorage.getItem("weave:col-left"));return Number.isFinite(W)&&W>0?oh(W,F_,B_):224}),[ft,mt]=x.useState(()=>{const W=Number(localStorage.getItem("weave:col-right"));return Number.isFinite(W)&&W>0?oh(W,H_,$_):288});x.useEffect(()=>localStorage.setItem("weave:col-left",String(be)),[be]),x.useEffect(()=>localStorage.setItem("weave:col-right",String(ft)),[ft]);const rt=qu(Pd,{activationConstraint:{distance:5}}),nt=qu(Sv,{activationConstraint:{delay:200,tolerance:8}}),ee=yv(pe?rt:nt);x.useEffect(()=>{n.isError&&n.data===void 0&&N(String(n.error))},[n.isError,n.data,n.error,N]);const[ne,Ce]=x.useState(null);x.useEffect(()=>{Ee.capabilities().then(Ce).catch(()=>{})},[]);const[v,X]=x.useState(null),de=x.useCallback(W=>{t.setQueryData(["projects"],we=>{if(!we)return we;const Re=new Map(we.map(re=>[re.id,re])),B=W.map(re=>Re.get(re)).filter(re=>!!re);for(const re of we)W.includes(re.id)||B.push(re);return B}),Ee.reorderProjects(W).catch(we=>{N(e("errors.projectReorderFailed",{error:String(we)})),a()})},[t,N,e,a]),[xe,fe]=x.useState({}),P=x.useRef(xe);P.current=xe;const oe=x.useRef(mR(_se));x.useEffect(()=>{oe.current.poke()},[xe]),x.useEffect(()=>()=>oe.current.releaseAll(),[]);const le=x.useCallback(W=>{Ee.listAssets(W.path).then(k).catch(()=>{})},[]),ve=x.useCallback(W=>{Ee.listMcp(W.id).then(D).catch(()=>{})},[]),Se=x.useRef(new Map),Ne=x.useCallback(W=>{const we=Se.current.get(W);if(we)return we;const Re=Ee.listUpdates(W).finally(()=>Se.current.delete(W));return Se.current.set(W,Re),Re},[]),ue=x.useCallback(W=>{Ne(W.id).then(z).catch(()=>{})},[Ne]);x.useEffect(()=>{d&&_&&O(W=>({...W,[d.id]:{available:_.available,needsInit:_.needsInit}}))},[_,d]);const _e=x.useCallback(W=>{Ee.listGlobalSkills(W.id).then(H).catch(()=>{})},[]),Me=x.useCallback(W=>{Ee.listPluginState(W.id).then(L).catch(()=>{})},[]),Fe=x.useCallback((W,we=!1)=>{!we&&C[W]!==void 0||Ne(W).then(Re=>{O(B=>({...B,[W]:{available:Re.available,needsInit:Re.needsInit}}))}).catch(()=>{})},[C,Ne]),De=x.useCallback(()=>{Ee.listHooksRules().then(A).catch(()=>{})},[]);x.useEffect(()=>{De()},[De]),x.useEffect(()=>(window.addEventListener("weave:rules-changed",De),()=>window.removeEventListener("weave:rules-changed",De)),[De]);const He=x.useCallback(W=>{f(W),p(!1),k([]),D([]),z(null),H([]),L([]),F(null),ge(null),J("tasks"),M(null),Oe(null),N(null),Ee.listAssets(W.path).then(k).catch(we=>N(String(we))),ve(W),ue(W),_e(W),Me(W),Ee.getStatusline(W.id).then(we=>Oe(we.config.source)).catch(()=>{})},[ve,ue,_e,Me]),Ge=x.useCallback(()=>{const W=d??r[0];W&&(p(!0),F(null),ge(null),J("tasks"),M(null),Oe(null),N(null),Ee.listGlobalFileAssets().then(g).catch(we=>N(String(we))),_e(W),Me(W),ve(W),ue(W))},[d,r,_e,Me,ve,ue]);x.useEffect(()=>{h||d||r.length===0||z_(c).kind==="none"&&(Ge(),Gi({kind:"global",category:Y},{replace:!0}))},[h,d,r,Ge,c,Y]),x.useEffect(()=>{if(!l)return;const W=z_(c);if(W.kind==="none")return;if(W.kind==="global"){h||Ge(),J(W.category),M(null);return}const we=r.find(Re=>Re.id===W.projectId);if(!we){Gi({kind:"global",category:"tasks"},{replace:!0});return}(h||(d==null?void 0:d.id)!==we.id)&&He(we),J(W.category),M(W.sessionId)},[c,l,r,h,d,He,Ge]);const xt=x.useMemo(()=>{var we;const W=new Set;for(const Re of $)for(const B of Re.skills)W.add(B.name);for(const Re of m)if(Re.category==="skill"){const B=(we=Re.relPath.match(/^[^/]+\/skills\/([^/]+)\//))==null?void 0:we[1];B&&W.add(B)}return W},[$,m]),Mt=x.useMemo(()=>{var Re;const W=new Set;for(const B of m)if(B.category==="skill"){const re=(Re=B.relPath.match(/^[^/]+\/skills\/([^/]+)\//))==null?void 0:Re[1];re&&W.add(re)}const we=R.filter(B=>B.harness==="claude").length;return{skill:W.size,mcp:we}},[m,R]),Ot=x.useMemo(()=>Ju($.map(W=>{const we=Hd(W.source);return{enabled:W.pluginKey&&we?Cse(I,we,W.pluginKey):void 0,skills:W.skills}})).effective,[$,I]),Dt=x.useMemo(()=>{const W=R.filter(B=>!B.installScopes.includes("project")).length,we=B=>R.filter(re=>re.installScopes.includes("project")&&re.scope===B).length;if(h){const B=((_==null?void 0:_.skills)??[]).filter(Ie=>Ie.scope==="user"&&Ie.outdated).length,re=((_==null?void 0:_.mcp)??[]).filter(Ie=>Ie.scope==="user"&&Ie.outdated).length;return{files:Ot+we("user")+W+w.length,outdated:B+re,statuslineSource:null,hooksRules:E.length,sessions:(y==null?void 0:y.length)??0}}const Re=m.filter(B=>B.category!=="skill"&&B.category!=="mcp").length;return{files:Mt.skill+Ot+we("project")+W+Re,outdated:((_==null?void 0:_.skills)??[]).filter(B=>B.outdated).length+((_==null?void 0:_.mcp)??[]).filter(B=>B.outdated).length,statuslineSource:ae,hooksRules:E.filter(B=>B.projectId===null||B.projectId===(d==null?void 0:d.id)).length,sessions:(y??[]).filter(B=>B.projectId===(d==null?void 0:d.id)).length}},[h,$,R,_,m,w,Mt,I,Ot,ae,E,d,y]),Wt=x.useMemo(()=>U?(h?w:m).find(we=>we.relPath===U)??null:null,[h,w,m,U]),zt=x.useRef(d);x.useEffect(()=>{zt.current=d},[d]),x.useEffect(()=>ki("projects",a),[a]),x.useEffect(()=>ki("toolkit",()=>{const W=d??r[0];W&&Me(W)}),[d,r,Me]),x.useEffect(()=>ux("project",a),[a]),x.useEffect(()=>Aa(W=>{if(W.kind==="watch.fired"){if(W.watcherSessionId!=null||typeof W.targetSessionId!="string")return;const re=y==null?void 0:y.find(vt=>vt.sessionId===W.targetSessionId),Ie=Sn((re==null?void 0:re.title)??null,W.targetSessionId),at=e(W.reason==="turnEnd"?"tasks.watchTurnEnd":W.reason==="messageFailed"?"tasks.watchMsgFailed":"tasks.watchOn",{label:Ie});j("info",at),J1(e("tasks.watchNotifyTitle"),at,`weave-watch-${W.targetSessionId}`);return}if(typeof W.sessionId!="string")return;const we=y==null?void 0:y.find(re=>re.sessionId===W.sessionId),Re=Sn((we==null?void 0:we.title)??null,W.sessionId),B=e("tasks.questionPending",{label:Re});j("info",B),J1(e("tasks.questionPendingTitle"),B,`weave-question-${W.sessionId}`)},["watch.fired","question.pending"]),[y,j,e]),x.useEffect(()=>po("terminalTopology",W=>fe(W.counts)),[]),x.useEffect(()=>po("updates",W=>O(W.counts??{})),[]),x.useEffect(()=>ux("asset",W=>{const we=zt.current;!we||W.projectPath!==we.path||(k(Re=>{if(W.kind==="unlink")return Re.filter(Ie=>Ie.relPath!==W.relPath);const B={absPath:W.absPath,relPath:W.relPath,category:W.category,mtimeMs:Date.now(),agent:W.agent,...W.isSymlink?{isSymlink:!0}:{}},re=Re.findIndex(Ie=>Ie.relPath===W.relPath);if(re>=0){const Ie=[...Re];return Ie[re]=B,Ie}return[...Re,B]}),W.category==="mcp"&&ve(we),W.category==="skill"&&_e(we),ue(we))}),[ve,ue,_e]);const Ht=x.useCallback(async(W,we="project",Re=nn[0]??"claude")=>{if(!d&&!h)return;const B=d??r[0];if(!B)return;const re=await Ee.install(B.id,{category:"skill",name:W.name,sourceDir:W.dirPath,scope:we,agent:Re});if(!re.ok)throw new Error(`${re.status} ${await re.text()}`);le(B),_e(B),ue(B)},[d,r,h,le,_e,ue]),se=x.useCallback(async(W,we="project")=>{if(!d&&!h)return;const Re=d??r[0];if(!Re)return;const B=await Ee.install(Re.id,{category:W.category,name:W.name,sourceFile:W.filePath,scope:we});if(!B.ok)throw new Error(`${B.status} ${await B.text()}`);le(Re),ue(Re)},[d,r,h,le,ue]),Pe=x.useCallback(async(W,we,Re="project",B=nn[0]??"claude")=>{var Cn;if(!d&&!h)return;const re=d??r[0];if(!re)return;const Ie=((Cn=ha("mcp",ne).surfaces.find(kr=>kr.harness===B))==null?void 0:Cn.scopes)??[],at=Ie.includes(Re)?Re:Ie[0]??"user",vt=await Ee.install(re.id,{category:"mcp",name:W,mcpConfig:we,scope:at,agent:B});if(!vt.ok)throw new Error(`${vt.status} ${await vt.text()}`);le(re),ve(re),ue(re)},[d,r,h,ne,le,ve,ue]),Be=x.useCallback(async(W,we="project",Re)=>{const B=d??r[0];if(!B)return;const re=await Ee.uninstall(B.id,{category:"skill",name:W,scope:we,...Re?{agent:Re}:{}});if(!re.ok)throw new Error(`${re.status} ${await re.text()}`);le(B),_e(B),ue(B)},[d,r,le,_e,ue]),it=x.useCallback(async(W,we="project",Re)=>{const B=d??r[0];if(!B)return;const re=await Ee.uninstall(B.id,{category:"mcp",name:W,scope:(Re??nn[0])==="claude"?we:"user",...Re?{agent:Re}:{}});if(!re.ok)throw new Error(`${re.status} ${await re.text()}`);le(B),ve(B),ue(B)},[d,r,le,ve,ue]),Ze=x.useCallback(async(W,we)=>{const Re=d??r[0];Re&&(await Ee.putMcpEnable(Re.id,W,we),ve(Re))},[d,r,ve]),_n=x.useCallback(async W=>{const we=W??d??r[0];if(!we)return{updated:0};const Re=await Ee.syncAll(we.id);if(!Re.ok)throw new Error(`${Re.status} ${await Re.text()}`);const B=await Re.json().catch(()=>null);return!h&&d&&we.id===d.id?(ue(we),le(we)):Fe(we.id,!0),{updated:Array.isArray(B==null?void 0:B.updated)?B.updated.length:0}},[d,r,h,ue,le,Fe]),yt=x.useCallback(async(W,we,Re,B)=>{const re=d??r[0];if(!re)return;const Ie=await Ee.updateAsset(re.id,{category:W,name:we,scope:Re,...(W==="skill"||W==="mcp")&&B?{agent:B}:{}});if(!Ie.ok)throw new Error(`${Ie.status} ${await Ie.text()}`);ue(re),le(re),W==="mcp"&&ve(re),W==="skill"&&_e(re)},[d,r,ue,le,ve,_e]),Br=x.useCallback(W=>G.stateOf(`sync:${W}`),[G]),Hr=x.useCallback(W=>G.run(`sync:${W.id}`,async()=>{const{updated:we}=await _n(W);we>0?j("success",e("toast.synced",{n:we})):j("info",e("toast.nothingToSync"))},{fail:we=>e("errors.syncFailed",{error:Ye(we)})}),[G,_n,j,e]),Os=x.useCallback((W,we)=>void G.run(`open-${we}:${W.id}`,async()=>{const Re=P.current[W.id]??0;await Ee.openProject(W.id,we),we==="terminal"&&await oe.current.wait(`count:${W.id}`,()=>(P.current[W.id]??0)>Re)},{fail:Re=>e("errors.openFailed",{error:Ye(Re)})}),[G,e]),Ci=x.useCallback(W=>G.stateOf(`open-explorer:${W}`),[G]),is=x.useCallback(W=>G.stateOf(`open-terminal:${W}`),[G]),$r=x.useCallback((W,we)=>void G.run(`close-terminal:${W.id}`,async()=>{const Re=P.current[W.id]??0,B=await Ee.closeProjectTerminal(W.id,we);await oe.current.wait(`close:${W.id}`,()=>(P.current[W.id]??0)<Re),j("success",e("toast.terminalsClosed",{n:B.closed}))},{fail:Re=>e("errors.closeTerminalFailed",{error:Ye(Re)})}),[G,j,e]),Da=x.useCallback(W=>G.stateOf(`close-terminal:${W}`),[G]),Gr=x.useCallback(W=>void G.run(`archive:${W.id}`,async()=>{const{purged:we}=await Ee.archiveProject(W.id);if(j("success",e("toast.projectArchived",{name:W.name,sessions:we.sessions,events:we.events})),(d==null?void 0:d.id)===W.id){const Re=r.find(B=>B.id!==W.id);Gi(Re?{kind:"project",projectId:Re.id,category:"tasks",sessionId:null}:{kind:"global",category:"tasks"},{replace:!0})}a()},{fail:we=>e("errors.archiveFailed",{error:Ye(we)})}),[G,d,r,j,e,a]),Ti=x.useCallback(W=>void G.run(`restore:${W.id}`,async()=>{await Ee.restoreProject(W.id),j("success",e("toast.projectRestored",{name:W.name})),a()},{fail:we=>e("errors.restoreFailed",{error:Ye(we)})}),[G,j,e,a]),Kr=x.useCallback(W=>G.stateOf(`restore:${W}`),[G]),xr=x.useCallback(async(W,we,Re,B)=>{const re=d??r[0];re&&(await Ee.putPluginState(re.id,W,we,Re,B),Me(re),_e(re))},[d,r,Me,_e]),Ai=x.useCallback(async(W,we)=>{const Re=d??r[0];Re&&(await Ee.uninstallPluginPack(Re.id,{runtime:W,key:we}),_e(Re),Me(Re))},[d,r,_e,Me]),qr=x.useCallback((W,we,Re)=>{Ht(W,we,Re).catch(B=>j("error",e("errors.installFailed",{error:Ye(B)})))},[Ht,j,e]),Mi=x.useCallback((W,we)=>{se(W,we).catch(Re=>j("error",e("errors.installFailed",{error:Ye(Re)})))},[se,j,e]),Ws=x.useCallback((W,we,Re,B)=>{Pe(W,we,Re,B).catch(re=>j("error",e("errors.mcpInstallFailed",{error:Ye(re)})))},[Pe,j,e]),Hn=x.useCallback((W,we,Re,B)=>{yt(W,we,Re,B).catch(re=>j("error",e("errors.updateFailed",{error:Ye(re)})))},[yt,j,e]),ji=x.useCallback((W,we,Re)=>{Be(W,we,Re).catch(B=>j("error",e("errors.uninstallFailed",{error:Ye(B)})))},[Be,j,e]),Ri=x.useCallback(W=>{Gi(h||!d?{kind:"global",category:W}:{kind:"project",projectId:d.id,category:W,sessionId:null}),W==="personalization"&&je(we=>we+1),W==="weave"&&De()},[h,d,De]),Yr=x.useCallback((W,we)=>{r.some(Re=>Re.id===W)&&Gi({kind:"project",projectId:W,category:"tasks",sessionId:we})},[r]),Oi=x.useCallback(W=>{var Re;const we=(d==null?void 0:d.id)??((Re=r[0])==null?void 0:Re.id);we!==void 0&&Gi({kind:"project",projectId:we,category:"tasks",sessionId:W})},[d,r]);function Ia(W){X(W.active.data.current??null)}function Zs(W){const{active:we,over:Re}=W,B=we.data.current;if(X(null),!Re||Re.id!=="project-assets"||!B)return;const re=h?"user":"project",Ie=_o(B.attrs,{scope:re,agent:B.targetAgent});if(!Ie.ok){Ie.reasonKey&&N(e(Ie.reasonKey));return}B.installKind==="skill"&&B.sourceDir&&B.name?qr({name:B.name,dirPath:B.sourceDir},re,B.targetAgent):B.installKind==="file"&&B.sourceFile&&B.name?Mi({name:B.name,filePath:B.sourceFile,category:B.category},re):B.installKind==="mcp"&&B.mcpConfig&&B.name&&Ws(B.name,B.mcpConfig,re,B.targetAgent)}const yr=x.useMemo(()=>{if(!ye||ye.scope==="user")return[];const{name:W,agent:we}=ye;return m.filter(Re=>{var re;return((re=Re.relPath.match(/^[^/]+\/skills\/([^/]+)\//))==null?void 0:re[1])===W&&(!we||Re.agent===we)})},[ye,m]),xs=x.useMemo(()=>ye?_==null?void 0:_.skills.find(W=>W.name===ye.name&&W.scope===ye.scope):void 0,[ye,_]),La=h?"global":"project",fn=d??r[0],vr=h&&!fn,Zt=l?o.jsx(r9,{projects:r,selectedId:d==null?void 0:d.id,globalActive:h,onSelect:W=>{Gi({kind:"project",projectId:W.id,category:"tasks",sessionId:null}),q(null)},onSelectGlobal:()=>{Gi({kind:"global",category:"tasks"}),q(null)},onOpenExplorer:W=>Os(W,"explorer"),onOpenTerminal:W=>Os(W,"terminal"),openExplorerStateOf:Ci,openTerminalStateOf:is,onCloseTerminal:$r,closeTerminalStateOf:Da,onHoverProject:Fe,updatesOf:W=>{var we;return(we=C[W])==null?void 0:we.available},needsInitOf:W=>{var we;return(we=C[W])==null?void 0:we.needsInit},syncStateOf:Br,onSyncNow:W=>void Hr(W),sessionStatsOf:W=>b.get(W),terminalsOf:W=>xe[W]??0,onReorder:de,archivedProjects:i,onArchive:Gr,onRestore:Ti,restoreStateOf:Kr}):o.jsx(Sm,{rows:7}),Di=fn?o.jsx(Yne,{installedSkillNames:xt,onInstallSkill:qr,onInstallFileAsset:Mi,onInstallMcp:Ws,updates:_,onUpdateAsset:Hn,category:Y,scope:h?"user":"project",capabilities:ne,projectId:fn.id,onSyncAll:()=>void Hr(fn)}):o.jsx("div",{className:"p-3 text-xs text-neutral-500",children:e("app.selectProjectForAssets")});return o.jsxs(Nv,{sensors:ee,onDragStart:Ia,onDragEnd:Zs,onDragCancel:()=>X(null),children:[o.jsx("div",{className:"h-dvh p-0 lg:p-4 bg-neutral-950",children:o.jsxs("div",{className:"h-full flex flex-col rounded-none lg:rounded-2xl border border-edge/[0.08] bg-neutral-900/40 shadow-mac overflow-hidden",children:[o.jsxs("div",{className:"h-11 shrink-0 flex items-center gap-2 lg:gap-3 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx("button",{onClick:()=>q("projects"),className:me("rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",Q&&"hidden"),title:e("app.mobileProjects"),children:o.jsx(e6,{className:"h-4 w-4"})}),o.jsx(Mse,{}),o.jsx("img",{src:"/weave-logo.svg",alt:"",className:"h-[18px] w-[18px] shrink-0"}),o.jsx("span",{className:"text-sm font-semibold tracking-tight text-neutral-200",children:"Weave"}),o.jsx("span",{className:"text-xs text-neutral-500",children:e("app.projectCount",{n:r.length})}),o.jsx("button",{onClick:()=>q("library"),className:me("rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",(Q||!fn)&&"hidden"),title:e("app.mobileLibrary"),children:o.jsx(zA,{className:"h-4 w-4"})}),o.jsxs("a",{href:vse,target:"_blank",rel:"noreferrer","aria-label":"GitHub",className:"ml-auto inline-flex items-center gap-1 rounded-lg px-1.5 py-1 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",children:[o.jsx(HP,{className:"h-4 w-4"}),u!==null&&o.jsx("span",{className:"text-[11px] tabular-nums",children:wse(u)})]}),o.jsx("button",{onClick:bse,className:"p-1.5 rounded-lg text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:e(te==="dark"?"app.themeToLight":"app.themeToDark"),"aria-label":e(te==="dark"?"app.themeToLight":"app.themeToDark"),children:te==="dark"?o.jsx(n6,{className:"h-4 w-4"}):o.jsx(JP,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>Z(!0),className:"p-1.5 rounded-lg text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:e("app.settingsTooltip"),children:o.jsx($A,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>void l6(),className:"p-1.5 rounded-lg text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:e("auth.logout"),children:o.jsx(WP,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[Q&&o.jsxs(o.Fragment,{children:[o.jsx("aside",{style:{width:be},className:"shrink-0 border-r border-edge/[0.06] frosted overflow-y-auto",children:Zt}),o.jsx(ey,{onResize:W=>$e(we=>oh(we+W,F_,B_)),title:e("app.resizeLeft")})]}),o.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden relative",children:[fn?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"px-4 py-2 border-b border-edge/[0.06] flex flex-wrap items-center gap-x-3 gap-y-1",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h2",{className:"text-sm font-semibold truncate",children:h?e("app.globalTitle"):(d==null?void 0:d.name)??""}),o.jsx("p",{className:"text-[11px] text-neutral-500 truncate",children:h?e("app.globalSubtitle"):(d==null?void 0:d.path)??""})]}),!h&&_&&_.available>0&&o.jsx("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-orange-900/40 text-orange-300 px-2.5 py-1 text-xs font-medium",children:_.available===1?e("app.updateCountOne"):e("app.updateCount",{n:_.available})}),!h&&_&&_.available>0&&o.jsxs("button",{onClick:()=>void G.run("sync:all",async()=>{const{updated:W}=await _n();W>0?j("success",e("toast.synced",{n:W})):j("info",e("toast.nothingToSync"))},{fail:W=>e("errors.syncFailed",{error:Ye(W)})}),title:`${e("app.syncAllTooltip",{n:_.available})}
584
+
585
+ ${e("app.scopeCoverageTooltip")}`,className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-blue-900/40 text-blue-300 px-2.5 py-1 text-xs font-medium hover:bg-blue-900/60",children:[o.jsx(ut,{state:G.stateOf("sync:all"),className:"h-3 w-3"}),e("app.syncAll")]}),!h&&(_==null?void 0:_.needsInit)&&o.jsx("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-amber-900/40 text-amber-300 px-2.5 py-1 text-xs font-medium",title:e("project.needsInitTip"),children:e("project.needsInit")}),!h&&d&&o.jsx("span",{className:"shrink-0 hidden lg:inline-flex rounded-full bg-neutral-800/60 text-neutral-500 px-2.5 py-1 text-[11px]",title:e("app.scopeCoverageTooltip"),children:e("app.scopeCoverageChip")})]}),o.jsx(v9,{category:Y,onSelect:Ri,data:Dt}),o.jsx("div",{className:me("flex-1 relative",Y==="tasks"&&!h?"overflow-hidden !p-0":"overflow-y-auto p-3"),children:vr?o.jsx("p",{className:"text-xs text-neutral-500",children:e("app.needProjectAnchor")}):l?o.jsx(ZJ,{projectId:fn.id,mode:La,category:Y,resourceView:ce,onResourceViewChange:ke,statuslineNonce:Ae,assets:m,globalAssets:w,mcpRows:R,updates:_,globalSkillGroups:$,pluginRows:I,statuslineSource:ae,onUninstallSkill:Be,onUninstallMcp:it,onCycleMcpEnable:Ze,onCyclePluginState:xr,onUninstallPlugin:Ai,onOpenFile:W=>{F(W),ge(null)},onOpenSkillDetail:(W,we,Re,B,re)=>{F(null),ge({name:W,scope:we,source:Re,pluginKey:B,agent:re})},projects:r,onOpenSession:Yr,onSelectSession:Oi,initialSessionId:S??void 0,dragPayload:v}):o.jsx(EG,{})})]}):o.jsx("div",{className:"flex-1 flex items-center justify-center text-neutral-500 text-sm",children:e("app.selectProject")}),U&&fn&&o.jsx(sse,{projectId:fn.id,relPath:U,global:h,agent:Wt==null?void 0:Wt.agent,onClose:()=>F(null)}),ye&&o.jsx($ne,{projectId:(fn==null?void 0:fn.id)??0,name:ye.name,scope:ye.scope,source:ye.source,pluginKey:ye.pluginKey,agent:ye.agent,files:yr,readOnly:!h&&ye.scope==="user",outdated:(xs==null?void 0:xs.outdated)??!1,custom:(xs==null?void 0:xs.custom)??!1,onUninstall:()=>{ji(ye.name,ye.scope,ye.agent),ge(null)},onClose:()=>ge(null)},`${ye.scope}-${ye.name}`)]}),Q&&o.jsxs(o.Fragment,{children:[o.jsx(ey,{onResize:W=>mt(we=>oh(we-W,H_,$_)),title:e("app.resizeRight")}),o.jsx("aside",{style:{width:ft},className:"shrink-0 border-l border-edge/[0.06] frosted overflow-hidden",children:Di})]})]})]})}),!Q&&V!==null&&o.jsxs("div",{className:"fixed inset-0 z-40",children:[o.jsx("button",{"aria-label":e("app.mobileDrawerClose"),onClick:()=>q(null),className:"absolute inset-0 bg-black/60 backdrop-blur-sm drawer-fade"}),o.jsxs("aside",{className:me("absolute top-0 bottom-0 w-[min(88vw,360px)] bg-neutral-900 border-edge/[0.08] shadow-mac flex flex-col",V==="projects"?"left-0 border-r drawer-left":"right-0 border-l drawer-right"),children:[o.jsxs("div",{className:"h-11 shrink-0 flex items-center gap-2 px-4 border-b border-edge/[0.06] frosted",children:[o.jsx("span",{className:"text-sm font-semibold tracking-tight text-neutral-200",children:e(V==="projects"?"app.mobileProjects":"app.mobileLibrary")}),o.jsx("button",{onClick:()=>q(null),className:"ml-auto rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",title:e("app.mobileDrawerClose"),children:o.jsx(tn,{className:"h-4 w-4"})})]}),V==="projects"?o.jsx("div",{className:"flex-1 overflow-y-auto",children:Zt}):o.jsx("div",{className:"flex-1 overflow-hidden",children:Di})]})]}),o.jsx(ase,{open:T,onClose:()=>Z(!1)}),o.jsx(sZ,{})]})}function Mse(){return o.jsxs("div",{className:"hidden sm:flex gap-1.5 shrink-0",children:[o.jsx("span",{className:"h-3 w-3 rounded-full bg-mac-red"}),o.jsx("span",{className:"h-3 w-3 rounded-full bg-mac-yellow"}),o.jsx("span",{className:"h-3 w-3 rounded-full bg-mac-green"})]})}const jse=new q4({defaultOptions:{queries:{staleTime:1/0,refetchOnWindowFocus:!1,retry:!1}}});"serviceWorker"in navigator&&window.isSecureContext&&navigator.serviceWorker.register("/sw.js").catch(()=>{});y4.createRoot(document.getElementById("root")).render(o.jsx(Jn.StrictMode,{children:o.jsx(v4,{client:jse,children:o.jsx(Yz,{children:o.jsx(n9,{children:o.jsx(y9,{children:o.jsx(Tse,{})})})})})}));