@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
@@ -1,560 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Ay=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eE={exports:{}},Jf={};/**
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 qj=Symbol.for("react.transitional.element"),Yj=Symbol.for("react.fragment");function tE(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:qj,type:e,key:r,ref:t!==void 0?t:null,props:n}}Jf.Fragment=Yj;Jf.jsx=tE;Jf.jsxs=tE;eE.exports=Jf;var o=eE.exports,nE={exports:{}},nt={};/**
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 J0=Symbol.for("react.transitional.element"),Vj=Symbol.for("react.portal"),Xj=Symbol.for("react.fragment"),Wj=Symbol.for("react.strict_mode"),Zj=Symbol.for("react.profiler"),Qj=Symbol.for("react.consumer"),Jj=Symbol.for("react.context"),e5=Symbol.for("react.forward_ref"),t5=Symbol.for("react.suspense"),n5=Symbol.for("react.memo"),rE=Symbol.for("react.lazy"),r5=Symbol.for("react.activity"),My=Symbol.iterator;function i5(e){return e===null||typeof e!="object"?null:(e=My&&e[My]||e["@@iterator"],typeof e=="function"?e:null)}var iE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sE=Object.assign,aE={};function ql(e,t,n){this.props=e,this.context=t,this.refs=aE,this.updater=n||iE}ql.prototype.isReactComponent={};ql.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")};ql.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lE(){}lE.prototype=ql.prototype;function eb(e,t,n){this.props=e,this.context=t,this.refs=aE,this.updater=n||iE}var tb=eb.prototype=new lE;tb.constructor=eb;sE(tb,ql.prototype);tb.isPureReactComponent=!0;var jy=Array.isArray;function tg(){}var Ht={H:null,A:null,T:null,S:null},oE=Object.prototype.hasOwnProperty;function nb(e,t,n){var r=n.ref;return{$$typeof:J0,type:e,key:t,ref:r!==void 0?r:null,props:n}}function s5(e,t){return nb(e.type,t,e.props)}function rb(e){return typeof e=="object"&&e!==null&&e.$$typeof===J0}function a5(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Oy=/\/+/g;function Zp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?a5(""+e.key):t.toString(36)}function l5(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(tg,tg):(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 Ha(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case J0:case Vj:a=!0;break;case rE:return a=e._init,Ha(a(e._payload),t,n,r,i)}}if(a)return i=i(e),a=r===""?"."+Zp(e,0):r,jy(i)?(n="",a!=null&&(n=a.replace(Oy,"$&/")+"/"),Ha(i,t,n,"",function(u){return u})):i!=null&&(rb(i)&&(i=s5(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(Oy,"$&/")+"/")+a)),t.push(i)),1;a=0;var l=r===""?".":r+":";if(jy(e))for(var c=0;c<e.length;c++)r=e[c],s=l+Zp(r,c),a+=Ha(r,t,n,s,i);else if(c=i5(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,s=l+Zp(r,c++),a+=Ha(r,t,n,s,i);else if(s==="object"){if(typeof e.then=="function")return Ha(l5(e),t,n,r,i);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 Cu(e,t,n){if(e==null)return e;var r=[],i=0;return Ha(e,r,"","",function(s){return t.call(n,s,i++)}),r}function o5(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 Ry=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)},c5={map:Cu,forEach:function(e,t,n){Cu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Cu(e,function(){t++}),t},toArray:function(e){return Cu(e,function(t){return t})||[]},only:function(e){if(!rb(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};nt.Activity=r5;nt.Children=c5;nt.Component=ql;nt.Fragment=Xj;nt.Profiler=Zj;nt.PureComponent=eb;nt.StrictMode=Wj;nt.Suspense=t5;nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ht;nt.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ht.H.useMemoCache(e)}};nt.cache=function(e){return function(){return e.apply(null,arguments)}};nt.cacheSignal=function(){return null};nt.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=sE({},e.props),i=e.key;if(t!=null)for(s in t.key!==void 0&&(i=""+t.key),t)!oE.call(t,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&t.ref===void 0||(r[s]=t[s]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var a=Array(s),l=0;l<s;l++)a[l]=arguments[l+2];r.children=a}return nb(e.type,i,r)};nt.createContext=function(e){return e={$$typeof:Jj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Qj,_context:e},e};nt.createElement=function(e,t,n){var r,i={},s=null;if(t!=null)for(r in t.key!==void 0&&(s=""+t.key),t)oE.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return nb(e,s,i)};nt.createRef=function(){return{current:null}};nt.forwardRef=function(e){return{$$typeof:e5,render:e}};nt.isValidElement=rb;nt.lazy=function(e){return{$$typeof:rE,_payload:{_status:-1,_result:e},_init:o5}};nt.memo=function(e,t){return{$$typeof:n5,type:e,compare:t===void 0?null:t}};nt.startTransition=function(e){var t=Ht.T,n={};Ht.T=n;try{var r=e(),i=Ht.S;i!==null&&i(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(tg,Ry)}catch(s){Ry(s)}finally{t!==null&&n.types!==null&&(t.types=n.types),Ht.T=t}};nt.unstable_useCacheRefresh=function(){return Ht.H.useCacheRefresh()};nt.use=function(e){return Ht.H.use(e)};nt.useActionState=function(e,t,n){return Ht.H.useActionState(e,t,n)};nt.useCallback=function(e,t){return Ht.H.useCallback(e,t)};nt.useContext=function(e){return Ht.H.useContext(e)};nt.useDebugValue=function(){};nt.useDeferredValue=function(e,t){return Ht.H.useDeferredValue(e,t)};nt.useEffect=function(e,t){return Ht.H.useEffect(e,t)};nt.useEffectEvent=function(e){return Ht.H.useEffectEvent(e)};nt.useId=function(){return Ht.H.useId()};nt.useImperativeHandle=function(e,t,n){return Ht.H.useImperativeHandle(e,t,n)};nt.useInsertionEffect=function(e,t){return Ht.H.useInsertionEffect(e,t)};nt.useLayoutEffect=function(e,t){return Ht.H.useLayoutEffect(e,t)};nt.useMemo=function(e,t){return Ht.H.useMemo(e,t)};nt.useOptimistic=function(e,t){return Ht.H.useOptimistic(e,t)};nt.useReducer=function(e,t,n){return Ht.H.useReducer(e,t,n)};nt.useRef=function(e){return Ht.H.useRef(e)};nt.useState=function(e){return Ht.H.useState(e)};nt.useSyncExternalStore=function(e,t,n){return Ht.H.useSyncExternalStore(e,t,n)};nt.useTransition=function(){return Ht.H.useTransition()};nt.version="19.2.8";nE.exports=nt;var y=nE.exports;const In=$c(y);var cE={exports:{}},ep={},uE={exports:{}},dE={};/**
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(A,M){var P=A.length;A.push(M);e:for(;0<P;){var H=P-1>>>1,E=A[H];if(0<i(E,M))A[H]=M,A[P]=E,P=H;else break e}}function n(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var M=A[0],P=A.pop();if(P!==M){A[0]=P;e:for(var H=0,E=A.length,j=E>>>1;H<j;){var B=2*(H+1)-1,O=A[B],Q=B+1,F=A[Q];if(0>i(O,P))Q<E&&0>i(F,O)?(A[H]=F,A[Q]=P,H=Q):(A[H]=O,A[B]=P,H=B);else if(Q<E&&0>i(F,P))A[H]=F,A[Q]=P,H=Q;else break e}}return M}function i(A,M){var P=A.sortIndex-M.sortIndex;return P!==0?P:A.id-M.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,p=3,h=!1,g=!1,k=!1,w=!1,m=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function S(A){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=A)r(u),M.sortIndex=M.expirationTime,t(c,M);else break;M=n(u)}}function T(A){if(k=!1,S(A),!g)if(n(c)!==null)g=!0,N||(N=!0,$());else{var M=n(u);M!==null&&D(T,M.startTime-A)}}var N=!1,_=-1,R=5,L=-1;function C(){return w?!0:!(e.unstable_now()-L<R)}function U(){if(w=!1,N){var A=e.unstable_now();L=A;var M=!0;try{e:{g=!1,k&&(k=!1,b(_),_=-1),h=!0;var P=p;try{t:{for(S(A),f=n(c);f!==null&&!(f.expirationTime>A&&C());){var H=f.callback;if(typeof H=="function"){f.callback=null,p=f.priorityLevel;var E=H(f.expirationTime<=A);if(A=e.unstable_now(),typeof E=="function"){f.callback=E,S(A),M=!0;break t}f===n(c)&&r(c),S(A)}else r(c);f=n(c)}if(f!==null)M=!0;else{var j=n(u);j!==null&&D(T,j.startTime-A),M=!1}}break e}finally{f=null,p=P,h=!1}M=void 0}}finally{M?$():N=!1}}}var $;if(typeof v=="function")$=function(){v(U)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,I=G.port2;G.port1.onmessage=U,$=function(){I.postMessage(null)}}else $=function(){m(U,0)};function D(A,M){_=m(function(){A(e.unstable_now())},M)}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(A){A.callback=null},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(A){switch(p){case 1:case 2:case 3:var M=3;break;default:M=p}var P=p;p=M;try{return A()}finally{p=P}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(A,M){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var P=p;p=A;try{return M()}finally{p=P}},e.unstable_scheduleCallback=function(A,M,P){var H=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?H+P:H):P=H,A){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=P+E,A={id:d++,callback:M,priorityLevel:A,startTime:P,expirationTime:E,sortIndex:-1},P>H?(A.sortIndex=P,t(u,A),n(c)===null&&A===n(u)&&(k?(b(_),_=-1):k=!0,D(T,P-H))):(A.sortIndex=E,t(c,A),g||h||(g=!0,N||(N=!0,$()))),A},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(A){var M=p;return function(){var P=p;p=M;try{return A.apply(this,arguments)}finally{p=P}}}})(dE);uE.exports=dE;var u5=uE.exports,fE={exports:{}},Bn={};/**
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 d5=y;function pE(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 Ui(){}var zn={d:{f:Ui,r:function(){throw Error(pE(522))},D:Ui,C:Ui,L:Ui,m:Ui,X:Ui,S:Ui,M:Ui},p:0,findDOMNode:null},f5=Symbol.for("react.portal");function p5(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f5,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var zo=d5.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function tp(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=zn;Bn.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(pE(299));return p5(e,t,null,n)};Bn.flushSync=function(e){var t=zo.T,n=zn.p;try{if(zo.T=null,zn.p=2,e)return e()}finally{zo.T=t,zn.p=n,zn.d.f()}};Bn.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,zn.d.C(e,t))};Bn.prefetchDNS=function(e){typeof e=="string"&&zn.d.D(e)};Bn.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=tp(n,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,s=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?zn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:s}):n==="script"&&zn.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:s,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Bn.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=tp(t.as,t.crossOrigin);zn.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&&zn.d.M(e)};Bn.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=tp(n,t.crossOrigin);zn.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Bn.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=tp(t.as,t.crossOrigin);zn.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 zn.d.m(e)};Bn.requestFormReset=function(e){zn.d.r(e)};Bn.unstable_batchedUpdates=function(e,t){return e(t)};Bn.useFormState=function(e,t,n){return zo.H.useFormState(e,t,n)};Bn.useFormStatus=function(){return zo.H.useHostTransitionStatus()};Bn.version="19.2.8";function hE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hE)}catch(e){console.error(e)}}hE(),fE.exports=Bn;var ln=fE.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 hn=u5,mE=y,h5=ln;function Ee(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 gE(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Gc(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 bE(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 xE(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 Dy(e){if(Gc(e)!==e)throw Error(Ee(188))}function m5(e){var t=e.alternate;if(!t){if(t=Gc(e),t===null)throw Error(Ee(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Dy(i),e;if(s===r)return Dy(i),t;s=s.sibling}throw Error(Ee(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a)throw Error(Ee(189))}}if(n.alternate!==r)throw Error(Ee(190))}if(n.tag!==3)throw Error(Ee(188));return n.stateNode.current===n?e:t}function yE(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=yE(e),t!==null)return t;e=e.sibling}return null}var Ft=Object.assign,g5=Symbol.for("react.element"),Tu=Symbol.for("react.transitional.element"),Co=Symbol.for("react.portal"),Ya=Symbol.for("react.fragment"),vE=Symbol.for("react.strict_mode"),ng=Symbol.for("react.profiler"),kE=Symbol.for("react.consumer"),ki=Symbol.for("react.context"),ib=Symbol.for("react.forward_ref"),rg=Symbol.for("react.suspense"),ig=Symbol.for("react.suspense_list"),sb=Symbol.for("react.memo"),Vi=Symbol.for("react.lazy"),sg=Symbol.for("react.activity"),b5=Symbol.for("react.memo_cache_sentinel"),Iy=Symbol.iterator;function po(e){return e===null||typeof e!="object"?null:(e=Iy&&e[Iy]||e["@@iterator"],typeof e=="function"?e:null)}var x5=Symbol.for("react.client.reference");function ag(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===x5?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ya:return"Fragment";case ng:return"Profiler";case vE:return"StrictMode";case rg:return"Suspense";case ig:return"SuspenseList";case sg:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Co:return"Portal";case ki:return e.displayName||"Context";case kE:return(e._context.displayName||"Context")+".Consumer";case ib:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case sb:return t=e.displayName||null,t!==null?t:ag(e.type)||"Memo";case Vi:t=e._payload,e=e._init;try{return ag(e(t))}catch{}}return null}var To=Array.isArray,Qe=mE.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,kt=h5.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ys={pending:!1,data:null,method:null,action:null},lg=[],Va=-1;function si(e){return{current:e}}function yn(e){0>Va||(e.current=lg[Va],lg[Va]=null,Va--)}function Rt(e,t){Va++,lg[Va]=e.current,e.current=t}var ti=si(null),ac=si(null),us=si(null),Zd=si(null);function Qd(e,t){switch(Rt(us,t),Rt(ac,e),Rt(ti,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hv(t),e=H_(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}yn(ti),Rt(ti,e)}function El(){yn(ti),yn(ac),yn(us)}function og(e){e.memoizedState!==null&&Rt(Zd,e);var t=ti.current,n=H_(t,e.type);t!==n&&(Rt(ac,e),Rt(ti,n))}function Jd(e){ac.current===e&&(yn(ti),yn(ac)),Zd.current===e&&(yn(Zd),bc._currentValue=Ys)}var Qp,Ly;function Us(e){if(Qp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qp=t&&t[1]||"",Ly=-1<n.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Qp+e+Ly}var Jp=!1;function eh(e,t){if(!e||Jp)return"";Jp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={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(h){var p=h}Reflect.construct(e,[],f)}else{try{f.call()}catch(h){p=h}e.call(f.prototype)}}else{try{throw Error()}catch(h){p=h}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(h){if(h&&p&&typeof h.stack=="string")return[h.stack,p.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=r.DetermineComponentFrameRoot(),a=s[0],l=s[1];if(a&&l){var c=a.split(`
44
- `),u=l.split(`
45
- `);for(i=r=0;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;for(;i<u.length&&!u[i].includes("DetermineComponentFrameRoot");)i++;if(r===c.length||i===u.length)for(r=c.length-1,i=u.length-1;1<=r&&0<=i&&c[r]!==u[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==u[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==u[i]){var d=`
46
- `+c[r].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}while(1<=r&&0<=i);break}}}finally{Jp=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Us(n):""}function y5(e,t){switch(e.tag){case 26:case 27:case 5:return Us(e.type);case 16:return Us("Lazy");case 13:return e.child!==t&&t!==null?Us("Suspense Fallback"):Us("Suspense");case 19:return Us("SuspenseList");case 0:case 15:return eh(e.type,!1);case 11:return eh(e.type.render,!1);case 1:return eh(e.type,!0);case 31:return Us("Activity");default:return""}}function zy(e){try{var t="",n=null;do t+=y5(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
47
- Error generating stack: `+r.message+`
48
- `+r.stack}}var cg=Object.prototype.hasOwnProperty,ab=hn.unstable_scheduleCallback,th=hn.unstable_cancelCallback,v5=hn.unstable_shouldYield,k5=hn.unstable_requestPaint,lr=hn.unstable_now,w5=hn.unstable_getCurrentPriorityLevel,wE=hn.unstable_ImmediatePriority,SE=hn.unstable_UserBlockingPriority,ef=hn.unstable_NormalPriority,S5=hn.unstable_LowPriority,EE=hn.unstable_IdlePriority,E5=hn.log,N5=hn.unstable_setDisableYieldValue,Kc=null,or=null;function rs(e){if(typeof E5=="function"&&N5(e),or&&typeof or.setStrictMode=="function")try{or.setStrictMode(Kc,e)}catch{}}var cr=Math.clz32?Math.clz32:T5,_5=Math.log,C5=Math.LN2;function T5(e){return e>>>=0,e===0?32:31-(_5(e)/C5|0)|0}var Au=256,Mu=262144,ju=4194304;function Bs(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 np(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,s=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~s,r!==0?i=Bs(r):(a&=l,a!==0?i=Bs(a):n||(n=l&~e,n!==0&&(i=Bs(n))))):(l=r&~s,l!==0?i=Bs(l):a!==0?i=Bs(a):n||(n=r&~e,n!==0&&(i=Bs(n)))),i===0?0:t!==0&&t!==i&&!(t&s)&&(s=i&-i,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:i}function qc(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function A5(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 NE(){var e=ju;return ju<<=1,!(ju&62914560)&&(ju=4194304),e}function nh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Yc(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function M5(e,t,n,r,i,s){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-cr(n),f=1<<d;l[d]=0,c[d]=-1;var p=u[d];if(p!==null)for(u[d]=null,d=0;d<p.length;d++){var h=p[d];h!==null&&(h.lane&=-536870913)}n&=~f}r!==0&&_E(e,r,0),s!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=s&~(a&~t))}function _E(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-cr(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function CE(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-cr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function TE(e,t){var n=t&-t;return n=n&42?1:lb(n),n&(e.suspendedLanes|t)?0:n}function lb(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 ob(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function AE(){var e=kt.p;return e!==0?e:(e=window.event,e===void 0?32:Q_(e.type))}function Py(e,t){var n=kt.p;try{return kt.p=e,t()}finally{kt.p=n}}var _s=Math.random().toString(36).slice(2),wn="__reactFiber$"+_s,Wn="__reactProps$"+_s,Yl="__reactContainer$"+_s,ug="__reactEvents$"+_s,j5="__reactListeners$"+_s,O5="__reactHandles$"+_s,Uy="__reactResources$"+_s,Vc="__reactMarker$"+_s;function cb(e){delete e[wn],delete e[Wn],delete e[ug],delete e[j5],delete e[O5]}function Xa(e){var t=e[wn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Yl]||n[wn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=qv(e);e!==null;){if(n=e[wn])return n;e=qv(e)}return t}e=n,n=e.parentNode}return null}function Vl(e){if(e=e[wn]||e[Yl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ao(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Ee(33))}function ol(e){var t=e[Uy];return t||(t=e[Uy]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xn(e){e[Vc]=!0}var ME=new Set,jE={};function wa(e,t){Nl(e,t),Nl(e+"Capture",t)}function Nl(e,t){for(jE[e]=t,e=0;e<t.length;e++)ME.add(t[e])}var R5=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]*$"),By={},Hy={};function D5(e){return cg.call(Hy,e)?!0:cg.call(By,e)?!1:R5.test(e)?Hy[e]=!0:(By[e]=!0,!1)}function Nd(e,t,n){if(D5(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Ou(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 ui(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function br(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function OE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function I5(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dg(e){if(!e._valueTracker){var t=OE(e)?"checked":"value";e._valueTracker=I5(e,t,""+e[t])}}function RE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=OE(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function tf(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 L5=/[\n"\\]/g;function kr(e){return e.replace(L5,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function fg(e,t,n,r,i,s,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=""+br(t)):e.value!==""+br(t)&&(e.value=""+br(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?pg(e,a,br(t)):n!=null?pg(e,a,br(n)):r!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+br(l):e.removeAttribute("name")}function DE(e,t,n,r,i,s,a,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){dg(e);return}n=n!=null?""+br(n):"",t=t!=null?""+br(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),dg(e)}function pg(e,t,n){t==="number"&&tf(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function cl(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+br(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function IE(e,t,n){if(t!=null&&(t=""+br(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+br(n):""}function LE(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(Ee(92));if(To(r)){if(1<r.length)throw Error(Ee(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=br(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),dg(e)}function _l(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var z5=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 Fy(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||z5.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function zE(e,t,n){if(t!=null&&typeof t!="object")throw Error(Ee(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Fy(e,i,r)}else for(var s in t)t.hasOwnProperty(s)&&Fy(e,s,t[s])}function ub(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 P5=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"]]),U5=/^[\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 _d(e){return U5.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function wi(){}var hg=null;function db(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wa=null,ul=null;function $y(e){var t=Vl(e);if(t&&(e=t.stateNode)){var n=e[Wn]||null;e:switch(e=t.stateNode,t.type){case"input":if(fg(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="'+kr(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Wn]||null;if(!i)throw Error(Ee(90));fg(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&RE(r)}break e;case"textarea":IE(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&cl(e,!!n.multiple,t,!1)}}}var rh=!1;function PE(e,t,n){if(rh)return e(t,n);rh=!0;try{var r=e(t);return r}finally{if(rh=!1,(Wa!==null||ul!==null)&&(hp(),Wa&&(t=Wa,e=ul,ul=Wa=null,$y(t),e)))for(t=0;t<e.length;t++)$y(e[t])}}function lc(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Wn]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Ee(231,t,typeof n));return n}var Ti=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mg=!1;if(Ti)try{var ho={};Object.defineProperty(ho,"passive",{get:function(){mg=!0}}),window.addEventListener("test",ho,ho),window.removeEventListener("test",ho,ho)}catch{mg=!1}var is=null,fb=null,Cd=null;function UE(){if(Cd)return Cd;var e,t=fb,n=t.length,r,i="value"in is?is.value:is.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[s-r];r++);return Cd=i.slice(e,1<r?1-r:void 0)}function Td(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 Ru(){return!0}function Gy(){return!1}function Zn(e){function t(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Ru:Gy,this.isPropagationStopped=Gy,this}return Ft(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=Ru)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ru)},persist:function(){},isPersistent:Ru}),t}var Sa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rp=Zn(Sa),Xc=Ft({},Sa,{view:0,detail:0}),B5=Zn(Xc),ih,sh,mo,ip=Ft({},Xc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pb,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!==mo&&(mo&&e.type==="mousemove"?(ih=e.screenX-mo.screenX,sh=e.screenY-mo.screenY):sh=ih=0,mo=e),ih)},movementY:function(e){return"movementY"in e?e.movementY:sh}}),Ky=Zn(ip),H5=Ft({},ip,{dataTransfer:0}),F5=Zn(H5),$5=Ft({},Xc,{relatedTarget:0}),ah=Zn($5),G5=Ft({},Sa,{animationName:0,elapsedTime:0,pseudoElement:0}),K5=Zn(G5),q5=Ft({},Sa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Y5=Zn(q5),V5=Ft({},Sa,{data:0}),qy=Zn(V5),X5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},W5={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"},Z5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q5(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Z5[e])?!!t[e]:!1}function pb(){return Q5}var J5=Ft({},Xc,{key:function(e){if(e.key){var t=X5[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Td(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?W5[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pb,charCode:function(e){return e.type==="keypress"?Td(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Td(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),e3=Zn(J5),t3=Ft({},ip,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yy=Zn(t3),n3=Ft({},Xc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pb}),r3=Zn(n3),i3=Ft({},Sa,{propertyName:0,elapsedTime:0,pseudoElement:0}),s3=Zn(i3),a3=Ft({},ip,{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}),l3=Zn(a3),o3=Ft({},Sa,{newState:0,oldState:0}),c3=Zn(o3),u3=[9,13,27,32],hb=Ti&&"CompositionEvent"in window,Po=null;Ti&&"documentMode"in document&&(Po=document.documentMode);var d3=Ti&&"TextEvent"in window&&!Po,BE=Ti&&(!hb||Po&&8<Po&&11>=Po),Vy=" ",Xy=!1;function HE(e,t){switch(e){case"keyup":return u3.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Za=!1;function f3(e,t){switch(e){case"compositionend":return FE(t);case"keypress":return t.which!==32?null:(Xy=!0,Vy);case"textInput":return e=t.data,e===Vy&&Xy?null:e;default:return null}}function p3(e,t){if(Za)return e==="compositionend"||!hb&&HE(e,t)?(e=UE(),Cd=fb=is=null,Za=!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 BE&&t.locale!=="ko"?null:t.data;default:return null}}var h3={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 Wy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!h3[e.type]:t==="textarea"}function $E(e,t,n,r){Wa?ul?ul.push(r):ul=[r]:Wa=r,t=vf(t,"onChange"),0<t.length&&(n=new rp("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Uo=null,oc=null;function m3(e){P_(e,0)}function sp(e){var t=Ao(e);if(RE(t))return e}function Zy(e,t){if(e==="change")return t}var GE=!1;if(Ti){var lh;if(Ti){var oh="oninput"in document;if(!oh){var Qy=document.createElement("div");Qy.setAttribute("oninput","return;"),oh=typeof Qy.oninput=="function"}lh=oh}else lh=!1;GE=lh&&(!document.documentMode||9<document.documentMode)}function Jy(){Uo&&(Uo.detachEvent("onpropertychange",KE),oc=Uo=null)}function KE(e){if(e.propertyName==="value"&&sp(oc)){var t=[];$E(t,oc,e,db(e)),PE(m3,t)}}function g3(e,t,n){e==="focusin"?(Jy(),Uo=t,oc=n,Uo.attachEvent("onpropertychange",KE)):e==="focusout"&&Jy()}function b3(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sp(oc)}function x3(e,t){if(e==="click")return sp(t)}function y3(e,t){if(e==="input"||e==="change")return sp(t)}function v3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dr=typeof Object.is=="function"?Object.is:v3;function cc(e,t){if(dr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!cg.call(t,i)||!dr(e[i],t[i]))return!1}return!0}function ev(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tv(e,t){var n=ev(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ev(n)}}function qE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function YE(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=tf(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=tf(e.document)}return t}function mb(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 k3=Ti&&"documentMode"in document&&11>=document.documentMode,Qa=null,gg=null,Bo=null,bg=!1;function nv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bg||Qa==null||Qa!==tf(r)||(r=Qa,"selectionStart"in r&&mb(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Bo&&cc(Bo,r)||(Bo=r,r=vf(gg,"onSelect"),0<r.length&&(t=new rp("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Qa)))}function Ds(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ja={animationend:Ds("Animation","AnimationEnd"),animationiteration:Ds("Animation","AnimationIteration"),animationstart:Ds("Animation","AnimationStart"),transitionrun:Ds("Transition","TransitionRun"),transitionstart:Ds("Transition","TransitionStart"),transitioncancel:Ds("Transition","TransitionCancel"),transitionend:Ds("Transition","TransitionEnd")},ch={},VE={};Ti&&(VE=document.createElement("div").style,"AnimationEvent"in window||(delete Ja.animationend.animation,delete Ja.animationiteration.animation,delete Ja.animationstart.animation),"TransitionEvent"in window||delete Ja.transitionend.transition);function Ea(e){if(ch[e])return ch[e];if(!Ja[e])return e;var t=Ja[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in VE)return ch[e]=t[n];return e}var XE=Ea("animationend"),WE=Ea("animationiteration"),ZE=Ea("animationstart"),w3=Ea("transitionrun"),S3=Ea("transitionstart"),E3=Ea("transitioncancel"),QE=Ea("transitionend"),JE=new Map,xg="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(" ");xg.push("scrollEnd");function Hr(e,t){JE.set(e,t),wa(t,[e])}var nf=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)},mr=[],el=0,gb=0;function ap(){for(var e=el,t=gb=el=0;t<e;){var n=mr[t];mr[t++]=null;var r=mr[t];mr[t++]=null;var i=mr[t];mr[t++]=null;var s=mr[t];if(mr[t++]=null,r!==null&&i!==null){var a=r.pending;a===null?i.next=i:(i.next=a.next,a.next=i),r.pending=i}s!==0&&eN(n,i,s)}}function lp(e,t,n,r){mr[el++]=e,mr[el++]=t,mr[el++]=n,mr[el++]=r,gb|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bb(e,t,n,r){return lp(e,t,n,r),rf(e)}function Na(e,t){return lp(e,null,null,t),rf(e)}function eN(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,s=e.return;s!==null;)s.childLanes|=n,r=s.alternate,r!==null&&(r.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(i=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,i&&t!==null&&(i=31-cr(n),e=s.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),s):null}function rf(e){if(50<Xo)throw Xo=0,Ug=null,Error(Ee(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var tl={};function N3(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(e,t,n,r){return new N3(e,t,n,r)}function xb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ni(e,t){var n=e.alternate;return n===null?(n=ir(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 tN(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 Ad(e,t,n,r,i,s){var a=0;if(r=e,typeof e=="function")xb(e)&&(a=1);else if(typeof e=="string")a=MO(e,n,ti.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case sg:return e=ir(31,n,t,i),e.elementType=sg,e.lanes=s,e;case Ya:return Vs(n.children,i,s,t);case vE:a=8,i|=24;break;case ng:return e=ir(12,n,t,i|2),e.elementType=ng,e.lanes=s,e;case rg:return e=ir(13,n,t,i),e.elementType=rg,e.lanes=s,e;case ig:return e=ir(19,n,t,i),e.elementType=ig,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ki:a=10;break e;case kE:a=9;break e;case ib:a=11;break e;case sb:a=14;break e;case Vi:a=16,r=null;break e}a=29,n=Error(Ee(130,e===null?"null":typeof e,"")),r=null}return t=ir(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Vs(e,t,n,r){return e=ir(7,e,r,t),e.lanes=n,e}function uh(e,t,n){return e=ir(6,e,null,t),e.lanes=n,e}function nN(e){var t=ir(18,null,null,0);return t.stateNode=e,t}function dh(e,t,n){return t=ir(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var rv=new WeakMap;function wr(e,t){if(typeof e=="object"&&e!==null){var n=rv.get(e);return n!==void 0?n:(t={value:e,source:t,stack:zy(t)},rv.set(e,t),t)}return{value:e,source:t,stack:zy(t)}}var nl=[],rl=0,sf=null,uc=0,xr=[],yr=0,vs=null,Zr=1,Qr="";function xi(e,t){nl[rl++]=uc,nl[rl++]=sf,sf=e,uc=t}function rN(e,t,n){xr[yr++]=Zr,xr[yr++]=Qr,xr[yr++]=vs,vs=e;var r=Zr;e=Qr;var i=32-cr(r)-1;r&=~(1<<i),n+=1;var s=32-cr(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Zr=1<<32-cr(t)+i|n<<i|r,Qr=s+e}else Zr=1<<s|n<<i|r,Qr=e}function yb(e){e.return!==null&&(xi(e,1),rN(e,1,0))}function vb(e){for(;e===sf;)sf=nl[--rl],nl[rl]=null,uc=nl[--rl],nl[rl]=null;for(;e===vs;)vs=xr[--yr],xr[yr]=null,Qr=xr[--yr],xr[yr]=null,Zr=xr[--yr],xr[yr]=null}function iN(e,t){xr[yr++]=Zr,xr[yr++]=Qr,xr[yr++]=vs,Zr=t.id,Qr=t.overflow,vs=e}var Sn=null,Bt=null,mt=!1,ds=null,Sr=!1,yg=Error(Ee(519));function ks(e){var t=Error(Ee(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dc(wr(t,e)),yg}function iv(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wn]=e,t[Wn]=r,n){case"dialog":ot("cancel",t),ot("close",t);break;case"iframe":case"object":case"embed":ot("load",t);break;case"video":case"audio":for(n=0;n<mc.length;n++)ot(mc[n],t);break;case"source":ot("error",t);break;case"img":case"image":case"link":ot("error",t),ot("load",t);break;case"details":ot("toggle",t);break;case"input":ot("invalid",t),DE(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ot("invalid",t);break;case"textarea":ot("invalid",t),LE(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||B_(t.textContent,n)?(r.popover!=null&&(ot("beforetoggle",t),ot("toggle",t)),r.onScroll!=null&&ot("scroll",t),r.onScrollEnd!=null&&ot("scrollend",t),r.onClick!=null&&(t.onclick=wi),t=!0):t=!1,t||ks(e,!0)}function sv(e){for(Sn=e.return;Sn;)switch(Sn.tag){case 5:case 31:case 13:Sr=!1;return;case 27:case 3:Sr=!0;return;default:Sn=Sn.return}}function La(e){if(e!==Sn)return!1;if(!mt)return sv(e),mt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Gg(e.type,e.memoizedProps)),n=!n),n&&Bt&&ks(e),sv(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ee(317));Bt=Kv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ee(317));Bt=Kv(e)}else t===27?(t=Bt,Cs(e.type)?(e=Vg,Vg=null,Bt=e):Bt=t):Bt=Sn?Cr(e.stateNode.nextSibling):null;return!0}function aa(){Bt=Sn=null,mt=!1}function fh(){var e=ds;return e!==null&&(Yn===null?Yn=e:Yn.push.apply(Yn,e),ds=null),e}function dc(e){ds===null?ds=[e]:ds.push(e)}var vg=si(null),_a=null,Si=null;function Qi(e,t,n){Rt(vg,t._currentValue),t._currentValue=n}function _i(e){e._currentValue=vg.current,yn(vg)}function kg(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function wg(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){var a=i.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),kg(s.return,n,e),r||(a=null);break e}s=l.next}}else if(i.tag===18){if(a=i.return,a===null)throw Error(Ee(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),kg(a,n,e),a=null}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}}function Xl(e,t,n,r){e=null;for(var i=t,s=!1;i!==null;){if(!s){if(i.flags&524288)s=!0;else if(i.flags&262144)break}if(i.tag===10){var a=i.alternate;if(a===null)throw Error(Ee(387));if(a=a.memoizedProps,a!==null){var l=i.type;dr(i.pendingProps.value,a.value)||(e!==null?e.push(l):e=[l])}}else if(i===Zd.current){if(a=i.alternate,a===null)throw Error(Ee(387));a.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(bc):e=[bc])}i=i.return}e!==null&&wg(t,e,n,r),t.flags|=262144}function af(e){for(e=e.firstContext;e!==null;){if(!dr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function la(e){_a=e,Si=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function En(e){return sN(_a,e)}function Du(e,t){return _a===null&&la(e),sN(e,t)}function sN(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Si===null){if(e===null)throw Error(Ee(308));Si=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Si=Si.next=t;return n}var _3=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},C3=hn.unstable_scheduleCallback,T3=hn.unstable_NormalPriority,an={$$typeof:ki,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kb(){return{controller:new _3,data:new Map,refCount:0}}function Wc(e){e.refCount--,e.refCount===0&&C3(T3,function(){e.controller.abort()})}var Ho=null,Sg=0,Cl=0,dl=null;function A3(e,t){if(Ho===null){var n=Ho=[];Sg=0,Cl=qb(),dl={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Sg++,t.then(av,av),t}function av(){if(--Sg===0&&Ho!==null){dl!==null&&(dl.status="fulfilled");var e=Ho;Ho=null,Cl=0,dl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function M3(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),r}var lv=Qe.S;Qe.S=function(e,t){y_=lr(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&A3(e,t),lv!==null&&lv(e,t)};var Xs=si(null);function wb(){var e=Xs.current;return e!==null?e:Mt.pooledCache}function Md(e,t){t===null?Rt(Xs,Xs.current):Rt(Xs,t.pool)}function aN(){var e=wb();return e===null?null:{parent:an._currentValue,pool:e}}var Wl=Error(Ee(460)),Sb=Error(Ee(474)),op=Error(Ee(542)),lf={then:function(){}};function ov(e){return e=e.status,e==="fulfilled"||e==="rejected"}function lN(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(wi,wi),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uv(e),e;default:if(typeof t.status=="string")t.then(wi,wi);else{if(e=Mt,e!==null&&100<e.shellSuspendCounter)throw Error(Ee(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,uv(e),e}throw Ws=t,Wl}}function Hs(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ws=n,Wl):n}}var Ws=null;function cv(){if(Ws===null)throw Error(Ee(459));var e=Ws;return Ws=null,e}function uv(e){if(e===Wl||e===op)throw Error(Ee(483))}var fl=null,fc=0;function Iu(e){var t=fc;return fc+=1,fl===null&&(fl=[]),lN(fl,e,t)}function go(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Lu(e,t){throw t.$$typeof===g5?Error(Ee(525)):(e=Object.prototype.toString.call(t),Error(Ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function oN(e){function t(m,b){if(e){var v=m.deletions;v===null?(m.deletions=[b],m.flags|=16):v.push(b)}}function n(m,b){if(!e)return null;for(;b!==null;)t(m,b),b=b.sibling;return null}function r(m){for(var b=new Map;m!==null;)m.key!==null?b.set(m.key,m):b.set(m.index,m),m=m.sibling;return b}function i(m,b){return m=Ni(m,b),m.index=0,m.sibling=null,m}function s(m,b,v){return m.index=v,e?(v=m.alternate,v!==null?(v=v.index,v<b?(m.flags|=67108866,b):v):(m.flags|=67108866,b)):(m.flags|=1048576,b)}function a(m){return e&&m.alternate===null&&(m.flags|=67108866),m}function l(m,b,v,S){return b===null||b.tag!==6?(b=uh(v,m.mode,S),b.return=m,b):(b=i(b,v),b.return=m,b)}function c(m,b,v,S){var T=v.type;return T===Ya?d(m,b,v.props.children,S,v.key):b!==null&&(b.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Vi&&Hs(T)===b.type)?(b=i(b,v.props),go(b,v),b.return=m,b):(b=Ad(v.type,v.key,v.props,null,m.mode,S),go(b,v),b.return=m,b)}function u(m,b,v,S){return b===null||b.tag!==4||b.stateNode.containerInfo!==v.containerInfo||b.stateNode.implementation!==v.implementation?(b=dh(v,m.mode,S),b.return=m,b):(b=i(b,v.children||[]),b.return=m,b)}function d(m,b,v,S,T){return b===null||b.tag!==7?(b=Vs(v,m.mode,S,T),b.return=m,b):(b=i(b,v),b.return=m,b)}function f(m,b,v){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return b=uh(""+b,m.mode,v),b.return=m,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Tu:return v=Ad(b.type,b.key,b.props,null,m.mode,v),go(v,b),v.return=m,v;case Co:return b=dh(b,m.mode,v),b.return=m,b;case Vi:return b=Hs(b),f(m,b,v)}if(To(b)||po(b))return b=Vs(b,m.mode,v,null),b.return=m,b;if(typeof b.then=="function")return f(m,Iu(b),v);if(b.$$typeof===ki)return f(m,Du(m,b),v);Lu(m,b)}return null}function p(m,b,v,S){var T=b!==null?b.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return T!==null?null:l(m,b,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Tu:return v.key===T?c(m,b,v,S):null;case Co:return v.key===T?u(m,b,v,S):null;case Vi:return v=Hs(v),p(m,b,v,S)}if(To(v)||po(v))return T!==null?null:d(m,b,v,S,null);if(typeof v.then=="function")return p(m,b,Iu(v),S);if(v.$$typeof===ki)return p(m,b,Du(m,v),S);Lu(m,v)}return null}function h(m,b,v,S,T){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return m=m.get(v)||null,l(b,m,""+S,T);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Tu:return m=m.get(S.key===null?v:S.key)||null,c(b,m,S,T);case Co:return m=m.get(S.key===null?v:S.key)||null,u(b,m,S,T);case Vi:return S=Hs(S),h(m,b,v,S,T)}if(To(S)||po(S))return m=m.get(v)||null,d(b,m,S,T,null);if(typeof S.then=="function")return h(m,b,v,Iu(S),T);if(S.$$typeof===ki)return h(m,b,v,Du(b,S),T);Lu(b,S)}return null}function g(m,b,v,S){for(var T=null,N=null,_=b,R=b=0,L=null;_!==null&&R<v.length;R++){_.index>R?(L=_,_=null):L=_.sibling;var C=p(m,_,v[R],S);if(C===null){_===null&&(_=L);break}e&&_&&C.alternate===null&&t(m,_),b=s(C,b,R),N===null?T=C:N.sibling=C,N=C,_=L}if(R===v.length)return n(m,_),mt&&xi(m,R),T;if(_===null){for(;R<v.length;R++)_=f(m,v[R],S),_!==null&&(b=s(_,b,R),N===null?T=_:N.sibling=_,N=_);return mt&&xi(m,R),T}for(_=r(_);R<v.length;R++)L=h(_,m,R,v[R],S),L!==null&&(e&&L.alternate!==null&&_.delete(L.key===null?R:L.key),b=s(L,b,R),N===null?T=L:N.sibling=L,N=L);return e&&_.forEach(function(U){return t(m,U)}),mt&&xi(m,R),T}function k(m,b,v,S){if(v==null)throw Error(Ee(151));for(var T=null,N=null,_=b,R=b=0,L=null,C=v.next();_!==null&&!C.done;R++,C=v.next()){_.index>R?(L=_,_=null):L=_.sibling;var U=p(m,_,C.value,S);if(U===null){_===null&&(_=L);break}e&&_&&U.alternate===null&&t(m,_),b=s(U,b,R),N===null?T=U:N.sibling=U,N=U,_=L}if(C.done)return n(m,_),mt&&xi(m,R),T;if(_===null){for(;!C.done;R++,C=v.next())C=f(m,C.value,S),C!==null&&(b=s(C,b,R),N===null?T=C:N.sibling=C,N=C);return mt&&xi(m,R),T}for(_=r(_);!C.done;R++,C=v.next())C=h(_,m,R,C.value,S),C!==null&&(e&&C.alternate!==null&&_.delete(C.key===null?R:C.key),b=s(C,b,R),N===null?T=C:N.sibling=C,N=C);return e&&_.forEach(function($){return t(m,$)}),mt&&xi(m,R),T}function w(m,b,v,S){if(typeof v=="object"&&v!==null&&v.type===Ya&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Tu:e:{for(var T=v.key;b!==null;){if(b.key===T){if(T=v.type,T===Ya){if(b.tag===7){n(m,b.sibling),S=i(b,v.props.children),S.return=m,m=S;break e}}else if(b.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Vi&&Hs(T)===b.type){n(m,b.sibling),S=i(b,v.props),go(S,v),S.return=m,m=S;break e}n(m,b);break}else t(m,b);b=b.sibling}v.type===Ya?(S=Vs(v.props.children,m.mode,S,v.key),S.return=m,m=S):(S=Ad(v.type,v.key,v.props,null,m.mode,S),go(S,v),S.return=m,m=S)}return a(m);case Co:e:{for(T=v.key;b!==null;){if(b.key===T)if(b.tag===4&&b.stateNode.containerInfo===v.containerInfo&&b.stateNode.implementation===v.implementation){n(m,b.sibling),S=i(b,v.children||[]),S.return=m,m=S;break e}else{n(m,b);break}else t(m,b);b=b.sibling}S=dh(v,m.mode,S),S.return=m,m=S}return a(m);case Vi:return v=Hs(v),w(m,b,v,S)}if(To(v))return g(m,b,v,S);if(po(v)){if(T=po(v),typeof T!="function")throw Error(Ee(150));return v=T.call(v),k(m,b,v,S)}if(typeof v.then=="function")return w(m,b,Iu(v),S);if(v.$$typeof===ki)return w(m,b,Du(m,v),S);Lu(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,b!==null&&b.tag===6?(n(m,b.sibling),S=i(b,v),S.return=m,m=S):(n(m,b),S=uh(v,m.mode,S),S.return=m,m=S),a(m)):n(m,b)}return function(m,b,v,S){try{fc=0;var T=w(m,b,v,S);return fl=null,T}catch(_){if(_===Wl||_===op)throw _;var N=ir(29,_,null,m.mode);return N.lanes=S,N.return=m,N}finally{}}}var oa=oN(!0),cN=oN(!1),Xi=!1;function Eb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eg(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 fs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ps(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,vt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=rf(e),eN(e,null,n),t}return lp(e,r,t,n),rf(e)}function Fo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,CE(e,n)}}function ph(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ng=!1;function $o(){if(Ng){var e=dl;if(e!==null)throw e}}function Go(e,t,n,r){Ng=!1;var i=e.updateQueue;Xi=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?s=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(s!==null){var f=i.baseState;a=0,d=u=c=null,l=s;do{var p=l.lane&-536870913,h=p!==l.lane;if(h?(ht&p)===p:(r&p)===p){p!==0&&p===Cl&&(Ng=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var g=e,k=l;p=t;var w=n;switch(k.tag){case 1:if(g=k.payload,typeof g=="function"){f=g.call(w,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=k.payload,p=typeof g=="function"?g.call(w,f,p):g,p==null)break e;f=Ft({},f,p);break e;case 2:Xi=!0}}p=l.callback,p!==null&&(e.flags|=64,h&&(e.flags|=8192),h=i.callbacks,h===null?i.callbacks=[p]:h.push(p))}else h={lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=h,c=f):d=d.next=h,a|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,s===null&&(i.shared.lanes=0),Ss|=a,e.lanes=a,e.memoizedState=f}}function uN(e,t){if(typeof e!="function")throw Error(Ee(191,e));e.call(t)}function dN(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)uN(n[e],t)}var Tl=si(null),of=si(0);function dv(e,t){e=Oi,Rt(of,e),Rt(Tl,t),Oi=e|t.baseLanes}function _g(){Rt(of,Oi),Rt(Tl,Tl.current)}function Nb(){Oi=of.current,yn(Tl),yn(of)}var fr=si(null),_r=null;function Ji(e){var t=e.alternate;Rt(Jt,Jt.current&1),Rt(fr,e),_r===null&&(t===null||Tl.current!==null||t.memoizedState!==null)&&(_r=e)}function Cg(e){Rt(Jt,Jt.current),Rt(fr,e),_r===null&&(_r=e)}function fN(e){e.tag===22?(Rt(Jt,Jt.current),Rt(fr,e),_r===null&&(_r=e)):es()}function es(){Rt(Jt,Jt.current),Rt(fr,fr.current)}function nr(e){yn(fr),_r===e&&(_r=null),yn(Jt)}var Jt=si(0);function cf(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||qg(n)||Yg(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 Ai=0,rt=null,Tt=null,rn=null,uf=!1,pl=!1,ca=!1,df=0,pc=0,hl=null,j3=0;function Xt(){throw Error(Ee(321))}function _b(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dr(e[n],t[n]))return!1;return!0}function Cb(e,t,n,r,i,s){return Ai=s,rt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Qe.H=e===null||e.memoizedState===null?$N:Pb,ca=!1,s=n(r,i),ca=!1,pl&&(s=hN(t,n,r,i)),pN(e),s}function pN(e){Qe.H=hc;var t=Tt!==null&&Tt.next!==null;if(Ai=0,rn=Tt=rt=null,uf=!1,pc=0,hl=null,t)throw Error(Ee(300));e===null||on||(e=e.dependencies,e!==null&&af(e)&&(on=!0))}function hN(e,t,n,r){rt=e;var i=0;do{if(pl&&(hl=null),pc=0,pl=!1,25<=i)throw Error(Ee(301));if(i+=1,rn=Tt=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}Qe.H=GN,s=t(n,r)}while(pl);return s}function O3(){var e=Qe.H,t=e.useState()[0];return t=typeof t.then=="function"?Zc(t):t,e=e.useState()[0],(Tt!==null?Tt.memoizedState:null)!==e&&(rt.flags|=1024),t}function Tb(){var e=df!==0;return df=0,e}function Ab(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mb(e){if(uf){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uf=!1}Ai=0,rn=Tt=rt=null,pl=!1,pc=df=0,hl=null}function Rn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?rt.memoizedState=rn=e:rn=rn.next=e,rn}function en(){if(Tt===null){var e=rt.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=rn===null?rt.memoizedState:rn.next;if(t!==null)rn=t,Tt=e;else{if(e===null)throw rt.alternate===null?Error(Ee(467)):Error(Ee(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},rn===null?rt.memoizedState=rn=e:rn=rn.next=e}return rn}function cp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zc(e){var t=pc;return pc+=1,hl===null&&(hl=[]),e=lN(hl,e,t),t=rt,(rn===null?t.memoizedState:rn.next)===null&&(t=t.alternate,Qe.H=t===null||t.memoizedState===null?$N:Pb),e}function up(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Zc(e);if(e.$$typeof===ki)return En(e)}throw Error(Ee(438,String(e)))}function jb(e){var t=null,n=rt.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=rt.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=cp(),rt.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=b5;return t.index++,n}function Mi(e,t){return typeof t=="function"?t(e):t}function jd(e){var t=en();return Ob(t,Tt,e)}function Ob(e,t,n){var r=e.queue;if(r===null)throw Error(Ee(311));r.lastRenderedReducer=n;var i=e.baseQueue,s=r.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}t.baseQueue=i=s,r.pending=null}if(s=e.baseState,i===null)e.memoizedState=s;else{t=i.next;var l=a=null,c=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f!==u.lane?(ht&f)===f:(Ai&f)===f){var p=u.revertLane;if(p===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Cl&&(d=!0);else if((Ai&p)===p){u=u.next,p===Cl&&(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=s):c=c.next=f,rt.lanes|=p,Ss|=p;f=u.action,ca&&n(s,f),s=u.hasEagerState?u.eagerState:n(s,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=p,a=s):c=c.next=p,rt.lanes|=f,Ss|=f;u=u.next}while(u!==null&&u!==t);if(c===null?a=s:c.next=l,!dr(s,e.memoizedState)&&(on=!0,d&&(n=dl,n!==null)))throw n;e.memoizedState=s,e.baseState=a,e.baseQueue=c,r.lastRenderedState=s}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function hh(e){var t=en(),n=t.queue;if(n===null)throw Error(Ee(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=e(s,a.action),a=a.next;while(a!==i);dr(s,t.memoizedState)||(on=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function mN(e,t,n){var r=rt,i=en(),s=mt;if(s){if(n===void 0)throw Error(Ee(407));n=n()}else n=t();var a=!dr((Tt||i).memoizedState,n);if(a&&(i.memoizedState=n,on=!0),i=i.queue,Rb(xN.bind(null,r,i,e),[e]),i.getSnapshot!==t||a||rn!==null&&rn.memoizedState.tag&1){if(r.flags|=2048,Al(9,{destroy:void 0},bN.bind(null,r,i,n,t),null),Mt===null)throw Error(Ee(349));s||Ai&127||gN(r,t,n)}return n}function gN(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=rt.updateQueue,t===null?(t=cp(),rt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bN(e,t,n,r){t.value=n,t.getSnapshot=r,yN(t)&&vN(e)}function xN(e,t,n){return n(function(){yN(t)&&vN(e)})}function yN(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dr(e,n)}catch{return!0}}function vN(e){var t=Na(e,2);t!==null&&Xn(t,e,2)}function Tg(e){var t=Rn();if(typeof e=="function"){var n=e;if(e=n(),ca){rs(!0);try{n()}finally{rs(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:e},t}function kN(e,t,n,r){return e.baseState=n,Ob(e,Tt,typeof r=="function"?r:Mi)}function R3(e,t,n,r,i){if(fp(e))throw Error(Ee(485));if(e=t.action,e!==null){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){s.listeners.push(a)}};Qe.T!==null?n(!0):s.isTransition=!1,r(s),n=t.pending,n===null?(s.next=t.pending=s,wN(t,s)):(s.next=n.next,t.pending=n.next=s)}}function wN(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var s=Qe.T,a={};Qe.T=a;try{var l=n(i,r),c=Qe.S;c!==null&&c(a,l),fv(e,t,l)}catch(u){Ag(e,t,u)}finally{s!==null&&a.types!==null&&(s.types=a.types),Qe.T=s}}else try{s=n(i,r),fv(e,t,s)}catch(u){Ag(e,t,u)}}function fv(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){pv(e,t,r)},function(r){return Ag(e,t,r)}):pv(e,t,n)}function pv(e,t,n){t.status="fulfilled",t.value=n,SN(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,wN(e,n)))}function Ag(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,SN(t),t=t.next;while(t!==r)}e.action=null}function SN(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function EN(e,t){return t}function hv(e,t){if(mt){var n=Mt.formState;if(n!==null){e:{var r=rt;if(mt){if(Bt){t:{for(var i=Bt,s=Sr;i.nodeType!==8;){if(!s){i=null;break t}if(i=Cr(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){Bt=Cr(i.nextSibling),r=i.data==="F!";break e}}ks(r)}r=!1}r&&(t=n[0])}}return n=Rn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:EN,lastRenderedState:t},n.queue=r,n=BN.bind(null,rt,r),r.dispatch=n,r=Tg(!1),s=zb.bind(null,rt,!1,r.queue),r=Rn(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=R3.bind(null,rt,i,s,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function mv(e){var t=en();return NN(t,Tt,e)}function NN(e,t,n){if(t=Ob(e,t,EN)[0],e=jd(Mi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Zc(t)}catch(a){throw a===Wl?op:a}else r=t;t=en();var i=t.queue,s=i.dispatch;return n!==t.memoizedState&&(rt.flags|=2048,Al(9,{destroy:void 0},D3.bind(null,i,n),null)),[r,s,e]}function D3(e,t){e.action=t}function gv(e){var t=en(),n=Tt;if(n!==null)return NN(t,n,e);en(),t=t.memoizedState,n=en();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Al(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=rt.updateQueue,t===null&&(t=cp(),rt.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function _N(){return en().memoizedState}function Od(e,t,n,r){var i=Rn();rt.flags|=e,i.memoizedState=Al(1|t,{destroy:void 0},n,r===void 0?null:r)}function dp(e,t,n,r){var i=en();r=r===void 0?null:r;var s=i.memoizedState.inst;Tt!==null&&r!==null&&_b(r,Tt.memoizedState.deps)?i.memoizedState=Al(t,s,n,r):(rt.flags|=e,i.memoizedState=Al(1|t,s,n,r))}function bv(e,t){Od(8390656,8,e,t)}function Rb(e,t){dp(2048,8,e,t)}function I3(e){rt.flags|=4;var t=rt.updateQueue;if(t===null)t=cp(),rt.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function CN(e){var t=en().memoizedState;return I3({ref:t,nextImpl:e}),function(){if(vt&2)throw Error(Ee(440));return t.impl.apply(void 0,arguments)}}function TN(e,t){return dp(4,2,e,t)}function AN(e,t){return dp(4,4,e,t)}function MN(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 jN(e,t,n){n=n!=null?n.concat([e]):null,dp(4,4,MN.bind(null,t,e),n)}function Db(){}function ON(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&_b(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function RN(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&_b(t,r[1]))return r[0];if(r=e(),ca){rs(!0);try{e()}finally{rs(!1)}}return n.memoizedState=[r,t],r}function Ib(e,t,n){return n===void 0||Ai&1073741824&&!(ht&261930)?e.memoizedState=t:(e.memoizedState=n,e=k_(),rt.lanes|=e,Ss|=e,n)}function DN(e,t,n,r){return dr(n,t)?n:Tl.current!==null?(e=Ib(e,n,r),dr(e,t)||(on=!0),e):!(Ai&42)||Ai&1073741824&&!(ht&261930)?(on=!0,e.memoizedState=n):(e=k_(),rt.lanes|=e,Ss|=e,t)}function IN(e,t,n,r,i){var s=kt.p;kt.p=s!==0&&8>s?s:8;var a=Qe.T,l={};Qe.T=l,zb(e,!1,t,n);try{var c=i(),u=Qe.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=M3(c,r);Ko(e,t,d,ur(e))}else Ko(e,t,r,ur(e))}catch(f){Ko(e,t,{then:function(){},status:"rejected",reason:f},ur())}finally{kt.p=s,a!==null&&l.types!==null&&(a.types=l.types),Qe.T=a}}function L3(){}function Mg(e,t,n,r){if(e.tag!==5)throw Error(Ee(476));var i=LN(e).queue;IN(e,i,t,Ys,n===null?L3:function(){return zN(e),n(r)})}function LN(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ys,baseState:Ys,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:Ys},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zN(e){var t=LN(e);t.next===null&&(t=e.alternate.memoizedState),Ko(e,t.next.queue,{},ur())}function Lb(){return En(bc)}function PN(){return en().memoizedState}function UN(){return en().memoizedState}function z3(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ur();e=fs(n);var r=ps(t,e,n);r!==null&&(Xn(r,t,n),Fo(r,t,n)),t={cache:kb()},e.payload=t;return}t=t.return}}function P3(e,t,n){var r=ur();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fp(e)?HN(t,n):(n=bb(e,t,n,r),n!==null&&(Xn(n,e,r),FN(n,t,r)))}function BN(e,t,n){var r=ur();Ko(e,t,n,r)}function Ko(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fp(e))HN(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,l=s(a,n);if(i.hasEagerState=!0,i.eagerState=l,dr(l,a))return lp(e,t,i,0),Mt===null&&ap(),!1}catch{}finally{}if(n=bb(e,t,i,r),n!==null)return Xn(n,e,r),FN(n,t,r),!0}return!1}function zb(e,t,n,r){if(r={lane:2,revertLane:qb(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fp(e)){if(t)throw Error(Ee(479))}else t=bb(e,n,r,2),t!==null&&Xn(t,e,2)}function fp(e){var t=e.alternate;return e===rt||t!==null&&t===rt}function HN(e,t){pl=uf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function FN(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,CE(e,n)}}var hc={readContext:En,use:up,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useLayoutEffect:Xt,useInsertionEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useSyncExternalStore:Xt,useId:Xt,useHostTransitionStatus:Xt,useFormState:Xt,useActionState:Xt,useOptimistic:Xt,useMemoCache:Xt,useCacheRefresh:Xt};hc.useEffectEvent=Xt;var $N={readContext:En,use:up,useCallback:function(e,t){return Rn().memoizedState=[e,t===void 0?null:t],e},useContext:En,useEffect:bv,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Od(4194308,4,MN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Od(4194308,4,e,t)},useInsertionEffect:function(e,t){Od(4,2,e,t)},useMemo:function(e,t){var n=Rn();t=t===void 0?null:t;var r=e();if(ca){rs(!0);try{e()}finally{rs(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Rn();if(n!==void 0){var i=n(t);if(ca){rs(!0);try{n(t)}finally{rs(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=P3.bind(null,rt,e),[r.memoizedState,e]},useRef:function(e){var t=Rn();return e={current:e},t.memoizedState=e},useState:function(e){e=Tg(e);var t=e.queue,n=BN.bind(null,rt,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Db,useDeferredValue:function(e,t){var n=Rn();return Ib(n,e,t)},useTransition:function(){var e=Tg(!1);return e=IN.bind(null,rt,e.queue,!0,!1),Rn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=rt,i=Rn();if(mt){if(n===void 0)throw Error(Ee(407));n=n()}else{if(n=t(),Mt===null)throw Error(Ee(349));ht&127||gN(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,bv(xN.bind(null,r,s,e),[e]),r.flags|=2048,Al(9,{destroy:void 0},bN.bind(null,r,s,n,t),null),n},useId:function(){var e=Rn(),t=Mt.identifierPrefix;if(mt){var n=Qr,r=Zr;n=(r&~(1<<32-cr(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=df++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=j3++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Lb,useFormState:hv,useActionState:hv,useOptimistic:function(e){var t=Rn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=zb.bind(null,rt,!0,n),n.dispatch=t,[e,t]},useMemoCache:jb,useCacheRefresh:function(){return Rn().memoizedState=z3.bind(null,rt)},useEffectEvent:function(e){var t=Rn(),n={impl:e};return t.memoizedState=n,function(){if(vt&2)throw Error(Ee(440));return n.impl.apply(void 0,arguments)}}},Pb={readContext:En,use:up,useCallback:ON,useContext:En,useEffect:Rb,useImperativeHandle:jN,useInsertionEffect:TN,useLayoutEffect:AN,useMemo:RN,useReducer:jd,useRef:_N,useState:function(){return jd(Mi)},useDebugValue:Db,useDeferredValue:function(e,t){var n=en();return DN(n,Tt.memoizedState,e,t)},useTransition:function(){var e=jd(Mi)[0],t=en().memoizedState;return[typeof e=="boolean"?e:Zc(e),t]},useSyncExternalStore:mN,useId:PN,useHostTransitionStatus:Lb,useFormState:mv,useActionState:mv,useOptimistic:function(e,t){var n=en();return kN(n,Tt,e,t)},useMemoCache:jb,useCacheRefresh:UN};Pb.useEffectEvent=CN;var GN={readContext:En,use:up,useCallback:ON,useContext:En,useEffect:Rb,useImperativeHandle:jN,useInsertionEffect:TN,useLayoutEffect:AN,useMemo:RN,useReducer:hh,useRef:_N,useState:function(){return hh(Mi)},useDebugValue:Db,useDeferredValue:function(e,t){var n=en();return Tt===null?Ib(n,e,t):DN(n,Tt.memoizedState,e,t)},useTransition:function(){var e=hh(Mi)[0],t=en().memoizedState;return[typeof e=="boolean"?e:Zc(e),t]},useSyncExternalStore:mN,useId:PN,useHostTransitionStatus:Lb,useFormState:gv,useActionState:gv,useOptimistic:function(e,t){var n=en();return Tt!==null?kN(n,Tt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:jb,useCacheRefresh:UN};GN.useEffectEvent=CN;function mh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ft({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var jg={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ur(),i=fs(r);i.payload=t,n!=null&&(i.callback=n),t=ps(e,i,r),t!==null&&(Xn(t,e,r),Fo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ur(),i=fs(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ps(e,i,r),t!==null&&(Xn(t,e,r),Fo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ur(),r=fs(n);r.tag=2,t!=null&&(r.callback=t),t=ps(e,r,n),t!==null&&(Xn(t,e,n),Fo(t,e,n))}};function xv(e,t,n,r,i,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,a):t.prototype&&t.prototype.isPureReactComponent?!cc(n,r)||!cc(i,s):!0}function yv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&jg.enqueueReplaceState(t,t.state,null)}function ua(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=Ft({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function KN(e){nf(e)}function qN(e){console.error(e)}function YN(e){nf(e)}function ff(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function vv(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Og(e,t,n){return n=fs(n),n.tag=3,n.payload={element:null},n.callback=function(){ff(e,t)},n}function VN(e){return e=fs(e),e.tag=3,e}function XN(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=r.value;e.payload=function(){return i(s)},e.callback=function(){vv(t,n,r)}}var a=n.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){vv(t,n,r),typeof i!="function"&&(hs===null?hs=new Set([this]):hs.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function U3(e,t,n,r,i){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Xl(t,n,i,!0),n=fr.current,n!==null){switch(n.tag){case 31:case 13:return _r===null?bf():n.alternate===null&&Wt===0&&(Wt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===lf?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),_h(e,r,i)),!1;case 22:return n.flags|=65536,r===lf?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),_h(e,r,i)),!1}throw Error(Ee(435,n.tag))}return _h(e,r,i),bf(),!1}if(mt)return t=fr.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==yg&&(e=Error(Ee(422),{cause:r}),dc(wr(e,n)))):(r!==yg&&(t=Error(Ee(423),{cause:r}),dc(wr(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=wr(r,n),i=Og(e.stateNode,r,i),ph(e,i),Wt!==4&&(Wt=2)),!1;var s=Error(Ee(520),{cause:r});if(s=wr(s,n),Vo===null?Vo=[s]:Vo.push(s),Wt!==4&&(Wt=2),t===null)return!0;r=wr(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Og(n.stateNode,r,e),ph(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(hs===null||!hs.has(s))))return n.flags|=65536,i&=-i,n.lanes|=i,i=VN(i),XN(i,e,n,r),ph(n,i),!1}n=n.return}while(n!==null);return!1}var Ub=Error(Ee(461)),on=!1;function vn(e,t,n,r){t.child=e===null?cN(t,null,n,r):oa(t,e.child,n,r)}function kv(e,t,n,r,i){n=n.render;var s=t.ref;if("ref"in r){var a={};for(var l in r)l!=="ref"&&(a[l]=r[l])}else a=r;return la(t),r=Cb(e,t,n,a,s,i),l=Tb(),e!==null&&!on?(Ab(e,t,i),ji(e,t,i)):(mt&&l&&yb(t),t.flags|=1,vn(e,t,r,i),t.child)}function wv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!xb(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,WN(e,t,s,r,i)):(e=Ad(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Bb(e,i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:cc,n(a,r)&&e.ref===t.ref)return ji(e,t,i)}return t.flags|=1,e=Ni(s,r),e.ref=t.ref,e.return=t,t.child=e}function WN(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(cc(s,r)&&e.ref===t.ref)if(on=!1,t.pendingProps=r=s,Bb(e,i))e.flags&131072&&(on=!0);else return t.lanes=e.lanes,ji(e,t,i)}return Rg(e,t,n,r,i)}function ZN(e,t,n,r){var i=r.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if(t.flags&128){if(s=s!==null?s.baseLanes|n:n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~s}else r=0,t.child=null;return Sv(e,t,s,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Md(t,s!==null?s.cachePool:null),s!==null?dv(t,s):_g(),fN(t);else return r=t.lanes=536870912,Sv(e,t,s!==null?s.baseLanes|n:n,n,r)}else s!==null?(Md(t,s.cachePool),dv(t,s),es(),t.memoizedState=null):(e!==null&&Md(t,null),_g(),es());return vn(e,t,i,n),t.child}function Mo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Sv(e,t,n,r,i){var s=wb();return s=s===null?null:{parent:an._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&Md(t,null),_g(),fN(t),e!==null&&Xl(e,t,r,!0),t.childLanes=i,null}function Rd(e,t){return t=pf({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ev(e,t,n){return oa(t,e.child,null,n),e=Rd(t,t.pendingProps),e.flags|=2,nr(t),t.memoizedState=null,e}function B3(e,t,n){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(mt){if(r.mode==="hidden")return e=Rd(t,r),t.lanes=536870912,Mo(null,e);if(Cg(t),(e=Bt)?(e=$_(e,Sr),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vs!==null?{id:Zr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},n=nN(e),n.return=t,t.child=n,Sn=t,Bt=null)):e=null,e===null)throw ks(t);return t.lanes=536870912,null}return Rd(t,r)}var s=e.memoizedState;if(s!==null){var a=s.dehydrated;if(Cg(t),i)if(t.flags&256)t.flags&=-257,t=Ev(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(Ee(558));else if(on||Xl(e,t,n,!1),i=(n&e.childLanes)!==0,on||i){if(r=Mt,r!==null&&(a=TE(r,n),a!==0&&a!==s.retryLane))throw s.retryLane=a,Na(e,a),Xn(r,e,a),Ub;bf(),t=Ev(e,t,n)}else e=s.treeContext,Bt=Cr(a.nextSibling),Sn=t,mt=!0,ds=null,Sr=!1,e!==null&&iN(t,e),t=Rd(t,r),t.flags|=4096;return t}return e=Ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Dd(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(Ee(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Rg(e,t,n,r,i){return la(t),n=Cb(e,t,n,r,void 0,i),r=Tb(),e!==null&&!on?(Ab(e,t,i),ji(e,t,i)):(mt&&r&&yb(t),t.flags|=1,vn(e,t,n,i),t.child)}function Nv(e,t,n,r,i,s){return la(t),t.updateQueue=null,n=hN(t,r,n,i),pN(e),r=Tb(),e!==null&&!on?(Ab(e,t,s),ji(e,t,s)):(mt&&r&&yb(t),t.flags|=1,vn(e,t,n,s),t.child)}function _v(e,t,n,r,i){if(la(t),t.stateNode===null){var s=tl,a=n.contextType;typeof a=="object"&&a!==null&&(s=En(a)),s=new n(r,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=jg,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=r,s.state=t.memoizedState,s.refs={},Eb(t),a=n.contextType,s.context=typeof a=="object"&&a!==null?En(a):tl,s.state=t.memoizedState,a=n.getDerivedStateFromProps,typeof a=="function"&&(mh(t,n,a,r),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(a=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),a!==s.state&&jg.enqueueReplaceState(s,s.state,null),Go(t,r,s,i),$o(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){s=t.stateNode;var l=t.memoizedProps,c=ua(n,l);s.props=c;var u=s.context,d=n.contextType;a=tl,typeof d=="object"&&d!==null&&(a=En(d));var f=n.getDerivedStateFromProps;d=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||u!==a)&&yv(t,s,r,a),Xi=!1;var p=t.memoizedState;s.state=p,Go(t,r,s,i),$o(),u=t.memoizedState,l||p!==u||Xi?(typeof f=="function"&&(mh(t,n,f,r),u=t.memoizedState),(c=Xi||xv(t,n,c,r,p,u,a))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=a,r=c):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Eg(e,t),a=t.memoizedProps,d=ua(n,a),s.props=d,f=t.pendingProps,p=s.context,u=n.contextType,c=tl,typeof u=="object"&&u!==null&&(c=En(u)),l=n.getDerivedStateFromProps,(u=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||p!==c)&&yv(t,s,r,c),Xi=!1,p=t.memoizedState,s.state=p,Go(t,r,s,i),$o();var h=t.memoizedState;a!==f||p!==h||Xi||e!==null&&e.dependencies!==null&&af(e.dependencies)?(typeof l=="function"&&(mh(t,n,l,r),h=t.memoizedState),(d=Xi||xv(t,n,d,r,p,h,c)||e!==null&&e.dependencies!==null&&af(e.dependencies))?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,h,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,h,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),s.props=r,s.state=h,s.context=c,r=d):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return s=r,Dd(e,t),r=(t.flags&128)!==0,s||r?(s=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&r?(t.child=oa(t,e.child,null,i),t.child=oa(t,null,n,i)):vn(e,t,n,i),t.memoizedState=s.state,e=t.child):e=ji(e,t,i),e}function Cv(e,t,n,r){return aa(),t.flags|=256,vn(e,t,n,r),t.child}var gh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bh(e){return{baseLanes:e,cachePool:aN()}}function xh(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ar),e}function QN(e,t,n){var r=t.pendingProps,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(Jt.current&2)!==0),a&&(i=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(mt){if(i?Ji(t):es(),(e=Bt)?(e=$_(e,Sr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vs!==null?{id:Zr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},n=nN(e),n.return=t,t.child=n,Sn=t,Bt=null)):e=null,e===null)throw ks(t);return Yg(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,i?(es(),i=t.mode,l=pf({mode:"hidden",children:l},i),r=Vs(r,i,n,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=bh(n),r.childLanes=xh(e,a,n),t.memoizedState=gh,Mo(null,r)):(Ji(t),Dg(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(s)t.flags&256?(Ji(t),t.flags&=-257,t=yh(e,t,n)):t.memoizedState!==null?(es(),t.child=e.child,t.flags|=128,t=null):(es(),l=r.fallback,i=t.mode,r=pf({mode:"visible",children:r.children},i),l=Vs(l,i,n,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,oa(t,e.child,null,n),r=t.child,r.memoizedState=bh(n),r.childLanes=xh(e,a,n),t.memoizedState=gh,t=Mo(null,r));else if(Ji(t),Yg(l)){if(a=l.nextSibling&&l.nextSibling.dataset,a)var u=a.dgst;a=u,r=Error(Ee(419)),r.stack="",r.digest=a,dc({value:r,source:null,stack:null}),t=yh(e,t,n)}else if(on||Xl(e,t,n,!1),a=(n&e.childLanes)!==0,on||a){if(a=Mt,a!==null&&(r=TE(a,n),r!==0&&r!==c.retryLane))throw c.retryLane=r,Na(e,r),Xn(a,e,r),Ub;qg(l)||bf(),t=yh(e,t,n)}else qg(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Bt=Cr(l.nextSibling),Sn=t,mt=!0,ds=null,Sr=!1,e!==null&&iN(t,e),t=Dg(t,r.children),t.flags|=4096);return t}return i?(es(),l=r.fallback,i=t.mode,c=e.child,u=c.sibling,r=Ni(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,u!==null?l=Ni(u,l):(l=Vs(l,i,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,Mo(null,r),r=t.child,l=e.child.memoizedState,l===null?l=bh(n):(i=l.cachePool,i!==null?(c=an._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=aN(),l={baseLanes:l.baseLanes|n,cachePool:i}),r.memoizedState=l,r.childLanes=xh(e,a,n),t.memoizedState=gh,Mo(e.child,r)):(Ji(t),n=e.child,e=n.sibling,n=Ni(n,{mode:"visible",children:r.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 Dg(e,t){return t=pf({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function pf(e,t){return e=ir(22,e,null,t),e.lanes=0,e}function yh(e,t,n){return oa(t,e.child,null,n),e=Dg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),kg(e.return,t,n)}function vh(e,t,n,r,i,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.treeForkCount=s)}function JN(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;r=r.children;var a=Jt.current,l=(a&2)!==0;if(l?(a=a&1|2,t.flags|=128):a&=1,Rt(Jt,a),vn(e,t,r,n),r=mt?uc:0,!l&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tv(e,n,t);else if(e.tag===19)Tv(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(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&cf(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),vh(t,!1,i,n,s,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&cf(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}vh(t,!0,n,null,s,r);break;case"together":vh(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function ji(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ss|=t.lanes,!(n&t.childLanes))if(e!==null){if(Xl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(Ee(153));if(t.child!==null){for(e=t.child,n=Ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Bb(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&af(e)))}function H3(e,t,n){switch(t.tag){case 3:Qd(t,t.stateNode.containerInfo),Qi(t,an,e.memoizedState.cache),aa();break;case 27:case 5:og(t);break;case 4:Qd(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,Cg(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Ji(t),t.flags|=128,null):n&t.child.childLanes?QN(e,t,n):(Ji(t),e=ji(e,t,n),e!==null?e.sibling:null);Ji(t);break;case 19:var i=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Xl(e,t,n,!1),r=(n&t.childLanes)!==0),i){if(r)return JN(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Rt(Jt,Jt.current),r)break;return null;case 22:return t.lanes=0,ZN(e,t,n,t.pendingProps);case 24:Qi(t,an,e.memoizedState.cache)}return ji(e,t,n)}function e_(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)on=!0;else{if(!Bb(e,n)&&!(t.flags&128))return on=!1,H3(e,t,n);on=!!(e.flags&131072)}else on=!1,mt&&t.flags&1048576&&rN(t,uc,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Hs(t.elementType),t.type=e,typeof e=="function")xb(e)?(r=ua(e,r),t.tag=1,t=_v(null,t,e,r,n)):(t.tag=0,t=Rg(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===ib){t.tag=11,t=kv(null,t,e,r,n);break e}else if(i===sb){t.tag=14,t=wv(null,t,e,r,n);break e}}throw t=ag(e)||e,Error(Ee(306,t,""))}}return t;case 0:return Rg(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=ua(r,t.pendingProps),_v(e,t,r,i,n);case 3:e:{if(Qd(t,t.stateNode.containerInfo),e===null)throw Error(Ee(387));r=t.pendingProps;var s=t.memoizedState;i=s.element,Eg(e,t),Go(t,r,null,n);var a=t.memoizedState;if(r=a.cache,Qi(t,an,r),r!==s.cache&&wg(t,[an],n,!0),$o(),r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=Cv(e,t,r,n);break e}else if(r!==i){i=wr(Error(Ee(424)),t),dc(i),t=Cv(e,t,r,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(Bt=Cr(e.firstChild),Sn=t,mt=!0,ds=null,Sr=!0,n=cN(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(aa(),r===i){t=ji(e,t,n);break e}vn(e,t,r,n)}t=t.child}return t;case 26:return Dd(e,t),e===null?(n=Vv(t.type,null,t.pendingProps,null))?t.memoizedState=n:mt||(n=t.type,e=t.pendingProps,r=kf(us.current).createElement(n),r[wn]=t,r[Wn]=e,Nn(r,n,e),xn(r),t.stateNode=r):t.memoizedState=Vv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return og(t),e===null&&mt&&(r=t.stateNode=G_(t.type,t.pendingProps,us.current),Sn=t,Sr=!0,i=Bt,Cs(t.type)?(Vg=i,Bt=Cr(r.firstChild)):Bt=i),vn(e,t,t.pendingProps.children,n),Dd(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&mt&&((i=r=Bt)&&(r=bO(r,t.type,t.pendingProps,Sr),r!==null?(t.stateNode=r,Sn=t,Bt=Cr(r.firstChild),Sr=!1,i=!0):i=!1),i||ks(t)),og(t),i=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,r=s.children,Gg(i,s)?r=null:a!==null&&Gg(i,a)&&(t.flags|=32),t.memoizedState!==null&&(i=Cb(e,t,O3,null,null,n),bc._currentValue=i),Dd(e,t),vn(e,t,r,n),t.child;case 6:return e===null&&mt&&((e=n=Bt)&&(n=xO(n,t.pendingProps,Sr),n!==null?(t.stateNode=n,Sn=t,Bt=null,e=!0):e=!1),e||ks(t)),null;case 13:return QN(e,t,n);case 4:return Qd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oa(t,null,r,n):vn(e,t,r,n),t.child;case 11:return kv(e,t,t.type,t.pendingProps,n);case 7:return vn(e,t,t.pendingProps,n),t.child;case 8:return vn(e,t,t.pendingProps.children,n),t.child;case 12:return vn(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Qi(t,t.type,r.value),vn(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,la(t),i=En(i),r=r(i),t.flags|=1,vn(e,t,r,n),t.child;case 14:return wv(e,t,t.type,t.pendingProps,n);case 15:return WN(e,t,t.type,t.pendingProps,n);case 19:return JN(e,t,n);case 31:return B3(e,t,n);case 22:return ZN(e,t,n,t.pendingProps);case 24:return la(t),r=En(an),e===null?(i=wb(),i===null&&(i=Mt,s=kb(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=n),i=s),t.memoizedState={parent:r,cache:i},Eb(t),Qi(t,an,i)):(e.lanes&n&&(Eg(e,t),Go(t,null,null,n),$o()),i=e.memoizedState,s=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Qi(t,an,r)):(r=s.cache,Qi(t,an,r),r!==i.cache&&wg(t,[an],n,!0))),vn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(Ee(156,t.tag))}function di(e){e.flags|=4}function kh(e,t,n,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(E_())e.flags|=8192;else throw Ws=lf,Sb}else e.flags&=-16777217}function Av(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Y_(t))if(E_())e.flags|=8192;else throw Ws=lf,Sb}function zu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?NE():536870912,e.lanes|=t,Ml|=t)}function bo(e,t){if(!mt)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function F3(e,t,n){var r=t.pendingProps;switch(vb(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(t),null;case 1:return zt(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),_i(an),El(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(La(t)?di(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fh())),zt(t),null;case 26:var i=t.type,s=t.memoizedState;return e===null?(di(t),s!==null?(zt(t),Av(t,s)):(zt(t),kh(t,i,null,r,n))):s?s!==e.memoizedState?(di(t),zt(t),Av(t,s)):(zt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&di(t),zt(t),kh(t,i,e,r,n)),null;case 27:if(Jd(t),n=us.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&di(t);else{if(!r){if(t.stateNode===null)throw Error(Ee(166));return zt(t),null}e=ti.current,La(t)?iv(t):(e=G_(i,r,n),t.stateNode=e,di(t))}return zt(t),null;case 5:if(Jd(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&di(t);else{if(!r){if(t.stateNode===null)throw Error(Ee(166));return zt(t),null}if(s=ti.current,La(t))iv(t);else{var a=kf(us.current);switch(s){case 1:s=a.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:s=a.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":s=a.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":s=a.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":s=a.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof r.is=="string"?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?s.multiple=!0:r.size&&(s.size=r.size);break;default:s=typeof r.is=="string"?a.createElement(i,{is:r.is}):a.createElement(i)}}s[wn]=t,s[Wn]=r;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)s.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=s;e:switch(Nn(s,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&di(t)}}return zt(t),kh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&di(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Ee(166));if(e=us.current,La(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Sn,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[wn]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||B_(e.nodeValue,n)),e||ks(t,!0)}else e=kf(e).createTextNode(r),e[wn]=t,t.stateNode=e}return zt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=La(t),n!==null){if(e===null){if(!r)throw Error(Ee(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ee(557));e[wn]=t}else aa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zt(t),e=!1}else n=fh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(nr(t),t):(nr(t),null);if(t.flags&128)throw Error(Ee(558))}return zt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=La(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Ee(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Ee(317));i[wn]=t}else aa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zt(t),i=!1}else i=fh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(nr(t),t):(nr(t),null)}return nr(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),zu(t,t.updateQueue),zt(t),null);case 4:return El(),e===null&&Yb(t.stateNode.containerInfo),zt(t),null;case 10:return _i(t.type),zt(t),null;case 19:if(yn(Jt),r=t.memoizedState,r===null)return zt(t),null;if(i=(t.flags&128)!==0,s=r.rendering,s===null)if(i)bo(r,!1);else{if(Wt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=cf(e),s!==null){for(t.flags|=128,bo(r,!1),e=s.updateQueue,t.updateQueue=e,zu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)tN(n,e),n=n.sibling;return Rt(Jt,Jt.current&1|2),mt&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&lr()>mf&&(t.flags|=128,i=!0,bo(r,!1),t.lanes=4194304)}else{if(!i)if(e=cf(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,zu(t,e),bo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!s.alternate&&!mt)return zt(t),null}else 2*lr()-r.renderingStartTime>mf&&n!==536870912&&(t.flags|=128,i=!0,bo(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(e=r.last,e!==null?e.sibling=s:t.child=s,r.last=s)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=lr(),e.sibling=null,n=Jt.current,Rt(Jt,i?n&1|2:n&1),mt&&xi(t,r.treeForkCount),e):(zt(t),null);case 22:case 23:return nr(t),Nb(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),n=t.updateQueue,n!==null&&zu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&yn(Xs),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_i(an),zt(t),null;case 25:return null;case 30:return null}throw Error(Ee(156,t.tag))}function $3(e,t){switch(vb(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _i(an),El(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Jd(t),null;case 31:if(t.memoizedState!==null){if(nr(t),t.alternate===null)throw Error(Ee(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(nr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ee(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return yn(Jt),null;case 4:return El(),null;case 10:return _i(t.type),null;case 22:case 23:return nr(t),Nb(),e!==null&&yn(Xs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _i(an),null;case 25:return null;default:return null}}function t_(e,t){switch(vb(t),t.tag){case 3:_i(an),El();break;case 26:case 27:case 5:Jd(t);break;case 4:El();break;case 31:t.memoizedState!==null&&nr(t);break;case 13:nr(t);break;case 19:yn(Jt);break;case 10:_i(t.type);break;case 22:case 23:nr(t),Nb(),e!==null&&yn(Xs);break;case 24:_i(an)}}function Qc(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var s=n.create,a=n.inst;r=s(),a.destroy=r}n=n.next}while(n!==i)}}catch(l){Nt(t,t.return,l)}}function ws(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var s=i.next;r=s;do{if((r.tag&e)===e){var a=r.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,i=t;var c=n,u=l;try{u()}catch(d){Nt(i,c,d)}}}r=r.next}while(r!==s)}}catch(d){Nt(t,t.return,d)}}function n_(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{dN(t,n)}catch(r){Nt(e,e.return,r)}}}function r_(e,t,n){n.props=ua(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Nt(e,t,r)}}function qo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){Nt(e,t,i)}}function Jr(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){Nt(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Nt(e,t,i)}else n.current=null}function i_(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){Nt(e,e.return,i)}}function wh(e,t,n){try{var r=e.stateNode;dO(r,e.type,n,t),r[Wn]=t}catch(i){Nt(e,e.return,i)}}function s_(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cs(e.type)||e.tag===4}function Sh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||s_(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&&Cs(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 Ig(e,t,n){var r=e.tag;if(r===5||r===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=wi));else if(r!==4&&(r===27&&Cs(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ig(e,t,n),e=e.sibling;e!==null;)Ig(e,t,n),e=e.sibling}function hf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Cs(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(hf(e,t,n),e=e.sibling;e!==null;)hf(e,t,n),e=e.sibling}function a_(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Nn(t,r,n),t[wn]=e,t[Wn]=n}catch(s){Nt(e,e.return,s)}}var yi=!1,sn=!1,Eh=!1,Mv=typeof WeakSet=="function"?WeakSet:Set,gn=null;function G3(e,t){if(e=e.containerInfo,Fg=Nf,e=YE(e),mb(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(l=a+i),f!==s||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===i&&(l=a),p===s&&++d===r&&(c=a),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for($g={focusedElem:e,selectionRange:n},Nf=!1,gn=t;gn!==null;)if(t=gn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,gn=e;else for(;gn!==null;){switch(t=gn,s=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++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&s!==null){e=void 0,n=t,i=s.memoizedProps,s=s.memoizedState,r=n.stateNode;try{var g=ua(n.type,i);e=r.getSnapshotBeforeUpdate(g,s),r.__reactInternalSnapshotBeforeUpdate=e}catch(k){Nt(n,n.return,k)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Kg(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Kg(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(Ee(163))}if(e=t.sibling,e!==null){e.return=t.return,gn=e;break}gn=t.return}}function l_(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:pi(e,n),r&4&&Qc(5,n);break;case 1:if(pi(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(a){Nt(n,n.return,a)}else{var i=ua(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){Nt(n,n.return,a)}}r&64&&n_(n),r&512&&qo(n,n.return);break;case 3:if(pi(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{dN(e,t)}catch(a){Nt(n,n.return,a)}}break;case 27:t===null&&r&4&&a_(n);case 26:case 5:pi(e,n),t===null&&r&4&&i_(n),r&512&&qo(n,n.return);break;case 12:pi(e,n);break;case 31:pi(e,n),r&4&&u_(e,n);break;case 13:pi(e,n),r&4&&d_(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=J3.bind(null,n),yO(e,n))));break;case 22:if(r=n.memoizedState!==null||yi,!r){t=t!==null&&t.memoizedState!==null||sn,i=yi;var s=sn;yi=r,(sn=t)&&!s?bi(e,n,(n.subtreeFlags&8772)!==0):pi(e,n),yi=i,sn=s}break;case 30:break;default:pi(e,n)}}function o_(e){var t=e.alternate;t!==null&&(e.alternate=null,o_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&cb(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 Kt=null,qn=!1;function fi(e,t,n){for(n=n.child;n!==null;)c_(e,t,n),n=n.sibling}function c_(e,t,n){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(Kc,n)}catch{}switch(n.tag){case 26:sn||Jr(n,t),fi(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:sn||Jr(n,t);var r=Kt,i=qn;Cs(n.type)&&(Kt=n.stateNode,qn=!1),fi(e,t,n),Wo(n.stateNode),Kt=r,qn=i;break;case 5:sn||Jr(n,t);case 6:if(r=Kt,i=qn,Kt=null,fi(e,t,n),Kt=r,qn=i,Kt!==null)if(qn)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(n.stateNode)}catch(s){Nt(n,t,s)}else try{Kt.removeChild(n.stateNode)}catch(s){Nt(n,t,s)}break;case 18:Kt!==null&&(qn?(e=Kt,$v(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Dl(e)):$v(Kt,n.stateNode));break;case 4:r=Kt,i=qn,Kt=n.stateNode.containerInfo,qn=!0,fi(e,t,n),Kt=r,qn=i;break;case 0:case 11:case 14:case 15:ws(2,n,t),sn||ws(4,n,t),fi(e,t,n);break;case 1:sn||(Jr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&r_(n,t,r)),fi(e,t,n);break;case 21:fi(e,t,n);break;case 22:sn=(r=sn)||n.memoizedState!==null,fi(e,t,n),sn=r;break;default:fi(e,t,n)}}function u_(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Dl(e)}catch(n){Nt(t,t.return,n)}}}function d_(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Dl(e)}catch(n){Nt(t,t.return,n)}}function K3(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Mv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Mv),t;default:throw Error(Ee(435,e.tag))}}function Pu(e,t){var n=K3(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var i=eO.bind(null,e,r);r.then(i,i)}})}function $n(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],s=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 27:if(Cs(l.type)){Kt=l.stateNode,qn=!1;break e}break;case 5:Kt=l.stateNode,qn=!1;break e;case 3:case 4:Kt=l.stateNode.containerInfo,qn=!0;break e}l=l.return}if(Kt===null)throw Error(Ee(160));c_(s,a,i),Kt=null,qn=!1,s=i.alternate,s!==null&&(s.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)f_(t,e),t=t.sibling}var Or=null;function f_(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$n(t,e),Gn(e),r&4&&(ws(3,e,e.return),Qc(3,e),ws(5,e,e.return));break;case 1:$n(t,e),Gn(e),r&512&&(sn||n===null||Jr(n,n.return)),r&64&&yi&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=Or;if($n(t,e),Gn(e),r&512&&(sn||n===null||Jr(n,n.return)),r&4){var s=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":s=i.getElementsByTagName("title")[0],(!s||s[Vc]||s[wn]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(r),i.head.insertBefore(s,i.querySelector("head > title"))),Nn(s,r,n),s[wn]=e,xn(s),r=s;break e;case"link":var a=Wv("link","href",i).get(r+(n.href||""));if(a){for(var l=0;l<a.length;l++)if(s=a[l],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(l,1);break t}}s=i.createElement(r),Nn(s,r,n),i.head.appendChild(s);break;case"meta":if(a=Wv("meta","content",i).get(r+(n.content||""))){for(l=0;l<a.length;l++)if(s=a[l],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){a.splice(l,1);break t}}s=i.createElement(r),Nn(s,r,n),i.head.appendChild(s);break;default:throw Error(Ee(468,r))}s[wn]=e,xn(s),r=s}e.stateNode=r}else Zv(i,e.type,e.stateNode);else e.stateNode=Xv(i,r,e.memoizedProps);else s!==r?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,r===null?Zv(i,e.type,e.stateNode):Xv(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&wh(e,e.memoizedProps,n.memoizedProps)}break;case 27:$n(t,e),Gn(e),r&512&&(sn||n===null||Jr(n,n.return)),n!==null&&r&4&&wh(e,e.memoizedProps,n.memoizedProps);break;case 5:if($n(t,e),Gn(e),r&512&&(sn||n===null||Jr(n,n.return)),e.flags&32){i=e.stateNode;try{_l(i,"")}catch(g){Nt(e,e.return,g)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,wh(e,i,n!==null?n.memoizedProps:i)),r&1024&&(Eh=!0);break;case 6:if($n(t,e),Gn(e),r&4){if(e.stateNode===null)throw Error(Ee(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(g){Nt(e,e.return,g)}}break;case 3:if(zd=null,i=Or,Or=wf(t.containerInfo),$n(t,e),Or=i,Gn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Dl(t.containerInfo)}catch(g){Nt(e,e.return,g)}Eh&&(Eh=!1,p_(e));break;case 4:r=Or,Or=wf(e.stateNode.containerInfo),$n(t,e),Gn(e),Or=r;break;case 12:$n(t,e),Gn(e);break;case 31:$n(t,e),Gn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Pu(e,r)));break;case 13:$n(t,e),Gn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(pp=lr()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Pu(e,r)));break;case 22:i=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,u=yi,d=sn;if(yi=u||i,sn=d||c,$n(t,e),sn=d,yi=u,Gn(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||c||yi||sn||Fs(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(s=c.stateNode,i)a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none";else{l=c.stateNode;var f=c.memoizedProps.style,p=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(g){Nt(c,c.return,g)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=i?"":c.memoizedProps}catch(g){Nt(c,c.return,g)}}}else if(t.tag===18){if(n===null){c=t;try{var h=c.stateNode;i?Gv(h,!0):Gv(c.stateNode,!1)}catch(g){Nt(c,c.return,g)}}}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}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Pu(e,n))));break;case 19:$n(t,e),Gn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Pu(e,r)));break;case 30:break;case 21:break;default:$n(t,e),Gn(e)}}function Gn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(s_(r)){n=r;break}r=r.return}if(n==null)throw Error(Ee(160));switch(n.tag){case 27:var i=n.stateNode,s=Sh(e);hf(e,s,i);break;case 5:var a=n.stateNode;n.flags&32&&(_l(a,""),n.flags&=-33);var l=Sh(e);hf(e,l,a);break;case 3:case 4:var c=n.stateNode.containerInfo,u=Sh(e);Ig(e,u,c);break;default:throw Error(Ee(161))}}catch(d){Nt(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function p_(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;p_(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function pi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)l_(e,t.alternate,t),t=t.sibling}function Fs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ws(4,t,t.return),Fs(t);break;case 1:Jr(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&r_(t,t.return,n),Fs(t);break;case 27:Wo(t.stateNode);case 26:case 5:Jr(t,t.return),Fs(t);break;case 22:t.memoizedState===null&&Fs(t);break;case 30:Fs(t);break;default:Fs(t)}e=e.sibling}}function bi(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,s=t,a=s.flags;switch(s.tag){case 0:case 11:case 15:bi(i,s,n),Qc(4,s);break;case 1:if(bi(i,s,n),r=s,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(u){Nt(r,r.return,u)}if(r=s,i=r.updateQueue,i!==null){var l=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)uN(c[i],l)}catch(u){Nt(r,r.return,u)}}n&&a&64&&n_(s),qo(s,s.return);break;case 27:a_(s);case 26:case 5:bi(i,s,n),n&&r===null&&a&4&&i_(s),qo(s,s.return);break;case 12:bi(i,s,n);break;case 31:bi(i,s,n),n&&a&4&&u_(i,s);break;case 13:bi(i,s,n),n&&a&4&&d_(i,s);break;case 22:s.memoizedState===null&&bi(i,s,n),qo(s,s.return);break;case 30:break;default:bi(i,s,n)}t=t.sibling}}function Hb(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&&Wc(n))}function Fb(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wc(e))}function jr(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)h_(e,t,n,r),t=t.sibling}function h_(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:jr(e,t,n,r),i&2048&&Qc(9,t);break;case 1:jr(e,t,n,r);break;case 3:jr(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wc(e)));break;case 12:if(i&2048){jr(e,t,n,r),e=t.stateNode;try{var s=t.memoizedProps,a=s.id,l=s.onPostCommit;typeof l=="function"&&l(a,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Nt(t,t.return,c)}}else jr(e,t,n,r);break;case 31:jr(e,t,n,r);break;case 13:jr(e,t,n,r);break;case 23:break;case 22:s=t.stateNode,a=t.alternate,t.memoizedState!==null?s._visibility&2?jr(e,t,n,r):Yo(e,t):s._visibility&2?jr(e,t,n,r):(s._visibility|=2,Fa(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Hb(a,t);break;case 24:jr(e,t,n,r),i&2048&&Fb(t.alternate,t);break;default:jr(e,t,n,r)}}function Fa(e,t,n,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,a=t,l=n,c=r,u=a.flags;switch(a.tag){case 0:case 11:case 15:Fa(s,a,l,c,i),Qc(8,a);break;case 23:break;case 22:var d=a.stateNode;a.memoizedState!==null?d._visibility&2?Fa(s,a,l,c,i):Yo(s,a):(d._visibility|=2,Fa(s,a,l,c,i)),i&&u&2048&&Hb(a.alternate,a);break;case 24:Fa(s,a,l,c,i),i&&u&2048&&Fb(a.alternate,a);break;default:Fa(s,a,l,c,i)}t=t.sibling}}function Yo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Yo(n,r),i&2048&&Hb(r.alternate,r);break;case 24:Yo(n,r),i&2048&&Fb(r.alternate,r);break;default:Yo(n,r)}t=t.sibling}}var jo=8192;function za(e,t,n){if(e.subtreeFlags&jo)for(e=e.child;e!==null;)m_(e,t,n),e=e.sibling}function m_(e,t,n){switch(e.tag){case 26:za(e,t,n),e.flags&jo&&e.memoizedState!==null&&jO(n,Or,e.memoizedState,e.memoizedProps);break;case 5:za(e,t,n);break;case 3:case 4:var r=Or;Or=wf(e.stateNode.containerInfo),za(e,t,n),Or=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=jo,jo=16777216,za(e,t,n),jo=r):za(e,t,n));break;default:za(e,t,n)}}function g_(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 xo(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gn=r,x_(r,e)}g_(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)b_(e),e=e.sibling}function b_(e){switch(e.tag){case 0:case 11:case 15:xo(e),e.flags&2048&&ws(9,e,e.return);break;case 3:xo(e);break;case 12:xo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Id(e)):xo(e);break;default:xo(e)}}function Id(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gn=r,x_(r,e)}g_(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ws(8,t,t.return),Id(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Id(t));break;default:Id(t)}e=e.sibling}}function x_(e,t){for(;gn!==null;){var n=gn;switch(n.tag){case 0:case 11:case 15:ws(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Wc(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,gn=r;else e:for(n=e;gn!==null;){r=gn;var i=r.sibling,s=r.return;if(o_(r),r===n){gn=null;break e}if(i!==null){i.return=s,gn=i;break e}gn=s}}}var q3={getCacheForType:function(e){var t=En(an),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return En(an).controller.signal}},Y3=typeof WeakMap=="function"?WeakMap:Map,vt=0,Mt=null,ct=null,ht=0,Et=0,tr=null,ss=!1,Zl=!1,$b=!1,Oi=0,Wt=0,Ss=0,Zs=0,Gb=0,ar=0,Ml=0,Vo=null,Yn=null,Lg=!1,pp=0,y_=0,mf=1/0,gf=null,hs=null,pn=0,ms=null,jl=null,Ci=0,zg=0,Pg=null,v_=null,Xo=0,Ug=null;function ur(){return vt&2&&ht!==0?ht&-ht:Qe.T!==null?qb():AE()}function k_(){if(ar===0)if(!(ht&536870912)||mt){var e=Mu;Mu<<=1,!(Mu&3932160)&&(Mu=262144),ar=e}else ar=536870912;return e=fr.current,e!==null&&(e.flags|=32),ar}function Xn(e,t,n){(e===Mt&&(Et===2||Et===9)||e.cancelPendingCommit!==null)&&(Ol(e,0),as(e,ht,ar,!1)),Yc(e,n),(!(vt&2)||e!==Mt)&&(e===Mt&&(!(vt&2)&&(Zs|=n),Wt===4&&as(e,ht,ar,!1)),ai(e))}function w_(e,t,n){if(vt&6)throw Error(Ee(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||qc(e,t),i=r?W3(e,t):Nh(e,t,!0),s=r;do{if(i===0){Zl&&!r&&as(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!V3(n)){i=Nh(e,t,!1),s=!1;continue}if(i===2){if(s=t,e.errorRecoveryDisabledLanes&s)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;i=Vo;var c=l.current.memoizedState.isDehydrated;if(c&&(Ol(l,a).flags|=256),a=Nh(l,a,!1),a!==2){if($b&&!c){l.errorRecoveryDisabledLanes|=s,Zs|=s,i=4;break e}s=Yn,Yn=i,s!==null&&(Yn===null?Yn=s:Yn.push.apply(Yn,s))}i=a}if(s=!1,i!==2)continue}}if(i===1){Ol(e,0),as(e,t,0,!0);break}e:{switch(r=e,s=i,s){case 0:case 1:throw Error(Ee(345));case 4:if((t&4194048)!==t)break;case 6:as(r,t,ar,!ss);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(Ee(329))}if((t&62914560)===t&&(i=pp+300-lr(),10<i)){if(as(r,t,ar,!ss),np(r,0,!0)!==0)break e;Ci=t,r.timeoutHandle=F_(jv.bind(null,r,n,Yn,gf,Lg,t,ar,Zs,Ml,ss,s,"Throttled",-0,0),i);break e}jv(r,n,Yn,gf,Lg,t,ar,Zs,Ml,ss,s,null,-0,0)}}break}while(!0);ai(e)}function jv(e,t,n,r,i,s,a,l,c,u,d,f,p,h){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:wi},m_(t,s,f);var g=(s&62914560)===s?pp-lr():(s&4194048)===s?y_-lr():0;if(g=OO(f,g),g!==null){Ci=s,e.cancelPendingCommit=g(Rv.bind(null,e,t,s,n,r,i,a,l,c,d,f,null,p,h)),as(e,s,a,!u);return}}Rv(e,t,s,n,r,i,a,l,c)}function V3(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!dr(s(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function as(e,t,n,r){t&=~Gb,t&=~Zs,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var s=31-cr(i),a=1<<s;r[s]=-1,i&=~a}n!==0&&_E(e,n,t)}function hp(){return vt&6?!0:(Jc(0),!1)}function Kb(){if(ct!==null){if(Et===0)var e=ct.return;else e=ct,Si=_a=null,Mb(e),fl=null,fc=0,e=ct;for(;e!==null;)t_(e.alternate,e),e=e.return;ct=null}}function Ol(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,hO(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ci=0,Kb(),Mt=e,ct=n=Ni(e.current,null),ht=t,Et=0,tr=null,ss=!1,Zl=qc(e,t),$b=!1,Ml=ar=Gb=Zs=Ss=Wt=0,Yn=Vo=null,Lg=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-cr(r),s=1<<i;t|=e[i],r&=~s}return Oi=t,ap(),n}function S_(e,t){rt=null,Qe.H=hc,t===Wl||t===op?(t=cv(),Et=3):t===Sb?(t=cv(),Et=4):Et=t===Ub?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,tr=t,ct===null&&(Wt=1,ff(e,wr(t,e.current)))}function E_(){var e=fr.current;return e===null?!0:(ht&4194048)===ht?_r===null:(ht&62914560)===ht||ht&536870912?e===_r:!1}function N_(){var e=Qe.H;return Qe.H=hc,e===null?hc:e}function __(){var e=Qe.A;return Qe.A=q3,e}function bf(){Wt=4,ss||(ht&4194048)!==ht&&fr.current!==null||(Zl=!0),!(Ss&134217727)&&!(Zs&134217727)||Mt===null||as(Mt,ht,ar,!1)}function Nh(e,t,n){var r=vt;vt|=2;var i=N_(),s=__();(Mt!==e||ht!==t)&&(gf=null,Ol(e,t)),t=!1;var a=Wt;e:do try{if(Et!==0&&ct!==null){var l=ct,c=tr;switch(Et){case 8:Kb(),a=6;break e;case 3:case 2:case 9:case 6:fr.current===null&&(t=!0);var u=Et;if(Et=0,tr=null,il(e,l,c,u),n&&Zl){a=0;break e}break;default:u=Et,Et=0,tr=null,il(e,l,c,u)}}X3(),a=Wt;break}catch(d){S_(e,d)}while(!0);return t&&e.shellSuspendCounter++,Si=_a=null,vt=r,Qe.H=i,Qe.A=s,ct===null&&(Mt=null,ht=0,ap()),a}function X3(){for(;ct!==null;)C_(ct)}function W3(e,t){var n=vt;vt|=2;var r=N_(),i=__();Mt!==e||ht!==t?(gf=null,mf=lr()+500,Ol(e,t)):Zl=qc(e,t);e:do try{if(Et!==0&&ct!==null){t=ct;var s=tr;t:switch(Et){case 1:Et=0,tr=null,il(e,t,s,1);break;case 2:case 9:if(ov(s)){Et=0,tr=null,Ov(t);break}t=function(){Et!==2&&Et!==9||Mt!==e||(Et=7),ai(e)},s.then(t,t);break e;case 3:Et=7;break e;case 4:Et=5;break e;case 7:ov(s)?(Et=0,tr=null,Ov(t)):(Et=0,tr=null,il(e,t,s,7));break;case 5:var a=null;switch(ct.tag){case 26:a=ct.memoizedState;case 5:case 27:var l=ct;if(a?Y_(a):l.stateNode.complete){Et=0,tr=null;var c=l.sibling;if(c!==null)ct=c;else{var u=l.return;u!==null?(ct=u,mp(u)):ct=null}break t}}Et=0,tr=null,il(e,t,s,5);break;case 6:Et=0,tr=null,il(e,t,s,6);break;case 8:Kb(),Wt=6;break e;default:throw Error(Ee(462))}}Z3();break}catch(d){S_(e,d)}while(!0);return Si=_a=null,Qe.H=r,Qe.A=i,vt=n,ct!==null?0:(Mt=null,ht=0,ap(),Wt)}function Z3(){for(;ct!==null&&!v5();)C_(ct)}function C_(e){var t=e_(e.alternate,e,Oi);e.memoizedProps=e.pendingProps,t===null?mp(e):ct=t}function Ov(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Nv(n,t,t.pendingProps,t.type,void 0,ht);break;case 11:t=Nv(n,t,t.pendingProps,t.type.render,t.ref,ht);break;case 5:Mb(t);default:t_(n,t),t=ct=tN(t,Oi),t=e_(n,t,Oi)}e.memoizedProps=e.pendingProps,t===null?mp(e):ct=t}function il(e,t,n,r){Si=_a=null,Mb(t),fl=null,fc=0;var i=t.return;try{if(U3(e,i,t,n,ht)){Wt=1,ff(e,wr(n,e.current)),ct=null;return}}catch(s){if(i!==null)throw ct=i,s;Wt=1,ff(e,wr(n,e.current)),ct=null;return}t.flags&32768?(mt||r===1?e=!0:Zl||ht&536870912?e=!1:(ss=e=!0,(r===2||r===9||r===3||r===6)&&(r=fr.current,r!==null&&r.tag===13&&(r.flags|=16384))),T_(t,e)):mp(t)}function mp(e){var t=e;do{if(t.flags&32768){T_(t,ss);return}e=t.return;var n=F3(t.alternate,t,Oi);if(n!==null){ct=n;return}if(t=t.sibling,t!==null){ct=t;return}ct=t=e}while(t!==null);Wt===0&&(Wt=5)}function T_(e,t){do{var n=$3(e.alternate,e);if(n!==null){n.flags&=32767,ct=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ct=e;return}ct=e=n}while(e!==null);Wt=6,ct=null}function Rv(e,t,n,r,i,s,a,l,c){e.cancelPendingCommit=null;do gp();while(pn!==0);if(vt&6)throw Error(Ee(327));if(t!==null){if(t===e.current)throw Error(Ee(177));if(s=t.lanes|t.childLanes,s|=gb,M5(e,n,s,a,l,c),e===Mt&&(ct=Mt=null,ht=0),jl=t,ms=e,Ci=n,zg=s,Pg=i,v_=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,tO(ef,function(){return R_(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=Qe.T,Qe.T=null,i=kt.p,kt.p=2,a=vt,vt|=4;try{G3(e,t,n)}finally{vt=a,kt.p=i,Qe.T=r}}pn=1,A_(),M_(),j_()}}function A_(){if(pn===1){pn=0;var e=ms,t=jl,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Qe.T,Qe.T=null;var r=kt.p;kt.p=2;var i=vt;vt|=4;try{f_(t,e);var s=$g,a=YE(e.containerInfo),l=s.focusedElem,c=s.selectionRange;if(a!==l&&l&&l.ownerDocument&&qE(l.ownerDocument.documentElement,l)){if(c!==null&&mb(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,p=f&&f.defaultView||window;if(p.getSelection){var h=p.getSelection(),g=l.textContent.length,k=Math.min(c.start,g),w=c.end===void 0?k:Math.min(c.end,g);!h.extend&&k>w&&(a=w,w=k,k=a);var m=tv(l,k),b=tv(l,w);if(m&&b&&(h.rangeCount!==1||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==b.node||h.focusOffset!==b.offset)){var v=f.createRange();v.setStart(m.node,m.offset),h.removeAllRanges(),k>w?(h.addRange(v),h.extend(b.node,b.offset)):(v.setEnd(b.node,b.offset),h.addRange(v))}}}}for(f=[],h=l;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.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}}Nf=!!Fg,$g=Fg=null}finally{vt=i,kt.p=r,Qe.T=n}}e.current=t,pn=2}}function M_(){if(pn===2){pn=0;var e=ms,t=jl,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Qe.T,Qe.T=null;var r=kt.p;kt.p=2;var i=vt;vt|=4;try{l_(e,t.alternate,t)}finally{vt=i,kt.p=r,Qe.T=n}}pn=3}}function j_(){if(pn===4||pn===3){pn=0,k5();var e=ms,t=jl,n=Ci,r=v_;t.subtreeFlags&10256||t.flags&10256?pn=5:(pn=0,jl=ms=null,O_(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(hs=null),ob(n),t=t.stateNode,or&&typeof or.onCommitFiberRoot=="function")try{or.onCommitFiberRoot(Kc,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=Qe.T,i=kt.p,kt.p=2,Qe.T=null;try{for(var s=e.onRecoverableError,a=0;a<r.length;a++){var l=r[a];s(l.value,{componentStack:l.stack})}}finally{Qe.T=t,kt.p=i}}Ci&3&&gp(),ai(e),i=e.pendingLanes,n&261930&&i&42?e===Ug?Xo++:(Xo=0,Ug=e):Xo=0,Jc(0)}}function O_(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Wc(t)))}function gp(){return A_(),M_(),j_(),R_()}function R_(){if(pn!==5)return!1;var e=ms,t=zg;zg=0;var n=ob(Ci),r=Qe.T,i=kt.p;try{kt.p=32>n?32:n,Qe.T=null,n=Pg,Pg=null;var s=ms,a=Ci;if(pn=0,jl=ms=null,Ci=0,vt&6)throw Error(Ee(331));var l=vt;if(vt|=4,b_(s.current),h_(s,s.current,a,n),vt=l,Jc(0,!1),or&&typeof or.onPostCommitFiberRoot=="function")try{or.onPostCommitFiberRoot(Kc,s)}catch{}return!0}finally{kt.p=i,Qe.T=r,O_(e,t)}}function Dv(e,t,n){t=wr(n,t),t=Og(e.stateNode,t,2),e=ps(e,t,2),e!==null&&(Yc(e,2),ai(e))}function Nt(e,t,n){if(e.tag===3)Dv(e,e,n);else for(;t!==null;){if(t.tag===3){Dv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(hs===null||!hs.has(r))){e=wr(n,e),n=VN(2),r=ps(t,n,2),r!==null&&(XN(n,r,t,e),Yc(r,2),ai(r));break}}t=t.return}}function _h(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Y3;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||($b=!0,i.add(n),e=Q3.bind(null,e,t,n),t.then(e,e))}function Q3(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Mt===e&&(ht&n)===n&&(Wt===4||Wt===3&&(ht&62914560)===ht&&300>lr()-pp?!(vt&2)&&Ol(e,0):Gb|=n,Ml===ht&&(Ml=0)),ai(e)}function D_(e,t){t===0&&(t=NE()),e=Na(e,t),e!==null&&(Yc(e,t),ai(e))}function J3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),D_(e,n)}function eO(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(Ee(314))}r!==null&&r.delete(t),D_(e,n)}function tO(e,t){return ab(e,t)}var xf=null,$a=null,Bg=!1,yf=!1,Ch=!1,ls=0;function ai(e){e!==$a&&e.next===null&&($a===null?xf=$a=e:$a=$a.next=e),yf=!0,Bg||(Bg=!0,rO())}function Jc(e,t){if(!Ch&&yf){Ch=!0;do for(var n=!1,r=xf;r!==null;){if(e!==0){var i=r.pendingLanes;if(i===0)var s=0;else{var a=r.suspendedLanes,l=r.pingedLanes;s=(1<<31-cr(42|e)+1)-1,s&=i&~(a&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Iv(r,s))}else s=ht,s=np(r,r===Mt?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(s&3)||qc(r,s)||(n=!0,Iv(r,s));r=r.next}while(n);Ch=!1}}function nO(){I_()}function I_(){yf=Bg=!1;var e=0;ls!==0&&pO()&&(e=ls);for(var t=lr(),n=null,r=xf;r!==null;){var i=r.next,s=L_(r,t);s===0?(r.next=null,n===null?xf=i:n.next=i,i===null&&($a=n)):(n=r,(e!==0||s&3)&&(yf=!0)),r=i}pn!==0&&pn!==5||Jc(e),ls!==0&&(ls=0)}function L_(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var a=31-cr(s),l=1<<a,c=i[a];c===-1?(!(l&n)||l&r)&&(i[a]=A5(l,t)):c<=t&&(e.expiredLanes|=l),s&=~l}if(t=Mt,n=ht,n=np(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Et===2||Et===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&th(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qc(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&th(r),ob(n)){case 2:case 8:n=SE;break;case 32:n=ef;break;case 268435456:n=EE;break;default:n=ef}return r=z_.bind(null,e),n=ab(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&th(r),e.callbackPriority=2,e.callbackNode=null,2}function z_(e,t){if(pn!==0&&pn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(gp()&&e.callbackNode!==n)return null;var r=ht;return r=np(e,e===Mt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(w_(e,r,t),L_(e,lr()),e.callbackNode!=null&&e.callbackNode===n?z_.bind(null,e):null)}function Iv(e,t){if(gp())return null;w_(e,t,!0)}function rO(){mO(function(){vt&6?ab(wE,nO):I_()})}function qb(){if(ls===0){var e=Cl;e===0&&(e=Au,Au<<=1,!(Au&261888)&&(Au=256)),ls=e}return ls}function Lv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_d(""+e)}function zv(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 iO(e,t,n,r,i){if(t==="submit"&&n&&n.stateNode===i){var s=Lv((i[Wn]||null).action),a=r.submitter;a&&(t=(t=a[Wn]||null)?Lv(t.formAction):a.getAttribute("formAction"),t!==null&&(s=t,a=null));var l=new rp("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ls!==0){var c=a?zv(i,a):new FormData(i);Mg(n,{pending:!0,data:c,method:i.method,action:s},null,c)}}else typeof s=="function"&&(l.preventDefault(),c=a?zv(i,a):new FormData(i),Mg(n,{pending:!0,data:c,method:i.method,action:s},s,c))},currentTarget:i}]})}}for(var Th=0;Th<xg.length;Th++){var Ah=xg[Th],sO=Ah.toLowerCase(),aO=Ah[0].toUpperCase()+Ah.slice(1);Hr(sO,"on"+aO)}Hr(XE,"onAnimationEnd");Hr(WE,"onAnimationIteration");Hr(ZE,"onAnimationStart");Hr("dblclick","onDoubleClick");Hr("focusin","onFocus");Hr("focusout","onBlur");Hr(w3,"onTransitionRun");Hr(S3,"onTransitionStart");Hr(E3,"onTransitionCancel");Hr(QE,"onTransitionEnd");Nl("onMouseEnter",["mouseout","mouseover"]);Nl("onMouseLeave",["mouseout","mouseover"]);Nl("onPointerEnter",["pointerout","pointerover"]);Nl("onPointerLeave",["pointerout","pointerover"]);wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wa("onBeforeInput",["compositionend","keypress","textInput","paste"]);wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mc="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(" "),lO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mc));function P_(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==s&&i.isPropagationStopped())break e;s=l,i.currentTarget=u;try{s(i)}catch(d){nf(d)}i.currentTarget=null,s=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==s&&i.isPropagationStopped())break e;s=l,i.currentTarget=u;try{s(i)}catch(d){nf(d)}i.currentTarget=null,s=c}}}}function ot(e,t){var n=t[ug];n===void 0&&(n=t[ug]=new Set);var r=e+"__bubble";n.has(r)||(U_(t,e,2,!1),n.add(r))}function Mh(e,t,n){var r=0;t&&(r|=4),U_(n,e,r,t)}var Uu="_reactListening"+Math.random().toString(36).slice(2);function Yb(e){if(!e[Uu]){e[Uu]=!0,ME.forEach(function(n){n!=="selectionchange"&&(lO.has(n)||Mh(n,!1,e),Mh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uu]||(t[Uu]=!0,Mh("selectionchange",!1,t))}}function U_(e,t,n,r){switch(Q_(t)){case 2:var i=IO;break;case 8:i=LO;break;default:i=Zb}n=i.bind(null,t,n,e),i=void 0,!mg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function jh(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===i)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&a.stateNode.containerInfo===i)return;a=a.return}for(;l!==null;){if(a=Xa(l),a===null)return;if(c=a.tag,c===5||c===6||c===26||c===27){r=s=a;continue e}l=l.parentNode}}r=r.return}PE(function(){var u=s,d=db(n),f=[];e:{var p=JE.get(e);if(p!==void 0){var h=rp,g=e;switch(e){case"keypress":if(Td(n)===0)break e;case"keydown":case"keyup":h=e3;break;case"focusin":g="focus",h=ah;break;case"focusout":g="blur",h=ah;break;case"beforeblur":case"afterblur":h=ah;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":h=Ky;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=F5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=r3;break;case XE:case WE:case ZE:h=K5;break;case QE:h=s3;break;case"scroll":case"scrollend":h=B5;break;case"wheel":h=l3;break;case"copy":case"cut":case"paste":h=Y5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Yy;break;case"toggle":case"beforetoggle":h=c3}var k=(t&4)!==0,w=!k&&(e==="scroll"||e==="scrollend"),m=k?p!==null?p+"Capture":null:p;k=[];for(var b=u,v;b!==null;){var S=b;if(v=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||v===null||m===null||(S=lc(b,m),S!=null&&k.push(gc(b,S,v))),w)break;b=b.return}0<k.length&&(p=new h(p,g,null,n,d),f.push({event:p,listeners:k}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==hg&&(g=n.relatedTarget||n.fromElement)&&(Xa(g)||g[Yl]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=u,g=g?Xa(g):null,g!==null&&(w=Gc(g),k=g.tag,g!==w||k!==5&&k!==27&&k!==6)&&(g=null)):(h=null,g=u),h!==g)){if(k=Ky,S="onMouseLeave",m="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(k=Yy,S="onPointerLeave",m="onPointerEnter",b="pointer"),w=h==null?p:Ao(h),v=g==null?p:Ao(g),p=new k(S,b+"leave",h,n,d),p.target=w,p.relatedTarget=v,S=null,Xa(d)===u&&(k=new k(m,b+"enter",g,n,d),k.target=v,k.relatedTarget=w,S=k),w=S,h&&g)t:{for(k=oO,m=h,b=g,v=0,S=m;S;S=k(S))v++;S=0;for(var T=b;T;T=k(T))S++;for(;0<v-S;)m=k(m),v--;for(;0<S-v;)b=k(b),S--;for(;v--;){if(m===b||b!==null&&m===b.alternate){k=m;break t}m=k(m),b=k(b)}k=null}else k=null;h!==null&&Pv(f,p,h,k,!1),g!==null&&w!==null&&Pv(f,w,g,k,!0)}}e:{if(p=u?Ao(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var N=Zy;else if(Wy(p))if(GE)N=y3;else{N=b3;var _=g3}else h=p.nodeName,!h||h.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?u&&ub(u.elementType)&&(N=Zy):N=x3;if(N&&(N=N(e,u))){$E(f,N,n,d);break e}_&&_(e,p,u),e==="focusout"&&u&&p.type==="number"&&u.memoizedProps.value!=null&&pg(p,"number",p.value)}switch(_=u?Ao(u):window,e){case"focusin":(Wy(_)||_.contentEditable==="true")&&(Qa=_,gg=u,Bo=null);break;case"focusout":Bo=gg=Qa=null;break;case"mousedown":bg=!0;break;case"contextmenu":case"mouseup":case"dragend":bg=!1,nv(f,n,d);break;case"selectionchange":if(k3)break;case"keydown":case"keyup":nv(f,n,d)}var R;if(hb)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else Za?HE(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(BE&&n.locale!=="ko"&&(Za||L!=="onCompositionStart"?L==="onCompositionEnd"&&Za&&(R=UE()):(is=d,fb="value"in is?is.value:is.textContent,Za=!0)),_=vf(u,L),0<_.length&&(L=new qy(L,e,null,n,d),f.push({event:L,listeners:_}),R?L.data=R:(R=FE(n),R!==null&&(L.data=R)))),(R=d3?f3(e,n):p3(e,n))&&(L=vf(u,"onBeforeInput"),0<L.length&&(_=new qy("onBeforeInput","beforeinput",null,n,d),f.push({event:_,listeners:L}),_.data=R)),iO(f,e,u,n,d)}P_(f,t)})}function gc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vf(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=lc(e,n),i!=null&&r.unshift(gc(e,i,s)),i=lc(e,t),i!=null&&r.push(gc(e,i,s))),e.tag===3)return r;e=e.return}return[]}function oO(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pv(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||u===null||(c=u,i?(u=lc(n,s),u!=null&&a.unshift(gc(n,u,c))):i||(u=lc(n,s),u!=null&&a.push(gc(n,u,c)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var cO=/\r\n?/g,uO=/\u0000|\uFFFD/g;function Uv(e){return(typeof e=="string"?e:""+e).replace(cO,`
49
- `).replace(uO,"")}function B_(e,t){return t=Uv(t),Uv(e)===t}function Ct(e,t,n,r,i,s){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||_l(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&_l(e,""+r);break;case"className":Ou(e,"class",r);break;case"tabIndex":Ou(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ou(e,n,r);break;case"style":zE(e,r,s);break;case"data":if(t!=="object"){Ou(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=_d(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(t!=="input"&&Ct(e,t,"name",i.name,i,null),Ct(e,t,"formEncType",i.formEncType,i,null),Ct(e,t,"formMethod",i.formMethod,i,null),Ct(e,t,"formTarget",i.formTarget,i,null)):(Ct(e,t,"encType",i.encType,i,null),Ct(e,t,"method",i.method,i,null),Ct(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=_d(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=wi);break;case"onScroll":r!=null&&ot("scroll",e);break;case"onScrollEnd":r!=null&&ot("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(Ee(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(Ee(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=_d(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":ot("beforetoggle",e),ot("toggle",e),Nd(e,"popover",r);break;case"xlinkActuate":ui(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":ui(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":ui(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":ui(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":ui(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":ui(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":ui(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":ui(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":ui(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Nd(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=P5.get(n)||n,Nd(e,n,r))}}function Hg(e,t,n,r,i,s){switch(n){case"style":zE(e,r,s);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(Ee(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(Ee(60));e.innerHTML=n}}break;case"children":typeof r=="string"?_l(e,r):(typeof r=="number"||typeof r=="bigint")&&_l(e,""+r);break;case"onScroll":r!=null&&ot("scroll",e);break;case"onScrollEnd":r!=null&&ot("scrollend",e);break;case"onClick":r!=null&&(e.onclick=wi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jE.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),s=e[Wn]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,i),typeof r=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Nd(e,n,r)}}}function Nn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",e),ot("load",e);var r=!1,i=!1,s;for(s in n)if(n.hasOwnProperty(s)){var a=n[s];if(a!=null)switch(s){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(Ee(137,t));default:Ct(e,t,s,a,n,null)}}i&&Ct(e,t,"srcSet",n.srcSet,n,null),r&&Ct(e,t,"src",n.src,n,null);return;case"input":ot("invalid",e);var l=s=a=i=null,c=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case"name":i=d;break;case"type":a=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":s=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(Ee(137,t));break;default:Ct(e,t,r,d,n,null)}}DE(e,s,l,c,u,a,i,!1);return;case"select":ot("invalid",e),r=a=s=null;for(i in n)if(n.hasOwnProperty(i)&&(l=n[i],l!=null))switch(i){case"value":s=l;break;case"defaultValue":a=l;break;case"multiple":r=l;default:Ct(e,t,i,l,n,null)}t=s,n=a,e.multiple=!!r,t!=null?cl(e,!!r,t,!1):n!=null&&cl(e,!!r,n,!0);return;case"textarea":ot("invalid",e),s=i=r=null;for(a in n)if(n.hasOwnProperty(a)&&(l=n[a],l!=null))switch(a){case"value":r=l;break;case"defaultValue":i=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(Ee(91));break;default:Ct(e,t,a,l,n,null)}LE(e,r,i,s);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(r=n[c],r!=null))switch(c){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ct(e,t,c,r,n,null)}return;case"dialog":ot("beforetoggle",e),ot("toggle",e),ot("cancel",e),ot("close",e);break;case"iframe":case"object":ot("load",e);break;case"video":case"audio":for(r=0;r<mc.length;r++)ot(mc[r],e);break;case"image":ot("error",e),ot("load",e);break;case"details":ot("toggle",e);break;case"embed":case"source":case"link":ot("error",e),ot("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(Ee(137,t));default:Ct(e,t,u,r,n,null)}return;default:if(ub(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Hg(e,t,d,r,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(r=n[l],r!=null&&Ct(e,t,l,r,n,null))}function dO(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,a=null,l=null,c=null,u=null,d=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":c=f;default:r.hasOwnProperty(h)||Ct(e,t,h,null,r,f)}}for(var p in r){var h=r[p];if(f=n[p],r.hasOwnProperty(p)&&(h!=null||f!=null))switch(p){case"type":s=h;break;case"name":i=h;break;case"checked":u=h;break;case"defaultChecked":d=h;break;case"value":a=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(Ee(137,t));break;default:h!==f&&Ct(e,t,p,h,r,f)}}fg(e,a,l,c,u,d,s,i);return;case"select":h=a=l=p=null;for(s in n)if(c=n[s],n.hasOwnProperty(s)&&c!=null)switch(s){case"value":break;case"multiple":h=c;default:r.hasOwnProperty(s)||Ct(e,t,s,null,r,c)}for(i in r)if(s=r[i],c=n[i],r.hasOwnProperty(i)&&(s!=null||c!=null))switch(i){case"value":p=s;break;case"defaultValue":l=s;break;case"multiple":a=s;default:s!==c&&Ct(e,t,i,s,r,c)}t=l,n=a,r=h,p!=null?cl(e,!!n,p,!1):!!r!=!!n&&(t!=null?cl(e,!!n,t,!0):cl(e,!!n,n?[]:"",!1));return;case"textarea":h=p=null;for(l in n)if(i=n[l],n.hasOwnProperty(l)&&i!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:Ct(e,t,l,null,r,i)}for(a in r)if(i=r[a],s=n[a],r.hasOwnProperty(a)&&(i!=null||s!=null))switch(a){case"value":p=i;break;case"defaultValue":h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(Ee(91));break;default:i!==s&&Ct(e,t,a,i,r,s)}IE(e,p,h);return;case"option":for(var g in n)if(p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g))switch(g){case"selected":e.selected=!1;break;default:Ct(e,t,g,null,r,p)}for(c in r)if(p=r[c],h=n[c],r.hasOwnProperty(c)&&p!==h&&(p!=null||h!=null))switch(c){case"selected":e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Ct(e,t,c,p,r,h)}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)p=n[k],n.hasOwnProperty(k)&&p!=null&&!r.hasOwnProperty(k)&&Ct(e,t,k,null,r,p);for(u in r)if(p=r[u],h=n[u],r.hasOwnProperty(u)&&p!==h&&(p!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(Ee(137,t));break;default:Ct(e,t,u,p,r,h)}return;default:if(ub(t)){for(var w in n)p=n[w],n.hasOwnProperty(w)&&p!==void 0&&!r.hasOwnProperty(w)&&Hg(e,t,w,void 0,r,p);for(d in r)p=r[d],h=n[d],!r.hasOwnProperty(d)||p===h||p===void 0&&h===void 0||Hg(e,t,d,p,r,h);return}}for(var m in n)p=n[m],n.hasOwnProperty(m)&&p!=null&&!r.hasOwnProperty(m)&&Ct(e,t,m,null,r,p);for(f in r)p=r[f],h=n[f],!r.hasOwnProperty(f)||p===h||p==null&&h==null||Ct(e,t,f,p,r,h)}function Bv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fO(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var i=n[r],s=i.transferSize,a=i.initiatorType,l=i.duration;if(s&&l&&Bv(a)){for(a=0,l=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],u=c.startTime;if(u>l)break;var d=c.transferSize,f=c.initiatorType;d&&Bv(f)&&(c=c.responseEnd,a+=d*(c<l?1:(l-u)/(c-u)))}if(--r,t+=8*(s+a)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Fg=null,$g=null;function kf(e){return e.nodeType===9?e:e.ownerDocument}function Hv(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 H_(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 Gg(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 Oh=null;function pO(){var e=window.event;return e&&e.type==="popstate"?e===Oh?!1:(Oh=e,!0):(Oh=null,!1)}var F_=typeof setTimeout=="function"?setTimeout:void 0,hO=typeof clearTimeout=="function"?clearTimeout:void 0,Fv=typeof Promise=="function"?Promise:void 0,mO=typeof queueMicrotask=="function"?queueMicrotask:typeof Fv<"u"?function(e){return Fv.resolve(null).then(e).catch(gO)}:F_;function gO(e){setTimeout(function(){throw e})}function Cs(e){return e==="head"}function $v(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(i),Dl(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Wo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Wo(n);for(var s=n.firstChild;s;){var a=s.nextSibling,l=s.nodeName;s[Vc]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=a}}else n==="body"&&Wo(e.ownerDocument.body);n=i}while(n);Dl(t)}function Gv(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function Kg(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":Kg(n),cb(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function bO(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Vc])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Cr(e.nextSibling),e===null)break}return null}function xO(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Cr(e.nextSibling),e===null))return null;return e}function $_(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Cr(e.nextSibling),e===null))return null;return e}function qg(e){return e.data==="$?"||e.data==="$~"}function Yg(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yO(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Cr(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 Vg=null;function Kv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Cr(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function qv(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 G_(e,t,n){switch(t=kf(n),e){case"html":if(e=t.documentElement,!e)throw Error(Ee(452));return e;case"head":if(e=t.head,!e)throw Error(Ee(453));return e;case"body":if(e=t.body,!e)throw Error(Ee(454));return e;default:throw Error(Ee(451))}}function Wo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);cb(e)}var Ar=new Map,Yv=new Set;function wf(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ii=kt.d;kt.d={f:vO,r:kO,D:wO,C:SO,L:EO,m:NO,X:CO,S:_O,M:TO};function vO(){var e=Ii.f(),t=hp();return e||t}function kO(e){var t=Vl(e);t!==null&&t.tag===5&&t.type==="form"?zN(t):Ii.r(e)}var Ql=typeof document>"u"?null:document;function K_(e,t,n){var r=Ql;if(r&&typeof t=="string"&&t){var i=kr(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Yv.has(i)||(Yv.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),Nn(t,"link",e),xn(t),r.head.appendChild(t)))}}function wO(e){Ii.D(e),K_("dns-prefetch",e,null)}function SO(e,t){Ii.C(e,t),K_("preconnect",e,t)}function EO(e,t,n){Ii.L(e,t,n);var r=Ql;if(r&&e&&t){var i='link[rel="preload"][as="'+kr(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+kr(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+kr(n.imageSizes)+'"]')):i+='[href="'+kr(e)+'"]';var s=i;switch(t){case"style":s=Rl(e);break;case"script":s=Jl(e)}Ar.has(s)||(e=Ft({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ar.set(s,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(eu(s))||t==="script"&&r.querySelector(tu(s))||(t=r.createElement("link"),Nn(t,"link",e),xn(t),r.head.appendChild(t)))}}function NO(e,t){Ii.m(e,t);var n=Ql;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+kr(r)+'"][href="'+kr(e)+'"]',s=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Jl(e)}if(!Ar.has(s)&&(e=Ft({rel:"modulepreload",href:e},t),Ar.set(s,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(tu(s)))return}r=n.createElement("link"),Nn(r,"link",e),xn(r),n.head.appendChild(r)}}}function _O(e,t,n){Ii.S(e,t,n);var r=Ql;if(r&&e){var i=ol(r).hoistableStyles,s=Rl(e);t=t||"default";var a=i.get(s);if(!a){var l={loading:0,preload:null};if(a=r.querySelector(eu(s)))l.loading=5;else{e=Ft({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ar.get(s))&&Vb(e,n);var c=a=r.createElement("link");xn(c),Nn(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,Ld(a,t,r)}a={type:"stylesheet",instance:a,count:1,state:l},i.set(s,a)}}}function CO(e,t){Ii.X(e,t);var n=Ql;if(n&&e){var r=ol(n).hoistableScripts,i=Jl(e),s=r.get(i);s||(s=n.querySelector(tu(i)),s||(e=Ft({src:e,async:!0},t),(t=Ar.get(i))&&Xb(e,t),s=n.createElement("script"),xn(s),Nn(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(i,s))}}function TO(e,t){Ii.M(e,t);var n=Ql;if(n&&e){var r=ol(n).hoistableScripts,i=Jl(e),s=r.get(i);s||(s=n.querySelector(tu(i)),s||(e=Ft({src:e,async:!0,type:"module"},t),(t=Ar.get(i))&&Xb(e,t),s=n.createElement("script"),xn(s),Nn(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},r.set(i,s))}}function Vv(e,t,n,r){var i=(i=us.current)?wf(i):null;if(!i)throw Error(Ee(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Rl(n.href),n=ol(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Rl(n.href);var s=ol(i).hoistableStyles,a=s.get(e);if(a||(i=i.ownerDocument||i,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,a),(s=i.querySelector(eu(e)))&&!s._p&&(a.instance=s,a.state.loading=5),Ar.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},Ar.set(e,n),s||AO(i,e,n,a.state))),t&&r===null)throw Error(Ee(528,""));return a}if(t&&r!==null)throw Error(Ee(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Jl(n),n=ol(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(Ee(444,e))}}function Rl(e){return'href="'+kr(e)+'"'}function eu(e){return'link[rel="stylesheet"]['+e+"]"}function q_(e){return Ft({},e,{"data-precedence":e.precedence,precedence:null})}function AO(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Nn(t,"link",n),xn(t),e.head.appendChild(t))}function Jl(e){return'[src="'+kr(e)+'"]'}function tu(e){return"script[async]"+e}function Xv(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+kr(n.href)+'"]');if(r)return t.instance=r,xn(r),r;var i=Ft({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),xn(r),Nn(r,"style",i),Ld(r,n.precedence,e),t.instance=r;case"stylesheet":i=Rl(n.href);var s=e.querySelector(eu(i));if(s)return t.state.loading|=4,t.instance=s,xn(s),s;r=q_(n),(i=Ar.get(i))&&Vb(r,i),s=(e.ownerDocument||e).createElement("link"),xn(s);var a=s;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Nn(s,"link",r),t.state.loading|=4,Ld(s,n.precedence,e),t.instance=s;case"script":return s=Jl(n.src),(i=e.querySelector(tu(s)))?(t.instance=i,xn(i),i):(r=n,(i=Ar.get(s))&&(r=Ft({},n),Xb(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),xn(i),Nn(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(Ee(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ld(r,n.precedence,e));return t.instance}function Ld(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,s=i,a=0;a<r.length;a++){var l=r[a];if(l.dataset.precedence===t)s=l;else if(s!==i)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Vb(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Xb(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var zd=null;function Wv(e,t,n){if(zd===null){var r=new Map,i=zd=new Map;i.set(n,r)}else i=zd,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var s=n[i];if(!(s[Vc]||s[wn]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var a=s.getAttribute(t)||"";a=e+a;var l=r.get(a);l?l.push(s):r.set(a,[s])}}return r}function Zv(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function MO(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 Y_(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function jO(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var i=Rl(r.href),s=t.querySelector(eu(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Sf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,xn(s);return}s=t.ownerDocument||t,r=q_(r),(i=Ar.get(i))&&Vb(r,i),s=s.createElement("link"),xn(s);var a=s;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Nn(s,"link",r),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Sf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Rh=0;function OO(e,t){return e.stylesheets&&e.count===0&&Pd(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Pd(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Rh===0&&(Rh=62500*fO());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Pd(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Rh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Sf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ef=null;function Pd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ef=new Map,t.forEach(RO,e),Ef=null,Sf.call(e))}function RO(e,t){if(!(t.state.loading&4)){var n=Ef.get(e);if(n)var r=n.get(null);else{n=new Map,Ef.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var a=i[s];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}i=t.instance,a=i.getAttribute("data-precedence"),s=n.get(a)||r,s===r&&n.set(null,i),n.set(a,i),this.count++,r=Sf.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),s?s.parentNode.insertBefore(i,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var bc={$$typeof:ki,Provider:null,Consumer:null,_currentValue:Ys,_currentValue2:Ys,_threadCount:0};function DO(e,t,n,r,i,s,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=nh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nh(0),this.hiddenUpdates=nh(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function V_(e,t,n,r,i,s,a,l,c,u,d,f){return e=new DO(e,t,n,a,c,u,d,f,l),t=1,s===!0&&(t|=24),s=ir(3,null,null,t),e.current=s,s.stateNode=e,t=kb(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:r,isDehydrated:n,cache:t},Eb(s),e}function X_(e){return e?(e=tl,e):tl}function W_(e,t,n,r,i,s){i=X_(i),r.context===null?r.context=i:r.pendingContext=i,r=fs(t),r.payload={element:n},s=s===void 0?null:s,s!==null&&(r.callback=s),n=ps(e,r,t),n!==null&&(Xn(n,e,t),Fo(n,e,t))}function Qv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Wb(e,t){Qv(e,t),(e=e.alternate)&&Qv(e,t)}function Z_(e){if(e.tag===13||e.tag===31){var t=Na(e,67108864);t!==null&&Xn(t,e,67108864),Wb(e,67108864)}}function Jv(e){if(e.tag===13||e.tag===31){var t=ur();t=lb(t);var n=Na(e,t);n!==null&&Xn(n,e,t),Wb(e,t)}}var Nf=!0;function IO(e,t,n,r){var i=Qe.T;Qe.T=null;var s=kt.p;try{kt.p=2,Zb(e,t,n,r)}finally{kt.p=s,Qe.T=i}}function LO(e,t,n,r){var i=Qe.T;Qe.T=null;var s=kt.p;try{kt.p=8,Zb(e,t,n,r)}finally{kt.p=s,Qe.T=i}}function Zb(e,t,n,r){if(Nf){var i=Xg(r);if(i===null)jh(e,t,r,_f,n),ek(e,r);else if(PO(i,e,t,n,r))r.stopPropagation();else if(ek(e,r),t&4&&-1<zO.indexOf(e)){for(;i!==null;){var s=Vl(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var a=Bs(s.pendingLanes);if(a!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;a;){var c=1<<31-cr(a);l.entanglements[1]|=c,a&=~c}ai(s),!(vt&6)&&(mf=lr()+500,Jc(0))}}break;case 31:case 13:l=Na(s,2),l!==null&&Xn(l,s,2),hp(),Wb(s,2)}if(s=Xg(r),s===null&&jh(e,t,r,_f,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else jh(e,t,r,null,n)}}function Xg(e){return e=db(e),Qb(e)}var _f=null;function Qb(e){if(_f=null,e=Xa(e),e!==null){var t=Gc(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=bE(t),e!==null)return e;e=null}else if(n===31){if(e=xE(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 _f=e,null}function Q_(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(w5()){case wE:return 2;case SE:return 8;case ef:case S5:return 32;case EE:return 268435456;default:return 32}default:return 32}}var Wg=!1,gs=null,bs=null,xs=null,xc=new Map,yc=new Map,ts=[],zO="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 ek(e,t){switch(e){case"focusin":case"focusout":gs=null;break;case"dragenter":case"dragleave":bs=null;break;case"mouseover":case"mouseout":xs=null;break;case"pointerover":case"pointerout":xc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yc.delete(t.pointerId)}}function yo(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Vl(t),t!==null&&Z_(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function PO(e,t,n,r,i){switch(t){case"focusin":return gs=yo(gs,e,t,n,r,i),!0;case"dragenter":return bs=yo(bs,e,t,n,r,i),!0;case"mouseover":return xs=yo(xs,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return xc.set(s,yo(xc.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,yc.set(s,yo(yc.get(s)||null,e,t,n,r,i)),!0}return!1}function J_(e){var t=Xa(e.target);if(t!==null){var n=Gc(t);if(n!==null){if(t=n.tag,t===13){if(t=bE(n),t!==null){e.blockedOn=t,Py(e.priority,function(){Jv(n)});return}}else if(t===31){if(t=xE(n),t!==null){e.blockedOn=t,Py(e.priority,function(){Jv(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 Ud(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xg(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);hg=r,n.target.dispatchEvent(r),hg=null}else return t=Vl(n),t!==null&&Z_(t),e.blockedOn=n,!1;t.shift()}return!0}function tk(e,t,n){Ud(e)&&n.delete(t)}function UO(){Wg=!1,gs!==null&&Ud(gs)&&(gs=null),bs!==null&&Ud(bs)&&(bs=null),xs!==null&&Ud(xs)&&(xs=null),xc.forEach(tk),yc.forEach(tk)}function Bu(e,t){e.blockedOn===t&&(e.blockedOn=null,Wg||(Wg=!0,hn.unstable_scheduleCallback(hn.unstable_NormalPriority,UO)))}var Hu=null;function nk(e){Hu!==e&&(Hu=e,hn.unstable_scheduleCallback(hn.unstable_NormalPriority,function(){Hu===e&&(Hu=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(Qb(r||n)===null)continue;break}var s=Vl(n);s!==null&&(e.splice(t,3),t-=3,Mg(s,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Dl(e){function t(c){return Bu(c,e)}gs!==null&&Bu(gs,e),bs!==null&&Bu(bs,e),xs!==null&&Bu(xs,e),xc.forEach(t),yc.forEach(t);for(var n=0;n<ts.length;n++){var r=ts[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<ts.length&&(n=ts[0],n.blockedOn===null);)J_(n),n.blockedOn===null&&ts.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],s=n[r+1],a=i[Wn]||null;if(typeof s=="function")a||nk(n);else if(a){var l=null;if(s&&s.hasAttribute("formAction")){if(i=s,a=s[Wn]||null)l=a.formAction;else if(Qb(i)!==null)continue}else l=a.action;typeof l=="function"?n[r+1]=l:(n.splice(r,3),r-=3),nk(n)}}}function eC(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(a){return i=a})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function Jb(e){this._internalRoot=e}bp.prototype.render=Jb.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ee(409));var n=t.current,r=ur();W_(n,r,e,t,null,null)};bp.prototype.unmount=Jb.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;W_(e.current,2,null,e,null,null),hp(),t[Yl]=null}};function bp(e){this._internalRoot=e}bp.prototype.unstable_scheduleHydration=function(e){if(e){var t=AE();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ts.length&&t!==0&&t<ts[n].priority;n++);ts.splice(n,0,e),n===0&&J_(e)}};var rk=mE.version;if(rk!=="19.2.8")throw Error(Ee(527,rk,"19.2.8"));kt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Ee(188)):(e=Object.keys(e).join(","),Error(Ee(268,e)));return e=m5(t),e=e!==null?yE(e):null,e=e===null?null:e.stateNode,e};var BO={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:Qe,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fu.isDisabled&&Fu.supportsFiber)try{Kc=Fu.inject(BO),or=Fu}catch{}}ep.createRoot=function(e,t){if(!gE(e))throw Error(Ee(299));var n=!1,r="",i=KN,s=qN,a=YN;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=V_(e,1,!1,null,null,n,r,null,i,s,a,eC),e[Yl]=t.current,Yb(e),new Jb(t)};ep.hydrateRoot=function(e,t,n){if(!gE(e))throw Error(Ee(299));var r=!1,i="",s=KN,a=qN,l=YN,c=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(a=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(c=n.formState)),t=V_(e,1,!0,t,n??null,r,i,c,s,a,l,eC),t.context=X_(null),n=t.current,r=ur(),r=lb(r),i=fs(r),i.callback=null,ps(n,i,r),n=r,t.current.lanes=n,Yc(t,n),ai(t),e[Yl]=t.current,Yb(e),new bp(t)};ep.version="19.2.8";function tC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tC)}catch(e){console.error(e)}}tC(),cE.exports=ep;var HO=cE.exports;const FO=$c(HO);function $O(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const xp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function eo(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ex(e){return"nodeType"in e}function Qn(e){var t,n;return e?eo(e)?e:ex(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function tx(e){const{Document:t}=Qn(e);return e instanceof t}function nu(e){return eo(e)?!1:e instanceof Qn(e).HTMLElement}function nC(e){return e instanceof Qn(e).SVGElement}function to(e){return e?eo(e)?e.document:ex(e)?tx(e)?e:nu(e)||nC(e)?e.ownerDocument:document:document:document}const ri=xp?y.useLayoutEffect:y.useEffect;function nx(e){const t=y.useRef(e);return ri(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function GO(){const e=y.useRef(null),t=y.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=y.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function vc(e,t){t===void 0&&(t=[e]);const n=y.useRef(e);return ri(()=>{n.current!==e&&(n.current=e)},t),n}function ru(e,t){const n=y.useRef();return y.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Cf(e){const t=nx(e),n=y.useRef(null),r=y.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function Zg(e){const t=y.useRef();return y.useEffect(()=>{t.current=e},[e]),t.current}let Dh={};function iu(e,t){return y.useMemo(()=>{if(t)return t;const n=Dh[e]==null?0:Dh[e]+1;return Dh[e]=n,e+"-"+n},[e,t])}function rC(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,a)=>{const l=Object.entries(a);for(const[c,u]of l){const d=s[c];d!=null&&(s[c]=d+e*u)}return s},{...t})}}const ml=rC(1),Tf=rC(-1);function KO(e){return"clientX"in e&&"clientY"in e}function rx(e){if(!e)return!1;const{KeyboardEvent:t}=Qn(e.target);return t&&e instanceof t}function qO(e){if(!e)return!1;const{TouchEvent:t}=Qn(e.target);return t&&e instanceof t}function Qg(e){if(qO(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 KO(e)?{x:e.clientX,y:e.clientY}:null}const Af=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[Af.Translate.toString(e),Af.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ik="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function YO(e){return e.matches(ik)?e:e.querySelector(ik)}const VO={display:"none"};function XO(e){let{id:t,value:n}=e;return In.createElement("div",{id:t,style:VO},n)}function WO(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={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 In.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function ZO(){const[e,t]=y.useState("");return{announce:y.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const iC=y.createContext(null);function QO(e){const t=y.useContext(iC);y.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function JO(){const[e]=y.useState(()=>new Set),t=y.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[y.useCallback(r=>{let{type:i,event:s}=r;e.forEach(a=>{var l;return(l=a[i])==null?void 0:l.call(a,s)})},[e]),t]}const eR={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
- `},tR={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 nR(e){let{announcements:t=tR,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=eR}=e;const{announce:s,announcement:a}=ZO(),l=iu("DndLiveRegion"),[c,u]=y.useState(!1);if(y.useEffect(()=>{u(!0)},[]),QO(y.useMemo(()=>({onDragStart(f){let{active:p}=f;s(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:h}=f;t.onDragMove&&s(t.onDragMove({active:p,over:h}))},onDragOver(f){let{active:p,over:h}=f;s(t.onDragOver({active:p,over:h}))},onDragEnd(f){let{active:p,over:h}=f;s(t.onDragEnd({active:p,over:h}))},onDragCancel(f){let{active:p,over:h}=f;s(t.onDragCancel({active:p,over:h}))}}),[s,t])),!c)return null;const d=In.createElement(In.Fragment,null,In.createElement(XO,{id:r,value:i.draggable}),In.createElement(WO,{id:l,announcement:a}));return n?ln.createPortal(d,n):d}var fn;(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"})(fn||(fn={}));function Mf(){}function kc(e,t){return y.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ix(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ur=Object.freeze({x:0,y:0});function rR(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function iR(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function sR(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function aR(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function sk(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 lR=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=sk(t,t.left,t.top),s=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const u=rR(sk(c),i);s.push({id:l,data:{droppableContainer:a,value:u}})}}return s.sort(iR)};function oR(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=i-r,l=s-n;if(r<i&&n<s){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 cR=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=oR(l,t);c>0&&i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(sR)};function uR(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function sC(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ur}function dR(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.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 fR=dR(1);function pR(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 hR(e,t,n){const r=pR(t);if(!r)return e;const{scaleX:i,scaleY:s,x:a,y:l}=r,c=e.left-a-(1-i)*parseFloat(n),u=e.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?e.width/i:e.width,f=s?e.height/s:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const mR={ignoreTransform:!1};function no(e,t){t===void 0&&(t=mR);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Qn(e).getComputedStyle(e);u&&(n=hR(n,u,d))}const{top:r,left:i,width:s,height:a,bottom:l,right:c}=n;return{top:r,left:i,width:s,height:a,bottom:l,right:c}}function ak(e){return no(e,{ignoreTransform:!0})}function gR(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function bR(e,t){return t===void 0&&(t=Qn(e).getComputedStyle(e)),t.position==="fixed"}function xR(e,t){t===void 0&&(t=Qn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function sx(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(tx(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!nu(i)||nC(i)||n.includes(i))return n;const s=Qn(e).getComputedStyle(i);return i!==e&&xR(i,s)&&n.push(i),bR(i,s)?n:r(i.parentNode)}return e?r(e):n}function aC(e){const[t]=sx(e,1);return t??null}function Ih(e){return!xp||!e?null:eo(e)?e:ex(e)?tx(e)||e===to(e).scrollingElement?window:nu(e)?e:null:null}function lC(e){return eo(e)?e.scrollX:e.scrollLeft}function oC(e){return eo(e)?e.scrollY:e.scrollTop}function Jg(e){return{x:lC(e),y:oC(e)}}var bn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(bn||(bn={}));function cC(e){return!xp||!e?!1:e===document.scrollingElement}function uC(e){const t={x:0,y:0},n=cC(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:a,isRight:l,maxScroll:r,minScroll:t}}const yR={x:.2,y:.2};function vR(e,t,n,r,i){let{top:s,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=yR);const{isTop:u,isBottom:d,isLeft:f,isRight:p}=uC(e),h={x:0,y:0},g={x:0,y:0},k={height:t.height*i.y,width:t.width*i.x};return!u&&s<=t.top+k.height?(h.y=bn.Backward,g.y=r*Math.abs((t.top+k.height-s)/k.height)):!d&&c>=t.bottom-k.height&&(h.y=bn.Forward,g.y=r*Math.abs((t.bottom-k.height-c)/k.height)),!p&&l>=t.right-k.width?(h.x=bn.Forward,g.x=r*Math.abs((t.right-k.width-l)/k.width)):!f&&a<=t.left+k.width&&(h.x=bn.Backward,g.x=r*Math.abs((t.left+k.width-a)/k.width)),{direction:h,speed:g}}function kR(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function dC(e){return e.reduce((t,n)=>ml(t,Jg(n)),Ur)}function wR(e){return e.reduce((t,n)=>t+lC(n),0)}function SR(e){return e.reduce((t,n)=>t+oC(n),0)}function ER(e,t){if(t===void 0&&(t=no),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);aC(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const NR=[["x",["left","right"],wR],["y",["top","bottom"],SR]];class ax{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 r=sx(n),i=dC(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,l]of NR)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=l(r),d=i[s]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Zo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function _R(e){const{EventTarget:t}=Qn(e);return e instanceof t?e:to(e)}function Lh(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var gr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(gr||(gr={}));function lk(e){e.preventDefault()}function CR(e){e.stopPropagation()}var yt;(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"})(yt||(yt={}));const fC={start:[yt.Space,yt.Enter],cancel:[yt.Esc],end:[yt.Space,yt.Enter,yt.Tab]},TR=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case yt.Right:return{...n,x:n.x+25};case yt.Left:return{...n,x:n.x-25};case yt.Down:return{...n,y:n.y+25};case yt.Up:return{...n,y:n.y-25}}};class pC{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 Zo(to(n)),this.windowListeners=new Zo(Qn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(gr.Resize,this.handleCancel),this.windowListeners.add(gr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(gr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&ER(r),n(Ur)}handleKeyDown(t){if(rx(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=fC,coordinateGetter:a=TR,scrollBehavior:l="smooth"}=i,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:Ur;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(t,{active:n,context:r.current,currentCoordinates:d});if(f){const p=Tf(f,d),h={x:0,y:0},{scrollableAncestors:g}=r.current;for(const k of g){const w=t.code,{isTop:m,isRight:b,isLeft:v,isBottom:S,maxScroll:T,minScroll:N}=uC(k),_=kR(k),R={x:Math.min(w===yt.Right?_.right-_.width/2:_.right,Math.max(w===yt.Right?_.left:_.left+_.width/2,f.x)),y:Math.min(w===yt.Down?_.bottom-_.height/2:_.bottom,Math.max(w===yt.Down?_.top:_.top+_.height/2,f.y))},L=w===yt.Right&&!b||w===yt.Left&&!v,C=w===yt.Down&&!S||w===yt.Up&&!m;if(L&&R.x!==f.x){const U=k.scrollLeft+p.x,$=w===yt.Right&&U<=T.x||w===yt.Left&&U>=N.x;if($&&!p.y){k.scrollTo({left:U,behavior:l});return}$?h.x=k.scrollLeft-U:h.x=w===yt.Right?k.scrollLeft-T.x:k.scrollLeft-N.x,h.x&&k.scrollBy({left:-h.x,behavior:l});break}else if(C&&R.y!==f.y){const U=k.scrollTop+p.y,$=w===yt.Down&&U<=T.y||w===yt.Up&&U>=N.y;if($&&!p.x){k.scrollTo({top:U,behavior:l});return}$?h.y=k.scrollTop-U:h.y=w===yt.Down?k.scrollTop-T.y:k.scrollTop-N.y,h.y&&k.scrollBy({top:-h.y,behavior:l});break}}this.handleMove(t,ml(Tf(f,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(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()}}pC.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=fC,onActivation:i}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const l=s.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function ok(e){return!!(e&&"distance"in e)}function ck(e){return!!(e&&"delay"in e)}class lx{constructor(t,n,r){var i;r===void 0&&(r=_R(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:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=to(a),this.documentListeners=new Zo(this.document),this.listeners=new Zo(r),this.windowListeners=new Zo(Qn(a)),this.initialCoordinates=(i=Qg(s))!=null?i:Ur,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:r}}}=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(gr.Resize,this.handleCancel),this.windowListeners.add(gr.DragStart,lk),this.windowListeners.add(gr.VisibilityChange,this.handleCancel),this.windowListeners.add(gr.ContextMenu,lk),this.documentListeners.add(gr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ck(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(ok(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:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(gr.Click,CR,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(gr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:a,options:{activationConstraint:l}}=s;if(!i)return;const c=(n=Qg(t))!=null?n:Ur,u=Tf(i,c);if(!r&&l){if(ok(l)){if(l.tolerance!=null&&Lh(u,l.tolerance))return this.handleCancel();if(Lh(u,l.distance))return this.handleStart()}if(ck(l)&&Lh(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===yt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const AR={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class su extends lx{constructor(t){const{event:n}=t,r=to(n.target);super(t,AR,r)}}su.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const MR={move:{name:"mousemove"},end:{name:"mouseup"}};var e0;(function(e){e[e.RightClick=2]="RightClick"})(e0||(e0={}));class jR extends lx{constructor(t){super(t,MR,to(t.event.target))}}jR.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===e0.RightClick?!1:(r==null||r({event:n}),!0)}}];const zh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ox extends lx{constructor(t){super(t,zh)}static setup(){return window.addEventListener(zh.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(zh.move.name,t)};function t(){}}}ox.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Qo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Qo||(Qo={}));var jf;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(jf||(jf={}));function OR(e){let{acceleration:t,activator:n=Qo.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:l=jf.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e;const h=DR({delta:f,disabled:!s}),[g,k]=GO(),w=y.useRef({x:0,y:0}),m=y.useRef({x:0,y:0}),b=y.useMemo(()=>{switch(n){case Qo.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Qo.DraggableRect:return i}},[n,i,c]),v=y.useRef(null),S=y.useCallback(()=>{const N=v.current;if(!N)return;const _=w.current.x*m.current.x,R=w.current.y*m.current.y;N.scrollBy(_,R)},[]),T=y.useMemo(()=>l===jf.TreeOrder?[...u].reverse():u,[l,u]);y.useEffect(()=>{if(!s||!u.length||!b){k();return}for(const N of T){if((r==null?void 0:r(N))===!1)continue;const _=u.indexOf(N),R=d[_];if(!R)continue;const{direction:L,speed:C}=vR(N,R,b,t,p);for(const U of["x","y"])h[U][L[U]]||(C[U]=0,L[U]=0);if(C.x>0||C.y>0){k(),v.current=N,g(S,a),w.current=C,m.current=L;return}}w.current={x:0,y:0},m.current={x:0,y:0},k()},[t,S,r,k,s,a,JSON.stringify(b),JSON.stringify(h),g,u,T,d,JSON.stringify(p)])}const RR={x:{[bn.Backward]:!1,[bn.Forward]:!1},y:{[bn.Backward]:!1,[bn.Forward]:!1}};function DR(e){let{delta:t,disabled:n}=e;const r=Zg(t);return ru(i=>{if(n||!r||!i)return RR;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[bn.Backward]:i.x[bn.Backward]||s.x===-1,[bn.Forward]:i.x[bn.Forward]||s.x===1},y:{[bn.Backward]:i.y[bn.Backward]||s.y===-1,[bn.Forward]:i.y[bn.Forward]||s.y===1}}},[n,t,r])}function IR(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return ru(i=>{var s;return t==null?null:(s=r??i)!=null?s:null},[r,t])}function LR(e,t){return y.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...s]},[]),[e,t])}var wc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(wc||(wc={}));var t0;(function(e){e.Optimized="optimized"})(t0||(t0={}));const uk=new Map;function zR(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,a]=y.useState(null),{frequency:l,measure:c,strategy:u}=i,d=y.useRef(e),f=w(),p=vc(f),h=y.useCallback(function(m){m===void 0&&(m=[]),!p.current&&a(b=>b===null?m:b.concat(m.filter(v=>!b.includes(v))))},[p]),g=y.useRef(null),k=ru(m=>{if(f&&!n)return uk;if(!m||m===uk||d.current!==e||s!=null){const b=new Map;for(let v of e){if(!v)continue;if(s&&s.length>0&&!s.includes(v.id)&&v.rect.current){b.set(v.id,v.rect.current);continue}const S=v.node.current,T=S?new ax(c(S),S):null;v.rect.current=T,T&&b.set(v.id,T)}return b}return m},[e,s,n,f,c]);return y.useEffect(()=>{d.current=e},[e]),y.useEffect(()=>{f||h()},[n,f]),y.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),y.useEffect(()=>{f||typeof l!="number"||g.current!==null||(g.current=setTimeout(()=>{h(),g.current=null},l))},[l,f,h,...r]),{droppableRects:k,measureDroppableContainers:h,measuringScheduled:s!=null};function w(){switch(u){case wc.Always:return!1;case wc.BeforeDragging:return n;default:return!n}}}function hC(e,t){return ru(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function PR(e,t){return hC(e,t)}function UR(e){let{callback:t,disabled:n}=e;const r=nx(t),i=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function yp(e){let{callback:t,disabled:n}=e;const r=nx(t),i=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function BR(e){return new ax(no(e),e)}function dk(e,t,n){t===void 0&&(t=BR);const[r,i]=y.useState(null);function s(){i(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=UR({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){s();break}}}}),l=yp({callback:s});return ri(()=>{s(),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]),r}function HR(e){const t=hC(e);return sC(e,t)}const fk=[];function FR(e){const t=y.useRef(e),n=ru(r=>e?r&&r!==fk&&e&&t.current&&e.parentNode===t.current.parentNode?r:sx(e):fk,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function $R(e){const[t,n]=y.useState(null),r=y.useRef(e),i=y.useCallback(s=>{const a=Ih(s.target);a&&n(l=>l?(l.set(a,Jg(a)),new Map(l)):null)},[]);return y.useEffect(()=>{const s=r.current;if(e!==s){a(s);const l=e.map(c=>{const u=Ih(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Jg(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(s)};function a(l){l.forEach(c=>{const u=Ih(c);u==null||u.removeEventListener("scroll",i)})}},[i,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>ml(s,a),Ur):dC(e):Ur,[e,t])}function pk(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const r=e!==Ur;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Tf(e,n.current):Ur}function GR(e){y.useEffect(()=>{if(!xp)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function KR(e,t){return y.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=a=>{s(a,t)},n},{}),[e,t])}function mC(e){return y.useMemo(()=>e?gR(e):null,[e])}const hk=[];function qR(e,t){t===void 0&&(t=no);const[n]=e,r=mC(n?Qn(n):null),[i,s]=y.useState(hk);function a(){s(()=>e.length?e.map(c=>cC(c)?r:new ax(t(c),c)):hk)}const l=yp({callback:a});return ri(()=>{l==null||l.disconnect(),a(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),i}function YR(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return nu(t)?t:e}function VR(e){let{measure:t}=e;const[n,r]=y.useState(null),i=y.useCallback(u=>{for(const{target:d}of u)if(nu(d)){r(f=>{const p=t(d);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),s=yp({callback:i}),a=y.useCallback(u=>{const d=YR(u);s==null||s.disconnect(),d&&(s==null||s.observe(d)),r(d?t(d):null)},[t,s]),[l,c]=Cf(a);return y.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const XR=[{sensor:su,options:{}},{sensor:pC,options:{}}],WR={current:{}},Bd={draggable:{measure:ak},droppable:{measure:ak,strategy:wc.WhileDragging,frequency:t0.Optimized},dragOverlay:{measure:no}};class Jo 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,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const ZR={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Jo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Mf},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Bd,measureDroppableContainers:Mf,windowRect:null,measuringScheduled:!1},QR={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Mf,draggableNodes:new Map,over:null,measureDroppableContainers:Mf},vp=y.createContext(QR),gC=y.createContext(ZR);function JR(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Jo}}}function eD(e,t){switch(t.type){case fn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case fn.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 fn.DragEnd:case fn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case fn.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Jo(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case fn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new Jo(e.droppable.containers);return a.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case fn.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Jo(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function tD(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=y.useContext(vp),s=Zg(r),a=Zg(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!rx(s)||document.activeElement===s.target)return;const l=i.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=YO(d);if(f){f.focus();break}}})}},[r,t,i,a,s]),null}function nD(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function rD(e){return y.useMemo(()=>({draggable:{...Bd.draggable,...e==null?void 0:e.draggable},droppable:{...Bd.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Bd.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 iD(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=y.useRef(!1),{x:a,y:l}=typeof i=="boolean"?{x:i,y:i}:i;ri(()=>{if(!a&&!l||!t){s.current=!1;return}if(s.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=sC(d,r);if(a||(f.x=0),l||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=aC(u);p&&p.scrollBy({top:f.y,left:f.x})}},[t,a,l,r,n])}const bC=y.createContext({...Ur,scaleX:1,scaleY:1});var Wi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Wi||(Wi={}));const cx=y.memo(function(t){var n,r,i,s;let{id:a,accessibility:l,autoScroll:c=!0,children:u,sensors:d=XR,collisionDetection:f=cR,measuring:p,modifiers:h,...g}=t;const k=y.useReducer(eD,void 0,JR),[w,m]=k,[b,v]=JO(),[S,T]=y.useState(Wi.Uninitialized),N=S===Wi.Initialized,{draggable:{active:_,nodes:R,translate:L},droppable:{containers:C}}=w,U=_!=null?R.get(_):null,$=y.useRef({initial:null,translated:null}),G=y.useMemo(()=>{var Me;return _!=null?{id:_,data:(Me=U==null?void 0:U.data)!=null?Me:WR,rect:$}:null},[_,U]),I=y.useRef(null),[D,A]=y.useState(null),[M,P]=y.useState(null),H=vc(g,Object.values(g)),E=iu("DndDescribedBy",a),j=y.useMemo(()=>C.getEnabled(),[C]),B=rD(p),{droppableRects:O,measureDroppableContainers:Q,measuringScheduled:F}=zR(j,{dragging:N,dependencies:[L.x,L.y],config:B.droppable}),J=IR(R,_),ce=y.useMemo(()=>M?Qg(M):null,[M]),K=Ae(),q=PR(J,B.draggable.measure);iD({activeNode:_!=null?R.get(_):null,config:K.layoutShiftCompensation,initialRect:q,measure:B.draggable.measure});const V=dk(J,B.draggable.measure,q),ue=dk(J?J.parentElement:null),me=y.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:O,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:C,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ne=C.getNodeFor((n=me.current.over)==null?void 0:n.id),Te=VR({measure:B.dragOverlay.measure}),ne=(r=Te.nodeRef.current)!=null?r:J,pe=N?(i=Te.rect)!=null?i:V:null,le=!!(Te.nodeRef.current&&Te.rect),de=HR(le?null:V),Ke=mC(ne?Qn(ne):null),He=FR(N?Ne??J:null),Fe=qR(He),dt=nD(h,{transform:{x:L.x-de.x,y:L.y-de.y,scaleX:1,scaleY:1},activatorEvent:M,active:G,activeNodeRect:V,containerNodeRect:ue,draggingNodeRect:pe,over:me.current.over,overlayNodeRect:Te.rect,scrollableAncestors:He,scrollableAncestorRects:Fe,windowRect:Ke}),st=ce?ml(ce,L):null,Ue=$R(He),at=pk(Ue),Z=pk(Ue,[V]),ae=ml(dt,at),_e=pe?fR(pe,dt):null,x=G&&_e?f({active:G,collisionRect:_e,droppableRects:O,droppableContainers:j,pointerCoordinates:st}):null,Y=aR(x,"id"),[se,ge]=y.useState(null),oe=le?dt:ml(dt,Z),z=uR(oe,(s=se==null?void 0:se.rect)!=null?s:null,V),re=y.useRef(null),ie=y.useCallback((Me,Ie)=>{let{sensor:Le,options:$e}=Ie;if(I.current==null)return;const qe=R.get(I.current);if(!qe)return;const gt=Me.nativeEvent,ft=new Le({active:I.current,activeNode:qe,event:gt,options:$e,context:me,onAbort(St){if(!R.get(St))return;const{onDragAbort:It}=H.current,Yt={id:St};It==null||It(Yt),b({type:"onDragAbort",event:Yt})},onPending(St,Qt,It,Yt){if(!R.get(St))return;const{onDragPending:je}=H.current,W={id:St,constraint:Qt,initialCoordinates:It,offset:Yt};je==null||je(W),b({type:"onDragPending",event:W})},onStart(St){const Qt=I.current;if(Qt==null)return;const It=R.get(Qt);if(!It)return;const{onDragStart:Yt}=H.current,te={activatorEvent:gt,active:{id:Qt,data:It.data,rect:$}};ln.unstable_batchedUpdates(()=>{Yt==null||Yt(te),T(Wi.Initializing),m({type:fn.DragStart,initialCoordinates:St,active:Qt}),b({type:"onDragStart",event:te}),A(re.current),P(gt)})},onMove(St){m({type:fn.DragMove,coordinates:St})},onEnd:Dt(fn.DragEnd),onCancel:Dt(fn.DragCancel)});re.current=ft;function Dt(St){return async function(){const{active:It,collisions:Yt,over:te,scrollAdjustedTranslate:je}=me.current;let W=null;if(It&&je){const{cancelDrop:fe}=H.current;W={activatorEvent:gt,active:It,collisions:Yt,delta:je,over:te},St===fn.DragEnd&&typeof fe=="function"&&await Promise.resolve(fe(W))&&(St=fn.DragCancel)}I.current=null,ln.unstable_batchedUpdates(()=>{m({type:St}),T(Wi.Uninitialized),ge(null),A(null),P(null),re.current=null;const fe=St===fn.DragEnd?"onDragEnd":"onDragCancel";if(W){const Oe=H.current[fe];Oe==null||Oe(W),b({type:fe,event:W})}})}}},[R]),he=y.useCallback((Me,Ie)=>(Le,$e)=>{const qe=Le.nativeEvent,gt=R.get($e);if(I.current!==null||!gt||qe.dndKit||qe.defaultPrevented)return;const ft={active:gt};Me(Le,Ie.options,ft)===!0&&(qe.dndKit={capturedBy:Ie.sensor},I.current=$e,ie(Le,Ie))},[R,ie]),be=LR(d,he);GR(d),ri(()=>{V&&S===Wi.Initializing&&T(Wi.Initialized)},[V,S]),y.useEffect(()=>{const{onDragMove:Me}=H.current,{active:Ie,activatorEvent:Le,collisions:$e,over:qe}=me.current;if(!Ie||!Le)return;const gt={active:Ie,activatorEvent:Le,collisions:$e,delta:{x:ae.x,y:ae.y},over:qe};ln.unstable_batchedUpdates(()=>{Me==null||Me(gt),b({type:"onDragMove",event:gt})})},[ae.x,ae.y]),y.useEffect(()=>{const{active:Me,activatorEvent:Ie,collisions:Le,droppableContainers:$e,scrollAdjustedTranslate:qe}=me.current;if(!Me||I.current==null||!Ie||!qe)return;const{onDragOver:gt}=H.current,ft=$e.get(Y),Dt=ft&&ft.rect.current?{id:ft.id,rect:ft.rect.current,data:ft.data,disabled:ft.disabled}:null,St={active:Me,activatorEvent:Ie,collisions:Le,delta:{x:qe.x,y:qe.y},over:Dt};ln.unstable_batchedUpdates(()=>{ge(Dt),gt==null||gt(St),b({type:"onDragOver",event:St})})},[Y]),ri(()=>{me.current={activatorEvent:M,active:G,activeNode:J,collisionRect:_e,collisions:x,droppableRects:O,draggableNodes:R,draggingNode:ne,draggingNodeRect:pe,droppableContainers:C,over:se,scrollableAncestors:He,scrollAdjustedTranslate:ae},$.current={initial:pe,translated:_e}},[G,J,x,_e,R,ne,pe,O,C,se,He,ae]),OR({...K,delta:L,draggingRect:_e,pointerCoordinates:st,scrollableAncestors:He,scrollableAncestorRects:Fe});const Ce=y.useMemo(()=>({active:G,activeNode:J,activeNodeRect:V,activatorEvent:M,collisions:x,containerNodeRect:ue,dragOverlay:Te,draggableNodes:R,droppableContainers:C,droppableRects:O,over:se,measureDroppableContainers:Q,scrollableAncestors:He,scrollableAncestorRects:Fe,measuringConfiguration:B,measuringScheduled:F,windowRect:Ke}),[G,J,V,M,x,ue,Te,R,C,O,se,Q,He,Fe,B,F,Ke]),xe=y.useMemo(()=>({activatorEvent:M,activators:be,active:G,activeNodeRect:V,ariaDescribedById:{draggable:E},dispatch:m,draggableNodes:R,over:se,measureDroppableContainers:Q}),[M,be,G,V,m,E,R,se,Q]);return In.createElement(iC.Provider,{value:v},In.createElement(vp.Provider,{value:xe},In.createElement(gC.Provider,{value:Ce},In.createElement(bC.Provider,{value:z},u)),In.createElement(tD,{disabled:(l==null?void 0:l.restoreFocus)===!1})),In.createElement(nR,{...l,hiddenTextDescribedById:E}));function Ae(){const Me=(D==null?void 0:D.autoScrollEnabled)===!1,Ie=typeof c=="object"?c.enabled===!1:c===!1,Le=N&&!Me&&!Ie;return typeof c=="object"?{...c,enabled:Le}:{enabled:Le}}}),sD=y.createContext(null),mk="button",aD="Draggable";function kp(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=iu(aD),{activators:a,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=y.useContext(vp),{role:h=mk,roleDescription:g="draggable",tabIndex:k=0}=i??{},w=(c==null?void 0:c.id)===t,m=y.useContext(w?bC:sD),[b,v]=Cf(),[S,T]=Cf(),N=KR(a,t),_=vc(n);ri(()=>(f.set(t,{id:t,key:s,node:b,activatorNode:S,data:_}),()=>{const L=f.get(t);L&&L.key===s&&f.delete(t)}),[f,t]);const R=y.useMemo(()=>({role:h,tabIndex:k,"aria-disabled":r,"aria-pressed":w&&h===mk?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,h,k,w,g,d.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:R,isDragging:w,listeners:r?void 0:N,node:b,over:p,setNodeRef:v,setActivatorNodeRef:T,transform:m}}function lD(){return y.useContext(gC)}const oD="Droppable",cD={timeout:25};function ux(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=iu(oD),{active:a,dispatch:l,over:c,measureDroppableContainers:u}=y.useContext(vp),d=y.useRef({disabled:n}),f=y.useRef(!1),p=y.useRef(null),h=y.useRef(null),{disabled:g,updateMeasurementsFor:k,timeout:w}={...cD,...i},m=vc(k??r),b=y.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(m.current)?m.current:[m.current]),h.current=null},w)},[w]),v=yp({callback:b,disabled:g||!a}),S=y.useCallback((R,L)=>{v&&(L&&(v.unobserve(L),f.current=!1),R&&v.observe(R))},[v]),[T,N]=Cf(S),_=vc(t);return y.useEffect(()=>{!v||!T.current||(v.disconnect(),f.current=!1,v.observe(T.current))},[T,v]),y.useEffect(()=>(l({type:fn.RegisterDroppable,element:{id:r,key:s,disabled:n,node:T,rect:p,data:_}}),()=>l({type:fn.UnregisterDroppable,key:s,id:r})),[r]),y.useEffect(()=>{n!==d.current.disabled&&(l({type:fn.SetDroppableDisabled,id:r,key:s,disabled:n}),d.current.disabled=n)},[r,s,n,l]),{active:a,rect:p,isOver:(c==null?void 0:c.id)===r,node:T,over:c,setNodeRef:N}}/**
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 uD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.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 dD={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 fD=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},c)=>y.createElement("svg",{ref:c,...dD,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xC("lucide",i),...l},[...a.map(([u,d])=>y.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
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 Pe=(e,t)=>{const n=y.forwardRef(({className:r,...i},s)=>y.createElement(fD,{ref:s,iconNode:t,className:xC(`lucide-${uD(e)}`,r),...i}));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 pD=Pe("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 hD=Pe("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 $u=Pe("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 mD=Pe("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 gD=Pe("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 bD=Pe("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 yC=Pe("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 n0=Pe("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 xD=Pe("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 ii=Pe("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 Pn=Pe("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 Un=Pe("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 au=Pe("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 lu=Pe("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 yD=Pe("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 vC=Pe("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 vD=Pe("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 kD=Pe("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"}]]);/**
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 Sc=Pe("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"}]]);/**
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 wD=Pe("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"}]]);/**
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 dx=Pe("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"}]]);/**
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 SD=Pe("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"}]]);/**
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 ED=Pe("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"}]]);/**
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 Es=Pe("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"}]]);/**
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 ND=Pe("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"}]]);/**
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 ou=Pe("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"}]]);/**
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 kC=Pe("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"}]]);/**
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 wC=Pe("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"}]]);/**
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 Ir=Pe("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"}]]);/**
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 r0=Pe("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"}]]);/**
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 _D=Pe("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"}]]);/**
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 Qs=Pe("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"}]]);/**
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 SC=Pe("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"}]]);/**
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 CD=Pe("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"}]]);/**
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 i0=Pe("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"}]]);/**
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 TD=Pe("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"}]]);/**
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 AD=Pe("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"}]]);/**
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 MD=Pe("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"}]]);/**
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 jD=Pe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 OD=Pe("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"}]]);/**
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 EC=Pe("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"}]]);/**
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 RD=Pe("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"}]]);/**
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 Cn=Pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 DD=Pe("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"}]]);/**
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 NC=Pe("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"}]]);/**
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 ID=Pe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
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 LD=Pe("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"}]]);/**
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 s0=Pe("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"}]]);/**
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 Ec=Pe("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"}]]);/**
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 zD=Pe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
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 _C=Pe("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"}]]);/**
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 wp=Pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 cu=Pe("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
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 a0=Pe("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"}]]);/**
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 Il=Pe("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"}]]);/**
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 PD=Pe("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"}]]);/**
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 gk=Pe("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"}]]);/**
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 CC=Pe("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"}]]);/**
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 UD=Pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 TC=Pe("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"}]]);/**
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 Sp=Pe("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"}]]);/**
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 AC=Pe("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"}]]);/**
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 MC=Pe("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"}]]);/**
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 bk=Pe("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"}]]);/**
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 fx=Pe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
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 px=Pe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
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 BD=Pe("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
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 HD=Pe("ToggleRight",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]]);/**
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 Fr=Pe("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"}]]);/**
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 hx=Pe("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"}]]);/**
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 l0=Pe("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"}]]);/**
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 FD=Pe("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"}]]);/**
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 jC=Pe("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"}]]);/**
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 $D=Pe("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"}]]);/**
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 tn=Pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
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 Ep=Pe("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"}]]),Ll={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:mD,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:TD,iconRunning:"text-cyan-400",iconIdle:"text-cyan-400/45",runAnimation:"harness-run-codex",dotDir:".codex"}},Ph={label:"",tooltip:"",badge:"border-neutral-700/50 bg-neutral-800/40 text-neutral-300",source:"bg-neutral-800 text-neutral-400",icon:Cn,iconRunning:"text-neutral-300",iconIdle:"text-neutral-500",runAnimation:"",dotDir:""},qt=Object.keys(Ll);function An(e){return e&&e in Ll?Ll[e]:{...Ph,label:e??Ph.label,tooltip:e??Ph.tooltip}}class OC extends Error{constructor(t,n){super(t),this.status=n,this.name="AuthError"}}const mx="/api";let o0="unknown";const c0=new Set;function Nc(e){if(o0!==e){o0=e;for(const t of c0)t()}}function gx(){return o0}function RC(e){return c0.add(e),()=>c0.delete(e)}function DC(){return y.useSyncExternalStore(RC,gx)}async function GD(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 IC(){try{const e=await fetch(`${mx}/auth/status`);if(!e.ok){Nc("anonymous");return}const t=await e.json();Nc(t.authenticated===!0?"authenticated":"anonymous")}catch{}}async function KD(e){const t=await fetch(`${mx}/auth/login`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({password:e})});if(!t.ok)throw new OC(await GD(t),t.status);Nc("authenticated")}async function qD(){try{await fetch(`${mx}/auth/logout`,{method:"POST"})}catch{}Nc("anonymous")}function YD(){Nc("anonymous")}function VD(){IC()}const ro="/api",Is=ro;async function ze(e,t){const n=await fetch(`${ro}${e}`,{...t,headers:{"content-type":"application/json",...t==null?void 0:t.headers}});if(n.status===401)throw YD(),new Error(await xk(n));if(!n.ok)throw new Error(await xk(n));return await n.json()}async function xk(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 _c(e){return e.kind==="claude-event"?{kind:"hook-event",harness:"claude",event:e.event}:e}function XD(e){return e.kind==="claude-event"?"claude":e.kind==="hook-event"?e.harness:null}const LC=["PreToolUse","PostToolUse","UserPromptSubmit","SessionStart","Stop","SubagentStop","Notification","PreCompact"],Uh=["PostToolUse","UserPromptSubmit","SessionStart","Stop","SubagentStop"],zC=["command","agent","workflow","rule","output-style"];function uu(e){return qt.find(t=>e.startsWith(t))??null}const PC=["gray","red","green","yellow","blue","magenta","cyan"],yk="0.1.0",WD={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"]},UC={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}"},ZD={percent:"{percent}%",bar:"{bar}",both:"{percent}% {bar}"},Se={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,r,i)=>ze(`/projects/${e}/hooks?sessionId=${encodeURIComponent(t)}&limit=${n}${r===void 0?"":`&beforeId=${r}`}${i!=null&&i.length?`&types=${encodeURIComponent(i.join(","))}`:""}`).then(s=>s.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,r)=>ze(`/projects/${e}/toolkit/${encodeURIComponent(t)}/${n?"enable":"disable"}${r?`?source=${encodeURIComponent(r)}`:""}`,{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(r=>r.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}`}`).then(t=>t.sessions),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}:{})}),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)}),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"}),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(`${Is}/projects/${e}/install`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),uninstall:(e,t)=>fetch(`${Is}/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(`${Is}/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(`${Is}/statusline/global`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),listUpdates:e=>ze(`/projects/${e}/updates`),updateAsset:(e,t)=>fetch(`${Is}/projects/${e}/update`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),syncAll:e=>fetch(`${Is}/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(r=>r.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,r,i)=>ze(`/projects/${e}/plugins/state`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({runtime:t,key:n,scope:r,state:i})}),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(`${Is}/projects/${e}/config`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),listLibraryAssets:e=>ze(`/libraries/${e}/assets`),eventsUrl:()=>`${ro}/events`};function os(e,t){const n=t==null?void 0:t.categories[e];return{surfaces:(n==null?void 0:n.surfaces)??qt.map(i=>({harness:i,scopes:["project","user"]}))}}const QD={claude:"capability.reason.codexOnly",codex:"capability.reason.claudeOnly"};function gl(e,t){const n=e.surfaces.find(r=>r.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:QD[t.agent]??"capability.reason.harnessUnsupported"}}function JD(e,t,n,r){return zC.includes(e)?gl(os(e,r),{scope:n,agent:t}).ok:!1}function Bh(e,t){return{...e,attrs:os(e.category,t)}}const u0=new Set,Hd=new Map;let Vr=null;function bx(){return gx()!=="authenticated"?null:Vr||(Vr=new EventSource(Se.eventsUrl()),Vr.onmessage=e=>{var n;let t;try{t=JSON.parse(e.data)}catch{return}t.type==="invalidate"&&((n=Hd.get(String(t.key)))==null||n());for(const r of u0)r(t)},Vr.onerror=()=>{VD()},Vr)}function eI(){Vr==null||Vr.close(),Vr=null}RC(()=>{if(gx()==="authenticated"){bx();return}eI()});function sl(e){return bx(),u0.add(e),()=>{u0.delete(e)}}function Ri(e,t){return bx(),Hd.set(e,t),()=>{Hd.get(e)===t&&Hd.delete(e)}}function Cc(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 BC={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",SubagentStop:"bg-orange-900/40 text-orange-300"};Object.fromEntries(Object.entries(Ll).map(([e,t])=>[e,t.source]));function rr(e){return new Date(e).toLocaleTimeString()}function Hh(e){const t=new Date(e),n=t.toLocaleTimeString();return t.toDateString()===new Date().toDateString()?n:`${t.getMonth()+1}/${t.getDate()} ${n}`}const vk="[weave] ",tI="weave",nI=/<cross-session-message([^>]*)>([\s\S]*)<\/cross-session-message>/,rI=/from-name="([^"]*)"/,iI=/^\[weave one-way injection — no reply is expected[^\]]*\]\s*/;function HC(e){var s;let t=e.startsWith(vk)?e.slice(vk.length):e;const n=t!==e,r=nI.exec(t),i=r?((s=rI.exec(r[1]))==null?void 0:s[1])??null:null;return r&&(t=r[2],t=t.startsWith(`
454
- `)?t.slice(1):t),t=t.replace(iI,""),{text:t.trim(),fromWeave:n||i===tI,fromName:i}}function sI(e){return dn(Li(e).prompt)}function aI(e){return dn(Li(e).last_assistant_message)}function Tn(e,t){return e??t.slice(0,8)}const kk=new WeakMap;function xx(e){const t=kk.get(e);if(t!==void 0)return t;let n={};try{const r=JSON.parse(e.payload);r&&typeof r=="object"&&(n=r)}catch{}return kk.set(e,n),n}function Li(e){const t=xx(e);return t.raw&&typeof t.raw=="object"?t.raw:{}}const Gu=e=>e.replace(/\s+/g," ").trim(),dn=e=>typeof e=="string"&&e?e:null;function d0(e){if(e.eventType!=="PostToolUse")return null;const t=xx(e),n=t.toolResponse;if(!n||typeof n.agentId!="string"||!n.agentId)return null;const r=t.raw;return{agentId:n.agentId,toolUseId:dn(r==null?void 0:r.tool_use_id),model:dn(n.resolvedModel)}}function Np(e){const t=xx(e).raw,n=dn(t==null?void 0:t.prompt);if(!n||!n.startsWith("<task-notification>"))return null;const r=i=>{const s=n.match(new RegExp(`<${i}>([^<]*)</${i}>`));return s&&s[1].trim()||null};return{taskId:r("task-id"),toolUseId:r("tool-use-id"),status:r("status"),summary:r("summary")}}function Fd(e){const t=Li(e),n=Cc(e.payload);switch(e.eventType){case"UserPromptSubmit":{const r=Np(e);return r?[r.status,r.summary].filter(Boolean).join(" · "):Gu(dn(t.prompt)??"")}case"PreToolUse":case"PostToolUse":{const r=n.toolInput??{},i=dn(r.file_path)??dn(r.path)??dn(r.description)??dn(r.pattern)??dn(r.url)??dn(r.command)??"",s=Gu([n.toolName,i].filter(Boolean).join(" "));if(e.eventType==="PostToolUse"){const a=n.toolResponse,l=a&&typeof a=="object"?dn(a.stdout)??dn(a.type):null;if(l)return`${s} → ${Gu(l).slice(0,90)}`}return s}case"Notification":{const r=dn(t.message)??"",i=dn(t.notification_type);return i&&r?`${i} · ${r}`:i??r}case"SubagentStop":return Gu(dn(t.last_assistant_message)??"");case"SessionStart":case"SessionEnd":{const r=dn(t.session_title)??"",i=dn(t.source)??"";return[r,i].filter(Boolean).join(" · ")}default:return""}}async function wk(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const r={...t?{body:t}:{},...n?{tag:n}:{}},i="serviceWorker"in navigator?await navigator.serviceWorker.getRegistration():void 0;if(i){await i.showNotification(e,Object.keys(r).length?r:void 0);return}new Notification(e,Object.keys(r).length?r:void 0)}catch{}}async function FC(){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 _p(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function lI(e,t){return e.reduce((n,r,i)=>{const s=t.get(r);return s&&(n[i]=s),n},Array(e.length))}function Ku(e){return e!==null&&e>=0}function oI(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 cI(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const qu={scaleX:1,scaleY:1},uI=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:i,overIndex:s,index:a}=e;const l=(t=n[i])!=null?t:r;if(!l)return null;const c=dI(n,a,i);if(a===i){const u=n[s];return u?{x:i<s?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...qu}:null}return a>i&&a<=s?{x:-l.width-c,y:0,...qu}:a<i&&a>=s?{x:l.width+c,y:0,...qu}:{x:0,y:0,...qu}};function dI(e,t,n){const r=e[t],i=e[t-1],s=e[t+1];return!r||!i&&!s?0:n<t?i?r.left-(i.left+i.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(i.left+i.width)}const $C=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const s=_p(t,r,n),a=t[i],l=s[i];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},Yu={scaleX:1,scaleY:1},fI=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:s,overIndex:a}=e;const l=(t=s[n])!=null?t:r;if(!l)return null;if(i===n){const u=s[a];return u?{x:0,y:n<a?u.top+u.height-(l.top+l.height):u.top-l.top,...Yu}:null}const c=pI(s,i,n);return i>n&&i<=a?{x:0,y:-l.height-c,...Yu}:i<n&&i>=a?{x:0,y:l.height+c,...Yu}:{x:0,y:0,...Yu}};function pI(e,t,n){const r=e[t],i=e[t-1],s=e[t+1];return r?n<t?i?r.top-(i.top+i.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const GC="Sortable",KC=In.createContext({activeIndex:-1,containerId:GC,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$C,disabled:{draggable:!1,droppable:!1}});function qC(e){let{children:t,id:n,items:r,strategy:i=$C,disabled:s=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:d}=lD(),f=iu(GC,n),p=l.rect!==null,h=y.useMemo(()=>r.map(N=>typeof N=="object"&&"id"in N?N.id:N),[r]),g=a!=null,k=a?h.indexOf(a.id):-1,w=u?h.indexOf(u.id):-1,m=y.useRef(h),b=!oI(h,m.current),v=w!==-1&&k===-1||b,S=cI(s);ri(()=>{b&&g&&d(h)},[b,h,g,d]),y.useEffect(()=>{m.current=h},[h]);const T=y.useMemo(()=>({activeIndex:k,containerId:f,disabled:S,disableTransforms:v,items:h,overIndex:w,useDragOverlay:p,sortedRects:lI(h,c),strategy:i}),[k,f,S.draggable,S.droppable,v,h,w,c,p,i]);return In.createElement(KC.Provider,{value:T},t)}const hI=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return _p(n,r,i).indexOf(t)},mI=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:s,newIndex:a,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==s&&i===a?!1:n?!0:a!==i&&t===c},gI={duration:200,easing:"ease"},YC="transform",bI=Af.Transition.toString({property:YC,duration:0,easing:"linear"}),xI={roleDescription:"sortable"};function yI(e){let{disabled:t,index:n,node:r,rect:i}=e;const[s,a]=y.useState(null),l=y.useRef(n);return ri(()=>{if(!t&&n!==l.current&&r.current){const c=i.current;if(c){const u=no(r.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,r,i]),y.useEffect(()=>{s&&a(null)},[s]),s}function VC(e){let{animateLayoutChanges:t=mI,attributes:n,disabled:r,data:i,getNewIndex:s=hI,id:a,strategy:l,resizeObserverConfig:c,transition:u=gI}=e;const{items:d,containerId:f,activeIndex:p,disabled:h,disableTransforms:g,sortedRects:k,overIndex:w,useDragOverlay:m,strategy:b}=y.useContext(KC),v=vI(r,h),S=d.indexOf(a),T=y.useMemo(()=>({sortable:{containerId:f,index:S,items:d},...i}),[f,i,S,d]),N=y.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:_,node:R,isOver:L,setNodeRef:C}=ux({id:a,data:T,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...c}}),{active:U,activatorEvent:$,activeNodeRect:G,attributes:I,setNodeRef:D,listeners:A,isDragging:M,over:P,setActivatorNodeRef:H,transform:E}=kp({id:a,data:T,attributes:{...xI,...n},disabled:v.draggable}),j=$O(C,D),B=!!U,O=B&&!g&&Ku(p)&&Ku(w),Q=!m&&M,F=Q&&O?E:null,ce=O?F??(l??b)({rects:k,activeNodeRect:G,activeIndex:p,overIndex:w,index:S}):null,K=Ku(p)&&Ku(w)?s({id:a,items:d,activeIndex:p,overIndex:w}):S,q=U==null?void 0:U.id,V=y.useRef({activeId:q,items:d,newIndex:K,containerId:f}),ue=d!==V.current.items,me=t({active:U,containerId:f,isDragging:M,isSorting:B,id:a,index:S,items:d,newIndex:V.current.newIndex,previousItems:V.current.items,previousContainerId:V.current.containerId,transition:u,wasDragging:V.current.activeId!=null}),Ne=yI({disabled:!me,index:S,node:R,rect:_});return y.useEffect(()=>{B&&V.current.newIndex!==K&&(V.current.newIndex=K),f!==V.current.containerId&&(V.current.containerId=f),d!==V.current.items&&(V.current.items=d)},[B,K,f,d]),y.useEffect(()=>{if(q===V.current.activeId)return;if(q&&!V.current.activeId){V.current.activeId=q;return}const ne=setTimeout(()=>{V.current.activeId=q},50);return()=>clearTimeout(ne)},[q]),{active:U,activeIndex:p,attributes:I,data:T,rect:_,index:S,newIndex:K,items:d,isOver:L,isSorting:B,isDragging:M,listeners:A,node:R,overIndex:w,over:P,setNodeRef:j,setActivatorNodeRef:H,setDroppableNodeRef:C,setDraggableNodeRef:D,transform:Ne??ce,transition:Te()};function Te(){if(Ne||ue&&V.current.newIndex===S)return bI;if(!(Q&&!rx($)||!u)&&(B||me))return Af.Transition.toString({...u,property:YC})}}function vI(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}yt.Down,yt.Right,yt.Up,yt.Left;function XC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=XC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function kI(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=XC(e))&&(r&&(r+=" "),r+=t);return r}const yx="-",wI=e=>{const t=EI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const l=a.split(yx);return l[0]===""&&l.length!==1&&l.shift(),WC(l,t)||SI(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&r[a]?[...c,...r[a]]:c}}},WC=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?WC(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(yx);return(a=t.validators.find(({validator:l})=>l(s)))==null?void 0:a.classGroupId},Sk=/^\[(.+)\]$/,SI=e=>{if(Sk.test(e)){const t=Sk.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},EI=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return _I(Object.entries(e.classGroups),n).forEach(([s,a])=>{f0(a,r,s,t)}),r},f0=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:Ek(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(NI(i)){f0(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{f0(a,Ek(t,s),n,r)})})},Ek=(e,t)=>{let n=e;return t.split(yx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},NI=e=>e.isThemeGetter,_I=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,l])=>[t+a,l])):s);return[n,i]}):e,CI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},ZC="!",TI=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,a=l=>{const c=[];let u=0,d=0,f;for(let w=0;w<l.length;w++){let m=l[w];if(u===0){if(m===i&&(r||l.slice(w,w+s)===t)){c.push(l.slice(d,w)),d=w+s;continue}if(m==="/"){f=w;continue}}m==="["?u++:m==="]"&&u--}const p=c.length===0?l:l.substring(d),h=p.startsWith(ZC),g=h?p.substring(1):p,k=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:k}};return n?l=>n({className:l,parseClassName:a}):a},AI=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},MI=e=>({cache:CI(e.cacheSize),parseClassName:TI(e),...wI(e)}),jI=/\s+/,OI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],a=e.trim().split(jI);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let g=!!h,k=r(g?p.substring(0,h):p);if(!k){if(!g){l=u+(l.length>0?" "+l:l);continue}if(k=r(p),!k){l=u+(l.length>0?" "+l:l);continue}g=!1}const w=AI(d).join(":"),m=f?w+ZC:w,b=m+k;if(s.includes(b))continue;s.push(b);const v=i(k,g);for(let S=0;S<v.length;++S){const T=v[S];s.push(m+T)}l=u+(l.length>0?" "+l:l)}return l};function RI(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=QC(t))&&(r&&(r+=" "),r+=n);return r}const QC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=QC(e[r]))&&(n&&(n+=" "),n+=t);return n};function DI(e,...t){let n,r,i,s=a;function a(c){const u=t.reduce((d,f)=>f(d),e());return n=MI(u),r=n.cache.get,i=n.cache.set,s=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=OI(c,n);return i(c,d),d}return function(){return s(RI.apply(null,arguments))}}const Pt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},JC=/^\[(?:([a-z-]+):)?(.+)\]$/i,II=/^\d+\/\d+$/,LI=new Set(["px","full","screen"]),zI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PI=/\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$/,UI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,BI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,HI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hi=e=>bl(e)||LI.has(e)||II.test(e),Bi=e=>io(e,"length",XI),bl=e=>!!e&&!Number.isNaN(Number(e)),Fh=e=>io(e,"number",bl),vo=e=>!!e&&Number.isInteger(Number(e)),FI=e=>e.endsWith("%")&&bl(e.slice(0,-1)),it=e=>JC.test(e),Hi=e=>zI.test(e),$I=new Set(["length","size","percentage"]),GI=e=>io(e,$I,eT),KI=e=>io(e,"position",eT),qI=new Set(["image","url"]),YI=e=>io(e,qI,ZI),VI=e=>io(e,"",WI),ko=()=>!0,io=(e,t,n)=>{const r=JC.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},XI=e=>PI.test(e)&&!UI.test(e),eT=()=>!1,WI=e=>BI.test(e),ZI=e=>HI.test(e),QI=()=>{const e=Pt("colors"),t=Pt("spacing"),n=Pt("blur"),r=Pt("brightness"),i=Pt("borderColor"),s=Pt("borderRadius"),a=Pt("borderSpacing"),l=Pt("borderWidth"),c=Pt("contrast"),u=Pt("grayscale"),d=Pt("hueRotate"),f=Pt("invert"),p=Pt("gap"),h=Pt("gradientColorStops"),g=Pt("gradientColorStopPositions"),k=Pt("inset"),w=Pt("margin"),m=Pt("opacity"),b=Pt("padding"),v=Pt("saturate"),S=Pt("scale"),T=Pt("sepia"),N=Pt("skew"),_=Pt("space"),R=Pt("translate"),L=()=>["auto","contain","none"],C=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",it,t],$=()=>[it,t],G=()=>["",hi,Bi],I=()=>["auto",bl,it],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",it],E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[bl,it];return{cacheSize:500,separator:":",theme:{colors:[ko],spacing:[hi,Bi],blur:["none","",Hi,it],brightness:j(),borderColor:[e],borderRadius:["none","","full",Hi,it],borderSpacing:$(),borderWidth:G(),contrast:j(),grayscale:H(),hueRotate:j(),invert:H(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[FI,Bi],inset:U(),margin:U(),opacity:j(),padding:$(),saturate:j(),scale:j(),sepia:H(),skew:j(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",it]}],container:["container"],columns:[{columns:[Hi]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:[...D(),it]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],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",vo,it]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",it]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",vo,it]}],"grid-cols":[{"grid-cols":[ko]}],"col-start-end":[{col:["auto",{span:["full",vo,it]},it]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[ko]}],"row-start-end":[{row:["auto",{span:[vo,it]},it]}],"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",it]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",it]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",it,t]}],"min-w":[{"min-w":[it,t,"min","max","fit"]}],"max-w":[{"max-w":[it,t,"none","full","min","max","fit","prose",{screen:[Hi]},Hi]}],h:[{h:[it,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[it,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[it,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[it,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Hi,Bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fh]}],"font-family":[{font:[ko]}],"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",it]}],"line-clamp":[{"line-clamp":["none",bl,Fh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hi,it]}],"list-image":[{"list-image":["none",it]}],"list-style-type":[{list:["none","disc","decimal",it]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hi,Bi]}],"underline-offset":[{"underline-offset":["auto",hi,it]}],"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",it]}],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",it]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...D(),KI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",GI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},YI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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":[m]}],"border-style":[{border:[...A(),"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":[m]}],"divide-style":[{divide:A()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[hi,it]}],"outline-w":[{outline:[hi,Bi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[hi,Bi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Hi,VI]}],"shadow-color":[{shadow:[ko]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...M(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Hi,it]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[v]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"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":[m]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"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",it]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",it]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",it]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[vo,it]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",it]}],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",it]}],"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",it]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[hi,Bi,Fh]}],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"]}}},JI=DI(QI);function ye(...e){return JI(kI(e))}const Nk={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 Ye({className:e,variant:t="default",...n}){return o.jsx("span",{className:ye("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium tracking-tight",Nk[t]??Nk.default,e),...n})}function $r({agent:e,className:t}){return e?o.jsx(Ye,{className:ye("shrink-0",An(e).badge,t),children:e}):null}function da(e){const[t,n]=y.useState(()=>typeof window<"u"&&window.matchMedia(e).matches);return y.useEffect(()=>{const r=window.matchMedia(e),i=()=>n(r.matches);return i(),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t}const tT=["zh-CN","en"],p0="zh-CN",e4={"zh-CN":"中文(简体)",en:"English"},nT="weave:locale",t4={"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":"增加"},n4={"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"},r4={"settings.title":"设置","settings.language":"语言","settings.languageHint":"dashboard 与 weave CLI 共用的界面语言。","settings.defaultTerminal":"默认终端","settings.defaultTerminalHint":"「在终端中打开」使用的终端程序;自动模式会探测当前系统可用的终端。","settings.customCommand":"自定义命令","settings.pathHint":"会被替换为带引号的项目路径,例如:","settings.hooks":"Weave 总开关","settings.hooksHint":"Weave daemon 总开关(规则级开关另控);关闭后规则命中直接短路。","settings.launchOnLogin":"开机自启 daemon","settings.launchOnLoginHint":"登录系统时自动拉起 weave 后台服务(Windows 注册表 Run 项 / macOS LaunchAgent / Linux XDG 自启动),默认关闭。","settings.retentionDays":"事件日志保留天数","settings.retentionDaysHint":"hook 事件日志的被动清理阈值:超过该天数的日志在下一次跨天写入时删除(无定时任务);保存后下一条事件即按新值清理。","settings.daysUnit":"天","settings.accessUrls":"访问地址","settings.accessUrlsHint":"本机与局域网设备访问 dashboard 的完整地址;https 端口用于手机浏览器通知(自签证书,首次访问需在浏览器接受)。","settings.urlLan":"局域网","settings.urlLocal":"本机","settings.push":"推送提醒","settings.pushHint":"提醒的推送通道:dashboard 页面关闭后仍可到达本浏览器(逐设备开关,多台主机各自打开即可都收到)。","settings.pushInsecure":"推送需 HTTPS 访问(当前页面是非安全上下文,浏览器禁用推送)。","settings.pushUnsupported":"此浏览器不支持 Web Push(iOS 需将本站加到主屏幕后可用)。","settings.pushFailed":"推送订阅未成功——提醒保持「页面开着才通知」。"},i4={"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 mode probes the terminals available on this system.',"settings.customCommand":"Custom command","settings.pathHint":"is replaced with the quoted project path, e.g.:","settings.hooks":"Weave master switch","settings.hooksHint":"Weave daemon master switch (rule-level switches stay independent); when off, rule matching short-circuits.","settings.launchOnLogin":"Launch daemon on login","settings.launchOnLoginHint":"Start the weave daemon automatically at login (Windows Run key / macOS LaunchAgent / Linux XDG autostart). Off by default.","settings.retentionDays":"Event log retention (days)","settings.retentionDaysHint":"Passive cleanup threshold for hook event logs: older logs are deleted on the first write after the next day boundary (no scheduled job); saving takes effect on the next event.","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":"Push channel for watch alerts: reaches this browser even with the dashboard closed (per-device toggle — enable it on each host that should receive pushes).","settings.pushInsecure":"Push requires HTTPS access (this page is an insecure context; the browser blocks push).","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."},s4={"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":"自定义命令"},a4={"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"},l4={"app.projectCount":"{n} 个项目","app.settingsTooltip":"设置(默认终端等)","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、单文件资产(commands / agents / workflows / rules / output-styles)。① 有新版的更新;② 被删除的已安装资产会装回;③ 本地改过(custom)的跳过。不含 statusline(状态栏面板自己管保存/覆盖)与 init 产物(helpers / hooks / CLAUDE.md,需 weave init)。","app.scopeCoverageChip":"覆盖 Skills · MCP · 资源管理","app.autoSyncOnTooltip":"自动同步已开启 — daemon 每约 60 秒自动应用过期资产更新;点击改为手动","app.autoSyncOffTooltip":"自动同步已关闭 — 过期资产只提示、不自动更新;点击开启(daemon 每约 60 秒自动应用)","app.autoSyncOn":"自动同步 开","app.autoSyncOff":"自动同步 关","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.syncNow":"立即同步","project.syncPending":"有更新待同步({n})— 点击立即同步","project.sessionsRunning":"{n} 个会话运行中","project.sessionsOpen":"{n} 个会话就绪(等输入)","project.harnessesTip":"本项目 init 时选择接入的 harness","project.archive":"归档项目","project.archiveConfirm":"归档「{name}」?历史会话将立即清空,server 不再消费该项目;基础信息保留,可随时从归档面恢复。","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.autoSyncOn":"自动同步已开启","toast.autoSyncOff":"自动同步已关闭","errors.syncFailed":"同步失败:{error}","errors.updateFailed":"更新失败:{error}","errors.configUpdateFailed":"配置更新失败:{error}","errors.pluginToggleFailed":"插件启用状态更新失败:{error}","errors.openFailed":"打开失败:{error}"},o4={"app.projectCount":"{n} projects","app.settingsTooltip":"Settings (default terminal, etc.)","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 everything syncable now ({n}): update outdated assets and reinstall deleted ones","app.syncAll":"Sync all","app.scopeCoverageTooltip":"Sync scope = library assets: Skills, MCP, single-file assets (commands / agents / workflows / rules / output-styles). (1) newer versions are applied; (2) installed assets that were deleted are reinstalled; (3) locally modified (custom) entries are skipped. Excludes the statusline (the statusline panel owns save/overwrite) and init artefacts (helpers / hooks / CLAUDE.md — those need `weave init`).","app.scopeCoverageChip":"Covers Skills · MCP · resources","app.autoSyncOnTooltip":"Auto-sync is ON — the daemon applies outdated asset updates about every 60 seconds; click to switch to manual","app.autoSyncOffTooltip":"Auto-sync is OFF — outdated assets are only flagged, not updated; click to enable (the daemon applies them about every 60 seconds)","app.autoSyncOn":"Auto-sync ON","app.autoSyncOff":"Auto-sync OFF","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.syncNow":"Sync now","project.syncPending":"{n} update(s) pending — click to sync now","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 and the server stops consuming it; basic info is kept — restore anytime from the archived view.',"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 — archive deletes, not pauses)","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) — global config cannot be changed from the project view","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.autoSyncOn":"Auto-sync turned ON","toast.autoSyncOff":"Auto-sync turned OFF","errors.syncFailed":"Sync failed: {error}","errors.updateFailed":"Update failed: {error}","errors.configUpdateFailed":"Config update failed: {error}","errors.pluginToggleFailed":"Plugin toggle failed: {error}","errors.openFailed":"Open failed: {error}"},c4={"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":"Claude Code 空闲时重跑脚本的间隔(秒);交互驱动的更新不受此限制","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(从 transcript 读取)","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":"rate_limits.five_hour — 5 小时限额","rateWin.sevenDay.label":"7d","rateWin.sevenDay.title":"rate_limits.seven_day — 7 天限额","rateWin.spend.label":"花费","rateWin.spend.title":"rate_limits.spend_limit — 花费限额(gateway)"},u4={"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":"Interval (seconds) before the script re-runs while Claude Code is idle; interaction-driven updates are not limited by this","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 rendered before the value, joined by the label separator","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 (read from the transcript)","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":"rate_limits.five_hour — 5-hour limit","rateWin.sevenDay.label":"7d","rateWin.sevenDay.title":"rate_limits.seven_day — 7-day limit","rateWin.spend.label":"spend","rateWin.spend.title":"rate_limits.spend_limit — spend limit (gateway)"},d4={"picker.title":"选择资源目录","picker.subtitle":"勾选一个或多个文件夹(点击箭头展开目录)","picker.quickAccess":"快速访问","picker.home":"主目录","picker.desktop":"桌面","picker.downloads":"下载","picker.documents":"文档","picker.libraryParent":"资源位置","picker.drive":"磁盘","picker.root":"根目录","picker.alreadyAdded":"已添加","picker.selectFolder":"选择此文件夹","picker.unselect":"取消选择","picker.noneSelected":"尚未选择任何文件夹","picker.clickRemove":"点击移除","picker.selectedCount":"已选 {count} 项","picker.add":"添加","picker.addCount":"添加({count})","picker.pathPlaceholder":"完整路径:勾选文件夹后显示在此,也可粘贴一个路径","picker.addPathTip":"把这一路径加入选择","category.tabAllTip":"混合展示全部 harness 工具的资产","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 资源(AGENTS.md、.codex/config.toml 等会展示在文件树中)。Codex 自定义 prompts(~/.codex/prompts/)已被官方移除。","category.emptyFilesOtherHarness":"该项目暂无 {harness} 资源","category.emptyFilesProject":"该项目暂无资源","category.globalFilesTitle":"全局资源","category.emptyFilesGlobalDesc":"~/.claude 与 ~/.codex 下暂无匹配的资源(skills 与 MCP 有各自页面)。","category.personalizationGlobal":"全局 Claude 个性化配置(模板)","category.personalizationProject":"Claude Code 个性化配置","category.statuslineSource":"statusline:{source}","category.statuslineCustom":"项目自定义","category.statuslineFollowGlobal":"跟随全局模板","category.codexPersonalizationPlaceholder":"Codex 没有 statusline 等个性化对等物(BACKLOG §10-4:Claude 专属是正确的)。此面板仅提供 Claude Code 个性化配置,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":"刷新市场缓存并同步已安装副本:全局 symlink skill 即时生效、Weave 包热重载、CC 插件需重装(uninstall + install)","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 原生插件:全局安装 + 项目启用,由 Claude Code 加载","library.weavePluginTip":"Weave 规则包:装载进 weave 引擎,项目级开关","library.pluginSkillsLabel":"包内 skills · 随插件启停","library.pluginSkillsFollowTip":"隶属该插件,不单独安装——随插件启用/停用","library.pluginNotInToolkit":"未纳入包扫描源(内置 · 市场导入)——无法在此安装","library.pluginsSectionHint":"「安装」= CC 插件与 mod 装到全局并在当前项目启用(表面包复制进本项目);weave 规则包直接启用。启停与卸载在 资源管理 ▸ Plugins","library.installPackTip":"装入:CC 插件与 mod 安装到全局并在当前项目启用;表面包复制进本项目","library.packInstalled":"已安装并启用:{name}","library.installing":"安装中…","library.installedManageTip":"已安装——启停与卸载在 资源管理 ▸ Plugins","library.pluginSourceDir":"来源目录","library.addLibraryTemplates":"在上方导入资源以浏览模板。","library.noFileTemplates":"资源中未发现文件模板(commands / agents / workflows / rules / output-styles 目录)。","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"},f4={"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.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":"Mix assets from every harness 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 (AGENTS.md, .codex/config.toml, etc. show up in the file tree). Codex custom prompts (~/.codex/prompts/) were removed upstream.","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 (skills and MCP have their own pages).","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 statusline counterpart for personalization (BACKLOG §10-4: Claude-only by design). This panel only provides Claude Code personalization — no equivalent surface exists for Codex.","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 as a relative path (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 + deregister from the host (plugins from this market are cascade-uninstalled)","library.removeMarketTitle":"Remove market","library.removeMarketConfirm":'Remove market "{name}"? The market copy is deleted and the host cascade-uninstalls plugins installed from it (including their data); installed copies such as 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 from the host 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":"Compare the local market cache with its source folder / git remote","library.checkDone":"Check complete: {n} update(s) available","library.checkFailed":"Update check failed: {error}","library.refreshUpdates":"Update all","library.refreshUpdatesTip":"Refresh the market cache and sync installed copies: global symlink skills take effect immediately, Weave packs hot-reload, CC plugins need a reinstall (uninstall + install)","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, loaded by Claude Code","library.weavePluginTip":"Weave pack: loaded by the weave engine, 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":"Not covered by any pack scan source (builtin / market imports) — cannot install here","library.pluginsSectionHint":'"Install" adds CC plugins & mods globally and enables them in this project (surface packs copy in); Weave packs enable directly. Manage enable/uninstall in Resource Management ▸ Plugins',"library.installPackTip":"Install: CC plugins & mods go global and enable in this project; surface packs copy into this project","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 (commands / agents / workflows / rules / output-styles directories).","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, merged incrementally)","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"},p4={"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":"插件注册键 name@marketplace——@后为所属市场(插件 namespace)","repo.local":"本地","repo.namespaceTip":"仓库 namespace:该市场下所有插件都归这一块","repo.packCount":"{n} 个包","repo.enabledCount":"已启 {done} / {total}","repo.formLink":"链接","repo.formCopy":"副本","repo.formLegend":"链接 / 副本","repo.formTip":"weave 装在全局位置时的形态:链接 = 该处不存副本(改源即改生效);副本 = 建立链接失败已回退复制。Windows 的目录链接用 junction、通常无需开发者模式——若你的环境禁用了链接创建,可在「设置 ▸ 系统 ▸ 开发者选项」启用开发者模式后重装","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"},h4={"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} enable override (now: {state}) — click to cycle","skillGrid.keyTip":"Plugin key name@marketplace — the part after @ is its marketplace (plugin namespace)","repo.local":"Local","repo.namespaceTip":"Repository namespace: every plugin from this marketplace groups here","repo.packCount":"{n} packs","repo.enabledCount":"{done} / {total} enabled","repo.formLink":"linked","repo.formCopy":"copied","repo.formLegend":"linked / copied","repo.formTip":"How weave laid it down at the global location: linked = no copy lives there (edits to the source take effect); copied = creating a link failed and weave fell back to copying. Directory links on Windows use junctions and normally need no Developer Mode — 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"},m4={"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":"事件规则(hook-event)","hooks.sourceKind.legacy":"兼容旧版(claude-event)","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":"只记录事件并广播 SSE,不生成指令","hooks.handlerWebhookTip":"将事件摘要 POST 到外部地址(可选 HMAC 密钥)","hooks.handlerInjectTip":"渲染指令并同步注入当前会话","hooks.handlerManualTip":"渲染为指令节点,等待复制或拖到会话执行","hooks.handlerPluginTip":"按 pluginId:handlerType 加载插件自带的 handler.mjs 执行","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":"暂无插件——内置仓与资源市场是唯一安装来源(`<dataDir>/market/` 下的仓库自动加载)。","hooks.plugins.rules":"{n} 条规则","hooks.plugins.toggleTip":"默认启用开关:启停该插件全部规则(各项目可单独覆盖,规则级开关保留)","hooks.plugins.rejectedTip":"插件校验失败,修复后热重载自动恢复","hooks.plugins.hotReload":"插件文件变更后 1 秒内热重载生效","hooks.plugins.rescan":"重新扫描","hooks.plugins.rescanTip":"重扫全部插件根并重新挂载监听——守护进程启动时还不存在的根(手工建的目录、刚 init 的项目)由此纳管","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":"跨项目采集全部会话事件——dashboard 的地基","hooks.capture.note":"安装即启用:写入宿主 user 档 hooks(claude = ~/.claude/settings.json);项目档 init 的采集组会被自动清扫,不会双采集","hooks.capture.toggleTip":"安装 / 停用 user 档事件采集","hooks.capture.onOk":"user 档采集已安装","hooks.capture.offOk":"user 档采集已停用","hooks.capture.fail":"采集开关失败:{error}","hooks.capture.half":"半安装","hooks.capture.halfTip":"采集组已写但 helper 脚本缺失——关掉再打开即可修复"},g4={"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 (hook-event)","hooks.sourceKind.legacy":"Legacy (claude-event)","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 and broadcasts SSE; no prompt generated","hooks.handlerWebhookTip":"POSTs an event summary to an external URL (optional HMAC secret)","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":"Loads the plugin's own handler.mjs by pluginId:handlerType and runs it","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":"Global switch = default state for every project · 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 — the builtin repository and resource markets are the only install sources (repositories under `<dataDir>/market/` load automatically).","hooks.plugins.rules":"{n} rules","hooks.plugins.toggleTip":"Default switch: enable/disable all rules of this plugin (projects can override; per-rule switches are kept)","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 every plugin root and re-attach watchers — roots that did not exist when the daemon started (hand-made directories, freshly inited projects) 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 — the dashboard foundation","hooks.capture.note":"Install = enabled: writes harness user-scope hooks (claude = ~/.claude/settings.json); project-scope init groups are swept automatically, so no double capture","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"},b4={"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":"在默认终端打开会话(claude --resume)","tasks.sessionTerminalRunning":"该会话已在终端运行(claude --resume)——不可重复打开","tasks.terminalPickTitle":"选择要附加到的终端","tasks.terminalPickCancel":"取消","tasks.harnessPickTitle":"在哪个 harness 里新建会话","tasks.terminalTargetFallback":"窗口 {w} · Tab {t}","tasks.terminalTargetActive":"当前聚焦","tasks.terminalTargetFull":"已满({n} pane)","tasks.terminalTargetFullTip":"这个终端已满——新会话只能新开终端(同一可见屏幕最多 6 个 pane)","tasks.terminalTargetDetail":"{match} 个本项目 pane(共 {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.messagesTitle":"对话","tasks.messagesClose":"关闭","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.msgSendFailed":"投递失败:{error}","tasks.msgUnsupported":"该会话的 harness 不支持投递","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.msgStatusQueued":"排队中","tasks.msgStatusDelivering":"投递中","tasks.msgStatusInjected":"已注入","tasks.msgStatusDelivered":"已送达","tasks.msgDeliveredHint":"已交给对方 Claude Code——不等于已读:对方可能暂扣(等人批准)或静默拒收,发送侧判不了","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":"该会话跑完一轮对话(claude = Stop)","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":"log 规则命中不落库,历史链可能缺该类节点(图例说明)","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":"停止会话(向终端送一记 ESC)","tasks.stopOk":"已送出停止(ESC)","tasks.stopFail":"停止失败:{error}","tasks.groupPreSession":"会话引导","tasks.autoDeleteIn":"{n} 分钟后自动删除","tasks.autoDeleteSoon":"即将自动删除","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":"会话按 harness 泳道排布(节点上挂在途消息数),点击可投递的节点看会话消息","orch.canvasEmpty":"本项目暂无会话——先在任务视图跑出会话,再回到这里编排","orch.messages":"{n} 条在途消息","orch.unknownLane":"未知 harness","orch.received":"在途 {n}","orch.builderTitle":"触发序列","orch.builderHint":"步 ≤3(hop 上限):前一步完成后自动发下一步","orch.namePlaceholder":"序列名(可选)","orch.stepTarget":"目标会话","orch.stepMode":"投递通道","orch.stepText":"消息内容","orch.addStep":"加一步","orch.removeStep":"移除该步","orch.trigger":"触发","orch.triggerFailed":"触发序列失败:{error}","orch.noCapableSessions":"暂无可收消息的会话(消息能力按 harness 派生——见任务视图)","orch.sequencesTitle":"序列","orch.seqEmpty":"暂无序列——用上方触发器发起第一条","orch.seqNameFallback":"序列 #{id}","orch.seqProgress":"第 {cur}/{n} 步","orch.seqDone":"已完成","orch.seqCancelled":"已取消","orch.seqCancel":"取消","orch.seqCancelFailed":"取消序列失败:{error}","orch.seqStepPending":"未触发","orch.globalHint":"编排是项目级视图——选择一个项目后编排它的会话"},x4={"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 (reuses this project's terminal, or opens a new one)","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 verification failed — server did not confirm the write; retry","tasks.renamePendingTip":"Queued — applies on the session’s next event (idle sessions wait)","tasks.dropTip":"Drop an instruction card here to run","tasks.copySessionId":"Copy full session id","tasks.copied":"Copied","tasks.openSessionTerminal":"Open in default terminal (claude --resume)","tasks.sessionTerminalRunning":"A terminal is already running this session (claude --resume) — cannot open again","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 can only open a new terminal (6 panes per screen max)","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.messagesTitle":"Conversation","tasks.messagesClose":"Close","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.msgSendFailed":"Delivery failed: {error}","tasks.msgUnsupported":"This session harness supports no message delivery","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 (never shown again; if it is why the queue is paused, the pause is lifted). Content already delivered to the session is unaffected","tasks.msgDismissQueuedHint":"Not delivered yet (still queued) — deleting it cancels the send","tasks.msgDismissFailed":"Delete failed: {error}","tasks.msgStatusQueued":"Queued","tasks.msgStatusDelivering":"Delivering","tasks.msgStatusInjected":"Injected","tasks.msgStatusDelivered":"Delivered","tasks.msgDeliveredHint":'Handed to the target Claude Code — not "read": it may be held for approval or silently refused, which the sender cannot detect',"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 terminal/inbox; queues if closed)","tasks.msgModeAutoHint":"Auto (busy → queued inject, idle → headless turn)","tasks.msgModeInjectHint":"Inject (non-preemptive queue, rides the next event)","tasks.msgModeHeadlessHint":"Headless (idle only, forces a new turn)","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 (in-page + browser notification), 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 (claude = Stop)","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":"Answers are sent as keystrokes into the session terminal (same as the terminal modal’s number keys / Enter): one question submits on click, several questions (or a multi-select) are submitted in one go with the buttons below. Question and option text is kept verbatim from the session.","tasks.answerPickerHintPreview":"Answers are sent as keystrokes into the session terminal (same as the terminal modal’s preview form): clicking an option only moves the highlight (the right pane follows), and the Send button commits; notes go together with the highlighted option (notes alone are allowed too). Question and option text is kept verbatim from the session.","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":"log-rule hits are not persisted; historical chains may omit them","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 (send one ESC to the terminal)","tasks.stopOk":"Stop sent (ESC)","tasks.stopFail":"Stop failed: {error}","tasks.groupPreSession":"Session kickoff","tasks.autoDeleteIn":"Auto-deletes in {n}m","tasks.autoDeleteSoon":"Auto-deletes soon","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 harness lanes (in-flight count on each node) — click a message-capable node to open its messages","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 (hop limit); each step 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 (messaging is derived per harness — see the Tasks view)","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"},y4={"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}"},v4={"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}"},k4={"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 档,claude plugin install --scope user)","toolkit.installFailed":"安装失败:{error}","toolkit.userInstalled":"已装到全局:{key}","toolkit.enableDefault":"默认","toolkit.enableOn":"启用","toolkit.enableOff":"禁用","toolkit.enableTip":"{state}(user 档)— 点击切换","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":"CC 注册键 name@marketplace——@后为所属市场(插件 namespace);安装 scope:{scopes}","toolkit.scopesNone":"未安装","toolkit.legacyTitle":"发现 {n} 个 Weave 旧插件副本","toolkit.legacyHint":"旧管线复制进项目插件位的死数据(Claude Code 不加载),可安全清理","toolkit.legacyCleanup":"清理","toolkit.uninstall":"卸载","toolkit.uninstallTip":"从 harness 彻底卸载(CC 插件与 mod 执行 claude plugin uninstall;表面包清扫已复制文件;预置源保留可重装)"},w4={"toolkit.hint":"Builtin and market imports share one scan pipeline; CC plugins & mods install as a whole, others toggle 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 (claude plugin install --scope user)","toolkit.installFailed":"Install failed: {error}","toolkit.userInstalled":"Installed to user scope: {key}","toolkit.enableDefault":"Default","toolkit.enableOn":"Enabled","toolkit.enableOff":"Disabled","toolkit.enableTip":"{state} (user scope) — 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":"CC plugin key name@marketplace — the part after @ is its marketplace (plugin namespace); install scope: {scopes}","toolkit.scopesNone":"not installed","toolkit.legacyTitle":"Found {n} stale Weave plugin copies","toolkit.legacyHint":"Dead data the old pipeline copied into the project plugin dir (Claude Code does not load it); safe to clean up","toolkit.legacyCleanup":"Clean up","toolkit.uninstall":"Uninstall","toolkit.uninstallTip":"Uninstall from the harness (CC plugins & mods run claude plugin uninstall; surface packs clean copied files; shipped sources stay and can be reinstalled)"},S4={"auth.title":"weave 控制台","auth.passwordPlaceholder":"登录密码","auth.login":"登录","auth.wrongPassword":"密码错误","auth.logout":"退出登录","auth.hint":"初始密码见本机 `weave dashboard` 输出;改密用 `weave chpass <新密码>`(本机执行)。"},E4={"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>`."},N4={"ai.title":"AI 助手","ai.open":"打开 AI 助手","ai.close":"关闭","ai.placeholder":"问点关于 weave 的…(Enter 发送,Shift+Enter 换行)","ai.send":"发送","ai.stop":"停止生成","ai.clear":"清空对话","ai.empty":"还没有对话。助手已加载 weave 的功能文档与内置技能,只回答 weave 相关问题——可直接提问。","ai.docsMissing":"(未找到仓库 docs/,本次只注入了内置技能)","ai.intro":"回答范围仅限 weave(功能/用法/配置/架构/技能,越界会礼貌拒答);依据下方注入的资料。","ai.thinking":"正在生成…","ai.emptyAnswer":"(上游没有返回内容——检查模型名、端点是否支持该对话接口)","ai.failed":"AI 请求失败:{error}","settings.ai":"AI 助手","settings.aiHint":"配置好 OpenAI 兼容端点后,右下角出现助手按钮。API key 只写在服务端(<dataDir>/ai.json),不会回显到浏览器;改密/改 key 均不影响会话。","settings.aiBaseUrl":"API 地址","settings.aiBaseUrlPlaceholder":"https://api.example.com/v1","settings.aiModel":"模型","settings.aiModelPlaceholder":"gpt-4o-mini","settings.aiModelFetch":"拉取模型","settings.aiModelFetchTip":"按当前地址与 key 从服务端拉取可用模型(地址+key 齐了会自动拉一次)","settings.aiApiKey":"API Key","settings.aiApiKeySet":"已设置(留空 = 保持不变)","settings.aiApiKeyUnset":"未设置","settings.aiApiKeyClear":"清除","settings.aiApiKeyShow":"显示","settings.aiApiKeyHide":"隐藏"},_4={"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 has weave’s feature docs and built-in skills loaded and answers weave questions only — just ask.","ai.docsMissing":" (repo docs/ not found — only built-in skills were injected)","ai.intro":"Scope is limited to weave (features / usage / config / architecture / skills; off-topic asks are politely declined). Answers rely on the injected material below.","ai.thinking":"Generating…","ai.emptyAnswer":"(The upstream returned no content — check the model name and that the endpoint supports chat completions.)","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 only (<dataDir>/ai.json) 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 available models server-side with the current base URL and key (auto-fetched once both 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"},rT={...t4,...r4,...s4,...l4,...c4,...d4,...p4,...m4,...b4,...y4,...k4,...S4,...N4},C4={...n4,...i4,...a4,...o4,...u4,...f4,...h4,...g4,...x4,...v4,...w4,...E4,..._4},_k={"zh-CN":rT,en:C4};function T4(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>r in t?String(t[r]):n):e}function A4(e,t){return(n,r)=>T4(e[n]??t[n]??String(n),r)}const iT=y.createContext(null);function M4(){try{const e=localStorage.getItem(nT);return e==="zh-CN"||e==="en"?e:p0}catch{return p0}}function Ck(e){try{localStorage.setItem(nT,e)}catch{}}function j4({children:e}){const[t,n]=y.useState(M4);y.useEffect(()=>{let s=!0;return Se.getDaemonSettings().then(a=>{if(!s)return;const l=a.settings.locale;tT.includes(l)&&(n(l),Ck(l))}).catch(()=>{}),()=>{s=!1}},[]),y.useEffect(()=>{document.documentElement.lang=t},[t]);const r=y.useMemo(()=>A4(_k[t],_k[p0]),[t]),i=y.useMemo(()=>({locale:t,t:r,setLocale:s=>{n(s),Ck(s)}}),[t,r]);return o.jsx(iT.Provider,{value:i,children:e})}function sT(){const e=y.useContext(iT);if(!e)throw new Error("useI18n must be used inside <I18nProvider>");return e}function We(){return sT().t}function fa({harness:e,running:t=!1,className:n}){if(e&&e in Ll){const i=Ll[e],s=i.icon;return o.jsx("span",{className:ye("inline-flex shrink-0",t&&i.runAnimation,n),children:o.jsx(s,{className:ye("h-3.5 w-3.5",t?i.iconRunning:i.iconIdle)})})}const r=An(null);return o.jsx(Cn,{className:ye("h-3.5 w-3.5 shrink-0",t?"animate-spin text-orange-400":r.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(Cn,{className:ye("animate-spin",n)}):e==="success"?o.jsx(ii,{className:ye("text-emerald-400",n)}):t??null})}function so({open:e,title:t,message:n,confirmLabel:r,onConfirm:i,onClose:s}){const a=We();return e?ln.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:s}),o.jsxs("div",{className:"relative w-[380px] max-w-full rounded-2xl border border-white/[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-white/[0.06] frosted",children:[o.jsx(hx,{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:s,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-white/[0.06] px-4 py-2.5 flex items-center justify-end gap-2 frosted",children:[o.jsx("button",{onClick:s,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:()=>{i(),s()},className:"rounded-lg bg-red-600 px-3 py-1.5 text-xs text-white hover:bg-red-500",children:r})]})]})]}),document.body):null}const O4=450,Tk=8;function R4({projects:e,selectedId:t,globalActive:n,onSelect:r,onSelectGlobal:i,onOpenExplorer:s,onOpenTerminal:a,onHoverProject:l,autoSyncOf:c,updatesOf:u,onToggleAutoSync:d,onSyncNow:f,autoSyncStateOf:p,syncStateOf:h,openExplorerStateOf:g,openTerminalStateOf:k,sessionStatsOf:w,terminalsOf:m,onReorder:b,archivedProjects:v=[],onArchive:S,onRestore:T,restoreStateOf:N}){const _=We(),R=da("(pointer: fine)"),L=kc(su,{activationConstraint:{distance:5}}),C=kc(ox,{activationConstraint:{delay:200,tolerance:8}}),U=ix(R?L:C),[$,G]=y.useState(!1),[I,D]=y.useState(null);y.useEffect(()=>{$&&v.length===0&&G(!1)},[$,v.length]);const A=F=>{const{active:J,over:ce}=F;if(!ce||J.id===ce.id)return;const K=e.findIndex(V=>V.id===Number(J.id)),q=e.findIndex(V=>V.id===Number(ce.id));K<0||q<0||b==null||b(_p(e,K,q).map(V=>V.id))},[M,P]=y.useState(null),H=y.useRef(null);y.useEffect(()=>{if(!M)return;const F=J=>{var ce;(ce=H.current)!=null&&ce.contains(J.target)||P(null)};return window.addEventListener("pointerdown",F,!0),window.addEventListener("contextmenu",F,!0),window.addEventListener("scroll",F,{capture:!0,passive:!0}),window.addEventListener("keydown",F),()=>{window.removeEventListener("pointerdown",F,!0),window.removeEventListener("contextmenu",F,!0),window.removeEventListener("scroll",F,!0),window.removeEventListener("keydown",F)}},[M]);const E=y.useRef(!1),j=y.useRef(null),B=()=>{j.current&&(window.clearTimeout(j.current.timer),j.current=null)},O=F=>J=>{if(E.current=!1,R||J.button!==0)return;const{clientX:ce,clientY:K}=J,q=window.setTimeout(()=>{j.current=null,E.current=!0,P({x:ce,y:K,project:F})},O4);j.current={x:ce,y:K,timer:q}},Q=F=>{const J=j.current;J&&(Math.abs(F.clientX-J.x)>Tk||Math.abs(F.clientY-J.y)>Tk)&&B()};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:_("project.globalConfig")}),o.jsx("div",{className:"px-2",children:o.jsxs("button",{onClick:i,className:ye("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(Qs,{className:ye("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:_("project.globalConfig")}),o.jsx("span",{className:"block text-[11px] text-neutral-500",children:_("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:_("project.sectionHeader")}),v.length>0&&o.jsxs("button",{type:"button","aria-label":_("project.archivedCount",{n:v.length}),title:_("project.archivedCount",{n:v.length}),onClick:()=>G(!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($u,{className:"h-3 w-3"}),v.length]})]}),e.length===0&&o.jsx("p",{className:"p-3 text-xs text-neutral-500",children:_("project.noneRegistered")}),o.jsx("ul",{className:"p-2 space-y-1",children:o.jsx(cx,{sensors:U,onDragEnd:A,children:o.jsx(qC,{items:e.map(F=>F.id),strategy:fI,children:e.map(F=>{const J=c==null?void 0:c(F.id),ce=u==null?void 0:u(F.id),K=(w==null?void 0:w(F.id))??[],q=(m==null?void 0:m(F.id))??0;return o.jsx(D4,{id:F.id,children:({setNodeRef:V,style:ue,attributes:me,listeners:Ne,isDragging:Te})=>{var ne;return o.jsxs("li",{ref:V,style:ue,className:ye("group relative rounded-xl border transition-colors duration-200",!n&&t===F.id?"border-white/[0.14] bg-neutral-800/60":"border-white/[0.06] bg-neutral-900/50 hover:border-white/[0.10]",Te&&"z-10 opacity-80"),onMouseEnter:()=>l==null?void 0:l(F.id),children:[o.jsxs("div",{className:"flex items-start",children:[o.jsx("span",{...me,...Ne,title:_("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(SC,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{onClick:()=>{if(E.current){E.current=!1;return}r(F)},onPointerDown:O(F),onPointerMove:Q,onPointerUp:B,onPointerCancel:B,onContextMenu:pe=>{pe.preventDefault(),pe.stopPropagation(),R&&P({x:pe.clientX,y:pe.clientY,project:F})},className:ye("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-white/[0.04]"),children:[o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm",title:F.name,children:F.name}),o.jsx("span",{className:"block truncate text-[11px] text-neutral-500",title:F.path,children:F.path}),(((ne=F.harnesses)==null?void 0:ne.length)??0)>0&&o.jsx("span",{className:"mt-1 flex flex-wrap items-center gap-1",title:_("project.harnessesTip"),children:F.harnesses.map(pe=>o.jsx($r,{agent:pe.id},pe.id))})]}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5 mt-1.5",children:[o.jsx(L4,{counts:K}),o.jsx(P4,{projectId:F.id})]})]})]}),o.jsxs("div",{className:"flex items-center gap-1 px-2 pb-1 pl-9",children:[o.jsx(Vu,{title:`${_(J?"app.autoSyncOnTooltip":"app.autoSyncOffTooltip")}
455
-
456
- ${_("app.scopeCoverageTooltip")}`,pressed:J,onClick:()=>d==null?void 0:d(F),children:o.jsx(ut,{state:(p==null?void 0:p(F.id))??"idle",className:"h-3.5 w-3.5",icon:J?o.jsx(HD,{className:"h-3.5 w-3.5 text-emerald-400"}):o.jsx(BD,{className:"h-3.5 w-3.5 text-neutral-400"})})}),o.jsxs("span",{className:"relative",children:[o.jsx(Vu,{title:`${ce?_("project.syncPending",{n:ce}):_("project.syncNow")}
457
-
458
- ${_("app.scopeCoverageTooltip")}`,onClick:()=>f==null?void 0:f(F),children:o.jsx(ut,{state:(h==null?void 0:h(F.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(Il,{className:ye("h-3.5 w-3.5",ce?"text-orange-300":"text-neutral-400")})})}),!!ce&&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(Vu,{title:_("project.openInExplorer"),onClick:()=>s(F),children:o.jsx(ut,{state:(g==null?void 0:g(F.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(kC,{className:"h-3.5 w-3.5"})})}),o.jsxs("span",{className:"relative",children:[o.jsx(Vu,{title:q>0?`${_("project.terminalsOpen",{n:q})}
459
-
460
- ${_("project.openInTerminal")}`:_("project.openInTerminal"),onClick:()=>a(F),children:o.jsx(ut,{state:(k==null?void 0:k(F.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(px,{className:ye("h-3.5 w-3.5",q>0&&"text-emerald-400")})})}),q>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:q})]})]})]})}},F.id)})})})}),$&&ln.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:()=>G(!1)}),o.jsxs("div",{className:"relative w-[680px] max-w-full rounded-2xl border border-white/[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-white/[0.06] frosted",children:[o.jsx($u,{className:"h-4 w-4 text-neutral-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:_("project.archivedSection")}),o.jsx("span",{className:"text-xs text-neutral-500",children:v.length}),o.jsx("button",{onClick:()=>G(!1),className:"ml-auto p-1 rounded text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",title:_("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:v.map(F=>o.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-white/[0.06] bg-neutral-900/50 p-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx($u,{className:"h-4 w-4 shrink-0 text-neutral-600"}),o.jsx("span",{className:"truncate text-sm text-neutral-200",title:F.name,children:F.name})]}),o.jsx("p",{className:"text-[11px] text-neutral-500 truncate",title:F.path,children:F.path}),F.archivedAt&&o.jsx("p",{className:"text-[11px] text-neutral-600",children:_("project.archivedOn",{date:new Date(F.archivedAt).toLocaleString()})}),o.jsxs("button",{type:"button",onClick:()=>T==null?void 0:T(F),title:_("project.restoreTooltip"),className:"mt-auto inline-flex items-center justify-center gap-1.5 rounded-lg border border-white/[0.08] bg-white/[0.03] px-2.5 py-1.5 text-xs text-neutral-300 transition-colors hover:border-white/[0.16] hover:bg-white/[0.08] hover:text-neutral-100",children:[o.jsx(ut,{state:(N==null?void 0:N(F.id))??"idle",className:"h-3.5 w-3.5",icon:o.jsx(hD,{className:"h-3.5 w-3.5"})}),_("project.restore")]})]},F.id))})})]})]}),document.body),o.jsx(so,{open:I!==null,title:_("project.archive"),message:I?_("project.archiveConfirm",{name:I.name}):"",confirmLabel:_("common.confirm"),onConfirm:()=>{I&&(S==null||S(I))},onClose:()=>D(null)}),M&&ln.createPortal(o.jsxs("div",{ref:H,style:{left:Math.min(M.x,window.innerWidth-200),top:Math.min(M.y,window.innerHeight-88)},className:"fixed z-50 w-48 rounded-lg border border-white/[0.08] bg-neutral-900 shadow-mac py-1",onContextMenu:F=>F.preventDefault(),children:[o.jsx("p",{className:"px-3 pb-1 pt-0.5 text-[10px] text-neutral-500 truncate",title:M.project.path,children:M.project.name}),o.jsx(I4,{icon:o.jsx($u,{className:"h-3.5 w-3.5"}),label:_("project.archive"),onClick:()=>{D(M.project),P(null)}})]}),document.body)]})}function D4({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:i,transform:s,transition:a,isDragging:l}=VC({id:e}),c={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:a??void 0,position:"relative"};return t({setNodeRef:i,style:c,attributes:n,listeners:r,isDragging:l})}function I4({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-white/[0.06]",children:[o.jsx("span",{className:"text-neutral-400",children:e}),t]})}function Vu({title:e,pressed:t,onClick:n,children:r}){return o.jsx("button",{type:"button",title:e,"aria-label":e,"aria-pressed":t,onClick:i=>{i.stopPropagation(),n()},className:"pointer-events-auto [&_svg]:pointer-events-none inline-flex h-5 w-5 items-center justify-center rounded border border-white/[0.08] bg-white/[0.02] text-neutral-400 transition-colors hover:border-white/[0.16] hover:bg-white/[0.08] hover:text-neutral-100",children:r})}function L4({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(fa,{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(fa,{harness:n.harness}),o.jsx("span",{className:"text-[10px] font-medium text-neutral-400",children:n.open})]})]},n.harness??"unknown"))})}const z4={"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 P4({projectId:e}){const t=We(),[n,r]=y.useState(null);if(y.useEffect(()=>{let s=!0;return Se.getHarnessChecks(e).then(a=>{s&&r(a.checks.filter(l=>!l.ok))}).catch(()=>{}),()=>{s=!1}},[e]),n===null)return null;if(n.length===0)return o.jsx("span",{title:t("health.okTip"),className:"h-2 w-2 shrink-0 rounded-full bg-emerald-500"});const i=[t("health.badgeTip",{count:n.length}),...n.flatMap(s=>{const a=z4[s.id];return a?[t(a,s.params)]:[]})].join(`
461
- `);return o.jsx("span",{title:i,className:"shrink-0",children:o.jsx(hx,{className:"h-3.5 w-3.5 text-amber-400"})})}const du={claude:{open:"UserPromptSubmit",close:["Stop"],sessionMarkers:["SessionStart","SessionEnd"],subagentStop:"SubagentStop",questionTools:["AskUserQuestion","ExitPlanMode"]},codex:{open:"",close:[],sessionMarkers:[],subagentStop:"",questionTools:[]}},vx={claude:{start:"PreCompact",end:"SessionStart",endSource:"compact"},codex:{start:null,end:null,endSource:null}};function kx(e,t,n){if(e==null)return!1;const r=vx[e];return!(r!=null&&r.end)||!r.endSource?!1:t===r.end&&n===r.endSource}const U4=3e4,B4=5*6e4,H4=10*6e4,F4=10*6e4;function $4(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,r=Date.parse(e.lastSeenAt),i=Math.max(Number.isNaN(n)?0:n,Number.isNaN(r)?0:r),s=i>0?t-i:Number.POSITIVE_INFINITY;if(e.interruptedAt!=null&&e.interruptedAt>i)return"interrupted";const a=e.harness!=null?(l=vx[e.harness])==null?void 0:l.start:null;return a!=null&&e.latestEventType===a&&s<H4?"compacting":e.turnOpen===!0&&s<B4?"running":e.turnOpen===!1?"open":s<U4?"running":"open"}function xl(e){return e==="running"||e==="compacting"}function aT(e){var t;return e==null?!1:!!((t=du[e])!=null&&t.open)}function lT(e,t){return e==="closed"||e==="terminated"||e==="failed"||e==="interrupted"?!1:t===!0?!0:t===!1?!1:xl(e)}const oT={running:"tasks.statusRunning",compacting:"tasks.statusCompacting",failed:"tasks.statusFailed",open:"tasks.statusOpen",closed:"tasks.statusClosed",terminated:"tasks.statusTerminated",interrupted:"tasks.statusInterrupted"},G4={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"},cT={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 K4(e,t){const n=new Map;for(const i of e){const s=t.get(i.sessionId)??"open";if(s!=="running"&&s!=="compacting"&&s!=="open"&&s!=="interrupted")continue;const a=i.harness!=null&&qt.includes(i.harness)?i.harness:null;let l=n.get(a);l||(l={harness:a,running:0,open:0},n.set(a,l)),s==="open"||s==="interrupted"?l.open+=1:l.running+=1}const r=i=>i===null?qt.length:qt.indexOf(i);return[...n.values()].sort((i,s)=>r(i.harness)-r(s.harness))}const uT=y.createContext(null);function q4({children:e}){const t=DC(),[n,r]=y.useState(null),[i,s]=y.useState([]),[a,l]=y.useState(null),[c,u]=y.useState(new Map),[d,f]=y.useState(new Map),[p,h]=y.useState(new Map),[g,k]=y.useState(new Map),w=y.useCallback(async()=>{const[T,N,_]=await Promise.allSettled([Se.listSessions(),Se.listHookDispatches({limit:200}),Se.listQuestions()]);if(N.status==="fulfilled"&&s(N.value),_.status==="fulfilled"&&k(new Map(_.value.map(L=>[L.sessionId,L]))),T.status==="fulfilled")return r(T.value),l(null),null;const R=T.reason instanceof Error?T.reason.message:String(T.reason);return l(R),R},[]);y.useEffect(()=>{t==="authenticated"&&w()},[t,w]),y.useEffect(()=>sl(T=>{if(T.type!=="push"||T.key!=="inflightCounts")return;const N=T.payload.counts??{};h(new Map(Object.entries(N)))}),[]),y.useEffect(()=>sl(T=>{if(T.type!=="push"||T.key!=="sessionLiveness")return;const N=T.payload.alive??{};r(_=>{if(!_)return _;let R=!1;const L=_.map(C=>{const U=N[C.sessionId];return U===void 0||C.pidAlive===U?C:(R=!0,{...C,pidAlive:U})});return R?L:_})}),[]),y.useEffect(()=>sl(T=>{if(T.type!=="push"||T.key!=="sessionInterrupt")return;const N=T.payload.interrupted??{};r(_=>{if(!_)return _;let R=!1;const L=_.map(C=>{const U=N[C.sessionId]??null;return(C.interruptedAt??null)===U?C:(R=!0,{...C,interruptedAt:U})});return R?L:_})}),[]),y.useEffect(()=>sl(T=>{if(T.type!=="push"||T.key!=="terminalTopology")return;const N=T.payload.terminals??{};r(_=>{if(!_)return _;let R=!1;const L=_.map(C=>{var $;const U=N[C.sessionId];return U===void 0||(($=C.terminal)==null?void 0:$.id)===(U==null?void 0:U.id)?C:(R=!0,{...C,terminal:U})});return R?L:_})}),[]),y.useEffect(()=>{let T=null;const N=()=>{T!==null&&window.clearTimeout(T),T=window.setTimeout(()=>{T=null,w().then(()=>{u(new Map)})},500)},_=R=>{const L=R.detail??{};switch(L.kind){case"event.ingested":{if(!L.sessionId)break;const C=L.sessionId;if(L.backgroundTasks){const U=L.agentId,$=Date.now(),G=new Map;for(const I of L.backgroundTasks)I.status==="running"&&I.id!==U&&G.set(I.id,$);f(I=>{const D=new Map(I);return G.size?D.set(C,G):D.delete(C),D})}else if(L.eventType==="SubagentStop"&&L.agentId){const U=L.agentId;f($=>{const G=$.get(C);if(!(G!=null&&G.has(U)))return $;const I=new Map(G);I.delete(U);const D=new Map($);return I.size?D.set(C,I):D.delete(C),D})}else if(L.spawnAgentId||L.agentId){const U=L.spawnAgentId??L.agentId;f($=>{const G=new Map($),I=new Map(G.get(C)??[]);return I.set(U,Date.now()),G.set(C,I),G})}break}case"dispatch.started":{L.sessionId&&u(C=>new Map(C).set(L.sessionId,"running"));break}case"dispatch.finished":{if(!L.sessionId)break;u(C=>{const U=new Map(C);return L.status==="failed"||L.status==="timeout"?U.set(L.sessionId,"failed"):U.delete(L.sessionId),U});break}}N()};return window.addEventListener("weave:hook",_),()=>{window.removeEventListener("weave:hook",_),T!==null&&window.clearTimeout(T)}},[w]);const m=y.useMemo(()=>{const T=new Map;for(const N of i){if(!N.sessionId)continue;const _=T.get(N.sessionId)??[];_.push(N),T.set(N.sessionId,_)}return T},[i]),b=y.useMemo(()=>{const T=Date.now(),N=new Map;for(const _ of n??[]){const R=m.get(_.sessionId)??[],L=R[0],C=d.get(_.sessionId);let U=!1;if(C){for(const $ of C.values())if(T-$<F4){U=!0;break}}N.set(_.sessionId,$4({lastSeenAt:_.lastSeenAt,latestEventType:_.lastEventType??void 0,pidAlive:_.pidAlive??void 0,hasRunningDispatch:R.some($=>$.status==="running"),hasRunningSubagent:U,latestDispatchFailed:L!==void 0&&(L.status==="failed"||L.status==="timeout"),overlay:c.get(_.sessionId),turnOpen:_.turnOpen,interruptedAt:_.interruptedAt??void 0,harness:_.harness,now:T}))}return N},[n,m,d,c]),v=y.useMemo(()=>{const T=new Map;for(const _ of n??[]){if(_.projectId==null)continue;const R=T.get(_.projectId)??[];R.push(_),T.set(_.projectId,R)}const N=new Map;for(const[_,R]of T)N.set(_,K4(R,b));return N},[n,b]),S=y.useMemo(()=>({sessions:n,dispatches:i,statuses:b,projectStats:v,error:a,inflight:p,questions:g,refresh:w}),[n,i,b,v,a,p,g,w]);return o.jsx(uT.Provider,{value:S,children:e})}function fu(){const e=y.useContext(uT);if(!e)throw new Error("useSessionStatus must be used within SessionStatusProvider");return e}const Y4=[{key:"tasks",labelKey:"catbar.tasks",icon:RD},{key:"orchestrate",labelKey:"catbar.orchestrate",icon:l0},{key:"files",labelKey:"catbar.files",icon:px},{key:"personalization",labelKey:"catbar.personalization",icon:MC},{key:"weave",labelKey:"catbar.hooks",icon:jC}];function V4({category:e,onSelect:t,data:n}){const r=We(),i=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}},s=a=>{switch(a){case"files":return n.outdated>0?o.jsx(Ye,{variant:"warning",children:r("catbar.updateBadge",{n:n.outdated})}):null;case"personalization":return n.statuslineSource?o.jsx(Ye,{variant:n.statuslineSource==="custom"?"skill":"default",children:n.statuslineSource==="custom"?r("catbar.custom"):r("catbar.followGlobal")}):null;default:return null}};return o.jsx("div",{className:"flex flex-wrap gap-2 p-2 border-b border-white/[0.06] overflow-x-auto",children:Y4.map(({key:a,labelKey:l,icon:c})=>{const u=e===a;return o.jsxs("button",{onClick:()=>t(a),className:ye("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-white/[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:ye("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:r(l)}),o.jsx("span",{className:"block truncate text-[11px] text-neutral-500",children:r("catbar.items",{n:i(a)})})]}),o.jsx("span",{className:"flex flex-wrap items-center gap-1",children:s(a)})]},a)})})}const Ns=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ye("rounded-xl border border-white/[0.08] bg-gradient-to-b from-neutral-800/70 to-neutral-900/70 shadow-mac-sm backdrop-blur-sm",e),...t}));Ns.displayName="Card";const pa=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ye("flex p-3 border-b border-white/[0.06]",e),...t}));pa.displayName="CardHeader";const ha=y.forwardRef(({className:e,...t},n)=>o.jsx("h3",{ref:n,className:ye("text-sm font-semibold tracking-tight",e),...t}));ha.displayName="CardTitle";const ma=y.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ye("p-3",e),...t}));ma.displayName="CardContent";function Tc(e){let t=0,n=0;for(const r of e)n+=r.skills.length,r.enabled!==!1&&(t+=r.skills.length);return{effective:t,total:n}}function Ac(e,t){return t===0?"none":e===t?"ok":"partial"}const X4={ok:"bg-emerald-900/40 text-emerald-300",partial:"bg-amber-900/30 text-amber-300",none:"bg-neutral-800 text-neutral-500"};function Mc({tone:e,title:t,children:n}){return o.jsx("span",{className:ye("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium tabular-nums",X4[e]),title:t,children:n})}const dT="__local__";function fT(e){const t=new Map;for(const r of e){const i=r.namespace??dT,s=t.get(i)??{key:i,...r.namespace!==void 0?{namespace:r.namespace}:{},groups:[]};s.groups.push(r),t.set(i,s)}const n=r=>r.namespace===void 0?1:r.groups.some(i=>i.provenance==="builtin")?0:2;return[...t.values()].sort((r,i)=>n(r)-n(i)||(r.namespace??"").localeCompare(i.namespace??""))}function Js(e,t){const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function W4(e,t){return[...e,t]}function Z4(e,t){return e.filter(n=>n.id!==t)}const Q4={success:3e3,info:4e3,error:8e3},J4=2e3;function eL(e,t){return t==="start"?"loading":e!=="loading"?e:t==="ok"?"success":"idle"}function tL(e){return e!=="loading"}const Ak={success:{box:"border-emerald-500/30 bg-emerald-950/80 text-emerald-100",icon:o.jsx(yD,{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(vD,{className:"mt-px h-3.5 w-3.5 shrink-0 text-red-400"})},info:{box:"border-white/[0.08] bg-neutral-900/90 text-neutral-200",icon:o.jsx(jD,{className:"mt-px h-3.5 w-3.5 shrink-0 text-neutral-400"})}},pT=y.createContext(null);function nL({children:e}){const[t,n]=y.useState([]),r=y.useRef(1),i=y.useCallback(l=>{n(c=>Z4(c,l))},[]),s=y.useCallback((l,c)=>{const u=r.current++;n(d=>W4(d,{id:u,kind:l,message:c})),setTimeout(()=>i(u),Q4[l])},[i]),a=y.useMemo(()=>({show:s}),[s]);return o.jsxs(pT.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 ${Ak[l.kind].box}`,children:[Ak[l.kind].icon,o.jsx("span",{className:"min-w-0 flex-1 break-words",children:l.message}),o.jsx("button",{type:"button",onClick:()=>i(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 Zt(){const e=y.useContext(pT);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function cn(){const[e,t]=y.useState({}),n=y.useRef({}),{show:r}=Zt(),i=y.useRef({}),s=y.useCallback((c,u)=>{i.current={...i.current,[c]:eL(i.current[c]??"idle",u)},t(i.current)},[]);y.useEffect(()=>()=>{for(const c of Object.values(n.current))clearTimeout(c)},[]);const a=y.useCallback(async(c,u,d)=>{if(tL(i.current[c]??"idle")){s(c,"start");try{await u(),s(c,"ok"),clearTimeout(n.current[c]),n.current[c]=setTimeout(()=>{i.current={...i.current,[c]:"idle"},t(i.current)},J4)}catch(f){s(c,"fail"),r("error",d.fail(f))}}},[s,r]);return{stateOf:y.useCallback(c=>e[c]??"idle",[e]),run:a}}function Xe(e){return e instanceof Error?e.message:String(e)}function rL(e){return e.endsWith("-plugin")?uu(e):null}const iL={inherit:"on",on:"off",off:"inherit"},Mk={inherit:"skillGrid.enableDefault",on:"skillGrid.enableOn",off:"skillGrid.enableOff"},jk={user:"skillGrid.scopeUser",project:"skillGrid.scopeProject",local:"skillGrid.scopeLocal"},sL=e=>e.installScopes.length>0?iL[e.enable]:e.enable==="on"?"off":"on";function wx({row:e,update:t,canUninstall:n,readOnly:r,onUninstallSkill:i,onOpenDetail:s}){var w;const a=We(),{show:l}=Zt(),c=cn(),u=`skill-uninstall:${e.scope}:${e.agent??"claude"}:${e.name}`,d=c.stateOf(u),[f,p]=y.useState(!1),h=()=>void c.run(u,async()=>{await i(e.name,e.scope,e.agent),l("success",a("skillGrid.uninstalled",{name:e.name}))},{fail:m=>a("errors.uninstallFailed",{error:Xe(m)})}),g=((w=e.source)==null?void 0:w.endsWith("-personal"))??!1,k=e.scope==="user"&&g&&e.form!==void 0;return o.jsxs(Ns,{children:[o.jsxs(pa,{className:"items-center gap-2",children:[o.jsxs("button",{onClick:()=>s(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(Es,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx(ha,{className:"truncate",children:e.name}),o.jsx($r,{agent:e.agent,className:"ml-1"}),r?o.jsx(Ye,{variant:"settings",className:"ml-1",children:a("skillGrid.globalTag")}):e.scope==="project"&&o.jsx(Ye,{variant:"settings",className:"ml-1",children:a("library.scopeProject")}),e.files.length>0&&o.jsx(Ye,{variant:"skill",className:"ml-1",children:e.files.length}),(t==null?void 0:t.outdated)&&o.jsx(Ye,{variant:"warning",className:"ml-1",children:a("skillGrid.update")}),(t==null?void 0:t.custom)&&o.jsx(Ye,{variant:"other",className:"ml-1",children:a("skillGrid.custom")}),k&&o.jsx("span",{className:ye("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&&!r&&o.jsx("button",{type:"button",disabled:d==="loading",onClick:()=>e.scope==="user"?p(!0):h(),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(Fr,{className:"h-3.5 w-3.5"})})})]}),e.scope==="user"&&o.jsx(so,{open:f,title:a("skillGrid.uninstallGlobalTitle"),message:a("skillGrid.uninstallGlobalConfirm",{name:e.name}),confirmLabel:a("common.confirm"),onConfirm:h,onClose:()=>p(!1)})]})}function aL({skills:e,groups:t,globalGroupsReadOnly:n,updates:r,empty:i,onUninstallSkill:s,onOpenDetail:a,onCyclePluginState:l,onUninstallPlugin:c}){const u=We(),d=h=>r==null?void 0:r.find(g=>g.name===h);if(t!==void 0&&t.length>0)return o.jsx(Ok,{groups:t,updates:r,onUninstallSkill:s,onOpenDetail:a,onCyclePluginState:l,onUninstallPlugin:c});const f=!!e&&e.length>0,p=!!n&&n.length>0;return!f&&!p?o.jsx("p",{className:"text-xs text-neutral-600 border border-dashed border-white/[0.06] rounded-md p-3",children:i}):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(h=>o.jsx(wx,{row:h,update:d(h.name),canUninstall:h.scope==="project",onUninstallSkill:s,onOpenDetail:a},`${h.scope}-${h.name}`))})]}),p&&o.jsx(Ok,{groups:n,updates:r,onUninstallSkill:s,onOpenDetail:a,onCyclePluginState:l,readOnly:!0})]})}function h0({effective:e,total:t}){const n=We(),r=t===0?n("skillGrid.effNone"):e===t?n("skillGrid.effAll",{n:t}):n("skillGrid.effDisabled",{n:t-e});return o.jsxs(Mc,{tone:Ac(e,t),title:r,children:[o.jsx(cu,{className:"h-3 w-3"}),n("skillGrid.effective",{done:e,total:t})]})}function lL({group:e,collapsed:t,onToggle:n,findUpdate:r,onUninstallSkill:i,onOpenDetail:s,onCyclePluginState:a,onUninstallPlugin:l,readOnly:c}){var N;const u=We(),d=cn(),{show:f}=Zt(),[p,h]=y.useState(!1),g=e.source.endsWith("-plugin"),k=rL(e.source),w=Tc([e]),m=g&&!!e.installSurface&&!!l&&!c&&!!e.pluginKey,b=g&&!!k&&!!a&&(((N=e.scopeStates)==null?void 0:N.length)??0)>0,v=`pack-uninstall:${e.pluginKey??"-"}`,S=d.stateOf(v),T=()=>{!e.pluginKey||!l||d.run(v,async()=>{await l(k,e.pluginKey),f("success",u("skillGrid.packUninstalled",{label:e.label}))},{fail:_=>u("errors.uninstallFailed",{error:Xe(_)})})};return o.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-neutral-900/40 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),n())},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-white/[0.02] cursor-pointer",children:[t?o.jsx(Un,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Pn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(wC,{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(Ye,{variant:g?"mcp":"skill",className:"ml-1",children:u(g?"skillGrid.plugin":"repo.local")}),o.jsx($r,{agent:uu(e.source)??void 0}),o.jsx(h0,{effective:w.effective,total:w.total}),b&&o.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1",children:e.scopeStates.map(_=>{const R=`plugin-state:${k}:${e.pluginKey}:${_.scope}`;return o.jsxs("button",{type:"button",disabled:d.stateOf(R)==="loading",onClick:L=>{L.stopPropagation(),d.run(R,async()=>{await a(k,e.pluginKey,_.scope,sL(_))},{fail:C=>u("errors.pluginToggleFailed",{error:Xe(C)})})},title:u("skillGrid.enableTip",{scope:u(jk[_.scope]),state:u(Mk[_.enable])}),className:ye("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",_.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(cu,{className:"h-3 w-3"})}),u(jk[_.scope]),"·",u(Mk[_.enable])]},_.scope)})}),m&&o.jsx("button",{type:"button",disabled:S==="loading",onClick:_=>{_.stopPropagation(),h(!0)},className:ye("shrink-0 text-neutral-500 hover:text-red-400 disabled:cursor-not-allowed [&_svg]:pointer-events-none",!b&&"ml-auto"),title:u("skillGrid.uninstallPackTitle"),children:o.jsx(ut,{state:S,className:"h-3.5 w-3.5",icon:o.jsx(Fr,{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(_=>o.jsx(wx,{row:_,update:r(_.name),canUninstall:!1,readOnly:c,onUninstallSkill:i,onOpenDetail:s},`${_.scope}-${_.agent??"claude"}-${_.name}`))})}),o.jsx(so,{open:p,title:u("skillGrid.uninstallPackTitle"),message:u("skillGrid.uninstallPackConfirm",{key:e.pluginKey??""}),confirmLabel:u("common.confirm"),onConfirm:T,onClose:()=>h(!1)})]})}function Ok({groups:e,updates:t,onUninstallSkill:n,onOpenDetail:r,onCyclePluginState:i,onUninstallPlugin:s,readOnly:a}){const l=We(),c=v=>t==null?void 0:t.find(S=>S.name===v),u=y.useMemo(()=>fT(e),[e]),d=y.useMemo(()=>e.map(v=>`${v.source}:${v.pluginKey??"-"}`),[e]),[f,p]=y.useState(new Set([dT])),[h,g]=y.useState(new Set),k=f.size>0||h.size>0,w=()=>{k?(p(new Set),g(new Set)):(p(new Set(u.map(v=>v.key))),g(new Set(d)))},{effective:m,total:b}=Tc(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(h0,{effective:m,total:b}),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(au,{className:"h-3 w-3"}):o.jsx(lu,{className:"h-3 w-3"}),l(k?"skillGrid.collapseAll":"skillGrid.expandAll")]})]})]}),o.jsx("div",{className:"space-y-3",children:u.map(v=>{const S=v.namespace,T=S===void 0,N=!f.has(v.key),_=Tc(v.groups),R=v.groups.reduce((L,C)=>L+C.skills.length,0);return o.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-neutral-900/60 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>p(L=>Js(L,v.key)),onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),p(C=>Js(C,v.key)))},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-white/[0.03] cursor-pointer",children:[N?o.jsx(Un,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Pn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(Ec,{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:T?l("repo.local"):S}),!T&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",title:l("repo.namespaceTip"),children:l("repo.packCount",{n:v.groups.length})}),T&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",title:l("repo.formTip"),children:l("repo.formLegend")}),o.jsx(Ye,{variant:"skill",className:"ml-1",children:R}),o.jsx(h0,{effective:_.effective,total:_.total})]}),!N&&(T?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:v.groups.flatMap(L=>L.skills).map(L=>o.jsx(wx,{row:L,update:c(L.name),canUninstall:!a,readOnly:a,onUninstallSkill:n,onOpenDetail:r},`${L.scope}-${L.agent??"claude"}-${L.name}`))})}):o.jsx("div",{className:"px-3 pb-3 pt-1 space-y-2",children:v.groups.map(L=>{const C=`${L.source}:${L.pluginKey??"-"}`;return o.jsx(lL,{group:L,collapsed:!h.has(C),onToggle:()=>g(U=>Js(U,C)),findUpdate:c,onUninstallSkill:n,onOpenDetail:r,onCyclePluginState:i,onUninstallPlugin:s,readOnly:a},C)})}))]},v.key)})})]})}function oL(e){const t=new Map;for(const n of e){const r=n.relPath.match(/^[^/]+\/skills\/([^/]+)\//);if(!r)continue;const i=r[1],s=`${n.agent??""}\0${i}`,a=t.get(s)??{name:i,agent:n.agent,files:[]};a.files.push(n),t.set(s,a)}return[...t.values()].map(({name:n,agent:r,files:i})=>({name:n,scope:"project",agent:r,files:i})).sort((n,r)=>n.name.localeCompare(r.name))}const cL={inherit:"on",on:"off",off:"inherit"},Rk={inherit:"mcp.enableDefault",on:"mcp.enableOn",off:"mcp.enableOff"},uL=e=>e.scope==="user"?"user":"project";function dL({rows:e,scope:t,updates:n,empty:r,onUninstallMcp:i,onCycleMcpEnable:s}){const a=We(),{show:l}=Zt(),c=cn(),u=f=>{const p=`mcp-enable:${f.key}`;c.stateOf(p)!=="loading"&&c.run(p,async()=>s(f.key,cL[f.enable??"inherit"]),{fail:h=>a("mcp.enableFailed",{error:Xe(h)})})};if(e.length===0)return o.jsx("p",{className:"text-xs text-neutral-600 border border-dashed border-white/[0.06] rounded-md p-3",children:r});const d=(f,p)=>!!(n!=null&&n.find(h=>h.name===f&&h.outdated&&(h.agent??"claude")===(p??"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 p=d(f.key,f.harness),h=f.enable!==null,g=f.enable??"inherit",k=`mcp-enable:${f.key}`,w=c.stateOf(k),m=`mcp-uninstall:${f.harness}:${f.scope}:${f.key}`,b=c.stateOf(m);return o.jsxs(Ns,{children:[o.jsxs(pa,{className:"items-center gap-2",children:[o.jsx(Sp,{className:"h-3.5 w-3.5 shrink-0 text-pink-400"}),o.jsx(ha,{className:"truncate",children:f.key}),o.jsx($r,{agent:f.harness}),o.jsx(Ye,{variant:"settings",className:"ml-1",children:a(f.harness==="codex"||f.scope==="user"?"library.scopeGlobal":"library.scopeProject")}),p&&o.jsx(Ye,{variant:"warning",className:"ml-1",children:a("mcp.update")}),o.jsxs("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",children:[h&&o.jsxs("button",{type:"button",disabled:w==="loading",onClick:()=>u(f),title:a("mcp.enableTip",{state:a(Rk[g])}),className:ye("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",g==="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(cu,{className:"h-3 w-3"})}),a(Rk[g])]}),o.jsx("button",{type:"button",disabled:b==="loading",onClick:()=>void c.run(m,async()=>{await i(f.key,uL(f),f.harness),l("success",a("mcp.uninstalled",{name:f.key}))},{fail:v=>a("errors.mcpUninstallFailed",{error:Xe(v)})}),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:b,className:"h-3.5 w-3.5",icon:o.jsx(Fr,{className:"h-3.5 w-3.5"})})})]})]}),o.jsxs(ma,{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 m0=["skill","mcp","hooks","workflow","rules","command","agent","output-style","instructions","settings","plugin","mods","other"];function g0(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 Dk={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"}},Sx=e=>Dk[e]??Dk.other,b0="shrink-0 rounded-full border border-transparent bg-neutral-800/60 px-1.5 py-0 text-[10px] font-medium font-sans",fL="border-neutral-700 bg-transparent text-neutral-400",pL="text-blue-200",hL="text-neutral-400 hover:text-neutral-300",mL="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",gL="bg-neutral-700 ring-1 ring-blue-500/50 hover:bg-neutral-700";function Of(e){const t=e.lastIndexOf("/");return t<0?e:e.slice(t+1)}function Ik(e){return Of(e).replace(/\.(md|js)$/u,"")}function bL(e){const t={children:[],fileCount:0};for(const r of e){const i=r.relPath.split("/");let s=t,a="";for(let l=0;l<i.length;l++){const c=i[l];if(a=a?`${a}/${c}`:c,l===i.length-1)s.children.push({type:"file",asset:r});else{let u=s.children.find(d=>d.type==="dir"&&d.name===c);u||(u={type:"dir",name:c,path:a,children:[],fileCount:0},s.children.push(u)),s=u}}}const n=r=>{r.children.sort((i,s)=>{const a=i.type==="dir",l=s.type==="dir";if(a!==l)return a?-1:1;const c=i.type==="file"?Of(i.asset.relPath):i.name,u=s.type==="file"?Of(s.asset.relPath):s.name;return c.localeCompare(u)}),r.children.forEach(i=>{i.type==="dir"&&n(i)}),r.fileCount=r.children.reduce((i,s)=>i+(s.type==="file"?1:s.fileCount),0)};return n(t),t.children}function Lk({kind:e,active:t,onClick:n,children:r}){const i=e?Sx(e):{on:pL,off:hL};return o.jsx("button",{type:"button",onClick:n,"aria-pressed":t,className:ye(mL,t&&gL,t?i.on:i.off),children:r})}function hT({node:e,depth:t,scope:n,capabilities:r,updateMap:i,collapsed:s,onToggle:a,onOpenFile:l,onUninstall:c}){const u=We(),{show:d}=Zt(),f=cn(),p=8+t*14;if(e.type==="file"){const g=e.asset,k=Of(g.relPath),w=g.relPath.toLowerCase().endsWith(".md"),m=i==null?void 0:i.get(`${Ik(g.relPath)}::${g.category}`),b=JD(g.category,g.agent??"claude",n,r),v=g0(g.category,g.relPath),S={name:Ik(g.relPath),category:g.category,relPath:g.relPath,...g.agent?{agent:g.agent}:{}},T=`uninstall:${g.relPath}`,N=f.stateOf(T);return o.jsxs("div",{className:"group/row relative",children:[o.jsxs("button",{type:"button",onClick:()=>l(g.relPath),style:{paddingLeft:p,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:g.isSymlink?u("fileTree.symlinkTitle",{path:g.absPath}):g.absPath,children:[g.isSymlink?o.jsx(ND,{className:"h-3 w-3 shrink-0 text-amber-400"}):w?o.jsx(ou,{className:"h-3 w-3 shrink-0 text-blue-400"}):o.jsx(Es,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:k}),o.jsx($r,{agent:g.agent,className:"shrink-0 px-1.5 py-0 text-[10px] font-sans"}),v.map(_=>o.jsx("span",{className:ye(b0,Sx(_).on),children:_},_)),g.namespace&&o.jsx("span",{className:ye(b0,fL),title:u("repo.namespaceTip"),children:g.namespace}),(m==null?void 0:m.outdated)&&o.jsx(Ye,{variant:"warning",className:"shrink-0 px-1.5 py-0 text-[10px] font-sans",children:u("fileTree.update")}),(m==null?void 0:m.custom)&&o.jsx(Ye,{variant:"other",className:"shrink-0 px-1.5 py-0 text-[10px] font-sans",children:u("fileTree.custom")})]}),b&&c&&o.jsx("button",{type:"button",disabled:N==="loading",onClick:()=>void f.run(T,async()=>{await(c==null?void 0:c(S)),d("success",u("fileTree.uninstalled",{name:k}))},{fail:_=>u("errors.uninstallFailed",{error:Xe(_)})}),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:N,className:"h-3 w-3",icon:o.jsx(Fr,{className:"h-3 w-3"})})})]})}const h=s.has(e.path);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",onClick:()=>a(e.path),style:{paddingLeft:p},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:[h?o.jsx(Un,{className:"h-3 w-3 shrink-0"}):o.jsx(Pn,{className:"h-3 w-3 shrink-0"}),o.jsx(Ir,{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})]}),!h&&e.children.map(g=>o.jsx(hT,{node:g,depth:t+1,scope:n,capabilities:r,updateMap:i,collapsed:s,onToggle:a,onOpenFile:l,onUninstall:c},g.type==="dir"?g.path:g.asset.relPath))]})}function zk({scope:e,assets:t,capabilities:n,updates:r,onUninstall:i,onOpenFile:s}){const a=We(),l=y.useMemo(()=>{const R=new Map;for(const L of m0)R.set(L,0);for(const L of t)for(const C of g0(L.category,L.relPath))R.set(C,(R.get(C)??0)+1);return R},[t]),[c,u]=y.useState(new Set),d=y.useMemo(()=>{const R=new Set;for(const L of c)l.has(L)&&R.add(L);return R},[c,l]),f=y.useMemo(()=>d.size?t.filter(R=>g0(R.category,R.relPath).some(L=>d.has(L))):t,[t,d]),p=y.useMemo(()=>bL(f),[f]),h=y.useMemo(()=>{if(!r)return;const R=new Map;for(const L of r)R.set(`${L.name}::${L.category}`,L);return R},[r]),[g,k]=y.useState(new Set),w=R=>k(L=>{const C=new Set(L);return C.has(R)?C.delete(R):C.add(R),C}),m=y.useMemo(()=>{const R=[],L=C=>{for(const U of C)U.type==="dir"&&(R.push(U.path),L(U.children))};return L(p),R},[p]),b=g.size>0,v=()=>k(b?new Set:new Set(m)),S=y.useMemo(()=>{const R=new Map;return m0.forEach((L,C)=>R.set(L,C)),[...l.keys()].sort((L,C)=>{const U=(l.get(C)??0)-(l.get(L)??0);return U!==0?U:(R.get(L)??1/0)-(R.get(C)??1/0)})},[l]),T=R=>{const L=new Set(d);L.delete(R)||L.add(R),u(L)},N=a(e==="user"?"fileTree.scopeGlobal":"fileTree.scopeProject"),_=qt.map(R=>e==="user"?`~/${An(R).dotDir}/`:`${An(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:[N," ",a("fileTree.title")," ",o.jsx("span",{className:"text-neutral-600 normal-case font-normal",children:e==="user"?_:a("fileTree.pathsProject",{dirs:_})})]}),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}),m.length>0&&o.jsxs("button",{type:"button",onClick:v,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(b?"fileTree.expandAllDirs":"fileTree.collapseAllDirs"),children:[b?o.jsx(lu,{className:"h-2.5 w-2.5"}):o.jsx(au,{className:"h-2.5 w-2.5"}),a(b?"fileTree.expandAll":"fileTree.collapseAll")]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsxs(Lk,{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(Lk,{kind:R,active:d.has(R),onClick:()=>T(R),children:[R,o.jsx("span",{className:"tabular-nums text-[10px] opacity-70",children:l.get(R)??0})]},R))]}),p.length===0?o.jsx("p",{className:"text-xs text-neutral-600 border border-dashed border-white/[0.06] rounded-md p-3",children:a("fileTree.emptyFiltered")}):o.jsx("div",{className:"max-h-[45vh] overflow-y-auto rounded-lg border border-white/[0.06] bg-neutral-900/40 p-2 space-y-0.5",children:p.map(R=>o.jsx(hT,{node:R,depth:0,scope:e,capabilities:n,updateMap:h,collapsed:g,onToggle:w,onOpenFile:s,onUninstall:i},R.type==="dir"?R.path:R.asset.relPath))})]})}const mT={gray:"#6b7280",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#d946ef",cyan:"#06b6d4"},xL={gray:"#d1d5db",red:"#fca5a5",green:"#86efac",yellow:"#fde68a",blue:"#bfdbfe",magenta:"#f5d0fe",cyan:"#a5f3fc"},yL=["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"];function Ex(e){const t=Math.max(0,Math.min(255,Math.round(e)));if(t<16)return yL[t];const n=i=>i.toString(16).padStart(2,"0");if(t<232){const i=t-16,s=a=>a===0?0:55+a*40;return`#${n(s(Math.floor(i/36)))}${n(s(Math.floor(i%36/6)))}${n(s(i%6))}`}const r=8+(t-232)*10;return`#${n(r)}${n(r)}${n(r)}`}const Cp=e=>e in mT;function $d(e){return Cp(e)?xL[e]:e.startsWith("ansi256:")?Ex(Number(e.slice(8))):e}function vi(e){return Cp(e)?mT[e]:e.startsWith("ansi256:")?Ex(Number(e.slice(8))):e}function vL(e){return Cp(e)?e:e.startsWith("ansi256:")?`ansi256 ${e.slice(8)}`:e}function kL(e){const t=e.trim();if(Cp(t))return t;const n=/^ansi256:(\d{1,3})$/.exec(t);if(n){const i=Number(n[1]);return i>=0&&i<=255?`ansi256:${i}`:null}if(/^#[0-9a-fA-F]{6}$/.test(t))return t.toLowerCase();const r=/^#([0-9a-fA-F]{3})$/.exec(t);if(r){const i=r[1];return`#${i[0]}${i[0]}${i[1]}${i[1]}${i[2]}${i[2]}`.toLowerCase()}return null}const wL=Array.from({length:256},(e,t)=>Ex(t));function Rf({value:e,min:t,max:n,disabled:r,onChange:i,title:s}){const a=We(),l=c=>Math.min(n??Number.MAX_SAFE_INTEGER,Math.max(t,c));return o.jsxs("span",{role:"group","aria-label":s,className:ye("inline-flex select-none items-stretch rounded border border-white/[0.08] bg-neutral-950 focus-within:border-blue-500/40",r&&"opacity-40"),children:[o.jsx("button",{type:"button","aria-label":a("common.decrease"),title:a("common.decrease"),disabled:r||e<=t,onClick:()=>i(l(e-1)),className:"flex w-6 items-center justify-center rounded-l bg-white/[0.04] text-neutral-400 transition-colors hover:bg-white/[0.08] hover:text-neutral-100 disabled:pointer-events-none disabled:opacity-30",children:o.jsx(ID,{className:"h-3 w-3"})}),o.jsx("input",{type:"number",min:t,max:n,value:e,disabled:r,"aria-label":s,onChange:c=>i(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:r||n!==void 0&&e>=n,onClick:()=>i(l(e+1)),className:"flex w-6 items-center justify-center rounded-r bg-white/[0.04] text-neutral-400 transition-colors hover:bg-white/[0.08] hover:text-neutral-100 disabled:pointer-events-none disabled:opacity-30",children:o.jsx(wp,{className:"h-3 w-3"})})]})}const x0=[{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"}],SL=[...PC],EL=[{key:"left",labelKey:"align.left"},{key:"center",labelKey:"align.center"},{key:"right",labelKey:"align.right"}],NL=[{key:"percent",labelKey:"statusline.barStyle.percent"},{key:"bar",labelKey:"statusline.barStyle.bar"},{key:"both",labelKey:"statusline.barStyle.both"}],_L=[{key:"session",labelKey:"statusline.metric.session",titleKey:"statusline.metric.sessionTitle"},{key:"context",labelKey:"statusline.metric.context",titleKey:"statusline.metric.contextTitle"}],CL=[{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"}],Nr=(e,t)=>({char:String.fromCodePoint(e),nameKey:t}),gT=String.fromCodePoint(57520),bT=String.fromCodePoint(57522),xT=String.fromCodePoint(57520),TL=[Nr(57520,"statusline.glyph.triangleRight"),Nr(57522,"statusline.glyph.triangleLeft"),Nr(57524,"statusline.glyph.roundRight"),Nr(57526,"statusline.glyph.roundLeft")],AL=[Nr(57522,"statusline.glyph.triangle"),Nr(57526,"statusline.glyph.round"),Nr(57530,"statusline.glyph.lowerTriangle"),Nr(57534,"statusline.glyph.diagonal")],ML=[Nr(57520,"statusline.glyph.triangle"),Nr(57524,"statusline.glyph.round"),Nr(57528,"statusline.glyph.lowerTriangle"),Nr(57532,"statusline.glyph.diagonal")];function $h({label:e,value:t,fallback:n,presets:r,editable:i,allowNone:s,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}),r.map(u=>o.jsx("button",{onClick:()=>a(u.char),disabled:!i,title:`${l(u.nameKey)} (U+${u.char.codePointAt(0).toString(16).toUpperCase()})`,className:ye("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-white/30":"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-900"),children:u.char},u.nameKey)),s&&o.jsx("button",{onClick:()=>a(""),disabled:!i,title:l("statusline.disableCap"),className:ye("rounded px-1.5 h-6 text-[10px] disabled:opacity-30",t===""?"bg-neutral-800 text-neutral-100 ring-1 ring-white/30":"text-neutral-500 hover:text-neutral-300"),children:l("statusline.none")})]})}function y0({value:e,editable:t,onChange:n,allowNone:r,noneSelected:i,onNone:s}){const[a,l]=y.useState(!1),[c,u]=y.useState(""),d=We(),f=()=>{const p=kL(c);p&&n(p),u("")};return o.jsxs("div",{className:"flex gap-1 items-center",children:[r&&o.jsx("button",{type:"button",onClick:s,disabled:!t,title:d("statusline.noBackground"),className:ye("h-3.5 w-3.5 rounded border border-white/20 disabled:opacity-30",i?"ring-2 ring-white/60 bg-neutral-800":"opacity-40"),children:o.jsx("span",{className:"block h-px bg-neutral-500 rotate-45"})}),SL.map(p=>o.jsx("button",{type:"button",onClick:()=>n(p),disabled:!t,title:p,style:{backgroundColor:vi(p)},className:ye("h-3.5 w-3.5 rounded-full disabled:opacity-30",e===p?"ring-2 ring-white/60":"opacity-50")},p)),o.jsx("button",{type:"button",onClick:()=>l(p=>!p),disabled:!t,title:e&&!Xu(e)?d("statusline.moreColorsCurrent",{color:vL(e)}):d("statusline.moreColors"),style:e&&!Xu(e)?{backgroundColor:vi(e)}:void 0,className:ye("h-3.5 w-3.5 rounded-full border border-white/25 text-[8px] leading-none disabled:opacity-30",e&&!Xu(e)?"ring-2 ring-white/60":"opacity-50 text-neutral-400"),children:e&&!Xu(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-white/15 bg-neutral-950 p-2 shadow-xl",children:[o.jsx("div",{className:"grid grid-cols-[repeat(16,minmax(0,1fr))] gap-[2px]",children:wL.map((p,h)=>o.jsx("button",{type:"button",title:`ansi256:${h}`,onClick:()=>{n(`ansi256:${h}`),l(!1)},style:{backgroundColor:p},className:"h-3 w-3 rounded-sm hover:ring-1 hover:ring-white/70"},h))}),o.jsxs("div",{className:"mt-2 flex items-center gap-1",children:[o.jsx("input",{type:"color",value:jL(e),onChange:p=>n(p.target.value.toLowerCase()),className:"h-6 w-8 bg-transparent",title:d("statusline.pickTruecolor")}),o.jsx("input",{value:c,onChange:p=>u(p.target.value),onKeyDown:p=>{p.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 Xu=e=>PC.includes(e);function jL(e){return e?/^#[0-9a-fA-F]{6}$/.test(e)?e:vi(e):"#000000"}const OL={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 RL(e,t){return t.format?t.format:e==="context"&&t.style?ZD[t.style]:UC[e]}function yT(e,t,n){const r={...OL[e]};if(e==="context"){const a=Number(r.percent);let l=Math.round(a/100*n.bar.cells);a>0&&l===0&&(l=1),r.bar=n.bar.fill.repeat(l)+n.bar.empty.repeat(n.bar.cells-l)}const i=RL(e,t).replace(/\{(\w+)\}/g,(a,l)=>r[l]??""),s=t.label?`${t.label}${n.labelSeparator}`:"";return(t.icon?`${t.icon} `:"")+s+i}function DL(e,t){const n=[];for(const s of t){const a=e.segments[s];if(!a.enabled)continue;const l=yT(s,a,e);l!==""&&n.push({text:l,fg:a.color,bold:a.bold,bg:a.backgroundColor,merge:a.merge})}const r=[];let i=[];for(const s of n){if(s.merge){i.push(s);continue}for(const a of i)a.bg=s.bg,a.joinsNext=!0;i=[],r.push(s)}for(const s of i)s.bg=null;return r.concat(i)}function Pk(e,t,n,r,i){const s=e.map(l=>[...l]),a=s[t].indexOf(r);return a>=0&&s[t].splice(a,1),s[n].splice(Math.min(i,s[n].length),0,r),s}function IL({projectId:e,initialTab:t="project"}){const n=t==="global",r=We(),[i,s]=y.useState(null),[a,l]=y.useState(null),[c,u]=y.useState("idle"),[d,f]=y.useState(null),[p,h]=y.useState(!1),[g,k]=y.useState(null),[w,m]=y.useState(null),b=y.useRef(0),v=y.useRef(!1),[S,T]=y.useState(!0),N=ix(kc(su,{activationConstraint:{distance:5}})),_=y.useCallback(()=>{f(null),s(null),u("idle"),Se.getStatusline(e).then(j=>{v.current=!0,l(j.globalConfig),s(n?j.globalConfig?structuredClone(j.globalConfig):null:j.config)}).catch(j=>f(String(j)))},[e,n]);y.useEffect(()=>{_()},[_]),y.useEffect(()=>Ri("statusline",_),[_]),y.useEffect(()=>{if(!p)return;const j=setTimeout(()=>h(!1),5e3);return()=>clearTimeout(j)},[p]),y.useEffect(()=>{if(!g)return;const j=setTimeout(()=>k(null),5e3);return()=>clearTimeout(j)},[g]);const R=y.useCallback(async()=>{if(!p){h(!0);return}h(!1),f(null);try{const j=await Se.getFactoryStatusline();u("idle"),s(structuredClone(j))}catch(j){f(String(j))}},[p]),L=y.useCallback(async()=>{if(i){u("saving"),f(null);try{const j=n?await Se.putGlobalStatusline(i):await Se.putStatusline(e,i);j.ok?u("saved"):(u("error"),f(r("statusline.saveFailed",{error:`${j.status} ${await j.text()}`})))}catch(j){u("error"),f(String(j))}}},[e,i,n,r]);if(y.useEffect(()=>{if(!i)return;if(v.current){v.current=!1;return}const j=setTimeout(()=>void L(),700);return()=>clearTimeout(j)},[i,L]),!i)return o.jsx("p",{className:"text-xs text-neutral-500",children:d??r("common.loading")});const C=n||i.source==="custom";function U(){a&&s({...structuredClone(a),source:"custom"})}function $(j,B){s(O=>O&&{...O,segments:{...O.segments,[j]:{...O.segments[j],...B}}})}function G(j){s(B=>B&&{...B,...j})}function I(){s(j=>j&&{...j,lines:[...j.lines,[]]})}function D(j){s(B=>{if(!B||B.lines.length<=1)return B;const O=B.lines.map(J=>[...J]),Q=O.splice(j,1)[0]??[],F=j>0?j-1:0;return O[F]=[...O[F],...Q],{...B,lines:O}})}function A(j,B){s(O=>{if(!O)return O;const Q=O.lines.map(F=>F.filter(J=>J!==B));return Q[j]=[...Q[j],B],{...O,lines:Q}})}function M(j,B,O){s(Q=>{if(!Q)return Q;const F=Q.lines.map(K=>K.filter(q=>q!==B&&q!==O)),J=Q.lines[j].indexOf(B),ce=Math.min(Math.max(J,0),F[j].length);return F[j]=[...F[j].slice(0,ce),O,...F[j].slice(ce)],{...Q,lines:F}})}function P(j,B){s(O=>O&&{...O,lines:O.lines.map((Q,F)=>F===j?Q.filter(J=>J!==B):Q)})}function H(j){b.current=Date.now();const{active:B,over:O}=j;if(!O)return;const Q=B.id;s(F=>{var ue,me,Ne;if(!F)return F;const J=((ue=B.data.current)==null?void 0:ue.line)??-1,ce=((me=O.data.current)==null?void 0:me.line)??-1,K=((Ne=O.data.current)==null?void 0:Ne.container)===!0;if(J<0||ce<0)return F;if(K)return J===ce?F:{...F,lines:Pk(F.lines,J,ce,Q,F.lines[ce].length)};if(B.id===O.id)return F;const q=F.lines[J].indexOf(Q);if(q<0)return F;if(J===ce){const Te=F.lines[ce].indexOf(O.id);if(Te<0)return F;const ne=F.lines.map(pe=>[...pe]);return ne[J]=_p(ne[J],q,Te),{...F,lines:ne}}const V=F.lines[ce].indexOf(O.id);return{...F,lines:Pk(F.lines,J,ce,Q,V<0?F.lines[ce].length:V)}})}const E={text:`${i.logoText} v${yk}`,fg:i.logoColor,bold:!0,bg:null,merge:!1};return o.jsxs(Ns,{className:ye("flex flex-col",S&&"h-[600px] overflow-hidden"),children:[o.jsxs(pa,{className:"shrink-0 items-center",children:[o.jsxs("button",{type:"button",onClick:()=>T(j=>!j),className:"flex items-center gap-2 text-left",title:r(S?"common.collapse":"common.expand"),children:[S?o.jsx(Pn,{className:"h-4 w-4 text-neutral-500"}):o.jsx(Un,{className:"h-4 w-4 text-neutral-500"}),o.jsx(ha,{children:r("statusline.title")}),o.jsx($r,{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:r(n?"statusline.scopeGlobal":"statusline.scopeProject")}),n&&o.jsx("button",{onClick:()=>void R(),className:ye("rounded px-2 py-1 transition-colors",p?"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:r("statusline.resetHint"),children:r(p?"statusline.resetConfirm":"statusline.reset")}),o.jsx("button",{onClick:()=>void L(),disabled:c==="saving",className:ye("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:r(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-white/[0.06] p-3",children:o.jsxs("div",{className:"nerd-font rounded-md bg-neutral-950 border border-white/[0.06] px-3 py-2 text-xs text-neutral-300 whitespace-pre overflow-x-auto",children:[i.lines.map((j,B)=>{const O=DL(i,j);return B===0&&E&&O.unshift(E),o.jsxs("div",{children:[B>0&&o.jsx("div",{className:"text-neutral-700",children:"────────────────────────────"}),O.length?o.jsx(LL,{items:O,config:i}):o.jsx("span",{className:"text-neutral-600",children:r("statusline.emptyRow")})]},B)}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:r("statusline.preview")})]})}),o.jsxs(ma,{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-white/[0.06] bg-neutral-900/60 px-2 py-1.5 text-xs",children:i.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:r("statusline.followingGlobal")}),o.jsx("span",{className:"text-neutral-600",children:r("statusline.editsDisabled")}),o.jsx("button",{onClick:U,className:"ml-auto shrink-0 rounded bg-blue-900/40 px-2 py-0.5 text-blue-300 hover:bg-blue-900/60",children:r("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:r("statusline.localCustom")}),o.jsx("span",{className:"text-neutral-600",children:r("statusline.ownConfig")}),o.jsx("button",{onClick:()=>{if(g!=="follow"){k("follow");return}k(null),G({source:"global"})},className:ye("ml-auto shrink-0 rounded px-2 py-0.5 transition-colors",g==="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:r("statusline.followHint"),children:r(g==="follow"?"statusline.followConfirm":"statusline.follow")}),o.jsx("button",{onClick:()=>{if(g!=="sync"){k("sync");return}k(null),U()},className:ye("shrink-0 rounded px-2 py-0.5 transition-colors",g==="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:r("statusline.syncHint"),children:r(g==="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:r("statusline.alignLabel")}),EL.map(j=>o.jsx("button",{onClick:()=>G({align:j.key}),disabled:!C,className:ye("rounded px-2 py-0.5 disabled:opacity-30",i.align===j.key?"bg-neutral-800 text-neutral-100":"text-neutral-400 hover:text-neutral-200"),children:r(j.labelKey)},j.key)),o.jsx("span",{className:"text-neutral-600",children:"|"}),o.jsxs("label",{className:"flex items-center gap-1.5",children:[r("statusline.refresh"),o.jsx(Rf,{value:i.refreshInterval,min:1,disabled:!C,onChange:j=>G({refreshInterval:j}),title:r("statusline.refresh")}),o.jsx("span",{className:"text-neutral-600",children:"s"}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:r("statusline.refreshNote")})]})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[o.jsx("input",{type:"checkbox",checked:i.powerline.enabled,disabled:!C,onChange:j=>G({powerline:{...i.powerline,enabled:j.target.checked}})}),r("statusline.powerlineStyle"),o.jsx("span",{className:"text-neutral-600",children:r("statusline.powerlineHint")})]}),i.powerline.enabled&&o.jsxs("div",{className:"flex items-center gap-4 text-xs text-neutral-400 flex-wrap pl-6",children:[o.jsx($h,{label:r("statusline.glyphSeparator"),value:i.powerline.separator,fallback:gT,presets:TL,editable:C,onChange:j=>G({powerline:{...i.powerline,separator:j}})}),o.jsx($h,{label:r("statusline.glyphStartCap"),value:i.powerline.startCap,fallback:bT,presets:AL,editable:C,allowNone:!0,onChange:j=>G({powerline:{...i.powerline,startCap:j}})}),o.jsx($h,{label:r("statusline.glyphEndCap"),value:i.powerline.endCap,fallback:xT,presets:ML,editable:C,allowNone:!0,onChange:j=>G({powerline:{...i.powerline,endCap:j}})}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:r("statusline.nerdFontHint")})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[r("statusline.logo"),o.jsxs("span",{className:"rounded bg-neutral-900 px-2 py-0.5 font-mono text-neutral-300",children:[i.logoText," v",yk]}),o.jsx("span",{className:"text-neutral-600 text-[10px]",children:r("statusline.logoHint")}),o.jsx("div",{className:"flex gap-1",children:o.jsx(y0,{value:i.logoColor,editable:C,onChange:j=>G({logoColor:j})})})]}),o.jsxs("label",{className:"flex items-center gap-2 text-xs text-neutral-400",children:[r("statusline.separator"),o.jsx("input",{value:i.separator,disabled:!C,onChange:j=>G({separator:j.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:r("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:[r("statusline.bar"),o.jsx(Rf,{value:i.bar.cells,min:1,max:40,disabled:!C,onChange:j=>G({bar:{...i.bar,cells:j}}),title:r("statusline.barCellsHint")})]}),o.jsxs("label",{className:"flex items-center gap-2",children:[r("statusline.fill"),o.jsx("input",{value:i.bar.fill,disabled:!C,onChange:j=>G({bar:{...i.bar,fill:j.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:[r("statusline.emptyChar"),o.jsx("input",{value:i.bar.empty,disabled:!C,onChange:j=>G({bar:{...i.bar,empty:j.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:[r("statusline.labelSep"),o.jsx("input",{value:i.labelSeparator,disabled:!C,onChange:j=>G({labelSeparator:j.target.value}),className:"bg-neutral-900 rounded px-2 py-0.5 font-mono w-14 disabled:opacity-40",title:r("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:r("statusline.lines")}),o.jsx("button",{onClick:I,disabled:!C,className:"text-[11px] rounded bg-neutral-800 px-2 py-0.5 text-neutral-300 hover:bg-neutral-700 disabled:opacity-30",children:r("statusline.addRow")})]}),o.jsx(cx,{sensors:N,collisionDetection:lR,onDragEnd:H,children:i.lines.map((j,B)=>o.jsx(PL,{li:B,row:j,linesLen:i.lines.length,editable:C,config:i,lastDragEnd:b,onRemoveRow:D,onOpen:(O,Q)=>m({line:O,key:Q}),onAdd:O=>m({line:O,key:null})},B))}),w&&o.jsx(UL,{editing:w,config:i,placedIn:j=>i.lines.findIndex(B=>B.includes(j)),onPick:j=>{w.key===null?A(w.line,j):w.key!==j&&M(w.line,w.key,j),m({line:w.line,key:j})},onPatch:$,onUnplace:()=>{w.key&&P(w.line,w.key),m(null)},onClose:()=>m(null)})]})]})]})]})}function LL({items:e,config:t}){if(!t.powerline.enabled)return o.jsx("span",{children:e.map(c=>o.jsx("span",{className:ye(c.bold&&"font-bold"),style:{color:$d(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,r=n.separator??gT,i=n.startCap??bT,s=n.endCap??xT,a=e[0],l=e[e.length-1];return o.jsxs("span",{className:"inline-flex items-stretch",children:[i&&(a==null?void 0:a.bg)&&o.jsx("span",{className:"whitespace-pre",style:{color:vi(a.bg)},children:i}),e.map((c,u)=>{const d=e[u-1],f=u>0&&!d.joinsNext,p=f&&!!c.bg&&!!d.bg&&r!=="";return o.jsxs("span",{className:"inline-flex items-stretch",children:[f&&(p?o.jsx("span",{className:"whitespace-pre",style:{backgroundColor:vi(c.bg),color:d.bg===c.bg?$d(d.fg):vi(d.bg)},children:r}):o.jsx("span",{className:"w-1"})),o.jsx("span",{className:ye("px-1.5 whitespace-pre",c.bold&&"font-bold"),style:{...c.bg?{backgroundColor:vi(c.bg)}:{},color:$d(c.fg)},children:c.text})]},u)}),s&&(l==null?void 0:l.bg)&&o.jsx("span",{className:"whitespace-pre",style:{color:vi(l.bg)},children:s})]})}function zL({segKey:e,line:t,segment:n,config:r,editable:i,lastDragEnd:s,onOpen:a}){const l=We(),{attributes:c,listeners:u,setNodeRef:d,transform:f,transition:p,isDragging:h}=VC({id:e,disabled:!i,data:{line:t}}),g={transform:f?`translate3d(${f.x}px, ${f.y}px, 0)`:void 0,transition:p},k=x0.find(S=>S.key===e),w=n.enabled,m=yT(e,n,r)||l(k.labelKey),b=w&&n.backgroundColor?vi(n.backgroundColor):void 0,v=w?$d(n.color):void 0;return o.jsx("div",{ref:d,style:g,className:ye("shrink-0 max-w-[260px]",h&&"opacity-50 ring-1 ring-white/30"),children:o.jsx("button",{...c,...u,onClick:()=>{Date.now()-s.current<250||a(t,e)},title:w?l("statusline.capsuleTitle",{name:l(k.labelKey)}):l("statusline.capsuleTitleOff",{name:l(k.labelKey)}),className:ye("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",i?"cursor-grab active:cursor-grabbing hover:brightness-110":"cursor-default"),style:b||v?{backgroundColor:b,color:v}:void 0,children:o.jsx("span",{className:"block truncate",children:m})})})}function PL({li:e,row:t,linesLen:n,editable:r,config:i,lastDragEnd:s,onRemoveRow:a,onOpen:l,onAdd:c}){const u=We(),{setNodeRef:d,isOver:f}=ux({id:`line-${e}`,data:{line:e,container:!0},disabled:!r});return o.jsxs("div",{ref:d,className:ye("rounded-lg border border-white/[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:!r,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(qC,{items:t,strategy:uI,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(p=>o.jsx(zL,{segKey:p,line:e,segment:i.segments[p],config:i,editable:r,lastDragEnd:s,onOpen:l},p)),r&&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 UL({editing:e,config:t,placedIn:n,onPick:r,onPatch:i,onUnplace:s,onClose:a}){const l=e.key,c=l?t.segments[l]:null,u=We();return y.useEffect(()=>{const d=f=>{f.key==="Escape"&&a()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[a]),ln.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-white/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(x0.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:x0.map(d=>{const f=n(d.key),p=d.key===l,h=f>=0&&f!==e.line;return o.jsxs("button",{type:"button",onClick:()=>{p||r(d.key)},title:h?u("statusline.tagOtherRow",{n:f+1}):d.key,className:ye("rounded-full border px-2 py-0.5 text-[11px] transition-colors",p?"border-blue-500/50 bg-blue-900/50 text-blue-200":h?"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),h&&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:()=>i(l,{enabled:!c.enabled}),className:ye("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:()=>i(l,{bold:!c.bold}),className:ye("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:ye("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=>i(l,{merge:d.target.checked}),className:"hidden"}),u("statusline.merge")]}),o.jsx("input",{value:c.icon,onChange:d=>i(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")}),NL.map(d=>o.jsx("button",{onClick:()=>i(l,{style:d.key}),className:ye("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")}),_L.map(d=>o.jsx("button",{onClick:()=>i(l,{metric:d.key}),className:ye("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")}),CL.map(d=>o.jsx("button",{onClick:()=>i(l,{window:d.key}),className:ye("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(y0,{value:c.color,editable:!0,onChange:d=>i(l,{color:d})}),o.jsx(y0,{value:c.backgroundColor,editable:!0,allowNone:!0,noneSelected:c.backgroundColor===null,onNone:()=>i(l,{backgroundColor:null}),onChange:d=>i(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=>i(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=>i(l,{format:d.target.value}),placeholder:UC[l],className:"min-w-0 flex-1 rounded bg-neutral-800 px-1.5 py-0.5 font-mono",title:u("statusline.tokensTitle",{tokens:WD[l].map(d=>"{"+d+"}").join(" ")})})]}),o.jsxs("div",{className:"flex items-center justify-between border-t border-white/[0.06] pt-2",children:[o.jsx("button",{onClick:s,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 un(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=un(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var BL={value:()=>{}};function Tp(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Gd(n)}function Gd(e){this._=e}function HL(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Gd.prototype=Tp.prototype={constructor:Gd,on:function(e,t){var n=this._,r=HL(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=FL(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Uk(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Uk(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Gd(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function FL(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Uk(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=BL,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var v0="http://www.w3.org/1999/xhtml";const Bk={svg:"http://www.w3.org/2000/svg",xhtml:v0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ap(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Bk.hasOwnProperty(t)?{space:Bk[t],local:e}:e}function $L(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===v0&&t.documentElement.namespaceURI===v0?t.createElement(e):t.createElementNS(n,e)}}function GL(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vT(e){var t=Ap(e);return(t.local?GL:$L)(t)}function KL(){}function Nx(e){return e==null?KL:function(){return this.querySelector(e)}}function qL(e){typeof e!="function"&&(e=Nx(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=new Array(a),c,u,d=0;d<a;++d)(c=s[d])&&(u=e.call(c,c.__data__,d,s))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new pr(r,this._parents)}function YL(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function VL(){return[]}function kT(e){return e==null?VL:function(){return this.querySelectorAll(e)}}function XL(e){return function(){return YL(e.apply(this,arguments))}}function WL(e){typeof e=="function"?e=XL(e):e=kT(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(r.push(e.call(c,c.__data__,u,a)),i.push(c));return new pr(r,i)}function wT(e){return function(){return this.matches(e)}}function ST(e){return function(t){return t.matches(e)}}var ZL=Array.prototype.find;function QL(e){return function(){return ZL.call(this.children,e)}}function JL(){return this.firstElementChild}function e6(e){return this.select(e==null?JL:QL(typeof e=="function"?e:ST(e)))}var t6=Array.prototype.filter;function n6(){return Array.from(this.children)}function r6(e){return function(){return t6.call(this.children,e)}}function i6(e){return this.selectAll(e==null?n6:r6(typeof e=="function"?e:ST(e)))}function s6(e){typeof e!="function"&&(e=wT(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],c,u=0;u<a;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new pr(r,this._parents)}function ET(e){return new Array(e.length)}function a6(){return new pr(this._enter||this._groups.map(ET),this._parents)}function Df(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Df.prototype={constructor:Df,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 l6(e){return function(){return e}}function o6(e,t,n,r,i,s){for(var a=0,l,c=t.length,u=s.length;a<u;++a)(l=t[a])?(l.__data__=s[a],r[a]=l):n[a]=new Df(e,s[a]);for(;a<c;++a)(l=t[a])&&(i[a]=l)}function c6(e,t,n,r,i,s,a){var l,c,u=new Map,d=t.length,f=s.length,p=new Array(d),h;for(l=0;l<d;++l)(c=t[l])&&(p[l]=h=a.call(c,c.__data__,l,t)+"",u.has(h)?i[l]=c:u.set(h,c));for(l=0;l<f;++l)h=a.call(e,s[l],l,s)+"",(c=u.get(h))?(r[l]=c,c.__data__=s[l],u.delete(h)):n[l]=new Df(e,s[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(p[l])===c&&(i[l]=c)}function u6(e){return e.__data__}function d6(e,t){if(!arguments.length)return Array.from(this,u6);var n=t?c6:o6,r=this._parents,i=this._groups;typeof e!="function"&&(e=l6(e));for(var s=i.length,a=new Array(s),l=new Array(s),c=new Array(s),u=0;u<s;++u){var d=r[u],f=i[u],p=f.length,h=f6(e.call(d,d&&d.__data__,u,r)),g=h.length,k=l[u]=new Array(g),w=a[u]=new Array(g),m=c[u]=new Array(p);n(d,f,k,w,m,h,t);for(var b=0,v=0,S,T;b<g;++b)if(S=k[b]){for(b>=v&&(v=b+1);!(T=w[v])&&++v<g;);S._next=T||null}}return a=new pr(a,r),a._enter=l,a._exit=c,a}function f6(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function p6(){return new pr(this._exit||this._groups.map(ET),this._parents)}function h6(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function m6(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),l=new Array(i),c=0;c<a;++c)for(var u=n[c],d=r[c],f=u.length,p=l[c]=new Array(f),h,g=0;g<f;++g)(h=u[g]||d[g])&&(p[g]=h);for(;c<i;++c)l[c]=n[c];return new pr(l,this._parents)}function g6(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function b6(e){e||(e=x6);function t(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],l=a.length,c=i[s]=new Array(l),u,d=0;d<l;++d)(u=a[d])&&(c[d]=u);c.sort(t)}return new pr(i,this._parents).order()}function x6(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function y6(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function v6(){return Array.from(this)}function k6(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function w6(){let e=0;for(const t of this)++e;return e}function S6(){return!this.node()}function E6(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}function N6(e){return function(){this.removeAttribute(e)}}function _6(e){return function(){this.removeAttributeNS(e.space,e.local)}}function C6(e,t){return function(){this.setAttribute(e,t)}}function T6(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function A6(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function M6(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 j6(e,t){var n=Ap(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?_6:N6:typeof t=="function"?n.local?M6:A6:n.local?T6:C6)(n,t))}function NT(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function O6(e){return function(){this.style.removeProperty(e)}}function R6(e,t,n){return function(){this.style.setProperty(e,t,n)}}function D6(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function I6(e,t,n){return arguments.length>1?this.each((t==null?O6:typeof t=="function"?D6:R6)(e,t,n??"")):zl(this.node(),e)}function zl(e,t){return e.style.getPropertyValue(t)||NT(e).getComputedStyle(e,null).getPropertyValue(t)}function L6(e){return function(){delete this[e]}}function z6(e,t){return function(){this[e]=t}}function P6(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function U6(e,t){return arguments.length>1?this.each((t==null?L6:typeof t=="function"?P6:z6)(e,t)):this.node()[e]}function _T(e){return e.trim().split(/^|\s+/)}function _x(e){return e.classList||new CT(e)}function CT(e){this._node=e,this._names=_T(e.getAttribute("class")||"")}CT.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 TT(e,t){for(var n=_x(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function AT(e,t){for(var n=_x(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function B6(e){return function(){TT(this,e)}}function H6(e){return function(){AT(this,e)}}function F6(e,t){return function(){(t.apply(this,arguments)?TT:AT)(this,e)}}function $6(e,t){var n=_T(e+"");if(arguments.length<2){for(var r=_x(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?F6:t?B6:H6)(n,t))}function G6(){this.textContent=""}function K6(e){return function(){this.textContent=e}}function q6(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Y6(e){return arguments.length?this.each(e==null?G6:(typeof e=="function"?q6:K6)(e)):this.node().textContent}function V6(){this.innerHTML=""}function X6(e){return function(){this.innerHTML=e}}function W6(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Z6(e){return arguments.length?this.each(e==null?V6:(typeof e=="function"?W6:X6)(e)):this.node().innerHTML}function Q6(){this.nextSibling&&this.parentNode.appendChild(this)}function J6(){return this.each(Q6)}function ez(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tz(){return this.each(ez)}function nz(e){var t=typeof e=="function"?e:vT(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function rz(){return null}function iz(e,t){var n=typeof e=="function"?e:vT(e),r=t==null?rz:typeof t=="function"?t:Nx(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function sz(){var e=this.parentNode;e&&e.removeChild(this)}function az(){return this.each(sz)}function lz(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function oz(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cz(e){return this.select(e?oz:lz)}function uz(e){return arguments.length?this.property("__data__",e):this.node().__data__}function dz(e){return function(t){e.call(this,t,this.__data__)}}function fz(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function pz(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function hz(e,t,n){return function(){var r=this.__on,i,s=dz(t);if(r){for(var a=0,l=r.length;a<l;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function mz(e,t,n){var r=fz(e+""),i,s=r.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(i=0,d=l[c];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(l=t?hz:pz,i=0;i<s;++i)this.each(l(r[i],t,n));return this}function MT(e,t,n){var r=NT(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function gz(e,t){return function(){return MT(this,e,t)}}function bz(e,t){return function(){return MT(this,e,t.apply(this,arguments))}}function xz(e,t){return this.each((typeof t=="function"?bz:gz)(e,t))}function*yz(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var jT=[null];function pr(e,t){this._groups=e,this._parents=t}function pu(){return new pr([[document.documentElement]],jT)}function vz(){return this}pr.prototype=pu.prototype={constructor:pr,select:qL,selectAll:WL,selectChild:e6,selectChildren:i6,filter:s6,data:d6,enter:a6,exit:p6,join:h6,merge:m6,selection:vz,order:g6,sort:b6,call:y6,nodes:v6,node:k6,size:w6,empty:S6,each:E6,attr:j6,style:I6,property:U6,classed:$6,text:Y6,html:Z6,raise:J6,lower:tz,append:nz,insert:iz,remove:az,clone:cz,datum:uz,on:mz,dispatch:xz,[Symbol.iterator]:yz};function sr(e){return typeof e=="string"?new pr([[document.querySelector(e)]],[document.documentElement]):new pr([[e]],jT)}function kz(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Rr(e,t){if(e=kz(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const wz={passive:!1},jc={capture:!0,passive:!1};function Gh(e){e.stopImmediatePropagation()}function yl(e){e.preventDefault(),e.stopImmediatePropagation()}function OT(e){var t=e.document.documentElement,n=sr(e).on("dragstart.drag",yl,jc);"onselectstart"in t?n.on("selectstart.drag",yl,jc):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function RT(e,t){var n=e.document.documentElement,r=sr(e).on("dragstart.drag",null);t&&(r.on("click.drag",yl,jc),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Wu=e=>()=>e;function k0(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,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}})}k0.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Sz(e){return!e.ctrlKey&&!e.button}function Ez(){return this.parentNode}function Nz(e,t){return t??{x:e.x,y:e.y}}function _z(){return navigator.maxTouchPoints||"ontouchstart"in this}function DT(){var e=Sz,t=Ez,n=Nz,r=_z,i={},s=Tp("start","drag","end"),a=0,l,c,u,d,f=0;function p(S){S.on("mousedown.drag",h).filter(r).on("touchstart.drag",w).on("touchmove.drag",m,wz).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(S,T){if(!(d||!e.call(this,S,T))){var N=v(this,t.call(this,S,T),S,T,"mouse");N&&(sr(S.view).on("mousemove.drag",g,jc).on("mouseup.drag",k,jc),OT(S.view),Gh(S),u=!1,l=S.clientX,c=S.clientY,N("start",S))}}function g(S){if(yl(S),!u){var T=S.clientX-l,N=S.clientY-c;u=T*T+N*N>f}i.mouse("drag",S)}function k(S){sr(S.view).on("mousemove.drag mouseup.drag",null),RT(S.view,u),yl(S),i.mouse("end",S)}function w(S,T){if(e.call(this,S,T)){var N=S.changedTouches,_=t.call(this,S,T),R=N.length,L,C;for(L=0;L<R;++L)(C=v(this,_,S,T,N[L].identifier,N[L]))&&(Gh(S),C("start",S,N[L]))}}function m(S){var T=S.changedTouches,N=T.length,_,R;for(_=0;_<N;++_)(R=i[T[_].identifier])&&(yl(S),R("drag",S,T[_]))}function b(S){var T=S.changedTouches,N=T.length,_,R;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),_=0;_<N;++_)(R=i[T[_].identifier])&&(Gh(S),R("end",S,T[_]))}function v(S,T,N,_,R,L){var C=s.copy(),U=Rr(L||N,T),$,G,I;if((I=n.call(S,new k0("beforestart",{sourceEvent:N,target:p,identifier:R,active:a,x:U[0],y:U[1],dx:0,dy:0,dispatch:C}),_))!=null)return $=I.x-U[0]||0,G=I.y-U[1]||0,function D(A,M,P){var H=U,E;switch(A){case"start":i[R]=D,E=a++;break;case"end":delete i[R],--a;case"drag":U=Rr(P||M,T),E=a;break}C.call(A,S,new k0(A,{sourceEvent:M,subject:I,target:p,identifier:R,active:E,x:U[0]+$,y:U[1]+G,dx:U[0]-H[0],dy:U[1]-H[1],dispatch:C}),_)}}return p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Wu(!!S),p):e},p.container=function(S){return arguments.length?(t=typeof S=="function"?S:Wu(S),p):t},p.subject=function(S){return arguments.length?(n=typeof S=="function"?S:Wu(S),p):n},p.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:Wu(!!S),p):r},p.on=function(){var S=s.on.apply(s,arguments);return S===s?p:S},p.clickDistance=function(S){return arguments.length?(f=(S=+S)*S,p):Math.sqrt(f)},p}function Cx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function IT(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hu(){}var Oc=.7,If=1/Oc,vl="\\s*([+-]?\\d+)\\s*",Rc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ni="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Cz=/^#([0-9a-f]{3,8})$/,Tz=new RegExp(`^rgb\\(${vl},${vl},${vl}\\)$`),Az=new RegExp(`^rgb\\(${ni},${ni},${ni}\\)$`),Mz=new RegExp(`^rgba\\(${vl},${vl},${vl},${Rc}\\)$`),jz=new RegExp(`^rgba\\(${ni},${ni},${ni},${Rc}\\)$`),Oz=new RegExp(`^hsl\\(${Rc},${ni},${ni}\\)$`),Rz=new RegExp(`^hsla\\(${Rc},${ni},${ni},${Rc}\\)$`),Hk={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};Cx(hu,ga,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fk,formatHex:Fk,formatHex8:Dz,formatHsl:Iz,formatRgb:$k,toString:$k});function Fk(){return this.rgb().formatHex()}function Dz(){return this.rgb().formatHex8()}function Iz(){return LT(this).formatHsl()}function $k(){return this.rgb().formatRgb()}function ga(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Cz.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Gk(t):n===3?new Vn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Zu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Zu(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=Tz.exec(e))?new Vn(t[1],t[2],t[3],1):(t=Az.exec(e))?new Vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Mz.exec(e))?Zu(t[1],t[2],t[3],t[4]):(t=jz.exec(e))?Zu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Oz.exec(e))?Yk(t[1],t[2]/100,t[3]/100,1):(t=Rz.exec(e))?Yk(t[1],t[2]/100,t[3]/100,t[4]):Hk.hasOwnProperty(e)?Gk(Hk[e]):e==="transparent"?new Vn(NaN,NaN,NaN,0):null}function Gk(e){return new Vn(e>>16&255,e>>8&255,e&255,1)}function Zu(e,t,n,r){return r<=0&&(e=t=n=NaN),new Vn(e,t,n,r)}function Lz(e){return e instanceof hu||(e=ga(e)),e?(e=e.rgb(),new Vn(e.r,e.g,e.b,e.opacity)):new Vn}function w0(e,t,n,r){return arguments.length===1?Lz(e):new Vn(e,t,n,r??1)}function Vn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Cx(Vn,w0,IT(hu,{brighter(e){return e=e==null?If:Math.pow(If,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oc:Math.pow(Oc,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vn(ea(this.r),ea(this.g),ea(this.b),Lf(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:Kk,formatHex:Kk,formatHex8:zz,formatRgb:qk,toString:qk}));function Kk(){return`#${qs(this.r)}${qs(this.g)}${qs(this.b)}`}function zz(){return`#${qs(this.r)}${qs(this.g)}${qs(this.b)}${qs((isNaN(this.opacity)?1:this.opacity)*255)}`}function qk(){const e=Lf(this.opacity);return`${e===1?"rgb(":"rgba("}${ea(this.r)}, ${ea(this.g)}, ${ea(this.b)}${e===1?")":`, ${e})`}`}function Lf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ea(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function qs(e){return e=ea(e),(e<16?"0":"")+e.toString(16)}function Yk(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Dr(e,t,n,r)}function LT(e){if(e instanceof Dr)return new Dr(e.h,e.s,e.l,e.opacity);if(e instanceof hu||(e=ga(e)),!e)return new Dr;if(e instanceof Dr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,l=s-i,c=(s+i)/2;return l?(t===s?a=(n-r)/l+(n<r)*6:n===s?a=(r-t)/l+2:a=(t-n)/l+4,l/=c<.5?s+i:2-s-i,a*=60):l=c>0&&c<1?0:a,new Dr(a,l,c,e.opacity)}function Pz(e,t,n,r){return arguments.length===1?LT(e):new Dr(e,t,n,r??1)}function Dr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Cx(Dr,Pz,IT(hu,{brighter(e){return e=e==null?If:Math.pow(If,e),new Dr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oc:Math.pow(Oc,e),new Dr(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Vn(Kh(e>=240?e-240:e+120,i,r),Kh(e,i,r),Kh(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Dr(Vk(this.h),Qu(this.s),Qu(this.l),Lf(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=Lf(this.opacity);return`${e===1?"hsl(":"hsla("}${Vk(this.h)}, ${Qu(this.s)*100}%, ${Qu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Vk(e){return e=(e||0)%360,e<0?e+360:e}function Qu(e){return Math.max(0,Math.min(1,e||0))}function Kh(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 Tx=e=>()=>e;function Uz(e,t){return function(n){return e+n*t}}function Bz(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Hz(e){return(e=+e)==1?zT:function(t,n){return n-t?Bz(t,n,e):Tx(isNaN(t)?n:t)}}function zT(e,t){var n=t-e;return n?Uz(e,n):Tx(isNaN(e)?t:e)}const zf=function e(t){var n=Hz(t);function r(i,s){var a=n((i=w0(i)).r,(s=w0(s)).r),l=n(i.g,s.g),c=n(i.b,s.b),u=zT(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function Fz(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function $z(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Gz(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=ec(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(l){for(a=0;a<r;++a)s[a]=i[a](l);return s}}function Kz(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Xr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function qz(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ec(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var S0=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qh=new RegExp(S0.source,"g");function Yz(e){return function(){return e}}function Vz(e){return function(t){return e(t)+""}}function PT(e,t){var n=S0.lastIndex=qh.lastIndex=0,r,i,s,a=-1,l=[],c=[];for(e=e+"",t=t+"";(r=S0.exec(e))&&(i=qh.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),l[a]?l[a]+=s:l[++a]=s),(r=r[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,c.push({i:a,x:Xr(r,i)})),n=qh.lastIndex;return n<t.length&&(s=t.slice(n),l[a]?l[a]+=s:l[++a]=s),l.length<2?c[0]?Vz(c[0].x):Yz(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 ec(e,t){var n=typeof t,r;return t==null||n==="boolean"?Tx(t):(n==="number"?Xr:n==="string"?(r=ga(t))?(t=r,zf):PT:t instanceof ga?zf:t instanceof Date?Kz:$z(t)?Fz:Array.isArray(t)?Gz:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?qz:Xr)(e,t)}var Xk=180/Math.PI,E0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function UT(e,t,n,r,i,s){var a,l,c;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Xk,skewX:Math.atan(c)*Xk,scaleX:a,scaleY:l}}var Ju;function Xz(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?E0:UT(t.a,t.b,t.c,t.d,t.e,t.f)}function Wz(e){return e==null||(Ju||(Ju=document.createElementNS("http://www.w3.org/2000/svg","g")),Ju.setAttribute("transform",e),!(e=Ju.transform.baseVal.consolidate()))?E0:(e=e.matrix,UT(e.a,e.b,e.c,e.d,e.e,e.f))}function BT(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function s(u,d,f,p,h,g){if(u!==f||d!==p){var k=h.push("translate(",null,t,null,n);g.push({i:k-4,x:Xr(u,f)},{i:k-2,x:Xr(d,p)})}else(f||p)&&h.push("translate("+f+t+p+n)}function a(u,d,f,p){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),p.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Xr(u,d)})):d&&f.push(i(f)+"rotate("+d+r)}function l(u,d,f,p){u!==d?p.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Xr(u,d)}):d&&f.push(i(f)+"skewX("+d+r)}function c(u,d,f,p,h,g){if(u!==f||d!==p){var k=h.push(i(h)+"scale(",null,",",null,")");g.push({i:k-4,x:Xr(u,f)},{i:k-2,x:Xr(d,p)})}else(f!==1||p!==1)&&h.push(i(h)+"scale("+f+","+p+")")}return function(u,d){var f=[],p=[];return u=e(u),d=e(d),s(u.translateX,u.translateY,d.translateX,d.translateY,f,p),a(u.rotate,d.rotate,f,p),l(u.skewX,d.skewX,f,p),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,p),u=d=null,function(h){for(var g=-1,k=p.length,w;++g<k;)f[(w=p[g]).i]=w.x(h);return f.join("")}}}var Zz=BT(Xz,"px, ","px)","deg)"),Qz=BT(Wz,", ",")",")"),Jz=1e-12;function Wk(e){return((e=Math.exp(e))+1/e)/2}function eP(e){return((e=Math.exp(e))-1/e)/2}function tP(e){return((e=Math.exp(2*e))-1)/(e+1)}const Kd=function e(t,n,r){function i(s,a){var l=s[0],c=s[1],u=s[2],d=a[0],f=a[1],p=a[2],h=d-l,g=f-c,k=h*h+g*g,w,m;if(k<Jz)m=Math.log(p/u)/t,w=function(_){return[l+_*h,c+_*g,u*Math.exp(t*_*m)]};else{var b=Math.sqrt(k),v=(p*p-u*u+r*k)/(2*u*n*b),S=(p*p-u*u-r*k)/(2*p*n*b),T=Math.log(Math.sqrt(v*v+1)-v),N=Math.log(Math.sqrt(S*S+1)-S);m=(N-T)/t,w=function(_){var R=_*m,L=Wk(T),C=u/(n*b)*(L*tP(t*R+T)-eP(T));return[l+C*h,c+C*g,u*L/Wk(t*R+T)]}}return w.duration=m*1e3*t/Math.SQRT2,w}return i.rho=function(s){var a=Math.max(.001,+s),l=a*a,c=l*l;return e(a,l,c)},i}(Math.SQRT2,2,4);var Pl=0,Oo=0,wo=0,HT=1e3,Pf,Ro,Uf=0,ba=0,Mp=0,Dc=typeof performance=="object"&&performance.now?performance:Date,FT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ax(){return ba||(FT(nP),ba=Dc.now()+Mp)}function nP(){ba=0}function Bf(){this._call=this._time=this._next=null}Bf.prototype=$T.prototype={constructor:Bf,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ax():+n)+(t==null?0:+t),!this._next&&Ro!==this&&(Ro?Ro._next=this:Pf=this,Ro=this),this._call=e,this._time=n,N0()},stop:function(){this._call&&(this._call=null,this._time=1/0,N0())}};function $T(e,t,n){var r=new Bf;return r.restart(e,t,n),r}function rP(){Ax(),++Pl;for(var e=Pf,t;e;)(t=ba-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Pl}function Zk(){ba=(Uf=Dc.now())+Mp,Pl=Oo=0;try{rP()}finally{Pl=0,sP(),ba=0}}function iP(){var e=Dc.now(),t=e-Uf;t>HT&&(Mp-=t,Uf=e)}function sP(){for(var e,t=Pf,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Pf=n);Ro=e,N0(r)}function N0(e){if(!Pl){Oo&&(Oo=clearTimeout(Oo));var t=e-ba;t>24?(e<1/0&&(Oo=setTimeout(Zk,e-Dc.now()-Mp)),wo&&(wo=clearInterval(wo))):(wo||(Uf=Dc.now(),wo=setInterval(iP,HT)),Pl=1,FT(Zk))}}function Qk(e,t,n){var r=new Bf;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var aP=Tp("start","end","cancel","interrupt"),lP=[],GT=0,Jk=1,_0=2,qd=3,ew=4,C0=5,Yd=6;function jp(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;oP(e,n,{name:t,index:r,group:i,on:aP,tween:lP,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:GT})}function Mx(e,t){var n=Gr(e,t);if(n.state>GT)throw new Error("too late; already scheduled");return n}function li(e,t){var n=Gr(e,t);if(n.state>qd)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 oP(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=$T(s,0,n.time);function s(u){n.state=Jk,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,p,h;if(n.state!==Jk)return c();for(d in r)if(h=r[d],h.name===n.name){if(h.state===qd)return Qk(a);h.state===ew?(h.state=Yd,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[d]):+d<t&&(h.state=Yd,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[d])}if(Qk(function(){n.state===qd&&(n.state=ew,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=_0,n.on.call("start",e,e.__data__,n.index,n.group),n.state===_0){for(n.state=qd,i=new Array(p=n.tween.length),d=0,f=-1;d<p;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=h);i.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=C0,1),f=-1,p=i.length;++f<p;)i[f].call(e,d);n.state===C0&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Yd,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Vd(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>_0&&r.state<C0,r.state=Yd,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function cP(e){return this.each(function(){Vd(this,e)})}function uP(e,t){var n,r;return function(){var i=li(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,l=r.length;a<l;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function dP(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=li(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var l={name:t,value:n},c=0,u=i.length;c<u;++c)if(i[c].name===t){i[c]=l;break}c===u&&i.push(l)}s.tween=i}}function fP(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Gr(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?uP:dP)(n,e,t))}function jx(e,t,n){var r=e._id;return e.each(function(){var i=li(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Gr(i,r).value[t]}}function KT(e,t){var n;return(typeof t=="number"?Xr:t instanceof ga?zf:(n=ga(t))?(t=n,zf):PT)(e,t)}function pP(e){return function(){this.removeAttribute(e)}}function hP(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mP(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function gP(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function bP(e,t,n){var r,i,s;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===r&&c===i?s:(i=c,s=t(r=a,l)))}}function xP(e,t,n){var r,i,s;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===r&&c===i?s:(i=c,s=t(r=a,l)))}}function yP(e,t){var n=Ap(e),r=n==="transform"?Qz:KT;return this.attrTween(e,typeof t=="function"?(n.local?xP:bP)(n,r,jx(this,"attr."+e,t)):t==null?(n.local?hP:pP)(n):(n.local?gP:mP)(n,r,t))}function vP(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function kP(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function wP(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&kP(e,s)),n}return i._value=t,i}function SP(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&vP(e,s)),n}return i._value=t,i}function EP(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 r=Ap(e);return this.tween(n,(r.local?wP:SP)(r,t))}function NP(e,t){return function(){Mx(this,e).delay=+t.apply(this,arguments)}}function _P(e,t){return t=+t,function(){Mx(this,e).delay=t}}function CP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?NP:_P)(t,e)):Gr(this.node(),t).delay}function TP(e,t){return function(){li(this,e).duration=+t.apply(this,arguments)}}function AP(e,t){return t=+t,function(){li(this,e).duration=t}}function MP(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?TP:AP)(t,e)):Gr(this.node(),t).duration}function jP(e,t){if(typeof t!="function")throw new Error;return function(){li(this,e).ease=t}}function OP(e){var t=this._id;return arguments.length?this.each(jP(t,e)):Gr(this.node(),t).ease}function RP(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;li(this,e).ease=n}}function DP(e){if(typeof e!="function")throw new Error;return this.each(RP(this._id,e))}function IP(e){typeof e!="function"&&(e=wT(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],c,u=0;u<a;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new Di(r,this._parents,this._name,this._id)}function LP(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=t[l],u=n[l],d=c.length,f=a[l]=new Array(d),p,h=0;h<d;++h)(p=c[h]||u[h])&&(f[h]=p);for(;l<r;++l)a[l]=t[l];return new Di(a,this._parents,this._name,this._id)}function zP(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 PP(e,t,n){var r,i,s=zP(t)?Mx:li;return function(){var a=s(this,e),l=a.on;l!==r&&(i=(r=l).copy()).on(t,n),a.on=i}}function UP(e,t){var n=this._id;return arguments.length<2?Gr(this.node(),n).on.on(e):this.each(PP(n,e,t))}function BP(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function HP(){return this.on("end.remove",BP(this._id))}function FP(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Nx(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var l=r[a],c=l.length,u=s[a]=new Array(c),d,f,p=0;p<c;++p)(d=l[p])&&(f=e.call(d,d.__data__,p,l))&&("__data__"in d&&(f.__data__=d.__data__),u[p]=f,jp(u[p],t,n,p,u,Gr(d,n)));return new Di(s,this._parents,t,n)}function $P(e){var t=this._name,n=this._id;typeof e!="function"&&(e=kT(e));for(var r=this._groups,i=r.length,s=[],a=[],l=0;l<i;++l)for(var c=r[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var p=e.call(d,d.__data__,f,c),h,g=Gr(d,n),k=0,w=p.length;k<w;++k)(h=p[k])&&jp(h,t,n,k,p,g);s.push(p),a.push(d)}return new Di(s,a,t,n)}var GP=pu.prototype.constructor;function KP(){return new GP(this._groups,this._parents)}function qP(e,t){var n,r,i;return function(){var s=zl(this,e),a=(this.style.removeProperty(e),zl(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function qT(e){return function(){this.style.removeProperty(e)}}function YP(e,t,n){var r,i=n+"",s;return function(){var a=zl(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function VP(e,t,n){var r,i,s;return function(){var a=zl(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),zl(this,e))),a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l))}}function XP(e,t){var n,r,i,s="style."+t,a="end."+s,l;return function(){var c=li(this,e),u=c.on,d=c.value[s]==null?l||(l=qT(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(a,i=d),c.on=r}}function WP(e,t,n){var r=(e+="")=="transform"?Zz:KT;return t==null?this.styleTween(e,qP(e,r)).on("end.style."+e,qT(e)):typeof t=="function"?this.styleTween(e,VP(e,r,jx(this,"style."+e,t))).each(XP(this._id,e)):this.styleTween(e,YP(e,r,t),n).on("end.style."+e,null)}function ZP(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function QP(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&ZP(e,a,n)),r}return s._value=t,s}function JP(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,QP(e,t,n??""))}function e9(e){return function(){this.textContent=e}}function t9(e){return function(){var t=e(this);this.textContent=t??""}}function n9(e){return this.tween("text",typeof e=="function"?t9(jx(this,"text",e)):e9(e==null?"":e+""))}function r9(e){return function(t){this.textContent=e.call(this,t)}}function i9(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&r9(i)),t}return r._value=e,r}function s9(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,i9(e))}function a9(){for(var e=this._name,t=this._id,n=YT(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var d=Gr(c,t);jp(c,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Di(r,this._parents,e,n)}function l9(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},c={value:function(){--i===0&&s()}};n.each(function(){var u=li(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),i===0&&s()})}var o9=0;function Di(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function YT(){return++o9}var mi=pu.prototype;Di.prototype={constructor:Di,select:FP,selectAll:$P,selectChild:mi.selectChild,selectChildren:mi.selectChildren,filter:IP,merge:LP,selection:KP,transition:a9,call:mi.call,nodes:mi.nodes,node:mi.node,size:mi.size,empty:mi.empty,each:mi.each,on:UP,attr:yP,attrTween:EP,style:WP,styleTween:JP,text:n9,textTween:s9,remove:HP,tween:fP,delay:CP,duration:MP,ease:OP,easeVarying:DP,end:l9,[Symbol.iterator]:mi[Symbol.iterator]};function c9(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var u9={time:null,delay:0,duration:250,ease:c9};function d9(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 f9(e){var t,n;e instanceof Di?(t=e._id,e=e._name):(t=YT(),(n=u9).time=Ax(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&jp(c,e,t,u,a,n||d9(c,t));return new Di(r,this._parents,e,t)}pu.prototype.interrupt=cP;pu.prototype.transition=f9;const ed=e=>()=>e;function p9(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ei(e,t,n){this.k=e,this.x=t,this.y=n}Ei.prototype={constructor:Ei,scale:function(e){return e===1?this:new Ei(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ei(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 Op=new Ei(1,0,0);VT.prototype=Ei.prototype;function VT(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Op;return e.__zoom}function Yh(e){e.stopImmediatePropagation()}function So(e){e.preventDefault(),e.stopImmediatePropagation()}function h9(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function m9(){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 tw(){return this.__zoom||Op}function g9(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function b9(){return navigator.maxTouchPoints||"ontouchstart"in this}function x9(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function XT(){var e=h9,t=m9,n=x9,r=g9,i=b9,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Kd,u=Tp("start","zoom","end"),d,f,p,h=500,g=150,k=0,w=10;function m(I){I.property("__zoom",tw).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",C).filter(i).on("touchstart.zoom",U).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(I,D,A,M){var P=I.selection?I.selection():I;P.property("__zoom",tw),I!==P?T(I,D,A,M):P.interrupt().each(function(){N(this,arguments).event(M).start().zoom(null,typeof D=="function"?D.apply(this,arguments):D).end()})},m.scaleBy=function(I,D,A,M){m.scaleTo(I,function(){var P=this.__zoom.k,H=typeof D=="function"?D.apply(this,arguments):D;return P*H},A,M)},m.scaleTo=function(I,D,A,M){m.transform(I,function(){var P=t.apply(this,arguments),H=this.__zoom,E=A==null?S(P):typeof A=="function"?A.apply(this,arguments):A,j=H.invert(E),B=typeof D=="function"?D.apply(this,arguments):D;return n(v(b(H,B),E,j),P,a)},A,M)},m.translateBy=function(I,D,A,M){m.transform(I,function(){return n(this.__zoom.translate(typeof D=="function"?D.apply(this,arguments):D,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),a)},null,M)},m.translateTo=function(I,D,A,M,P){m.transform(I,function(){var H=t.apply(this,arguments),E=this.__zoom,j=M==null?S(H):typeof M=="function"?M.apply(this,arguments):M;return n(Op.translate(j[0],j[1]).scale(E.k).translate(typeof D=="function"?-D.apply(this,arguments):-D,typeof A=="function"?-A.apply(this,arguments):-A),H,a)},M,P)};function b(I,D){return D=Math.max(s[0],Math.min(s[1],D)),D===I.k?I:new Ei(D,I.x,I.y)}function v(I,D,A){var M=D[0]-A[0]*I.k,P=D[1]-A[1]*I.k;return M===I.x&&P===I.y?I:new Ei(I.k,M,P)}function S(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function T(I,D,A,M){I.on("start.zoom",function(){N(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(M).end()}).tween("zoom",function(){var P=this,H=arguments,E=N(P,H).event(M),j=t.apply(P,H),B=A==null?S(j):typeof A=="function"?A.apply(P,H):A,O=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),Q=P.__zoom,F=typeof D=="function"?D.apply(P,H):D,J=c(Q.invert(B).concat(O/Q.k),F.invert(B).concat(O/F.k));return function(ce){if(ce===1)ce=F;else{var K=J(ce),q=O/K[2];ce=new Ei(q,B[0]-K[0]*q,B[1]-K[1]*q)}E.zoom(null,ce)}})}function N(I,D,A){return!A&&I.__zooming||new _(I,D)}function _(I,D){this.that=I,this.args=D,this.active=0,this.sourceEvent=null,this.extent=t.apply(I,D),this.taps=0}_.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,D){return this.mouse&&I!=="mouse"&&(this.mouse[1]=D.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=D.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=D.invert(this.touch1[0])),this.that.__zoom=D,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var D=sr(this.that).datum();u.call(I,this.that,new p9(I,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),D)}};function R(I,...D){if(!e.apply(this,arguments))return;var A=N(this,D).event(I),M=this.__zoom,P=Math.max(s[0],Math.min(s[1],M.k*Math.pow(2,r.apply(this,arguments)))),H=Rr(I);if(A.wheel)(A.mouse[0][0]!==H[0]||A.mouse[0][1]!==H[1])&&(A.mouse[1]=M.invert(A.mouse[0]=H)),clearTimeout(A.wheel);else{if(M.k===P)return;A.mouse=[H,M.invert(H)],Vd(this),A.start()}So(I),A.wheel=setTimeout(E,g),A.zoom("mouse",n(v(b(M,P),A.mouse[0],A.mouse[1]),A.extent,a));function E(){A.wheel=null,A.end()}}function L(I,...D){if(p||!e.apply(this,arguments))return;var A=I.currentTarget,M=N(this,D,!0).event(I),P=sr(I.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",O,!0),H=Rr(I,A),E=I.clientX,j=I.clientY;OT(I.view),Yh(I),M.mouse=[H,this.__zoom.invert(H)],Vd(this),M.start();function B(Q){if(So(Q),!M.moved){var F=Q.clientX-E,J=Q.clientY-j;M.moved=F*F+J*J>k}M.event(Q).zoom("mouse",n(v(M.that.__zoom,M.mouse[0]=Rr(Q,A),M.mouse[1]),M.extent,a))}function O(Q){P.on("mousemove.zoom mouseup.zoom",null),RT(Q.view,M.moved),So(Q),M.event(Q).end()}}function C(I,...D){if(e.apply(this,arguments)){var A=this.__zoom,M=Rr(I.changedTouches?I.changedTouches[0]:I,this),P=A.invert(M),H=A.k*(I.shiftKey?.5:2),E=n(v(b(A,H),M,P),t.apply(this,D),a);So(I),l>0?sr(this).transition().duration(l).call(T,E,M,I):sr(this).call(m.transform,E,M,I)}}function U(I,...D){if(e.apply(this,arguments)){var A=I.touches,M=A.length,P=N(this,D,I.changedTouches.length===M).event(I),H,E,j,B;for(Yh(I),E=0;E<M;++E)j=A[E],B=Rr(j,this),B=[B,this.__zoom.invert(B),j.identifier],P.touch0?!P.touch1&&P.touch0[2]!==B[2]&&(P.touch1=B,P.taps=0):(P.touch0=B,H=!0,P.taps=1+!!d);d&&(d=clearTimeout(d)),H&&(P.taps<2&&(f=B[0],d=setTimeout(function(){d=null},h)),Vd(this),P.start())}}function $(I,...D){if(this.__zooming){var A=N(this,D).event(I),M=I.changedTouches,P=M.length,H,E,j,B;for(So(I),H=0;H<P;++H)E=M[H],j=Rr(E,this),A.touch0&&A.touch0[2]===E.identifier?A.touch0[0]=j:A.touch1&&A.touch1[2]===E.identifier&&(A.touch1[0]=j);if(E=A.that.__zoom,A.touch1){var O=A.touch0[0],Q=A.touch0[1],F=A.touch1[0],J=A.touch1[1],ce=(ce=F[0]-O[0])*ce+(ce=F[1]-O[1])*ce,K=(K=J[0]-Q[0])*K+(K=J[1]-Q[1])*K;E=b(E,Math.sqrt(ce/K)),j=[(O[0]+F[0])/2,(O[1]+F[1])/2],B=[(Q[0]+J[0])/2,(Q[1]+J[1])/2]}else if(A.touch0)j=A.touch0[0],B=A.touch0[1];else return;A.zoom("touch",n(v(E,j,B),A.extent,a))}}function G(I,...D){if(this.__zooming){var A=N(this,D).event(I),M=I.changedTouches,P=M.length,H,E;for(Yh(I),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),H=0;H<P;++H)E=M[H],A.touch0&&A.touch0[2]===E.identifier?delete A.touch0:A.touch1&&A.touch1[2]===E.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(E=Rr(E,this),Math.hypot(f[0]-E[0],f[1]-E[1])<w)){var j=sr(this).on("dblclick.zoom");j&&j.apply(this,arguments)}}}return m.wheelDelta=function(I){return arguments.length?(r=typeof I=="function"?I:ed(+I),m):r},m.filter=function(I){return arguments.length?(e=typeof I=="function"?I:ed(!!I),m):e},m.touchable=function(I){return arguments.length?(i=typeof I=="function"?I:ed(!!I),m):i},m.extent=function(I){return arguments.length?(t=typeof I=="function"?I:ed([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),m):t},m.scaleExtent=function(I){return arguments.length?(s[0]=+I[0],s[1]=+I[1],m):[s[0],s[1]]},m.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],m):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},m.constrain=function(I){return arguments.length?(n=I,m):n},m.duration=function(I){return arguments.length?(l=+I,m):l},m.interpolate=function(I){return arguments.length?(c=I,m):c},m.on=function(){var I=u.on.apply(u,arguments);return I===u?m:I},m.clickDistance=function(I){return arguments.length?(k=(I=+I)*I,m):Math.sqrt(k)},m.tapDistance=function(I){return arguments.length?(w=+I,m):w},m}const Br={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:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", 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.`},Ic=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],WT=["Enter"," ","Escape"],ZT={"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 Ul;(function(e){e.Strict="strict",e.Loose="loose"})(Ul||(Ul={}));var ta;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ta||(ta={}));var Lc;(function(e){e.Partial="partial",e.Full="full"})(Lc||(Lc={}));const QT={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ns;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ns||(ns={}));var Bl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Bl||(Bl={}));var Ge;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ge||(Ge={}));const nw={[Ge.Left]:Ge.Right,[Ge.Right]:Ge.Left,[Ge.Top]:Ge.Bottom,[Ge.Bottom]:Ge.Top},JT=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,y9=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ox=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),mu=(e,t=[0,0])=>{const{width:n,height:r}=Kr(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},v9=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const r=e.reduce((i,s)=>{const a=typeof s=="string";let l=!t.nodeLookup&&!a?s:void 0;return t.nodeLookup&&(l=a?t.nodeLookup.get(s):Ox(s)?s:t.nodeLookup.get(s.id)),l?(n=!0,Rp(i,Hf(l,t.nodeOrigin))):i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Dp(r):{x:0,y:0,width:0,height:0}},gu=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Rp(n,Hf(i)),r=!0)}),r?Dp(n):{x:0,y:0,width:0,height:0}},Rx=(e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{const l=(t.x-n)/i,c=(t.y-r)/i,u=t.width/i,d=t.height/i,f=[];for(const p of e.values()){const{measured:h,selectable:g=!0,hidden:k=!1}=p;if(a&&!g||k)continue;const w=h.width??p.width??p.initialWidth??0,m=h.height??p.height??p.initialHeight??0,{x:b,y:v}=p.internals.positionAbsolute,S=r2(l,c,u,d,b,v,w,m),T=w*m,N=s&&S>0;(!p.internals.handleBounds||N||S>=T||p.dragging)&&f.push(p)}return f},k9=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function w9(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let s;if(t!=null&&t.includeHiddenNodes){const{width:a,height:l}=Kr(i);s=a>0&&l>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function S9({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;const l=w9(e,a),c=gu(l),u=Ix(c,t,n,(a==null?void 0:a.minZoom)??i,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await r.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 e2({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){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??r;let f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!l)s==null||s("005",Br.error005());else{const{width:h,height:g}=Kr(l);h&&g&&(f=[[c,u],[c+h,u+g]])}else l&&ya(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const p=ya(f)?xa(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Br.error015())),{position:{x:p.x-c+(a.measured.width??0)*d[0],y:p.y-u+(a.measured.height??0)*d[1]},positionAbsolute:p}}async function E9({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(p=>p.id)),a=[];for(const p of n){if(p.deletable===!1)continue;const h=s.has(p.id),g=!h&&p.parentId&&a.find(k=>k.id===p.parentId);(h||g)&&a.push(p)}const l=new Set(t.map(p=>p.id)),c=r.filter(p=>p.deletable!==!1),d=k9(a,c);for(const p of c)l.has(p.id)&&!d.find(g=>g.id===p.id)&&d.push(p);if(!i)return{edges:d,nodes:a};const f=await i({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Hl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),xa=(e={x:0,y:0},t,n)=>({x:Hl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Hl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function t2(e,t,n){const{width:r,height:i}=Kr(n),{x:s,y:a}=n.internals.positionAbsolute;return xa(e,[[s,a],[s+r,a+i]],t)}const rw=(e,t,n)=>e<t?Hl(Math.abs(e-t),1,t)/t:e>n?-Hl(Math.abs(e-n),1,t)/t:0,Dx=(e,t,n=15,r=40)=>{const i=rw(e.x,r,t.width-r)*n,s=rw(e.y,r,t.height-r)*n;return[i,s]},Rp=(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)}),T0=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Dp=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),zc=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Ox(e)?e.internals.positionAbsolute:mu(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},Hf=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Ox(e)?e.internals.positionAbsolute:mu(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},n2=(e,t)=>Dp(Rp(T0(e),T0(t))),r2=(e,t,n,r,i,s,a,l)=>{const c=Math.max(0,Math.min(e+n,i+a)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,s+l)-Math.max(t,s));return Math.ceil(c*u)},Ff=(e,t)=>r2(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),iw=e=>Lr(e.width)&&Lr(e.height)&&Lr(e.x)&&Lr(e.y),Lr=e=>!isNaN(e)&&isFinite(e),i2=(e,t)=>(n,r)=>{},bu=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),xu=({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return s?bu(l,a):l},Fl=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Pa(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 N9(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Pa(e,n),i=Pa(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Pa(e.top??e.y??0,n),i=Pa(e.bottom??e.y??0,n),s=Pa(e.left??e.x??0,t),a=Pa(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function _9(e,t,n,r,i,s){const{x:a,y:l}=Fl(e,[t,n,r]),{x:c,y:u}=Fl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-c,f=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const Ix=(e,t,n,r,i,s)=>{const a=N9(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=Hl(u,r,i),f=e.x+e.width/2,p=e.y+e.height/2,h=t/2-f*d,g=n/2-p*d,k=_9(e,h,g,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:h-w.left+w.right,y:g-w.top+w.bottom,zoom:d}},Pc=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ya(e){return e!=null&&e!=="parent"}function Kr(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 s2(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 a2(e,t={width:0,height:0},n,r,i){const s={...e},a=r.get(n);if(a){const l=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function sw(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function C9(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function T9(e){return{...ZT,...e||{}}}function l2(e){return e===null?null:e?"valid":"invalid"}function tc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:a}=zr(e),l=xu({x:s-((i==null?void 0:i.left)??0),y:a-((i==null?void 0:i.top)??0)},r),{x:c,y:u}=n?bu(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const Lx=e=>({width:e.offsetWidth,height:e.offsetHeight}),o2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},A9=["INPUT","SELECT","TEXTAREA"];function c2(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:A9.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const u2=e=>"clientX"in e,zr=(e,t)=>{var s,a;const n=u2(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},aw=(e,t,n,r,i)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Lx(a)}})};function d2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:l}){const c=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function td(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function lw({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case Ge.Left:return[t-td(t-r,s),n];case Ge.Right:return[t+td(r-t,s),n];case Ge.Top:return[t,n-td(n-i,s)];case Ge.Bottom:return[t,n+td(i-n,s)]}}function f2({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:i,targetPosition:s=Ge.Top,curvature:a=.25}){const[l,c]=lw({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,d]=lw({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[f,p,h,g]=d2({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${i}`,f,p,h,g]}function p2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,l=r<t?r+a:r-a;return[s,l,i,a]}function M9({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;const a=i&&n?r+1e3:r,l=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+l}function j9({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const s=Rp(Hf(e),Hf(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Ff(a,Dp(s))>0}const O9=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,R9=(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)),D9=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Br.error006()),t;const r=n.getEdgeId||O9;let i;return JT(e)?i={...e}:i={...e,id:r(e)},R9(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function h2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,a,l]=p2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,l]}const ow={[Ge.Left]:{x:-1,y:0},[Ge.Right]:{x:1,y:0},[Ge.Top]:{x:0,y:-1},[Ge.Bottom]:{x:0,y:1}},I9=({source:e,sourcePosition:t=Ge.Bottom,target:n})=>t===Ge.Left||t===Ge.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},cw=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function L9({source:e,sourcePosition:t=Ge.Bottom,target:n,targetPosition:r=Ge.Top,center:i,offset:s,stepPosition:a}){const l=ow[t],c=ow[r],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=I9({source:u,sourcePosition:t,target:d}),p=f.x!==0?"x":"y",h=f[p];let g=[],k,w;const m={x:0,y:0},b={x:0,y:0},[,,v,S]=p2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*c[p]===-1){p==="x"?(k=i.x??u.x+(d.x-u.x)*a,w=i.y??(u.y+d.y)/2):(k=i.x??(u.x+d.x)/2,w=i.y??u.y+(d.y-u.y)*a);const R=[{x:k,y:u.y},{x:k,y:d.y}],L=[{x:u.x,y:w},{x:d.x,y:w}];l[p]===h?g=p==="x"?R:L:g=p==="x"?L:R}else{const R=[{x:u.x,y:d.y}],L=[{x:d.x,y:u.y}];if(p==="x"?g=l.x===h?L:R:g=l.y===h?R:L,t===r){const I=Math.abs(e[p]-n[p]);if(I<=s){const D=Math.min(s-1,s-I);l[p]===h?m[p]=(u[p]>e[p]?-1:1)*D:b[p]=(d[p]>n[p]?-1:1)*D}}if(t!==r){const I=p==="x"?"y":"x",D=l[p]===c[I],A=u[I]>d[I],M=u[I]<d[I];(l[p]===1&&(!D&&A||D&&M)||l[p]!==1&&(!D&&M||D&&A))&&(g=p==="x"?R:L)}const C={x:u.x+m.x,y:u.y+m.y},U={x:d.x+b.x,y:d.y+b.y},$=Math.max(Math.abs(C.x-g[0].x),Math.abs(U.x-g[0].x)),G=Math.max(Math.abs(C.y-g[0].y),Math.abs(U.y-g[0].y));$>=G?(k=(C.x+U.x)/2,w=g[0].y):(k=g[0].x,w=(C.y+U.y)/2)}const T={x:u.x+m.x,y:u.y+m.y},N={x:d.x+b.x,y:d.y+b.y};return[[e,...T.x!==g[0].x||T.y!==g[0].y?[T]:[],...g,...N.x!==g[g.length-1].x||N.y!==g[g.length-1].y?[N]:[],n],k,w,v,S]}function z9(e,t,n,r){const i=Math.min(cw(e,t)/2,cw(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*d}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${s},${a+i*c}Q ${s},${a} ${s+i*l},${a}`}function A0({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:i,targetPosition:s=Ge.Top,borderRadius:a=5,centerX:l,centerY:c,offset:u=20,stepPosition:d=.5}){const[f,p,h,g,k]=L9({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:l,y:c},offset:u,stepPosition:d});let w=`M${f[0].x} ${f[0].y}`;for(let m=1;m<f.length-1;m++)w+=z9(f[m-1],f[m],f[m+1],a);return w+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[w,p,h,g,k]}function uw(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function P9(e){var f;const{sourceNode:t,targetNode:n}=e;if(!uw(t)||!uw(n))return null;const r=t.internals.handleBounds||dw(t.handles),i=n.internals.handleBounds||dw(n.handles),s=fw((r==null?void 0:r.source)??[],e.sourceHandle),a=fw(e.connectionMode===Ul.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!s||!a)return(f=e.onError)==null||f.call(e,"008",Br.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(s==null?void 0:s.position)||Ge.Bottom,c=(a==null?void 0:a.position)||Ge.Top,u=va(t,s,l),d=va(n,a,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}function dw(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function va(e,t,n=Ge.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??Kr(e);if(r)return{x:i+a/2,y:s+l/2};switch((t==null?void 0:t.position)??n){case Ge.Top:return{x:i+a/2,y:s};case Ge.Right:return{x:i+a,y:s+l/2};case Ge.Bottom:return{x:i+a/2,y:s+l};case Ge.Left:return{x:i,y:s+l/2}}}function fw(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function M0(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function U9(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const u=M0(c,t);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const m2=1e3,B9=10,zx={nodeOrigin:[0,0],nodeExtent:Ic,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},H9={...zx,checkEquality:!0};function Px(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function F9(e,t,n){const r=Px(zx,n);for(const i of e.values())if(i.parentId)Bx(i,e,t,r);else{const s=mu(i,r.nodeOrigin),a=ya(i.extent)?i.extent:r.nodeExtent,l=xa(s,a,Kr(i));i.internals.positionAbsolute=l}}function $9(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}function Ux(e){return e==="manual"}function j0(e,t,n,r={}){var d,f;const i=Px(H9,r),s={i:0},a=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!Ux(i.zIndexMode)?m2:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const p of e){let h=a.get(p.id);if(i.checkEquality&&p===(h==null?void 0:h.internals.userNode))t.set(p.id,h);else{const g=mu(p,i.nodeOrigin),k=ya(p.extent)?p.extent:i.nodeExtent,w=xa(g,k,Kr(p));h={...i.defaults,...p,measured:{width:(d=p.measured)==null?void 0:d.width,height:(f=p.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:$9(p,h),z:g2(p,l,i.zIndexMode),userNode:p}},t.set(p.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(c=!1),p.parentId&&Bx(h,t,n,r,s),u||(u=p.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function G9(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 Bx(e,t,n,r,i){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=Px(zx,r),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}G9(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*B9),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);const f=s&&!Ux(c)?m2:0,{x:p,y:h,z:g}=K9(e,d,a,l,f,c),{positionAbsolute:k}=e.internals,w=p!==k.x||h!==k.y;(w||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:p,y:h}:k,z:g}})}function g2(e,t,n){const r=Lr(e.zIndex)?e.zIndex:0;return Ux(n)?r:r+(e.selected?t:0)}function K9(e,t,n,r,i,s){const{x:a,y:l}=t.internals.positionAbsolute,c=Kr(e),u=mu(e,n),d=ya(e.extent)?xa(u,e.extent,c):u;let f=xa({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=t2(f,c,t));const p=g2(e,i,s),h=t.internals.z??0;return{x:f.x,y:f.y,z:h>=p?h+1:p}}function Hx(e,t,n,r=[0,0]){var a;const i=[],s=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=s.get(l.parentId))==null?void 0:a.expandedRect)??zc(c),d=n2(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var v;const d=c.internals.positionAbsolute,f=Kr(c),p=c.origin??r,h=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,g=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)),m=(k-f.width)*p[0],b=(w-f.height)*p[1];(h>0||g>0||m||b)&&(i.push({id:u,type:"position",position:{x:c.position.x-h+m,y:c.position.y-g+b}}),(v=n.get(u))==null||v.forEach(S=>{e.some(T=>T.id===S.id)||i.push({id:S.id,type:"position",position:{x:S.position.x+h,y:S.position.y+g}})})),(f.width<l.width||f.height<l.height||h||g)&&i.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:k+(h?p[0]*h-m:0),height:w+(g?p[1]*g-b:0)}})}),i}function q9(e,t,n,r,i,s,a){const l=r==null?void 0:r.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),p=[];for(const h of e.values()){const g=t.get(h.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),c=!0;continue}const k=Lx(h.nodeElement),w=g.measured.width!==k.width||g.measured.height!==k.height;if(!!(k.width&&k.height&&(w||!g.internals.handleBounds||h.force))){const b=h.nodeElement.getBoundingClientRect(),v=ya(g.extent)?g.extent:s;let{positionAbsolute:S}=g.internals;if(g.parentId&&g.extent==="parent"){const N=t.get(g.parentId);N&&(S=t2(S,k,N))}else v&&(S=xa(S,v,k));const T={...g,measured:k,internals:{...g.internals,positionAbsolute:S,handleBounds:{source:aw("source",h.nodeElement,b,f,g.id),target:aw("target",h.nodeElement,b,f,g.id)}}};t.set(g.id,T),g.parentId&&Bx(T,t,n,{nodeOrigin:i,zIndexMode:a}),c=!0,w&&(u.push({id:g.id,type:"dimensions",dimensions:k}),g.expandParent&&g.parentId&&p.push({id:g.id,parentId:g.parentId,rect:zc(T,i)}))}}if(p.length>0){const h=Hx(p,t,n,i);u.push(...h)}return{changes:u,updatedInternals:c}}async function Y9({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){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],[i,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function pw(e,t,n,r,i,s){let a=i;const l=r.get(a)||new Map;r.set(a,l.set(n,t)),a=`${i}-${e}`;const c=r.get(a)||new Map;if(r.set(a,c.set(n,t)),s){a=`${i}-${e}-${s}`;const u=r.get(a)||new Map;r.set(a,u.set(n,t))}}function b2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:l},u=`${i}-${a}--${s}-${l}`,d=`${s}-${l}--${i}-${a}`;pw("source",c,d,e,i,a),pw("target",c,u,e,s,l),t.set(r.id,r)}}function x2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:x2(n,t):!1}function hw(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function V9(e,t,n,r){const i=new Map;for(const[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!x2(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(s);l&&i.set(s,{id:s,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 i}function Vh({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,l,c;const i=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&i.push({...f,position:d.position,dragging:r})}if(!e)return[i[0],i];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((c=t.get(e))==null?void 0:c.position)||s.position,dragging:r}:i[0],i]}function X9({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},a=bu(s,t);return{x:a.x-s.x,y:a.y-s.y}}function W9({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,p=null,h=!1,g=!1,k=null;function w({noDragClassName:b,handleSelector:v,domNode:S,isSelectable:T,nodeId:N,nodeClickDistance:_=0}){p=sr(S);function R({x:$,y:G}){const{nodeLookup:I,nodeExtent:D,snapGrid:A,snapToGrid:M,nodeOrigin:P,onNodeDrag:H,onSelectionDrag:E,onError:j,updateNodePositions:B}=t();s={x:$,y:G};let O=!1;const Q=l.size>1,F=Q&&D?T0(gu(l)):null,J=Q&&M?X9({dragItems:l,snapGrid:A,x:$,y:G}):null;for(const[ce,K]of l){if(!I.has(ce))continue;let q={x:$-K.distance.x,y:G-K.distance.y};M&&(q=J?{x:Math.round(q.x+J.x),y:Math.round(q.y+J.y)}:bu(q,A));let V=null;if(Q&&D&&!K.extent&&F){const{positionAbsolute:Ne}=K.internals,Te=Ne.x-F.x+D[0][0],ne=Ne.x+K.measured.width-F.x2+D[1][0],pe=Ne.y-F.y+D[0][1],le=Ne.y+K.measured.height-F.y2+D[1][1];V=[[Te,pe],[ne,le]]}const{position:ue,positionAbsolute:me}=e2({nodeId:ce,nextPosition:q,nodeLookup:I,nodeExtent:V||D,nodeOrigin:P,onError:j});O=O||K.position.x!==ue.x||K.position.y!==ue.y,K.position=ue,K.internals.positionAbsolute=me}if(g=g||O,!!O&&(B(l,!0),k&&(r||H||!N&&E))){const[ce,K]=Vh({nodeId:N,dragItems:l,nodeLookup:I});r==null||r(k,l,ce,K),H==null||H(k,ce,K),N||E==null||E(k,K)}}async function L(){if(!d)return;const{transform:$,panBy:G,autoPanSpeed:I,autoPanOnNodeDrag:D}=t();if(!D){c=!1,cancelAnimationFrame(a);return}const[A,M]=Dx(u,d,I);(A!==0||M!==0)&&(s.x=(s.x??0)-A/$[2],s.y=(s.y??0)-M/$[2],await G({x:A,y:M})&&R(s)),a=requestAnimationFrame(L)}function C($){var Q;const{nodeLookup:G,multiSelectionActive:I,nodesDraggable:D,transform:A,snapGrid:M,snapToGrid:P,selectNodesOnDrag:H,onNodeDragStart:E,onSelectionDragStart:j,unselectNodesAndEdges:B}=t();f=!0,(!H||!T)&&!I&&N&&((Q=G.get(N))!=null&&Q.selected||B()),T&&H&&N&&(e==null||e(N));const O=tc($.sourceEvent,{transform:A,snapGrid:M,snapToGrid:P,containerBounds:d});if(s=O,l=V9(G,D,O,N),l.size>0&&(n||E||!N&&j)){const[F,J]=Vh({nodeId:N,dragItems:l,nodeLookup:G});n==null||n($.sourceEvent,l,F,J),E==null||E($.sourceEvent,F,J),N||j==null||j($.sourceEvent,J)}}const U=DT().clickDistance(_).on("start",$=>{const{domNode:G,nodeDragThreshold:I,transform:D,snapGrid:A,snapToGrid:M}=t();d=(G==null?void 0:G.getBoundingClientRect())||null,h=!1,g=!1,k=$.sourceEvent,I===0&&C($),s=tc($.sourceEvent,{transform:D,snapGrid:A,snapToGrid:M,containerBounds:d}),u=zr($.sourceEvent,d)}).on("drag",$=>{const{autoPanOnNodeDrag:G,transform:I,snapGrid:D,snapToGrid:A,nodeDragThreshold:M,nodeLookup:P}=t(),H=tc($.sourceEvent,{transform:I,snapGrid:D,snapToGrid:A,containerBounds:d});if(k=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||N&&!P.has(N))&&(h=!0),!h){if(!c&&G&&f&&(c=!0,L()),!f){const E=zr($.sourceEvent,d),j=E.x-u.x,B=E.y-u.y;Math.sqrt(j*j+B*B)>M&&C($)}(s.x!==H.xSnapped||s.y!==H.ySnapped)&&l&&f&&(u=zr($.sourceEvent,d),R(H))}}).on("end",$=>{if(!f||h){h&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:G,updateNodePositions:I,onNodeDragStop:D,onSelectionDragStop:A}=t();if(g&&(I(l,!1),g=!1),i||D||!N&&A){const[M,P]=Vh({nodeId:N,dragItems:l,nodeLookup:G,dragging:!1});i==null||i($.sourceEvent,l,M,P),D==null||D($.sourceEvent,M,P),N||A==null||A($.sourceEvent,P)}}}).filter($=>{const G=$.target;return!$.button&&(!b||!hw(G,`.${b}`,S))&&(!v||hw(G,v,S))});p.call(U)}function m(){p==null||p.on(".drag",null)}return{update:w,destroy:m}}function Z9(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())Ff(i,zc(s))>0&&r.push(s);return r}const Q9=250;function J9(e,t,n,r){var l,c;let i=[],s=1/0;const a=Z9(e,n,t+Q9);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(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:p,y:h}=va(u,f,f.position,!0),g=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(h-e.y,2));g>t||(g<s?(i=[{...f,x:p,y:h}],s=g):g===s&&i.push({...f,x:p,y:h}))}}if(!i.length)return null;if(i.length>1){const u=r.type==="source"?"target":"source";return i.find(d=>d.type===u)??i[0]}return i[0]}function y2(e,t,n,r,i,s=!1){var u,d,f;const a=r.get(e);if(!a)return null;const l=i==="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(p=>p.id===n):l==null?void 0:l[0])??null;return c&&s?{...c,...va(a,c,c.position,!0)}:c}function v2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function e8(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const k2=()=>!0;function t8(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:p,cancelConnection:h,onConnectStart:g,onConnect:k,onConnectEnd:w,isValidConnection:m=k2,onReconnectEnd:b,updateConnection:v,getTransform:S,getFromHandle:T,autoPanSpeed:N,dragThreshold:_=1,handleDomNode:R}){const L=o2(e.target);let C=0,U;const{x:$,y:G}=zr(e),I=v2(s,R),D=l==null?void 0:l.getBoundingClientRect();let A=!1;if(!D||!I)return;const M=y2(i,I,r,c,t);if(!M)return;let P=zr(e,D),H=!1,E=null,j=!1,B=null;function O(){if(!d||!D)return;const[ue,me]=Dx(P,D,N);p({x:ue,y:me}),C=requestAnimationFrame(O)}const Q={...M,nodeId:i,type:I,position:M.position},F=c.get(i);let ce={inProgress:!0,isValid:null,from:va(F,Q,Ge.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:F,to:P,toHandle:null,toPosition:nw[Q.position],toNode:null,pointer:P};function K(){A=!0,v(ce),g==null||g(e,{nodeId:i,handleId:r,handleType:I})}_===0&&K();function q(ue){if(!A){const{x:le,y:de}=zr(ue),Ke=le-$,He=de-G;if(!(Ke*Ke+He*He>_*_))return;K()}if(!T()||!Q){V(ue);return}const me=S();P=zr(ue,D),U=J9(xu(P,me,!1,[1,1]),n,c,Q),H||(O(),H=!0);const Ne=w2(ue,{handle:U,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:m,doc:L,lib:u,flowId:f,nodeLookup:c});B=Ne.handleDomNode,E=Ne.connection,j=e8(!!U,Ne.isValid);const Te=c.get(i),ne=Te?va(Te,Q,Ge.Left,!0):ce.from,pe={...ce,from:ne,isValid:j,to:Ne.toHandle&&j?Fl({x:Ne.toHandle.x,y:Ne.toHandle.y},me):P,toHandle:Ne.toHandle,toPosition:j&&Ne.toHandle?Ne.toHandle.position:nw[Q.position],toNode:Ne.toHandle?c.get(Ne.toHandle.nodeId):null,pointer:P};v(pe),ce=pe}function V(ue){if(!("touches"in ue&&ue.touches.length>0)){if(A){(U||B)&&E&&j&&(k==null||k(E));const{inProgress:me,...Ne}=ce,Te={...Ne,toPosition:ce.toHandle?ce.toPosition:null};w==null||w(ue,Te),s&&(b==null||b(ue,Te))}h(),cancelAnimationFrame(C),H=!1,j=!1,E=null,B=null,L.removeEventListener("mousemove",q),L.removeEventListener("mouseup",V),L.removeEventListener("touchmove",q),L.removeEventListener("touchend",V)}}L.addEventListener("mousemove",q),L.addEventListener("mouseup",V),L.addEventListener("touchmove",q),L.addEventListener("touchend",V)}function w2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=k2,nodeLookup:d}){const f=s==="target",p=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:h,y:g}=zr(e),k=a.elementFromPoint(h,g),w=k!=null&&k.classList.contains(`${l}-flow__handle`)?k:p,m={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const b=v2(void 0,w),v=w.getAttribute("data-nodeid"),S=w.getAttribute("data-handleid"),T=w.classList.contains("connectable"),N=w.classList.contains("connectableend");if(!v||!b)return m;const _={source:f?v:r,sourceHandle:f?S:i,target:f?r:v,targetHandle:f?i:S};m.connection=_;const L=T&&N&&(n===Ul.Strict?f&&b==="source"||!f&&b==="target":v!==r||S!==i);m.isValid=L&&u(_),m.toHandle=y2(v,b,S,d,n,!0)}return m}const O0={onPointerDown:t8,isValid:w2};function n8({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=sr(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:p=!0,inversePan:h=!1}){const g=v=>{if(v.sourceEvent.type!=="wheel"||!t)return;const S=n(),T=v.sourceEvent.ctrlKey&&Pc()?10:1,N=-v.sourceEvent.deltaY*(v.sourceEvent.deltaMode===1?.05:v.sourceEvent.deltaMode?1:.002)*d,_=S[2]*Math.pow(2,N*T);t.scaleTo(_)};let k=[0,0];const w=v=>{(v.sourceEvent.type==="mousedown"||v.sourceEvent.type==="touchstart")&&(k=[v.sourceEvent.clientX??v.sourceEvent.touches[0].clientX,v.sourceEvent.clientY??v.sourceEvent.touches[0].clientY])},m=v=>{const S=n();if(v.sourceEvent.type!=="mousemove"&&v.sourceEvent.type!=="touchmove"||!t)return;const T=[v.sourceEvent.clientX??v.sourceEvent.touches[0].clientX,v.sourceEvent.clientY??v.sourceEvent.touches[0].clientY],N=[T[0]-k[0],T[1]-k[1]];k=T;const _=r()*Math.max(S[2],Math.log(S[2]))*(h?-1:1),R={x:S[0]-N[0]*_,y:S[1]-N[1]*_},L=[[0,0],[c,u]];t.setViewportConstrained({x:R.x,y:R.y,zoom:S[2]},L,l)},b=XT().on("start",w).on("zoom",f?m:null).on("zoom.wheel",p?g:null);i.call(b,{})}function a(){i.on("zoom",null)}return{update:s,destroy:a,pointer:Rr}}const Ip=e=>({x:e.x,y:e.y,zoom:e.k}),Xh=({x:e,y:t,zoom:n})=>Op.translate(e,t).scale(n),Zi=(e,t)=>e.target.closest(`.${t}`),S2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),r8=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Wh=(e,t=0,n=r8,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},E2=e=>{const t=e.ctrlKey&&Pc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function i8({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Zi(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=Rr(d),m=E2(d),b=f*Math.pow(2,m);r.scaleTo(n,b,w,d);return}const p=d.deltaMode===1?20:1;let h=i===ta.Vertical?0:d.deltaX*p,g=i===ta.Horizontal?0:d.deltaY*p;!Pc()&&d.shiftKey&&i!==ta.Vertical&&(h=d.deltaY*p,g=0),r.translateBy(n,-(h/f)*s,-(g/f)*s,{internal:!0});const k=Ip(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 s8({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,l=Zi(r,e);if(r.ctrlKey&&s&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,i)}}function a8({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,a,l;if((s=r.sourceEvent)!=null&&s.internal)return;const i=Ip(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function l8({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var a,l;e.usedRightMouseButton=!!(n&&S2(t,e.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((l=s.sourceEvent)!=null&&l.internal)&&(i==null||i(s.sourceEvent,Ip(s.transform)))}}function o8({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&S2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=Ip(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(a.sourceEvent,c)},n?150:0)}}}function c8({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:u,lib:d,connectionInProgress:f}){return p=>{var m;const h=t||n,g=r&&p.ctrlKey,k=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Zi(p,`${d}-flow__node`)||Zi(p,`${d}-flow__edge`)||Zi(p,`${d}-flow__selection`)||Zi(p,`${d}-flow__nodesselection`)))return!0;if(!i&&!h&&!s&&!a&&!r||l||f&&!k||Zi(p,c)&&k||Zi(p,u)&&(!k||s&&k&&!t)||!r&&p.ctrlKey&&k)return!1;if(!r&&p.type==="touchstart"&&((m=p.touches)==null?void 0:m.length)>1)return p.preventDefault(),!1;if(!h&&!s&&!g&&k||!i&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(i)&&!i.includes(p.button)&&p.type==="mousedown")return!1;const w=Array.isArray(i)&&i.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||k||e)&&w}}function u8({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,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 p=typeof ResizeObserver<"u"?new ResizeObserver(G=>{const I=G[0];I&&(f=[[0,0],[I.contentRect.width,I.contentRect.height]])}):null;p==null||p.observe(e);const h=XT().extent(()=>f).scaleExtent([t,n]).translateExtent(r),g=sr(e).call(h);S({x:i.x,y:i.y,zoom:Hl(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);const k=g.on("wheel.zoom"),w=g.on("dblclick.zoom");h.wheelDelta(E2);async function m(G,I){return g?new Promise(D=>{h==null||h.interpolate((I==null?void 0:I.interpolate)==="linear"?ec:Kd).transform(Wh(g,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>D(!0)),G)}):!1}function b({noWheelClassName:G,noPanClassName:I,onPaneContextMenu:D,userSelectionActive:A,panOnScroll:M,panOnDrag:P,panOnScrollMode:H,panOnScrollSpeed:E,preventScrolling:j,zoomOnPinch:B,zoomOnScroll:O,zoomOnDoubleClick:Q,panActivationKeyPressed:F=!1,zoomActivationKeyPressed:J,lib:ce,onTransformChange:K,connectionInProgress:q,paneClickDistance:V,selectionOnDrag:ue}){A&&!u.isZoomingOrPanning&&v();const me=M&&!J&&!A;h.clickDistance(ue?1/0:!Lr(V)||V<0?0:V);const Ne=me?i8({zoomPanValues:u,noWheelClassName:G,d3Selection:g,d3Zoom:h,panOnScrollMode:H,panOnScrollSpeed:E,zoomOnPinch:B,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):s8({noWheelClassName:G,preventScrolling:j,d3ZoomHandler:k});g.on("wheel.zoom",Ne,{passive:!1});const Te=a8({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});h.on("start",Te);const ne=l8({zoomPanValues:u,panOnDrag:P,onPaneContextMenu:!!D,onPanZoom:s,onTransformChange:K});h.on("zoom",ne);const pe=o8({zoomPanValues:u,panOnDrag:P,panOnScroll:M,onPaneContextMenu:D,onPanZoomEnd:l,onDraggingChange:c});h.on("end",pe);const le=c8({panActivationKeyPressed:F,zoomActivationKeyPressed:J,panOnDrag:P,zoomOnScroll:O,panOnScroll:M,zoomOnDoubleClick:Q,zoomOnPinch:B,userSelectionActive:A,noPanClassName:I,noWheelClassName:G,lib:ce,connectionInProgress:q});h.filter(le),Q?g.on("dblclick.zoom",w):g.on("dblclick.zoom",null)}function v(){h.on("zoom",null)}async function S(G,I,D){const A=Xh(G),M=h==null?void 0:h.constrain()(A,I,D);return M&&await m(M),M}async function T(G,I){const D=Xh(G);return await m(D,I),D}function N(G){if(g){const I=Xh(G),D=g.property("__zoom");(D.k!==G.zoom||D.x!==G.x||D.y!==G.y)&&(h==null||h.transform(g,I,null,{sync:!0}))}}function _(){const G=g?VT(g.node()):{x:0,y:0,k:1};return{x:G.x,y:G.y,zoom:G.k}}async function R(G,I){return g?new Promise(D=>{h==null||h.interpolate((I==null?void 0:I.interpolate)==="linear"?ec:Kd).scaleTo(Wh(g,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>D(!0)),G)}):!1}async function L(G,I){return g?new Promise(D=>{h==null||h.interpolate((I==null?void 0:I.interpolate)==="linear"?ec:Kd).scaleBy(Wh(g,I==null?void 0:I.duration,I==null?void 0:I.ease,()=>D(!0)),G)}):!1}function C(G){h==null||h.scaleExtent(G)}function U(G){h==null||h.translateExtent(G)}function $(G){const I=!Lr(G)||G<0?0:G;h==null||h.clickDistance(I)}return{update:b,destroy:v,setViewport:T,setViewportConstrained:S,getViewport:_,scaleTo:R,scaleBy:L,setScaleExtent:C,setTranslateExtent:U,syncViewport:N,setClickDistance:$}}var $l;(function(e){e.Line="line",e.Handle="handle"})($l||($l={}));function d8({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){const a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}function mw(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function Fi(e,t){return Math.max(0,t-e)}function $i(e,t){return Math.max(0,e-t)}function nd(e,t,n){return Math.max(0,t-e,e-n)}function gw(e,t){return e?!t:t}function f8(e,t,n,r,i,s,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,p=d&&f,{xSnapped:h,ySnapped:g}=n,{minWidth:k,maxWidth:w,minHeight:m,maxHeight:b}=r,{x:v,y:S,width:T,height:N,aspectRatio:_}=e;let R=Math.floor(d?h-e.pointerX:0),L=Math.floor(f?g-e.pointerY:0);const C=T+(c?-R:R),U=N+(u?-L:L),$=-s[0]*T,G=-s[1]*N;let I=nd(C,k,w),D=nd(U,m,b);if(a){let P=0,H=0;c&&R<0?P=Fi(v+R+$,a[0][0]):!c&&R>0&&(P=$i(v+C+$,a[1][0])),u&&L<0?H=Fi(S+L+G,a[0][1]):!u&&L>0&&(H=$i(S+U+G,a[1][1])),I=Math.max(I,P),D=Math.max(D,H)}if(l){let P=0,H=0;c&&R>0?P=$i(v+R,l[0][0]):!c&&R<0&&(P=Fi(v+C,l[1][0])),u&&L>0?H=$i(S+L,l[0][1]):!u&&L<0&&(H=Fi(S+U,l[1][1])),I=Math.max(I,P),D=Math.max(D,H)}if(i){if(d){const P=nd(C/_,m,b)*_;if(I=Math.max(I,P),a){let H=0;!c&&!u||c&&!u&&p?H=$i(S+G+C/_,a[1][1])*_:H=Fi(S+G+(c?R:-R)/_,a[0][1])*_,I=Math.max(I,H)}if(l){let H=0;!c&&!u||c&&!u&&p?H=Fi(S+C/_,l[1][1])*_:H=$i(S+(c?R:-R)/_,l[0][1])*_,I=Math.max(I,H)}}if(f){const P=nd(U*_,k,w)/_;if(D=Math.max(D,P),a){let H=0;!c&&!u||u&&!c&&p?H=$i(v+U*_+$,a[1][0])/_:H=Fi(v+(u?L:-L)*_+$,a[0][0])/_,D=Math.max(D,H)}if(l){let H=0;!c&&!u||u&&!c&&p?H=Fi(v+U*_,l[1][0])/_:H=$i(v+(u?L:-L)*_,l[0][0])/_,D=Math.max(D,H)}}}L=L+(L<0?D:-D),R=R+(R<0?I:-I),i&&(p?C>U*_?L=(gw(c,u)?-R:R)/_:R=(gw(c,u)?-L:L)*_:d?(L=R/_,u=c):(R=L*_,c=u));const A=c?v+R:v,M=u?S+L:S;return{width:T+(c?-R:R),height:N+(u?-L:L),x:s[0]*R*(c?-1:1)+A,y:s[1]*L*(u?-1:1)+M}}const N2={width:0,height:0,x:0,y:0},p8={...N2,pointerX:0,pointerY:0,aspectRatio:1};function h8(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,l=n[0]*s,c=n[1]*a;return[[r-l,i-c],[r+s-l,i+a-c]]}function m8({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=sr(e);let a={controlDirection:mw("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:p,onResizeStart:h,onResize:g,onResizeEnd:k,shouldResize:w}){let m={...N2},b={...p8};a={boundaries:d,resizeDirection:p,keepAspectRatio:f,controlDirection:mw(u)};let v,S=null,T=[],N,_,R;const L=DT().on("start",C=>{const{nodeLookup:U,transform:$,snapGrid:G,snapToGrid:I,nodeOrigin:D,paneDomNode:A}=n();if(v=U.get(t),!v)return;S=(A==null?void 0:A.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:P}=tc(C.sourceEvent,{transform:$,snapGrid:G,snapToGrid:I,containerBounds:S});m={width:v.measured.width??0,height:v.measured.height??0,x:v.position.x??0,y:v.position.y??0},b={...m,pointerX:M,pointerY:P,aspectRatio:m.width/m.height},N=void 0,_=ya(v.extent)?v.extent:void 0,v.parentId&&(v.extent==="parent"||v.expandParent)&&(N=U.get(v.parentId)),N&&v.extent==="parent"&&(_=[[0,0],[N.measured.width,N.measured.height]]),T=[],R=void 0;for(const[H,E]of U)if(E.parentId===t&&(T.push({id:H,position:{...E.position},extent:E.extent}),E.extent==="parent"||E.expandParent)){const j=h8(E,v,E.origin??D);R?R=[[Math.min(j[0][0],R[0][0]),Math.min(j[0][1],R[0][1])],[Math.max(j[1][0],R[1][0]),Math.max(j[1][1],R[1][1])]]:R=j}h==null||h(C,{...m})}).on("drag",C=>{const{transform:U,snapGrid:$,snapToGrid:G,nodeOrigin:I}=n(),D=tc(C.sourceEvent,{transform:U,snapGrid:$,snapToGrid:G,containerBounds:S}),A=[];if(!v)return;const{x:M,y:P,width:H,height:E}=m,j={},B=v.origin??I,{width:O,height:Q,x:F,y:J}=f8(b,a.controlDirection,D,a.boundaries,a.keepAspectRatio,B,_,R),ce=O!==H,K=Q!==E,q=F!==M&&ce,V=J!==P&&K;if(!q&&!V&&!ce&&!K)return;const ue={prevValues:{...m},startX:b.x,startY:b.y,childNodes:T.map(ne=>({...ne,position:{...ne.position}}))};if((q||V||B[0]===1||B[1]===1)&&(j.x=q?F:m.x,j.y=V?J:m.y,m.x=j.x,m.y=j.y,T.length>0)){const ne=F-M,pe=J-P;for(const le of T)le.position={x:le.position.x-ne+B[0]*(O-H),y:le.position.y-pe+B[1]*(Q-E)},A.push(le)}if((ce||K)&&(j.width=ce&&(!a.resizeDirection||a.resizeDirection==="horizontal")?O:m.width,j.height=K&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:m.height,m.width=j.width,m.height=j.height),N&&v.expandParent){const ne=B[0]*(j.width??0);j.x&&j.x<ne&&(m.x=ne,b.x=b.x-(j.x-ne));const pe=B[1]*(j.height??0);j.y&&j.y<pe&&(m.y=pe,b.y=b.y-(j.y-pe))}const me=d8({width:m.width,prevWidth:H,height:m.height,prevHeight:E,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),Ne={...m,direction:me};if((w==null?void 0:w(C,Ne))===!1){m=ue.prevValues,b.x=ue.startX,b.y=ue.startY,T.forEach((ne,pe)=>{ne.position=ue.childNodes[pe].position});return}g==null||g(C,Ne),r(j,A)}).on("end",C=>{k==null||k(C,{...m}),i==null||i({...m})});s.call(L)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}var _2={exports:{}},C2={},T2={exports:{}},A2={};/**
462
- * @license React
463
- * use-sync-external-store-shim.production.min.js
464
- *
465
- * Copyright (c) Facebook, Inc. and its affiliates.
466
- *
467
- * This source code is licensed under the MIT license found in the
468
- * LICENSE file in the root directory of this source tree.
469
- */var Gl=y;function g8(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var b8=typeof Object.is=="function"?Object.is:g8,x8=Gl.useState,y8=Gl.useEffect,v8=Gl.useLayoutEffect,k8=Gl.useDebugValue;function w8(e,t){var n=t(),r=x8({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return v8(function(){i.value=n,i.getSnapshot=t,Zh(i)&&s({inst:i})},[e,n,t]),y8(function(){return Zh(i)&&s({inst:i}),e(function(){Zh(i)&&s({inst:i})})},[e]),k8(n),n}function Zh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!b8(e,n)}catch{return!0}}function S8(e,t){return t()}var E8=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?S8:w8;A2.useSyncExternalStore=Gl.useSyncExternalStore!==void 0?Gl.useSyncExternalStore:E8;T2.exports=A2;var N8=T2.exports;/**
470
- * @license React
471
- * use-sync-external-store-shim/with-selector.production.min.js
472
- *
473
- * Copyright (c) Facebook, Inc. and its affiliates.
474
- *
475
- * This source code is licensed under the MIT license found in the
476
- * LICENSE file in the root directory of this source tree.
477
- */var Lp=y,_8=N8;function C8(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var T8=typeof Object.is=="function"?Object.is:C8,A8=_8.useSyncExternalStore,M8=Lp.useRef,j8=Lp.useEffect,O8=Lp.useMemo,R8=Lp.useDebugValue;C2.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=M8(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=O8(function(){function c(h){if(!u){if(u=!0,d=h,h=r(h),i!==void 0&&a.hasValue){var g=a.value;if(i(g,h))return f=g}return f=h}if(g=f,T8(d,h))return g;var k=r(h);return i!==void 0&&i(g,k)?g:(d=h,f=k)}var u=!1,d,f,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,r,i]);var l=A8(e,s[0],s[1]);return j8(function(){a.hasValue=!0,a.value=l},[l]),R8(l),l};_2.exports=C2;var D8=_2.exports;const I8=$c(D8),L8={},bw=e=>{let t;const n=new Set,r=(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(p=>p(t,f))}},i=()=>t,l={setState:r,getState:i,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(L8?"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(r,i,l),l},z8=e=>e?bw(e):bw,{useSyncExternalStoreWithSelector:P8}=I8;function M2(e,t=e.getState,n){const r=P8(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return y.useDebugValue(r),r}const xw=(e,t)=>{const n=z8(e),r=(i,s=t)=>M2(n,i,s);return Object.assign(r,n),r},U8=(e,t)=>e?xw(e,t):xw;function Vt(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[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}const zp=y.createContext(null),B8=zp.Provider,j2=Br.error001("react");function bt(e,t){const n=y.useContext(zp);if(n===null)throw new Error(j2);return M2(n,e,t)}function $t(){const e=y.useContext(zp);if(e===null)throw new Error(j2);return y.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const yw={display:"none"},H8={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},O2="react-flow__node-desc",R2="react-flow__edge-desc",F8="react-flow__aria-live",$8=e=>e.ariaLiveMessage,G8=e=>e.ariaLabelConfig;function K8({rfId:e}){const t=bt($8);return o.jsx("div",{id:`${F8}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:H8,children:t})}function q8({rfId:e,disableKeyboardA11y:t}){const n=bt(G8);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${O2}-${e}`,style:yw,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${R2}-${e}`,style:yw,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(K8,{rfId:e})]})}const Pp=y.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{const a=`${e}`.split("-");return o.jsx("div",{className:un(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});Pp.displayName="Panel";const vw="https://reactflow.dev?utm_source=attribution";function Y8({proOptions:e,position:t="bottom-right"}){return y.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:o.jsx(Pp,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${vw}`,children:o.jsx("a",{href:vw,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const V8=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},rd=e=>e.id;function X8(e,t){return Vt(e.selectedNodes.map(rd),t.selectedNodes.map(rd))&&Vt(e.selectedEdges.map(rd),t.selectedEdges.map(rd))}function W8({onSelectionChange:e}){const t=$t(),{selectedNodes:n,selectedEdges:r}=bt(V8,X8);return y.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}const Z8=e=>!!e.onSelectionChangeHandlers;function Q8({onSelectionChange:e}){const t=bt(Z8);return e||t?o.jsx(W8,{onSelectionChange:e}):null}const D2=[0,0],J8={x:0,y:0,zoom:1},eU=["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"],kw=[...eU,"rfId"],tU=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}),ww={translateExtent:Ic,nodeOrigin:D2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function nU(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=bt(tU,Vt),u=$t();y.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=ww,l()}),[]);const d=y.useRef(ww);return y.useEffect(()=>{for(const f of kw){const p=e[f],h=d.current[f];p!==h&&(typeof e[f]>"u"||(f==="nodes"?t(p):f==="edges"?n(p):f==="minZoom"?r(p):f==="maxZoom"?i(p):f==="translateExtent"?s(p):f==="nodeExtent"?a(p):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:T9(p)}):f==="fitView"?u.setState({fitViewQueued:p}):f==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[f]:p})))}d.current=e},kw.map(f=>e[f])),null}function Sw(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function rU(e){var r;const[t,n]=y.useState(e==="system"?null:e);return y.useEffect(()=>{if(e!=="system"){n(e);return}const i=Sw(),s=()=>n(i!=null&&i.matches?"dark":"light");return s(),i==null||i.addEventListener("change",s),()=>{i==null||i.removeEventListener("change",s)}},[e]),t!==null?t:(r=Sw())!=null&&r.matches?"dark":"light"}const Ew=typeof document<"u"?document:null;function Uc(e=null,t={target:Ew,actInsideInputWithModifier:!0}){const[n,r]=y.useState(!1),i=y.useRef(!1),s=y.useRef(new Set([])),[a,l]=y.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace(/\+/g,`
478
- `).replace(`
479
-
480
- `,`
481
- +`).split(`
482
- `)),d=u.reduce((f,p)=>f.concat(...p),[]);return[u,d]}return[[],[]]},[e]);return y.useEffect(()=>{const c=(t==null?void 0:t.target)??Ew,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=h=>{var w,m;if(i.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!i.current||i.current&&!u)&&c2(h))return!1;const k=_w(h.code,l);if(s.current.add(h[k]),Nw(a,s.current,!1)){const b=((m=(w=h.composedPath)==null?void 0:w.call(h))==null?void 0:m[0])||h.target,v=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(i.current||!v)&&h.preventDefault(),r(!0)}},f=h=>{const g=_w(h.code,l);Nw(a,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(h[g]),h.key==="Meta"&&s.current.clear(),i.current=!1},p=()=>{s.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),n}function Nw(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function _w(e,t){return t.includes(e)?"code":"key"}const iU=()=>{const e=$t();return y.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:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:s,maxZoom:a,panZoom:l}=e.getState(),c=Ix(t,r,i,s,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:r,snapGrid:i,snapToGrid:s,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??i,f=n.snapToGrid??s;return xu(u,r,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:s}=r.getBoundingClientRect(),a=Fl(t,n);return{x:a.x+i,y:a.y+s}}}),[])};function I2(e,t){const n=[],r=new Map,i=[];for(const s of e)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const a=r.get(s.id);a?a.push(s):r.set(s.id,[s])}for(const s of t){const a=r.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...s};for(const c of a)sU(c,l);n.push(l)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function sU(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 L2(e,t){return I2(e,t)}function aU(e,t){return I2(e,t)}function $s(e,t){return{id:e,type:"select",selected:t}}function al(e,t=new Set,n=!1){const r=[];for(const[i,s]of e){const a=t.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),r.push($s(s.id,a)))}return r}function Cw({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(s=>[s.id,s]));for(const[s,a]of e.entries()){const l=t.get(a.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.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:s})}for(const[s]of t)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function Tw(e){return{id:e.id,type:"remove"}}const lU=i2();function oU(e,t,n={}){return D9(e,t,{...n,onError:n.onError??lU})}const Aw=e=>y9(e),cU=e=>JT(e);function z2(e){return y.forwardRef(e)}const P2=typeof window<"u"?y.useLayoutEffect:y.useEffect;function Mw(e){const[t,n]=y.useState(BigInt(0)),[r]=y.useState(()=>uU(()=>n(i=>i+BigInt(1))));return P2(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function uU(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const U2=y.createContext(null);function dU({children:e}){const t=$t(),n=y.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:p,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=t.getState();let k=c;for(const m of l)k=typeof m=="function"?m(k):m;let w=Cw({items:k,lookup:p});for(const m of g.values())w=m(w);d&&u(k),w.length>0?f==null||f(w):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:b,setNodes:v}=t.getState();m&&v(b)})},[]),r=Mw(n),i=y.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:p}=t.getState();let h=c;for(const g of l)h=typeof g=="function"?g(h):g;d?u(h):f&&f(Cw({items:h,lookup:p}))},[]),s=Mw(i),a=y.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return o.jsx(U2.Provider,{value:a,children:e})}function fU(){const e=y.useContext(U2);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const pU=e=>!!e.panZoom;function Fx(){const e=iU(),t=$t(),n=fU(),r=bt(pU),i=y.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var m,b;const{nodeLookup:p,nodeOrigin:h}=t.getState(),g=Aw(f)?f:p.get(f.id),k=g.parentId?a2(g.position,g.measured,g.parentId,p,h):g.position,w={...g,position:k,width:((m=g.measured)==null?void 0:m.width)??g.width,height:((b=g.measured)==null?void 0:b.height)??g.height};return zc(w)},u=(f,p,h={replace:!1})=>{a(g=>g.map(k=>{if(k.id===f){const w=typeof p=="function"?p(k):p;return h.replace&&Aw(w)?w:{...k,...w}}return k}))},d=(f,p,h={replace:!1})=>{l(g=>g.map(k=>{if(k.id===f){const w=typeof p=="function"?p(k):p;return h.replace&&cU(w)?w:{...k,...w}}return k}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var p;return(p=s(f))==null?void 0:p.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(p=>({...p}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:l,addNodes:f=>{const p=Array.isArray(f)?f:[f];n.nodeQueue.push(h=>[...h,...p])},addEdges:f=>{const p=Array.isArray(f)?f:[f];n.edgeQueue.push(h=>[...h,...p])},toObject:()=>{const{nodes:f=[],edges:p=[],transform:h}=t.getState(),[g,k,w]=h;return{nodes:f.map(m=>({...m})),edges:p.map(m=>({...m})),viewport:{x:g,y:k,zoom:w}}},deleteElements:async({nodes:f=[],edges:p=[]})=>{const{nodes:h,edges:g,onNodesDelete:k,onEdgesDelete:w,triggerNodeChanges:m,triggerEdgeChanges:b,onDelete:v,onBeforeDelete:S}=t.getState(),{nodes:T,edges:N}=await E9({nodesToRemove:f,edgesToRemove:p,nodes:h,edges:g,onBeforeDelete:S}),_=N.length>0,R=T.length>0;if(_){const L=N.map(Tw);w==null||w(N),b(L)}if(R){const L=T.map(Tw);k==null||k(T),m(L)}return(R||_)&&(v==null||v({nodes:T,edges:N})),{deletedNodes:T,deletedEdges:N}},getIntersectingNodes:(f,p=!0,h)=>{const g=iw(f),k=g?f:c(f),w=h!==void 0;return k?(h||t.getState().nodes).filter(m=>{const b=t.getState().nodeLookup.get(m.id);if(b&&!g&&(m.id===f.id||!b.internals.positionAbsolute))return!1;const v=zc(w?m:b),S=Ff(v,k);return p&&S>0||S>=v.width*v.height||S>=k.width*k.height}):[]},isNodeIntersecting:(f,p,h=!0)=>{const k=iw(f)?f:c(f);if(!k)return!1;const w=Ff(k,p);return h&&w>0||w>=p.width*p.height||w>=k.width*k.height},updateNode:u,updateNodeData:(f,p,h={replace:!1})=>{u(f,g=>{const k=typeof p=="function"?p(g):p;return h.replace?{...g,data:k}:{...g,data:{...g.data,...k}}},h)},updateEdge:d,updateEdgeData:(f,p,h={replace:!1})=>{d(f,g=>{const k=typeof p=="function"?p(g):p;return h.replace?{...g,data:k}:{...g,data:{...g.data,...k}}},h)},getNodesBounds:f=>{const{nodeLookup:p,nodeOrigin:h}=t.getState();return v9(f,{nodeLookup:p,nodeOrigin:h})},getHandleConnections:({type:f,id:p,nodeId:h})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${h}-${f}${p?`-${p}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:p,nodeId:h})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${h}${f?p?`-${f}-${p}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const p=t.getState().fitViewResolver??C9();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:p}),n.nodeQueue.push(h=>[...h]),p.promise}}},[]);return y.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const jw=e=>e.selected,hU=typeof window<"u"?window:void 0;function mU({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=$t(),{deleteElements:r}=Fx(),i=Uc(e,{actInsideInputWithModifier:!1}),s=Uc(t,{target:hU});y.useEffect(()=>{if(i){const{edges:a,nodes:l}=n.getState();r({nodes:l.filter(jw),edges:a.filter(jw)}),n.setState({nodesSelectionActive:!1})}},[i]),y.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function gU(e){const t=$t();y.useEffect(()=>{const n=()=>{var i,s,a,l;if(!e.current||!(((s=(i=e.current).checkVisibility)==null?void 0:s.call(i))??!0))return!1;const r=Lx(e.current);(r.height===0||r.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",Br.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Up={position:"absolute",width:"100%",height:"100%",top:0,left:0},bU=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function xU({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:s=.5,panOnScrollMode:a=ta.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:d,minZoom:f,maxZoom:p,zoomActivationKeyCode:h,preventScrolling:g=!0,children:k,noWheelClassName:w,noPanClassName:m,onViewportChange:b,isControlledViewport:v,paneClickDistance:S,selectionOnDrag:T}){const N=$t(),_=y.useRef(null),{userSelectionActive:R,lib:L,connectionInProgress:C}=bt(bU,Vt),U=Uc(h),$=y.useRef();gU(_);const G=y.useCallback(I=>{b==null||b({x:I[0],y:I[1],zoom:I[2]}),v||N.setState({transform:I})},[b,v]);return y.useEffect(()=>{if(_.current){$.current=u8({domNode:_.current,minZoom:f,maxZoom:p,translateExtent:d,viewport:u,onDraggingChange:M=>N.setState(P=>P.paneDragging===M?P:{paneDragging:M}),onPanZoomStart:(M,P)=>{const{onViewportChangeStart:H,onMoveStart:E}=N.getState();E==null||E(M,P),H==null||H(P)},onPanZoom:(M,P)=>{const{onViewportChange:H,onMove:E}=N.getState();E==null||E(M,P),H==null||H(P)},onPanZoomEnd:(M,P)=>{const{onViewportChangeEnd:H,onMoveEnd:E}=N.getState();E==null||E(M,P),H==null||H(P)}});const{x:I,y:D,zoom:A}=$.current.getViewport();return N.setState({panZoom:$.current,transform:[I,D,A],domNode:_.current.closest(".react-flow")}),()=>{var M;(M=$.current)==null||M.destroy()}}},[]),y.useEffect(()=>{var I;(I=$.current)==null||I.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:s,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:U,preventScrolling:g,noPanClassName:m,userSelectionActive:R,noWheelClassName:w,lib:L,onTransformChange:G,connectionInProgress:C,selectionOnDrag:T,paneClickDistance:S})},[e,t,n,r,i,s,a,l,c,U,g,m,R,w,L,G,C,T,S]),o.jsx("div",{className:"react-flow__renderer",ref:_,style:Up,children:k})}const yU=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function vU(){const{userSelectionActive:e,userSelectionRect:t}=bt(yU,Vt);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 Qh=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},kU=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function wU({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Lc.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:p,onPaneMouseMove:h,onPaneMouseLeave:g,children:k}){const w=y.useRef(0),m=$t(),{userSelectionActive:b,elementsSelectable:v,dragging:S,panBy:T,autoPanSpeed:N}=bt(kU,Vt),_=v&&(e||b),R=y.useRef(null),L=y.useRef(),C=y.useRef(new Set),U=y.useRef(new Set),$=y.useRef(!1),G=y.useRef(!1),I=y.useRef({x:0,y:0}),D=y.useRef(!1),A=K=>{if(G.current||$.current||m.getState().connection.inProgress){G.current=!1,$.current=!1;return}u==null||u(K),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},M=K=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){K.preventDefault();return}d==null||d(K)},P=f?K=>f(K):void 0,H=K=>{G.current&&(K.stopPropagation(),G.current=!1)},E=K=>{var le,de;if(K.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:q,transform:V}=m.getState();if(L.current=q==null?void 0:q.getBoundingClientRect(),!L.current)return;const ue=K.target===R.current;if(!ue&&!!K.target.closest(".nokey")||!e||!(a&&ue||t)||K.button!==0||!K.isPrimary)return;(de=(le=K.target)==null?void 0:le.setPointerCapture)==null||de.call(le,K.pointerId),G.current=!1;const{x:Te,y:ne}=zr(K.nativeEvent,L.current),pe=xu({x:Te,y:ne},V);m.setState({userSelectionRect:{width:0,height:0,startX:pe.x,startY:pe.y,x:Te,y:ne}}),ue||(K.stopPropagation(),K.preventDefault())};function j(K,q){const{userSelectionRect:V}=m.getState();if(!V)return;const{transform:ue,nodeLookup:me,edgeLookup:Ne,connectionLookup:Te,triggerNodeChanges:ne,triggerEdgeChanges:pe,defaultEdgeOptions:le}=m.getState(),de={x:V.startX,y:V.startY},{x:Ke,y:He}=Fl(de,ue),Fe={startX:de.x,startY:de.y,x:K<Ke?K:Ke,y:q<He?q:He,width:Math.abs(K-Ke),height:Math.abs(q-He)},dt=C.current,st=U.current;C.current=new Set(Rx(me,Fe,ue,n===Lc.Partial,!0).map(at=>at.id)),U.current=new Set;const Ue=(le==null?void 0:le.selectable)??!0;for(const at of C.current){const Z=Te.get(at);if(Z)for(const{edgeId:ae}of Z.values()){const _e=Ne.get(ae);_e&&(_e.selectable??Ue)&&U.current.add(ae)}}if(!sw(dt,C.current)){const at=al(me,C.current,!0);ne(at)}if(!sw(st,U.current)){const at=al(Ne,U.current);pe(at)}m.setState({userSelectionRect:Fe,userSelectionActive:!0,nodesSelectionActive:!1})}function B(){if(!i||!L.current)return;const[K,q]=Dx(I.current,L.current,N);T({x:K,y:q}).then(V=>{if(!G.current||!V){w.current=requestAnimationFrame(B);return}const{x:ue,y:me}=I.current;j(ue,me),w.current=requestAnimationFrame(B)})}const O=()=>{cancelAnimationFrame(w.current),w.current=0,D.current=!1};y.useEffect(()=>()=>O(),[]);const Q=K=>{const{userSelectionRect:q,transform:V,resetSelectedElements:ue}=m.getState();if(!L.current||!q)return;const{x:me,y:Ne}=zr(K.nativeEvent,L.current);I.current={x:me,y:Ne};const Te=Fl({x:q.startX,y:q.startY},V);if(!G.current){const ne=t?0:s;if(Math.hypot(me-Te.x,Ne-Te.y)<=ne)return;ue(),l==null||l(K)}G.current=!0,D.current||(B(),D.current=!0),j(me,Ne)},F=K=>{var q,V;if(!_){K.target===R.current&&m.getState().connection.inProgress&&($.current=!0);return}K.button===0&&((V=(q=K.target)==null?void 0:q.releasePointerCapture)==null||V.call(q,K.pointerId),!b&&K.target===R.current&&m.getState().userSelectionRect&&(A==null||A(K)),m.setState({userSelectionActive:!1,userSelectionRect:null}),G.current&&(c==null||c(K),m.setState({nodesSelectionActive:C.current.size>0})),O())},J=K=>{var q,V;(V=(q=K.target)==null?void 0:q.releasePointerCapture)==null||V.call(q,K.pointerId),O()},ce=r===!0||Array.isArray(r)&&r.includes(0);return o.jsxs("div",{className:un(["react-flow__pane",{draggable:ce,dragging:S,selection:e}]),onClick:_?void 0:Qh(A,R),onContextMenu:Qh(M,R),onWheel:Qh(P,R),onPointerEnter:_?void 0:p,onPointerMove:_?Q:h,onPointerUp:F,onPointerCancel:_?J:void 0,onPointerDownCapture:_?E:void 0,onClickCapture:_?H:void 0,onPointerLeave:g,ref:R,style:Up,children:[k,o.jsx(vU,{})]})}function R0({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Br.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):i([e])}function B2({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:a}){const l=$t(),[c,u]=y.useState(!1),d=y.useRef();return y.useEffect(()=>{if(!t)return d.current=W9({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{R0({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]),y.useEffect(()=>{t||!e.current||!d.current||d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:a})},[n,r,t,s,e,i,a]),c}const SU=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function H2(){const e=$t();return y.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,p=SU(a),h=i?s[0]:5,g=i?s[1]:5,k=n.direction.x*h*n.factor,w=n.direction.y*g*n.factor;for(const[,m]of u){if(!p(m))continue;let b={x:m.internals.positionAbsolute.x+k,y:m.internals.positionAbsolute.y+w};i&&(b=bu(b,s));const{position:v,positionAbsolute:S}=e2({nodeId:m.id,nextPosition:b,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});m.position=v,m.internals.positionAbsolute=S,f.set(m.id,m)}c(f)},[])}const $x=y.createContext(null),EU=$x.Provider;$x.Consumer;const F2=()=>y.useContext($x),NU=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),$2=y.createContext(null);function _U({children:e}){const t=bt(NU,Vt);return o.jsx($2.Provider,{value:t,children:e})}function CU(){const e=y.useContext($2);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const TU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},AU=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:a}=r,{fromHandle:l,toHandle:c,isValid:u}=a;if(!l&&!i)return TU;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:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:s===Ul.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:!!i,valid:d&&u}};function MU({type:e="source",position:t=Ge.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...p},h){var D,A;const g=a||null,k=e==="target",w=$t(),m=F2(),{connectOnClick:b,noPanClassName:v,rfId:S}=CU(),{connectingFrom:T,connectingTo:N,clickConnecting:_,isPossibleEndHandle:R,connectionInProcess:L,clickConnectionInProcess:C,valid:U}=bt(AU(m,g,e),Vt);m||(A=(D=w.getState()).onError)==null||A.call(D,"010",Br.error010());const $=M=>{const{defaultEdgeOptions:P,onConnect:H,hasDefaultEdges:E}=w.getState(),j={...P,...M};if(E){const{edges:B,setEdges:O,onError:Q}=w.getState();O(oU(j,B,{onError:Q}))}H==null||H(j),l==null||l(j)},G=M=>{if(!m)return;const P=u2(M.nativeEvent);if(i&&(P&&M.button===0||!P)){const H=w.getState();O0.onPointerDown(M.nativeEvent,{handleDomNode:M.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:k,handleId:g,nodeId:m,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...E)=>{var j,B;return(B=(j=w.getState()).onConnectEnd)==null?void 0:B.call(j,...E)},updateConnection:H.updateConnection,onConnect:$,isValidConnection:n||((...E)=>{var j,B;return((B=(j=w.getState()).isValidConnection)==null?void 0:B.call(j,...E))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}P?d==null||d(M):f==null||f(M)},I=M=>{const{onClickConnectStart:P,onClickConnectEnd:H,connectionClickStartHandle:E,connectionMode:j,isValidConnection:B,lib:O,rfId:Q,nodeLookup:F,connection:J}=w.getState();if(!m||!E&&!i)return;if(!E){P==null||P(M.nativeEvent,{nodeId:m,handleId:g,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:m,type:e,id:g}});return}const ce=o2(M.target),K=n||B,{connection:q,isValid:V}=O0.isValid(M.nativeEvent,{handle:{nodeId:m,id:g,type:e},connectionMode:j,fromNodeId:E.nodeId,fromHandleId:E.id||null,fromType:E.type,isValidConnection:K,flowId:Q,doc:ce,lib:O,nodeLookup:F});V&&q&&$(q);const ue=structuredClone(J);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,H==null||H(M,ue),w.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":g,"data-nodeid":m,"data-handlepos":t,"data-id":`${S}-${m}-${g}-${e}`,className:un(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",v,u,{source:!k,target:k,connectable:r,connectablestart:i,connectableend:s,clickconnecting:_,connectingfrom:T,connectingto:N,valid:U,connectionindicator:r&&(!L||R)&&(L||C?s:i)}]),onMouseDown:G,onTouchStart:G,onClick:b?I:void 0,ref:h,...p,children:c})}const kn=y.memo(z2(MU));function jU({data:e,isConnectable:t,sourcePosition:n=Ge.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(kn,{type:"source",position:n,isConnectable:t})]})}function OU({data:e,isConnectable:t,targetPosition:n=Ge.Top,sourcePosition:r=Ge.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(kn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(kn,{type:"source",position:r,isConnectable:t})]})}function RU(){return null}function DU({data:e,isConnectable:t,targetPosition:n=Ge.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(kn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const $f={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ow={input:jU,default:OU,output:DU,group:RU};function IU(e){var t,n,r,i;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??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const LU=e=>{const{width:t,height:n,x:r,y:i}=gu(e.nodeLookup,{filter:s=>!!s.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(${r}px,${i}px)`}};function zU({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=$t(),{width:i,height:s,transformString:a,userSelectionActive:l}=bt(LU,Vt),c=H2(),u=y.useRef(null);y.useEffect(()=>{var h;n||(h=u.current)==null||h.focus({preventScroll:!0})},[n]);const d=!l&&i!==null&&s!==null;if(B2({nodeRef:u,disabled:!d}),!d)return null;const f=e?h=>{const g=r.getState().nodes.filter(k=>k.selected);e(h,g)}:void 0,p=h=>{Object.prototype.hasOwnProperty.call($f,h.key)&&(h.preventDefault(),c({direction:$f[h.key],factor:h.shiftKey?4:1}))};return o.jsx("div",{className:un(["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:p,style:{width:i,height:s}})})}const Rw=typeof window<"u"?window:void 0,PU=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function G2({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:p,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:k,zoomActivationKeyCode:w,elementsSelectable:m,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:S,panOnScrollSpeed:T,panOnScrollMode:N,zoomOnDoubleClick:_,panOnDrag:R,autoPanOnSelection:L,defaultViewport:C,translateExtent:U,minZoom:$,maxZoom:G,preventScrolling:I,onSelectionContextMenu:D,noWheelClassName:A,noPanClassName:M,disableKeyboardA11y:P,onViewportChange:H,isControlledViewport:E}){const{nodesSelectionActive:j,userSelectionActive:B}=bt(PU,Vt),O=Uc(u,{target:Rw}),Q=Uc(k,{target:Rw}),F=Q||R,J=Q||S,ce=d&&F!==!0,K=O||B||ce;return mU({deleteKeyCode:c,multiSelectionKeyCode:g}),o.jsx(xU,{onPaneContextMenu:s,elementsSelectable:m,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:J,panActivationKeyPressed:Q,panOnScrollSpeed:T,panOnScrollMode:N,zoomOnDoubleClick:_,panOnDrag:!O&&F,defaultViewport:C,translateExtent:U,minZoom:$,maxZoom:G,zoomActivationKeyCode:w,preventScrolling:I,noWheelClassName:A,noPanClassName:M,onViewportChange:H,isControlledViewport:E,paneClickDistance:l,selectionOnDrag:ce,children:o.jsxs(wU,{onSelectionStart:p,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:F,autoPanOnSelection:L,isSelecting:!!K,selectionMode:f,selectionKeyPressed:O,paneClickDistance:l,selectionOnDrag:ce,children:[e,j&&o.jsx(zU,{onSelectionContextMenu:D,noPanClassName:M,disableKeyboardA11y:P})]})})}G2.displayName="FlowRenderer";const UU=y.memo(G2),BU=e=>t=>e?Rx(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 HU(e){return bt(y.useCallback(BU(e),[e]),Vt)}const FU=e=>e.updateNodeInternals;function $U(){const e=bt(FU),[t]=y.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),e(r)}));return y.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function GU({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=$t(),s=y.useRef(null),a=y.useRef(null),l=y.useRef(e.sourcePosition),c=y.useRef(e.targetPosition),u=y.useRef(t),d=n&&!!e.internals.handleBounds;return y.useEffect(()=>{s.current&&!e.hidden&&(!d||a.current!==s.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(s.current),a.current=s.current)},[d,e.hidden]),y.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),y.useEffect(()=>{if(s.current){const f=u.current!==t,p=l.current!==e.sourcePosition,h=c.current!==e.targetPosition;(f||p||h)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function KU({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:p,noPanClassName:h,disableKeyboardA11y:g,rfId:k,nodeTypes:w,nodeClickDistance:m,onError:b}){const{node:v,internals:S,isParent:T}=bt(K=>{const q=K.nodeLookup.get(e),V=K.parentLookup.has(e);return{node:q,internals:q.internals,isParent:V}},Vt);let N=v.type||"default",_=(w==null?void 0:w[N])||Ow[N];_===void 0&&(b==null||b("003",Br.error003(N)),N="default",_=(w==null?void 0:w.default)||Ow.default);const R=!!(v.draggable||l&&typeof v.draggable>"u"),L=!!(v.selectable||c&&typeof v.selectable>"u"),C=!!(v.connectable||u&&typeof v.connectable>"u"),U=!!(v.focusable||d&&typeof v.focusable>"u"),$=$t(),G=s2(v),I=GU({node:v,nodeType:N,hasDimensions:G,resizeObserver:f}),D=B2({nodeRef:I,disabled:v.hidden||!R,noDragClassName:p,handleSelector:v.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:m}),A=H2();if(v.hidden)return null;const M=Kr(v),P=IU(v),H=L||R||t||n||r||i,E=n?K=>n(K,{...S.userNode}):void 0,j=r?K=>r(K,{...S.userNode}):void 0,B=i?K=>i(K,{...S.userNode}):void 0,O=s?K=>s(K,{...S.userNode}):void 0,Q=a?K=>a(K,{...S.userNode}):void 0,F=K=>{const{selectNodesOnDrag:q,nodeDragThreshold:V}=$.getState();L&&(!q||!R||V>0)&&R0({id:e,store:$,nodeRef:I}),t&&t(K,{...S.userNode})},J=K=>{if(!(c2(K.nativeEvent)||g)){if(WT.includes(K.key)&&L){const q=K.key==="Escape";R0({id:e,store:$,unselect:q,nodeRef:I})}else if(R&&v.selected&&Object.prototype.hasOwnProperty.call($f,K.key)){K.preventDefault();const{ariaLabelConfig:q}=$.getState();$.setState({ariaLiveMessage:q["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~S.positionAbsolute.x,y:~~S.positionAbsolute.y})}),A({direction:$f[K.key],factor:K.shiftKey?4:1})}}},ce=()=>{var Te;if(g||!((Te=I.current)!=null&&Te.matches(":focus-visible")))return;const{transform:K,width:q,height:V,autoPanOnNodeFocus:ue,setCenter:me}=$.getState();if(!ue)return;Rx(new Map([[e,v]]),{x:0,y:0,width:q,height:V},K,!0).length>0||me(v.position.x+M.width/2,v.position.y+M.height/2,{zoom:K[2]})};return o.jsx("div",{className:un(["react-flow__node",`react-flow__node-${N}`,{[h]:R},v.className,{selected:v.selected,selectable:L,parent:T,draggable:R,dragging:D}]),ref:I,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:G?"visible":"hidden",...v.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:E,onMouseMove:j,onMouseLeave:B,onContextMenu:O,onClick:F,onDoubleClick:Q,onKeyDown:U?J:void 0,tabIndex:U?0:void 0,onFocus:U?ce:void 0,role:v.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${O2}-${k}`,"aria-label":v.ariaLabel,...v.domAttributes,children:o.jsx(EU,{value:e,children:o.jsx(_,{id:e,data:v.data,type:N,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:v.selected??!1,selectable:L,draggable:R,deletable:v.deletable??!0,isConnectable:C,sourcePosition:v.sourcePosition,targetPosition:v.targetPosition,dragging:D,dragHandle:v.dragHandle,zIndex:S.z,parentId:v.parentId,...M})})})}var qU=y.memo(KU);const YU=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function K2(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=bt(YU,Vt),s=HU(e.onlyRenderVisibleElements),a=$U();return o.jsx("div",{className:"react-flow__nodes",style:Up,children:s.map(l=>o.jsx(qU,{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:r,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}K2.displayName="NodeRenderer";const VU=y.memo(K2);function XU(e){return bt(y.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);s&&a&&j9({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Vt)}const WU=({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"})},ZU=({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"})},Dw={[Bl.Arrow]:WU,[Bl.ArrowClosed]:ZU};function QU(e){const t=$t();return y.useMemo(()=>{var i,s;return Object.prototype.hasOwnProperty.call(Dw,e)?Dw[e]:((s=(i=t.getState()).onError)==null||s.call(i,"009",Br.error009(e)),null)},[e])}const JU=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=QU(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},q2=({defaultColor:e,rfId:t})=>{const n=bt(s=>s.edges),r=bt(s=>s.defaultEdgeOptions),i=y.useMemo(()=>U9(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:i.map(s=>o.jsx(JU,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};q2.displayName="MarkerDefinitions";var eB=y.memo(q2);function Y2({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,p]=y.useState({x:1,y:0,width:0,height:0}),h=un(["react-flow__edge-textwrapper",u]),g=y.useRef(null);return y.useEffect(()=>{if(g.current){const k=g.current.getBBox();p({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:h,visibility:f.width?"visible":"hidden",...d,children:[i&&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:s,rx:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:r,children:n}),c]}):null}Y2.displayName="EdgeText";const tB=y.memo(Y2);function yu({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:s,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:un(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Lr(t)&&Lr(n)?o.jsx(tB,{x:t,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function Iw({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ge.Left||e===Ge.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function V2({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:i,targetPosition:s=Ge.Top}){const[a,l]=Iw({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,u]=Iw({pos:s,x1:r,y1:i,x2:e,y2:t}),[d,f,p,h]=d2({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${i}`,d,f,p,h]}function X2(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:k,markerStart:w,interactionWidth:m})=>{const[b,v,S]=V2({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:l}),T=e.isInternal?void 0:t;return o.jsx(yu,{id:T,path:b,labelX:v,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:k,markerStart:w,interactionWidth:m})})}const nB=X2({isInternal:!1}),W2=X2({isInternal:!0});nB.displayName="SimpleBezierEdge";W2.displayName="SimpleBezierEdgeInternal";function Z2(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,sourcePosition:h=Ge.Bottom,targetPosition:g=Ge.Top,markerEnd:k,markerStart:w,pathOptions:m,interactionWidth:b})=>{const[v,S,T]=A0({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:s,targetPosition:g,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),N=e.isInternal?void 0:t;return o.jsx(yu,{id:N,path:v,labelX:S,labelY:T,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:k,markerStart:w,interactionWidth:b})})}const Q2=Z2({isInternal:!1}),J2=Z2({isInternal:!0});Q2.displayName="SmoothStepEdge";J2.displayName="SmoothStepEdgeInternal";function eA(e){return y.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return o.jsx(Q2,{...n,id:r,pathOptions:y.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const rB=eA({isInternal:!1}),tA=eA({isInternal:!0});rB.displayName="StepEdge";tA.displayName="StepEdgeInternal";function nA(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:g,interactionWidth:k})=>{const[w,m,b]=h2({sourceX:n,sourceY:r,targetX:i,targetY:s}),v=e.isInternal?void 0:t;return o.jsx(yu,{id:v,path:w,labelX:m,labelY:b,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:g,interactionWidth:k})})}const iB=nA({isInternal:!1}),rA=nA({isInternal:!0});iB.displayName="StraightEdge";rA.displayName="StraightEdgeInternal";function iA(e){return y.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a=Ge.Bottom,targetPosition:l=Ge.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:k,markerStart:w,pathOptions:m,interactionWidth:b})=>{const[v,S,T]=f2({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:l,curvature:m==null?void 0:m.curvature}),N=e.isInternal?void 0:t;return o.jsx(yu,{id:N,path:v,labelX:S,labelY:T,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:g,markerEnd:k,markerStart:w,interactionWidth:b})})}const sB=iA({isInternal:!1}),sA=iA({isInternal:!0});sB.displayName="BezierEdge";sA.displayName="BezierEdgeInternal";const Lw={default:sA,straight:rA,step:tA,smoothstep:J2,simplebezier:W2},zw={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},aB=(e,t,n)=>n===Ge.Left?e-t:n===Ge.Right?e+t:e,lB=(e,t,n)=>n===Ge.Top?e-t:n===Ge.Bottom?e+t:e,Pw="react-flow__edgeupdater";function Uw({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:a,className:un([Pw,`${Pw}-${l}`]),cx:aB(t,r,e),cy:lB(n,r,e),r,stroke:"transparent",fill:"transparent"})}function oB({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:p,setUpdateHover:h}){const g=$t(),k=(S,T)=>{if(S.button!==0)return;const{autoPanOnConnect:N,domNode:_,connectionMode:R,connectionRadius:L,lib:C,onConnectStart:U,cancelConnection:$,nodeLookup:G,rfId:I,panBy:D,updateConnection:A}=g.getState(),M=T.type==="target",P=(j,B)=>{p(!1),f==null||f(j,n,T.type,B)},H=j=>u==null?void 0:u(n,j),E=(j,B)=>{p(!0),d==null||d(S,n,T.type),U==null||U(j,B)};O0.onPointerDown(S.nativeEvent,{autoPanOnConnect:N,connectionMode:R,connectionRadius:L,domNode:_,handleId:T.id,nodeId:T.nodeId,nodeLookup:G,isTarget:M,edgeUpdaterType:T.type,lib:C,flowId:I,cancelConnection:$,panBy:D,isValidConnection:(...j)=>{var B,O;return((O=(B=g.getState()).isValidConnection)==null?void 0:O.call(B,...j))??!0},onConnect:H,onConnectStart:E,onConnectEnd:(...j)=>{var B,O;return(O=(B=g.getState()).onConnectEnd)==null?void 0:O.call(B,...j)},onReconnectEnd:P,updateConnection:A,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:S.currentTarget})},w=S=>k(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=S=>k(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>h(!0),v=()=>h(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(Uw,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:w,onMouseEnter:b,onMouseOut:v,type:"source"}),(e===!0||e==="target")&&o.jsx(Uw,{position:c,centerX:s,centerY:a,radius:t,onMouseDown:m,onMouseEnter:b,onMouseOut:v,type:"target"})]})}function cB({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:p,onReconnectEnd:h,rfId:g,edgeTypes:k,noPanClassName:w,onError:m,disableKeyboardA11y:b}){let v=bt(me=>me.edgeLookup.get(e));const S=bt(me=>me.defaultEdgeOptions);v=S?{...S,...v}:v;let T=v.type||"default",N=(k==null?void 0:k[T])||Lw[T];N===void 0&&(m==null||m("011",Br.error011(T)),T="default",N=(k==null?void 0:k.default)||Lw.default);const _=!!(v.focusable||t&&typeof v.focusable>"u"),R=typeof f<"u"&&(v.reconnectable||n&&typeof v.reconnectable>"u"),L=!!(v.selectable||r&&typeof v.selectable>"u"),C=y.useRef(null),[U,$]=y.useState(!1),[G,I]=y.useState(!1),D=$t(),{zIndex:A=v.zIndex,sourceX:M,sourceY:P,targetX:H,targetY:E,sourcePosition:j,targetPosition:B}=bt(y.useCallback(me=>{const Ne=me.nodeLookup.get(v.source),Te=me.nodeLookup.get(v.target);if(!Ne||!Te)return zw;const ne=P9({id:e,sourceNode:Ne,targetNode:Te,sourceHandle:v.sourceHandle||null,targetHandle:v.targetHandle||null,connectionMode:me.connectionMode,onError:m}),pe=M9({selected:v.selected,zIndex:v.zIndex,sourceNode:Ne,targetNode:Te,elevateOnSelect:me.elevateEdgesOnSelect,zIndexMode:me.zIndexMode});return{...ne||zw,zIndex:pe}},[v.source,v.target,v.sourceHandle,v.targetHandle,v.selected,v.zIndex,m]),Vt),O=y.useMemo(()=>v.markerStart?`url('#${M0(v.markerStart,g)}')`:void 0,[v.markerStart,g]),Q=y.useMemo(()=>v.markerEnd?`url('#${M0(v.markerEnd,g)}')`:void 0,[v.markerEnd,g]);if(v.hidden||M===null||P===null||H===null||E===null)return null;const F=me=>{var pe;const{addSelectedEdges:Ne,unselectNodesAndEdges:Te,multiSelectionActive:ne}=D.getState();L&&(D.setState({nodesSelectionActive:!1}),v.selected&&ne?(Te({nodes:[],edges:[v]}),(pe=C.current)==null||pe.blur()):Ne([e])),i&&i(me,v)},J=s?me=>{s(me,{...v})}:void 0,ce=a?me=>{a(me,{...v})}:void 0,K=l?me=>{l(me,{...v})}:void 0,q=c?me=>{c(me,{...v})}:void 0,V=u?me=>{u(me,{...v})}:void 0,ue=me=>{var Ne;if(!b&&WT.includes(me.key)&&L){const{unselectNodesAndEdges:Te,addSelectedEdges:ne}=D.getState();me.key==="Escape"?((Ne=C.current)==null||Ne.blur(),Te({edges:[v]})):ne([e])}};return o.jsx("svg",{style:{zIndex:A},children:o.jsxs("g",{className:un(["react-flow__edge",`react-flow__edge-${T}`,v.className,w,{selected:v.selected,animated:v.animated,inactive:!L&&!i,updating:U,selectable:L}]),onClick:F,onDoubleClick:J,onContextMenu:ce,onMouseEnter:K,onMouseMove:q,onMouseLeave:V,onKeyDown:_?ue:void 0,tabIndex:_?0:void 0,role:v.ariaRole??(_?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":v.ariaLabel===null?void 0:v.ariaLabel||`Edge from ${v.source} to ${v.target}`,"aria-describedby":_?`${R2}-${g}`:void 0,ref:C,...v.domAttributes,children:[!G&&o.jsx(N,{id:e,source:v.source,target:v.target,type:v.type,selected:v.selected,animated:v.animated,selectable:L,deletable:v.deletable??!0,label:v.label,labelStyle:v.labelStyle,labelShowBg:v.labelShowBg,labelBgStyle:v.labelBgStyle,labelBgPadding:v.labelBgPadding,labelBgBorderRadius:v.labelBgBorderRadius,sourceX:M,sourceY:P,targetX:H,targetY:E,sourcePosition:j,targetPosition:B,data:v.data,style:v.style,sourceHandleId:v.sourceHandle,targetHandleId:v.targetHandle,markerStart:O,markerEnd:Q,pathOptions:"pathOptions"in v?v.pathOptions:void 0,interactionWidth:v.interactionWidth}),R&&o.jsx(oB,{edge:v,isReconnectable:R,reconnectRadius:d,onReconnect:f,onReconnectStart:p,onReconnectEnd:h,sourceX:M,sourceY:P,targetX:H,targetY:E,sourcePosition:j,targetPosition:B,setUpdateHover:$,setReconnecting:I})]})})}var uB=y.memo(cB);const dB=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function aA({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:p,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:k}){const{edgesFocusable:w,edgesReconnectable:m,elementsSelectable:b,onError:v}=bt(dB,Vt),S=XU(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(eB,{defaultColor:e,rfId:n}),S.map(T=>o.jsx(uB,{id:T,edgesFocusable:w,edgesReconnectable:m,elementsSelectable:b,noPanClassName:i,onReconnect:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:p,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:v,edgeTypes:r,disableKeyboardA11y:k},T))]})}aA.displayName="EdgeRenderer";const fB=y.memo(aA),Bw=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function pB({children:e}){const t=$t(),n=y.useRef(null),[r]=y.useState(()=>t.getState().transform);return P2(()=>{let i=null;const s=()=>{const a=t.getState().transform;i&&a[0]===i[0]&&a[1]===i[1]&&a[2]===i[2]||(i=a,n.current&&(n.current.style.transform=Bw(a)))};return s(),t.subscribe(s)},[t]),o.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Bw(r)},children:e})}function hB(e){const t=Fx(),n=y.useRef(!1);y.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const mB=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function gB(e){const t=bt(mB),n=$t();return y.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function bB(e){return e.connection.inProgress?{...e.connection,to:xu(e.connection.to,e.transform)}:{...e.connection}}function xB(e){return bB}function yB(e){const t=xB();return bt(t,Vt)}const vB=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function kB({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:s,height:a,isValid:l,inProgress:c}=bt(vB,Vt);return!(s&&i&&c)?null:o.jsx("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:un(["react-flow__connection",l2(l)]),children:o.jsx(lA,{style:t,type:n,CustomComponent:r,isValid:l})})})}const lA=({style:e,type:t=ns.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:p,pointer:h}=yB();if(!i)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:p,connectionStatus:l2(r),toNode:d,toHandle:f,pointer:h});let g="";const k={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:p};switch(t){case ns.Bezier:[g]=f2(k);break;case ns.SimpleBezier:[g]=V2(k);break;case ns.Step:[g]=A0({...k,borderRadius:0});break;case ns.SmoothStep:[g]=A0(k);break;default:[g]=h2(k)}return o.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};lA.displayName="ConnectionLine";const wB={};function Hw(e=wB){y.useRef(e),$t(),y.useEffect(()=>{},[e])}function SB(){$t(),y.useRef(!1),y.useEffect(()=>{},[])}function oA({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:p,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:k,connectionLineComponent:w,connectionLineContainerStyle:m,selectionKeyCode:b,selectionOnDrag:v,selectionMode:S,multiSelectionKeyCode:T,panActivationKeyCode:N,zoomActivationKeyCode:_,deleteKeyCode:R,onlyRenderVisibleElements:L,elementsSelectable:C,defaultViewport:U,translateExtent:$,minZoom:G,maxZoom:I,preventScrolling:D,defaultMarkerColor:A,zoomOnScroll:M,zoomOnPinch:P,panOnScroll:H,panOnScrollSpeed:E,panOnScrollMode:j,zoomOnDoubleClick:B,panOnDrag:O,autoPanOnSelection:Q,onPaneClick:F,onPaneMouseEnter:J,onPaneMouseMove:ce,onPaneMouseLeave:K,onPaneScroll:q,onPaneContextMenu:V,paneClickDistance:ue,nodeClickDistance:me,onEdgeContextMenu:Ne,onEdgeMouseEnter:Te,onEdgeMouseMove:ne,onEdgeMouseLeave:pe,reconnectRadius:le,onReconnect:de,onReconnectStart:Ke,onReconnectEnd:He,noDragClassName:Fe,noWheelClassName:dt,noPanClassName:st,disableKeyboardA11y:Ue,nodeExtent:at,rfId:Z,viewport:ae,onViewportChange:_e,nodesDraggable:x}){return Hw(e),Hw(t),SB(),hB(n),gB(ae),o.jsx(UU,{onPaneClick:F,onPaneMouseEnter:J,onPaneMouseMove:ce,onPaneMouseLeave:K,onPaneContextMenu:V,onPaneScroll:q,paneClickDistance:ue,deleteKeyCode:R,selectionKeyCode:b,selectionOnDrag:v,selectionMode:S,onSelectionStart:p,onSelectionEnd:h,multiSelectionKeyCode:T,panActivationKeyCode:N,zoomActivationKeyCode:_,elementsSelectable:C,zoomOnScroll:M,zoomOnPinch:P,zoomOnDoubleClick:B,panOnScroll:H,panOnScrollSpeed:E,panOnScrollMode:j,panOnDrag:O,autoPanOnSelection:Q,defaultViewport:U,translateExtent:$,minZoom:G,maxZoom:I,onSelectionContextMenu:f,preventScrolling:D,noDragClassName:Fe,noWheelClassName:dt,noPanClassName:st,disableKeyboardA11y:Ue,onViewportChange:_e,isControlledViewport:!!ae,children:o.jsxs(pB,{children:[o.jsx(fB,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:de,onReconnectStart:Ke,onReconnectEnd:He,onlyRenderVisibleElements:L,onEdgeContextMenu:Ne,onEdgeMouseEnter:Te,onEdgeMouseMove:ne,onEdgeMouseLeave:pe,reconnectRadius:le,defaultMarkerColor:A,noPanClassName:st,disableKeyboardA11y:Ue,rfId:Z}),o.jsx(kB,{style:k,type:g,component:w,containerStyle:m}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(VU,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:me,onlyRenderVisibleElements:L,noPanClassName:st,noDragClassName:Fe,disableKeyboardA11y:Ue,nodeExtent:at,rfId:Z,nodesDraggable:x}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}oA.displayName="GraphView";const EB=y.memo(oA),NB=i2(),Fw=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:p="basic"}={})=>{const h=new Map,g=new Map,k=new Map,w=new Map,m=r??t??[],b=n??e??[],v=d??[0,0],S=f??Ic;b2(k,w,m);const{nodesInitialized:T}=j0(b,h,g,{nodeOrigin:v,nodeExtent:S,zIndexMode:p});let N=[0,0,1];if(a&&i&&s){const _=gu(h,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:R,y:L,zoom:C}=Ix(_,i,s,c,u,(l==null?void 0:l.padding)??.1);N=[R,L,C]}return{rfId:"1",width:i??0,height:s??0,transform:N,nodes:b,nodesInitialized:T,nodeLookup:h,parentLookup:g,edges:m,edgeLookup:w,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Ic,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ul.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,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:{...QT},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:NB,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:ZT,zIndexMode:p,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}},_B=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p})=>U8((h,g)=>{async function k(){const{nodeLookup:w,panZoom:m,fitViewOptions:b,fitViewResolver:v,width:S,height:T,minZoom:N,maxZoom:_}=g();m&&(await S9({nodes:w,width:S,height:T,panZoom:m,minZoom:N,maxZoom:_},b),v==null||v.resolve(!0),h({fitViewResolver:null}))}return{...Fw({nodes:e,edges:t,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:p}),setNodes:w=>{const{nodeLookup:m,parentLookup:b,nodeOrigin:v,nodeExtent:S,elevateNodesOnSelect:T,fitViewQueued:N,zIndexMode:_,nodesSelectionActive:R}=g(),{nodesInitialized:L,hasSelectedNodes:C}=j0(w,m,b,{nodeOrigin:v,nodeExtent:S,elevateNodesOnSelect:T,checkEquality:!0,zIndexMode:_}),U=R&&C;N&&L?(k(),h({nodes:w,nodesInitialized:L,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:U})):h({nodes:w,nodesInitialized:L,nodesSelectionActive:U})},setEdges:w=>{const{connectionLookup:m,edgeLookup:b}=g();b2(m,b,w),h({edges:w})},setDefaultNodesAndEdges:(w,m)=>{if(w){const{setNodes:b}=g();b(w),h({hasDefaultNodes:!0})}if(m){const{setEdges:b}=g();b(m),h({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:m,nodeLookup:b,parentLookup:v,domNode:S,nodeOrigin:T,nodeExtent:N,debug:_,fitViewQueued:R,zIndexMode:L}=g(),{changes:C,updatedInternals:U}=q9(w,b,v,S,T,N,L);U&&(F9(b,v,{nodeOrigin:T,nodeExtent:N,zIndexMode:L}),R?(k(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(C==null?void 0:C.length)>0&&(_&&console.log("React Flow: trigger node changes",C),m==null||m(C)))},updateNodePositions:(w,m=!1)=>{const b=[];let v=[];const{nodeLookup:S,triggerNodeChanges:T,connection:N,updateConnection:_,onNodesChangeMiddlewareMap:R}=g();for(const[L,C]of w){const U=S.get(L),$=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(C!=null&&C.position)),G={id:L,type:"position",position:$?{x:Math.max(0,C.position.x),y:Math.max(0,C.position.y)}:C.position,dragging:m};if(U&&N.inProgress&&N.fromNode.id===U.id){const I=va(U,N.fromHandle,Ge.Left,!0);_({...N,from:I})}$&&U.parentId&&b.push({id:L,parentId:U.parentId,rect:{...C.internals.positionAbsolute,width:C.measured.width??0,height:C.measured.height??0}}),v.push(G)}if(b.length>0){const{parentLookup:L,nodeOrigin:C}=g(),U=Hx(b,S,L,C);v.push(...U)}for(const L of R.values())v=L(v);T(v)},triggerNodeChanges:w=>{const{onNodesChange:m,setNodes:b,nodes:v,hasDefaultNodes:S,debug:T}=g();if(w!=null&&w.length){if(S){const N=L2(w,v);b(N)}T&&console.log("React Flow: trigger node changes",w),m==null||m(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:m,setEdges:b,edges:v,hasDefaultEdges:S,debug:T}=g();if(w!=null&&w.length){if(S){const N=aU(w,v);b(N)}T&&console.log("React Flow: trigger edge changes",w),m==null||m(w)}},addSelectedNodes:w=>{const{multiSelectionActive:m,edgeLookup:b,nodeLookup:v,triggerNodeChanges:S,triggerEdgeChanges:T}=g();if(m){const N=w.map(_=>$s(_,!0));S(N);return}S(al(v,new Set([...w]),!0)),T(al(b))},addSelectedEdges:w=>{const{multiSelectionActive:m,edgeLookup:b,nodeLookup:v,triggerNodeChanges:S,triggerEdgeChanges:T}=g();if(m){const N=w.map(_=>$s(_,!0));T(N);return}T(al(b,new Set([...w]))),S(al(v,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:m}={})=>{const{edges:b,nodes:v,nodeLookup:S,triggerNodeChanges:T,triggerEdgeChanges:N}=g(),_=w||v,R=m||b,L=[];for(const U of _){if(!U.selected)continue;const $=S.get(U.id);$&&($.selected=!1),L.push($s(U.id,!1))}const C=[];for(const U of R)U.selected&&C.push($s(U.id,!1));T(L),N(C)},setMinZoom:w=>{const{panZoom:m,maxZoom:b}=g();m==null||m.setScaleExtent([w,b]),h({minZoom:w})},setMaxZoom:w=>{const{panZoom:m,minZoom:b}=g();m==null||m.setScaleExtent([b,w]),h({maxZoom:w})},setTranslateExtent:w=>{var m;(m=g().panZoom)==null||m.setTranslateExtent(w),h({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:m,triggerNodeChanges:b,triggerEdgeChanges:v,elementsSelectable:S}=g();if(!S)return;const T=m.reduce((_,R)=>R.selected?[..._,$s(R.id,!1)]:_,[]),N=w.reduce((_,R)=>R.selected?[..._,$s(R.id,!1)]:_,[]);b(T),v(N)},setNodeExtent:w=>{const{nodes:m,nodeLookup:b,parentLookup:v,nodeOrigin:S,elevateNodesOnSelect:T,nodeExtent:N,zIndexMode:_}=g();w[0][0]===N[0][0]&&w[0][1]===N[0][1]&&w[1][0]===N[1][0]&&w[1][1]===N[1][1]||(j0(m,b,v,{nodeOrigin:S,nodeExtent:w,elevateNodesOnSelect:T,checkEquality:!1,zIndexMode:_}),h({nodeExtent:w}))},panBy:w=>{const{transform:m,width:b,height:v,panZoom:S,translateExtent:T}=g();return Y9({delta:w,panZoom:S,transform:m,translateExtent:T,width:b,height:v})},setCenter:async(w,m,b)=>{const{width:v,height:S,maxZoom:T,panZoom:N}=g();if(!N)return!1;const _=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:T;return await N.setViewport({x:v/2-w*_,y:S/2-m*_,zoom:_},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),!0},cancelConnection:()=>{h({connection:{...QT}})},updateConnection:w=>{h({connection:w})},reset:()=>h({...Fw()})}},Object.is);function CB({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:h}){const[g]=y.useState(()=>_B({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p}));return o.jsx(B8,{value:g,children:o.jsx(dU,{children:o.jsx(_U,{children:h})})})}function TB({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:p,zIndexMode:h}){return y.useContext(zp)?o.jsx(o.Fragment,{children:e}):o.jsx(CB,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:p,zIndexMode:h,children:e})}const AB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function MB({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:g,onConnectEnd:k,onClickConnectStart:w,onClickConnectEnd:m,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:S,onNodeContextMenu:T,onNodeDoubleClick:N,onNodeDragStart:_,onNodeDrag:R,onNodeDragStop:L,onNodesDelete:C,onEdgesDelete:U,onDelete:$,onSelectionChange:G,onSelectionDragStart:I,onSelectionDrag:D,onSelectionDragStop:A,onSelectionContextMenu:M,onSelectionStart:P,onSelectionEnd:H,onBeforeDelete:E,connectionMode:j,connectionLineType:B=ns.Bezier,connectionLineStyle:O,connectionLineComponent:Q,connectionLineContainerStyle:F,deleteKeyCode:J="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:K=!1,selectionMode:q=Lc.Full,panActivationKeyCode:V="Space",multiSelectionKeyCode:ue=Pc()?"Meta":"Control",zoomActivationKeyCode:me=Pc()?"Meta":"Control",snapToGrid:Ne,snapGrid:Te,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:pe,nodesDraggable:le,autoPanOnNodeFocus:de,nodesConnectable:Ke,nodesFocusable:He,nodeOrigin:Fe=D2,edgesFocusable:dt,edgesReconnectable:st,elementsSelectable:Ue=!0,defaultViewport:at=J8,minZoom:Z=.5,maxZoom:ae=2,translateExtent:_e=Ic,preventScrolling:x=!0,nodeExtent:Y,defaultMarkerColor:se="#b1b1b7",zoomOnScroll:ge=!0,zoomOnPinch:oe=!0,panOnScroll:z=!1,panOnScrollSpeed:re=.5,panOnScrollMode:ie=ta.Free,zoomOnDoubleClick:he=!0,panOnDrag:be=!0,onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:Ae,onPaneMouseLeave:Me,onPaneScroll:Ie,onPaneContextMenu:Le,paneClickDistance:$e=1,nodeClickDistance:qe=0,children:gt,onReconnect:ft,onReconnectStart:Dt,onReconnectEnd:St,onEdgeContextMenu:Qt,onEdgeDoubleClick:It,onEdgeMouseEnter:Yt,onEdgeMouseMove:te,onEdgeMouseLeave:je,reconnectRadius:W=10,onNodesChange:fe,onEdgesChange:Oe,noDragClassName:Je="nodrag",noWheelClassName:tt="nowheel",noPanClassName:Lt="nopan",fitView:Mr,fitViewOptions:As,connectOnClick:Ms,attributionPosition:Ma,proOptions:oo,defaultEdgeOptions:ci,elevateNodesOnSelect:js=!0,elevateEdgesOnSelect:co=!1,disableKeyboardA11y:ja=!1,autoPanOnConnect:uo,autoPanOnNodeDrag:Pi,autoPanOnSelection:mn=!0,autoPanSpeed:Oa,connectionRadius:Os,isValidConnection:Ra,onError:ee,style:we,id:Ve,nodeDragThreshold:pt,connectionDragThreshold:Gt,viewport:Fn,onViewportChange:On,width:Da,height:Ot,colorMode:Xp="light",debug:Ia,onScroll:Rs,ariaLabelConfig:_u,zIndexMode:fo="basic",...X},ke){const Re=Ve||"1",ve=rU(Xp),Be=y.useCallback(wt=>{wt.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Rs==null||Rs(wt)},[Rs]);return o.jsx("div",{"data-testid":"rf__wrapper",...X,onScroll:Be,style:{...we,...AB},ref:ke,className:un(["react-flow",i,ve]),id:Ve,role:"application",children:o.jsxs(TB,{nodes:e,edges:t,width:Da,height:Ot,fitView:Mr,fitViewOptions:As,minZoom:Z,maxZoom:ae,nodeOrigin:Fe,nodeExtent:Y,zIndexMode:fo,children:[o.jsx(nU,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:g,onConnectEnd:k,onClickConnectStart:w,onClickConnectEnd:m,nodesDraggable:le,autoPanOnNodeFocus:de,nodesConnectable:Ke,nodesFocusable:He,edgesFocusable:dt,edgesReconnectable:st,elementsSelectable:Ue,elevateNodesOnSelect:js,elevateEdgesOnSelect:co,minZoom:Z,maxZoom:ae,nodeExtent:Y,onNodesChange:fe,onEdgesChange:Oe,snapToGrid:Ne,snapGrid:Te,connectionMode:j,translateExtent:_e,connectOnClick:Ms,defaultEdgeOptions:ci,fitView:Mr,fitViewOptions:As,onNodesDelete:C,onEdgesDelete:U,onDelete:$,onNodeDragStart:_,onNodeDrag:R,onNodeDragStop:L,onSelectionDrag:D,onSelectionDragStart:I,onSelectionDragStop:A,onMove:d,onMoveStart:f,onMoveEnd:p,noPanClassName:Lt,nodeOrigin:Fe,rfId:Re,autoPanOnConnect:uo,autoPanOnNodeDrag:Pi,autoPanSpeed:Oa,onError:ee,connectionRadius:Os,isValidConnection:Ra,selectNodesOnDrag:pe,nodeDragThreshold:pt,connectionDragThreshold:Gt,onBeforeDelete:E,debug:Ia,ariaLabelConfig:_u,zIndexMode:fo}),o.jsx(EB,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:S,onNodeContextMenu:T,onNodeDoubleClick:N,nodeTypes:s,edgeTypes:a,connectionLineType:B,connectionLineStyle:O,connectionLineComponent:Q,connectionLineContainerStyle:F,selectionKeyCode:ce,selectionOnDrag:K,selectionMode:q,deleteKeyCode:J,multiSelectionKeyCode:ue,panActivationKeyCode:V,zoomActivationKeyCode:me,onlyRenderVisibleElements:ne,defaultViewport:at,translateExtent:_e,minZoom:Z,maxZoom:ae,preventScrolling:x,zoomOnScroll:ge,zoomOnPinch:oe,zoomOnDoubleClick:he,panOnScroll:z,panOnScrollSpeed:re,panOnScrollMode:ie,panOnDrag:be,autoPanOnSelection:mn,onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:Ae,onPaneMouseLeave:Me,onPaneScroll:Ie,onPaneContextMenu:Le,paneClickDistance:$e,nodeClickDistance:qe,onSelectionContextMenu:M,onSelectionStart:P,onSelectionEnd:H,onReconnect:ft,onReconnectStart:Dt,onReconnectEnd:St,onEdgeContextMenu:Qt,onEdgeDoubleClick:It,onEdgeMouseEnter:Yt,onEdgeMouseMove:te,onEdgeMouseLeave:je,reconnectRadius:W,defaultMarkerColor:se,noDragClassName:Je,noWheelClassName:tt,noPanClassName:Lt,rfId:Re,disableKeyboardA11y:ja,nodeExtent:Y,viewport:Fn,onViewportChange:On,nodesDraggable:le}),o.jsx(Q8,{onSelectionChange:G}),gt,o.jsx(Y8,{proOptions:oo,position:Ma}),o.jsx(q8,{rfId:Re,disableKeyboardA11y:ja})]})})}var Gx=z2(MB);function jB(e){const[t,n]=y.useState(e),r=y.useCallback(i=>n(s=>L2(i,s)),[]);return[t,n,r]}function OB({dimensions:e,lineWidth:t,variant:n,className:r}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:un(["react-flow__background-pattern",n,r])})}function RB({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:un(["react-flow__background-pattern","dots",t])})}var ys;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ys||(ys={}));const DB={[ys.Dots]:1,[ys.Lines]:1,[ys.Cross]:6},IB=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function cA({id:e,variant:t=ys.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=y.useRef(null),{transform:p,patternId:h}=bt(IB,Vt),g=r||DB[t],k=t===ys.Dots,w=t===ys.Cross,m=Array.isArray(n)?n:[n,n],b=[m[0]*p[2]||1,m[1]*p[2]||1],v=g*p[2],S=Array.isArray(s)?s:[s,s],T=w?[v,v]:b,N=[S[0]*p[2]+T[0]/2,S[1]*p[2]+T[1]/2],_=`${h}${e||""}`;return o.jsxs("svg",{className:un(["react-flow__background",u]),style:{...c,...Up,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:_,x:p[0]%b[0],y:p[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:k?o.jsx(RB,{radius:v/2,className:d}):o.jsx(OB,{dimensions:T,lineWidth:i,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}cA.displayName="Background";const Kx=y.memo(cA);function LB(){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 zB(){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 PB(){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 UB(){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 BB(){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 id({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:un(["react-flow__controls-button",t]),...n,children:e})}const HB=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function uA({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:p="vertical","aria-label":h}){const g=$t(),{isInteractive:k,minZoomReached:w,maxZoomReached:m,ariaLabelConfig:b}=bt(HB,Vt),{zoomIn:v,zoomOut:S,fitView:T}=Fx(),N=()=>{v(),s==null||s()},_=()=>{S(),a==null||a()},R=()=>{T(i),l==null||l()},L=()=>{g.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},C=p==="horizontal"?"horizontal":"vertical";return o.jsxs(Pp,{className:un(["react-flow__controls",C,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":h??b["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(id,{onClick:N,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:m,children:o.jsx(LB,{})}),o.jsx(id,{onClick:_,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:w,children:o.jsx(zB,{})})]}),n&&o.jsx(id,{className:"react-flow__controls-fitview",onClick:R,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:o.jsx(PB,{})}),r&&o.jsx(id,{className:"react-flow__controls-interactive",onClick:L,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:k?o.jsx(BB,{}):o.jsx(UB,{})}),d]})}uA.displayName="Controls";const qx=y.memo(uA);function FB({id:e,x:t,y:n,width:r,height:i,style:s,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:p,onClick:h}){const{background:g,backgroundColor:k}=s||{},w=a||g||k;return o.jsx("rect",{className:un(["react-flow__minimap-node",{selected:p},u]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:w,stroke:l,strokeWidth:c},shapeRendering:f,onClick:h?m=>h(m,e):void 0})}const $B=y.memo(FB),GB=e=>e.nodes.map(t=>t.id),Jh=e=>e instanceof Function?e:()=>e;function KB({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=$B,onClick:a}){const l=bt(GB,Vt),c=Jh(t),u=Jh(e),d=Jh(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(p=>o.jsx(YB,{id:p,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:a,shapeRendering:f},p))})}function qB({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:p,height:h}=bt(g=>{const k=g.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const w=k.internals.userNode,{x:m,y:b}=k.internals.positionAbsolute,{width:v,height:S}=Kr(w);return{node:w,x:m,y:b,width:v,height:S}},Vt);return!u||u.hidden||!s2(u)?null:o.jsx(l,{x:d,y:f,width:p,height:h,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:s,shapeRendering:a,onClick:c,id:u.id})}const YB=y.memo(qB);var VB=y.memo(KB);const XB=200,WB=150,ZB=e=>!e.hidden,QB=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 r of e.nodeLookup.values())if(!r.hidden){n=!0;break}return{viewBB:t,boundingRect:n?n2(gu(e.nodeLookup,{filter:ZB}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},$w=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,JB=(e,t)=>$w(e.viewBB,t.viewBB)&&$w(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,eH="react-flow__minimap-desc";function dA({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:p="bottom-right",onClick:h,onNodeClick:g,pannable:k=!1,zoomable:w=!1,ariaLabel:m,inversePan:b,zoomStep:v=1,offsetScale:S=5}){const T=$t(),N=y.useRef(null),{boundingRect:_,panZoom:R,viewBB:L,rfId:C,translateExtent:U,flowWidth:$,flowHeight:G,ariaLabelConfig:I}=bt(QB,JB),D=(e==null?void 0:e.width)??XB,A=(e==null?void 0:e.height)??WB,M=_.width/D,P=_.height/A,H=Math.max(M,P),E=H*D,j=H*A,B=S*H,O=_.x-(E-_.width)/2-B,Q=_.y-(j-_.height)/2-B,F=E+B*2,J=j+B*2,ce=`${eH}-${C}`,K=y.useRef(0),q=y.useRef();K.current=H,y.useEffect(()=>{const Te=T.getState().panZoom;if(N.current&&Te)return q.current=n8({domNode:N.current,panZoom:Te,getTransform:()=>T.getState().transform,getViewScale:()=>K.current}),()=>{var ne;(ne=q.current)==null||ne.destroy()}},[R]),y.useEffect(()=>{var Te;(Te=q.current)==null||Te.update({translateExtent:U,width:$,height:G,inversePan:b,pannable:k,zoomStep:v,zoomable:w})},[k,w,b,v,U,$,G]);const V=h?Te=>{var le;const[ne,pe]=((le=q.current)==null?void 0:le.pointer(Te))||[0,0];h(Te,{x:ne,y:pe})}:void 0,ue=y.useCallback((Te,ne)=>{const pe=T.getState().nodeLookup.get(ne).internals.userNode;g==null||g(Te,pe)},[g]),me=g?ue:void 0,Ne=m??I["minimap.ariaLabel"];return o.jsx(Pp,{position:p,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*H:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r: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:un(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:D,height:A,viewBox:`${O} ${Q} ${F} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:N,onClick:V,children:[Ne&&o.jsx("title",{id:ce,children:Ne}),o.jsx(VB,{onClick:me,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${O-B},${Q-B}h${F+B*2}v${J+B*2}h${-F-B*2}z
483
- M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}dA.displayName="MiniMap";y.memo(dA);const tH=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,nH={[$l.Line]:"right",[$l.Handle]:"bottom-right"};function rH({nodeId:e,position:t,variant:n=$l.Handle,className:r,style:i=void 0,children:s,color:a,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:p,autoScale:h=!0,shouldResize:g,onResizeStart:k,onResize:w,onResizeEnd:m}){const b=F2(),v=typeof e=="string"?e:b,S=$t(),T=y.useRef(null),N=n===$l.Handle,_=bt(y.useCallback(tH(N&&h),[N,h]),Vt),R=y.useRef(null),L=t??nH[n];y.useEffect(()=>{if(!(!T.current||!v))return R.current||(R.current=m8({domNode:T.current,nodeId:v,getStoreItems:()=>{const{nodeLookup:U,transform:$,snapGrid:G,snapToGrid:I,nodeOrigin:D,domNode:A}=S.getState();return{nodeLookup:U,transform:$,snapGrid:G,snapToGrid:I,nodeOrigin:D,paneDomNode:A}},onChange:(U,$)=>{const{triggerNodeChanges:G,nodeLookup:I,parentLookup:D,nodeOrigin:A}=S.getState(),M=[],P={x:U.x,y:U.y},H=I.get(v);if(H&&H.expandParent&&H.parentId){const E=H.origin??A,j=U.width??H.measured.width??0,B=U.height??H.measured.height??0,O={id:H.id,parentId:H.parentId,rect:{width:j,height:B,...a2({x:U.x??H.position.x,y:U.y??H.position.y},{width:j,height:B},H.parentId,I,E)}},Q=Hx([O],I,D,A);M.push(...Q),P.x=U.x?Math.max(E[0]*j,U.x):void 0,P.y=U.y?Math.max(E[1]*B,U.y):void 0}if(P.x!==void 0&&P.y!==void 0){const E={id:v,type:"position",position:{...P}};M.push(E)}if(U.width!==void 0&&U.height!==void 0){const j={id:v,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};M.push(j)}for(const E of $){const j={...E,type:"position"};M.push(j)}G(M)},onEnd:({width:U,height:$})=>{const G={id:v,type:"dimensions",resizing:!1,dimensions:{width:U,height:$}};S.getState().triggerNodeChanges([G])}})),R.current.update({controlPosition:L,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:p,onResizeStart:k,onResize:w,onResizeEnd:m,shouldResize:g}),()=>{var U;(U=R.current)==null||U.destroy()}},[L,l,c,u,d,f,k,w,m,g]);const C=L.split("-");return o.jsx("div",{className:un(["react-flow__resize-control","nodrag",...C,n,r]),ref:T,style:{...i,scale:_,...a&&{[N?"backgroundColor":"borderColor"]:a}},children:s})}y.memo(rH);function Er({className:e}){return o.jsx("div",{className:ye("animate-pulse rounded bg-neutral-800/70",e)})}function Bp({rows:e=5,className:t}){return o.jsx("div",{className:ye("space-y-1.5 p-2",t),"aria-busy":"true",children:Array.from({length:e},(n,r)=>o.jsxs("div",{className:"flex items-center gap-2 rounded-lg px-2 py-1.5",children:[o.jsx(Er,{className:"h-4 w-4 shrink-0 rounded"}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[o.jsx(Er,{className:ye("h-3",r%3===0?"w-2/3":"w-1/2")}),o.jsx(Er,{className:"h-2.5 w-1/3"})]})]},r))})}function fA({count:e=6,className:t}){return o.jsx("div",{className:ye("grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3",t),"aria-busy":"true",children:Array.from({length:e},(n,r)=>o.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.06] bg-neutral-900/40 p-3",children:[o.jsx(Er,{className:"h-3.5 w-1/2"}),o.jsx(Er,{className:"h-2.5 w-full"}),o.jsx(Er,{className:"h-2.5 w-4/5"}),o.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[o.jsx(Er,{className:"h-4 w-12 rounded-full"}),o.jsx(Er,{className:"h-4 w-8 rounded-full"})]})]},r))})}function iH({lines:e=8,className:t}){return o.jsx("div",{className:ye("space-y-2 p-3",t),"aria-busy":"true",children:Array.from({length:e},(n,r)=>o.jsx(Er,{className:ye("h-3",r%4===3?"w-1/2":r%5===0?"w-3/4":"w-full")},r))})}function sH(){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(Er,{className:"h-6 w-24 rounded-lg"}),o.jsx(Er,{className:"h-6 w-16 rounded-lg"}),o.jsx(Er,{className:"h-6 w-20 rounded-lg"})]}),o.jsx(fA,{count:6})]})}function na({checked:e,onChange:t,title:n,disabled:r}){return o.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-disabled":r||void 0,title:n,disabled:r,onClick:i=>{i.stopPropagation(),!r&&t(!e)},className:ye("nodrag relative h-4 w-7 shrink-0 rounded-full transition-colors duration-200",e?"bg-emerald-500/80":"bg-neutral-600",r&&"opacity-50"),children:o.jsx("span",{className:ye("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 aH={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 sd(){window.dispatchEvent(new Event("weave:rules-changed"))}function lH({projectId:e,renderRules:t}){const n=We(),[r,i]=y.useState(null),[s,a]=y.useState(null),[l,c]=y.useState(new Set),[u,d]=y.useState(null),{show:f}=Zt(),p=cn(),h=y.useCallback(()=>{Promise.all([Se.listHookPlugins(e),e===void 0?Promise.resolve(null):Se.listHookPlugins()]).then(([b,v])=>{i(b),a(v)}).catch(()=>i(b=>b??[]))},[e]);y.useEffect(()=>{h();const b=v=>{const S=v.detail;((S==null?void 0:S.kind)==="plugin.reloaded"||(S==null?void 0:S.kind)==="plugin.toggled")&&(h(),sd())};return window.addEventListener("weave:hook",b),()=>window.removeEventListener("weave:hook",b)},[h]);const g=(b,v)=>{p.run(`toggle:${b.id}`,async()=>{await Se.toggleHookPlugin(b.id,v,e),h(),sd()},{fail:S=>n("hooks.plugins.toggleFail",{error:Xe(S)})})},k=async b=>{await p.run(`uninstall:${b.id}`,async()=>{await Se.uninstallHookPlugin(b.id),h(),sd(),f("success",n("hooks.plugins.uninstallOk",{id:b.id}))},{fail:v=>n("hooks.plugins.uninstallFail",{error:Xe(v)})})},w=()=>{p.run("rescan",async()=>{const b=await Se.rescanHookPlugins();h(),sd(),f("success",n("hooks.plugins.rescanOk",{n:b}))},{fail:b=>n("hooks.plugins.rescanFail",{error:Xe(b)})})};if(r===null)return null;const m=new Map((s??[]).map(b=>[b.id,b.status]));return o.jsxs("div",{className:"space-y-2",children:[r.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:n("hooks.plugins.empty")}),r.map(b=>{const v=m.get(b.id),S=e!==void 0&&v!==void 0&&v!==b.status,T=l.has(b.id),N=!!t&&b.ruleCount>0;return o.jsxs("div",{className:"rounded-md border border-white/[0.06] bg-white/[0.015] overflow-hidden",children:[o.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[N&&o.jsx("button",{type:"button",onClick:()=>c(_=>Js(_,b.id)),title:n(T?"hooks.plugins.expand":"hooks.plugins.collapse"),className:"shrink-0 text-neutral-500 hover:text-neutral-300 [&_svg]:pointer-events-none",children:T?o.jsx(Un,{className:"h-3.5 w-3.5"}):o.jsx(Pn,{className:"h-3.5 w-3.5"})}),o.jsx(Ec,{className:ye("h-3.5 w-3.5 shrink-0",b.status==="active"?"text-emerald-400":b.status==="disabled"?"text-neutral-600":"text-red-400")}),o.jsx("span",{className:"shrink-0 text-xs font-medium text-neutral-200",children:b.name}),o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",children:b.id}),o.jsx(Ye,{className:ye("shrink-0",aH[b.scope]),children:b.scope}),o.jsxs("span",{className:"shrink-0 text-[10px] text-neutral-600",children:["v",b.version]}),o.jsx("span",{className:"shrink-0 text-[11px] text-neutral-500",children:n("hooks.plugins.rules",{n:b.ruleCount})}),b.status==="rejected"&&b.error&&o.jsx("span",{className:"min-w-0 truncate text-[11px] text-red-400/90",title:b.error,children:b.error}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[e!==void 0&&b.status!=="rejected"&&v!==void 0&&o.jsx(Ye,{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(b),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:p.stateOf(`uninstall:${b.id}`),className:"h-3 w-3",icon:o.jsx("span",{className:"text-[11px]",children:"✕"})})}),o.jsx(na,{checked:b.status!=="disabled",onChange:_=>void g(b,_),title:b.status==="rejected"?n("hooks.plugins.rejectedTip"):n("hooks.plugins.toggleTip")})]})]}),N&&!T&&o.jsx("div",{className:"px-2 pb-2 pl-7",children:t(b)})]},b.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(gk,{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-white/[0.06] hover:text-neutral-200",children:[o.jsx(ut,{state:p.stateOf("rescan"),className:"h-3 w-3",icon:o.jsx(gk,{className:"h-3 w-3"})}),n("hooks.plugins.rescan")]})]}),o.jsx(so,{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 pA=["log","webhook","inject","manual","plugin"],Gf={log:"hooks.handler.log",webhook:"hooks.handler.webhook",inject:"hooks.handler.inject",manual:"hooks.handler.manual",plugin:"hooks.handler.plugin"},oH={log:"hooks.handlerLogTip",webhook:"hooks.handlerWebhookTip",inject:"hooks.handlerInjectTip",manual:"hooks.handlerManualTip",plugin:"hooks.handlerPluginTip"},Yx={log:CC,webhook:FD,inject:n0,manual:CD,plugin:a0},cH=["hook-event","claude-event"],uH=[...qt,"any"];function em(e){return e instanceof Error?e.message:String(e)}function Gw(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function Kw(){window.dispatchEvent(new Event("weave:rules-changed"))}function dH({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(Ep,{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(kn,{type:"source",position:Ge.Right,className:"!bg-amber-400/80"})]})}function fH({data:e}){const t=We(),n=e.rule,r=Yx[n.handler.type],i=_c(n.source),s=i.kind==="webhook"?i.routeId:i.event;return o.jsxs("div",{className:ye("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-white/[0.08] opacity-60"),children:[o.jsx(kn,{type:"target",position:Ge.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(Ye,{variant:"command",className:"gap-1",children:[o.jsx(r,{className:"h-3 w-3"}),t(Gf[n.handler.type])]}),o.jsxs("span",{className:"truncate text-[10px] text-neutral-500",title:e.scopeLabel,children:[s," · ",e.scopeLabel]})]}),o.jsx(kn,{type:"source",position:Ge.Right,className:"!bg-blue-400/80"})]})}function pH({data:e}){const t=We(),n=Yx[e.handlerType];return o.jsxs("div",{className:"flex w-[170px] items-center gap-2 rounded-lg border border-white/[0.08] bg-neutral-900/90 px-3 py-2 shadow-mac-sm",children:[o.jsx(kn,{type:"target",position:Ge.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(Gf[e.handlerType])}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:e.count}),o.jsx(kn,{type:"source",position:Ge.Right,className:"!bg-blue-400/80"})]})}const hH={source:dH,rule:fH,handler:pH},mH=[],tm={source:0,rule:320,handler:640},nm=100;function gH(e,t,n){const r=[],i=[],s=new Set;for(const a of e){const l=_c(a.source);l.kind==="hook-event"&&s.add(l.event)}return LC.filter(a=>s.has(a)).forEach((a,l)=>{r.push({id:`src:${a}`,type:"source",position:{x:tm.source,y:l*nm},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});r.push({id:`rule:${a.id}`,type:"rule",position:{x:tm.rule,y:l*nm},data:{rule:a,scopeLabel:c}});const u=_c(a.source);u.kind==="hook-event"&&i.push({id:`e:${u.event}->${a.id}`,source:`src:${u.event}`,target:`rule:${a.id}`,data:{ruleId:a.id}}),i.push({id:`e:${a.id}->${a.handler.type}`,source:`rule:${a.id}`,target:`h:${a.handler.type}`,data:{ruleId:a.id}})}),pA.filter(a=>e.some(l=>l.handler.type===a)).forEach((a,l)=>{r.push({id:`h:${a}`,type:"handler",position:{x:tm.handler,y:l*nm},data:{handlerType:a,count:e.filter(c=>c.handler.type===a).length}})}),{nodes:r,edges:i}}function bH(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 xH(e){const t=e.handler,n=_c(e.source);return{name:e.name,projectId:e.projectId,sourceKind:e.source.kind==="claude-event"?"claude-event":"hook-event",harness:XD(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 yH(){const e=We(),{show:t}=Zt(),n=cn(),[r,i]=y.useState(null),s=y.useCallback(()=>{Se.getCapture().then(i).catch(()=>{})},[]);if(y.useEffect(()=>Ri("capture",s),[s]),r===null||r.length===0)return null;const a=(l,c)=>{n.run(`capture:${l.harness}`,async()=>{const u=await Se.putCapture(l.harness,c);i(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:Xe(u)})})};return o.jsxs(Ns,{children:[o.jsxs(pa,{className:"flex-row items-center gap-2 space-y-0",children:[o.jsx(ha,{className:"text-sm",children:e("hooks.capture.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:e("hooks.capture.hint")})]}),o.jsxs(ma,{className:"space-y-2",children:[r.map(l=>o.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-white/[0.06] bg-white/[0.015] px-2 py-1.5",children:[o.jsx(Ep,{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:An(l.harness).label}),l.installed&&!l.helperPresent&&o.jsx(Ye,{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(na,{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 vH({projectId:e,mode:t}){const n=We(),[r,i]=y.useState(null),[s,a]=y.useState(new Map),[l,c]=y.useState([]),[u,d]=y.useState(null),[f,p]=y.useState(null),[h,g]=y.useState(null),[k,w]=y.useState(null),m=y.useMemo(()=>new Map(l.map(E=>[E.id,E.name])),[l]),b=y.useCallback(async()=>{try{const E=t==="project",[j,B]=await Promise.all([Se.listHooksRules(E?e:void 0),E?Se.listHookPlugins(e):Promise.resolve(null)]);i(j),a(new Map((B==null?void 0:B.map(O=>[O.id,O.status]))??[]))}catch(E){d(em(E))}},[t,e]),v=y.useCallback(E=>t==="project"&&E.pluginId!=null?s.get(E.pluginId)==="active":E.enabled,[t,s]);y.useEffect(()=>{b(),Se.listProjects().then(c).catch(()=>{})},[b]),y.useEffect(()=>{const E=()=>{b()};return window.addEventListener("weave:rules-changed",E),()=>window.removeEventListener("weave:rules-changed",E)},[b]);const S=y.useCallback(async E=>{if(k!==E){w(E);return}try{await Se.deleteHookRule(E),w(null),(f==null?void 0:f.editingId)===E&&p(null),Kw()}catch(j){d(em(j))}},[k,f]),[T,N,_]=jB([]),R=y.useMemo(()=>r?gH(r.filter(v),m,n):null,[r,v,m,n]),L=(R==null?void 0:R.edges)??mH;y.useEffect(()=>{R&&N(E=>{const j=new Map(E.map(B=>[B.id,B.position]));return R.nodes.map(B=>{const O=j.get(B.id);return O?{...B,position:O}:B})})},[R,N]);const C=()=>{g(null),p({editingId:null,state:bH(t==="project"?e:null)})},U=E=>{g(null),p({editingId:E.id,state:xH(E)})},$=()=>{p(null),g(null)},G=E=>p(j=>j&&{...j,state:{...j.state,...E}}),I=E=>p(j=>{if(!j)return j;let B=j.state.event;return E==="inject"&&!Uh.includes(B)&&(B="PostToolUse"),{...j,state:{...j.state,handlerType:E,event:B,record:E==="log"?!1:j.state.record}}}),D=()=>{f&&(g(null),p({...f,state:{...f.state,name:n("hooks.quickTemplateName"),event:"PostToolUse",toolNames:"",pathGlobs:"**/*.md",crossProjectOnly:!1,handlerType:"inject",template:n("hooks.quickTemplatePrompt"),url:"",secret:"",record:!0,enabled:!1}}))},A=async()=>{if(!f)return;const E=f.state,j=E.name.trim();if(!j){g(n("hooks.errNameRequired"));return}if((E.handlerType==="inject"||E.handlerType==="manual")&&!E.template.trim()){g(n("hooks.errTemplateRequired"));return}if(E.handlerType==="webhook")try{new URL(E.url.trim())}catch{g(n("hooks.errUrlRequired"));return}if(E.handlerType==="plugin"&&(!E.pluginId.trim()||!E.pluginHandlerType.trim())){g(n("hooks.errPluginRequired"));return}const B=E.handlerType==="log"?{type:"log"}:E.handlerType==="webhook"?{type:"webhook",url:E.url.trim(),...E.secret.trim()?{secret:E.secret.trim()}:{}}:E.handlerType==="plugin"?{type:"plugin",pluginId:E.pluginId.trim(),handlerType:E.pluginHandlerType.trim()}:{type:E.handlerType,template:E.template.trim()},O={},Q=Gw(E.toolNames),F=Gw(E.pathGlobs);Q.length&&(O.toolNames=Q),F.length&&(O.pathGlobs=F),E.crossProjectOnly&&(O.crossProjectOnly=!0);const J=E.sourceKind==="claude-event"?{kind:"claude-event",event:E.event}:{kind:"hook-event",harness:E.harness,event:E.event},ce={name:j,enabled:E.enabled,projectId:E.projectId,source:J,filter:O,handler:B,record:E.record};try{f.editingId?await Se.updateHookRule(f.editingId,ce):await Se.createHookRule(ce),$(),d(null),Kw()}catch(K){g(em(K))}},M=E=>{const j=E.filter.toolNames??[],B=E.filter.pathGlobs??[],O=_c(E.source),Q=O.kind==="webhook"?O.routeId:O.event,F=Yx[E.handler.type];return o.jsxs("div",{className:ye("rounded-lg border px-3 py-2 transition-colors",E.enabled?"border-white/[0.08] bg-neutral-900/40":"border-white/[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:E.name}),o.jsx(Ye,{variant:"helper",children:Q}),o.jsx("button",{type:"button",title:n("hooks.edit"),onClick:()=>U(E),className:"rounded p-1 text-neutral-500 transition-colors hover:text-neutral-200",children:o.jsx(_C,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",title:k===E.id?n("hooks.confirmDelete"):n("hooks.delete"),onClick:()=>void S(E.id),className:ye("rounded px-1.5 py-1 text-[11px] font-medium transition-colors",k===E.id?"bg-red-900/60 text-red-300":"text-neutral-500 hover:text-red-300"),children:k===E.id?n("hooks.confirmDelete"):o.jsx(Fr,{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(Ye,{variant:"command",className:"gap-1",children:[o.jsx(F,{className:"h-3 w-3"}),n(Gf[E.handler.type])]}),o.jsx(Ye,{variant:"default",children:E.projectId===null?n("hooks.scopeGlobal"):m.has(E.projectId)?n("hooks.scopeProjectName",{name:m.get(E.projectId)}):n("hooks.scopeProjectId",{id:E.projectId})}),j.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-0.5",title:n("hooks.filterToolTip",{names:j.join(", ")}),children:[o.jsx($D,{className:"h-3 w-3"}),j.length]}),B.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-0.5",title:n("hooks.filterPathTip",{paths:B.join(", ")}),children:[o.jsx(ou,{className:"h-3 w-3"}),B.length]}),E.filter.crossProjectOnly&&o.jsx("span",{className:"inline-flex items-center gap-0.5",title:n("hooks.filterCrossTip"),children:o.jsx(r0,{className:"h-3 w-3"})}),j.length===0&&B.length===0&&!E.filter.crossProjectOnly&&o.jsx("span",{children:n("hooks.filterNone")})]})]},E.id)},P=(r??[]).filter(E=>!E.pluginId),H=new Map;for(const E of r??[]){if(!E.pluginId)continue;const j=H.get(E.pluginId)??[];j.push(E),H.set(E.pluginId,j)}return o.jsxs("div",{className:"space-y-3",children:[u&&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:u}),t==="global"&&o.jsx(yH,{}),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:()=>f&&f.editingId===null?$():C(),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:f&&f.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(wp,{className:"h-3.5 w-3.5"}),n("hooks.newRule")]})})]}),o.jsxs(Ns,{children:[o.jsxs(pa,{className:"flex-row items-center gap-2 space-y-0",children:[o.jsx(ha,{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(ma,{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-md border border-white/[0.06] bg-white/[0.015]",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[o.jsx(Es,{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(Ye,{variant:"skill",children:P.length})]}),o.jsx("div",{className:"space-y-2 px-3 pb-3",children:r===null?o.jsx(Bp,{rows:6,className:"p-0"}):P.length===0?o.jsx("p",{className:"py-2 text-center text-xs text-neutral-500",children:n("hooks.rulesEmpty")}):P.map(M)})]}),o.jsx(lH,{projectId:t==="project"?e:void 0,renderRules:E=>(H.get(E.id)??[]).length===0?null:o.jsx("div",{className:"space-y-2",children:(H.get(E.id)??[]).map(M)})})]})]}),o.jsxs(Ns,{children:[o.jsxs(pa,{className:"flex-col gap-1.5",children:[o.jsxs("div",{className:"flex w-full items-center gap-2",children:[o.jsx(ha,{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(v)&&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(rm,{icon:Ep,tone:"text-amber-400",label:n("hooks.colSource")}),o.jsx(rm,{icon:jC,tone:"text-blue-400",label:n("hooks.colRule")}),o.jsx(rm,{icon:CC,tone:"text-purple-300",label:n("hooks.colHandler")})]})]}),o.jsx(ma,{className:"p-2",children:o.jsx("div",{className:"h-80 rounded-lg border border-white/[0.06] bg-neutral-950/40",children:T.length>0?o.jsxs(Gx,{nodes:T,onNodesChange:_,edges:L,nodeTypes:hH,fitView:!0,minZoom:.15,maxZoom:1.5,nodesDraggable:!0,nodesConnectable:!1,deleteKeyCode:null,defaultEdgeOptions:{type:"smoothstep",style:{stroke:"rgba(255,255,255,0.25)",strokeWidth:1.5}},children:[o.jsx(Kx,{gap:14,size:1,color:"rgba(255,255,255,0.06)"}),o.jsx(qx,{showInteractive:!1})]}):o.jsx("div",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:r!==null&&!r.some(v)?n(r.length===0?"hooks.emptyFlow":"hooks.emptyFlowDisabled"):n("hooks.loading")})})})]}),f&&ln.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-white/[0.08] bg-neutral-900 shadow-mac",children:[o.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-white/[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:f.editingId?n("hooks.form.editTitle"):n("hooks.form.createTitle")}),!f.editingId&&o.jsx("button",{type:"button",onClick:D,title:n("hooks.quickTemplateTip"),className:"rounded-md border border-white/[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:$,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:[h&&o.jsx("p",{className:"text-xs text-red-400",children:h}),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-white/[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:f.state.name,onChange:E=>G({name:E.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-white/[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:f.state.projectId===null?"":String(f.state.projectId),onChange:E=>G({projectId:E.target.value===""?null:Number(E.target.value)}),children:[o.jsx("option",{value:"",children:n("hooks.projectGlobal")}),l.map(E=>o.jsx("option",{value:String(E.id),children:E.name},E.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-white/[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:f.state.sourceKind,onChange:E=>G({sourceKind:E.target.value}),children:cH.map(E=>o.jsx("option",{value:E,children:n(E==="hook-event"?"hooks.sourceKind.hookEvent":"hooks.sourceKind.legacy")},E))})]}),f.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-white/[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:f.state.harness,onChange:E=>G({harness:E.target.value}),children:uH.map(E=>o.jsx("option",{value:E,children:E==="any"?n("hooks.harness.any"):An(E).label},E))})]}),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-white/[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:f.state.event,onChange:E=>G({event:E.target.value}),children:(f.state.handlerType==="inject"?Uh:LC).map(E=>o.jsx("option",{value:E,children:E},E))}),f.state.handlerType==="inject"&&o.jsx("span",{className:"block text-[10px] text-amber-400/80",children:n("hooks.eventInjectHint",{events:Uh.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-white/[0.06] bg-neutral-900/60 p-0.5",children:pA.map(E=>o.jsx("button",{type:"button",title:n(oH[E]),onClick:()=>I(E),className:ye("rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",f.state.handlerType===E?"bg-neutral-800 text-neutral-100 shadow-mac-sm":"text-neutral-500 hover:text-neutral-300"),children:n(Gf[E])},E))})]})]}),f.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-white/[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:f.state.url,onChange:E=>G({url:E.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-white/[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:f.state.secret,onChange:E=>G({secret:E.target.value})})]})]}),f.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-white/[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:f.state.pluginId,onChange:E=>G({pluginId:E.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-white/[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:f.state.pluginHandlerType,onChange:E=>G({pluginHandlerType:E.target.value}),placeholder:n("hooks.pluginHandlerPlaceholder")})]})]}),(f.state.handlerType==="inject"||f.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-white/[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:f.state.template,onChange:E=>G({template:E.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-white/[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:f.state.toolNames,onChange:E=>G({toolNames:E.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-white/[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:f.state.pathGlobs,onChange:E=>G({pathGlobs:E.target.value}),placeholder:n("hooks.pathGlobsPlaceholder")})]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[o.jsx(im,{label:n("hooks.field.crossProjectOnly"),checked:f.state.crossProjectOnly,onChange:E=>G({crossProjectOnly:E})}),o.jsx(im,{label:n("hooks.field.record"),checked:f.state.record,onChange:E=>G({record:E})}),o.jsx(im,{label:n("hooks.field.enabled"),checked:f.state.enabled,onChange:E=>G({enabled:E})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:()=>void A(),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:$,className:"rounded-lg border border-white/[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 rm({icon:e,tone:t,label:n}){return o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(e,{className:ye("h-3 w-3",t)}),n]})}function im({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:r=>n(r.target.checked)}),e]})}const hA={skill:"toolkit.kind.skill",hook:"toolkit.kind.hook",mod:"toolkit.kind.mod",rule:"toolkit.kind.rule",surface:"toolkit.kind.surface"},mA={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"},kH={builtin:"toolkit.prov.builtin",market:"toolkit.prov.market"},wH={inherit:"on",on:"off",off:"inherit"},qw={inherit:"toolkit.enableDefault",on:"toolkit.enableOn",off:"toolkit.enableOff"},D0="__root__";function SH(e){const t=new Map;for(const n of e){const r=n.scope||D0,i=t.get(r)??{key:r,scope:n.scope,packs:[]};i.packs.push(n),t.set(r,i)}return[...t.values()]}function EH({projectId:e,runtimeTab:t="all",scope:n="project"}){const r=We(),[i,s]=y.useState(null),[a,l]=y.useState([]),[c,u]=y.useState([]),[d,f]=y.useState(new Set),{show:p}=Zt(),h=cn(),g=D=>`${D.provenance}:${D.sourceRoot}:${D.id}`,k=D=>h.stateOf(D)==="loading",w=y.useCallback(()=>{Se.listToolkit(e).then(D=>{s(D.packs),u(D.legacyCopies??[])}).catch(D=>{s(A=>A??[]),p("error",r("toolkit.loadFailed",{error:Xe(D)}))}),n==="user"&&Se.listPluginState(e).then(l).catch(()=>{})},[e,n,r,p]);y.useEffect(()=>{w()},[w]),y.useEffect(()=>Ri("toolkit",w),[w]);const m=async(D,A)=>{const M=g(D);k(M)||await h.run(M,async()=>{const P=await Se.toggleToolkit(e,D.id,A,D.sourceRoot);P.warnings.length>0&&p("info",P.warnings.join(";")),w()},{fail:P=>r("toolkit.toggleFailed",{error:Xe(P)})})},b=async D=>{const A=g(D);k(A)||await h.run(A,async()=>{const M=await Se.install(e,{category:"plugin",name:D.name,sourceDir:D.dir,version:D.version,description:D.description,scope:"user",agent:"claude"});if(!M.ok)throw new Error(`${M.status} ${await M.text()}`);w(),p("success",r("toolkit.userInstalled",{key:D.key??D.name}))},{fail:M=>r("toolkit.installFailed",{error:Xe(M)})})},v=async(D,A)=>{const M=g(D);k(M)||await h.run(M,async()=>{await Se.putPluginState(e,"claude",D.key,"user",A),w()},{fail:P=>r("toolkit.toggleFailed",{error:Xe(P)})})},S=async D=>{const A=g(D);k(A)||await h.run(A,async()=>{const M=await Se.uninstallToolkit(e,D.id,D.sourceRoot);M.warnings.length>0&&p("info",M.warnings.join(";")),w(),p("success",r("toolkit.uninstalled",{name:D.name}))},{fail:M=>r("toolkit.uninstallFailed",{error:Xe(M)})})},T=async()=>{await h.run("legacy-cleanup",async()=>{await Se.cleanupToolkitLegacyCopies(e),w(),p("success",r("toolkit.legacyCleaned"))},{fail:D=>r("toolkit.toggleFailed",{error:Xe(D)})})},N=y.useMemo(()=>i?i.filter(D=>!D.weavePack&&(t==="all"||D.targets.includes(t))):[],[i,t]),_=y.useMemo(()=>fT(N),[N]),R=D=>SH(D.groups),L=D=>{const A=R(D);return A.length===1&&A[0].key===D0},C=_.flatMap(D=>[D.key,...L(D)?[]:R(D).map(A=>`${D.key}:${A.key}`)]),U=d.size===0,$=y.useRef(!1);y.useEffect(()=>{$.current||C.length===0||f(new Set(C))},[C.join("|")]);const G=D=>{$.current=!0,f(A=>Js(A,D))};if(i===null)return o.jsx("p",{className:"text-xs text-neutral-600",children:r("toolkit.loading")});const I=D=>{var j;const A=k(g(D)),M=n==="user"&&!!D.key,P=M?a.find(B=>B.harness==="claude"&&B.key===D.key&&B.scope==="user"):void 0,H=(P==null?void 0:P.enable)??"inherit",E=M?(P==null?void 0:P.effective)??!1:D.enabled;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-md border border-white/[0.06] bg-white/[0.015] px-2 py-1.5",children:[o.jsx(Ec,{className:ye("h-3.5 w-3.5 shrink-0",E?"text-emerald-400":"text-neutral-600")}),o.jsx("span",{className:"shrink-0 text-xs font-medium text-neutral-200",title:D.key?r("toolkit.keyTip",{scopes:((j=D.scopes)==null?void 0:j.join("+"))||r("toolkit.scopesNone")}):void 0,children:D.key??D.name}),D.id!==D.name&&o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",children:D.id}),o.jsx(Ye,{className:ye("shrink-0",mA[D.kind]),children:r(hA[D.kind])}),o.jsx(Ye,{className:ye("shrink-0",D.provenance==="builtin"?"bg-amber-900/40 text-amber-300":"bg-neutral-800 text-neutral-300"),children:r(kH[D.provenance])}),o.jsxs("span",{className:"shrink-0 text-[10px] text-neutral-600",children:["v",D.version]}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:r("toolkit.targets",{targets:D.targets.join("+")})}),D.weave&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:r("toolkit.weaveRules",{n:D.weave.ruleCount})}),D.description&&o.jsx("span",{className:"min-w-0 truncate text-[11px] text-neutral-500",title:D.description,children:D.description}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[o.jsx("button",{type:"button",title:r("toolkit.uninstallTip"),disabled:A,onClick:()=>void S(D),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:h.stateOf(g(D)),className:"h-3.5 w-3.5",icon:o.jsx(Fr,{className:"h-3.5 w-3.5"})})}),M?D.installed?o.jsxs("button",{type:"button",disabled:A,onClick:()=>void v(D,wH[H]),title:r("toolkit.enableTip",{state:r(qw[H])}),className:ye("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",H==="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:h.stateOf(g(D)),className:"h-3 w-3",icon:o.jsx(cu,{className:"h-3 w-3"})}),r(qw[H])]}):o.jsx("button",{type:"button",disabled:A,onClick:()=>void b(D),title:r("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:r(A?"toolkit.installing":"toolkit.install")}):o.jsx(na,{checked:D.enabled,disabled:A,onChange:B=>void m(D,B),title:r("toolkit.toggleTip")})]})]},`${D.provenance}:${D.sourceRoot}:${D.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(hx,{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:r("toolkit.legacyTitle",{n:c.length})}),o.jsx("p",{className:"truncate text-[10px] text-amber-200/60",title:c.join(`
484
- `),children:r("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 T(),children:r("toolkit.legacyCleanup")})]}),N.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:r("toolkit.empty")}),N.length>0&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-[11px] text-neutral-500",children:r("toolkit.hint")}),o.jsxs("button",{type:"button",onClick:()=>{$.current=!0,f(U?new Set(C):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:r(U?"toolkit.collapseAllGroups":"toolkit.expandAllGroups"),children:[U?o.jsx(au,{className:"h-3 w-3"}):o.jsx(lu,{className:"h-3 w-3"}),r(U?"toolkit.collapseAll":"toolkit.expandAll")]})]}),_.map(D=>{const A=D.namespace===void 0,M=d.has(D.key),P=D.groups.length,H=D.groups.every(E=>E.provenance==="builtin");return o.jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-neutral-900/60 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>G(D.key),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),f(j=>Js(j,D.key)))},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-white/[0.03] cursor-pointer",children:[M?o.jsx(Un,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Pn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(Ec,{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:A?r("repo.local"):D.namespace}),H&&o.jsx(Ye,{className:"bg-amber-900/40 text-amber-300",children:r("toolkit.prov.builtin")}),o.jsx(Mc,{tone:Ac(D.groups.filter(E=>E.enabled).length,D.groups.length),children:r("repo.enabledCount",{done:D.groups.filter(E=>E.enabled).length,total:D.groups.length})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",title:r("repo.namespaceTip"),children:r("repo.packCount",{n:P})})]}),!M&&o.jsx("div",{className:"px-3 pb-3 pt-1 space-y-2",children:L(D)?o.jsx("div",{className:"space-y-1.5",children:D.groups.map(I)}):R(D).map(E=>{const j=`${D.key}:${E.key}`,B=d.has(j);return o.jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-neutral-900/40 overflow-hidden",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>G(j),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),f(Q=>Js(Q,j)))},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-white/[0.02] cursor-pointer",children:[B?o.jsx(Un,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Pn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}),o.jsx(wC,{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.key===D0?r("toolkit.scopeRoot"):E.scope}),o.jsx(Ye,{variant:"skill",children:E.packs.length}),[...new Set(E.packs.flatMap(O=>O.targets))].sort((O,Q)=>qt.indexOf(O)-qt.indexOf(Q)).map(O=>o.jsx($r,{agent:O},O))]}),!B&&o.jsx("div",{className:"px-3 pb-3 pt-1 space-y-1.5",children:E.packs.map(I)})]},j)})})]},D.key)})]})}function NH({projectId:e,mode:t,runtimeTab:n}){return o.jsx("div",{className:"space-y-4",children:o.jsx(Ns,{children:o.jsx(ma,{className:"space-y-1 pt-4",children:o.jsx(EH,{projectId:e,runtimeTab:n,scope:t==="global"?"user":"project"})})})},t)}const _H="application/x-weave-dispatch";function CH(e){const t=e.getData(_H);if(!t)return null;const n=Number(t);return Number.isInteger(n)&&n>0?n:null}async function Hp(e){var t;if((t=navigator.clipboard)!=null&&t.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}return AH(e)}async function TH(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 AH(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 sm=["idle","turnEnd","messageFailed"],MH={idle:"tasks.watchKindIdle",turnEnd:"tasks.watchKindTurnEnd",messageFailed:"tasks.watchKindMessageFailed"},jH={idle:"tasks.watchKindIdleHint",turnEnd:"tasks.watchKindTurnEndHint",messageFailed:"tasks.watchKindMessageFailedHint"};function OH({label:e,current:t,busy:n,onSubscribe:r,onUnwatch:i,onClose:s}){const a=We(),[l,c]=y.useState(()=>new Set(t!=null&&t.onEvents.length?t.onEvents:sm)),[u,d]=y.useState(()=>(t==null?void 0:t.remaining)??1),[f,p]=y.useState(()=>t!=null&&t.remaining===null);y.useEffect(()=>{const g=k=>{k.key==="Escape"&&s()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[s]);const h=g=>{c(k=>{const w=new Set(k);return w.has(g)?w.delete(g):w.add(g),w})};return ln.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:s,children:o.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-white/[0.08] bg-neutral-900 p-3 shadow-mac",onClick:g=>g.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:s,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:sm.map(g=>{const k=l.has(g);return o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>h(g),className:ye("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-white/[0.06] bg-white/[0.02] hover:border-white/[0.16] hover:bg-white/[0.06]"),children:[o.jsx("span",{className:ye("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-neutral-950":"border-white/20"),children:k&&o.jsx(ii,{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(MH[g])}),o.jsx("span",{className:"mt-0.5 block text-[10px] text-neutral-500",children:a(jH[g])})]})]})},g)})}),o.jsxs("div",{className:"mt-3 flex items-center gap-2 border-t border-white/[0.06] pt-2.5",children:[o.jsx("span",{className:"text-[11px] text-neutral-400",children:a(t?"tasks.watchTimesLeft":"tasks.watchTimes")}),o.jsx(Rf,{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:g=>p(g.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:()=>r(sm.filter(g=>l.has(g)),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:i,className:"rounded border border-white/[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 Yw={plain:{w:448,h:0},preview:{w:880,h:560}},ad={w:320,h:220},gA=(e,t)=>({w:Math.min(Math.max(Math.round(e),ad.w),Math.max(ad.w+40,innerWidth-32)),h:t>0?Math.min(Math.max(Math.round(t),ad.h),Math.max(ad.h+40,innerHeight-32)):0});function Vw(e){try{const t=JSON.parse(localStorage.getItem(`weave:answer-size:${e}`)??"null");return!t||typeof t.w!="number"||typeof t.h!="number"?Yw[e]:gA(t.w,t.h)}catch{return Yw[e]}}function RH(e,t,n){const r=t.filter(a=>{var l;return!((l=e[a])!=null&&l.input)}),i=e.findIndex(a=>a.input),s=n.trim();return r.length===0?s&&i>=0?[i]:null:s&&i>=0?[...r,i]:r}function DH({label:e,entry:t,busy:n,onAnswer:r,onClose:i}){const s=We(),a=da("(min-width: 1024px)"),[l,c]=y.useState({}),[u,d]=y.useState({}),[f,p]=y.useState({});y.useEffect(()=>{const M=P=>{P.key==="Escape"&&i()};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[i]);const h=t.questions.find(M=>M.submit)??null,g=t.questions.filter(M=>M!==h),k=g.some(M=>M.previewMode),w=g.length===1&&g[0].previewMode===!0,m=k?"preview":"plain",[b,v]=y.useState(()=>Vw(m));y.useEffect(()=>v(Vw(m)),[m]);const S=y.useRef(null),T=y.useRef(null),N=M=>{var H;const P=(H=S.current)==null?void 0:H.getBoundingClientRect();T.current={x:M.clientX,y:M.clientY,w:b.w,h:b.h||Math.round((P==null?void 0:P.height)??0)},M.currentTarget.setPointerCapture(M.pointerId)},_=M=>{const P=T.current;P&&v(gA(P.w+(M.clientX-P.x),P.h+(M.clientY-P.y)))},R=()=>{T.current&&(T.current=null,v(M=>(localStorage.setItem(`weave:answer-size:${m}`,JSON.stringify(M)),M)))},L=(M,P)=>{n||c(H=>{const E=H[M.key]??[];return M.multiSelect?{...H,[M.key]:E.includes(P)?E.filter(j=>j!==P):[...E,P]}:{...H,[M.key]:[P]}})},C=(M,P)=>{n||!h||(l[M.key]??[]).includes(P)||c(H=>({...H,[M.key]:M.multiSelect?[...H[M.key]??[],P]:[P]}))},U=M=>RH(M.options,l[M.key]??[],u[M.key]??""),$=M=>M.previewMode?U(M)??[]:l[M.key]??[],G=()=>g.filter(M=>M.previewMode?U(M)!==null:(l[M.key]??[]).length>0).map(M=>({questionKey:M.key,options:$(M),text:u[M.key]})),I=h?g.filter(M=>{if(M.options.length===0)return!1;if(M.previewMode)return U(M)===null;const P=l[M.key]??[];if(P.length===0)return!0;const H=M.options.findIndex(E=>E.input);return H>=0&&P.includes(H)&&!(u[M.key]??"").trim()}):[],D=(M,P,H)=>{n||r([...G(),{questionKey:M,options:P,text:H}])},A=(M,P)=>{const H=M.options[P];return H&&!H.input&&!H.chat?H:null};return ln.createPortal(o.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:i,children:o.jsxs("div",{ref:S,style:a?{width:b.w,height:b.h||void 0}:void 0,className:ye("relative flex w-full flex-col overflow-hidden rounded-xl border border-white/[0.08] bg-neutral-900 p-3 shadow-mac",a?"max-h-[calc(100dvh_-_2rem)]":"h-[90dvh]"),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:[s("tasks.answerPickerTitle")," · ",e]}),o.jsx("button",{type:"button",title:s("tasks.messagesClose"),"aria-label":s("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:s(k?"tasks.answerPickerHintPreview":"tasks.answerPickerHint")}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto",children:g.map(M=>{var Q;const P=l[M.key]??[],H=u[M.key]??"",E=M.previewMode?M.options.findIndex(F=>F.input):-1,j=M.previewMode?M.options.findIndex(F=>F.chat):-1,B=E>=0?M.options[E]:void 0,O=f[M.key]??P[0]??0;return o.jsxs("div",{className:ye("rounded-lg border border-white/[0.06] bg-white/[0.02] p-2.5",w&&"flex min-h-0 flex-1 flex-col"),children:[M.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:M.header}),o.jsx("p",{className:"text-xs leading-relaxed text-neutral-200",children:M.question}),M.previewMode&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:ye("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:M.options.map((F,J)=>{if(!A(M,J))return null;const ce=O===J,K=P.includes(J);return o.jsx("li",{children:o.jsxs("button",{type:"button",disabled:n,onMouseEnter:()=>p(q=>({...q,[M.key]:J})),onFocus:()=>p(q=>({...q,[M.key]:J})),onClick:()=>L(M,J),className:ye("flex w-full items-center gap-2 rounded-lg border px-2 py-1.5 text-left transition-colors disabled:opacity-50",K?"border-blue-400/50 bg-blue-500/10":ce?"border-white/15 bg-white/[0.04]":"border-white/[0.06] bg-white/[0.02] hover:bg-white/[0.04]"),children:[o.jsx("span",{className:"w-2.5 shrink-0 text-neutral-500",children:ce?"›":""}),o.jsxs("span",{className:"shrink-0 text-[11px] text-neutral-500",children:[J+1,"."]}),o.jsx("span",{className:ye("min-w-0 flex-1 truncate text-xs",K?"text-blue-200":"text-neutral-200"),children:F.label}),K&&o.jsx(ii,{className:"h-3 w-3 shrink-0 text-blue-300"})]})},J)})}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5 lg:min-h-0",children:[o.jsx("pre",{className:ye("overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-white/[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:((Q=M.options[O])==null?void 0:Q.preview)??""}),B&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"shrink-0 text-[11px] text-neutral-400",children:B.label}),o.jsx("input",{value:H,disabled:n,placeholder:B.description??B.label,onChange:F=>{const J=F.target.value;d(ce=>({...ce,[M.key]:J}))},onKeyDown:F=>{if(F.key!=="Enter"||n)return;F.preventDefault();const J=U(M);!h&&J&&D(M.key,J,H)},className:"min-w-0 flex-1 rounded border border-white/[0.08] bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-white/20 focus:outline-none disabled:opacity-50"})]})]})]}),j>=0&&o.jsxs("button",{type:"button",disabled:n,onClick:()=>D(M.key,[j]),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-white/[0.06] hover:text-neutral-200 disabled:opacity-50",children:[o.jsx("span",{className:"w-2.5 shrink-0",children:"·"}),o.jsx("span",{children:M.options[j].label}),n&&o.jsx(Cn,{className:"h-3 w-3 animate-spin text-blue-300"})]}),!h&&o.jsx("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-white/[0.06] pt-2",children:o.jsxs("button",{type:"button",disabled:n||U(M)===null,onClick:()=>{const F=U(M);F&&D(M.key,F,H)},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:[s("tasks.answerSend"),n&&o.jsx(Cn,{className:"h-3 w-3 animate-spin"})]})})]}),!M.previewMode&&M.options.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:M.options.map((F,J)=>{const ce=P.includes(J),K=o.jsx("span",{className:ye("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border text-[10px] font-semibold leading-none",ce?"border-blue-400/40 bg-blue-500/15 text-blue-200":"border-white/15 bg-neutral-950 text-neutral-300"),children:J+1});return F.input?o.jsx("li",{children:o.jsxs("div",{onClick:()=>C(M,J),className:ye("flex items-center gap-2 rounded-lg border px-2.5 py-1.5",ce?"border-blue-400/50 bg-blue-500/10":"border-white/[0.06] bg-white/[0.02]"),children:[h?o.jsx("button",{type:"button",disabled:n,onClick:q=>{q.stopPropagation(),L(M,J)},"aria-label":F.label,className:"shrink-0 disabled:opacity-50",children:K}):K,o.jsx("input",{value:H,disabled:n,placeholder:F.description??F.label,onChange:q=>{const V=q.target.value;d(ue=>({...ue,[M.key]:V})),h&&C(M,J)},onKeyDown:q=>{q.key!=="Enter"||n||(q.preventDefault(),!h&&H.trim()&&D(M.key,[J],H))},className:"min-w-0 flex-1 rounded border border-white/[0.08] bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-200 placeholder:text-neutral-600 focus:border-white/20 focus:outline-none disabled:opacity-50"}),!h&&o.jsx("button",{type:"button",disabled:n||!H.trim(),onClick:()=>D(M.key,[J],H),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:s("tasks.answerSend")}),n&&o.jsx(Cn,{className:"h-3 w-3 shrink-0 animate-spin text-blue-300"})]})},J):o.jsx("li",{children:o.jsxs("button",{type:"button",disabled:n,onClick:()=>h&&!F.chat?L(M,J):D(M.key,[J]),className:ye("flex w-full items-start gap-2 rounded-lg border px-2.5 py-1.5 text-left transition-colors disabled:opacity-50",ce?"border-blue-400/50 bg-blue-500/10":"border-white/[0.06] bg-white/[0.02] hover:border-blue-400/40 hover:bg-blue-500/10"),children:[K,o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block text-xs text-neutral-200",children:F.label}),F.description&&o.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-neutral-500",children:F.description})]}),(ce||n)&&o.jsxs("span",{className:"mt-0.5 flex shrink-0 items-center gap-1",children:[ce&&!F.chat&&o.jsx(ii,{className:"h-3 w-3 text-blue-300"}),n&&o.jsx(Cn,{className:"h-3 w-3 animate-spin text-blue-300"})]})]})},J)})})]},M.key)})}),h&&o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 border-t border-white/[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:s("tasks.answerIncomplete",{n:I.length})}),o.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:h.options.map((M,P)=>o.jsxs("button",{type:"button",disabled:n||P===0&&I.length>0,onClick:()=>D(h.key,[P]),className:ye("flex items-center gap-1 rounded px-2.5 py-1 text-[11px] font-medium transition-colors disabled:opacity-40",P===0?"bg-blue-700/80 text-white hover:bg-blue-600":"border border-white/[0.08] bg-white/[0.02] text-neutral-300 hover:bg-white/[0.08]"),children:[M.label,n&&P===0&&o.jsx(Cn,{className:"h-3 w-3 animate-spin"})]},P))})]}),a&&o.jsx("div",{role:"separator",title:s("app.resizeDialog"),"aria-label":s("app.resizeDialog"),onPointerDown:N,onPointerMove:_,onPointerUp:R,onPointerCancel:R,onClick:M=>M.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-white/20"})})]})}),document.body)}function Vx({status:e,harness:t}){return e==="open"||xl(e)?o.jsx(fa,{harness:t,running:xl(e)}):o.jsx("span",{className:ye("h-2 w-2 shrink-0 rounded-full",G4[e])})}const Ls="inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-white/[0.08] bg-white/[0.02] text-neutral-500 transition-colors hover:border-white/[0.16] hover:bg-white/[0.08] hover:text-neutral-200",IH=1e4,LH=450;function bA(e,t){return Date.parse(t.lastSeenAt)-Date.parse(e.lastSeenAt)||Date.parse(t.createdAt)-Date.parse(e.createdAt)}function zH(e){const t=[],n=new Map;for(const r of e){const i=r.terminal;if(!i){t.push({kind:"row",row:r});continue}let s=n.get(i.id);s||(s={kind:"block",terminal:i,rows:[]},n.set(i.id,s),t.push(s)),s.rows.push(r)}return t.map(r=>r.kind==="block"&&r.rows.length===1?{kind:"row",row:r.rows[0]}:r)}function PH(e,t){const n=new Set(t),r=e.filter(a=>n.has(a)),i=new Set(r);return[...t.filter(a=>!i.has(a)),...r]}function Xw(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function xA(e,t){const n=y.useRef(e);n.current=e;const[r,i]=y.useState(e),s=y.useRef(t);return y.useLayoutEffect(()=>{if(s.current!==t){s.current=t,i(e);return}i(a=>{const l=PH(a,e);return Xw(a,l)?a:l})},[e,t]),y.useEffect(()=>{const a=window.setInterval(()=>{i(l=>Xw(l,n.current)?l:n.current)},IH);return()=>window.clearInterval(a)},[]),r}function yA(e){const t=y.useRef(new Map);y.useLayoutEffect(()=>{const n=e.current;if(n.size===0){t.current=new Map;return}const r=t.current,i=new Map,s=[];for(const[a,l]of n){const c=l.offsetTop;i.set(a,c);const u=r.get(a);u!==void 0&&Math.abs(u-c)>=1&&s.push([l,u-c])}if(t.current=i,s.length!==0){for(const[a]of s)a.style.transition="none";for(const[a,l]of s)a.style.transform=`translateY(${l}px)`;s[0][0].offsetHeight;for(const[a]of s)a.style.transition=`transform ${LH}ms cubic-bezier(0.2, 0, 0, 1)`,a.style.transform=""}})}function UH({sessions:e,statuses:t,selectedId:n,highlightId:r,onSelect:i,onRename:s,onDropDispatch:a,onOpenTerminal:l,openTerminalStateOf:c,capabilities:u,onOpenMessages:d,inflightOf:f,questionOf:p,onAnswer:h,answerStateOf:g,answerFor:k,onSetAnswerFor:w,watchOf:m,watchStateOf:b,onSubscribeWatch:v,onUnwatch:S,onDelete:T,deleteStateOf:N}){var Te;const _=We(),{show:R}=Zt(),L=ne=>ne.tabsInWindow>1?_("tasks.terminalBlockTab",{w:ne.windowId,tab:ne.tabId}):_("tasks.terminalBlock",{w:ne.windowId}),[C,U]=y.useState(null),[$,G]=y.useState(null),[I,D]=y.useState(""),[A,M]=y.useState(null),[P,H]=y.useState(null),E=y.useRef(null),j=y.useMemo(()=>e.slice().sort(bA).map(ne=>ne.sessionId),[e]),B=xA(j),O=y.useMemo(()=>{const ne=new Map(e.map(Ke=>[Ke.sessionId,Ke])),pe=[];for(const Ke of B){const He=ne.get(Ke);He&&pe.push(He)}const le=new Set(pe.map(Ke=>Ke.sessionId));return[...e.filter(Ke=>!le.has(Ke.sessionId)),...pe]},[e,B]),Q=y.useRef(new Map);yA(Q);const[F,J]=y.useState(()=>Date.now()),ce=e.some(ne=>ne.autoDeleteAt!=null);y.useEffect(()=>{if(!ce)return;const ne=window.setInterval(()=>J(Date.now()),3e4);return()=>window.clearInterval(ne)},[ce]),y.useEffect(()=>{var ne;$&&((ne=E.current)==null||ne.focus())},[$]);const K=ne=>{G(ne.sessionId),D(ne.title??"")},q=()=>{$&&I.trim()&&s($,I.trim()),G(null)},V=ne=>{Hp(ne).then(pe=>{if(!pe){R("error",_("common.copyFailed"));return}M(ne),window.setTimeout(()=>M(null),1500)})},ue=ne=>pe=>{pe?Q.current.set(ne,pe):Q.current.delete(ne)},me=ne=>{var st;const pe=t.get(ne.sessionId)??"open",le=ne.sessionId===n,de=ne.harness!=null?u==null?void 0:u.get(ne.harness):void 0,Ke=m==null?void 0:m(ne.sessionId),He=f(ne.sessionId),Fe=(c==null?void 0:c(ne.sessionId))??"idle",dt=(((st=p==null?void 0:p(ne.sessionId))==null?void 0:st.questions)??[]).filter(Ue=>!Ue.submit).length;return o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>i(ne.sessionId),onKeyDown:Ue=>{(Ue.key==="Enter"||Ue.key===" ")&&(Ue.preventDefault(),i(ne.sessionId))},onDoubleClick:Ue=>{Ue.stopPropagation(),$!==ne.sessionId&&K(ne)},onDragOver:Ue=>{Ue.preventDefault(),H(ne.sessionId)},onDragLeave:()=>H(Ue=>Ue===ne.sessionId?null:Ue),onDrop:Ue=>{Ue.preventDefault(),H(null);const at=CH(Ue.dataTransfer);at!==null&&a(at,ne.sessionId)},title:P===ne.sessionId?_("tasks.dropTip"):ne.sessionId,className:ye("group flex flex-wrap cursor-pointer items-center gap-x-2 gap-y-1 rounded-xl border p-2 transition-colors",le?"border-blue-500/50 bg-blue-500/10":"border-white/[0.06] bg-neutral-900/50 hover:border-white/[0.10] hover:bg-white/[0.04]",r===ne.sessionId&&"border-rose-400/70",P===ne.sessionId&&"border-dashed border-blue-400/70 bg-blue-500/10"),children:[o.jsx(Vx,{status:pe,harness:ne.harness}),$===ne.sessionId?o.jsx("input",{ref:E,value:I,onChange:Ue=>D(Ue.target.value),onBlur:q,onKeyDown:Ue=>{Ue.key==="Enter"&&q(),Ue.key==="Escape"&&G(null)},onClick:Ue=>Ue.stopPropagation(),placeholder:_("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:Tn(ne.title,ne.sessionId)}),o.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 [&_svg]:pointer-events-none",children:[ne.harness==="claude"&&o.jsx("button",{type:"button",disabled:!!ne.pidAlive||Fe==="loading",title:ne.pidAlive?_("tasks.sessionTerminalRunning"):_("tasks.openSessionTerminal"),onClick:Ue=>{Ue.stopPropagation(),l(ne.sessionId)},className:ye(Ls,(ne.pidAlive||Fe==="loading")&&"disabled:cursor-not-allowed hover:border-white/[0.08] hover:bg-white/[0.02] hover:text-neutral-500"),children:o.jsx(ut,{state:Fe,className:"h-3 w-3",icon:o.jsx(bk,{className:ye("h-3 w-3",ne.pidAlive&&"text-emerald-400")})})}),(p==null?void 0:p(ne.sessionId))&&o.jsxs("button",{type:"button",title:_("tasks.answerActiveTooltip",{n:dt}),onClick:Ue=>{Ue.stopPropagation(),w(ne.sessionId)},className:ye(Ls,"relative","border-amber-400/40 bg-amber-500/10 text-amber-300 hover:border-amber-400/60 hover:text-amber-200"),children:[o.jsx(vC,{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-neutral-950",children:dt})]}),(de==null?void 0:de.prompt)&&o.jsxs("button",{type:"button",title:He>0?_("tasks.messageInflight",{n:He}):_("tasks.messageTooltip"),onClick:Ue=>{Ue.stopPropagation(),d(ne.sessionId)},className:ye(Ls,"relative",He>0&&"border-amber-400/40 bg-amber-500/10 text-amber-300 hover:border-amber-400/60 hover:text-amber-200"),children:[o.jsx(NC,{className:ye("h-3 w-3",He>0&&"text-amber-300")}),He>0&&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-neutral-950",children:He>9?"9+":He})]}),(de==null?void 0:de.watch)&&o.jsxs("button",{type:"button",title:Ke?_("tasks.watchActiveTooltip",{n:Ke.remaining===null?"∞":String(Ke.remaining)}):_("tasks.watchTooltip"),onClick:Ue=>{Ue.stopPropagation(),U(ne.sessionId)},className:ye(Ls,"relative"),children:[o.jsx(ut,{state:(b==null?void 0:b(ne.sessionId))??"idle",className:"h-3 w-3",icon:Ke?o.jsx(bD,{className:"h-3 w-3 text-amber-300"}):o.jsx(yC,{className:"h-3 w-3"})}),Ke&&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-neutral-950",children:Ke.remaining===null?"∞":Ke.remaining})]}),o.jsx("button",{type:"button",title:_("tasks.renameTip"),onClick:Ue=>{Ue.stopPropagation(),K(ne)},className:Ls,children:o.jsx(_C,{className:"h-3 w-3"})}),o.jsx("button",{type:"button",title:A===ne.sessionId?_("tasks.copied"):_("tasks.copySessionId"),onClick:Ue=>{Ue.stopPropagation(),V(ne.sessionId)},className:Ls,children:A===ne.sessionId?o.jsx(ii,{className:"h-3 w-3 text-emerald-400"}):o.jsx(Sc,{className:"h-3 w-3"})}),o.jsx("button",{type:"button",title:_("tasks.deleteTooltip"),"aria-label":_("tasks.deleteSession"),onClick:Ue=>{Ue.stopPropagation(),T(ne.sessionId)},className:ye(Ls,"hover:text-red-400"),children:o.jsx(ut,{state:(N==null?void 0:N(ne.sessionId))??"idle",className:"h-3 w-3",icon:o.jsx(Fr,{className:"h-3 w-3"})})})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 basis-full",children:[ne.pendingTitle&&o.jsx(Ye,{title:_("tasks.renamePendingTip"),className:"shrink-0 bg-amber-900/40 text-amber-300",children:_("tasks.pendingTitle")}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:_("tasks.events",{n:ne.eventCount??0})}),ne.harness&&o.jsx($r,{agent:ne.harness,className:"shrink-0 px-1 text-[10px]"}),o.jsx(Ye,{className:ye("shrink-0",cT[pe]),children:_(oT[pe])}),ne.autoDeleteAt&&o.jsx(Ye,{className:"shrink-0 bg-neutral-800/80 text-neutral-400",children:Date.parse(ne.autoDeleteAt)-F>6e4?_("tasks.autoDeleteIn",{n:Math.ceil((Date.parse(ne.autoDeleteAt)-F)/6e4)}):_("tasks.autoDeleteSoon")})]})]})]})},Ne=y.useMemo(()=>zH(O),[O]);return o.jsxs("ul",{className:"space-y-1.5",children:[Ne.map(ne=>ne.kind==="row"?o.jsx("li",{ref:ue(ne.row.sessionId),children:me(ne.row)},ne.row.sessionId):o.jsxs("li",{className:"rounded-xl border border-white/[0.06] bg-white/[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(bk,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"font-medium",children:L(ne.terminal)}),o.jsx("span",{className:"text-neutral-500",children:_("tasks.terminalBlockSessions",{n:ne.rows.length})})]}),o.jsx("ul",{className:"space-y-1.5",children:ne.rows.map(pe=>o.jsx("li",{ref:ue(pe.sessionId),children:me(pe)},pe.sessionId))})]},`terminal:${ne.terminal.id}`)),k&&(()=>{var pe;const ne=p==null?void 0:p(k);return!ne||ne.questions.length===0?null:o.jsx(DH,{label:Tn(((pe=e.find(le=>le.sessionId===k))==null?void 0:pe.title)??null,k),entry:ne,busy:(g==null?void 0:g(k))==="loading",onAnswer:le=>h==null?void 0:h(k,le),onClose:()=>w(null)})})(),C&&o.jsx(OH,{label:Tn(((Te=e.find(ne=>ne.sessionId===C))==null?void 0:Te.title)??null,C),current:(m==null?void 0:m(C))??null,busy:(b==null?void 0:b(C))==="loading",onSubscribe:(ne,pe)=>{U(null),v(C,ne,pe)},onUnwatch:()=>{U(null),S(C)},onClose:()=>U(null)})]})}function BH(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const HH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,FH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$H={};function Ww(e,t){return($H.jsx?FH:HH).test(e)}const GH=/[ \t\n\f\r]/g;function KH(e){return typeof e=="object"?e.type==="text"?Zw(e.value):!1:Zw(e)}function Zw(e){return e.replace(GH,"")===""}let vu=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};vu.prototype.normal={};vu.prototype.property={};vu.prototype.space=void 0;function vA(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vu(n,r,t)}function I0(e){return e.toLowerCase()}class Jn{constructor(t,n){this.attribute=n,this.property=t}}Jn.prototype.attribute="";Jn.prototype.booleanish=!1;Jn.prototype.boolean=!1;Jn.prototype.commaOrSpaceSeparated=!1;Jn.prototype.commaSeparated=!1;Jn.prototype.defined=!1;Jn.prototype.mustUseProperty=!1;Jn.prototype.number=!1;Jn.prototype.overloadedBoolean=!1;Jn.prototype.property="";Jn.prototype.spaceSeparated=!1;Jn.prototype.space=void 0;let qH=0;const et=Ca(),nn=Ca(),L0=Ca(),De=Ca(),At=Ca(),ra=Ca(),er=Ca();function Ca(){return 2**++qH}const z0=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:nn,commaOrSpaceSeparated:er,commaSeparated:ra,number:De,overloadedBoolean:L0,spaceSeparated:At},Symbol.toStringTag,{value:"Module"})),am=Object.keys(z0);class Xx extends Jn{constructor(t,n,r,i){let s=-1;if(super(t,n),Qw(this,"space",i),typeof r=="number")for(;++s<am.length;){const a=am[s];Qw(this,am[s],(r&z0[a])===z0[a])}}}Xx.prototype.defined=!0;function Qw(e,t,n){n&&(e[t]=n)}function ao(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Xx(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[I0(r)]=r,n[I0(s.attribute)]=r}return new vu(t,n,e.space)}const kA=ao({properties:{ariaActiveDescendant:null,ariaAtomic:nn,ariaAutoComplete:null,ariaBusy:nn,ariaChecked:nn,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:At,ariaCurrent:null,ariaDescribedBy:At,ariaDetails:null,ariaDisabled:nn,ariaDropEffect:At,ariaErrorMessage:null,ariaExpanded:nn,ariaFlowTo:At,ariaGrabbed:nn,ariaHasPopup:null,ariaHidden:nn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:At,ariaLevel:De,ariaLive:null,ariaModal:nn,ariaMultiLine:nn,ariaMultiSelectable:nn,ariaOrientation:null,ariaOwns:At,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:nn,ariaReadOnly:nn,ariaRelevant:null,ariaRequired:nn,ariaRoleDescription:At,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:nn,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function wA(e,t){return t in e?e[t]:t}function SA(e,t){return wA(e,t.toLowerCase())}const YH=ao({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ra,acceptCharset:At,accessKey:At,action:null,allow:null,allowFullScreen:et,allowPaymentRequest:et,allowUserMedia:et,alpha:et,alt:null,as:null,async:et,autoCapitalize:null,autoComplete:At,autoFocus:et,autoPlay:et,blocking:At,capture:null,charSet:null,checked:et,cite:null,className:At,closedBy:null,colorSpace:null,cols:De,colSpan:De,command:null,commandFor:null,content:null,contentEditable:nn,controls:et,controlsList:At,coords:De|ra,crossOrigin:null,data:null,dateTime:null,decoding:null,default:et,defer:et,dir:null,dirName:null,disabled:et,download:L0,draggable:nn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:et,formTarget:null,headers:At,height:De,hidden:L0,high:De,href:null,hrefLang:null,htmlFor:At,httpEquiv:At,id:null,imageSizes:null,imageSrcSet:null,inert:et,inputMode:null,integrity:null,is:null,isMap:et,itemId:null,itemProp:At,itemRef:At,itemScope:et,itemType:At,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:et,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:et,muted:et,name:null,nonce:null,noModule:et,noValidate:et,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:et,optimum:De,pattern:null,ping:At,placeholder:null,playsInline:et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:et,referrerPolicy:null,rel:At,required:et,reversed:et,rows:De,rowSpan:De,sandbox:At,scope:null,scoped:et,seamless:et,selected:et,shadowRootClonable:et,shadowRootCustomElementRegistry:et,shadowRootDelegatesFocus:et,shadowRootMode:null,shadowRootSerializable:et,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:nn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:et,useMap:null,value:nn,width:De,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:At,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:et,declare:et,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:et,noHref:et,noShade:et,noWrap:et,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:nn,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:et,disablePictureInPicture:et,disableRemotePlayback:et,exportParts:ra,part:At,prefix:null,property:null,results:De,security:null,unselectable:null},space:"html",transform:SA}),VH=ao({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:er,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:At,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:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:et,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,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:ra,g2:ra,glyphName:ra,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:er,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,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:De,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:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:At,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:er,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:er,rev:er,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:er,requiredFeatures:er,requiredFonts:er,requiredFormats:er,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:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:er,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:er,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:er,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:wA}),EA=ao({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()}}),NA=ao({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:SA}),_A=ao({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),XH={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"},WH=/[A-Z]/g,Jw=/-[a-z]/g,ZH=/^data[-\w.:]+$/i;function QH(e,t){const n=I0(t);let r=t,i=Jn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ZH.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Jw,eF);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Jw.test(s)){let a=s.replace(WH,JH);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Xx}return new i(r,t)}function JH(e){return"-"+e.toLowerCase()}function eF(e){return e.charAt(1).toUpperCase()}const tF=vA([kA,YH,EA,NA,_A],"html"),Wx=vA([kA,VH,EA,NA,_A],"svg");function nF(e){return e.join(" ").trim()}var CA={},e1=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,rF=/\n/g,iF=/^\s*/,sF=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,aF=/^:\s*/,lF=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,oF=/^[;\s]*/,cF=/^\s+|\s+$/g,uF=`
485
- `,t1="/",n1="*",Ks="",dF="comment",fF="declaration",pF=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var k=g.match(rF);k&&(n+=k.length);var w=g.lastIndexOf(uF);r=~w?g.length-w:r+g.length}function s(){var g={line:n,column:r};return function(k){return k.position=new a(g),u(),k}}function a(g){this.start=g,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(g){var k=new Error(t.source+":"+n+":"+r+": "+g);if(k.reason=g,k.filename=t.source,k.line=n,k.column=r,k.source=e,!t.silent)throw k}function c(g){var k=g.exec(e);if(k){var w=k[0];return i(w),e=e.slice(w.length),k}}function u(){c(iF)}function d(g){var k;for(g=g||[];k=f();)k!==!1&&g.push(k);return g}function f(){var g=s();if(!(t1!=e.charAt(0)||n1!=e.charAt(1))){for(var k=2;Ks!=e.charAt(k)&&(n1!=e.charAt(k)||t1!=e.charAt(k+1));)++k;if(k+=2,Ks===e.charAt(k-1))return l("End of comment missing");var w=e.slice(2,k-2);return r+=2,i(w),e=e.slice(k),r+=2,g({type:dF,comment:w})}}function p(){var g=s(),k=c(sF);if(k){if(f(),!c(aF))return l("property missing ':'");var w=c(lF),m=g({type:fF,property:r1(k[0].replace(e1,Ks)),value:w?r1(w[0].replace(e1,Ks)):Ks});return c(oF),m}}function h(){var g=[];d(g);for(var k;k=p();)k!==!1&&(g.push(k),d(g));return g}return u(),h()};function r1(e){return e?e.replace(cF,Ks):Ks}var hF=pF;function mF(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=hF(e),s=typeof t=="function",a,l,c=0,u=i.length;c<u;c++)r=i[c],a=r.property,l=r.value,s?t(a,l,r):l&&(n||(n={}),n[a]=l);return n}var gF=mF,Fp={};Fp.__esModule=!0;Fp.camelCase=void 0;var bF=/^--[a-zA-Z0-9-]+$/,xF=/-([a-z])/g,yF=/^[^-]+$/,vF=/^-(webkit|moz|ms|o)-/,kF=function(e){return!e||yF.test(e)||bF.test(e)?e:e.toLowerCase().replace(vF,function(t,n){return n+"-"}).replace(xF,function(t,n){return n.toUpperCase()})};Fp.camelCase=kF;(function(e){var t=Ay&&Ay.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};e.__esModule=!0;var n=t(gF),r=Fp;function i(s){if(!s||typeof s!="string")return{};var a={};return n.default(s,function(l,c){l&&c&&(a[r.camelCase(l)]=c)}),a}e.default=i})(CA);const wF=$c(CA),TA=AA("end"),Zx=AA("start");function AA(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function SF(e){const t=Zx(e),n=TA(e);if(t&&n)return{start:t,end:n}}function nc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?i1(e.position):"start"in e||"end"in e?i1(e):"line"in e||"column"in e?P0(e):""}function P0(e){return s1(e&&e.line)+":"+s1(e&&e.column)}function i1(e){return P0(e&&e.start)+"-"+P0(e&&e.end)}function s1(e){return e&&typeof e=="number"?e:1}class jn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=nc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jn.prototype.file="";jn.prototype.name="";jn.prototype.reason="";jn.prototype.message="";jn.prototype.stack="";jn.prototype.column=void 0;jn.prototype.line=void 0;jn.prototype.ancestors=void 0;jn.prototype.cause=void 0;jn.prototype.fatal=void 0;jn.prototype.place=void 0;jn.prototype.ruleId=void 0;jn.prototype.source=void 0;const Qx={}.hasOwnProperty,EF=new Map,NF=/[A-Z]/g,_F=new Set(["table","tbody","thead","tfoot","tr"]),CF=new Set(["td","th"]),MA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function TF(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=LF(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");r=IF(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Wx:tF,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=jA(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function jA(e,t,n){if(t.type==="element")return AF(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return MF(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return OF(e,t,n);if(t.type==="mdxjsEsm")return jF(e,t);if(t.type==="root")return RF(e,t,n);if(t.type==="text")return DF(e,t)}function AF(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Wx,e.schema=i),e.ancestors.push(t);const s=RA(e,t.tagName,!1),a=zF(e,t);let l=ey(e,t);return _F.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!KH(c):!0})),OA(e,a,s,t),Jx(a,l),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function MF(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Bc(e,t.position)}function jF(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Bc(e,t.position)}function OF(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Wx,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:RA(e,t.name,!0),a=PF(e,t),l=ey(e,t);return OA(e,a,s,t),Jx(a,l),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function RF(e,t,n){const r={};return Jx(r,ey(e,t)),e.create(t,e.Fragment,r,n)}function DF(e,t){return t.value}function OA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Jx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function IF(e,t,n){return r;function r(i,s,a,l){const u=Array.isArray(a.children)?n:t;return l?u(s,a,l):u(s,a)}}function LF(e,t){return n;function n(r,i,s,a){const l=Array.isArray(s.children),c=Zx(r);return t(i,s,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function zF(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Qx.call(t.properties,i)){const s=UF(e,i,t.properties[i]);if(s){const[a,l]=s;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&CF.has(t.tagName)?r=l:n[a]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function PF(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Bc(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else Bc(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function ey(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:EF;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const u=i.get(c)||0;a=c+"-"+u,i.set(c,u+1)}}const l=jA(e,s,a);l!==void 0&&n.push(l)}return n}function UF(e,t,n){const r=QH(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?BH(n):nF(n)),r.property==="style"){let i=typeof n=="object"?n:BF(e,String(n));return e.stylePropertyNameCase==="css"&&(i=HF(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?XH[r.property]||r.property:r.attribute,n]}}function BF(e,t){try{return wF(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new jn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=MA+"#cannot-parse-style-attribute",i}}function RA(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const l=Ww(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=a}else r=Ww(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Qx.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Bc(e)}function Bc(e,t){const n=new jn("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=MA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function HF(e){const t={};let n;for(n in e)Qx.call(e,n)&&(t[FF(n)]=e[n]);return t}function FF(e){let t=e.replace(NF,$F);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function $F(e){return"-"+e.toLowerCase()}const lm={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"]},GF={};function ty(e,t){const n=GF,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return DA(e,r,i)}function DA(e,t,n){if(KF(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 a1(e.children,t,n)}return Array.isArray(e)?a1(e,t,n):""}function a1(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=DA(e[i],t,n);return r.join("")}function KF(e){return!!(e&&typeof e=="object")}const l1=document.createElement("i");function ny(e){const t="&"+e+";";l1.innerHTML=t;const n=l1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tr(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function vr(e,t){return e.length>0?(Tr(e,e.length,0,t),e):t}const o1={}.hasOwnProperty;function IA(e){const t={};let n=-1;for(;++n<e.length;)qF(t,e[n]);return t}function qF(e,t){let n;for(n in t){const i=(o1.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){o1.call(i,a)||(i[a]=[]);const l=s[a];YF(i[a],Array.isArray(l)?l:l?[l]:[])}}}function YF(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Tr(e,0,0,r)}function LA(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 Pr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ln=Ts(/[A-Za-z]/),Mn=Ts(/[\dA-Za-z]/),VF=Ts(/[#-'*+\--9=?A-Z^-~]/);function Kf(e){return e!==null&&(e<32||e===127)}const U0=Ts(/\d/),XF=Ts(/[\dA-Fa-f]/),WF=Ts(/[!-/:-@[-`{-~]/);function Ze(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function lt(e){return e===-2||e===-1||e===32}const $p=Ts(new RegExp("\\p{P}","u")),ka=Ts(/\s/);function Ts(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function lo(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Mn(e.charCodeAt(n+1))&&Mn(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(a=String.fromCharCode(s,l),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function xt(e,t,n,r){const i=r?r-1:1/0;let s=0;return a;function a(c){return lt(c)?(e.enter(n),l(c)):t(c)}function l(c){return lt(c)&&s++<i?(e.consume(c),l):(e.exit(n),t(c))}}function zA(e,t,n,r,i,s){let a=0;return l;function l(d){return lt(d)?(e.enter(r),c(d)):u(d)}function c(d){return lt(d)&&a<s?(e.consume(d),a++,c):(e.exit(r),u(d))}function u(d){return a>=i?t(d):n(d)}}const ZF={tokenize:QF};function QF(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),xt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),s(l)}function s(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 Ze(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),a)}}let qf=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){c1(this,t,n,r,!1)}addBefore(t,n,r){c1(this,t,n,r,!0)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0,this.index.clear()}};function c1(e,t,n,r,i){if(n===0&&r.length===0)return;const s=e.index.get(t);if(s){s[1]+=n,i?(r.push(...s[2]),s[2]=r):s[2].push(...r);return}const a=[t,n,r];e.map.push(a),e.index.set(t,a)}const JF={tokenize:e$},u1={tokenize:t$};function e$(e){const t=this,n=[];let r=0,i,s,a;return l;function l(v){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,u)(v)}return u(v)}function c(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const S=t.events.length;let T=S,N;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){N=t.events[T][1].end;break}m(r);let _=S;for(;_<t.events.length;)t.events[_][1].end={...N},_++;const R=new qf;return R.add(T+1,0,t.events.slice(S)),R.add(S,_-S,[]),R.consume(t.events),u(v)}return l(v)}function u(v){if(r===n.length){if(!i)return p(v);if(i.currentConstruct&&i.currentConstruct.concrete)return g(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(u1,d,f)(v)}function d(v){return i&&b(),m(r),p(v)}function f(v){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(v)}function p(v){return t.containerState={},e.attempt(u1,h,g)(v)}function h(v){return r++,n.push([t.currentConstruct,t.containerState]),p(v)}function g(v){if(v===null){i&&b(),m(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),k(v)}function k(v){if(v===null){w(e.exit("chunkFlow"),!0),m(0),e.consume(v);return}return Ze(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(v),k)}function w(v,S){const T=t.sliceStream(v);if(S&&T.push(null),v.previous=s,s&&(s.next=v),s=v,i.defineSkip(v.start),i.write(T),t.parser.lazy[v.start.line]){let N=i.events.length;for(;N--;)if(i.events[N][1].start.offset<a&&(!i.events[N][1].end||i.events[N][1].end.offset>a))return;const _=t.events.length;let R=_,L,C;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(L){C=t.events[R][1].end;break}L=!0}for(m(r),N=_;N<t.events.length;)t.events[N][1].end={...C},N++;const U=new qf;U.add(R+1,0,t.events.slice(_)),U.add(_,N-_,[]),U.consume(t.events)}}function m(v){let S=n.length;for(;S-- >v;){const T=n[S];t.containerState=T[1],T[0].exit.call(t,e)}n.length=v}function b(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function t$(e,t,n){return xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yf(e){if(e===null||jt(e)||ka(e))return 1;if($p(e))return 2}function Gp(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const B0={name:"attention",resolveAll:n$,tokenize:r$};function n$(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const s=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,a={...e[i][1].end},l={...e[n][1].start};d1(a,-s),d1(l,s);const c={type:s>1?"strongSequence":"emphasisSequence",start:a,end:{...e[i][1].end}},u={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:l},d={type:s>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},f={type:s>1?"strong":"emphasis",start:{...c.start},end:{...u.end}};e[i][1].end={...c.start},e[n][1].start={...u.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=vr(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=vr(r,[["enter",f,t],["enter",c,t],["exit",c,t],["enter",d,t]]),r=vr(r,Gp(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=vr(r,[["exit",d,t],["enter",u,t],["exit",u,t],["exit",f,t]]);let p=0;e[n][1].end.offset-e[n][1].start.offset&&(p=2,r=vr(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),Tr(e,i-1,n-i+3,r),n=i+r.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function r$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Yf(r);let s;return a;function a(c){return s=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===s)return e.consume(c),l;const u=e.exit("attentionSequence"),d=Yf(c),f=!d||d===2&&i||n.includes(c)&&c!==42&&c!==95,p=!i||i===2&&d||n.includes(r)&&r!==42&&r!==95;return u._open=!!(s===42?f:f&&(i||!p)),u._close=!!(s===42?p:p&&(d||!f)),t(c)}}function d1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const i$={name:"autolink",tokenize:s$};function s$(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(h){return Ln(h)?(e.consume(h),a):h===64?n(h):u(h)}function a(h){return h===43||h===45||h===46||Mn(h)?(r=1,l(h)):u(h)}function l(h){return h===58?(e.consume(h),r=0,c):(h===43||h===45||h===46||Mn(h))&&r++<32?(e.consume(h),l):(r=0,u(h))}function c(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Kf(h)?n(h):(e.consume(h),c)}function u(h){return h===64?(e.consume(h),d):VF(h)?(e.consume(h),u):n(h)}function d(h){return Mn(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,d):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||Mn(h))&&r++<63){const g=h===45?p:f;return e.consume(h),g}return n(h)}}const ku={partial:!0,tokenize:a$};function a$(e,t,n){return r;function r(s){return lt(s)?xt(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Ze(s)?t(s):n(s)}}const PA={continuation:{tokenize:o$},exit:c$,name:"blockQuote",tokenize:l$};function l$(e,t,n){const r=this;return i;function i(a){if(a===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return lt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function o$(e,t,n){const r=this;return i;function i(a){return lt(a)?xt(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(PA,t,n)(a)}}function c$(e){e.exit("blockQuote")}const UA={name:"characterEscape",tokenize:u$};function u$(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return WF(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const BA={name:"characterReference",tokenize:d$};function d$(e,t,n){const r=this;let i=0,s,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"),s=31,a=Mn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=XF,d):(e.enter("characterReferenceValue"),s=7,a=U0,d(f))}function d(f){if(f===59&&i){const p=e.exit("characterReferenceValue");return a===Mn&&!ny(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(f)&&i++<s?(e.consume(f),d):n(f)}}const H0={partial:!0,tokenize:f$};function f$(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const f1={concrete:!0,name:"codeFenced",tokenize:p$};function p$(e,t,n){const r=this,i={partial:!0,tokenize:T};let s=0,a=0,l;return c;function c(N){return u(N)}function u(N){const _=r.events[r.events.length-1];return s=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,l=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(N)}function d(N){return N===l?(a++,e.consume(N),d):a<3?n(N):(e.exit("codeFencedFenceSequence"),lt(N)?xt(e,f,"whitespace")(N):f(N))}function f(N){return N===null||Ze(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(H0,k,S)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(N))}function p(N){return N===null||Ze(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(N)):lt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xt(e,h,"whitespace")(N)):N===96&&N===l?n(N):(e.consume(N),p)}function h(N){return N===null||Ze(N)?f(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||Ze(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(N)):N===96&&N===l?n(N):(e.consume(N),g)}function k(N){return e.attempt(i,S,w)(N)}function w(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),m}function m(N){return s>0&&lt(N)?xt(e,b,"linePrefix",s+1)(N):b(N)}function b(N){return N===null||Ze(N)?e.check(H0,k,S)(N):(e.enter("codeFlowValue"),v(N))}function v(N){return N===null||Ze(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),v)}function S(N){return e.exit("codeFenced"),t(N)}function T(N,_,R){let L=0;return C;function C(D){return N.enter("lineEnding"),N.consume(D),N.exit("lineEnding"),U}function U(D){return N.enter("codeFencedFence"),lt(D)?xt(N,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):$(D)}function $(D){return D===l?(N.enter("codeFencedFenceSequence"),G(D)):R(D)}function G(D){return D===l?(L++,N.consume(D),G):L>=a?(N.exit("codeFencedFenceSequence"),lt(D)?xt(N,I,"whitespace")(D):I(D)):R(D)}function I(D){return D===null||Ze(D)?(N.exit("codeFencedFence"),_(D)):R(D)}}}const om={name:"codeIndented",tokenize:m$},h$={partial:!0,tokenize:g$};function m$(e,t,n){return r;function r(l){return e.enter("codeIndented"),zA(e,i,n,"linePrefix",4,4)(l)}function i(l){return l===null?a(l):Ze(l)?e.attempt(h$,i,a)(l):(e.enter("codeFlowValue"),s(l))}function s(l){return l===null||Ze(l)?(e.exit("codeFlowValue"),i(l)):(e.consume(l),s)}function a(l){return e.exit("codeIndented"),t(l)}}function g$(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Ze(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):zA(e,t,s,"linePrefix",4,4)(a)}function s(a){return Ze(a)?i(a):n(a)}}const b$={name:"codeText",previous:y$,resolve:x$,tokenize:v$};function x$(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function y$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function v$(e,t,n){let r=0,i,s;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),r++,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?(s=e.enter("codeTextSequence"),i=0,d(f)):Ze(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||Ze(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",u(f))}}function HA(e){const t={};let n=-1,r,i,s,a,l,c,u;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,k$(e,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--&&(a=e[s],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);i&&(r[1].end=Object.assign({},e[i][1].start),l=e.slice(i,n),l.unshift(r),Tr(e,i,n-i+1,l))}}return!u}function k$(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const s=[],a=n._tokenizer||r.parser[n.contentType](n.start),l=a.events,c=[],u={};let d,f,p=-1,h=n,g=0,k=0;const w=[k];for(;h;){for(;e[++i][1]!==h;);s.push(i),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<l.length;)l[p][0]==="exit"&&l[p-1][0]==="enter"&&l[p][1].type===l[p-1][1].type&&l[p][1].start.line!==l[p][1].end.line&&(k=p+1,w.push(k),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):w.pop(),p=w.length;p--;){const m=l.slice(w[p],w[p+1]),b=s.pop();c.unshift([b,b+m.length-1]),Tr(e,b,2,m)}for(p=-1;++p<c.length;)u[g+c[p][0]]=g+c[p][1],g+=c[p][1]-c[p][0]-1;return u}const w$={resolve:E$,tokenize:N$},S$={partial:!0,tokenize:_$};function E$(e){return HA(e),e}function N$(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):Ze(l)?e.check(S$,a,s)(l):(e.consume(l),i)}function s(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,i}}function _$(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),xt(e,s,"linePrefix")}function s(a){if(a===null||Ze(a))return n(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function FA(e,t,n,r,i,s,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(m){return m===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(m),e.exit(s),p):m===null||m===32||m===41||Kf(m)?n(m):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(m))}function p(m){return m===62?(e.enter(s),e.consume(m),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===62?(e.exit("chunkString"),e.exit(l),p(m)):m===null||m===60||Ze(m)?n(m):(e.consume(m),m===92?g:h)}function g(m){return m===60||m===62||m===92?(e.consume(m),h):h(m)}function k(m){return!d&&(m===null||m===41||jt(m))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(m)):d<u&&m===40?(e.consume(m),d++,k):m===41?(e.consume(m),d--,k):m===null||m===32||m===40||Kf(m)?n(m):(e.consume(m),m===92?w:k)}function w(m){return m===40||m===41||m===92?(e.consume(m),k):k(m)}}function $A(e,t,n,r,i,s){const a=this;let l=0,c;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(s),d}function d(h){return l>999||h===null||h===91||h===93&&!c||h===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(e.exit(s),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):Ze(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Ze(h)||l++>999?(e.exit("chunkString"),d(h)):(e.consume(h),c||(c=!lt(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),l++,f):f(h)}}function GA(e,t,n,r,i,s){let a;return l;function l(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),a=p===40?41:p,c):n(p)}function c(p){return p===a?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(s),u(p))}function u(p){return p===a?(e.exit(s),c(a)):p===null?n(p):Ze(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),xt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===a||p===null||Ze(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:d)}function f(p){return p===a||p===92?(e.consume(p),d):d(p)}}function rc(e,t){let n;return r;function r(i){return Ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):lt(i)?xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const C$={name:"definition",tokenize:A$},T$={partial:!0,tokenize:M$};function A$(e,t,n){const r=this;let i;return s;function s(h){return e.enter("definition"),a(h)}function a(h){return $A.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return i=Pr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),c):n(h)}function c(h){return jt(h)?rc(e,u)(h):u(h)}function u(h){return FA(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(T$,f,f)(h)}function f(h){return lt(h)?xt(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Ze(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function M$(e,t,n){return r;function r(l){return jt(l)?rc(e,i)(l):n(l)}function i(l){return GA(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return lt(l)?xt(e,a,"whitespace")(l):a(l)}function a(l){return l===null||Ze(l)?t(l):n(l)}}const j$={name:"hardBreakEscape",tokenize:O$};function O$(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Ze(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const R$={name:"headingAtx",resolve:D$,tokenize:I$};function D$(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};Tr(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])}return e}function I$(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||jt(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ze(d)?(e.exit("atxHeading"),t(d)):lt(d)?xt(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||jt(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const L$=["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"],p1=["pre","script","style","textarea"],z$={concrete:!0,name:"htmlFlow",resolveTo:U$,tokenize:B$},P$={partial:!0,tokenize:H$};function U$(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 B$(e,t,n){const r=this;let i,s,a,l,c;return u;function u(O){return d(O)}function d(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),f}function f(O){return O===33?(e.consume(O),p):O===47?(e.consume(O),s=!0,k):O===63?(e.consume(O),i=3,r.interrupt?t:E):Ln(O)?(e.consume(O),a=String.fromCharCode(O),w):n(O)}function p(O){return O===45?(e.consume(O),i=2,h):O===91?(e.consume(O),i=5,l=0,g):Ln(O)?(e.consume(O),i=4,r.interrupt?t:E):n(O)}function h(O){return O===45?(e.consume(O),r.interrupt?t:E):n(O)}function g(O){const Q="CDATA[";return O===Q.charCodeAt(l++)?(e.consume(O),l===Q.length?r.interrupt?t:$:g):n(O)}function k(O){return Ln(O)?(e.consume(O),a=String.fromCharCode(O),w):n(O)}function w(O){if(O===null||O===47||O===62||jt(O)){const Q=O===47,F=a.toLowerCase();return!Q&&!s&&p1.includes(F)?(i=1,r.interrupt?t(O):$(O)):L$.includes(a.toLowerCase())?(i=6,Q?(e.consume(O),m):r.interrupt?t(O):$(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):s?b(O):v(O))}return O===45||Mn(O)?(e.consume(O),a+=String.fromCharCode(O),w):n(O)}function m(O){return O===62?(e.consume(O),r.interrupt?t:$):n(O)}function b(O){return lt(O)?(e.consume(O),b):C(O)}function v(O){return O===47?(e.consume(O),C):O===58||O===95||Ln(O)?(e.consume(O),S):lt(O)?(e.consume(O),v):C(O)}function S(O){return O===45||O===46||O===58||O===95||Mn(O)?(e.consume(O),S):T(O)}function T(O){return O===61?(e.consume(O),N):lt(O)?(e.consume(O),T):v(O)}function N(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),c=O,_):lt(O)?(e.consume(O),N):R(O)}function _(O){return O===c?(e.consume(O),c=null,L):O===null||Ze(O)?n(O):(e.consume(O),_)}function R(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||jt(O)?T(O):(e.consume(O),R)}function L(O){return O===47||O===62||lt(O)?v(O):n(O)}function C(O){return O===62?(e.consume(O),U):n(O)}function U(O){return O===null||Ze(O)?$(O):lt(O)?(e.consume(O),U):n(O)}function $(O){return O===45&&i===2?(e.consume(O),A):O===60&&i===1?(e.consume(O),M):O===62&&i===4?(e.consume(O),j):O===63&&i===3?(e.consume(O),E):O===93&&i===5?(e.consume(O),H):Ze(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(P$,B,G)(O)):O===null||Ze(O)?(e.exit("htmlFlowData"),G(O)):(e.consume(O),$)}function G(O){return e.check(H0,I,B)(O)}function I(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),D}function D(O){return O===null||Ze(O)?G(O):(e.enter("htmlFlowData"),$(O))}function A(O){return O===45?(e.consume(O),E):$(O)}function M(O){return O===47?(e.consume(O),a="",P):$(O)}function P(O){if(O===62){const Q=a.toLowerCase();return p1.includes(Q)?(e.consume(O),j):$(O)}return Ln(O)&&a.length<8?(e.consume(O),a+=String.fromCharCode(O),P):$(O)}function H(O){return O===93?(e.consume(O),E):$(O)}function E(O){return O===62?(e.consume(O),j):O===45&&i===2?(e.consume(O),E):$(O)}function j(O){return O===null||Ze(O)?(e.exit("htmlFlowData"),B(O)):(e.consume(O),j)}function B(O){return e.exit("htmlFlow"),t(O)}}function H$(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ku,t,n)}}const F$={name:"htmlText",tokenize:$$};function $$(e,t,n){const r=this;let i,s,a;return l;function l(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),c}function c(E){return E===33?(e.consume(E),u):E===47?(e.consume(E),T):E===63?(e.consume(E),v):Ln(E)?(e.consume(E),R):n(E)}function u(E){return E===45?(e.consume(E),d):E===91?(e.consume(E),s=0,g):Ln(E)?(e.consume(E),b):n(E)}function d(E){return E===45?(e.consume(E),h):n(E)}function f(E){return E===null?n(E):E===45?(e.consume(E),p):Ze(E)?(a=f,M(E)):(e.consume(E),f)}function p(E){return E===45?(e.consume(E),h):f(E)}function h(E){return E===62?A(E):E===45?p(E):f(E)}function g(E){const j="CDATA[";return E===j.charCodeAt(s++)?(e.consume(E),s===j.length?k:g):n(E)}function k(E){return E===null?n(E):E===93?(e.consume(E),w):Ze(E)?(a=k,M(E)):(e.consume(E),k)}function w(E){return E===93?(e.consume(E),m):k(E)}function m(E){return E===62?A(E):E===93?(e.consume(E),m):k(E)}function b(E){return E===null||E===62?A(E):Ze(E)?(a=b,M(E)):(e.consume(E),b)}function v(E){return E===null?n(E):E===63?(e.consume(E),S):Ze(E)?(a=v,M(E)):(e.consume(E),v)}function S(E){return E===62?A(E):v(E)}function T(E){return Ln(E)?(e.consume(E),N):n(E)}function N(E){return E===45||Mn(E)?(e.consume(E),N):_(E)}function _(E){return Ze(E)?(a=_,M(E)):lt(E)?(e.consume(E),_):A(E)}function R(E){return E===45||Mn(E)?(e.consume(E),R):E===47||E===62||jt(E)?L(E):n(E)}function L(E){return E===47?(e.consume(E),A):E===58||E===95||Ln(E)?(e.consume(E),C):Ze(E)?(a=L,M(E)):lt(E)?(e.consume(E),L):A(E)}function C(E){return E===45||E===46||E===58||E===95||Mn(E)?(e.consume(E),C):U(E)}function U(E){return E===61?(e.consume(E),$):Ze(E)?(a=U,M(E)):lt(E)?(e.consume(E),U):L(E)}function $(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),i=E,G):Ze(E)?(a=$,M(E)):lt(E)?(e.consume(E),$):(e.consume(E),I)}function G(E){return E===i?(e.consume(E),i=void 0,D):E===null?n(E):Ze(E)?(a=G,M(E)):(e.consume(E),G)}function I(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||jt(E)?L(E):(e.consume(E),I)}function D(E){return E===47||E===62||jt(E)?L(E):n(E)}function A(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function M(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),P}function P(E){return lt(E)?xt(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):H(E)}function H(E){return e.enter("htmlTextData"),a(E)}}const ry={name:"labelEnd",resolveAll:Y$,resolveTo:V$,tokenize:X$},G$={tokenize:W$},K$={tokenize:Z$},q$={tokenize:Q$};function Y$(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Tr(e,0,e.length,n),e}function V$(e,t){let n=e.length,r=0,i,s,a;for(;n--;){const d=e[n][1];if(i){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;e[n][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(i=n,d.type!=="labelLink")){r=2;break}}else d.type==="labelEnd"&&(s=n)}const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=vr(a,e.slice(i+1,i+r+3)),a=vr(a,[["enter",u,t]]),a=vr(a,Gp(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=vr(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=vr(a,e.slice(s+1)),a=vr(a,[["exit",l,t]]),Tr(e,i,e.length,a),e}function X$(e,t,n){const r=this,i=r._labelStarts;let s,a;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();s=i[i.length-1]}return l;function l(p){return s?s._inactive?f(p):(a=r.parser.defined.includes(Pr(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),c):n(p)}function c(p){return p===40?e.attempt(G$,d,a?d:f)(p):p===91?e.attempt(K$,d,a?u:f)(p):a?d(p):f(p)}function u(p){return e.attempt(q$,d,f)(p)}function d(p){return i.pop(),t(p)}function f(p){return s._balanced=!0,n(p)}}function W$(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return jt(f)?rc(e,s)(f):s(f)}function s(f){return f===41?d(f):FA(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return jt(f)?rc(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?GA(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return jt(f)?rc(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 Z$(e,t,n){const r=this;return i;function i(l){return $A.call(r,e,s,a,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Pr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function a(l){return n(l)}}function Q$(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const J$={name:"labelStartImage",resolveAll:ry.resolveAll,tokenize:e7};function e7(e,t,n){const r=this;let i;return s;function s(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"),i=e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(c))}}const t7={name:"labelStartLink",resolveAll:ry.resolveAll,tokenize:n7};function n7(e,t,n){const r=this;let i;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),i=e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(l))}}const cm={name:"lineEnding",tokenize:r7};function r7(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),xt(e,t,"linePrefix")}}const Xd={name:"thematicBreak",tokenize:i7};function i7(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ze(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),lt(u)?xt(e,l,"whitespace")(u):l(u))}}const Kn={continuation:{tokenize:o7},exit:u7,name:"list",tokenize:l7},s7={partial:!0,tokenize:d7},a7={partial:!0,tokenize:c7};function l7(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:U0(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Xd,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(h)}return n(h)}function c(h){return U0(h)&&++a<10?(e.consume(h),c):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(ku,r.interrupt?n:d,e.attempt(s7,p,f))}function d(h){return r.containerState.initialBlankLine=!0,s++,p(h)}function f(h){return lt(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function o7(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ku,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xt(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!lt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(a7,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,xt(e,e.attempt(Kn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function c7(e,t,n){const r=this;return xt(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function u7(e){e.exit(this.containerState.type)}function d7(e,t,n){const r=this;return xt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!lt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const h1={name:"setextUnderline",resolveTo:f7,tokenize:p7};function f7(e,t){const n=new qf;let r=e.length,i,s,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!a&&e[r][1].type==="definition"&&(a=r);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(n.add(s,0,[["enter",l,t]]),n.add(a+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[a][1].end}):e[i][1]=l,n.add(e.length,0,[["exit",l,t]]),n.consume(e),e}function p7(e,t,n){const r=this;let i;return s;function s(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),lt(u)?xt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ze(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const h7={tokenize:m7};function m7(e){const t=this,n=e.attempt(ku,r,e.attempt(this.parser.constructs.flowInitial,i,xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(w$,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const g7={resolveAll:qA()},b7=KA("string"),x7=KA("text");function KA(e){return{resolveAll:qA(e==="text"?y7:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,l);return a;function a(d){return u(d)?s(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"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=i[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function qA(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function y7(e,t){const n=new qf;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],s=t.sliceStream(i);let a=s.length,l=-1,c=0,u;for(;a--;){const d=s[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&&r===e.length&&(c=0),c){const d={type:r===e.length||u||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:i.start._bufferIndex+l,_index:i.start._index+a,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):n.add(r,0,[["enter",d,t],["exit",d,t]])}r++}return n.consume(e),e}const v7={42:Kn,43:Kn,45:Kn,48:Kn,49:Kn,50:Kn,51:Kn,52:Kn,53:Kn,54:Kn,55:Kn,56:Kn,57:Kn,62:PA},k7={91:C$},w7={[-2]:om,[-1]:om,32:om},S7={35:R$,42:Xd,45:[h1,Xd],60:z$,61:h1,95:Xd,96:f1,126:f1},E7={38:BA,92:UA},N7={[-5]:cm,[-4]:cm,[-3]:cm,33:J$,38:BA,42:B0,60:[i$,F$],91:t7,92:[j$,UA],93:ry,95:B0,96:b$},_7={null:[B0,g7]},C7={null:[42,95]},T7={null:[]},A7=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:C7,contentInitial:k7,disable:T7,document:v7,flow:S7,flowInitial:w7,insideSpan:_7,string:E7,text:N7},Symbol.toStringTag,{value:"Module"}));function M7(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],l=[];const c={attempt:_(T),check:_(N),consume:b,enter:v,exit:S,interrupt:_(N,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&s.push(t),u;function f(U){return a=vr(a,U),w(),a[a.length-1]!==null?[]:(R(t,0),u.events=Gp(s,u.events,u),u.events)}function p(U,$){return O7(h(U),$)}function h(U){return j7(a,U)}function g(){const{_bufferIndex:U,_index:$,line:G,column:I,offset:D}=r;return{_bufferIndex:U,_index:$,line:G,column:I,offset:D}}function k(U){i[U.line]=U.column,C()}function w(){for(;r._index<a.length;){const U=a[r._index];if(typeof U=="string"){const $=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<U.length;)m(U.charCodeAt(r._bufferIndex))}else m(U)}}function m(U){d=d(U)}function b(U){Ze(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,C()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=U}function v(U,$){const G=$||{};return G.type=U,G.start=g(),u.events.push(["enter",G,u]),l.push(G),G}function S(U){const $=l.pop();return $.end=g(),u.events.push(["exit",$,u]),$}function T(U,$){R(U,$.from)}function N(U,$){$.restore()}function _(U,$){return G;function G(I,D,A){let M,P,H,E;return Array.isArray(I)?B(I):"tokenize"in I?B([I]):j(I);function j(J){return ce;function ce(K){const q=K!==null&&J[K],V=K!==null&&J.null,ue=[...Array.isArray(q)?q:q?[q]:[],...Array.isArray(V)?V:V?[V]:[]];return B(ue)(K)}}function B(J){return M=J,P=0,J.length===0?A:O(J[P])}function O(J){return ce;function ce(K){return E=L(),H=J,J.partial||(u.currentConstruct=J),J.name&&u.parser.constructs.disable.null.includes(J.name)?F():J.tokenize.call($?Object.assign(Object.create(u),$):u,c,Q,F)(K)}}function Q(J){return U(H,E),D}function F(J){return E.restore(),++P<M.length?O(M[P]):A}}}function R(U,$){U.resolveAll&&!s.includes(U)&&s.push(U),U.resolve&&Tr(u.events,$,u.events.length-$,U.resolve(u.events.slice($),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function L(){const U=g(),$=u.previous,G=u.currentConstruct,I=u.events.length,D=Array.from(l);return{from:I,restore:A};function A(){r=U,u.previous=$,u.currentConstruct=G,u.events.length=I,l=D,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function j7(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function O7(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
486
- `;break}case-3:{a=`\r
487
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function R7(e){const r={constructs:IA([A7,...(e||{}).extensions||[]]),content:i(ZF),defined:[],document:i(JF),flow:i(h7),lazy:{},string:i(b7),text:i(x7)};return r;function i(s){return a;function a(l){return M7(r,s,l)}}}function D7(e){for(;!HA(e););return e}const m1=/[\0\t\n\r]/g;function I7(){let e=1,t="",n=!0,r;return i;function i(s,a,l){s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s));const c=[];let u=0;for(t="",n&&(s.charCodeAt(0)===65279&&u++,n=void 0);u<s.length;){m1.lastIndex=u;const d=m1.exec(s),f=d&&d.index!==void 0?d.index:s.length,p=s.charCodeAt(f);if(!d){t=s.slice(u);break}if(p===10&&u===f&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),u<f&&(c.push(s.slice(u,f)),e+=f-u),p){case 0:{c.push(65533),e++;break}case 9:{const h=Math.ceil(e/4)*4;for(c.push(-2);e++<h;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}u=f+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const L7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function z7(e){return e.replace(L7,P7)}function P7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return LA(n.slice(s?2:1),s?16:10)}return ny(n)||e}const YA={}.hasOwnProperty;function U7(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),B7(n)(D7(R7(n).document().write(I7()(e,t,!0))))}function B7(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ke),autolinkProtocol:L,autolinkEmail:L,atxHeading:s(ne),blockQuote:s(V),characterEscape:L,characterReference:L,codeFenced:s(ue),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(ue,a),codeText:s(me,a),codeTextData:L,data:L,codeFlowValue:L,definition:s(Ne),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Te),hardBreakEscape:s(pe),hardBreakTrailing:s(pe),htmlFlow:s(le,a),htmlFlowData:L,htmlText:s(le,a),htmlTextData:L,image:s(de),label:a,link:s(Ke),listItem:s(Fe),listItemValue:p,listOrdered:s(He,f),listUnordered:s(He),paragraph:s(dt),reference:O,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(ne),strong:s(st),thematicBreak:s(at)},exit:{atxHeading:c(),atxHeadingSequence:T,autolink:c(),autolinkEmail:q,autolinkProtocol:K,blockQuote:c(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:F,characterReferenceMarkerNumeric:F,characterReferenceValue:J,characterReference:ce,codeFenced:c(w),codeFencedFence:k,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:C,codeIndented:c(m),codeText:c(D),codeTextData:C,data:C,definition:c(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:v,emphasis:c(),hardBreakEscape:c($),hardBreakTrailing:c($),htmlFlow:c(G),htmlFlowData:C,htmlText:c(I),htmlTextData:C,image:c(M),label:H,labelText:P,lineEnding:U,link:c(A),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:E,resourceTitleString:j,resource:B,setextHeading:c(R),setextHeadingLineSequence:_,setextHeadingText:N,strong:c(),thematicBreak:c()}};VA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Z){let ae={type:"root",children:[]};const _e={stack:[ae],tokenStack:[],config:t,enter:l,exit:u,buffer:a,resume:d,data:n},x=[];let Y=-1;for(;++Y<Z.length;)if(Z[Y][1].type==="listOrdered"||Z[Y][1].type==="listUnordered")if(Z[Y][0]==="enter")x.push(Y);else{const se=x.pop();Y=i(Z,se,Y)}for(Y=-1;++Y<Z.length;){const se=t[Z[Y][0]];YA.call(se,Z[Y][1].type)&&se[Z[Y][1].type].call(Object.assign({sliceSerialize:Z[Y][2].sliceSerialize},_e),Z[Y][1])}if(_e.tokenStack.length>0){const se=_e.tokenStack[_e.tokenStack.length-1];(se[1]||g1).call(_e,void 0,se[0])}for(ae.position={start:Gi(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:Gi(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},Y=-1;++Y<t.transforms.length;)ae=t.transforms[Y](ae)||ae;return ae}function i(Z,ae,_e){let x=ae-1,Y=-1,se=!1,ge,oe,z,re;for(;++x<=_e;){const ie=Z[x];switch(ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ie[0]==="enter"?Y++:Y--,re=void 0;break}case"lineEndingBlank":{ie[0]==="enter"&&(ge&&!re&&!Y&&!z&&(z=x),re=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:re=void 0}if(!Y&&ie[0]==="enter"&&ie[1].type==="listItemPrefix"||Y===-1&&ie[0]==="exit"&&(ie[1].type==="listUnordered"||ie[1].type==="listOrdered")){if(ge){let he=x;for(oe=void 0;he--;){const be=Z[he];if(be[1].type==="lineEnding"||be[1].type==="lineEndingBlank"){if(be[0]==="exit")continue;oe&&(Z[oe][1].type="lineEndingBlank",se=!0),be[1].type="lineEnding",oe=he}else if(!(be[1].type==="linePrefix"||be[1].type==="blockQuotePrefix"||be[1].type==="blockQuotePrefixWhitespace"||be[1].type==="blockQuoteMarker"||be[1].type==="listItemIndent"))break}z&&(!oe||z<oe)&&(ge._spread=!0),ge.end=Object.assign({},oe?Z[oe][1].start:ie[1].end),Z.splice(oe||x,0,["exit",ge,ie[2]]),x++,_e++}if(ie[1].type==="listItemPrefix"){const he={type:"listItem",_spread:!1,start:Object.assign({},ie[1].start),end:void 0};ge=he,Z.splice(x,0,["enter",he,ie[2]]),x++,_e++,z=void 0,re=!0}}}return Z[ae][1]._spread=se,_e}function s(Z,ae){return _e;function _e(x){l.call(this,Z(x),x),ae&&ae.call(this,x)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(Z,ae,_e){this.stack[this.stack.length-1].children.push(Z),this.stack.push(Z),this.tokenStack.push([ae,_e||void 0]),Z.position={start:Gi(ae.start),end:void 0}}function c(Z){return ae;function ae(_e){Z&&Z.call(this,_e),u.call(this,_e)}}function u(Z,ae){const _e=this.stack.pop(),x=this.tokenStack.pop();if(x)x[0].type!==Z.type&&(ae?ae.call(this,Z,x[0]):(x[1]||g1).call(this,Z,x[0]));else throw new Error("Cannot close `"+Z.type+"` ("+nc({start:Z.start,end:Z.end})+"): it’s not open");_e.position.end=Gi(Z.end)}function d(){return ty(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(Z){if(this.data.expectingFirstListItemValue){const ae=this.stack[this.stack.length-2];ae.start=Number.parseInt(this.sliceSerialize(Z),10),this.data.expectingFirstListItemValue=void 0}}function h(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.lang=Z}function g(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.meta=Z}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z.replace(/(\r?\n|\r)$/g,"")}function b(Z){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ae,_e.identifier=Pr(this.sliceSerialize(Z)).toLowerCase()}function v(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.title=Z}function S(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.url=Z}function T(Z){const ae=this.stack[this.stack.length-1];if(!ae.depth){const _e=this.sliceSerialize(Z).length;ae.depth=_e}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function _(Z){const ae=this.stack[this.stack.length-1];ae.depth=this.sliceSerialize(Z).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function L(Z){const _e=this.stack[this.stack.length-1].children;let x=_e[_e.length-1];(!x||x.type!=="text")&&(x=Ue(),x.position={start:Gi(Z.start),end:void 0},_e.push(x)),this.stack.push(x)}function C(Z){const ae=this.stack.pop();ae.value+=this.sliceSerialize(Z),ae.position.end=Gi(Z.end)}function U(Z){const ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=ae.children[ae.children.length-1];_e.position.end=Gi(Z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ae.type)&&(L.call(this,Z),C.call(this,Z))}function $(){this.data.atHardBreak=!0}function G(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z}function I(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z}function D(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.value=Z}function A(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=ae,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function M(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=ae,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function P(Z){const ae=this.sliceSerialize(Z),_e=this.stack[this.stack.length-2];_e.label=z7(ae),_e.identifier=Pr(ae).toLowerCase()}function H(){const Z=this.stack[this.stack.length-1],ae=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const x=Z.children;_e.children=x}else _e.alt=ae}function E(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.url=Z}function j(){const Z=this.resume(),ae=this.stack[this.stack.length-1];ae.title=Z}function B(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function Q(Z){const ae=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ae,_e.identifier=Pr(this.sliceSerialize(Z)).toLowerCase(),this.data.referenceType="full"}function F(Z){this.data.characterReferenceType=Z.type}function J(Z){const ae=this.sliceSerialize(Z),_e=this.data.characterReferenceType;let x;_e?(x=LA(ae,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):x=ny(ae);const Y=this.stack[this.stack.length-1];Y.value+=x}function ce(Z){const ae=this.stack.pop();ae.position.end=Gi(Z.end)}function K(Z){C.call(this,Z);const ae=this.stack[this.stack.length-1];ae.url=this.sliceSerialize(Z)}function q(Z){C.call(this,Z);const ae=this.stack[this.stack.length-1];ae.url="mailto:"+this.sliceSerialize(Z)}function V(){return{type:"blockquote",children:[]}}function ue(){return{type:"code",lang:null,meta:null,value:""}}function me(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function ne(){return{type:"heading",depth:0,children:[]}}function pe(){return{type:"break"}}function le(){return{type:"html",value:""}}function de(){return{type:"image",title:null,url:"",alt:null}}function Ke(){return{type:"link",title:null,url:"",children:[]}}function He(Z){return{type:"list",ordered:Z.type==="listOrdered",start:null,spread:Z._spread,children:[]}}function Fe(Z){return{type:"listItem",spread:Z._spread,checked:null,children:[]}}function dt(){return{type:"paragraph",children:[]}}function st(){return{type:"strong",children:[]}}function Ue(){return{type:"text",value:""}}function at(){return{type:"thematicBreak"}}}function Gi(e){return{line:e.line,column:e.column,offset:e.offset}}function VA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?VA(e,r):H7(e,r)}}function H7(e,t){let n;for(n in t)if(YA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function g1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+nc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+nc({start:t.start,end:t.end})+") is still open")}function F7(e){const t=this;t.parser=n;function n(r){return U7(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function $7(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 G7(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
488
- `}]}function K7(e,t){const n=t.value?t.value+`
489
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function q7(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y7(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V7(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=lo(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(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 X7(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 W7(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function XA(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Z7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XA(e,t);const i={src:lo(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Q7(e,t){const n={src:lo(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 r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function J7(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function eG(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XA(e,t);const i={href:lo(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function tG(e,t){const n={href:lo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nG(e,t,n){const r=e.all(t),i=n?rG(n):WA(t),s={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.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:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(i||l!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
490
- `}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
491
- `});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function rG(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=WA(n[r])}return t}function WA(e){const t=e.spread;return t??e.children.length>1}function iG(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];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 s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function sG(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aG(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function lG(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oG(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Zx(t.children[1]),c=TA(t.children[t.children.length-1]);l&&c&&(a.position={start:l,end:c}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function cG(e,t,n){const r=n?n.children:void 0,s=(r?r.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],p={},h=a?a[c]:void 0;h&&(p.align=h);let g={type:"element",tagName:s,properties:p,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function uG(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const b1=9,x1=32;function dG(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(y1(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(y1(t.slice(i),i>0,!1)),s.join("")}function y1(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===b1||s===x1;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===b1||s===x1;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function fG(e,t){const n={type:"text",value:dG(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function pG(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const hG={blockquote:$7,break:G7,code:K7,delete:q7,emphasis:Y7,footnoteReference:V7,heading:X7,html:W7,imageReference:Z7,image:Q7,inlineCode:J7,linkReference:eG,link:tG,listItem:nG,list:iG,paragraph:sG,root:aG,strong:lG,table:oG,tableCell:uG,tableRow:cG,text:fG,thematicBreak:pG,toml:ld,yaml:ld,definition:ld,footnoteDefinition:ld};function ld(){}const ZA=-1,Kp=0,ic=1,Vf=2,iy=3,sy=4,ay=5,ly=6,QA=7,JA=8,eM=typeof self=="object"?self:globalThis,v1=(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 eM[e](t)},mG=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case Kp:case ZA:return n(a,i);case ic:{const l=n([],i);for(const c of a)l.push(r(c));return l}case Vf:{const l=n({},i);for(const[c,u]of a)l[r(c)]=r(u);return l}case iy:return n(new Date(a),i);case sy:{const{source:l,flags:c}=a;return n(new RegExp(l,c),i)}case ay:{const l=n(new Map,i);for(const[c,u]of a)l.set(r(c),r(u));return l}case ly:{const l=n(new Set,i);for(const c of a)l.add(r(c));return l}case QA:{const{name:l,message:c}=a;return n(typeof eM[l]=="function"?v1(l,c):new Error(c),i)}case JA:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);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(v1(s,a),i)};return r},k1=e=>mG(new Map,e)(0),Gs="",{toString:gG}={},{keys:bG}=Object,Eo=e=>{const t=typeof e;if(t!=="object"||!e)return[Kp,t];const n=gG.call(e).slice(8,-1);switch(n){case"Array":return[ic,Gs];case"Object":return[Vf,Gs];case"Date":return[iy,Gs];case"RegExp":return[sy,Gs];case"Map":return[ay,Gs];case"Set":return[ly,Gs];case"DataView":return[ic,n]}return n.includes("Array")?[ic,n]:e instanceof Error?[QA,e.name||"Error"]:[Vf,n]},od=([e,t])=>e===Kp&&(t==="function"||t==="symbol"),xG=(e,t,n,r)=>{const i=(a,l)=>{const c=r.push(a)-1;return n.set(l,c),c},s=a=>{if(n.has(a))return n.get(a);let[l,c]=Eo(a);switch(l){case Kp:{let d=a;switch(c){case"bigint":l=JA,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([ZA],a)}return i([l,d],a)}case ic:{if(c){let p=a;return c==="DataView"?p=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(a)),i([c,[...p]],a)}const d=[],f=i([l,d],a);for(const p of a)d.push(s(p));return f}case Vf:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],f=i([l,d],a);for(const p of bG(a))(e||!od(Eo(a[p])))&&d.push([s(p),s(a[p])]);return f}case iy:return i([l,isNaN(a.getTime())?Gs:a.toISOString()],a);case sy:{const{source:d,flags:f}=a;return i([l,{source:d,flags:f}],a)}case ay:{const d=[],f=i([l,d],a);for(const[p,h]of a)(e||!(od(Eo(p))||od(Eo(h))))&&d.push([s(p),s(h)]);return f}case ly:{const d=[],f=i([l,d],a);for(const p of a)(e||!od(Eo(p)))&&d.push(s(p));return f}}const{message:u}=a;return i([l,{name:c,message:u}],a)};return s},w1=(e,{json:t,lossy:n}={})=>{const r=[];return xG(!(t||n),!!t,new Map,r)(e),r},ia=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?k1(w1(e,t)):structuredClone(e):(e,t)=>k1(w1(e,t));function yG(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 vG(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function kG(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||yG,r=e.options.footnoteBackLabel||vG,i=e.options.footnoteLabel||"Footnotes",s=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(),p=lo(f.toLowerCase());let h=0;const g=[],k=e.footnoteCounts.get(f);for(;k!==void 0&&++h<=k;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,h);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,h),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const w=d[d.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const b=w.children[w.children.length-1];b&&b.type==="text"?b.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...g)}else d.push(...g);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(u,m),l.push(m)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ia(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
492
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
493
- `}]}}const wu=function(e){if(e==null)return NG;if(typeof e=="function")return qp(e);if(typeof e=="object")return Array.isArray(e)?wG(e):SG(e);if(typeof e=="string")return EG(e);throw new Error("Expected function, string, or object as test")};function wG(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=wu(e[n]);return qp(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function SG(e){const t=e;return qp(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function EG(e){return qp(t);function t(n){return n&&n.type===e}}function qp(e){return t;function t(n,r,i){return!!(_G(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function NG(){return!0}function _G(e){return e!==null&&typeof e=="object"&&"type"in e}const tM=[],CG=!0,F0=!1,TG="skip";function nM(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=wu(i),a=r?-1:1;l(e,void 0,[])();function l(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(c.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=tM,g,k,w;if((!t||s(c,u,d[d.length-1]||void 0))&&(h=AG(n(c,d)),h[0]===F0))return h;if("children"in c&&c.children){const m=c;if(m.children&&h[0]!==TG)for(k=(r?m.children.length:-1)+a,w=d.concat(m);k>-1&&k<m.children.length;){const b=m.children[k];if(g=l(b,k,w)(),g[0]===F0)return g;k=typeof g[1]=="number"?g[1]:k+a}}return h}}}function AG(e){return Array.isArray(e)?e:typeof e=="number"?[CG,e]:e==null?tM:[e]}function Yp(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),nM(e,s,l,i);function l(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return a(c,f,d)}}const $0={}.hasOwnProperty,MG={};function jG(e,t){const n=t||MG,r=new Map,i=new Map,s=new Map,a={...hG,...n.handlers},l={all:u,applyData:RG,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:c,options:n,patch:OG,wrap:IG};return Yp(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,p=String(d.identifier).toUpperCase();f.has(p)||f.set(p,d)}}),l;function c(d,f){const p=d.type,h=l.handlers[p];if($0.call(l.handlers,p)&&h)return h(l,d,f);if(l.options.passThrough&&l.options.passThrough.includes(p)){if("children"in d){const{children:k,...w}=d,m=ia(w);return m.children=l.all(d),m}return ia(d)}return(l.options.unknownHandler||DG)(l,d,f)}function u(d){const f=[];if("children"in d){const p=d.children;let h=-1;for(;++h<p.length;){const g=l.one(p[h],d);if(g){if(h&&p[h-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=S1(g.value)),!Array.isArray(g)&&g.type==="element")){const k=g.children[0];k&&k.type==="text"&&(k.value=S1(k.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function OG(e,t){e.position&&(t.position=SF(e))}function RG(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,ia(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function DG(e,t){const n=t.data||{},r="value"in t&&!($0.call(n,"hProperties")||$0.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function IG(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
494
- `});++r<e.length;)r&&n.push({type:"text",value:`
495
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
496
- `}),n}function S1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function E1(e,t){const n=jG(e,t),r=n.one(e,void 0),i=kG(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
497
- `},i),s}function LG(e,t){return e&&"run"in e?async function(n,r){const i=E1(n,{file:r,...t});await e.run(i,r)}:function(n,r){return E1(n,{file:r,...e||t})}}function N1(e){if(e)throw e}function G0(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 zG(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...i);function l(c,...u){const d=e[++s];let f=-1;if(c){a(c);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,d?PG(d,l)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function PG(e,t){let n;return r;function r(...a){const l=e.length>a.length;let c;l&&a.push(i);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return i(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,i):c instanceof Error?i(c):s(c))}function i(a,...l){n||(n=!0,t(a,...l))}function s(a){i(null,a)}}const Yr={basename:UG,dirname:BG,extname:HG,join:FG,sep:"/"};function UG(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Su(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function BG(e){if(Su(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function HG(e){Su(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function FG(...e){let t=-1,n;for(;++t<e.length;)Su(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":$G(n)}function $G(e){Su(e);const t=e.codePointAt(0)===47;let n=GG(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function GG(e,t){let n="",r=0,i=-1,s=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(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function Su(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const KG={cwd:qG};function qG(){return"/"}function K0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YG(e){if(typeof e=="string")e=new URL(e);else if(!K0(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 VG(e)}function VG(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const um=["history","path","basename","stem","extname","dirname"];class rM{constructor(t){let n;t?K0(t)?n={path:t}:typeof t=="string"||XG(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":KG.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<um.length;){const s=um[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)um.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Yr.basename(this.path):void 0}set basename(t){fm(t,"basename"),dm(t,"basename"),this.path=Yr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yr.dirname(this.path):void 0}set dirname(t){_1(this.basename,"dirname"),this.path=Yr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yr.extname(this.path):void 0}set extname(t){if(dm(t,"extname"),_1(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=Yr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){K0(t)&&(t=YG(t)),fm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yr.basename(this.path,this.extname):void 0}set stem(t){fm(t,"stem"),dm(t,"stem"),this.path=Yr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new jn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function dm(e,t){if(e&&e.includes(Yr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yr.sep+"`")}function fm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function XG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const WG=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};Object.setPrototypeOf(s,r);const a=Object.getOwnPropertyNames(i);for(const l of a){const c=Object.getOwnPropertyDescriptor(i,l);c&&Object.defineProperty(s,l,c)}return s},ZG={}.hasOwnProperty;class oy extends WG{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=zG()}copy(){const t=new oy;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ia(this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(mm("data",this.frozen),this.namespace[t]=n,this):ZG.call(this.namespace,t)&&this.namespace[t]||void 0:t?(mm("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,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=cd(t),r=this.parser||this.Parser;return pm("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),pm("process",this.parser||this.Parser),hm("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const l=cd(t),c=r.parse(l);r.run(c,l,function(d,f,p){if(d||!f||!p)return u(d);const h=f,g=r.stringify(h,p);eK(g)?p.value=g:p.result=g,u(d,p)});function u(d,f){d||!f?a(d):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),pm("processSync",this.parser||this.Parser),hm("processSync",this.compiler||this.Compiler),this.process(t,i),T1("processSync","process",n),r;function i(s,a){n=!0,N1(s),r=a}}run(t,n,r){C1(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,l){const c=cd(n);i.run(t,c,u);function u(d,f,p){const h=f||t;d?l(d):a?a(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),T1("runSync","run",r),i;function s(a,l){N1(a),i=l,r=!0}}stringify(t,n){this.freeze();const r=cd(n),i=this.compiler||this.Compiler;return hm("stringify",i),C1(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(mm("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 s(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&&(i.settings={...i.settings,...ia(u.settings)})}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===u){p=f;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[h,...g]=d;const k=r[p][1];G0(k)&&G0(h)&&(h=ia({...k,...h})),r[p]=[u,h,...g]}}}}const QG=new oy().freeze();function pm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mm(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 C1(e){if(!G0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function T1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function cd(e){return JG(e)?e:new rM(e)}function JG(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eK(e){return typeof e=="string"||tK(e)}function tK(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nK="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",A1=[],M1={allowDangerousHtml:!0},rK=/^(https?|ircs?|mailto|xmpp)$/i,iK=[{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 cy(e){const t=sK(e),n=aK(e);return lK(t.runSync(t.parse(n),n),e)}function sK(e){const t=e.rehypePlugins||A1,n=e.remarkPlugins||A1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...M1}:M1;return QG().use(F7).use(n).use(LG,r).use(t)}function aK(e){const t=e.children||"",n=new rM;return typeof t=="string"&&(n.value=t),n}function lK(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||oK;for(const d of iK)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+nK+d.id,void 0);return Yp(e,u),TF(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return a?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in lm)if(Object.hasOwn(lm,h)&&Object.hasOwn(d.properties,h)){const g=d.properties[h],k=lm[h];(k===null||k.includes(d.tagName))&&(d.properties[h]=c(String(g||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,p)),h&&p&&typeof f=="number")return l&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function oK(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||rK.test(e.slice(0,t))?e:""}function j1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function cK(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function uK(e,t,n){const i=wu((n||{}).ignore||[]),s=dK(t);let a=-1;for(;++a<s.length;)nM(e,"text",l);function l(u,d){let f=-1,p;for(;++f<d.length;){const h=d[f],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return c(u,d)}function c(u,d){const f=d[d.length-1],p=s[a][0],h=s[a][1];let g=0;const w=f.children.indexOf(u);let m=!1,b=[];p.lastIndex=0;let v=p.exec(u.value);for(;v;){const S=v.index,T={index:v.index,input:v.input,stack:[...d,u]};let N=h(...v,T);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?p.lastIndex=S+1:(g!==S&&b.push({type:"text",value:u.value.slice(g,S)}),Array.isArray(N)?b.push(...N):N&&b.push(N),g=S+v[0].length,m=!0),!p.global)break;v=p.exec(u.value)}return m?(g<u.value.length&&b.push({type:"text",value:u.value.slice(g)}),f.children.splice(w,1,...b)):b=[u],w+b.length}}function dK(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 r=-1;for(;++r<n.length;){const i=n[r];t.push([fK(i[0]),pK(i[1])])}return t}function fK(e){return typeof e=="string"?new RegExp(cK(e),"g"):e}function pK(e){return typeof e=="function"?e:function(){return e}}const gm="phrasing",bm=["autolink","link","image","label"];function hK(){return{transforms:[kK],enter:{literalAutolink:gK,literalAutolinkEmail:xm,literalAutolinkHttp:xm,literalAutolinkWww:xm},exit:{literalAutolink:vK,literalAutolinkEmail:yK,literalAutolinkHttp:bK,literalAutolinkWww:xK}}}function mK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gm,notInConstruct:bm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gm,notInConstruct:bm},{character:":",before:"[ps]",after:"\\/",inConstruct:gm,notInConstruct:bm}]}}function gK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function xm(e){this.config.enter.autolinkProtocol.call(this,e)}function bK(e){this.config.exit.autolinkProtocol.call(this,e)}function xK(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 yK(e){this.config.exit.autolinkEmail.call(this,e)}function vK(e){this.exit(e)}function kK(e){uK(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wK],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),SK]],{ignore:["link","linkReference"]})}function wK(e,t,n,r,i){let s="";if(!iM(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!EK(n)))return!1;const a=NK(n+r);if(!a[0])return!1;const l={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[l,{type:"text",value:a[1]}]:l}function SK(e,t,n,r){return!iM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function EK(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 NK(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=j1(e,"(");let s=j1(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function iM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||ka(n)||$p(n))&&(!t||n!==47)}sM.peek=DK;function _K(){this.buffer()}function CK(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function TK(){this.buffer()}function AK(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function MK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Pr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jK(e){this.exit(e)}function OK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Pr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function RK(e){this.exit(e)}function DK(){return"["}function sM(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),a(),s+=i.move("]"),s}function IK(){return{enter:{gfmFootnoteCallString:_K,gfmFootnoteCall:CK,gfmFootnoteDefinitionLabelString:TK,gfmFootnoteDefinition:AK},exit:{gfmFootnoteCallString:MK,gfmFootnoteCall:jK,gfmFootnoteDefinitionLabelString:OK,gfmFootnoteDefinition:RK}}}function LK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:sM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const l=s.createTracker(a);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
498
- `:" ")+s.indentLines(s.containerFlow(r,l.current()),t?aM:zK))),u(),c}}function zK(e,t,n){return t===0?e:aM(e,t,n)}function aM(e,t,n){return(n?"":" ")+e}const PK=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uy.attention=$K;uy.peek=GK;function UK(){return{canContainEols:["delete"],enter:{strikethrough:HK},exit:{strikethrough:FK}}}function BK(){return{handlers:{delete:uy},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:PK}]}}function HK(e){this.enter({type:"delete",children:[],position:void 0},e)}function FK(e){this.exit(e)}function uy(e,t,n,r){const i=n.createTracker(r),s=n.stack.includes("strikethrough")?"~":"~~",a=n.enter("strikethrough");let l=i.move(s);return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move(s),a(),l}function $K(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function GK(){return"~"}function KK(e){return e.length}function qK(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||KK,s=[],a=[],l=[],c=[];let u=0,d=-1;for(;++d<e.length;){const k=[],w=[];let m=-1;for(e[d].length>u&&(u=e[d].length);++m<e[d].length;){const b=YK(e[d][m]);if(n.alignDelimiters!==!1){const v=i(b);w[m]=v,(c[m]===void 0||v>c[m])&&(c[m]=v)}k.push(b)}a[d]=k,l[d]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=O1(r[f]);else{const k=O1(r);for(;++f<u;)s[f]=k}f=-1;const p=[],h=[];for(;++f<u;){const k=s[f];let w="",m="";k===99?(w=":",m=":"):k===108?w=":":k===114&&(m=":");let b=n.alignDelimiters===!1?1:Math.max(1,c[f]-w.length-m.length);const v=w+"-".repeat(b)+m;n.alignDelimiters!==!1&&(b=w.length+b+m.length,b>c[f]&&(c[f]=b),h[f]=b),p[f]=v}a.splice(1,0,p),l.splice(1,0,h),d=-1;const g=[];for(;++d<a.length;){const k=a[d],w=l[d];f=-1;const m=[];for(;++f<u;){const b=k[f]||"";let v="",S="";if(n.alignDelimiters!==!1){const T=c[f]-(w[f]||0),N=s[f];N===114?v=" ".repeat(T):N===99?T%2?(v=" ".repeat(T/2+.5),S=" ".repeat(T/2-.5)):(v=" ".repeat(T/2),S=v):S=" ".repeat(T)}n.delimiterStart!==!1&&!f&&m.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&b==="")&&(n.delimiterStart!==!1||f)&&m.push(" "),n.alignDelimiters!==!1&&m.push(v),m.push(b),n.alignDelimiters!==!1&&m.push(S),n.padding!==!1&&m.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&m.push("|")}g.push(n.delimiterEnd===!1?m.join("").replace(/ +$/,""):m.join(""))}return g.join(`
499
- `)}function YK(e){return e==null?"":String(e)}function O1(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 VK=wu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function XK(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),WK);return i(),a}function WK(e,t,n){return">"+(n?"":" ")+e}function ZK(e,t){return R1(e,t.inConstruct,!0)&&!R1(e,t.notInConstruct,!1)}function R1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function D1(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){const s=n.unsafe[i];if(s.character===`
500
- `&&!s.before&&!s.after&&ZK(n.stack,s))return/[\t ]/.test(r.before)?"":" "}return`\\
501
- `}function QK(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function JK(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 eq(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 tq(e,t,n,r){const i=eq(n),s=e.value||"";if(JK(e,n)){const f=n.enter("codeIndented"),p=n.indentLines(s,nq);return f(),p}const a=n.createTracker(r),l=i.repeat(Math.max(QK(s,i)+1,3)),c=n.enter("codeFenced"),u=i==="`"?"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:`
502
- `,encode:["`"],...a.current()})),f()}return d+=a.move(`
503
- `),s&&(d+=a.move(s+`
504
- `)),d+=a.move(l),c(),d}function nq(e,t,n){return(n?"":" ")+e}function dy(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 rq(e,t,n,r){const i=dy(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);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?" ":`
505
- `,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),a(),u}function iq(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}fy.attention=sq;fy.peek=aq;function fy(e,t,n,r){const i=n.enter("phrasing"),s=n.containerPhrasing({type:"root",children:[e]},r);return i(),s}function sq(e,t){return{construct:"emphasis",markers:iq(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function aq(e,t,n){return n.options.emphasis||"*"}function lq(e){return"&#x"+e.toString(16).toUpperCase()+";"}function oq(e,t){let n=!1;return Yp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,F0}),!!((!e.depth||e.depth<3)&&ty(e)&&(t.options.setext||n))}function cq(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(oq(e,n)){const f=n.enter("headingSetext"),p=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
506
- `,after:`
507
- `});return p(),f(),h+`
508
- `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
509
- `))+1))}const a="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
510
- `,...s.current()});const d=u.charCodeAt(0);return(d===9||d===32)&&(u=lq(d)+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}lM.peek=uq;function lM(e){return e.value||""}function uq(){return"<"}oM.peek=dq;function oM(e,t,n,r){const i=dy(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);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${s}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),u+=c.move(")"),a(),u}function dq(){return"!"}cM.peek=fq;function cM(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(r);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(p){return p!=="phrasing"}),a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function fq(){return"!"}uM.peek=pq;function uM(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],l=n.compilePattern(a);if(!a.atBreak)continue;let c;for(;c=l.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return i+r+i}function pq(){return"`"}function dM(e,t){const n=ty(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))}fM.peek=hq;function fM(e,t,n,r){const i=dy(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);if(dM(e,n)){const d=n.stack;n.stack=d.filter(function(h){return h!=="phrasing"});const f=n.enter("autolink");let p=a.move("<");return p+=a.move(n.containerPhrasing(e,{before:p,after:">",...a.current()})),p+=a.move(">"),f(),n.stack=d,p}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${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),c()),u+=a.move(")"),l(),u}function hq(e,t,n){return dM(e,n)?"<":"["}pM.peek=mq;function pM(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(r);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(p){return p!=="phrasing"}),a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function mq(){return"["}function py(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 gq(e){const t=py(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 bq(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 hM(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 xq(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?bq(n):py(n);const l=e.ordered?a==="."?")":".":gq(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),hM(n)===a&&d){let f=-1;for(;++f<e.children.length;){const p=e.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=l),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function yq(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 vq(e,t,n,r){const i=yq(n);let s=n.bulletCurrent||py(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(a-s.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,p,h){return p?(h?"":" ".repeat(a))+f:(h?s:s+" ".repeat(a-s.length))+f}}function kq(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}function wq(e,t,n,r){if(!e.children.some(function(l){return VK(l)}))return n.containerFlow(e,r);const s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),a}function Sq(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hy.attention=Eq;hy.peek=Nq;function hy(e,t,n,r){const i=n.enter("phrasing"),s=n.containerPhrasing({type:"root",children:[e]},r);return i(),s}function Eq(e,t){return{construct:"strong",markers:Sq(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function Nq(e,t,n){return n.options.strong||"*"}function _q(e,t,n,r){return n.safe(e.value,r)}function Cq(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 Tq(e,t,n){const r=(hM(n)+(n.options.ruleSpaces?" ":"")).repeat(Cq(n));return n.options.ruleSpaces?r.slice(0,-1):r}const mM={blockquote:XK,break:D1,code:tq,definition:rq,emphasis:fy,hardBreak:D1,heading:cq,html:lM,image:oM,imageReference:cM,inlineCode:uM,link:fM,linkReference:pM,list:xq,listItem:vq,paragraph:kq,root:wq,strong:hy,text:_q,thematicBreak:Tq};function Aq(){return{enter:{table:Mq,tableData:I1,tableHeader:I1,tableRow:Oq},exit:{codeText:Rq,table:jq,tableData:ym,tableHeader:ym,tableRow:ym}}}function Mq(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 jq(e){this.exit(e),this.data.inTable=void 0}function Oq(e){this.enter({type:"tableRow",children:[]},e)}function ym(e){this.exit(e)}function I1(e){this.enter({type:"tableCell",children:[]},e)}function Rq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Dq));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Dq(e,t){return t==="|"?t:e}function Iq(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
511
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:c,tableRow:l}};function a(h,g,k,w){return u(d(h,k,w),h.align)}function l(h,g,k,w){const m=f(h,k,w),b=u([m]);return b.slice(0,b.indexOf(`
512
- `))}function c(h,g,k,w){const m=k.enter("tableCell"),b=k.enter("phrasing"),v=k.containerPhrasing(h,{...w,before:s,after:s});return b(),m(),v}function u(h,g){return qK(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(h,g,k){const w=h.children;let m=-1;const b=[],v=g.enter("table");for(;++m<w.length;)b[m]=f(w[m],g,k);return v(),b}function f(h,g,k){const w=h.children;let m=-1;const b=[],v=g.enter("tableRow");for(;++m<w.length;)b[m]=c(w[m],h,g,k);return v(),b}function p(h,g,k){let w=mM.inlineCode(h,g,k);return k.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function Lq(){return{exit:{taskListCheckValueChecked:L1,taskListCheckValueUnchecked:L1,paragraph:Pq}}}function zq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Uq}}}function L1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Pq(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 r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const l=i[s];if(l.type==="paragraph"){a=l;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Uq(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);s&&l.move(a);let c=mM.listItem(e,t,n,{...r,...l.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+a}}function Bq(){return[hK(),IK(),UK(),Aq(),Lq()]}function Hq(e){return{extensions:[mK(),LK(e),BK(),Iq(e),zq()]}}const Fq={tokenize:Vq,partial:!0},gM={tokenize:Xq,partial:!0},bM={tokenize:Wq,partial:!0},xM={tokenize:Zq,partial:!0},$q={tokenize:Qq,partial:!0},yM={name:"wwwAutolink",tokenize:qq,previous:kM},vM={name:"protocolAutolink",tokenize:Yq,previous:wM},zi={name:"emailAutolink",tokenize:Kq,previous:SM},oi={};function Gq(){return{text:oi}}let zs=48;for(;zs<123;)oi[zs]=zi,zs++,zs===58?zs=65:zs===91&&(zs=97);oi[43]=zi;oi[45]=zi;oi[46]=zi;oi[95]=zi;oi[72]=[zi,vM];oi[104]=[zi,vM];oi[87]=[zi,yM];oi[119]=[zi,yM];function Kq(e,t,n){const r=this;let i,s;return a;function a(f){return!q0(f)||!SM.call(r,r.previous)||my(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(f))}function l(f){return q0(f)?(e.consume(f),l):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check($q,d,u)(f):f===45||f===95||Mn(f)?(s=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),i=!0,c}function d(f){return s&&i&&Ln(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function qq(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!kM.call(r,r.previous)||my(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Fq,e.attempt(gM,e.attempt(bM,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Yq(e,t,n){const r=this;let i="",s=!1;return a;function a(f){return(f===72||f===104)&&wM.call(r,r.previous)&&!my(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),l):n(f)}function l(f){if(Ln(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),l;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),s?u:(s=!0,c)):n(f)}function u(f){return f===null||Kf(f)||jt(f)||ka(f)||$p(f)?n(f):e.attempt(gM,e.attempt(bM,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Vq(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function Xq(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(xM,c,l)(u):u===null||jt(u)||ka(u)||u!==45&&$p(u)?c(u):(s=!0,e.consume(u),a)}function l(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function c(u){return i||r||!s?n(u):t(u)}}function Wq(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(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(xM,t,s)(a):a===null||jt(a)||ka(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Zq(e,t,n){return r;function r(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),r):l===38?(e.consume(l),s):l===93?(e.consume(l),i):l===60||l===null||jt(l)||ka(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||jt(l)||ka(l)?t(l):r(l)}function s(l){return Ln(l)?a(l):n(l)}function a(l){return l===59?(e.consume(l),r):Ln(l)?(e.consume(l),a):n(l)}}function Qq(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Mn(s)?n(s):t(s)}}function kM(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function wM(e){return!Ln(e)}function SM(e){return!(e===47||q0(e))}function q0(e){return e===43||e===45||e===46||e===95||Mn(e)}function my(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Jq={tokenize:lY,partial:!0};function eY(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:iY,continuation:{tokenize:sY},exit:aY}},text:{91:{name:"gfmFootnoteCall",tokenize:rY},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tY,resolveTo:nY}}}}function tY(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const c=r.events[i][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=Pr(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function nY(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 r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function rY(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=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(s>999||f===93&&!a||f===null||f===91||jt(f))return n(f);if(f===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(Pr(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return jt(f)||(a=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function iY(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,l;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!l||g===null||g===91||jt(g))return n(g);if(g===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return s=Pr(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return jt(g)||(l=!0),a++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),a++,d):d(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),xt(e,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return t(g)}}function sY(e,t,n){return e.check(ku,t,e.attempt(Jq,t,n))}function aY(e){e.exit("gfmFootnoteDefinition")}function lY(e,t,n){const r=this;return xt(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function oY(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(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)},p=[["enter",d,l],["enter",a[u][1],l],["exit",a[u][1],l],["enter",f,l]],h=l.parser.constructs.insideSpan.null;h&&Tr(p,p.length,0,Gp(h,a.slice(u+1,c),l)),Tr(p,p.length,0,[["exit",f,l],["enter",a[c][1],l],["exit",a[c][1],l],["exit",d,l]]),Tr(a,u-1,c-u+3,p),c=u+p.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function s(a,l,c){const u=this.previous,d=this.events;let f=0;return p;function p(g){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(g):(a.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const k=Yf(u);if(g===126)return f>1?c(g):(a.consume(g),f++,h);if(f<2&&!n)return c(g);const w=a.exit("strikethroughSequenceTemporary"),m=Yf(g);return w._open=!m||m===2&&!!k,w._close=!k||k===2&&!!m,l(g)}}}class cY{constructor(){this.map=[],this.index=new Map}add(t,n,r){uY(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0,this.index.clear()}}function uY(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const s=[t,n,r];e.map.push(s),e.index.set(t,s)}function dY(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function fY(){return{flow:{null:{name:"table",tokenize:pY,resolveAll:hY}}}}function pY(e,t,n){const r=this;let i=0,s=0,a;return l;function l(C){let U=r.events.length-1;for(;U>-1;){const{type:I}=r.events[U][1];if(I==="lineEnding"||I==="linePrefix")U--;else break}const $=U>-1?r.events[U][1].type:null,G=$==="tableHead"||$==="tableRow"?N:c;return G===N&&r.parser.lazy[r.now().line]?n(C):G(C)}function c(C){return e.enter("tableHead"),e.enter("tableRow"),u(C)}function u(C){return C===124||(a=!0,s+=1),d(C)}function d(C){return C===null?n(C):Ze(C)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),h):n(C):lt(C)?xt(e,d,"whitespace")(C):(s+=1,a&&(a=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(C)))}function f(C){return C===null||C===124||jt(C)?(e.exit("data"),d(C)):(e.consume(C),C===92?p:f)}function p(C){return C===92||C===124?(e.consume(C),f):f(C)}function h(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),a=!1,lt(C)?xt(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):g(C))}function g(C){return C===45||C===58?w(C):C===124?(a=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),k):T(C)}function k(C){return lt(C)?xt(e,w,"whitespace")(C):w(C)}function w(C){return C===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),m):C===45?(s+=1,m(C)):C===null||Ze(C)?S(C):T(C)}function m(C){return C===45?(e.enter("tableDelimiterFiller"),b(C)):T(C)}function b(C){return C===45?(e.consume(C),b):C===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(C))}function v(C){return lt(C)?xt(e,S,"whitespace")(C):S(C)}function S(C){return C===124?g(C):C===null||Ze(C)?!a||i!==s?T(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):T(C)}function T(C){return n(C)}function N(C){return e.enter("tableRow"),_(C)}function _(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),_):C===null||Ze(C)?(e.exit("tableRow"),t(C)):lt(C)?xt(e,_,"whitespace")(C):(e.enter("data"),R(C))}function R(C){return C===null||C===124||jt(C)?(e.exit("data"),_(C)):(e.consume(C),C===92?L:R)}function L(C){return C===92||C===124?(e.consume(C),R):R(C)}}function hY(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const p=new cY;for(;++n<e.length;){const h=e[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(z1(p,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],a=[0,n+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,t]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],f=ud(p,t,s,i,void 0,f),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],f=ud(p,t,s,i,void 0,f)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(l=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,s[1]!==0?(a[0]=a[1],f=ud(p,t,s,i,n,f)):a[1]!==0&&(f=ud(p,t,a,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&z1(p,t,c,u,d),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=dY(t.events,n))}return e}function ud(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(s.end=Object.assign({},Ga(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const c=Ga(t.events,n[1]);if(s={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Ga(t.events,n[2]),d=Ga(t.events,n[3]),f={type:l,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,k=n[3]-n[2]-1;e.add(g,k,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},Ga(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function z1(e,t,n,r,i){const s=[],a=Ga(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function Ga(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const mY={name:"tasklistCheck",tokenize:bY};function gY(){return{text:{91:mY}}}function bY(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return jt(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 Ze(c)?t(c):lt(c)?e.check({tokenize:xY},t,n)(c):n(c)}}function xY(e,t,n){return xt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function yY(e){return IA([Gq(),eY(),oY(e),fY(),gY()])}const vY={};function gy(e){const t=this,n=e||vY,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(yY(n)),s.push(Bq()),a.push(Hq(n))}async function kY(){const e=await fetch(`${ro}/ai/status`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return await e.json()}async function wY(e){const t=await fetch(`${ro}/ai/models`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})});if(!t.ok){const n=await t.text();let r=n;try{const i=JSON.parse(n);typeof i.error=="string"&&i.error&&(r=i.error)}catch{}throw new Error(r||`HTTP ${t.status}`)}return await t.json()}async function SY(e,t){const n=await fetch(`${ro}/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 r=n.body.getReader(),i=new TextDecoder;let s="";for(;;){const{done:a,value:l}=await r.read();if(a)break;s+=i.decode(l,{stream:!0});let c;for(;(c=s.indexOf(`
513
- `))>=0;){const u=s.slice(0,c).trim();if(s=s.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}}}function Xf({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-white/[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-white/[0.08] [&_th]:bg-neutral-950/40 [&_th]:px-1.5 [&_th]:py-1 [&_th]:text-left [&_th]:font-medium [&_td]:border [&_td]:border-white/[0.08] [&_td]:px-1.5 [&_td]:py-1 [&_td]:align-top [&_hr]:my-2 [&_hr]:border-white/[0.08]",children:o.jsx(cy,{remarkPlugins:[gy],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 EY(){const e=We(),{show:t}=Zt(),[n,r]=y.useState(null),[i,s]=y.useState(!1),[a,l]=y.useState([]),[c,u]=y.useState(""),[d,f]=y.useState(""),[p,h]=y.useState(!1),g=y.useRef(null),k=y.useRef(null),w=y.useCallback(()=>{kY().then(r).catch(()=>{})},[]);y.useEffect(()=>{w()},[w]),y.useEffect(()=>Ri("settings",w),[w]),y.useEffect(()=>{const b=k.current;b&&(b.scrollTop=b.scrollHeight)},[a,d,i]);const m=y.useCallback(async()=>{const b=c.trim();if(b===""||p)return;const v=[...a,{role:"user",content:b}];l(v),u(""),f(""),h(!0);const S=new AbortController;g.current=S;let T="";try{await SY(v,{signal:S.signal,onDelta:N=>{T+=N,f(T)}}),l([...v,{role:"assistant",content:T!==""?T:e("ai.emptyAnswer")}]),f("")}catch(N){f(""),N.name==="AbortError"?T!==""&&l([...v,{role:"assistant",content:T}]):t("error",e("ai.failed",{error:Xe(N)}))}finally{g.current=null,h(!1)}},[p,c,a,t,e]);return(n==null?void 0:n.configured)!==!0?null:o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:()=>s(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-white/[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(n0,{className:"h-5 w-5"})}),i&&ln.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-white/[0.08] bg-neutral-900 shadow-mac",children:[o.jsxs("header",{className:"h-11 shrink-0 flex items-center gap-2 border-b border-white/[0.06] px-4 frosted",children:[o.jsx(n0,{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:()=>l([]),title:e("ai.clear"),className:"ml-auto rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200",children:o.jsx(Fr,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",onClick:()=>s(!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:k,className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-3",children:[a.length===0&&d===""&&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"),n.docsFound?"":e("ai.docsMissing")]})]}),a.map((b,v)=>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(Xf,{text:b.content})})},v)),p&&d===""&&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")})}),d!==""&&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(Xf,{text:d})})})]}),o.jsxs("form",{className:"shrink-0 flex items-end gap-2 border-t border-white/[0.06] p-2",onSubmit:b=>{b.preventDefault(),m()},children:[o.jsx("textarea",{value:c,rows:2,onChange:b=>u(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),m())},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=g.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(fx,{className:"h-3.5 w-3.5"})}):o.jsx("button",{type:"submit",disabled:c.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(TC,{className:"h-3.5 w-3.5"})})]})]}),document.body)]})}function Ua(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 NY=/(`+)([\s\S]*?)\1|~{2}([\s\S]+?)~{2}|\*{2}([\s\S]+?)\*{2}|_{2}([\s\S]+?)_{2}|\*([^*\n]+?)\*|_([^_\n]+?)_|\[([^\]\n]*)\]\(([^)\s]*)\)|(https?:\/\/[^\s<>()]+)|(\\(?:[\\`*_~{}[\]()#+\-.!>|]))/;function ei(e,t="plain"){var a;const n=[];let r="",i=e;const s=()=>{r!==""&&(n.push({text:r,style:t}),r="")};for(;i!=="";){const l=NY.exec(i);if(!l||l.index===void 0)break;r+=i.slice(0,l.index);const c=l.slice(1);if(c[1]!==void 0)s(),n.push({text:c[1],style:Ua(t,"code")});else if(c[2]!==void 0)s(),n.push(...ei(c[2],Ua(t,"del")));else if(c[3]!==void 0||c[4]!==void 0)s(),n.push(...ei(c[3]??c[4],Ua(t,"strong")));else if(c[5]!==void 0||c[6]!==void 0)s(),n.push(...ei(c[5]??c[6],Ua(t,"em")));else if(c[7]!==void 0){const u=c[7],d=c[8]??"";s();const f=d!==""&&d!==u?`${u||d} (${d})`:u||d;f!==""&&n.push(...ei(f,Ua(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);s(),n.push({text:d,style:Ua(t,"link")}),r=u}else c[10]!==void 0&&(r+=c[10].slice(1));i=i.slice(l.index+l[0].length)}return r+=i,s(),n}const _Y=/^ {0,3}(`{3,}|~{3,})/,CY=/^ {0,3}(`{3,}|~{3,})\s*$/,TY=/^ {0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,AY=/^ {0,3}([-*_])(?:\s*\1){2,}\s*$/,P1=/^ {0,3}>\s?(.*)$/,EM=/^(\s*)([-*+])\s+(.*)$/,NM=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,MY=/^\[([ xX])\]\s+(.*)$/,jY=/^ {0,3}(#{1,6}\s|>|`{3,}|~{3,}|[-*+]\s|\d{1,9}[.)]\s)/;function _M(e){let t=e.trim();t.startsWith("|")&&(t=t.slice(1));const n=[];let r="";for(let s=0;s<t.length;s++){const a=t[s];if(a==="\\"&&t[s+1]==="|"){r+="|",s++;continue}if(a==="|"){n.push(r),r="";continue}r+=a}n.push(r);const i=n[n.length-1];return n.length>1&&i.trim()===""&&n.pop(),n.map(s=>s.trim())}function CM(e){if(!e.includes("-"))return!1;const t=_M(e);return t.length>=1&&t.every(n=>/^:?-+:?$/.test(n))}function OY(e,t,n){const r=[];let i=t;for(;i<e.length;){const s=e[i];if(s.trim()===""||!s.includes("|"))break;i++,!CM(s)&&r.push(_M(s).map(a=>ei(a)))}return r.length>0&&n.push({kind:"table",rows:r}),i}function RY(e,t,n){const r=[];let i=t;for(;i<e.length;){const s=e[i],a=EM.exec(s),l=a?null:NM.exec(s);if(!a&&!l){const f=r[r.length-1];if(f&&s.trim()!==""&&/^\s{2,}/.test(s)&&!jY.test(s)){f.spans=[...f.spans,{text:" ",style:"plain"},...ei(s.trim())],i++;continue}break}const c=Math.min(3,Math.floor((a??l)[1].length/2));let u,d;if(a){const f=MY.exec(a[3]);f?(u=f[1].toLowerCase()==="x"?"☑":"☐",d=f[2]):(u="•",d=a[3])}else u=`${l[2]}.`,d=l[3];r.push({marker:u,level:c,spans:ei(d)}),i++}return n.push({kind:"list",items:r}),i}function DY(e){const t=e.replace(/\r\n?/g,`
514
- `).replace(/\t/g," ").split(`
515
- `),n=[],r=[],i=()=>{r.length>0&&(n.push({kind:"p",spans:ei(r.join(" ").replace(/ {2,}/g," "))}),r.length=0)};let s=0;for(;s<t.length;){const a=t[s],l=_Y.exec(a);if(l){i();const u=[];for(s++;s<t.length;){const d=CY.exec(t[s]);if(d&&d[1][0]===l[1][0]&&d[1].length>=l[1].length){s++;break}u.push(t[s]),s++}n.push({kind:"code",lines:u});continue}if(a.trim()===""){i(),s++;continue}const c=TY.exec(a);if(c){i(),n.push({kind:"h",level:c[1].length,spans:ei(c[2])}),s++;continue}if(AY.test(a)){i(),n.push({kind:"hr"}),s++;continue}if(a.includes("|")&&s+1<t.length&&CM(t[s+1])){i(),s=OY(t,s,n);continue}if(P1.test(a)){i();const u=[];for(;s<t.length;){const d=P1.exec(t[s]);if(!d)break;u.push(d[1].trim()===""?[]:ei(d[1])),s++}n.push({kind:"quote",lines:u});continue}if(EM.test(a)||NM.test(a)){i(),s=RY(t,s,n);continue}r.push(a.trim()),s++}return i(),n}const Wd=880,Wr=24,TM=26,vm=15,kl=10,km=12,AM=Math.round((Wd-Wr*2)*.78),Ki=AM-kl*2,dd=19,Do=16,IY=21,LY=4,zY=8,U1=2,PY=16,No=8,fd=6,Y0=2,sc=6,UY=44,BY=16e6,gi='ui-sans-serif, system-ui, "Segoe UI", "Microsoft YaHei", sans-serif',HY='ui-monospace, SFMono-Regular, Menlo, Consolas, "Microsoft YaHei", monospace',wl={title:`600 17px ${gi}`,meta:`11px ${gi}`,body:`12px ${gi}`,small:`11px ${gi}`,strong:`600 12px ${gi}`,em:`italic 12px ${gi}`,strongEm:`600 italic 12px ${gi}`,h1:`600 13px ${gi}`,h3:`500 12px ${gi}`,mono:`11px ${HY}`},B1="#737373",FY="#f5f5f5",MM="rgba(0,0,0,0.45)",$Y="rgba(255,255,255,0.06)",H1="rgba(255,255,255,0.08)",GY="rgba(0,0,0,0.35)",KY="#404040",F1="rgba(255,255,255,0.08)",jM={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 qY(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:MM};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 YY=/[A-Za-z0-9@._/:%+~=?#&$'"-]+|\s+|[\s\S]/g;function VY(e,t){return e.font===t.font&&e.fg===t.fg&&e.bg===t.bg&&e.underline===t.underline&&e.strike===t.strike}function Ps(e,t,n,r,i,s={}){const a=[];let l=[],c=0;const u=()=>{const f=l[l.length-1];if(f){const p=f.text.replace(/\s+$/,"");p===""?l.pop():p!==f.text&&(f.w-=e(f.font,f.text.slice(p.length)),f.text=p)}a.push({spans:l,indent:0,lh:i,gap:0}),l=[],c=0},d=(f,p,h)=>{const g=l[l.length-1];if(g&&VY(g,p)){g.text+=f,g.w+=h;return}l.push({...p,text:f,w:h})};for(const f of t){const p=qY(f.style,n,s.base);for(const h of f.text.match(YY)??[]){const g=/^\s+$/.test(h);if(g&&l.length===0&&!s.keepSpace)continue;const k=e(p.font,h);if(!(l.length>0&&c+k>r&&(u(),g&&!s.keepSpace))){if(l.length===0&&k>r){for(const w of h){const m=e(p.font,w);l.length>0&&c+m>r&&u(),d(w,p,m),c+=m}continue}d(h,p,k),c+=k}}}return(l.length>0||a.length===0)&&u(),a}function $1(e){var t;return e.indent+(((t=e.marker)==null?void 0:t.w)??0)+e.spans.reduce((n,r)=>n+r.w,0)}function wm(e){return e.reduce((t,n)=>t+n.gap+n.lh,0)}function XY(e){return e==="flow"?LY:zY}function WY(e,t,n){const r=[];let i=0;const s=l=>{const c=r.length===0?0:XY(l.kind);r.push({...l,y:i,gap:c}),i+=c+l.h},a=l=>({kind:"flow",h:wm(l),w:Math.max(0,...l.map($1)),lines:l});for(const l of DY(t))switch(l.kind){case"hr":s({kind:"rule",h:1,w:Ki});break;case"h":{const c=l.level===1?"h1":l.level===2?"strong":"h3";s(a(Ps(e,l.spans,n,Ki,c==="h1"?IY:dd,{base:c})));break}case"p":s(a(Ps(e,l.spans,n,Ki,dd)));break;case"list":{const c=[];for(const u of l.items){const d=`${u.marker} `,f=e("body",d),p=u.level*PY;Ps(e,u.spans,n,Ki-p-f,dd).forEach((g,k)=>{g.indent=k===0?p:p+f,g.gap=k===0&&c.length>0?U1:0,k===0&&(g.marker={text:d,font:"body",fg:n.fg,w:f}),c.push(g)})}s(a(c));break}case"quote":{const c={...n,fg:n.quote,strong:n.quote},u=[];for(const[d,f]of l.lines.entries())Ps(e,f,c,Ki-fd-Y0,dd).forEach((h,g)=>{h.indent=fd+Y0,h.gap=d>0&&g===0?U1:0,u.push(h)});s({kind:"box",h:wm(u)+fd,w:Math.max(0,...u.map($1)),leftBar:KY,pad:fd/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=Ps(e,[{text:d,style:"plain"}],c,Ki-No*2,Do,{base:"mono",keepSpace:!0});for(const p of f)p.indent=No,u.push(p)}s({kind:"box",h:wm(u)+No*2,w:Math.max(0,...u.map(d=>d.spans.reduce((f,p)=>f+p.w,0)))+No*2,fill:MM,border:$Y,pad:No,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 m=0;for(const b of c){const v=b[w];if(!v)continue;const S=Ps(e,v,n,Number.MAX_SAFE_INTEGER,Do,{base:"small"})[0];m=Math.max(m,S?S.spans.reduce((T,N)=>T+N.w,0):0)}return m+sc*2}),f=d.reduce((k,w)=>k+w,0),p=f>Ki?Ki/f:1,h=d.map(k=>Math.max(UY,k*p)),g=c.map((k,w)=>{const m=h.map((v,S)=>Ps(e,k[S]??[],n,Math.max(10,v-sc*2),Do,{base:"small"})),b=Math.max(...m.map(v=>v.length))*Do+sc*2;return{head:w===0,h:b,cells:m}});s({kind:"table",h:g.reduce((k,w)=>k+w.h,0),w:h.reduce((k,w)=>k+w,0),colW:h,rows:g});break}}return r}function ZY(e,t,n=2){for(const r of[n,1])if(e*r*t*r<=BY)return r;return 1}function QY(e,t,n){const r=TM+vm+8,i={y:Wr,h:r,title:n.title,subtitle:n.subtitle};let s=Wr+r+km;const a=[];for(const c of t){const u=WY(e,c.text,jM[c.role]),d=Math.max(0,...u.map(g=>g.w)),f=u.reduce((g,k)=>g+k.gap+k.h,0),p=Math.min(AM,d+kl*2),h=f+kl*2;a.push({role:c.role,meta:`${n.stamp(c.at)} · ${c.role==="user"?n.labels.user:n.labels.assistant}`,metaY:s,x:c.role==="user"?Wd-Wr-p:Wr,y:s+vm,w:p,h,blocks:u}),s+=vm+h+km}const l=Math.round(t.length>0?s-km+Wr:s);return{width:Wd,height:l,scale:ZY(Wd,l,n.scale),header:i,bubbles:a}}function V0(e,t,n,r,i,s){e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+r,n,t+r,n+i,s),e.arcTo(t+r,n+i,t,n+i,s),e.arcTo(t,n+i,t,n,s),e.arcTo(t,n,t+r,n,s),e.closePath()}function Sm(e,t,n,r){var s;let i=r;for(const a of t){i+=a.gap,a.marker&&(e.font=wl[a.marker.font],e.fillStyle=a.marker.fg,e.fillText(a.marker.text,n+a.indent,i));let l=n+a.indent+(((s=a.marker)==null?void 0:s.w)??0);for(const c of a.spans){if(e.font=wl[c.font],c.bg&&(e.fillStyle=c.bg,V0(e,l-2,i-1,c.w+4,a.lh-4,3),e.fill()),e.fillStyle=c.fg,e.fillText(c.text,l,i),c.underline||c.strike){e.strokeStyle=c.fg,e.beginPath();const u=c.underline?i+a.lh-4:i+a.lh/2+1;e.moveTo(l,u),e.lineTo(l+c.w,u),e.stroke()}l+=c.w}i+=a.lh}}function JY(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:r,title:i,subtitle:s}=t.header;e.font=wl.title,e.fillStyle=FY,e.fillText(i,Wr,n),e.font=wl.meta,e.fillStyle=B1,e.fillText(s,Wr,n+TM),e.strokeStyle=F1,e.beginPath(),e.moveTo(Wr,n+r+.5),e.lineTo(t.width-Wr,n+r+.5),e.stroke();for(const a of t.bubbles){const l=jM[a.role];e.font=wl.meta,e.fillStyle=B1,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",V0(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+kl,u=a.y+kl;for(const d of a.blocks){const f=u+d.y;if(d.kind==="rule"){e.strokeStyle=F1,e.beginPath(),e.moveTo(c,f+.5),e.lineTo(c+a.w-kl*2,f+.5),e.stroke();continue}if(d.kind==="flow"){Sm(e,d.lines,c,f);continue}if(d.kind==="box"){(d.fill||d.border)&&(V0(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,Y0,d.h)),Sm(e,d.lines,c,f+d.pad);continue}let p=f;for(const g of d.rows){g.head&&(e.fillStyle=GY,e.fillRect(c,p,d.w,g.h));let k=c;g.cells.forEach((w,m)=>{w.forEach((b,v)=>Sm(e,[{...b,indent:sc,gap:0}],k,p+sc+v*Do)),k+=d.colW[m]??0}),e.strokeStyle=H1,e.beginPath(),e.moveTo(c,p+.5),e.lineTo(c+d.w,p+.5),e.moveTo(c,p+g.h+.5),e.lineTo(c+d.w,p+g.h+.5),e.stroke(),p+=g.h}let h=c;e.strokeStyle=H1;for(const g of d.colW)e.beginPath(),e.moveTo(h+.5,f),e.lineTo(h+.5,f+d.h),e.stroke(),h+=g;e.beginPath(),e.moveTo(h+.5,f),e.lineTo(h+.5,f+d.h),e.stroke()}}}async function eV(e,t){const n=document.createElement("canvas").getContext("2d");if(!n)throw new Error("canvas 2d context unavailable");const i=QY((c,u)=>(n.font=wl[c],n.measureText(u).width),e,t),s=document.createElement("canvas");s.width=Math.round(i.width*i.scale),s.height=Math.round(i.height*i.scale);const a=s.getContext("2d");if(!a)throw new Error("canvas 2d context unavailable");a.scale(i.scale,i.scale),JY(a,i);const l=await new Promise(c=>s.toBlob(c,"image/png"));if(!l)throw new Error("image encoding failed");return l}function tV(e,t=new Date){const n=s=>String(s).padStart(2,"0"),r=e.replace(/[\\/:*?"<>|\s]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40),i=`${t.getFullYear()}${n(t.getMonth()+1)}${n(t.getDate())}-${n(t.getHours())}${n(t.getMinutes())}${n(t.getSeconds())}`;return`weave-${r||"conversation"}-${i}.png`}function nV(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,r.click(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}const rV=120,OM=40,iV=500;function sV(e,t,n){const r=t===1?e*16:e,i=n==="top"?-r:r;return Math.max(0,Math.min(OM,i))}function aV(e,t){const n=t==="top"?e:-e;return Math.max(0,Math.min(OM,n))}function lV(e=rV){let t=0,n=!1,r=!1;return{setEdge(i){n=i,i||(t=0,r=!1)},add(i){return!n||i<=0?{value:t,fired:!1}:(t+=i,r||t<e?{value:t,fired:!1}:(r=!0,t=0,{value:0,fired:!0}))},reset(){t=0,r=!1}}}function RM(e){const[t,n]=y.useState(0),r=y.useRef(lV()),i=y.useRef(null),s=y.useRef(null),a=y.useRef(e);a.current=e;const l=y.useCallback(()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),r.current.reset(),n(0)},[]),c=y.useCallback(d=>{if(!a.current.enabled||d<=0)return;const f=r.current;f.setEdge(a.current.getEdge());const p=f.add(d);if(p.fired){l(),a.current.onFire();return}n(p.value),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(l,iV)},[l]),u=y.useCallback(d=>{const f=i.current;i.current=d,f!==null&&c(aV(d-f,a.current.axis))},[c]);return y.useEffect(()=>{e.enabled||l()},[e.enabled,l]),{px:t,syncEdge:y.useCallback(()=>r.current.setEdge(a.current.getEdge()),[]),wheel:y.useCallback((d,f)=>c(sV(d,f,a.current.axis)),[c]),touchStart:y.useCallback(d=>{i.current=d},[]),touchMove:u,touchEnd:y.useCallback(()=>{i.current=null,l()},[l])}}const pd=10,oV=10*6e4,cV=10*6e4,uV=60;function dV(e){var t;try{const n=sessionStorage.getItem(`weave:conv:${e}`);if(!n)return null;const r=JSON.parse(n);return typeof r.at!="number"||Date.now()-r.at>cV?null:(t=r.entries)!=null&&t.length?r.entries:null}catch{return null}}function fV(e,t){try{sessionStorage.setItem(`weave:conv:${e}`,JSON.stringify({at:Date.now(),entries:t.slice(-uV).map(({pipe:n,...r})=>r)}))}catch{}}const pV={socket:"tasks.msgViaSocket",relay:"tasks.msgViaRelay",terminal:"tasks.msgViaTerminal"},hV={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"},mV={pending:"tasks.msgStatusQueued",delivering:"tasks.msgStatusDelivering",running:"tasks.msgStatusRunning",injected:"tasks.msgStatusInjected",delivered:"tasks.msgStatusDelivered",succeeded:"tasks.msgStatusSucceeded",failed:"tasks.msgStatusFailed",timeout:"tasks.msgStatusTimeout"};function G1(e,t,n){const r=[];for(const i of e)if(kx(n,i.eventType,Li(i).source))r.push({key:`e${i.id}`,eventId:i.id,role:"compaction",at:i.createdAt,text:""});else if(i.eventType===t.open){if(Np(i))continue;const s=sI(i);if(!s)continue;const{text:a,fromWeave:l,fromName:c}=HC(s);r.push({key:`e${i.id}`,eventId:i.id,role:"user",at:i.createdAt,text:a,fromWeave:l,fromName:c})}else if(t.close.includes(i.eventType)){const s=aI(i);s&&r.push({key:`e${i.id}`,eventId:i.id,role:"assistant",at:i.createdAt,text:s})}return r}function K1(e){return HC(e).text.replace(/\s+/g," ").trim()}function gV(e,t){return K1(e)===K1(t)}function bV(e,t){const n=new Set,r=a=>{let l,c=oV;for(const u of t){if(n.has(u.id)||!gV(a.text,u.text))continue;const d=Math.abs(Date.parse(u.at)-Date.parse(a.at));d<c&&(l=u,c=d)}return l&&n.add(l.id),l},i=e.map(a=>{if(a.role!=="user")return a;const l=r(a);return l?{...a,pipe:l}:a}),s=t.filter(a=>!n.has(a.id)).map(a=>({key:`m${a.id}`,role:"user",at:a.at,text:a.text,pipe:a})).sort((a,l)=>a.at.localeCompare(l.at));return[...i,...s]}const xV=["all","user","assistant"],yV={all:"tasks.convFilterAll",user:"tasks.convFilterSent",assistant:"tasks.convFilterRecv"};function vV(e,t){return t==="all"?[...e]:e.filter(n=>n.role===t)}function X0(e){const t=new Date(e),n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function kV(e,t){return e.filter(n=>n.role!=="compaction").map(n=>`[${X0(n.at)}] ${n.role==="user"?t.user:t.assistant}
516
- ${n.text}`).join(`
517
-
518
- `)}const wV=450,q1=8,Y1=168,V1=72,SV=e=>e.filter(t=>t.role!=="compaction").map(t=>({role:t.role,at:t.at,text:t.text})),DM="weave:conv-size",hd={w:320,h:220},by=(e,t)=>({w:Math.min(Math.max(Math.round(e),hd.w),Math.max(hd.w+40,innerWidth-32)),h:t>0?Math.min(Math.max(Math.round(t),hd.h),Math.max(hd.h+40,innerHeight-32)):0}),X1=()=>by(Math.min(1100,Math.round(innerWidth*.62)),0);function EV(){try{const e=JSON.parse(localStorage.getItem(DM)??"null");return!e||typeof e.w!="number"||typeof e.h!="number"?X1():by(e.w,e.h)}catch{return X1()}}function W1({on:e,className:t}){return o.jsx("span",{className:ye("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(ii,{className:"h-2.5 w-2.5",strokeWidth:3})})}function IM({sessionId:e,projectId:t,label:n,projectLabel:r,capability:i,answerPending:s,onOpenAnswer:a,onInterrupt:l,interruptStateOf:c,onClose:u}){var It,Yt,te,je;const d=We(),{show:f}=Zt(),p=cn(),{statuses:h,sessions:g}=fu(),k=du[i.harness],w=y.useMemo(()=>{var W;return[k.open,...k.close,((W=vx[i.harness])==null?void 0:W.end)??""].filter(Boolean)},[i.harness,k]),[m,b]=y.useState(()=>dV(e)),[v,S]=y.useState(!1),[T,N]=y.useState(!1),[_,R]=y.useState(null),[L,C]=y.useState(""),[U,$]=y.useState(null),[G,I]=y.useState("all"),[D,A]=y.useState(!1),[M,P]=y.useState(()=>new Set),[H,E]=y.useState(null),[j,B]=y.useState(()=>EV()),[O,Q]=y.useState({x:0,y:0}),F=y.useRef(null),J=y.useRef(null),ce=y.useRef(null),K=y.useRef(null),q=y.useRef(null),V=y.useRef(null),ue=y.useRef(null),me=da("(min-width: 1024px)"),Ne=da("(pointer: coarse)"),Te=y.useCallback(W=>{$(W instanceof Error?W.message:String(W))},[]),ne=y.useCallback(async()=>{try{if(w.length===0){b([]),S(!0);return}const W=await Se.listSessionHooks(t,e,pd,void 0,w),fe=G1(W,k,i.harness);S(W.length<pd),b(Oe=>{var Lt;const Je=Oe!=null&&Oe.length?Oe[Oe.length-1].eventId:void 0,tt=(Lt=fe[0])==null?void 0:Lt.eventId;return Je===void 0||tt===void 0||tt>Je?fe:[...Oe.filter(Mr=>(Mr.eventId??0)<tt),...fe]}),$(null)}catch(W){Te(W)}},[i.harness,w,Te,k,t,e]),pe=y.useCallback(async()=>{try{R(await Se.listSessionMessages(e)),$(null)}catch(W){Te(W)}},[Te,e]);y.useEffect(()=>{ne(),pe()},[ne,pe]),y.useEffect(()=>{m&&m.length>0&&fV(e,m)},[m,e]),y.useEffect(()=>{let W=null;const fe=Oe=>{var Lt;const Je=Oe.detail??{};if(Je.sessionId!==e)return;const tt=Je.kind==="event.ingested"&&(Je.eventType===k.open||k.close.includes(Je.eventType??""));!tt&&!((Lt=Je.kind)!=null&&Lt.startsWith("message."))||(W!==null&&window.clearTimeout(W),W=window.setTimeout(()=>{W=null,tt?ne():pe()},500))};return window.addEventListener("weave:hook",fe),()=>{window.removeEventListener("weave:hook",fe),W!==null&&window.clearTimeout(W)}},[k,ne,pe,e]),y.useEffect(()=>{const W=fe=>{fe.key==="Escape"&&(H?E(null):D?(A(!1),P(new Set)):u())};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[H,u,D]),y.useEffect(()=>{if(!H)return;const W=Oe=>{var Je,tt;(tt=(Je=Oe.target)==null?void 0:Je.closest)!=null&&tt.call(Je,"[data-conv-menu]")||(Oe.stopPropagation(),E(null))},fe=()=>E(null);return window.addEventListener("pointerdown",W,!0),window.addEventListener("contextmenu",W,!0),window.addEventListener("wheel",fe,{capture:!0,passive:!0}),window.addEventListener("resize",fe),()=>{window.removeEventListener("pointerdown",W,!0),window.removeEventListener("contextmenu",W,!0),window.removeEventListener("wheel",fe,!0),window.removeEventListener("resize",fe)}},[H]),y.useEffect(()=>()=>{V.current&&window.clearTimeout(V.current.timer)},[]);const le=y.useCallback(async()=>{var fe,Oe;const W=(fe=m==null?void 0:m[0])==null?void 0:fe.eventId;if(!(W===void 0||T||v)){N(!0);try{const Je=await Se.listSessionHooks(t,e,pd,W,w);S(Je.length<pd);const tt=G1(Je,k,i.harness);tt.length>0&&(ce.current=((Oe=F.current)==null?void 0:Oe.scrollHeight)??null,b(Lt=>[...tt,...Lt??[]]))}catch(Je){Te(Je)}finally{N(!1)}}},[i.harness,w,m,Te,v,k,T,t,e]);y.useLayoutEffect(()=>{const W=F.current;!W||ce.current===null||(W.scrollTop+=W.scrollHeight-ce.current,ce.current=null)},[m]);const de=y.useMemo(()=>(_??[]).filter(W=>W.mode==="prompt"),[_]),Ke=y.useMemo(()=>bV(m??[],de),[m,de]),He=y.useRef(!0),Fe=()=>{const W=F.current;return!!W&&W.scrollHeight-W.scrollTop-W.clientHeight<=40},dt=(It=Ke[Ke.length-1])==null?void 0:It.key,st=h.get(e),Ue=st==="compacting",at=st==="interrupted",Z=Ue||st==="running"&&((Yt=Ke[Ke.length-1])==null?void 0:Yt.role)==="user",ae=y.useRef(void 0);y.useEffect(()=>{if(m===null||dt===ae.current||(ae.current=dt,!He.current))return;const W=F.current;W&&(W.scrollTop=W.scrollHeight)},[m,dt]);const _e=y.useMemo(()=>vV(Ke,G),[Ke,G]),x=RM({axis:"top",getEdge:()=>{var W;return(((W=F.current)==null?void 0:W.scrollTop)??1)<=1},onFire:()=>void le(),enabled:m!==null&&!v&&!T}),Y=lT(st??"open",aT(i.harness)?(te=g==null?void 0:g.find(W=>W.sessionId===e))==null?void 0:te.turnOpen:void 0),se=W=>P(fe=>{const Oe=new Set(fe);return Oe.delete(W)||Oe.add(W),Oe}),ge=W=>{E(null),A(!0),W!==void 0&&P(new Set([W]))},oe=()=>Ke.filter(W=>M.has(W.key)),z=Ke.filter(W=>W.role!=="compaction"),re=z.length>0&&z.every(W=>M.has(W.key)),ie=()=>P(re?new Set:new Set(z.map(W=>W.key))),he=()=>{const W=oe();if(W.length===0)return;const fe=kV(W,{user:d("tasks.convRoleUser"),assistant:d("tasks.convRoleAssistant")});Hp(fe).then(Oe=>f(Oe?"success":"error",Oe?d("tasks.convCopyOk",{n:W.length}):d("tasks.convCopyFailed")))},be=W=>{const fe=oe();fe.length!==0&&(E(null),p.run(`convImg:${e}`,async()=>{let Oe;try{Oe=await eV(SV(fe),{title:n,subtitle:`${r} · ${d("tasks.convImgSubtitle",{at:X0(new Date().toISOString()),n:fe.length})}`,labels:{user:d("tasks.convRoleUser"),assistant:d("tasks.convRoleAssistant")},stamp:X0})}catch(Je){throw new Error(d("tasks.convImgFailed",{error:Xe(Je)}))}if(W==="download")nV(Oe,tV(n)),f("success",d("tasks.convImgSaved"));else if(await TH(Oe))f("success",d("tasks.convImgOk",{n:fe.length}));else throw new Error(d("tasks.convImgCopyFailed"))},{fail:Xe}))},Ce=W=>{const fe=W.currentTarget.getBoundingClientRect();E({kind:"share",x:fe.right-Y1,y:fe.top-V1})},xe=W=>fe=>{if(ue.current=null,!Ne||D||fe.button!==0)return;const Oe=window.setTimeout(()=>{V.current=null,ue.current=W,ge(W)},wV);V.current={x:fe.clientX,y:fe.clientY,timer:Oe}},Ae=W=>{const fe=V.current;fe&&(Math.abs(W.clientX-fe.x)>q1||Math.abs(W.clientY-fe.y)>q1)&&(window.clearTimeout(fe.timer),V.current=null)},Me=()=>{V.current&&(window.clearTimeout(V.current.timer),V.current=null)},Ie=(W,fe,Oe)=>{var Mr;const Je=(Mr=J.current)==null?void 0:Mr.getBoundingClientRect(),tt=Math.max(0,(innerWidth-((Je==null?void 0:Je.width)??Oe.w))/2-12),Lt=Math.max(0,(innerHeight-((Je==null?void 0:Je.height)??0))/2-12);return{x:Math.max(-tt,Math.min(tt,W)),y:Math.max(-Lt,Math.min(Lt,fe))}},Le=W=>{var Oe;const fe=(Oe=J.current)==null?void 0:Oe.getBoundingClientRect();K.current={x:W.clientX,y:W.clientY,w:j.w,h:j.h||Math.round((fe==null?void 0:fe.height)??0)},W.currentTarget.setPointerCapture(W.pointerId)},$e=W=>{const fe=K.current;if(!fe)return;const Oe=by(fe.w+(W.clientX-fe.x),fe.h+(W.clientY-fe.y));B(Oe),Q(Je=>Ie(Je.x,Je.y,Oe))},qe=()=>{K.current&&(K.current=null,B(W=>{try{localStorage.setItem(DM,JSON.stringify(W))}catch{}return W}))},gt=W=>{!me||W.target.closest("button")||(q.current={x:W.clientX,y:W.clientY,px:O.x,py:O.y},W.currentTarget.setPointerCapture(W.pointerId))},ft=W=>{const fe=q.current;fe&&Q(Ie(fe.px+(W.clientX-fe.x),fe.py+(W.clientY-fe.y),j))},Dt=()=>{q.current=null},St=W=>({onContextMenu:fe=>{D||(fe.preventDefault(),!Ne&&E({kind:"bubble",x:fe.clientX,y:fe.clientY,key:W}))},onPointerDown:xe(W),onPointerMove:Ae,onPointerUp:Me,onPointerCancel:Me,onClick:D?()=>{if(ue.current===W){ue.current=null;return}se(W)}:void 0}),Qt=()=>{const W=L.trim();W&&(C(""),He.current=!0,p.run(`sendMsg:${e}`,async()=>{await Se.sendSessionMessage(e,{text:W}),await pe()},{fail:fe=>d("tasks.msgSendFailed",{error:Xe(fe)})}))};return ln.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:u,children:o.jsxs("div",{ref:J,style:me?{width:j.w,height:j.h||void 0,transform:O.x||O.y?`translate(${O.x}px, ${O.y}px)`:void 0}:void 0,className:"relative flex h-[70dvh] max-lg:h-[88dvh] w-full flex-col overflow-hidden rounded-xl border border-white/[0.08] bg-neutral-900 p-3 shadow-mac",onClick:W=>W.stopPropagation(),children:[o.jsxs("div",{onPointerDown:gt,onPointerMove:ft,onPointerUp:Dt,onPointerCancel:Dt,className:ye("flex items-center justify-between gap-2 pb-2",me&&"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:[d("tasks.messagesTitle")," · ",n]}),o.jsx("p",{className:"truncate text-[10px] text-neutral-500",children:r})]}),o.jsx("div",{className:"flex shrink-0 items-center gap-1",children:o.jsx("button",{type:"button",title:d("tasks.messagesClose"),"aria-label":d("tasks.messagesClose"),onClick:u,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:[xV.map(W=>o.jsx("button",{type:"button",onClick:()=>I(W),className:ye("rounded border px-1.5 py-0.5 text-[10px] transition-colors",G===W?"border-blue-500/40 bg-blue-500/10 text-blue-300":"border-white/[0.08] text-neutral-500 hover:text-neutral-300"),children:d(yV[W])},W)),o.jsx("span",{className:"ml-auto text-[10px] text-neutral-600",children:d("tasks.convCount",{n:Ke.length})})]}),o.jsxs("div",{ref:F,onScroll:()=>{He.current=Fe(),Me(),x.syncEdge()},onWheel:W=>x.wheel(W.deltaY,W.deltaMode),onTouchStart:W=>{var fe;return x.touchStart(((fe=W.touches[0])==null?void 0:fe.clientY)??0)},onTouchMove:W=>{var fe;return x.touchMove(((fe=W.touches[0])==null?void 0:fe.clientY)??0)},onTouchEnd:x.touchEnd,onTouchCancel:x.touchEnd,className:"relative min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain pr-1",children:[x.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(${x.px}px)`},children:o.jsx("span",{className:"text-[10px] text-neutral-600",children:d("tasks.pullMore")})}),o.jsx("div",{className:"space-y-2",style:x.px>0?{transform:`translateY(${x.px}px)`}:void 0,children:m===null?o.jsxs("p",{className:"flex items-center justify-center gap-1.5 pt-6 text-xs text-neutral-600",children:[o.jsx(Cn,{className:"h-3.5 w-3.5 animate-spin"}),d("hooks.loading")]}):Ke.length===0?o.jsx("p",{className:"pt-6 text-center text-xs text-neutral-600",children:d("tasks.messagesEmpty")}):o.jsxs(o.Fragment,{children:[T&&o.jsxs("p",{className:"flex items-center justify-center gap-1.5 pt-1 text-[10px] text-neutral-600",children:[o.jsx(Cn,{className:"h-3 w-3 animate-spin"}),d("tasks.msgEarlier")]}),_e.length===0&&o.jsx("p",{className:"pt-6 text-center text-xs text-neutral-600",children:d("tasks.convFilterEmpty")}),_e.map(W=>{if(W.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-white/[0.08]"}),o.jsxs("span",{className:"shrink-0",children:[d("hooks.mindmap.compactTag")," · ",Hh(W.at)]}),o.jsx("span",{className:"h-px flex-1 bg-white/[0.08]"})]},W.key);if(W.role==="assistant")return o.jsxs("div",{...St(W.key),className:ye("flex justify-start",D&&"select-none"),children:[o.jsxs("div",{className:"min-w-0 max-w-[92%] overflow-x-auto rounded-lg border border-white/[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:Hh(W.at)}),o.jsx(Xf,{text:W.text})]}),D&&o.jsx(W1,{on:M.has(W.key),className:"ml-1.5 mt-1"})]},W.key);const fe=W.pipe;return o.jsxs("div",{...St(W.key),className:ye("flex items-end justify-end gap-1",D&&"select-none"),children:[D&&o.jsx(W1,{on:M.has(W.key),className:"mr-1.5 mt-1"}),(fe==null?void 0:fe.acked)===!0&&o.jsx("span",{title:d("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(ii,{className:"h-2 w-2",strokeWidth:3})}),fe&&fe.acked!==!0&&fe.status==="delivered"&&o.jsx("span",{title:d("tasks.msgDeliveredHint"),className:"mb-0.5 h-3 w-3 shrink-0 rounded-full border border-neutral-500"}),o.jsxs("div",{className:ye("min-w-0 max-w-[85%] overflow-x-auto rounded-lg border px-2 py-1.5",fe?"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:[W.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"}),W.fromWeave!==!0&&W.fromName!=null&&o.jsx("span",{className:"shrink-0 rounded border border-white/[0.12] px-1 py-px text-[10px] text-neutral-400",children:W.fromName}),fe!==void 0&&fe.status!=="delivered"&&o.jsx(Ye,{className:ye("shrink-0",hV[fe.status]),children:d(mV[fe.status])}),fe!==void 0&&fe.via!=null&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:d(pV[fe.via])}),(fe==null?void 0:fe.stalled)===!0&&o.jsx("span",{className:"shrink-0 text-[10px] text-amber-400",children:d("tasks.msgStalled")}),o.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-neutral-600",children:Hh(W.at)})]}),o.jsx("div",{className:"[&_p]:whitespace-pre-wrap",children:o.jsx(Xf,{text:W.text})}),(fe==null?void 0:fe.error)&&o.jsx("p",{className:"mt-1 break-words text-[11px] text-red-400",children:fe.error}),!D&&fe&&(fe.status==="failed"||fe.status==="pending"||fe.stalled===!0)&&o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(fe.status==="failed"||fe.stalled===!0)&&o.jsxs("button",{type:"button",disabled:p.stateOf(`resend:${fe.id}`)==="loading",onClick:()=>void p.run(`resend:${fe.id}`,async()=>{await Se.resendSessionMessage(e,fe.id),await pe()},{fail:Oe=>d("tasks.msgResendFailed",{error:Xe(Oe)})}),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:p.stateOf(`resend:${fe.id}`),className:"h-3 w-3",icon:o.jsx(PD,{className:"h-3 w-3"})}),d("tasks.msgResend")]}),o.jsxs("button",{type:"button",title:d(fe.status==="pending"?"tasks.msgDismissQueuedHint":"tasks.msgDismissHint"),disabled:p.stateOf(`dismiss:${fe.id}`)==="loading",onClick:()=>void p.run(`dismiss:${fe.id}`,async()=>{await Se.dismissSessionMessage(e,fe.id),await pe()},{fail:Oe=>d("tasks.msgDismissFailed",{error:Xe(Oe)})}),className:"inline-flex items-center gap-1 rounded border border-white/[0.1] px-1.5 py-0.5 text-[10px] text-neutral-400 transition-colors hover:border-white/20 hover:text-neutral-200 disabled:opacity-40",children:[o.jsx(ut,{state:p.stateOf(`dismiss:${fe.id}`),className:"h-3 w-3",icon:o.jsx(Fr,{className:"h-3 w-3"})}),d("tasks.msgDismiss")]})]})]})]},W.key)}),(s||Z||at)&&o.jsxs("div",{className:"flex flex-wrap items-center justify-start gap-1.5",children:[s&&o.jsxs("button",{type:"button",title:d("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(vC,{className:"h-3 w-3"}),d("tasks.convAnswer")]}),(Z||at)&&o.jsxs("div",{className:"flex items-center gap-1.5 rounded-lg border border-white/[0.08] bg-neutral-800/50 px-2 py-1.5 text-[10px] text-neutral-500",children:[at?o.jsx(gD,{className:"h-3 w-3"}):o.jsx(Cn,{className:"h-3 w-3 animate-spin"}),d(at?"tasks.msgInterrupted":Ue?"tasks.msgCompacting":"tasks.msgGenerating")]})]})]})})]}),U&&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:U}),D?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:d("tasks.convSelected",{n:M.size})}),o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[o.jsxs("button",{type:"button",disabled:Ke.length===0,onClick:ie,className:ye("inline-flex shrink-0 items-center gap-1 rounded border px-2 py-1 text-[11px] transition-colors disabled:opacity-40",re?"border-blue-500/40 bg-blue-500/10 text-blue-300":"border-white/[0.1] text-neutral-200 hover:border-white/20"),children:[o.jsx(xD,{className:"h-3 w-3"}),d(re?"tasks.convDeselectAll":"tasks.convSelectAll")]}),o.jsxs("button",{type:"button",disabled:M.size===0,onClick:he,className:"inline-flex shrink-0 items-center gap-1 rounded border border-white/[0.1] px-2 py-1 text-[11px] text-neutral-200 transition-colors hover:border-white/20 disabled:opacity-40",children:[o.jsx(Sc,{className:"h-3 w-3"}),d("tasks.convCopy")]}),o.jsxs("button",{type:"button",disabled:M.size===0,onClick:Ce,title:d("tasks.convShare"),className:"inline-flex shrink-0 items-center gap-1 rounded border border-white/[0.1] px-2 py-1 text-[11px] text-neutral-200 transition-colors hover:border-white/20 disabled:opacity-40",children:[o.jsx(ut,{state:p.stateOf(`convImg:${e}`),className:"h-3 w-3",icon:o.jsx(MD,{className:"h-3 w-3"})}),d("tasks.convShare")]}),o.jsx("button",{type:"button",onClick:()=>{A(!1),P(new Set)},className:"inline-flex shrink-0 items-center gap-1 rounded border border-white/[0.1] px-2 py-1 text-[11px] text-neutral-400 transition-colors hover:border-white/20 hover:text-neutral-200",children:d("tasks.convCancel")})]})]}):o.jsxs("div",{className:"mt-2 flex shrink-0 items-end gap-1.5",children:[o.jsx("textarea",{value:L,onChange:W=>C(W.target.value),onKeyDown:W=>{W.key==="Enter"&&!W.shiftKey&&(W.preventDefault(),Qt())},placeholder:d("tasks.messagesPlaceholder"),rows:2,className:"min-w-0 flex-1 resize-none rounded border border-white/[0.1] bg-neutral-950 px-2 py-1.5 text-xs text-neutral-100 focus:outline-none focus:border-blue-500/40"}),Y&&o.jsxs("button",{type:"button",title:d("tasks.stopTooltip"),"aria-label":d("tasks.stopTooltip"),onClick:()=>l(e),className:"inline-flex shrink-0 items-center justify-center gap-1 rounded border border-white/[0.1] px-2.5 py-1 text-[11px] text-neutral-400 transition-colors hover:border-red-500/40 hover:text-red-300",children:[o.jsx(ut,{state:c(e),className:"h-3 w-3",icon:o.jsx(fx,{className:"h-3 w-3"})}),d("tasks.stop")]}),o.jsxs("button",{type:"button",disabled:!i.prompt||!L.trim()||p.stateOf(`sendMsg:${e}`)==="loading",title:i.prompt?void 0:((je=i.unsupportedReasons)==null?void 0:je.prompt)??d("tasks.msgUnsupported"),onClick:Qt,className:"inline-flex shrink-0 items-center justify-center gap-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:[o.jsx(ut,{state:p.stateOf(`sendMsg:${e}`),className:"h-3 w-3",icon:o.jsx(TC,{className:"h-3 w-3"})}),d("tasks.messagesSend")]})]}),me&&o.jsx("div",{role:"separator",title:d("app.resizeDialog"),"aria-label":d("app.resizeDialog"),onPointerDown:Le,onPointerMove:$e,onPointerUp:qe,onPointerCancel:qe,onClick:W=>W.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-white/20"})}),H&&ln.createPortal(o.jsx("div",{"data-conv-menu":!0,className:"fixed z-[60] rounded-lg border border-white/[0.1] bg-neutral-900 py-1 shadow-mac",style:{left:Math.max(8,Math.min(H.x,window.innerWidth-Y1-8)),top:Math.max(8,Math.min(H.y,window.innerHeight-V1))},onClick:W=>W.stopPropagation(),children:H.kind==="bubble"?o.jsxs("button",{type:"button",onClick:()=>ge(H.key),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-white/[0.06]",children:[o.jsx(ii,{className:"h-3 w-3 text-neutral-500"}),d("tasks.convSelect")]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>be("clipboard"),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-white/[0.06]",children:[o.jsx(Sc,{className:"h-3 w-3 text-neutral-500"}),d("tasks.convShareCopy")]}),o.jsxs("button",{type:"button",onClick:()=>be("download"),className:"flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-[11px] text-neutral-200 hover:bg-white/[0.06]",children:[o.jsx(dx,{className:"h-3 w-3 text-neutral-500"}),d("tasks.convShareDownload")]})]})}),document.body)]})}),document.body)}function NV({targets:e,busy:t,onPick:n,onClose:r}){const i=We();return y.useEffect(()=>{const s=a=>{a.key==="Escape"&&r()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[r]),ln.createPortal(o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:r,children:o.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-white/[0.08] bg-neutral-900 p-3 shadow-mac",onClick:s=>s.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:i("tasks.terminalPickTitle")}),o.jsx("button",{type:"button",title:i("tasks.terminalPickCancel"),"aria-label":i("tasks.terminalPickCancel"),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("ul",{className:"max-h-72 space-y-1 overflow-y-auto",children:e.map(s=>o.jsx("li",{children:o.jsxs("button",{type:"button",disabled:t||s.full,onClick:()=>n(s.id),title:s.full?i("tasks.terminalTargetFullTip"):void 0,className:"w-full rounded-lg border border-white/[0.06] bg-white/[0.02] px-2.5 py-2 text-left transition-colors hover:border-white/[0.16] hover:bg-white/[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:s.title??i("tasks.terminalTargetFallback",{w:s.windowId,t:s.tabId})}),s.full&&o.jsx("span",{className:"shrink-0 rounded bg-amber-900/40 px-1 text-[10px] text-amber-300",children:i("tasks.terminalTargetFull",{n:s.paneCount})}),s.active&&o.jsx("span",{className:"shrink-0 rounded bg-emerald-900/40 px-1 text-[10px] text-emerald-300",children:i("tasks.terminalTargetActive")})]}),o.jsx("span",{className:"mt-0.5 block text-[10px] text-neutral-500",children:i("tasks.terminalTargetDetail",{match:s.matchCount,total:s.paneCount})})]})},s.id))})]})}),document.body)}function _V({harnesses:e,onPick:t,onClose:n}){const r=We();return y.useEffect(()=>{const i=s=>{s.key==="Escape"&&n()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n]),ln.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-white/[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:r("tasks.harnessPickTitle")}),o.jsx("button",{type:"button",title:r("tasks.terminalPickCancel"),"aria-label":r("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(i=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>t(i),className:"flex w-full items-center gap-2 rounded-lg border border-white/[0.06] bg-white/[0.02] px-2.5 py-2 text-left transition-colors hover:border-white/[0.16] hover:bg-white/[0.06]",children:[o.jsx(fa,{harness:i}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",children:An(i).label})]})},i))})]})}),document.body)}const CV="pre-session",xy="orphan";function LM(e,t,n){const r=[],i=w=>(r.push(w),w),s=new Set;let a=null,l=null,c=null;const u=new Map,d=new Map,f=new Map,p=(w,m)=>{s.has(w)||(s.add(w),m&&(w.open=!0),c=w,l===w&&(l=null))},h=(w,m)=>{let S=(m?u.get(m):void 0)??l??c??a;S||(S=a=i({id:CV,events:[],dispatches:[],preSession:!0,subagentStops:0,agentsDispatched:0,questions:0}),s.add(S)),S.events.push(w),w.eventType===n.subagentStop&&S.subagentStops++,w.eventType==="PreToolUse"&&n.questionTools.includes(Cc(w.payload).toolName??"")&&S.questions++;const T=d0(w);T&&(S.agentsDispatched++,d.set(T.agentId,S),T.toolUseId&&f.set(T.toolUseId,S))};for(const w of e){const m=w.eventType,b=AV(w.payload);if(m===n.open){const v=Np(w);if(v){const N=(v.toolUseId?f.get(v.toolUseId):void 0)??(v.taskId?d.get(v.taskId):void 0);N?N.events.push(w):h(w,b);continue}if(b){const N=u.get(b);if(N){l=N,N.events.push(w);continue}}const S=i({id:`turn:${w.id}`,events:[],dispatches:[],subagentStops:0,agentsDispatched:0,questions:0});b&&(S.promptId=b,u.set(b,S)),l=S;const T=TV(w.payload);T!==void 0&&(S.prompt=T),S.events.push(w);continue}if(n.close.includes(m)){const S=(b?u.get(b):void 0)??l;S?(S.events.push(w),p(S,!1)):h(w,b);continue}if(n.sessionMarkers.includes(m)){const v=b?u.get(b):void 0,S=v!==void 0&&v===l,T=v??l;T?T.events.push(w):h(w,b),!S&&l&&!s.has(l)&&p(l,!0);continue}h(w,b)}for(const w of r)s.has(w)||(w.open=!0,s.add(w));const g=new Map;for(const w of r)for(const m of w.events)g.set(m.id,w);let k=null;for(const w of t){const m=w.eventId!=null?g.get(w.eventId):void 0;if(m){m.dispatches.push(w);continue}k??(k=i({id:xy,events:[],dispatches:[],subagentStops:0,agentsDispatched:0,questions:0})),s.add(k),k.dispatches.push(w)}return r}function TV(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 AV(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 ll=400,Io=280,Lo=56,MV=128;function jV(e){const t=new Set;let n=0;for(const r of e){const i=Li(r).tool_use_id;if(typeof i!="string"||!i){n+=r.eventType==="PreToolUse"?1:-1;continue}r.eventType==="PostToolUse"?t.delete(i):t.add(i)}return t.size>0||n>0}function zM(e){if(e.eventType!=="SessionStart")return;const t=Li(e).model;return typeof t=="string"&&t?t:void 0}function OV(e,t,n=new Map,r,i=du[qt[0]??"claude"]){var w;const s=m=>m.map(b=>{const v=b.status==="pending";return{key:`d:${b.id}`,kind:"dispatch",dispatch:b,children:[],hasPotential:!1,highlight:v}}),a=(m,b)=>{const v=new Map;for(const T of b){const N=v.get(T.ruleId)??[];N.push(T),v.set(T.ruleId,N)}const S=[];for(const[T,N]of v){const _=`e:${m}:r:${T}`,R=n.get(T),L=N.some($=>$.status==="pending"),C=s(N);let U;R!=null&&R.handlerType?U=[{key:`${_}:h`,kind:"handler",handlerType:R.handlerType,children:C,hasPotential:C.length>0,highlight:L}]:U=C,S.push({key:_,kind:"rule",ruleId:T,ruleName:R?R.name:null,children:U,hasPotential:U.length>0,highlight:L})}return S},l=[],c=[];for(const m of e){const b=`g:${m.id}`,v=[];if(t.has(b))if(m.events.length>0){const T=[],N=new Map,_=new Map,R=new Map;let L=null;const C=G=>{const I=`e:${G.id}`,D=m.dispatches.filter(j=>j.eventId===G.id),A=t.has(I)?a(G.id,D):[],M=G.eventType===i.subagentStop,P=d0(G),H=Np(G);if(H||M){const j=Li(G),B=(H==null?void 0:H.taskId)??(typeof j.agent_id=="string"?j.agent_id:null),O=(H!=null&&H.toolUseId?_.get(H.toolUseId):void 0)??(B?_.get(B):void 0);if(O){const Q={key:I,kind:H?"notification":"subagent",event:G,children:A,hasPotential:A.length>0,highlight:A.some(J=>J.highlight),model:O.model,agentId:O.agentId},F=R.get(O)??[];F.push(Q),R.set(O,F),N.set(G.id,Q),H&&(O.agentRunning=!1);return}}const E={key:I,kind:H?"notification":M?"subagent":"event",event:G,children:A,hasPotential:D.length>0,highlight:A.some(j=>j.highlight),agentId:(P==null?void 0:P.agentId)??(H==null?void 0:H.taskId)??void 0,model:(P==null?void 0:P.model)??zM(G),agentRunning:P?!0:void 0};if(P&&(_.set(P.agentId,E),P.toolUseId&&_.set(P.toolUseId,E),R.set(E,[])),M){const j=L?N.get(L.id):void 0;if(j){j.children.unshift(E),j.highlight=j.highlight||E.highlight,L=G,N.set(G.id,E);return}}T.push(E),N.set(G.id,E),L=G};let U=[];const $=()=>{if(U.length!==0){if(U.length>=2){const G=`c:${U[0].id}`;T.push({key:G,kind:"cluster",children:t.has(G)?U.map(I=>({key:`e:${I.id}`,kind:"event",event:I,children:[],hasPotential:!1,highlight:!1})):[],hasPotential:!0,highlight:!1,clusterEvents:U}),L=null}else C(U[0]);U=[]}};for(const G of m.events){if((G.eventType==="PreToolUse"||G.eventType==="PostToolUse")&&!d0(G)&&!m.dispatches.some(D=>D.eventId===G.id)){U.push(G);continue}$(),C(G)}$();for(const[G,I]of R)I.length===0&&G.agentRunning&&I.push({key:`${G.key}:agent`,kind:"subagent",children:[],hasPotential:!1,highlight:!1,agentId:G.agentId,model:G.model,agentRunning:!0}),I.length>0&&(G.children=[...I,...G.children],G.highlight=G.highlight||I.some(D=>D.highlight),c.push({anchor:G,members:I,closed:!G.agentRunning}));v.push(...T)}else v.push(...s(m.dispatches));const S=v.some(T=>T.highlight)||m.dispatches.some(T=>T.status==="pending");l.push({key:b,kind:"group",group:m,children:v,hasPotential:m.events.length>0||m.dispatches.length>0,highlight:S,model:r})}const u=[],d=[];let f=0;const p=(m,b,v)=>{v&&d.push({id:`${v}->${m.key}`,source:v,target:m.key});let S;if(m.children.length===0)S=f*MV,f+=1;else{const T=p(m.children[0],b+1,m.key);let N=T;for(let _=1;_<m.children.length;_++)N=p(m.children[_],b+1,m.key);S=(T+N)/2}return u.push({key:m.key,kind:m.kind,depth:b,y:S,group:m.group,event:m.event,dispatch:m.dispatch,ruleId:m.ruleId,ruleName:m.ruleName,handlerType:m.handlerType,clusterEvents:m.clusterEvents,agentId:m.agentId,model:m.model,agentRunning:m.agentRunning,expandable:m.hasPotential,expanded:t.has(m.key),highlight:m.highlight}),S};for(const m of l)p(m,0,null);for(const m of l){if(m.kind!=="group")continue;const b=m.children.filter(S=>S.kind==="event"||S.kind==="cluster"||S.kind==="subagent"||S.kind==="notification");if(b.length===0)continue;const v=new Set(b.map(S=>S.key));for(let S=d.length-1;S>=0;S--){const T=d[S];T.source===m.key&&v.has(T.target)&&d.splice(S,1)}d.push({id:`${m.key}->${b[0].key}`,source:m.key,target:b[0].key});for(let S=0;S+1<b.length;S++)d.push({id:`${b[S].key}->${b[S+1].key}`,source:b[S].key,target:b[S+1].key,vertical:!0});(w=m.group)!=null&&w.open||d.push({id:`${b[b.length-1].key}->${m.key}`,source:b[b.length-1].key,target:m.key,closure:!0})}const h=m=>[...m.kind==="cluster"?[m]:[],...m.children.flatMap(h)],g=new Map(u.map(m=>[m.key,m.y])),k=new Map(u.map(m=>[m.key,m.depth]));for(const m of l.flatMap(h)){if(m.children.length===0)continue;const b=new Set(m.children.map(R=>R.key));for(let R=d.length-1;R>=0;R--){const L=d[R];L.source===m.key&&b.has(L.target)&&d.splice(R,1)}d.push({id:`${m.key}->${m.children[0].key}`,source:m.key,target:m.children[0].key,dashed:!0});for(let R=0;R+1<m.children.length;R++)d.push({id:`${m.children[R].key}->${m.children[R+1].key}`,source:m.children[R].key,target:m.children[R+1].key,vertical:!0});if(jV(m.clusterEvents??[]))continue;const v=m.children[m.children.length-1],S=(g.get(v.key)??0)+Lo/2,T=(g.get(m.key)??0)+Lo*.78,_=(k.get(m.key)??0)*ll+Io+(ll-Io)/2;d.push({id:`${v.key}->${m.key}`,source:v.key,target:m.key,clusterLoop:!0,waypoints:[{x:_,y:S},{x:_,y:T}]})}for(const{anchor:m,members:b,closed:v}of c){const S=new Set(b.map(N=>N.key));for(let N=d.length-1;N>=0;N--){const _=d[N];_.source===m.key&&S.has(_.target)&&d.splice(N,1)}let T=m.key;for(const N of b)d.push({id:`${T}->${N.key}`,source:T,target:N.key,vertical:T!==m.key}),T=N.key;if(v){const N=k.get(m.key)??0,_=(g.get(T)??0)+Lo/2,R=(g.get(m.key)??0)+Lo*.78,L=N*ll+Io+(ll-Io)/2;d.push({id:`${T}->${m.key}`,source:T,target:m.key,ringLoop:!0,waypoints:[{x:L,y:_},{x:L,y:R}]})}}return{nodes:u,edges:d}}const PM=y.createContext(new Set);function Ut(e){return`${e} rounded px-1 py-px text-[10px] leading-tight`}function Sl({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 RV({data:e}){var f;const t=We(),n=y.useContext(PM),{node:r,flash:i,onToggle:s,onOpenDetail:a,answerable:l,onOpenAnswer:c}=e,u=r.expandable?o.jsx("button",{type:"button",onClick:p=>{p.stopPropagation(),s(r.key)},className:"shrink-0 rounded p-0.5 text-neutral-500 transition-colors hover:bg-white/[0.08] hover:text-neutral-200","aria-expanded":r.expanded,children:r.expanded?o.jsx(Pn,{className:"h-3.5 w-3.5"}):o.jsx(Un,{className:"h-3.5 w-3.5"})}):o.jsx("span",{className:"w-4 shrink-0"});let d=null;if(r.kind==="group"&&r.group){const p=r.group,h=p.preSession?t("hooks.mindmap.preSession"):p.prompt??"",g=(f=p.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:p.prompt??h,children:h}),o.jsxs("span",{className:"mt-1 flex flex-wrap items-center gap-1",children:[p.preSession?o.jsx("span",{className:Ut("bg-neutral-800 text-neutral-300"),children:h}):o.jsx("span",{className:Ut("bg-cyan-900/40 text-cyan-300"),children:"prompt"}),p.open&&(n.has(p.id)?o.jsx("span",{className:Ut("bg-emerald-900/40 text-emerald-300"),children:t("hooks.mindmap.runningTag")}):o.jsx("span",{className:Ut("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:Ut("bg-amber-900/50 font-medium text-amber-300 transition-colors hover:bg-amber-800/60 hover:text-amber-200"),children:t("tasks.answerPendingTag")}),p.subagentStops>0&&o.jsx("span",{className:Ut("bg-orange-900/40 text-orange-300"),children:t("hooks.mindmap.subagentCount",{n:p.subagentStops})}),p.agentsDispatched>0&&o.jsx("span",{className:Ut("bg-fuchsia-900/40 text-fuchsia-300"),children:t("hooks.mindmap.agentDispatched",{n:p.agentsDispatched})}),p.dispatches.length>0&&o.jsx("span",{className:Ut("bg-emerald-900/40 text-emerald-300"),children:t("hooks.mindmap.dispatchCount",{n:p.dispatches.length})}),r.model&&o.jsx(Sl,{model:r.model}),o.jsxs("span",{className:"text-[10px] text-neutral-500",children:[t("catbar.items",{n:p.events.length}),g?` · ${rr(g)}`:""]})]})]})}else if((r.kind==="event"||r.kind==="subagent"||r.kind==="notification")&&r.event){const p=r.event,h=r.kind==="subagent",g=Fd(p),k=kx(p.source,p.eventType,Li(p).source);d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("span",{className:Ut(BC[p.eventType]??"bg-neutral-800 text-neutral-300"),children:p.eventType}),k&&o.jsx("span",{className:Ut("bg-amber-900/40 text-amber-300"),children:t("hooks.mindmap.compactTag")}),h&&o.jsx("span",{className:Ut("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:"subagent"}),r.kind==="notification"&&o.jsx("span",{className:Ut("border border-teal-700/50 bg-teal-950/60 text-teal-300"),children:t("hooks.mindmap.notifyTag")}),r.agentId&&o.jsxs("span",{className:"text-[10px] text-neutral-500",children:["agent …",r.agentId.slice(-8)]}),r.model&&o.jsx(Sl,{model:r.model}),r.agentRunning&&o.jsx("span",{className:Ut("bg-amber-900/50 text-amber-300"),children:t("hooks.mindmap.agentRunning")}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:rr(p.createdAt)})]}),g&&o.jsx("span",{className:ye("mt-0.5 block text-[11px] text-neutral-400",h?"line-clamp-2 text-orange-100/70":"truncate"),title:g,children:g})]})}else if(r.kind==="cluster"&&r.clusterEvents){const p=r.clusterEvents,h=new Map;for(const m of p){const b=Cc(m.payload).toolName??m.eventType;h.set(b,(h.get(b)??0)+1)}const g=[...h.entries()].sort((m,b)=>b[1]-m[1]),k=g.map(([m,b])=>`${m} ×${b}`).join(" · "),w=g.slice(0,3).map(([m,b])=>b>1?`${m} ×${b}`:m).join(" · ");d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("span",{className:Ut("bg-amber-900/40 text-amber-300"),children:t("hooks.mindmap.toolCluster")}),o.jsxs("span",{className:"text-[10px] text-neutral-400",children:["×",p.length]}),o.jsx("span",{className:"text-[10px] text-neutral-500",children:rr(p[0].createdAt)})]}),o.jsxs("span",{className:"mt-0.5 block truncate text-[11px] text-neutral-400",title:k,children:[w,g.length>3?` · +${g.length-3}`:""]})]})}else if(r.kind==="subagent"&&!r.event)d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex flex-wrap items-center gap-1",children:[o.jsx("span",{className:Ut("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:"subagent"}),r.agentId&&o.jsxs("span",{className:"text-[10px] text-neutral-500",children:["agent …",r.agentId.slice(-8)]}),r.model&&o.jsx(Sl,{model:r.model}),r.agentRunning&&o.jsx("span",{className:Ut("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(r.kind==="rule")d=o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Ut("bg-blue-900/40 text-blue-300"),children:"rule"}),o.jsx("span",{className:"truncate text-xs text-blue-200",title:r.ruleName??r.ruleId??"",children:r.ruleName??(r.ruleId?`#${r.ruleId.slice(0,12)}`:"")})]});else if(r.kind==="handler")d=o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Ut("bg-purple-900/40 text-purple-300"),children:"handler"}),o.jsx("span",{className:"truncate text-xs text-purple-200",children:r.handlerType})]});else if(r.kind==="dispatch"&&r.dispatch){const p=r.dispatch;d=o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx("span",{className:Ut("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??p.ruleId,children:e.ruleName??p.ruleId}),o.jsx(UM,{status:p.status})]}),o.jsx("span",{className:"mt-0.5 block truncate text-[11px] text-neutral-400",title:p.prompt,children:p.prompt})]})}return o.jsxs("div",{className:ye("flex w-[280px] cursor-pointer items-start gap-1 rounded-lg border border-white/[0.08] bg-neutral-900/95 px-2 py-1.5 shadow-mac transition-colors hover:border-white/[0.18]",r.highlight&&"ring-1 ring-amber-400/70",i&&"weave-node-flash"),title:r.highlight?t("hooks.mindmap.pendingTip"):void 0,onClick:p=>{p.stopPropagation(),a(r)},children:[o.jsx(kn,{type:"target",id:"l",position:Ge.Left,style:{visibility:"hidden"}}),o.jsx(kn,{type:"target",id:"t",position:Ge.Top,style:{visibility:"hidden"}}),o.jsx(kn,{type:"target",id:"rt",position:Ge.Right,style:{visibility:"hidden",top:"78%"}}),o.jsx(kn,{type:"source",id:"r",position:Ge.Right,style:{visibility:"hidden"}}),o.jsx(kn,{type:"source",id:"b",position:Ge.Bottom,style:{visibility:"hidden"}}),o.jsx(kn,{type:"source",id:"c",position:Ge.Left,style:{visibility:"hidden"}}),u,o.jsx("div",{className:"min-w-0 flex-1",children:d})]})}const DV={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 UM({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",r=DV[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}`}),r?t(r):e]})}const IV={mindmap:RV};function LV(e,t=14){let n=`M${e[0].x} ${e[0].y}`;for(let i=1;i<e.length-1;i++){const s=e[i-1],a=e[i],l=e[i+1],c=(p,h)=>Math.hypot(h.x-p.x,h.y-p.y),u=Math.min(t,c(s,a)/2,c(a,l)/2),d={x:a.x+(s.x-a.x)*(u/c(s,a)),y:a.y+(s.y-a.y)*(u/c(s,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 r=e[e.length-1];return`${n} L${r.x} ${r.y}`}function zV({id:e,sourceX:t,sourceY:n,targetX:r,targetY:i,markerEnd:s,style:a,data:l}){const c=(l==null?void 0:l.waypoints)??[],u=[{x:t,y:n},...c,{x:r,y:i}];return o.jsx(yu,{id:e,path:LV(u),markerEnd:s,style:a})}const PV={waypoint:zV};function UV({projectId:e,sessionId:t,sessions:n,harness:r,onSelect:i,focusGroupId:s,focusGroup:a,running:l,answerable:c,onOpenAnswer:u}){const d=We(),f=du[r??qt[0]??"claude"],[p,h]=y.useState(null),[g,k]=y.useState(null),[w,m]=y.useState(new Map),[b,v]=y.useState(new Set),[S,T]=y.useState(null),[N,_]=y.useState(null),R=y.useRef(null),L=y.useRef(null),C=y.useCallback(async()=>{try{const[B,O,Q]=await Promise.all([Se.listSessionHooks(e,t,300),Se.listHookDispatches({limit:200}),Se.listHooksRules(e)]);h(B),k(O),m(new Map(Q.map(F=>[F.id,{name:F.name,handlerType:F.handler.type}])))}catch{}},[e,t]);y.useEffect(()=>{h(null),k(null),v(s?new Set([`g:${s}`]):new Set),_(null),C()},[C,s]),y.useEffect(()=>{const B=O=>{const Q=O.detail;Q.kind==="dispatch.created"&&Q.dispatchId!=null&&(T(`d:${Q.dispatchId}`),R.current&&window.clearTimeout(R.current),R.current=window.setTimeout(()=>T(null),900)),L.current&&window.clearTimeout(L.current),L.current=window.setTimeout(()=>void C(),500)};return window.addEventListener("weave:hook",B),()=>{window.removeEventListener("weave:hook",B),R.current&&window.clearTimeout(R.current),L.current&&window.clearTimeout(L.current)}},[C]);const U=y.useMemo(()=>{if(s&&a)return[a];if(!p||!g)return[];const B=new Set(p.map(J=>J.id)),O=g.filter(J=>J.sessionId===t||J.eventId!=null&&B.has(J.eventId)).sort((J,ce)=>J.id-ce.id),Q=p.length>=300,F=LM(p,O,f).filter(J=>J.id!==xy&&!(J.preSession&&Q));return s?F.filter(J=>J.id===s):F},[p,g,t,s,a,f]),$=y.useMemo(()=>{const B=U[U.length-1];return l&&B?new Set([B.id]):new Set},[U,l]),G=y.useMemo(()=>{if(p)for(let B=p.length-1;B>=0;B--){const O=zM(p[B]);if(O)return O}},[p]),I=y.useMemo(()=>OV(U,b,w,G,f),[U,b,w,G,f]),D=y.useRef(null),A=y.useRef(null),M=y.useCallback(B=>{A.current=B,v(O=>{const Q=new Set(O);return Q.delete(B)||Q.add(B),Q})},[]),P=y.useCallback(B=>_(B),[]);y.useEffect(()=>{const B=A.current;if(!B)return;A.current=null;const O=I.nodes.find(F=>F.key===B),Q=D.current;!O||!Q||Q.setCenter(O.depth*ll+Io/2,O.y+Lo/2,{zoom:Q.getZoom(),duration:250})},[I]);const H=y.useMemo(()=>I.nodes.map(B=>{var O;return{id:B.key,type:"mindmap",position:{x:B.depth*ll,y:B.y},data:{node:B,flash:S===B.key,ruleName:B.dispatch?((O=w.get(B.dispatch.ruleId))==null?void 0:O.name)??void 0:void 0,onToggle:M,onOpenDetail:P,answerable:B.kind==="group"&&(c??!1),onOpenAnswer:u},draggable:!0}}),[I.nodes,S,w,M,P,c,u]),E=y.useMemo(()=>I.edges.map(B=>({id:B.id,...B.waypoints?{data:{waypoints:B.waypoints}}:{},source:B.source,target:B.target,sourceHandle:B.closure||B.clusterLoop||B.ringLoop?"c":B.vertical?"b":"r",targetHandle:B.closure?"l":B.clusterLoop||B.ringLoop?"rt":B.vertical?"t":"l",type:B.waypoints?"waypoint":"smoothstep",markerEnd:{type:Bl.ArrowClosed,width:16,height:16},style:B.dashed||B.clusterLoop?{stroke:"rgba(96,165,250,0.55)",strokeWidth:1.5,strokeDasharray:"7 5"}:{stroke:"rgba(96,165,250,0.8)",strokeWidth:2}})),[I.edges]),j=B=>{const O=(F,J)=>o.jsxs("p",{className:"flex gap-2",children:[o.jsx("span",{className:"shrink-0 text-neutral-500",children:F}),o.jsx("span",{className:"min-w-0 break-all text-neutral-300",children:J})]}),Q=F=>F==null?"—":typeof F=="string"?F:JSON.stringify(F,null,2);if(B.kind==="group"&&B.group){const F=B.group;return o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"whitespace-pre-wrap break-all text-neutral-100",children:F.prompt??d("hooks.mindmap.preSession")}),o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[F.open&&($.has(F.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")})),F.subagentStops>0&&o.jsx("span",{className:"rounded bg-orange-900/40 px-1 text-[10px] text-orange-300",children:d("hooks.mindmap.subagentCount",{n:F.subagentStops})}),F.agentsDispatched>0&&o.jsx("span",{className:"rounded bg-fuchsia-900/40 px-1 text-[10px] text-fuchsia-300",children:d("hooks.mindmap.agentDispatched",{n:F.agentsDispatched})}),B.model&&o.jsx(Sl,{model:B.model})]}),O(d("tasks.events",{n:F.events.length}),""),O(d("tasks.groupDispatches",{n:F.dispatches.length}),"")]})}if(B.kind==="subagent"&&!B.event)return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:Ut("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:"subagent"}),B.agentId&&o.jsxs("span",{className:"text-neutral-500",children:["agent …",B.agentId.slice(-8)]}),B.model&&o.jsx(Sl,{model:B.model}),B.agentRunning&&o.jsx("span",{className:Ut("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((B.kind==="event"||B.kind==="subagent"||B.kind==="notification")&&B.event){const F=B.event,J=Cc(F.payload);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:Ut(BC[F.eventType]??"bg-neutral-800 text-neutral-300"),children:F.eventType}),kx(F.source,F.eventType,Li(F).source)&&o.jsx("span",{className:Ut("bg-amber-900/40 text-amber-300"),children:d("hooks.mindmap.compactTag")}),B.agentId&&o.jsxs("span",{className:Ut("border border-orange-700/50 bg-orange-950/60 text-orange-300"),children:["agent …",B.agentId.slice(-8)]}),B.model&&o.jsx(Sl,{model:B.model}),B.agentRunning&&o.jsx("span",{className:Ut("bg-amber-900/50 text-amber-300"),children:d("hooks.mindmap.agentRunning")}),o.jsx("span",{className:"text-neutral-500",children:rr(F.createdAt)})]}),o.jsx("p",{className:"whitespace-pre-wrap break-all text-neutral-100",children:Fd(F)}),J.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:Q(J.toolInput)})]}),J.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:Q(J.toolResponse)})]})]})}if(B.kind==="cluster"&&B.clusterEvents){const F=B.clusterEvents,J=new Map;for(const ce of F){const K=Cc(ce.payload).toolName??ce.eventType;J.set(K,(J.get(K)??0)+1)}return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex flex-wrap gap-1.5",children:[...J.entries()].map(([ce,K])=>o.jsxs("span",{className:"rounded bg-amber-900/40 px-1 text-[10px] text-amber-300",children:[ce," ×",K]},ce))}),o.jsxs("p",{className:"text-neutral-500",children:[rr(F[0].createdAt)," → ",rr(F[F.length-1].createdAt)]}),o.jsx("ul",{className:"space-y-1",children:F.map(ce=>o.jsxs("li",{className:"truncate text-neutral-300",title:Fd(ce),children:[o.jsx("span",{className:"text-neutral-600",children:rr(ce.createdAt)})," ",Fd(ce)||ce.eventType]},ce.id))})]})}if(B.kind==="dispatch"&&B.dispatch){const F=B.dispatch;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(UM,{status:F.status}),o.jsx("span",{className:"text-neutral-500",children:rr(F.startedAt)}),F.finishedAt&&o.jsxs("span",{className:"text-neutral-600",children:["→ ",rr(F.finishedAt)]})]}),O("rule",B.ruleName??F.ruleId),o.jsx("p",{className:"whitespace-pre-wrap break-all text-neutral-100",children:F.prompt}),F.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:F.output})]}),F.error&&o.jsx("p",{className:"whitespace-pre-wrap break-all text-red-400/80",children:F.error})]})}return B.kind==="rule"?O("rule",B.ruleName??B.ruleId??"—"):B.kind==="handler"?O("handler",B.handlerType??"—"):null};return o.jsx(PM.Provider,{value:$,children:o.jsxs("div",{className:ye("space-y-2",s&&"h-full"),children:[!s&&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:B=>i==null?void 0:i(B.target.value),className:"rounded-md border border-white/[0.08] bg-neutral-900 px-2 py-1 text-xs text-neutral-200",children:(n??[]).map(B=>o.jsx("option",{value:B.sessionId,children:Tn(B.title,B.sessionId)},B.sessionId))}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:p===null?d("hooks.loading"):d("catbar.items",{n:U.length})}),o.jsx("span",{className:"ml-auto text-[11px] text-neutral-600",children:d("hooks.mindmap.hint")})]}),o.jsxs("div",{className:ye("relative rounded-lg bg-neutral-950/40",s?"h-full border-0":"h-96 border border-white/[0.06]"),onClick:()=>_(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")}):H.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(Gx,{onInit:B=>{D.current=B},nodes:H,edges:E,nodeTypes:IV,edgeTypes:PV,fitView:!s,fitViewOptions:{maxZoom:1,padding:.12},...s?{defaultViewport:{x:24,y:12,zoom:.75}}:{},minZoom:.15,maxZoom:1.5,nodesDraggable:!0,nodesConnectable:!1,deleteKeyCode:null,defaultEdgeOptions:{type:"smoothstep",markerEnd:{type:Bl.ArrowClosed,width:16,height:16},style:{stroke:"rgba(96,165,250,0.8)",strokeWidth:2}},children:[o.jsx(Kx,{gap:14,size:1,color:"rgba(255,255,255,0.06)"}),o.jsx(qx,{showInteractive:!1})]}),N&&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-white/[0.14] bg-neutral-900/95 shadow-mac",onClick:B=>B.stopPropagation(),children:[o.jsxs("div",{className:"flex items-center gap-2 border-b border-white/[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:()=>_(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:j(N)})]})]})]})})}const BV=300;function yy({onClick:e,title:t,className:n}){const[r,i]=y.useState(!1);return o.jsx("button",{type:"button",title:t,"aria-label":t,disabled:r,onClick:()=>{const s=e();s instanceof Promise&&(i(!0),Promise.all([s.then(()=>{},()=>{}),new Promise(a=>setTimeout(a,BV))]).then(()=>i(!1)))},className:ye("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(Il,{className:ye("h-3.5 w-3.5",r&&"animate-spin")})})}const HV=8e3,FV=10*6e4;let Z1=0;function $V(e){const t="=".repeat((4-e.length%4)%4),n=atob((e+t).replace(/-/g,"+").replace(/_/g,"/")),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}function GV(e){if(e==null)return null;const t=new Uint8Array(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n)}async function vy(){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 BM(e){return Promise.race([e,new Promise(t=>setTimeout(()=>t(null),HV))])}async function HM(e){if(!(e!=null&&e.force)&&Date.now()<Z1)return"unavailable";try{const t=await BM(KV());return t===null?(Z1=Date.now()+FV,"unavailable"):t}catch{return"failed"}}async function KV(){var s,a;const e=await vy();if(!e||typeof Notification>"u"||Notification.permission!=="granted")return"unavailable";const{publicKey:t}=await Se.pushPublicKey(),n=await e.pushManager.getSubscription();let r=n;n&&GV(n.options.applicationServerKey)!==t&&(await n.unsubscribe(),r=null),r??(r=await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:$V(t)}));const i=r.toJSON();return!i.endpoint||!((s=i.keys)!=null&&s.p256dh)||!((a=i.keys)!=null&&a.auth)?"failed":(await Se.pushSubscribe({endpoint:i.endpoint,keys:{p256dh:i.keys.p256dh,auth:i.keys.auth}}),"ok")}async function qV(){try{const e=await vy();if(!e)return;const t=await e.pushManager.getSubscription();if(!t)return;await Se.pushUnsubscribe(t.endpoint),await BM(t.unsubscribe())}catch{}}async function md(){if(globalThis.isSecureContext===!1)return"insecure";if(typeof navigator>"u"||!("serviceWorker"in navigator))return"unsupported";try{const e=await vy();return e?await e.pushManager.getSubscription()?"on":"off":"unsupported"}catch{return"unsupported"}}const YV={denied:"tasks.notifyDenied",unsupported:"tasks.notifyUnsupported",insecure:"tasks.notifyInsecure"},VV=3e4;function XV({projectId:e,initialSessionId:t,projectLabel:n,harnesses:r}){var Ra;const i=We(),{show:s}=Zt(),a=cn(),{sessions:l,dispatches:c,statuses:u,inflight:d,questions:f,refresh:p}=fu(),h=da("(min-width: 1024px)"),[g,k]=y.useState(!1),[w,m]=y.useState([]),[b,v]=y.useState([]),[S,T]=y.useState(null),[N,_]=y.useState(null),[R,L]=y.useState(null),[C,U]=y.useState(""),[$,G]=y.useState(null),[I,D]=y.useState(10),[A,M]=y.useState(""),[P,H]=y.useState(null),[E,j]=y.useState(!1),[B,O]=y.useState(!1),Q=y.useRef(null),F=y.useMemo(()=>l===null?null:l.filter(ee=>ee.projectId===e),[l,e]),J=y.useRef(F);J.current=F;const ce=y.useRef(new Map);y.useEffect(()=>{var ee;for(const we of F??[])we.pidAlive&&((ee=ce.current.get(we.sessionId))==null||ee(),ce.current.delete(we.sessionId))},[F]),y.useEffect(()=>()=>{for(const ee of ce.current.values())ee();ce.current.clear()},[]);const K=y.useCallback(ee=>{var we;return(we=J.current)!=null&&we.some(Ve=>Ve.sessionId===ee&&Ve.pidAlive)?Promise.resolve():new Promise(Ve=>{const pt=window.setTimeout(()=>{ce.current.delete(ee),Ve()},VV);ce.current.set(ee,()=>{window.clearTimeout(pt),Ve()})})},[]),q=y.useCallback(async ee=>{O(!0);try{const we=await Se.listSessionHooks(e,ee);v(Ve=>{var Gt;if(Ve.length===0)return we;const pt=((Gt=we[0])==null?void 0:Gt.id)??Number.POSITIVE_INFINITY;return[...Ve.filter(Fn=>Fn.id<pt),...we]}),j(Ve=>Ve||we.length<300)}catch(we){_(we instanceof Error?we.message:String(we))}finally{O(!1)}},[e]);y.useEffect(()=>{T(t??null),t&&(H(t),window.setTimeout(()=>H(ee=>ee===t?null:ee),3e3)),Se.listHooksRules(e).then(m).catch(()=>{})},[e,t]);const[V,ue]=y.useState(null),me=y.useCallback(()=>{Se.messagingCapabilities().then(ue).catch(()=>{})},[]);y.useEffect(()=>{me()},[me]),y.useEffect(()=>Ri("settings",me),[me]);const Ne=y.useMemo(()=>{const ee=new Map;for(const we of V??[])ee.set(we.harness,we);return ee},[V]),[Te,ne]=y.useState(null),pe=y.useCallback(()=>{Se.listSessionWatches().then(ne).catch(()=>{})},[]);y.useEffect(()=>{pe()},[pe]);const le=y.useMemo(()=>{const ee=new Map;for(const we of Te??[])we.watcherSessionId===null&&ee.set(we.targetSessionId,we);return ee},[Te]),de=y.useCallback(ee=>le.get(ee),[le]),Ke=y.useCallback(ee=>a.stateOf(`watch:${ee}`),[a]),He=y.useCallback(ee=>d.get(ee)??0,[d]),Fe=y.useCallback(ee=>f.get(ee),[f]),dt=y.useCallback((ee,we)=>{a.run(`answer:${ee}`,async()=>{await Se.answerQuestion(ee,we),await p()},{fail:Ve=>i("tasks.answerFailed",{error:Xe(Ve)})})},[a,i,p]),st=y.useCallback(ee=>a.stateOf(`answer:${ee}`),[a]),Ue=y.useCallback(ee=>{a.run(`interrupt:${ee}`,async()=>{await Se.interruptSession(ee),s("success",i("tasks.stopOk"))},{fail:we=>i("tasks.stopFail",{error:Xe(we)})})},[a,i,s]),at=y.useCallback(ee=>a.stateOf(`interrupt:${ee}`),[a]),Z=y.useCallback((ee,we,Ve)=>{a.run(`watch:${ee}`,async()=>{const pt=await FC();pt!=="granted"&&s("info",i(YV[pt])),await HM(),await Se.createSessionWatch(ee,{on:we,times:Ve}),pe()},{fail:pt=>i("tasks.watchFailed",{error:Xe(pt)})})},[a,i,s,pe]),ae=y.useCallback(ee=>{const we=le.get(ee);we&&a.run(`watch:${ee}`,async()=>{await Se.deleteSessionWatch(ee,we.id),pe()},{fail:Ve=>i("tasks.unwatchFailed",{error:Xe(Ve)})})},[a,i,le,pe]);y.useEffect(()=>{const ee=we=>{(we.detail??{}).kind==="watch.fired"&&pe()};return window.addEventListener("weave:hook",ee),()=>window.removeEventListener("weave:hook",ee)},[pe]),y.useEffect(()=>{var ee;$&&!((ee=Fe($))!=null&&ee.questions.length)&&G(null)},[$,Fe]),y.useEffect(()=>{T(ee=>{var we;return ee??((we=F==null?void 0:F[0])==null?void 0:we.sessionId)??null})},[F]),y.useEffect(()=>{v([]),j(!1),U(""),D(10),M(""),S&&q(S)},[S,q]),y.useEffect(()=>{let ee=null;const we=Ve=>{const pt=Ve.detail??{};!S||pt.sessionId!==S||(ee!==null&&window.clearTimeout(ee),ee=window.setTimeout(()=>{ee=null,q(S)},500))};return window.addEventListener("weave:hook",we),()=>{window.removeEventListener("weave:hook",we),ee!==null&&window.clearTimeout(ee)}},[q,S]);const _e=y.useMemo(()=>{const ee=new Map;for(const we of c){if(!we.sessionId)continue;const Ve=ee.get(we.sessionId)??[];Ve.push(we),ee.set(we.sessionId,Ve)}return ee},[c]),x=((Ra=F==null?void 0:F.find(ee=>ee.sessionId===S))==null?void 0:Ra.harness)??null,Y=du[x??qt[0]??"claude"],se=y.useMemo(()=>S?LM(b,_e.get(S)??[],Y).filter(ee=>ee.id!==xy).filter(ee=>!(ee.preSession&&!E)):[],[S,b,_e,E,Y]),ge=y.useMemo(()=>C&&se.some(ee=>ee.id===C)?C:null,[se,C]),oe=A.trim().toLowerCase(),z=y.useMemo(()=>oe?se.filter(ee=>{var we;return(ee.prompt??(ee.preSession?"":((we=ee.events[0])==null?void 0:we.eventType)??"")).toLowerCase().includes(oe)}):null,[se,oe]),re=async(ee,we)=>{try{const Ve=await Se.renameSession(ee,we);if(Ve.pendingTitle!==we&&Ve.title!==we){_(i("tasks.renameVerifyFail"));return}await p()}catch(Ve){_(Ve instanceof Error?Ve.message:String(Ve))}},ie=y.useCallback((ee,we)=>{a.run(`openTerm:${ee}`,async()=>{await Se.openSessionTerminal(ee,we),await p(),await K(ee)},{fail:Ve=>i("errors.openFailed",{error:Xe(Ve)})})},[a,i,p,K]),he=y.useCallback(ee=>{a.run(`newSession:${e}`,async()=>{await Se.startProjectSession(e,ee)},{fail:we=>i("tasks.newSessionFailed",{error:Xe(we)})})},[a,e,i]),be=y.useMemo(()=>r.filter(ee=>ee.canStartSession).map(ee=>ee.id),[r]),[Ce,xe]=y.useState(!1),Ae=be.length>0,Me=a.stateOf(`newSession:${e}`)==="loading",Ie=y.useCallback(()=>{if(be.length>1){xe(!0);return}he(be[0])},[be,he]),[Le,$e]=y.useState(null),qe=y.useCallback(ee=>{var Ve;const we=((Ve=F==null?void 0:F.find(pt=>pt.sessionId===ee))==null?void 0:Ve.projectId)??null;if(we==null){ie(ee);return}Se.listProjectTerminals(we).then(pt=>{pt.filter(Gt=>!Gt.full).length>1?$e({sessionId:ee,targets:pt}):ie(ee)}).catch(()=>ie(ee))},[F,ie]),gt=y.useCallback(ee=>a.stateOf(`openTerm:${ee}`),[a]),[ft,Dt]=y.useState(null),St=y.useCallback(ee=>{const we=F==null?void 0:F.find(pt=>pt.sessionId===ee),Ve=we!=null&&we.harness?Ne.get(we.harness):void 0;Ve&&Dt({sessionId:ee,projectId:(we==null?void 0:we.projectId)??e,label:Tn((we==null?void 0:we.title)??null,ee),capability:Ve})},[F,Ne,e]),[Qt,It]=y.useState({}),Yt=y.useMemo(()=>c.filter(ee=>ee.status==="pending"&&ee.sessionId===null&&w.some(we=>we.id===ee.ruleId)),[c,w]),te=y.useCallback((ee,we)=>{a.run(`dispatch:${ee}`,async()=>{await Se.runHookDispatch(ee,we),await p()},{fail:Ve=>i("tasks.dispatchRunFailed",{error:Xe(Ve)})})},[a,p,i]),je=z?z.slice().reverse():se.slice(-I).reverse(),W=se.length-je.length,fe=!E&&b.length>0,Oe=W>0||fe,Je=ee=>!!ee&&ee.scrollHeight-ee.scrollTop-ee.clientHeight<=1,tt=async()=>{var ee;if(W>0){D(we=>we+10);return}if(!(!fe||!S))try{const we=await Se.listSessionHooks(e,S,300,(ee=b[0])==null?void 0:ee.id);if(we.length===0){j(!0);return}const Ve=new Set(b.map(Gt=>Gt.id));if(we.filter(Gt=>!Ve.has(Gt.id)).length===0){j(!0);return}we.length<300&&j(!0),v(Gt=>{const Fn=new Set(Gt.map(On=>On.id));return[...we.filter(On=>!Fn.has(On.id)),...Gt]}),D(Gt=>Gt+10)}catch(we){_(we instanceof Error?we.message:String(we))}},Lt=RM({axis:"bottom",getEdge:()=>Je(Q.current),onFire:()=>void tt(),enabled:Oe});y.useEffect(()=>{!S||E||b.length===0||se.length>=10||tt()},[S,se.length,E,b.length]),y.useEffect(()=>{if(!oe||!S||E||b.length===0)return;if(se.length>I){D(se.length);return}const ee=window.setTimeout(()=>{tt()},250);return()=>window.clearTimeout(ee)},[oe,S,E,b.length,se.length,I]);const Mr=(ee,we)=>{const Ve=(F??[]).find(pt=>pt.sessionId===we);L({dispatchId:ee,sessionId:we,sessionLabel:Tn((Ve==null?void 0:Ve.title)??null,we)})},[As,Ms]=y.useState(null),Ma=ee=>{ee.prompt&&Hp(ee.prompt).then(we=>{if(!we){s("error",i("common.copyFailed"));return}Ms(ee.id),window.setTimeout(()=>Ms(null),1500)})},oo=()=>{if(!R)return;const{dispatchId:ee,sessionId:we}=R;L(null),a.run(`dispatch:${ee}`,async()=>{await Se.runHookDispatch(ee,we),await p()},{fail:Ve=>i("tasks.dispatchRunFailed",{error:Xe(Ve)})})},[ci,js]=y.useState(null),co=y.useCallback(ee=>{const we=F==null?void 0:F.find(pt=>pt.sessionId===ee),Ve=we?Tn(we.title,we.sessionId):ee.slice(0,8);js({sessionId:ee,label:Ve})},[F]),ja=()=>{if(!ci)return;const{sessionId:ee}=ci;js(null),a.run(`del:${ee}`,async()=>{const we=await Se.deleteSession(ee);S===ee&&T(null),await p(),s("success",i("toast.sessionDeleted",{n:we.events}))},{fail:we=>i("tasks.deleteFailed",{error:Xe(we)})})},uo=y.useCallback(ee=>a.stateOf(`del:${ee}`),[a]),Pi=u.get(S??"")??"open",mn=F==null?void 0:F.find(ee=>ee.sessionId===S),Oa=lT(Pi,aT(mn==null?void 0:mn.harness)?mn==null?void 0:mn.turnOpen:void 0),Os=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(pD,{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(UD,{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:A,onChange:ee=>M(ee.target.value),placeholder:i("tasks.searchPlaceholder"),className:"h-6 w-full rounded border border-white/[0.08] bg-neutral-900 pl-6 pr-5 text-[11px] text-neutral-200 placeholder:text-neutral-600 focus:border-white/20 focus:outline-none"}),A&&o.jsx("button",{type:"button",onClick:()=>M(""),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"})})]}),z&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:i("tasks.searchMatches",{n:z.length})}),o.jsx("span",{className:"ml-auto text-[10px] text-neutral-600",children:i("tasks.legendNote")})]}),Yt.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:Yt.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:Yt.map(ee=>{var Ve;const we=Qt[ee.id]??((Ve=F==null?void 0:F[0])==null?void 0:Ve.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:ee.prompt,children:ee.prompt}),o.jsx("select",{value:we,onChange:pt=>It(Gt=>({...Gt,[ee.id]:pt.target.value})),className:"shrink-0 rounded border border-white/[0.08] bg-neutral-900 px-1.5 py-0.5 text-[11px] text-neutral-200",children:(F??[]).map(pt=>o.jsx("option",{value:pt.sessionId,children:Tn(pt.title,pt.sessionId)},pt.sessionId))}),o.jsxs("button",{type:"button",disabled:!we||a.stateOf(`dispatch:${ee.id}`)==="loading",onClick:()=>te(ee.id,we),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:a.stateOf(`dispatch:${ee.id}`),className:"h-3 w-3"}),i("tasks.dispatchRun")]})]},ee.id)})})]}),S?B&&b.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(Cn,{className:"h-3.5 w-3.5 animate-spin"}),i("hooks.loading")]}):b.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")}):se.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(Cn,{className:"h-3.5 w-3.5 animate-spin"}),i("tasks.chainCatchUp")]}):z&&z.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:E?i("tasks.searchNoMatch"):o.jsxs(o.Fragment,{children:[o.jsx(Cn,{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:Q,className:"flex min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain pr-1",onScroll:Lt.syncEdge,onWheel:ee=>Lt.wheel(ee.deltaY,ee.deltaMode),onTouchStart:ee=>{var we;return Lt.touchStart(((we=ee.touches[0])==null?void 0:we.clientY)??0)},onTouchMove:ee=>{var we;return Lt.touchMove(((we=ee.touches[0])==null?void 0:we.clientY)??0)},onTouchEnd:Lt.touchEnd,onTouchCancel:Lt.touchEnd,children:o.jsx("div",{className:"flex shrink-0 flex-col gap-1",style:Lt.px>0?{transform:`translateY(-${Lt.px}px)`}:void 0,children:je.map(ee=>{var On,Da;const we=ee.prompt??(ee.preSession?null:((On=ee.events[0])==null?void 0:On.eventType)??ee.id),Ve=ee.events[ee.events.length-1],pt=(Ve==null?void 0:Ve.createdAt)??((Da=ee.dispatches[0])==null?void 0:Da.startedAt),Gt=ge===ee.id,Fn=se.length>0&&ee.id===se[se.length-1].id;return o.jsxs("div",{className:"shrink-0 rounded-lg border border-white/[0.06] bg-white/[0.015]",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>U(Gt?"":ee.id),onKeyDown:Ot=>{(Ot.key==="Enter"||Ot.key===" ")&&(Ot.preventDefault(),U(Gt?"":ee.id))},className:"flex w-full flex-wrap cursor-pointer items-center gap-2 px-2 py-1.5 text-left hover:bg-white/[0.03]",children:[Gt?o.jsx(Pn,{className:"h-3.5 w-3.5 shrink-0 text-neutral-500"}):o.jsx(Un,{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:we??void 0,children:we??""}),ee.preSession&&o.jsx(Ye,{className:"shrink-0 bg-sky-900/40 text-sky-300",children:i("tasks.groupPreSession")}),ee.open&&(Fn&&xl(Pi)?o.jsx(Ye,{className:"shrink-0 bg-emerald-900/40 text-emerald-300",children:i("tasks.groupRunning")}):o.jsx(Ye,{className:"shrink-0 bg-amber-900/40 text-amber-300",children:i("tasks.groupOpen")})),Fn&&Fe(S)&&o.jsx("button",{type:"button",title:i("tasks.answerActiveTooltip",{n:Fe(S).questions.filter(Ot=>!Ot.submit).length}),onClick:Ot=>{Ot.stopPropagation(),G(S)},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")}),ee.questions>0&&o.jsx(Ye,{className:"shrink-0 bg-teal-900/40 text-teal-300",children:i("tasks.groupQuestions",{n:ee.questions})}),ee.subagentStops>0&&o.jsx(Ye,{className:"shrink-0 bg-purple-900/40 text-purple-300",children:i("tasks.groupSubagent",{n:ee.subagentStops})}),ee.agentsDispatched>0&&o.jsx(Ye,{className:"shrink-0 bg-fuchsia-900/40 text-fuchsia-300",children:i("tasks.groupAgents",{n:ee.agentsDispatched})}),pt&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:rr(pt)}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:i("tasks.events",{n:ee.events.length})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:i("tasks.groupDispatches",{n:ee.dispatches.length})}),ee.prompt&&o.jsx("button",{type:"button",title:As===ee.id?i("tasks.copied"):i("tasks.copyPrompt"),onClick:Ot=>{Ot.stopPropagation(),Ma(ee)},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-white/[0.08] bg-white/[0.02] text-neutral-500 transition-colors hover:border-white/[0.16] hover:bg-white/[0.08] hover:text-neutral-200",children:As===ee.id?o.jsx(ii,{className:"h-3 w-3 text-emerald-400"}):o.jsx(Sc,{className:"h-3 w-3"})}),Fn&&ee.open&&xl(Pi)&&o.jsx("span",{className:"shrink-0",children:o.jsx(fa,{harness:x,running:!0})}),Fn&&Oa&&o.jsx("button",{type:"button",title:i("tasks.stopTooltip"),onClick:Ot=>{Ot.stopPropagation(),Ue(S)},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-white/[0.08] bg-white/[0.02] text-neutral-500 transition-colors hover:border-white/[0.16] hover:bg-white/[0.08] hover:text-red-300",children:o.jsx(ut,{state:a.stateOf(`interrupt:${S}`),className:"h-3 w-3",icon:o.jsx(fx,{className:"h-3 w-3"})})})]}),Gt&&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-white/[0.06] p-1.5",children:o.jsxs("div",{className:"relative h-full rounded-md border border-white/[0.04] bg-neutral-950/40",children:[o.jsx(UV,{projectId:e,sessionId:S,harness:x,focusGroupId:ee.id,focusGroup:ee,running:Fn&&xl(Pi),answerable:Fn&&!!Fe(S),onOpenAnswer:()=>G(S)},`${S}:${ee.id}`),o.jsx("p",{className:"pointer-events-none absolute bottom-1 left-2 text-[10px] text-neutral-700",children:i("tasks.legendNote")})]})})]},ee.id)})})}),Oe&&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:Lt.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 tt(),className:"rounded-md border border-white/[0.1] bg-neutral-900/90 px-2 py-0.5 text-[11px] text-neutral-200 transition-colors hover:bg-neutral-800",children:W>0?i("tasks.loadOlder",{n:Math.min(10,W)}):i("tasks.loadOlderEvents")}),o.jsx("button",{type:"button",onClick:()=>D(ee=>ee+se.length),className:"rounded-md border border-white/[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")})]});return o.jsxs("div",{className:"flex flex-col lg:flex-row h-full min-h-0 gap-3",children:[o.jsxs("aside",{className:"flex w-full lg:w-72 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-white/[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:F===null?i("hooks.loading"):String(F.length)}),o.jsxs("button",{type:"button",disabled:!Ae||Me,title:Me?i("tasks.newSessionStarting"):be.length===0?i("tasks.newSessionNoHarness"):i("tasks.newSessionTip"),onClick:Ie,className:ye("inline-flex items-center gap-1 rounded-md border border-white/[0.1] bg-neutral-900/90 px-2 py-0.5 text-[11px] transition-colors",Ae?"text-neutral-200 hover:bg-neutral-800":"cursor-not-allowed text-neutral-600",Me&&"cursor-progress opacity-70 hover:bg-neutral-900/90"),children:[o.jsx(ut,{state:a.stateOf(`newSession:${e}`),className:"h-3 w-3",icon:o.jsx(wp,{className:"h-3 w-3"})}),i("tasks.newSession")]}),o.jsx(yy,{className:"ml-auto",title:i("tasks.refresh"),onClick:async()=>{const ee=await p();s(ee?"error":"success",ee??i("tasks.refreshed"))}})]}),N&&o.jsx("p",{className:"rounded border border-red-500/30 bg-red-950/30 px-2 py-1 text-[11px] text-red-300",children:N}),F===null?o.jsx(Bp,{rows:8,className:"p-0"}):F.length===0?o.jsx("p",{className:"text-xs text-neutral-600",children:i("tasks.emptySessions")}):o.jsx(UH,{sessions:F,statuses:u,selectedId:S,highlightId:P,onSelect:ee=>{T(ee),h||k(!0)},onRename:(ee,we)=>void re(ee,we),onDropDispatch:Mr,onOpenTerminal:qe,openTerminalStateOf:gt,capabilities:V===null?null:Ne,onOpenMessages:St,inflightOf:He,questionOf:Fe,onAnswer:dt,answerStateOf:st,answerFor:$,onSetAnswerFor:G,watchOf:de,watchStateOf:Ke,onSubscribeWatch:Z,onUnwatch:ae,onDelete:co,deleteStateOf:uo})]}),h&&Os,!h&&g&&S&&o.jsx("div",{className:"fixed inset-0 z-40",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-white/[0.06] frosted",children:[o.jsx("span",{className:"truncate text-sm font-semibold text-neutral-200",children:Tn((mn==null?void 0:mn.title)??null,S)}),(mn==null?void 0:mn.harness)&&o.jsx("span",{className:"shrink-0",children:o.jsx(fa,{harness:mn.harness})}),o.jsx("button",{onClick:()=>k(!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:Os})]})}),R&&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-white/[0.1] bg-neutral-900 p-4 shadow-xl",children:[o.jsx("p",{className:"text-sm text-neutral-200",children:i("hooks.runConfirm",{id:R.dispatchId,session:R.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-white/[0.06]",children:i("hooks.cancel")}),o.jsx("button",{type:"button",onClick:oo,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(so,{open:ci!==null,title:i("tasks.deleteSession"),message:ci?i("tasks.deleteConfirm",{id:ci.label}):"",confirmLabel:i("common.confirm"),onConfirm:ja,onClose:()=>js(null)}),Le&&o.jsx(NV,{targets:Le.targets,busy:a.stateOf(`openTerm:${Le.sessionId}`)==="loading",onPick:ee=>{const{sessionId:we}=Le;$e(null),ie(we,ee)},onClose:()=>$e(null)}),Ce&&o.jsx(_V,{harnesses:be,onPick:ee=>{xe(!1),he(ee)},onClose:()=>xe(!1)}),ft&&o.jsx(IM,{sessionId:ft.sessionId,projectId:ft.projectId,label:ft.label,projectLabel:n,capability:ft.capability,answerPending:!!Fe(ft.sessionId),onOpenAnswer:()=>G(ft.sessionId),onInterrupt:Ue,interruptStateOf:at,onClose:()=>Dt(null)},ft.sessionId)]})}const WV=["all","today","1d","3d","7d","30d","over30","custom"],ZV={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 QV(e,t){const n=new Map(e.map(s=>[s.sessionId,s])),r=[];for(const s of t){const a=n.get(s);a&&r.push(a)}const i=new Set(r.map(s=>s.sessionId));return[...e.filter(s=>!i.has(s.sessionId)),...r]}function JV({projects:e,onOpenSession:t}){const n=We(),{show:r}=Zt(),{sessions:i,statuses:s,error:a,refresh:l}=fu(),[c,u]=y.useState("all"),[d,f]=y.useState("all"),[p,h]=y.useState(""),[g,k]=y.useState(""),w=y.useMemo(()=>{const N=i??[],_=Date.now(),R=new Date;return R.setHours(0,0,0,0),N.filter(L=>{if(c!=="all"&&L.projectId!==c)return!1;const C=Date.parse(L.lastSeenAt);switch(d){case"today":return C>=R.getTime();case"1d":return C>=_-864e5;case"3d":return C>=_-3*864e5;case"7d":return C>=_-7*864e5;case"30d":return C>=_-30*864e5;case"over30":return C<_-30*864e5;case"custom":{if(p){const U=Date.parse(`${p}T00:00:00`);if(Number.isFinite(U)&&C<U)return!1}if(g){const U=Date.parse(`${g}T23:59:59.999`);if(Number.isFinite(U)&&C>U)return!1}return!0}default:return!0}})},[i,c,d,p,g]),m=`${c}|${d}|${p}|${g}`,b=y.useMemo(()=>w.slice().sort(bA).map(N=>N.sessionId),[w]),v=xA(b,m),S=y.useMemo(()=>{const N=new Map(e.map(_=>[_.id,_.name]));return QV(w,v).map(_=>({session:_,projectName:_.projectId==null?n("tasks.overviewUnknownProject"):N.get(_.projectId)??n("tasks.overviewUnknownProject")}))},[w,v,e,n]),T=y.useRef(new Map);return yA(T),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qs,{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:i===null?n("hooks.loading"):w.length===((i==null?void 0:i.length)??0)?String(w.length):`${w.length} / ${(i==null?void 0:i.length)??0}`}),o.jsx(yy,{className:"ml-auto",title:n("tasks.refresh"),onClick:async()=>{const N=await l();r(N?"error":"success",N??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:N=>u(N.target.value===""?"all":Number(N.target.value)),className:"rounded-md border border-white/[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(N=>o.jsx("option",{value:String(N.id),children:N.name},N.id))]}),o.jsx("span",{className:"flex overflow-hidden rounded-md border border-white/[0.08]",children:WV.map(N=>o.jsx("button",{type:"button",onClick:()=>f(N),className:ye("px-2 py-1 text-[11px] transition-colors",d===N?"bg-neutral-800 text-neutral-100":"text-neutral-500 hover:bg-neutral-800/50"),children:n(ZV[N])},N))}),d==="custom"&&o.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-neutral-500",children:[o.jsx("input",{type:"date",value:p,onChange:N=>h(N.target.value),"aria-label":n("tasks.rangeFrom"),className:"rounded-md border border-white/[0.08] bg-neutral-900 px-1.5 py-0.5 text-[11px] text-neutral-200"}),"—",o.jsx("input",{type:"date",value:g,onChange:N=>k(N.target.value),"aria-label":n("tasks.rangeTo"),className:"rounded-md border border-white/[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}),i===null?o.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-neutral-600",children:[o.jsx(Cn,{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:N,projectName:_})=>{const R=s.get(N.sessionId)??"open",L=N.projectId!=null;return o.jsx("li",{ref:C=>{C?T.current.set(N.sessionId,C):T.current.delete(N.sessionId)},children:o.jsxs("div",{role:L?"button":void 0,tabIndex:L?0:void 0,onClick:L?()=>t(N.projectId,N.sessionId):void 0,onKeyDown:L?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),t(N.projectId,N.sessionId))}:void 0,title:L?N.sessionId:void 0,className:ye("flex flex-wrap lg:flex-nowrap items-center gap-3 rounded-md border px-2 py-1.5",L?"cursor-pointer border-white/[0.06] bg-white/[0.015] hover:bg-white/[0.04]":"border-white/[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:_,children:_}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-neutral-200",children:Tn(N.title,N.sessionId)}),N.harness&&o.jsx($r,{agent:N.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(Vx,{status:R,harness:N.harness}),o.jsx("span",{className:ye("text-[10px]",cT[R].split(" ")[1]),children:n(oT[R])})]}),o.jsx("span",{className:"hidden lg:block w-16 shrink-0 text-right text-[10px] text-neutral-500",children:n("tasks.events",{n:N.eventCount??0})}),o.jsx("span",{className:"hidden lg:block w-16 shrink-0 text-right text-[10px] text-neutral-500",children:rr(N.lastSeenAt)}),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:N.eventCount??0})}),o.jsx("span",{children:rr(N.lastSeenAt)})]})]})},N.sessionId)})})]})]})}const eX=92,Q1=380,tX=56;function J1(e){return e!=null&&qt.includes(e)?qt.indexOf(e):qt.length}function nX(e){const t=new Map;for(const l of e){const c=J1(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),r=new Map(n.map((l,c)=>[l,c])),i=n.map((l,c)=>({harness:t.get(l).harness,x:c*Q1,count:t.get(l).count})),s=i.map(()=>0),a=[];for(const l of e){const c=r.get(J1(l.harness))??0,u=s[c];s[c]=u+1;const d={key:`s:${l.sessionId}`,session:l,lane:c,row:u,x:c*Q1,y:tX+u*eX};a.push(d)}return{nodes:a,lanes:i}}const rX={running:"tasks.statusRunning",failed:"tasks.statusFailed",done:"orch.seqDone",cancelled:"orch.seqCancelled"},iX={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"},sX={prompt:"tasks.msgModePrompt",auto:"tasks.msgModeAuto",inject:"tasks.msgModeInject",headless:"tasks.msgModeHeadless"},aX={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 lX({data:e}){const t=We(),{session:n,status:r,capable:i,received:s,onOpenMessages:a}=e;return o.jsxs("div",{className:ye("flex w-[260px] items-center gap-2 rounded-lg border border-white/[0.08] bg-neutral-900/95 px-2 py-1.5 shadow-mac transition-colors",i?"cursor-pointer hover:border-blue-500/40":"cursor-default"),onClick:()=>i&&a(n.sessionId),title:i?t("tasks.messageTooltip"):n.sessionId,children:[o.jsx(kn,{type:"target",id:"l",position:Ge.Left,style:{visibility:"hidden"}}),o.jsx(kn,{type:"source",id:"r",position:Ge.Right,style:{visibility:"hidden"}}),o.jsx(Vx,{status:r,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:Tn(n.title,n.sessionId)}),o.jsx("span",{className:"block truncate text-[10px] text-neutral-500",children:t("orch.received",{n:s})})]}),i&&o.jsx(NC,{className:"h-3 w-3 shrink-0 text-teal-400/70"})]})}function oX({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-white/[0.1] pb-1.5",children:[o.jsx(fa,{harness:n.harness}),o.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-neutral-400",children:n.harness==null?t("orch.unknownLane"):An(n.harness).label}),o.jsx("span",{className:"text-[10px] text-neutral-600",children:t("catbar.items",{n:n.count})})]})}const cX={seqSession:lX,seqLane:oX};function uX({projectId:e,projectLabel:t}){const n=We(),r=cn(),{show:i}=Zt(),{sessions:s,statuses:a}=fu(),l=y.useMemo(()=>s===null?null:s.filter(K=>K.projectId===e),[s,e]),c=y.useMemo(()=>(l??[]).map(K=>K.sessionId).sort().join(","),[l]),u=y.useRef(null);u.current=l;const[d,f]=y.useState(null);y.useEffect(()=>{Se.messagingCapabilities().then(f).catch(()=>{})},[]);const p=y.useMemo(()=>{const K=new Map;for(const q of d??[])K.set(q.harness,q);return K},[d]),h=y.useCallback(K=>{var V;const q=(V=u.current)==null?void 0:V.find(ue=>ue.sessionId===K);return(q==null?void 0:q.harness)!=null?p.get(q.harness):void 0},[p]),g=y.useCallback(K=>{r.run(`interrupt:${K}`,async()=>{await Se.interruptSession(K),i("success",n("tasks.stopOk"))},{fail:q=>n("tasks.stopFail",{error:Xe(q)})})},[r,n,i]),k=y.useCallback(K=>r.stateOf(`interrupt:${K}`),[r]),[w,m]=y.useState(null),b=y.useCallback(async()=>{const K=u.current;if(K)try{const q=new Map;await Promise.all(K.map(async V=>{q.set(V.sessionId,await Se.listSessionMessages(V.sessionId))})),m(q)}catch{}},[]);y.useEffect(()=>{m(null),b()},[b,c]);const[v,S]=y.useState(null),T=y.useCallback(()=>{Se.listSessionSequences().then(S).catch(()=>{})},[]);y.useEffect(()=>{T()},[T,c]);const N=y.useMemo(()=>{if(!v)return null;const K=new Set((l??[]).map(q=>q.sessionId));return v.filter(q=>q.steps.some(V=>K.has(V.to)))},[v,l]),_=y.useMemo(()=>{const K=new Map;for(const q of(w==null?void 0:w.values())??[])for(const V of q)K.set(V.id,V);return K},[w]);y.useEffect(()=>{let K=null,q=null;const V=ue=>{const me=ue.detail??{},Ne=me.kind??"";if(Ne.startsWith("message.")){if(!(!me.sessionId||(u.current??[]).some(ne=>ne.sessionId===me.sessionId)))return;K!==null&&window.clearTimeout(K),K=window.setTimeout(()=>{K=null,b()},500)}else Ne.startsWith("sequence.")&&(q!==null&&window.clearTimeout(q),q=window.setTimeout(()=>{q=null,T()},500))};return window.addEventListener("weave:hook",V),()=>{window.removeEventListener("weave:hook",V),K!==null&&window.clearTimeout(K),q!==null&&window.clearTimeout(q)}},[b,T]);const R=y.useMemo(()=>nX(l??[]),[l]),L=y.useMemo(()=>{let K=0;for(const q of(w==null?void 0:w.values())??[])K+=q.length;return K},[w]),C=y.useCallback(K=>{var ue;const q=(ue=u.current)==null?void 0:ue.find(me=>me.sessionId===K),V=(q==null?void 0:q.harness)!=null?p.get(q.harness):void 0;!q||!V||J({sessionId:K,projectId:q.projectId??e,label:Tn(q.title,K),capability:V})},[p,e]),U=y.useMemo(()=>{const K=R.lanes.map((V,ue)=>({id:`lane:${ue}`,type:"seqLane",position:{x:V.x,y:0},data:{lane:V},draggable:!1,selectable:!1})),q=R.nodes.map(V=>{const ue=V.session,me=ue.harness!=null?p.get(ue.harness):void 0,Ne=w==null?void 0:w.get(ue.sessionId);return{id:V.key,type:"seqSession",position:{x:V.x,y:V.y},data:{session:ue,status:a.get(ue.sessionId)??"open",capable:!!me&&(me.inject||me.headless),received:(Ne==null?void 0:Ne.length)??0,onOpenMessages:C},draggable:!0}});return[...K,...q]},[R,p,a,w,C]),[$,G]=y.useState(""),[I,D]=y.useState([{to:"",text:"",mode:"auto"}]),A=y.useMemo(()=>(l??[]).filter(K=>{if(K.harness==null)return!1;const q=p.get(K.harness);return!!q&&(q.prompt||q.inject||q.headless)}),[l,p]),M=A.map(K=>K.sessionId).join(",");y.useEffect(()=>{const K=new Set(M?M.split(","):[]);D(q=>q.some(V=>V.to!==""&&!K.has(V.to))?q.map(V=>V.to!==""&&!K.has(V.to)?{to:"",text:V.text,mode:"auto"}:V):q)},[M]);const P=(K,q)=>{D(V=>V.map((ue,me)=>me===K?{...ue,...q}:ue))},H=(K,q)=>{const V=q?h(q):void 0;D(ue=>ue.map((me,Ne)=>Ne!==K?me:me.mode==="auto"||me.mode==="prompt"&&!!(V!=null&&V.prompt)||me.mode==="inject"&&!!(V!=null&&V.inject)||me.mode==="headless"&&!!(V!=null&&V.headless)?{...me,to:q}:{...me,to:q,mode:"auto"}))},E=I.length>0&&I.every(K=>K.to!==""&&K.text.trim()!==""),j=()=>{E&&r.run("seq:create",async()=>{await Se.createSequence({name:$.trim()||void 0,steps:I.map(K=>({to:K.to,text:K.text.trim(),mode:K.mode}))}),G(""),D([{to:"",text:"",mode:"auto"}]),await Promise.all([T(),b()])},{fail:K=>n("orch.triggerFailed",{error:Xe(K)})})},B=K=>{r.run(`seqCancel:${K}`,async()=>{await Se.cancelSequence(K),await T()},{fail:q=>n("orch.seqCancelFailed",{error:Xe(q)})})},[O,Q]=y.useState(null),[F,J]=y.useState(null),ce=K=>{const q=(l??[]).find(V=>V.sessionId===K);return Tn((q==null?void 0:q.title)??null,K)};return o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(l0,{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:w===null?n("hooks.loading"):n("orch.messages",{n:L})}),o.jsx(yy,{className:"ml-auto",title:n("tasks.refresh"),onClick:()=>{b(),T()}})]}),o.jsxs("div",{className:"relative h-[420px] rounded-lg border border-white/[0.06] bg-neutral-950/40",children:[l===null?o.jsx("p",{className:"flex h-full items-center justify-center text-xs text-neutral-500",children:n("hooks.loading")}):l.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(Gx,{nodes:U,nodeTypes:cX,fitView:!0,fitViewOptions:{maxZoom:1,padding:.12},minZoom:.15,maxZoom:1.5,nodesDraggable:!0,nodesConnectable:!1,deleteKeyCode:null,children:[o.jsx(Kx,{gap:14,size:1,color:"rgba(255,255,255,0.06)"}),o.jsx(qx,{showInteractive:!1})]}),o.jsx("p",{className:"pointer-events-none absolute bottom-1 left-2 text-[10px] text-neutral-700",children:n("orch.hint")})]}),o.jsxs("div",{className:"rounded-lg border border-white/[0.06] bg-white/[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")})]}),A.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:$,onChange:K=>G(K.target.value),placeholder:n("orch.namePlaceholder"),className:"w-56 rounded border border-white/[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"}),I.map((K,q)=>{const V=K.to?h(K.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:q+1}),o.jsxs("select",{value:K.to,onChange:ue=>H(q,ue.target.value),title:n("orch.stepTarget"),className:"shrink-0 rounded border border-white/[0.08] bg-neutral-900 px-1.5 py-1 text-[11px] text-neutral-200",children:[o.jsxs("option",{value:"",children:[n("orch.stepTarget"),"…"]}),A.map(ue=>o.jsx("option",{value:ue.sessionId,children:Tn(ue.title,ue.sessionId)},ue.sessionId))]}),o.jsxs("select",{value:K.mode,onChange:ue=>P(q,{mode:ue.target.value}),title:n("orch.stepMode"),className:"shrink-0 rounded border border-white/[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")}),(V==null?void 0:V.prompt)&&o.jsx("option",{value:"prompt",children:n("tasks.msgModePromptHint")}),(V==null?void 0:V.inject)&&o.jsx("option",{value:"inject",children:n("tasks.msgModeInjectHint")}),(V==null?void 0:V.headless)&&o.jsx("option",{value:"headless",children:n("tasks.msgModeHeadlessHint")})]}),o.jsx("input",{value:K.text,onChange:ue=>P(q,{text:ue.target.value}),onKeyDown:ue=>{ue.key==="Enter"&&(ue.preventDefault(),j())},placeholder:n("orch.stepText"),className:"min-w-[12rem] flex-1 rounded border border-white/[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"}),I.length>1&&o.jsx("button",{type:"button",title:n("orch.removeStep"),onClick:()=>D(ue=>ue.filter((me,Ne)=>Ne!==q)),className:"shrink-0 rounded p-1 text-neutral-500 transition-colors hover:bg-white/[0.08] hover:text-neutral-200",children:o.jsx(tn,{className:"h-3 w-3"})})]},q)}),o.jsxs("div",{className:"flex items-center gap-2 pt-0.5",children:[o.jsxs("button",{type:"button",disabled:I.length>=3,onClick:()=>D(K=>K.length>=3?K:[...K,{to:"",text:"",mode:"auto"}]),className:"inline-flex items-center gap-1 rounded-md border border-white/[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(wp,{className:"h-3 w-3"}),n("orch.addStep")]}),o.jsxs("button",{type:"button",disabled:!E||r.stateOf("seq:create")==="loading",onClick:j,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(l0,{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:N===null?"":String(N.length)})]}),N===null?o.jsx("p",{className:"text-xs text-neutral-600",children:n("hooks.loading")}):N.length===0?o.jsx("p",{className:"text-xs text-neutral-600",children:n("orch.seqEmpty")}):o.jsx("ul",{className:"space-y-1.5",children:N.map(K=>{const q=O===K.id,V=K.steps.length,ue=K.status==="done"?V:Math.min(K.cursor+1,V);return o.jsxs("li",{className:"rounded-lg border border-white/[0.06] bg-white/[0.015]",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>Q(q?null:K.id),onKeyDown:me=>{(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),Q(q?null:K.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-white/[0.03]",children:[o.jsx(Ye,{className:ye("shrink-0",iX[K.status]),children:n(rX[K.status])}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-neutral-200",title:K.name||`#${K.id}`,children:K.name||n("orch.seqNameFallback",{id:K.id})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-500",children:n("orch.seqProgress",{cur:ue,n:V})}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:rr(K.createdAt)}),K.status==="running"&&o.jsx("button",{type:"button",onClick:me=>{me.stopPropagation(),B(K.id)},disabled:r.stateOf(`seqCancel:${K.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")})]}),K.error&&o.jsx("p",{className:"break-words border-t border-white/[0.04] px-2 py-1 text-[11px] text-red-400/80",children:K.error}),q&&o.jsx("ul",{className:"space-y-1 border-t border-white/[0.04] px-2 py-1.5",children:K.steps.map((me,Ne)=>{const Te=me.messageId!=null?_.get(me.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:Ne+1}),o.jsx("span",{className:"shrink-0 truncate text-[11px] text-neutral-300",children:ce(me.to)}),o.jsx(Ye,{className:"shrink-0 bg-neutral-800 text-neutral-400",children:n(sX[me.mode])}),o.jsx(Ye,{className:ye("shrink-0",Te?Te.status==="succeeded"?"bg-emerald-900/40 text-emerald-300":Te.status==="failed"||Te.status==="timeout"?"bg-red-900/40 text-red-300":"bg-sky-900/40 text-sky-300":"bg-neutral-900 text-neutral-500"),children:n(Te?aX[Te.status]:"orch.seqStepPending")}),o.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] text-neutral-500",title:me.text,children:me.text})]},Ne)})})]},K.id)})})]}),F&&o.jsx(IM,{sessionId:F.sessionId,projectId:F.projectId,label:F.label,projectLabel:t,capability:F.capability,onInterrupt:g,interruptStateOf:k,onClose:()=>J(null)},F.sessionId)]})}const dX=[{key:"packs",label:"assetView.packs"},{key:"files",label:"assetView.files"}];function W0(e){return e.filter(t=>!t.pluginKey)}function fX(e,t,n){return(n?Tc(W0(n)).effective:e.length)+t.filter(i=>i.effective!==!1).length}function pX({title:e,note:t,tag:n,children:r}){const i=We(),[s,a]=y.useState(!1);return o.jsxs("section",{className:"rounded-xl border border-white/[0.06] bg-neutral-900/40",children:[o.jsxs("button",{type:"button",onClick:()=>a(l=>!l),title:i(s?"common.collapse":"common.expand"),className:"flex w-full items-center gap-1.5 px-3 py-2 text-left [&_svg]:pointer-events-none",children:[s?o.jsx(Pn,{className:"h-3 w-3 text-neutral-500"}):o.jsx(Un,{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})]}),s&&o.jsx("div",{className:"space-y-2 px-3 pb-3",children:r})]})}const hX=[...qt,"all"],mX={global:["user"],project:["project","local"]};function gX({projectId:e,mode:t,category:n,resourceView:r,onResourceViewChange:i,statuslineNonce:s,assets:a,globalAssets:l,mcpRows:c,updates:u,globalSkillGroups:d,pluginRows:f,statuslineSource:p,onUninstallSkill:h,onUninstallMcp:g,onCycleMcpEnable:k,onCyclePluginState:w,onUninstallPlugin:m,onOpenFile:b,onOpenSkillDetail:v,projects:S,onOpenSession:T,initialSessionId:N,dragPayload:_}){var J,ce,K;const{setNodeRef:R,isOver:L}=ux({id:"project-assets"}),C=t==="global",U=C?"user":"project",$=We(),G=_?gl(_.attrs,{scope:U,agent:_.targetAgent}):null,I=_!==null&&G!==null&&!G.ok,[D,A]=y.useState(qt[0]??"claude"),M=n==="files"||n==="personalization",P=y.useMemo(()=>C?[]:oL(a).filter(q=>D==="all"||q.agent===D),[C,D,a]),H=y.useMemo(()=>(D==="all"?d:d.filter(V=>V.source.startsWith(D))).map(V=>{const ue=uu(V.source),me=le=>le.harness===ue&&le.key===V.pluginKey,Ne=V.pluginKey&&ue?f.filter(me):[],Te=V.pluginKey&&ue?Ne.some(le=>le.effective):void 0,ne=mX[t],pe=Ne.filter(le=>ne.includes(le.scope)&&le.enable!==null).map(le=>({scope:le.scope,enable:le.enable,installScopes:le.installScopes}));return{label:V.label,source:V.source,pluginKey:V.pluginKey,namespace:V.namespace,enabled:Te,installSurface:V.pluginKey&&ue?Ne.some(le=>le.installScopes.length>0):void 0,...pe.length>0?{scopeStates:pe}:{},skills:V.skills.map(le=>({name:le.name,scope:"user",files:[],source:V.source,pluginKey:V.pluginKey,form:le.form,...ue?{agent:ue}:{}}))}}),[t,d,f,D]),E=y.useMemo(()=>{const q=V=>{const ue=c.filter(Ne=>Ne.harness===V);if(ue.length===0)return[];const me=ue[0].installScopes.includes(U)?U:ue[0].installScopes[0];return ue.filter(Ne=>Ne.scope===me)};return D==="all"?qt.flatMap(q):q(D)},[c,U,D]),j=u==null?void 0:u.skills.filter(q=>q.scope===U),B=u==null?void 0:u.mcp.filter(q=>{const V=q.agent&&q.agent!=="claude"?q.agent:null;return V?D==="all"||D===V:q.scope===U&&(D==="all"||D==="claude")}),O=u==null?void 0:u.files.filter(q=>q.scope===U),Q=y.useMemo(()=>a.filter(q=>D==="all"||q.agent===D),[a,D]),F=y.useMemo(()=>l.filter(q=>D==="all"||q.agent===D),[l,D]);return o.jsxs("div",{ref:R,className:ye("space-y-4 h-full px-2 pt-2",I?"ring-1 ring-red-500/60 rounded-md -m-2 bg-red-950/20 cursor-not-allowed":L&&"ring-1 ring-blue-500/60 rounded-md -m-2 bg-blue-950/20"),children:[M&&o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/60 border border-white/[0.06] p-0.5 w-fit",children:hX.map(q=>o.jsx("button",{onClick:()=>A(q),className:ye("rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",D===q?"bg-neutral-800 text-neutral-100 shadow-mac-sm":"text-neutral-500 hover:text-neutral-300"),title:q==="all"?$("category.tabAllTip"):$("category.tabToolTip",{tool:An(q).tooltip}),children:q==="all"?$("category.tabAll"):An(q).label},q))}),n==="files"&&o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/60 border border-white/[0.06] p-0.5 w-fit",children:dX.map(q=>o.jsx("button",{onClick:()=>i(q.key),className:ye("rounded-md px-2.5 py-1 text-xs font-medium transition-colors duration-150",r===q.key?"bg-neutral-800 text-neutral-100 shadow-mac-sm":"text-neutral-500 hover:text-neutral-300"),children:$(q.label)},q.key))}),n==="files"&&r==="files"&&!C&&(Q.length===0?D!=="claude"&&D!=="all"?o.jsx(eS,{harness:D,text:D==="codex"?$("category.codexFilesPlaceholder"):$("category.emptyFilesOtherHarness",{harness:An(D).label})}):o.jsxs("div",{className:"rounded-xl border border-dashed border-white/[0.1] bg-neutral-900/40 p-8 flex flex-col items-center justify-center text-center gap-3",children:[o.jsx(s0,{className:"h-8 w-8 text-neutral-600"}),o.jsx("p",{className:"text-xs text-neutral-500",children:$("category.emptyFilesProject")})]}):o.jsx(zk,{scope:U,assets:Q,updates:O,onOpenFile:b})),n==="files"&&r==="files"&&C&&(F.length===0?o.jsxs("div",{className:"rounded-xl border border-dashed border-white/[0.1] bg-neutral-900/40 p-8 flex flex-col items-center justify-center text-center gap-3",children:[o.jsx(s0,{className:"h-8 w-8 text-neutral-600"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-neutral-300",children:$("category.globalFilesTitle")}),o.jsx("p",{className:"text-xs text-neutral-500 mt-1 max-w-xs",children:$("category.emptyFilesGlobalDesc")})]})]}):o.jsx(zk,{scope:U,assets:F,updates:O,onOpenFile:b})),n==="files"&&r==="packs"&&o.jsxs(o.Fragment,{children:[o.jsx(NH,{projectId:e,mode:t,runtimeTab:D}),o.jsxs(pX,{title:$("category.externalAssets"),note:$("category.externalAssetsNote"),tag:o.jsx(Mc,{tone:Ac(fX(P,E,C?H:void 0),P.length+E.length),children:$("category.externalAssetsSummary",{skills:P.length,mcp:E.length})}),children:[o.jsx(aL,{skills:P,groups:C?W0(H):void 0,globalGroupsReadOnly:C?void 0:W0(H),updates:j,empty:$(D==="codex"?C?"category.emptySkillsGlobalCodex":"category.emptySkillsProjectCodex":C?"category.emptySkillsGlobal":"category.emptySkillsProject"),onUninstallSkill:h,onOpenDetail:v,onCyclePluginState:w,onUninstallPlugin:m}),o.jsx(dL,{rows:E,scope:U,updates:B,empty:$(D==="codex"?"category.emptyMcpCodex":C?"category.emptyMcpGlobal":"category.emptyMcpProject"),onUninstallMcp:g,onCycleMcpEnable:k})]})]}),n==="weave"&&o.jsx(vH,{projectId:e,mode:t}),n==="tasks"&&(C?o.jsx(JV,{projects:S,onOpenSession:T}):o.jsx(XV,{projectId:e,initialSessionId:N,projectLabel:((J=S.find(q=>q.id===e))==null?void 0:J.name)??"",harnesses:((ce=S.find(q=>q.id===e))==null?void 0:ce.harnesses)??[]})),n==="orchestrate"&&(C?o.jsx("p",{className:"pt-6 text-center text-xs text-neutral-600",children:$("orch.globalHint")}):o.jsx(uX,{projectId:e,projectLabel:((K=S.find(q=>q.id===e))==null?void 0:K.name)??""})),n==="personalization"&&(D==="claude"||D==="all")&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("p",{className:"text-[11px] text-neutral-500",children:[$(C?"category.personalizationGlobal":"category.personalizationProject"),p&&o.jsx("span",{className:"ml-2",children:$("category.statuslineSource",{source:$(p==="custom"?"category.statuslineCustom":"category.statuslineFollowGlobal")})})]}),o.jsx(IL,{projectId:e,initialTab:C?"global":"project"},`${e}-${C?"global":"project"}-${s}`)]}),n==="personalization"&&D!=="claude"&&o.jsx(eS,{harness:D==="all"?"codex":D,text:D==="all"||D==="codex"?$("category.codexPersonalizationPlaceholder"):$("category.personalizationUnsupported",{harness:An(D).label})}),I&&(G==null?void 0:G.reasonKey)&&o.jsx("p",{className:"text-xs text-red-300",children:$(G.reasonKey)}),!I&&L&&o.jsx("p",{className:"text-xs text-blue-300",children:$("category.dropToInstall")})]})}function eS({harness:e,text:t}){return o.jsxs("div",{className:"rounded-xl border border-dashed border-white/[0.1] bg-neutral-900/40 p-8 flex flex-col items-center justify-center text-center gap-3",children:[o.jsx(kD,{className:"h-8 w-8 text-neutral-600"}),o.jsx($r,{agent:e}),o.jsx("p",{className:"text-xs text-neutral-500 max-w-xs",children:t})]})}const tS=function(e,t,n){const r=wu(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(r(e.children[t],t,e))return e.children[t]},Ta=function(e){if(e==null)return yX;if(typeof e=="string")return xX(e);if(typeof e=="object")return bX(e);if(typeof e=="function")return ky(e);throw new Error("Expected function, string, or array as `test`")};function bX(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ta(e[n]);return ky(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function xX(e){return ky(t);function t(n){return n.tagName===e}}function ky(e){return t;function t(n,r,i){return!!(vX(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function yX(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function vX(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const nS=/\n/g,rS=/[\t ]+/g,Z0=Ta("br"),iS=Ta(TX),kX=Ta("p"),sS=Ta("tr"),wX=Ta(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",CX,AX]),FM=Ta(["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 SX(e,t){const n=t||{},r="children"in e?e.children:[],i=FM(e),s=KM(e,{whitespace:n.whitespace||"normal"}),a=[];(e.type==="text"||e.type==="comment")&&a.push(...GM(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<r.length;)a.push(...$M(r[l],e,{whitespace:s,breakBefore:l?void 0:i,breakAfter:l<r.length-1?Z0(r[l+1]):i}));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(`
519
- `.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function $M(e,t,n){return e.type==="element"?EX(e,t,n):e.type==="text"?n.whitespace==="normal"?GM(e,n):NX(e):[]}function EX(e,t,n){const r=KM(e,n),i=e.children||[];let s=-1,a=[];if(wX(e))return a;let l,c;for(Z0(e)||sS(e)&&tS(t,e,sS)?c=`
520
- `:kX(e)?(l=2,c=2):FM(e)&&(l=1,c=1);++s<i.length;)a=a.concat($M(i[s],e,{whitespace:r,breakBefore:s?void 0:l,breakAfter:s<i.length-1?Z0(i[s+1]):c}));return iS(e)&&tS(t,e,iS)&&a.push(" "),l&&a.unshift(l),c&&a.push(c),a}function GM(e,t){const n=String(e.value),r=[],i=[];let s=0;for(;s<=n.length;){nS.lastIndex=s;const c=nS.exec(n),u=c&&"index"in c?c.index:n.length;r.push(_X(n.slice(s,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),s=u+1}let a=-1,l;for(;++a<r.length;)r[a].charCodeAt(r[a].length-1)===8203||a<r.length-1&&r[a+1].charCodeAt(0)===8203?(i.push(r[a]),l=void 0):r[a]?(typeof l=="number"&&i.push(l),i.push(r[a]),l=0):(a===0||a===r.length-1)&&i.push(0);return i}function NX(e){return[String(e.value)]}function _X(e,t,n){const r=[];let i=0,s;for(;i<e.length;){rS.lastIndex=i;const a=rS.exec(e);s=a?a.index:e.length,!i&&!s&&a&&!t&&r.push(""),i!==s&&r.push(e.slice(i,s)),i=a?s+a[0].length:s}return i!==s&&!n&&r.push(""),r.join(" ")}function KM(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 CX(e){return!!(e.properties||{}).hidden}function TX(e){return e.tagName==="td"||e.tagName==="th"}function AX(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function MX(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[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]},p={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["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"],m=["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:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},T={className:"function.dispatch",relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[T,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:N.concat([{begin:/\(/,end:/\)/,keywords:S,contains:N.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:h,returnBegin:!0,contains:[p],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(_,R,T,N,[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 jX(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=MX(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function OX(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=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,i]};i.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]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),g={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"],m={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],v=["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"],T=["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:[...b,...v,"set","shopt",...S,...T]},contains:[h,e.SHEBANG(),g,f,s,a,m,l,c,u,d,n]}}function RX(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(i)+"[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]},p={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+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"},m=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:m.concat([{begin:/\(/,end:/\)/,keywords:w,contains:m.concat(["self"]),relevance:0}]),relevance:0},v={begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:h,returnBegin:!0,contains:[e.inherit(p,{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(b,v,m,[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 DX(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[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]},p={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},h=t.optional(i)+e.IDENT_RE+"\\s*\\(",g=["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"],m=["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:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},T={className:"function.dispatch",relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[T,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:N.concat([{begin:/\(/,end:/\)/,keywords:S,contains:N.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+a+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:h,returnBegin:!0,contains:[p],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(_,R,T,N,[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 IX(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"],r=["default","false","null","true"],i=["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"],s=["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:i.concat(s),built_in:t,literal:r},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/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:a},h=e.inherit(p,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,h]},k={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},w=e.inherit(k,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]});p.contains=[k,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],h.contains=[w,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const m={variants:[u,k,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},v=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"}},m,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,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,b,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:"("+v+"\\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,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[m,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},S]}}const LX=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_-]*/}}),zX=["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"],PX=["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"],UX=[...zX,...PX],BX=["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(),HX=["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(),FX=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$X=["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 GX(e){const t=e.regex,n=LX(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\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,r,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:":("+HX.join("|")+")"},{begin:":(:)?("+FX.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$X.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:BX.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+UX.join("|")+")\\b"}]}}function KX(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 qX(e){const s={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:s,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:s,illegal:/["']/}]}]}}function YX(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 VX(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={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:[r,s,i,a,n,"self"],relevance:0},c=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,d=/'[^']*'/,f=t.either(c,u,d),p=t.concat(f,"(\\s*\\.\\s*",f,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:p,className:"attr",starts:{end:/$/,contains:[r,l,s,i,a,n]}}]}}var Ka="[0-9](_*[0-9])*",gd=`\\.(${Ka})`,bd="[0-9a-fA-F](_*[0-9a-fA-F])*",aS={className:"number",variants:[{begin:`(\\b(${Ka})((${gd})|\\.)?|(${gd}))[eE][+-]?(${Ka})[fFdD]?\\b`},{begin:`\\b(${Ka})((${gd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${gd})[fFdD]?\\b`},{begin:`\\b(${Ka})[fFdD]\\b`},{begin:`\\b0[xX]((${bd})\\.?|(${bd})?\\.(${bd}))[pP][+-]?(${Ka})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${bd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function qM(e,t,n){return n===-1?"":e.replace(t,r=>qM(e,t,n-1))}function XX(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+qM("(?:<"+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:["(?:"+r+"\\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,aS,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},aS,u]}}const lS="[A-Za-z$_][0-9A-Za-z$_]*",WX=["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"],ZX=["true","false","null","undefined","NaN","Infinity"],YM=["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"],VM=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],XM=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],QX=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],JX=[].concat(XM,YM,VM);function eW(e){const t=e.regex,n=(P,{after:H})=>{const E="</"+P[0].slice(1);return P.input.indexOf(E,H)!==-1},r=lS,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,H)=>{const E=P[0].length+P.index,j=P.input[E];if(j==="<"||j===","){H.ignoreMatch();return}j===">"&&(n(P,{after:E})||H.ignoreMatch());let B;const O=P.input.substring(E);if(B=O.match(/^\s*=/)){H.ignoreMatch();return}if((B=O.match(/^\s+extends\s+/))&&B.index===0){H.ignoreMatch();return}}},l={$pattern:lS,keyword:WX,literal:ZX,built_in:JX,"variable.language":QX},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},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},b={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,k,w,{match:/\$\d+/},f];p.contains=v.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(v)});const S=[].concat(b,p.contains),T=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:T},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],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:{_:[...YM,...VM]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(P){return t.concat("(?!",P.join("|"),")")}const G={match:t.concat(/\b/,$([...XM,"super","import","await"].map(P=>`${P}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:R},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,k,w,b,{match:/\$\d+/},f,R,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:A,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:T}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},G,U,_,D,{match:/\$[(.]/}]}}const tW="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",nW={scope:"number",match:tW,relevance:0};function rW(e){const t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,nW,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var qa="[0-9](_*[0-9])*",xd=`\\.(${qa})`,yd="[0-9a-fA-F](_*[0-9a-fA-F])*",iW={className:"number",variants:[{begin:`(\\b(${qa})((${xd})|\\.)?|(${xd}))[eE][+-]?(${qa})[fFdD]?\\b`},{begin:`\\b(${qa})((${xd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${xd})[fFdD]?\\b`},{begin:`\\b(${qa})[fFdD]\\b`},{begin:`\\b0[xX]((${yd})\\.?|(${yd})?\\.(${yd}))[pP][+-]?(${qa})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${yd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function sW(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+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.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=iW,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=f;return p.variants[1].contains=[f],f.variants[1].contains=[p],{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,r,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:`
521
- `},u]}}const aW=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_-]*/}}),lW=["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"],oW=["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"],cW=[...lW,...oW],uW=["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(),WM=["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(),ZM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),dW=["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(),fW=WM.concat(ZM).sort().reverse();function pW(e){const t=aW(e),n=fW,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",a=[],l=[],c=function(v){return{className:"string",begin:"~?"+v+".*?"+v}},u=function(v,S,T){return{className:v,begin:S,relevance:T}},d={$pattern:/[a-z-]+/,keyword:r,attribute:uW.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","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const p=l.concat({begin:/\{/,end:/\}/,contains:a}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+dW.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:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:p}},m={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+cW.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+WM.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ZM.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[m]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,k,w,b,g,m,h,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function hW(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],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:i.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:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function mW(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]},r={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]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={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,r,i,s,a]}}function gW(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={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}]},s={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:[]}),p=e.inherit(d,{contains:[]});u.contains.push(p),d.contains.push(f);let h=[n,c];return[u,d,f,p].forEach(m=>{m.contains=m.contains.concat(h)}),h=h.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},i,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function bW(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 xW(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"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},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,s,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],p=(k,w,m="\\1")=>{const b=m==="\\1"?m:t.concat(m,w);return t.concat(t.concat("(?:",k,")"),w,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,m,r)},h=(k,w,m)=>t.concat(t.concat("(?:",k,")"),w,/(?:\\.|[^\\\/])*?/,m,r),g=[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:p("s|tr|y",t.either(...f,{capture:!0}))},{begin:p("s|tr|y","\\(","\\)")},{begin:p("s|tr|y","\\[","\\]")},{begin:p("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("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 s.contains=g,a.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function yW(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},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,D)=>{D.data._beginMatch=I[1]||I[2]},"on:end":(I,D)=>{D.data._beginMatch!==I[1]&&D.ignoreMatch()}},p=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[
522
- ]`,g={scope:"string",variants:[d,u,f,p]},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"],m=["__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"],b=["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:m,literal:(I=>{const D=[];return I.forEach(A=>{D.push(A),A.toLowerCase()===A?D.push(A.toUpperCase()):D.push(A.toLowerCase())}),D})(w),built_in:b},T=I=>I.map(D=>D.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(h,"+"),t.concat("(?!",T(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},_=t.concat(r,"\\b(?!\\()"),R={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},L={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},C={relevance:0,begin:/\(/,end:/\)/,keywords:S,contains:[L,a,R,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,k,N]},U={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",T(m).join("\\b|"),"|",T(b).join("\\b|"),"\\b)"),r,t.concat(h,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[C]};C.contains.push(U);const $=[L,R,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,k,N],G={begin:t.concat(/#\[\s*\\?/,t.either(i,s)),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:i},{match:s}]}]};return{case_insensitive:!1,keywords:S,contains:[G,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,U,R,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},N,{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",G,a,R,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,g,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]},g,k]}}function vW(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 kW(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function wW(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["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:r,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]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,g=`\\b|${r.join("|")}`,k={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${g})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${p})[jJ](?=${g})`}]},w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={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:[m]},{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,m,f]}]}}function SW(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function EW(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=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]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=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:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function NW(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\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]})]}]},p="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${p})(\\.(${h}))?([eE][+-]?(${h})|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}]},N=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,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},g,{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=N,k.contains=N;const C=[{begin:/^\s*=>/,starts:{end:"$",contains:N}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:N}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(C).concat(u).concat(N)}}function _W(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,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+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:d}},{className:"punctuation",begin:"->"},s]}}const CW=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_-]*/}}),TW=["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"],AW=["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"],MW=[...TW,...AW],jW=["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(),OW=["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(),RW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),DW=["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 IW(e){const t=CW(e),n=RW,r=OW,i="@[a-z-]+",s="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("+MW.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+DW.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:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:jW.join(" ")},contains:[{begin:i,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 LW(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function zW(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["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"],p=["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"],h=d,g=[...u,...c].filter(T=>!d.includes(T)),k={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},m={match:t.concat(/\b/,t.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function b(T){return t.concat(/\b/,t.either(...T.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const v={scope:"keyword",match:b(p),relevance:0};function S(T,{exceptions:N,when:_}={}){const R=_;return N=N||[],T.map(L=>L.match(/\|\d+$/)||N.includes(L)?L:R(L)?`${L}|0`:L)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:S(g,{when:T=>T.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:b(a)},v,m,k,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}function QM(e){return e?typeof e=="string"?e:e.source:null}function _o(e){return _t("(?=",e,")")}function _t(...e){return e.map(n=>QM(n)).join("")}function PW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Dn(...e){return"("+(PW(e).capture?"":"?:")+e.map(r=>QM(r)).join("|")+")"}const wy=e=>_t(/\b/,e,/\w$/.test(e)?/\b/:/\B/),UW=["Protocol","Type"].map(wy),oS=["init","self"].map(wy),BW=["Any","Self"],Em=["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"],cS=["false","nil","true"],HW=["assignment","associativity","higherThan","left","lowerThan","none","right"],FW=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],uS=["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"],JM=Dn(/[/=\-+!*%<>&|^~?]/,/[\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]/),ej=Dn(JM,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Nm=_t(JM,ej,"*"),tj=Dn(/[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]/),Wf=Dn(tj,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qr=_t(tj,Wf,"*"),vd=_t(/[A-Z]/,Wf,"*"),$W=["attached","autoclosure",_t(/convention\(/,Dn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",_t(/objc\(/,qr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],GW=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function KW(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Dn(...UW,...oS)],className:{2:"keyword"}},s={match:_t(/\./,Dn(...Em)),relevance:0},a=Em.filter(pe=>typeof pe=="string").concat(["_|0"]),l=Em.filter(pe=>typeof pe!="string").concat(BW).map(wy),c={variants:[{className:"keyword",match:Dn(...l,...oS)}]},u={$pattern:Dn(/\b\w+/,/#\w+/),keyword:a.concat(FW),literal:cS},d=[i,s,c],f={match:_t(/\./,Dn(...uS)),relevance:0},p={className:"built_in",match:_t(/\b/,Dn(...uS),/(?=\()/)},h=[f,p],g={match:/->/,relevance:0},k={className:"operator",relevance:0,variants:[{match:Nm},{match:`\\.(\\.|${ej})+`}]},w=[g,k],m="([0-9]_*)+",b="([0-9a-fA-F]_*)+",v={className:"number",relevance:0,variants:[{match:`\\b(${m})(\\.(${m}))?([eE][+-]?(${m}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${m}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(pe="")=>({className:"subst",variants:[{match:_t(/\\/,pe,/[0\\tnr"']/)},{match:_t(/\\/,pe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),T=(pe="")=>({className:"subst",match:_t(/\\/,pe,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(pe="")=>({className:"subst",label:"interpol",begin:_t(/\\/,pe,/\(/),end:/\)/}),_=(pe="")=>({begin:_t(pe,/"""/),end:_t(/"""/,pe),contains:[S(pe),T(pe),N(pe)]}),R=(pe="")=>({begin:_t(pe,/"/),end:_t(/"/,pe),contains:[S(pe),N(pe)]}),L={className:"string",variants:[_(),_("#"),_("##"),_("###"),R(),R("#"),R("##"),R("###")]},C=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],U={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:C},$=pe=>{const le=_t(pe,/\//),de=_t(/\//,pe);return{begin:le,end:de,contains:[...C,{scope:"comment",begin:`#(?!.*${de})`,end:/$/}]}},G={scope:"regexp",variants:[$("###"),$("##"),$("#"),U]},I={match:_t(/`/,qr,/`/)},D={className:"variable",match:/\$\d+/},A={className:"variable",match:`\\$${Wf}+`},M=[I,D,A],P={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:GW,contains:[...w,v,L]}]}},H={scope:"keyword",match:_t(/@/,Dn(...$W),_o(Dn(/\(/,/\s+/)))},E={scope:"meta",match:_t(/@/,qr)},j=[P,H,E],B={match:_o(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:_t(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Wf,"+")},{className:"type",match:vd,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:_t(/\s+&\s+/,_o(vd)),relevance:0}]},O={begin:/</,end:/>/,keywords:u,contains:[...r,...d,...j,g,B]};B.contains.push(O);const Q={match:_t(qr,/\s*:/),keywords:"_|0",relevance:0},F={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Q,...r,G,...d,...h,...w,v,L,...M,...j,B]},J={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,B]},ce={begin:Dn(_o(_t(qr,/\s*:/)),_o(_t(qr,/\s+/,qr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qr}]},K={begin:/\(/,end:/\)/,keywords:u,contains:[ce,...r,...d,...w,v,L,...j,B,F],endsParent:!0,illegal:/["']/},q={match:[/(func|macro)/,/\s+/,Dn(I.match,qr,Nm)],className:{1:"keyword",3:"title.function"},contains:[J,K,t],illegal:[/\[/,/%/]},V={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[J,K,t],illegal:/\[|%/},ue={match:[/operator/,/\s+/,Nm],className:{1:"keyword",3:"title"}},me={begin:[/precedencegroup/,/\s+/,vd],className:{1:"keyword",3:"title"},contains:[B],keywords:[...HW,...cS],end:/}/},Ne={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Te={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ne={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[J,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:vd},...d],relevance:0}]};for(const pe of L.variants){const le=pe.contains.find(Ke=>Ke.label==="interpol");le.keywords=u;const de=[...d,...h,...w,v,L,...M];le.contains=[...de,{begin:/\(/,end:/\)/,contains:["self",...de]}]}return{name:"Swift",keywords:u,contains:[...r,q,V,Ne,Te,ne,ue,me,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},G,...d,...h,...w,v,L,...M,...j,B,F]}}const Zf="[A-Za-z$_][0-9A-Za-z$_]*",nj=["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"],rj=["true","false","null","undefined","NaN","Infinity"],ij=["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"],sj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],aj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],lj=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],oj=[].concat(aj,ij,sj);function qW(e){const t=e.regex,n=(P,{after:H})=>{const E="</"+P[0].slice(1);return P.input.indexOf(E,H)!==-1},r=Zf,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,H)=>{const E=P[0].length+P.index,j=P.input[E];if(j==="<"||j===","){H.ignoreMatch();return}j===">"&&(n(P,{after:E})||H.ignoreMatch());let B;const O=P.input.substring(E);if(B=O.match(/^\s*=/)){H.ignoreMatch();return}if((B=O.match(/^\s+extends\s+/))&&B.index===0){H.ignoreMatch();return}}},l={$pattern:Zf,keyword:nj,literal:rj,built_in:oj,"variable.language":lj},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},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},b={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,k,w,{match:/\$\d+/},f];p.contains=v.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(v)});const S=[].concat(b,p.contains),T=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(S)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:T},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],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:{_:[...ij,...sj]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(P){return t.concat("(?!",P.join("|"),")")}const G={match:t.concat(/\b/,$([...aj,"super","import","await"].map(P=>`${P}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:R},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,k,w,b,{match:/\$\d+/},f,R,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:A,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:T}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},G,U,_,D,{match:/\$[(.]/}]}}function YW(e){const t=e.regex,n=qW(e),r=Zf,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},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:Zf,keyword:nj.concat(c),literal:rj,built_in:oj.concat(i),"variable.language":lj},d={className:"meta",begin:"@"+r},f=(k,w,m)=>{const b=k.contains.findIndex(v=>v.label===w);if(b===-1)throw new Error("can not find mode to replace");k.contains.splice(b,1,m)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const p=n.contains.find(k=>k.scope==="attr"),h=Object.assign({},p,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,p,h]),n.contains=n.contains.concat([d,s,a,h]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const g=n.contains.find(k=>k.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function VW(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\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(s,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(s,i),/ +/,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:/>/}]}),p=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,r,c,u,d,f,p,{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:[p]}]}}function XW(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["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"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={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:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,i,e.QUOTE_STRING_MODE,c,u,l]}}function WW(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(s,{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:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{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:[s,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,a,c,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{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 ZW(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={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,i]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={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"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},k={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},w=[r,{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}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,k,s,a],m=[...w];return m.pop(),m.push(l),h.contains=m,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}const QW={arduino:jX,bash:OX,c:RX,cpp:DX,csharp:IX,css:GX,diff:KX,go:qX,graphql:YX,ini:VX,java:XX,javascript:eW,json:rW,kotlin:sW,less:pW,lua:hW,makefile:mW,markdown:gW,objectivec:bW,perl:xW,php:yW,"php-template":vW,plaintext:kW,python:wW,"python-repl":SW,r:EW,ruby:NW,rust:_W,scss:IW,shell:LW,sql:zW,swift:KW,typescript:YW,vbnet:VW,wasm:XW,xml:WW,yaml:ZW};function cj(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],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&cj(n)}),e}class dS{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function uj(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function cs(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const JW="</span>",fS=e=>!!e.scope,eZ=(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((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class tZ{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=uj(t)}openNode(t){if(!fS(t))return;const n=eZ(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){fS(t)&&(this.buffer+=JW)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const pS=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Sy{constructor(){this.rootNode=pS(),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=pS({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(r=>this._walk(t,r)),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=>{Sy._collapse(n)}))}}class nZ extends Sy{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new tZ(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Hc(e){return e?typeof e=="string"?e:e.source:null}function dj(e){return Aa("(?=",e,")")}function rZ(e){return Aa("(?:",e,")*")}function iZ(e){return Aa("(?:",e,")?")}function Aa(...e){return e.map(n=>Hc(n)).join("")}function sZ(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ey(...e){return"("+(sZ(e).capture?"":"?:")+e.map(r=>Hc(r)).join("|")+")"}function fj(e){return new RegExp(e.toString()+"|").exec("").length-1}function aZ(e,t){const n=e&&e.exec(t);return n&&n.index===0}const lZ=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ny(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let s=Hc(r),a="";for(;s.length>0;){const l=lZ.exec(s);if(!l){a+=s;break}a+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+i):(a+=l[0],l[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const oZ=/\b\B/,pj="[a-zA-Z]\\w*",_y="[a-zA-Z_]\\w*",hj="\\b\\d+(\\.\\d+)?",mj="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",gj="\\b(0b[01]+)",cZ="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",uZ=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Aa(t,/.*\b/,e.binary,/\b.*/)),cs({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Fc={begin:"\\\\[\\s\\S]",relevance:0},dZ={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Fc]},fZ={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Fc]},pZ={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/},Vp=function(e,t,n={}){const r=cs({scope:"comment",begin:e,end:t,contains:[]},n);r.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 i=Ey("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 r.contains.push({begin:Aa(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},hZ=Vp("//","$"),mZ=Vp("/\\*","\\*/"),gZ=Vp("#","$"),bZ={scope:"number",begin:hj,relevance:0},xZ={scope:"number",begin:mj,relevance:0},yZ={scope:"number",begin:gj,relevance:0},vZ={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Fc,{begin:/\[/,end:/\]/,relevance:0,contains:[Fc]}]},kZ={scope:"title",begin:pj,relevance:0},wZ={scope:"title",begin:_y,relevance:0},SZ={begin:"\\.\\s*"+_y,relevance:0},EZ=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 kd=Object.freeze({__proto__:null,APOS_STRING_MODE:dZ,BACKSLASH_ESCAPE:Fc,BINARY_NUMBER_MODE:yZ,BINARY_NUMBER_RE:gj,COMMENT:Vp,C_BLOCK_COMMENT_MODE:mZ,C_LINE_COMMENT_MODE:hZ,C_NUMBER_MODE:xZ,C_NUMBER_RE:mj,END_SAME_AS_BEGIN:EZ,HASH_COMMENT_MODE:gZ,IDENT_RE:pj,MATCH_NOTHING_RE:oZ,METHOD_GUARD:SZ,NUMBER_MODE:bZ,NUMBER_RE:hj,PHRASAL_WORDS_MODE:pZ,QUOTE_STRING_MODE:fZ,REGEXP_MODE:vZ,RE_STARTERS_RE:cZ,SHEBANG:uZ,TITLE_MODE:kZ,UNDERSCORE_IDENT_RE:_y,UNDERSCORE_TITLE_MODE:wZ});function NZ(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function _Z(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function CZ(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=NZ,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function TZ(e,t){Array.isArray(e.illegal)&&(e.illegal=Ey(...e.illegal))}function AZ(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 MZ(e,t){e.relevance===void 0&&(e.relevance=1)}const jZ=(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(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Aa(n.beforeMatch,dj(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},OZ=["of","and","for","in","not","or","if","then","parent","list","value"],RZ="keyword";function bj(e,t,n=RZ){const r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(s){Object.assign(r,bj(e[s],t,s))}),r;function i(s,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");r[c[0]]=[s,DZ(c[0],c[1])]})}}function DZ(e,t){return t?Number(t):IZ(e)?0:1}function IZ(e){return OZ.includes(e.toLowerCase())}const hS={},sa=e=>{console.error(e)},mS=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ba=(e,t)=>{hS[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),hS[`${e}/${t}`]=!0)},Qf=new Error;function xj(e,t,{key:n}){let r=0;const i=e[n],s={},a={};for(let l=1;l<=t.length;l++)a[l+r]=i[l],s[l+r]=!0,r+=fj(t[l-1]);e[n]=a,e[n]._emit=s,e[n]._multi=!0}function LZ(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sa("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Qf;if(typeof e.beginScope!="object"||e.beginScope===null)throw sa("beginScope must be object"),Qf;xj(e,e.begin,{key:"beginScope"}),e.begin=Ny(e.begin,{joinWith:""})}}function zZ(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sa("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Qf;if(typeof e.endScope!="object"||e.endScope===null)throw sa("endScope must be object"),Qf;xj(e,e.end,{key:"endScope"}),e.end=Ny(e.end,{joinWith:""})}}function PZ(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function UZ(e){PZ(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),LZ(e),zZ(e)}function BZ(e){function t(a,l){return new RegExp(Hc(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+=fj(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(Ny(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,p)=>p>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class r{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 i(a){const l=new r;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 s(a,l){const c=a;if(a.isCompiled)return c;[_Z,AZ,UZ,jZ].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[CZ,TZ,MZ].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=bj(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=Hc(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 HZ(d==="self"?a:d)})),a.contains.forEach(function(d){s(d,c)}),a.starts&&s(a.starts,l),c.matcher=i(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=cs(e.classNameAliases||{}),s(e)}function yj(e){return e?e.endsWithParent||yj(e.starts):!1}function HZ(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return cs(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:yj(e)?cs(e,{starts:e.starts?cs(e.starts):null}):Object.isFrozen(e)?cs(e):e}var FZ="11.11.2";class $Z extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const _m=uj,gS=cs,bS=Symbol("nomatch"),GZ=7,vj=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="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:nZ};function c(A){return l.noHighlightRe.test(A)}function u(A){let M=A.className+" ";M+=A.parentNode?A.parentNode.className:"";const P=l.languageDetectRe.exec(M);if(P){const H=R(P[1]);return H||(mS(s.replace("{}",P[1])),mS("Falling back to no-highlight mode for this block.",A)),H?P[1]:"no-highlight"}return M.split(/\s+/).find(H=>c(H)||R(H))}function d(A,M,P){let H="",E="";typeof M=="object"?(H=A,P=M.ignoreIllegals,E=M.language):(Ba("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ba("10.7.0",`Please use highlight(code, options) instead.
523
- https://github.com/highlightjs/highlight.js/issues/2277`),E=A,H=M),P===void 0&&(P=!0);const j={code:H,language:E};I("before:highlight",j);const B=j.result?j.result:f(j.language,j.code,P);return B.code=j.code,I("after:highlight",B),B}function f(A,M,P,H){const E=Object.create(null);function j(Z,ae){return Z.keywords[ae]}function B(){if(!de.keywords){He.addText(Fe);return}let Z=0;de.keywordPatternRe.lastIndex=0;let ae=de.keywordPatternRe.exec(Fe),_e="";for(;ae;){_e+=Fe.substring(Z,ae.index);const x=ne.case_insensitive?ae[0].toLowerCase():ae[0],Y=j(de,x);if(Y){const[se,ge]=Y;if(He.addText(_e),_e="",E[x]=(E[x]||0)+1,E[x]<=GZ&&(dt+=ge),se.startsWith("_"))_e+=ae[0];else{const oe=ne.classNameAliases[se]||se;F(ae[0],oe)}}else _e+=ae[0];Z=de.keywordPatternRe.lastIndex,ae=de.keywordPatternRe.exec(Fe)}_e+=Fe.substring(Z),He.addText(_e)}function O(){if(Fe==="")return;let Z=null;if(typeof de.subLanguage=="string"){if(!t[de.subLanguage]){He.addText(Fe);return}Z=f(de.subLanguage,Fe,!0,Ke[de.subLanguage]),Ke[de.subLanguage]=Z._top}else Z=h(Fe,de.subLanguage.length?de.subLanguage:null);de.relevance>0&&(dt+=Z.relevance),He.__addSublanguage(Z._emitter,Z.language)}function Q(){de.subLanguage!=null?O():B(),Fe=""}function F(Z,ae){Z!==""&&(He.startScope(ae),He.addText(Z),He.endScope())}function J(Z,ae){let _e=1;const x=ae.length-1;for(;_e<=x;){if(!Z._emit[_e]){_e++;continue}const Y=ne.classNameAliases[Z[_e]]||Z[_e],se=ae[_e];Y?F(se,Y):(Fe=se,B(),Fe=""),_e++}}function ce(Z,ae){return Z.scope&&typeof Z.scope=="string"&&He.openNode(ne.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(F(Fe,ne.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),Fe=""):Z.beginScope._multi&&(J(Z.beginScope,ae),Fe="")),de=Object.create(Z,{parent:{value:de}}),de}function K(Z,ae,_e){let x=aZ(Z.endRe,_e);if(x){if(Z["on:end"]){const Y=new dS(Z);Z["on:end"](ae,Y),Y.isMatchIgnored&&(x=!1)}if(x){for(;Z.endsParent&&Z.parent;)Z=Z.parent;return Z}}if(Z.endsWithParent)return K(Z.parent,ae,_e)}function q(Z){return de.matcher.regexIndex===0?(Fe+=Z[0],1):(at=!0,0)}function V(Z){const ae=Z[0],_e=Z.rule,x=new dS(_e),Y=[_e.__beforeBegin,_e["on:begin"]];for(const se of Y)if(se&&(se(Z,x),x.isMatchIgnored))return q(ae);return _e.skip?Fe+=ae:(_e.excludeBegin&&(Fe+=ae),Q(),!_e.returnBegin&&!_e.excludeBegin&&(Fe=ae)),ce(_e,Z),_e.returnBegin?0:ae.length}function ue(Z){const ae=Z[0],_e=M.substring(Z.index),x=K(de,Z,_e);if(!x)return bS;const Y=de;de.endScope&&de.endScope._wrap?(Q(),F(ae,de.endScope._wrap)):de.endScope&&de.endScope._multi?(Q(),J(de.endScope,Z)):Y.skip?Fe+=ae:(Y.returnEnd||Y.excludeEnd||(Fe+=ae),Q(),Y.excludeEnd&&(Fe=ae));do de.scope&&He.closeNode(),!de.skip&&!de.subLanguage&&(dt+=de.relevance),de=de.parent;while(de!==x.parent);return x.starts&&ce(x.starts,Z),Y.returnEnd?0:ae.length}function me(){const Z=[];for(let ae=de;ae!==ne;ae=ae.parent)ae.scope&&Z.unshift(ae.scope);Z.forEach(ae=>He.openNode(ae))}let Ne={};function Te(Z,ae){const _e=ae&&ae[0];if(Fe+=Z,_e==null)return Q(),0;if(Ne.type==="begin"&&ae.type==="end"&&Ne.index===ae.index&&_e===""){if(Fe+=M.slice(ae.index,ae.index+1),!i){const x=new Error(`0 width match regex (${A})`);throw x.languageName=A,x.badRule=Ne.rule,x}return 1}if(Ne=ae,ae.type==="begin")return V(ae);if(ae.type==="illegal"&&!P){const x=new Error('Illegal lexeme "'+_e+'" for mode "'+(de.scope||"<unnamed>")+'"');throw x.mode=de,x}else if(ae.type==="end"){const x=ue(ae);if(x!==bS)return x}if(ae.type==="illegal"&&_e==="")return ae.index===M.length||(Fe+=`
524
- `),1;if(Ue>1e5&&Ue>ae.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Fe+=_e,_e.length}const ne=R(A);if(!ne)throw sa(s.replace("{}",A)),new Error('Unknown language: "'+A+'"');const pe=BZ(ne);let le="",de=H||pe;const Ke={},He=new l.__emitter(l);me();let Fe="",dt=0,st=0,Ue=0,at=!1;try{if(ne.__emitTokens)ne.__emitTokens(M,He);else{for(de.matcher.considerAll();;){Ue++,at?at=!1:de.matcher.considerAll(),de.matcher.lastIndex=st;const Z=de.matcher.exec(M);if(!Z)break;const ae=M.substring(st,Z.index),_e=Te(ae,Z);st=Z.index+_e}Te(M.substring(st))}return He.finalize(),le=He.toHTML(),{language:A,value:le,relevance:dt,illegal:!1,_emitter:He,_top:de}}catch(Z){if(Z.message&&Z.message.includes("Illegal"))return{language:A,value:_m(M),illegal:!0,relevance:0,_illegalBy:{message:Z.message,index:st,context:M.slice(st-100,st+100),mode:Z.mode,resultSoFar:le},_emitter:He};if(i)return{language:A,value:_m(M),illegal:!1,relevance:0,errorRaised:Z,_emitter:He,_top:de};throw Z}}function p(A){const M={value:_m(A),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return M._emitter.addText(A),M}function h(A,M){M=M||l.languages||Object.keys(t);const P=p(A),H=M.filter(R).filter(C).map(Q=>f(Q,A,!1));H.unshift(P);const E=H.sort((Q,F)=>{if(Q.relevance!==F.relevance)return F.relevance-Q.relevance;if(Q.language&&F.language){if(R(Q.language).supersetOf===F.language)return 1;if(R(F.language).supersetOf===Q.language)return-1}return 0}),[j,B]=E,O=j;return O.secondBest=B,O}function g(A,M,P){const H=M&&n[M]||P;A.classList.add("hljs"),A.classList.add(`language-${H}`)}function k(A){let M=null;const P=u(A);if(c(P))return;if(I("before:highlightElement",{el:A,language:P}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.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(A)),l.throwUnescapedHTML))throw new $Z("One of your code blocks includes unescaped HTML.",A.innerHTML);M=A;const H=M.textContent,E=P?d(H,{language:P,ignoreIllegals:!0}):h(H);A.innerHTML=E.value,A.dataset.highlighted="yes",g(A,P,E.language),A.result={language:E.language,re:E.relevance,relevance:E.relevance},E.secondBest&&(A.secondBest={language:E.secondBest.language,relevance:E.secondBest.relevance}),I("after:highlightElement",{el:A,result:E,text:H})}function w(A){l=gS(l,A)}const m=()=>{S(),Ba("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){S(),Ba("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let v=!1;function S(){function A(){S()}if(document.readyState==="loading"){v||window.addEventListener("DOMContentLoaded",A,!1),v=!0;return}document.querySelectorAll(l.cssSelector).forEach(k)}function T(A,M){let P=null;try{P=M(e)}catch(H){if(sa("Language definition for '{}' could not be registered.".replace("{}",A)),i)sa(H);else throw H;P=a}P.name||(P.name=A),t[A]=P,P.rawDefinition=M.bind(null,e),P.aliases&&L(P.aliases,{languageName:A})}function N(A){delete t[A];for(const M of Object.keys(n))n[M]===A&&delete n[M]}function _(){return Object.keys(t)}function R(A){return A=(A||"").toLowerCase(),t[A]||t[n[A]]}function L(A,{languageName:M}){typeof A=="string"&&(A=[A]),A.forEach(P=>{n[P.toLowerCase()]=M})}function C(A){const M=R(A);return M&&!M.disableAutodetect}function U(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=M=>{A["before:highlightBlock"](Object.assign({block:M.el},M))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=M=>{A["after:highlightBlock"](Object.assign({block:M.el},M))})}function $(A){U(A),r.push(A)}function G(A){const M=r.indexOf(A);M!==-1&&r.splice(M,1)}function I(A,M){const P=A;r.forEach(function(H){H[P]&&H[P](M)})}function D(A){return Ba("10.7.0","highlightBlock will be removed entirely in v12.0"),Ba("10.7.0","Please use highlightElement now."),k(A)}Object.assign(e,{highlight:d,highlightAuto:h,highlightAll:S,highlightElement:k,highlightBlock:D,configure:w,initHighlighting:m,initHighlightingOnLoad:b,registerLanguage:T,unregisterLanguage:N,listLanguages:_,getLanguage:R,registerAliases:L,autoDetection:C,inherit:gS,addPlugin:$,removePlugin:G}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=FZ,e.regex={concat:Aa,lookahead:dj,either:Ey,optional:iZ,anyNumberOfTimes:rZ};for(const A in kd)typeof kd[A]=="object"&&cj(kd[A]);return Object.assign(e,kd),e},Kl=vj({});Kl.newInstance=()=>vj({});var KZ=Kl;Kl.HighlightJS=Kl;Kl.default=Kl;const qZ=$c(KZ),xS={},YZ="hljs-";function VZ(e){const t=qZ.newInstance();return e&&s(e),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:a,registered:l};function n(c,u,d){const f=d||xS,p=typeof f.prefix=="string"?f.prefix:YZ;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:XZ,classPrefix:p});const h=t.highlight(u,{ignoreIllegals:!0,language:c});if(h.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:h.errorRaised});const g=h._emitter.root,k=g.data;return k.language=h.language,k.relevance=h.relevance,g}function r(c,u){const f=(u||xS).subset||i();let p=-1,h=0,g;for(;++p<f.length;){const k=f[p];if(!t.getLanguage(k))continue;const w=n(k,c,u);w.data&&w.data.relevance!==void 0&&w.data.relevance>h&&(h=w.data.relevance,g=w)}return g||{type:"root",children:[],data:{language:void 0,relevance:h}}}function i(){return t.listLanguages()}function s(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 XZ{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],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const WZ={};function kj(e){const t=e||WZ,n=t.aliases,r=t.detect||!1,i=t.languages||QW,s=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=VZ(i);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){Yp(d,"element",function(p,h,g){if(p.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const k=ZZ(p);if(k===!1||!k&&!r||k&&s&&s.includes(k))return;Array.isArray(p.properties.className)||(p.properties.className=[]),p.properties.className.includes(c)||p.properties.className.unshift(c);const w=SX(p,{whitespace:"pre"});let m;try{m=k?u.highlight(k,w,{prefix:a}):u.highlightAuto(w,{prefix:a,subset:l})}catch(b){const v=b;if(k&&/Unknown language/.test(v.message)){f.message("Cannot highlight as `"+k+"`, it’s not registered",{ancestors:[g,p],cause:v,place:p.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw v}!k&&m.data&&m.data.language&&p.properties.className.push("language-"+m.data.language),m.children.length>0&&(p.children=m.children)})}}function ZZ(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const i=String(t[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}function QZ(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _n={},wd={},qi={},yS;function Eu(){if(yS)return qi;yS=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 r(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 i(a,l){let c="";for(let u=0;u<l;u+=1)c+=a;return c}function s(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return qi.isNothing=e,qi.isObject=t,qi.toArray=n,qi.repeat=i,qi.isNegativeZero=s,qi.extend=r,qi}var Cm,vS;function Nu(){if(vS)return Cm;vS=1;function e(n,r){let i="";const s=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(i+='in "'+n.mark.name+'" '),i+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!r&&n.mark.snippet&&(i+=`
525
-
526
- `+n.mark.snippet),s+" "+i):s}function t(n,r){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=r,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(r){return this.name+": "+e(this,r)},Cm=t,Cm}var Tm,kS;function JZ(){if(kS)return Tm;kS=1;const e=Eu();function t(i,s,a,l,c){let u="",d="";const f=Math.floor(c/2)-1;return l-s>f&&(u=" ... ",s=l-f+u.length),a-l>f&&(d=" ...",a=l+f-d.length),{str:u+i.slice(s,a).replace(/\t/g,"→")+d,pos:l-s+u.length}}function n(i,s){return e.repeat(" ",s-i.length)+i}function r(i,s){if(s=Object.create(s||null),!i.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);const a=/\r?\n|\r|\0/g,l=[0],c=[];let u,d=-1;for(;u=a.exec(i.buffer);)c.push(u.index),l.push(u.index+u[0].length),i.position<=u.index&&d<0&&(d=l.length-2);d<0&&(d=l.length-1);let f="";const p=Math.min(i.line+s.linesAfter,c.length).toString().length,h=s.maxLength-(s.indent+p+3);for(let k=1;k<=s.linesBefore&&!(d-k<0);k++){const w=t(i.buffer,l[d-k],c[d-k],i.position-(l[d]-l[d-k]),h);f=e.repeat(" ",s.indent)+n((i.line-k+1).toString(),p)+" | "+w.str+`
527
- `+f}const g=t(i.buffer,l[d],c[d],i.position,h);f+=e.repeat(" ",s.indent)+n((i.line+1).toString(),p)+" | "+g.str+`
528
- `,f+=e.repeat("-",s.indent+p+3+g.pos)+`^
529
- `;for(let k=1;k<=s.linesAfter&&!(d+k>=c.length);k++){const w=t(i.buffer,l[d+k],c[d+k],i.position-(l[d]-l[d+k]),h);f+=e.repeat(" ",s.indent)+n((i.line+k+1).toString(),p)+" | "+w.str+`
530
- `}return f.replace(/\n$/,"")}return Tm=r,Tm}var Am,wS;function Hn(){if(wS)return Am;wS=1;const e=Nu(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],n=["scalar","sequence","mapping"];function r(s){const a={};return s!==null&&Object.keys(s).forEach(function(l){s[l].forEach(function(c){a[String(c)]=l})}),a}function i(s,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 "'+s+'" YAML type.')}),this.options=a,this.tag=s,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=r(a.styleAliases||null),n.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return Am=i,Am}var Mm,SS;function wj(){if(SS)return Mm;SS=1;const e=Nu(),t=Hn();function n(s,a){const l=[];return s[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 r(){const s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(l){l.multi?(s.multi[l.kind].push(l),s.multi.fallback.push(l)):s[l.kind][l.tag]=s.fallback[l.tag]=l}for(let l=0,c=arguments.length;l<c;l+=1)arguments[l].forEach(a);return s}function i(s){return this.extend(s)}return i.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(i.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=r(u.compiledImplicit,u.compiledExplicit),u},Mm=i,Mm}var jm,ES;function Sj(){if(ES)return jm;ES=1;const e=Hn();return jm=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),jm}var Om,NS;function Ej(){if(NS)return Om;NS=1;const e=Hn();return Om=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Om}var Rm,_S;function Nj(){if(_S)return Rm;_S=1;const e=Hn();return Rm=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Rm}var Dm,CS;function _j(){if(CS)return Dm;CS=1;const e=wj();return Dm=new e({explicit:[Sj(),Ej(),Nj()]}),Dm}var Im,TS;function Cj(){if(TS)return Im;TS=1;const e=Hn();function t(i){if(i===null)return!0;const s=i.length;return s===1&&i==="~"||s===4&&(i==="null"||i==="Null"||i==="NULL")}function n(){return null}function r(i){return i===null}return Im=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:n,predicate:r,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Im}var Lm,AS;function Tj(){if(AS)return Lm;AS=1;const e=Hn();function t(i){if(i===null)return!1;const s=i.length;return s===4&&(i==="true"||i==="True"||i==="TRUE")||s===5&&(i==="false"||i==="False"||i==="FALSE")}function n(i){return i==="true"||i==="True"||i==="TRUE"}function r(i){return Object.prototype.toString.call(i)==="[object Boolean]"}return Lm=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:n,predicate:r,represent:{lowercase:function(i){return i?"true":"false"},uppercase:function(i){return i?"TRUE":"FALSE"},camelcase:function(i){return i?"True":"False"}},defaultStyle:"lowercase"}),Lm}var zm,MS;function Aj(){if(MS)return zm;MS=1;const e=Eu(),t=Hn();function n(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}function r(u){return u>=48&&u<=55}function i(u){return u>=48&&u<=57}function s(u){if(u===null)return!1;const d=u.length;let f=0,p=!1;if(!d)return!1;let h=u[f];if((h==="-"||h==="+")&&(h=u[++f]),h==="0"){if(f+1===d)return!0;if(h=u[++f],h==="b"){for(f++;f<d;f++){if(h=u[f],h!=="0"&&h!=="1")return!1;p=!0}return p&&isFinite(a(u))}if(h==="x"){for(f++;f<d;f++){if(!n(u.charCodeAt(f)))return!1;p=!0}return p&&isFinite(a(u))}if(h==="o"){for(f++;f<d;f++){if(!r(u.charCodeAt(f)))return!1;p=!0}return p&&isFinite(a(u))}}for(;f<d;f++){if(!i(u.charCodeAt(f)))return!1;p=!0}return p?isFinite(a(u)):!1}function a(u){let d=u,f=1,p=d[0];if((p==="-"||p==="+")&&(p==="-"&&(f=-1),d=d.slice(1),p=d[0]),d==="0")return 0;if(p==="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 zm=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,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"]}}),zm}var Pm,jS;function Mj(){if(jS)return Pm;jS=1;const e=Eu(),t=Hn(),n=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),r=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function i(u){return u===null||!n.test(u)?!1:isFinite(parseFloat(u,10))?!0:r.test(u)}function s(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 Pm=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:s,predicate:c,represent:l,defaultStyle:"lowercase"}),Pm}var Um,OS;function jj(){return OS||(OS=1,Um=_j().extend({implicit:[Cj(),Tj(),Aj(),Mj()]})),Um}var Bm,RS;function Oj(){return RS||(RS=1,Bm=jj()),Bm}var Hm,DS;function Rj(){if(DS)return Hm;DS=1;const e=Hn(),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 r(a){return a===null?!1:t.exec(a)!==null||n.exec(a)!==null}function i(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,p=+u[3];if(!u[4])return new Date(Date.UTC(d,f,p));const h=+u[4],g=+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 m=+u[10],b=+(u[11]||0);c=(m*60+b)*6e4,u[9]==="-"&&(c=-c)}const w=new Date(Date.UTC(d,f,p,h,g,k,l));return c&&w.setTime(w.getTime()-c),w}function s(a){return a.toISOString()}return Hm=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:s}),Hm}var Fm,IS;function Dj(){if(IS)return Fm;IS=1;const e=Hn();function t(n){return n==="<<"||n===null}return Fm=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),Fm}var $m,LS;function Ij(){if(LS)return $m;LS=1;const e=Hn(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
531
- \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 r(a){const l=a.replace(/[\r\n=]/g,""),c=l.length,u=t;let d=0;const f=[];for(let h=0;h<c;h++)h%4===0&&h&&(f.push(d>>16&255),f.push(d>>8&255),f.push(d&255)),d=d<<6|u.indexOf(l.charAt(h));const p=c%4*6;return p===0?(f.push(d>>16&255),f.push(d>>8&255),f.push(d&255)):p===18?(f.push(d>>10&255),f.push(d>>2&255)):p===12&&f.push(d>>4&255),new Uint8Array(f)}function i(a){let l="",c=0;const u=a.length,d=t;for(let p=0;p<u;p++)p%3===0&&p&&(l+=d[c>>18&63],l+=d[c>>12&63],l+=d[c>>6&63],l+=d[c&63]),c=(c<<8)+a[p];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 s(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return $m=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:r,predicate:s,represent:i}),$m}var Gm,zS;function Lj(){if(zS)return Gm;zS=1;const e=Hn(),t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(s){if(s===null)return!0;const a={},l=s;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 p;for(p in d)if(t.call(d,p))if(!f)f=!0;else return!1;if(!f||t.call(a,p))return!1;Object.defineProperty(a,p,{value:!0})}return!0}function i(s){return s!==null?s:[]}return Gm=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i}),Gm}var Km,PS;function zj(){if(PS)return Km;PS=1;const e=Hn(),t=Object.prototype.toString;function n(i){if(i===null)return!0;const s=i,a=new Array(s.length);for(let l=0,c=s.length;l<c;l+=1){const u=s[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 r(i){if(i===null)return[];const s=i,a=new Array(s.length);for(let l=0,c=s.length;l<c;l+=1){const u=s[l],d=Object.keys(u);a[l]=[d[0],u[d[0]]]}return a}return Km=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:r}),Km}var qm,US;function Pj(){if(US)return qm;US=1;const e=Hn(),t=Object.prototype.hasOwnProperty;function n(i){if(i===null)return!0;const s=i;for(const a in s)if(t.call(s,a)&&s[a]!==null)return!1;return!0}function r(i){return i!==null?i:{}}return qm=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:n,construct:r}),qm}var Ym,BS;function Cy(){return BS||(BS=1,Ym=Oj().extend({implicit:[Rj(),Dj()],explicit:[Ij(),Lj(),zj(),Pj()]})),Ym}var HS;function eQ(){if(HS)return wd;HS=1;const e=Eu(),t=Nu(),n=JZ(),r=Cy(),i=Object.prototype.hasOwnProperty,s=1,a=2,l=3,c=4,u=1,d=2,f=3,p=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,h=/[\x85\u2028\u2029]/,g=/[,\[\]{}]/,k=/^(?:!|!!|![0-9A-Za-z-]+!)$/,w=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function m(x){return Object.prototype.toString.call(x)}function b(x){return x===10||x===13}function v(x){return x===9||x===32}function S(x){return x===9||x===32||x===10||x===13}function T(x){return x===44||x===91||x===93||x===123||x===125}function N(x){if(x>=48&&x<=57)return x-48;const Y=x|32;return Y>=97&&Y<=102?Y-97+10:-1}function _(x){return x===120?2:x===117?4:x===85?8:0}function R(x){return x>=48&&x<=57?x-48:-1}function L(x){switch(x){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
532
- `;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 C(x){return x<=65535?String.fromCharCode(x):String.fromCharCode((x-65536>>10)+55296,(x-65536&1023)+56320)}function U(x,Y,se){Y==="__proto__"?Object.defineProperty(x,Y,{configurable:!0,enumerable:!0,writable:!0,value:se}):x[Y]=se}const $=new Array(256),G=new Array(256);for(let x=0;x<256;x++)$[x]=L(x)?1:0,G[x]=L(x);function I(x,Y){this.input=x,this.filename=Y.filename||null,this.schema=Y.schema||r,this.onWarning=Y.onWarning||null,this.legacy=Y.legacy||!1,this.json=Y.json||!1,this.listener=Y.listener||null,this.maxDepth=typeof Y.maxDepth=="number"?Y.maxDepth:100,this.maxTotalMergeKeys=typeof Y.maxTotalMergeKeys=="number"?Y.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=x.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 D(x,Y){const se={name:x.filename,buffer:x.input.slice(0,-1),position:x.position,line:x.line,column:x.position-x.lineStart};return se.snippet=n(se),new t(Y,se)}function A(x,Y){throw D(x,Y)}function M(x,Y){x.onWarning&&x.onWarning.call(null,D(x,Y))}function P(x,Y,se){const ge=x.anchorMapTransactions;if(ge.length!==0){const oe=ge[ge.length-1];i.call(oe,Y)||(oe[Y]={existed:i.call(x.anchorMap,Y),value:x.anchorMap[Y]})}x.anchorMap[Y]=se}function H(x){x.anchorMapTransactions.push(Object.create(null))}function E(x){const Y=x.anchorMapTransactions.pop(),se=x.anchorMapTransactions;if(se.length===0)return;const ge=se[se.length-1],oe=Object.keys(Y);for(let z=0,re=oe.length;z<re;z+=1){const ie=oe[z];i.call(ge,ie)||(ge[ie]=Y[ie])}}function j(x){const Y=x.anchorMapTransactions.pop(),se=Object.keys(Y);for(let ge=se.length-1;ge>=0;ge-=1){const oe=Y[se[ge]];oe.existed?x.anchorMap[se[ge]]=oe.value:delete x.anchorMap[se[ge]]}}function B(x){return{position:x.position,line:x.line,lineStart:x.lineStart,lineIndent:x.lineIndent,firstTabInLine:x.firstTabInLine,tag:x.tag,anchor:x.anchor,kind:x.kind,result:x.result}}function O(x,Y){x.position=Y.position,x.line=Y.line,x.lineStart=Y.lineStart,x.lineIndent=Y.lineIndent,x.firstTabInLine=Y.firstTabInLine,x.tag=Y.tag,x.anchor=Y.anchor,x.kind=Y.kind,x.result=Y.result}const Q={YAML:function(Y,se,ge){Y.version!==null&&A(Y,"duplication of %YAML directive"),ge.length!==1&&A(Y,"YAML directive accepts exactly one argument");const oe=/^([0-9]+)\.([0-9]+)$/.exec(ge[0]);oe===null&&A(Y,"ill-formed argument of the YAML directive");const z=parseInt(oe[1],10),re=parseInt(oe[2],10);z!==1&&A(Y,"unacceptable YAML version of the document"),Y.version=ge[0],Y.checkLineBreaks=re<2,re!==1&&re!==2&&M(Y,"unsupported YAML version of the document")},TAG:function(Y,se,ge){let oe;ge.length!==2&&A(Y,"TAG directive accepts exactly two arguments");const z=ge[0];oe=ge[1],k.test(z)||A(Y,"ill-formed tag handle (first argument) of the TAG directive"),i.call(Y.tagMap,z)&&A(Y,'there is a previously declared suffix for "'+z+'" tag handle'),w.test(oe)||A(Y,"ill-formed tag prefix (second argument) of the TAG directive");try{oe=decodeURIComponent(oe)}catch{A(Y,"tag prefix is malformed: "+oe)}Y.tagMap[z]=oe}};function F(x,Y,se,ge){if(Y<se){const oe=x.input.slice(Y,se);if(ge)for(let z=0,re=oe.length;z<re;z+=1){const ie=oe.charCodeAt(z);ie===9||ie>=32&&ie<=1114111||A(x,"expected valid JSON character")}else p.test(oe)&&A(x,"the stream contains non-printable characters");x.result+=oe}}function J(x){x.totalMergeKeys++,x.maxTotalMergeKeys!==-1&&x.totalMergeKeys>x.maxTotalMergeKeys&&A(x,"merge keys exceeded maxTotalMergeKeys ("+x.maxTotalMergeKeys+")")}function ce(x,Y,se,ge){e.isObject(se)||A(x,"cannot merge mappings; the provided source object is unacceptable"),J(x);const oe=Object.keys(se);for(let z=0,re=oe.length;z<re;z+=1){const ie=oe[z];J(x),i.call(Y,ie)||(U(Y,ie,se[ie]),ge[ie]=!0)}}function K(x,Y,se,ge,oe,z,re,ie,he){if(Array.isArray(oe)){oe=Array.prototype.slice.call(oe);for(let be=0,Ce=oe.length;be<Ce;be+=1)Array.isArray(oe[be])&&A(x,"nested arrays are not supported inside keys"),typeof oe=="object"&&m(oe[be])==="[object Object]"&&(oe[be]="[object Object]")}if(typeof oe=="object"&&m(oe)==="[object Object]"&&(oe="[object Object]"),oe=String(oe),Y===null&&(Y={}),ge==="tag:yaml.org,2002:merge")if(Array.isArray(z)){z.length>100&&A(x,"abnormal merge sequence size");for(let be=0,Ce=z.length;be<Ce;be+=1)ce(x,Y,z[be],se)}else ce(x,Y,z,se);else!x.json&&!i.call(se,oe)&&i.call(Y,oe)&&(x.line=re||x.line,x.lineStart=ie||x.lineStart,x.position=he||x.position,A(x,"duplicated mapping key")),U(Y,oe,z),delete se[oe];return Y}function q(x){const Y=x.input.charCodeAt(x.position);Y===10?x.position++:Y===13?(x.position++,x.input.charCodeAt(x.position)===10&&x.position++):A(x,"a line break is expected"),x.line+=1,x.lineStart=x.position,x.firstTabInLine=-1}function V(x,Y,se){let ge=0,oe=x.input.charCodeAt(x.position);for(;oe!==0;){for(;v(oe);)oe===9&&x.firstTabInLine===-1&&(x.firstTabInLine=x.position),oe=x.input.charCodeAt(++x.position);if(Y&&oe===35)do oe=x.input.charCodeAt(++x.position);while(oe!==10&&oe!==13&&oe!==0);if(b(oe))for(q(x),oe=x.input.charCodeAt(x.position),ge++,x.lineIndent=0;oe===32;)x.lineIndent++,oe=x.input.charCodeAt(++x.position);else break}return se!==-1&&ge!==0&&x.lineIndent<se&&M(x,"deficient indentation"),ge}function ue(x){let Y=x.position,se=x.input.charCodeAt(Y);return!!((se===45||se===46)&&se===x.input.charCodeAt(Y+1)&&se===x.input.charCodeAt(Y+2)&&(Y+=3,se=x.input.charCodeAt(Y),se===0||S(se)))}function me(x,Y){Y===1?x.result+=" ":Y>1&&(x.result+=e.repeat(`
533
- `,Y-1))}function Ne(x,Y,se){let ge,oe,z,re,ie,he;const be=x.kind,Ce=x.result;let xe=x.input.charCodeAt(x.position);if(S(xe)||T(xe)||xe===35||xe===38||xe===42||xe===33||xe===124||xe===62||xe===39||xe===34||xe===37||xe===64||xe===96)return!1;if(xe===63||xe===45){const Ae=x.input.charCodeAt(x.position+1);if(S(Ae)||se&&T(Ae))return!1}for(x.kind="scalar",x.result="",ge=oe=x.position,z=!1;xe!==0;){if(xe===58){const Ae=x.input.charCodeAt(x.position+1);if(S(Ae)||se&&T(Ae))break}else if(xe===35){const Ae=x.input.charCodeAt(x.position-1);if(S(Ae))break}else{if(x.position===x.lineStart&&ue(x)||se&&T(xe))break;if(b(xe))if(re=x.line,ie=x.lineStart,he=x.lineIndent,V(x,!1,-1),x.lineIndent>=Y){z=!0,xe=x.input.charCodeAt(x.position);continue}else{x.position=oe,x.line=re,x.lineStart=ie,x.lineIndent=he;break}}z&&(F(x,ge,oe,!1),me(x,x.line-re),ge=oe=x.position,z=!1),v(xe)||(oe=x.position+1),xe=x.input.charCodeAt(++x.position)}return F(x,ge,oe,!1),x.result?!0:(x.kind=be,x.result=Ce,!1)}function Te(x,Y){let se,ge,oe=x.input.charCodeAt(x.position);if(oe!==39)return!1;for(x.kind="scalar",x.result="",x.position++,se=ge=x.position;(oe=x.input.charCodeAt(x.position))!==0;)if(oe===39)if(F(x,se,x.position,!0),oe=x.input.charCodeAt(++x.position),oe===39)se=x.position,x.position++,ge=x.position;else return!0;else b(oe)?(F(x,se,ge,!0),me(x,V(x,!1,Y)),se=ge=x.position):x.position===x.lineStart&&ue(x)?A(x,"unexpected end of the document within a single quoted scalar"):(x.position++,v(oe)||(ge=x.position));A(x,"unexpected end of the stream within a single quoted scalar")}function ne(x,Y){let se,ge,oe,z=x.input.charCodeAt(x.position);if(z!==34)return!1;for(x.kind="scalar",x.result="",x.position++,se=ge=x.position;(z=x.input.charCodeAt(x.position))!==0;){if(z===34)return F(x,se,x.position,!0),x.position++,!0;if(z===92){if(F(x,se,x.position,!0),z=x.input.charCodeAt(++x.position),b(z))V(x,!1,Y);else if(z<256&&$[z])x.result+=G[z],x.position++;else if((oe=_(z))>0){let re=oe,ie=0;for(;re>0;re--)z=x.input.charCodeAt(++x.position),(oe=N(z))>=0?ie=(ie<<4)+oe:A(x,"expected hexadecimal character");x.result+=C(ie),x.position++}else A(x,"unknown escape sequence");se=ge=x.position}else b(z)?(F(x,se,ge,!0),me(x,V(x,!1,Y)),se=ge=x.position):x.position===x.lineStart&&ue(x)?A(x,"unexpected end of the document within a double quoted scalar"):(x.position++,v(z)||(ge=x.position))}A(x,"unexpected end of the stream within a double quoted scalar")}function pe(x,Y){let se=!0,ge,oe,z;const re=x.tag;let ie;const he=x.anchor;let be,Ce,xe,Ae;const Me=Object.create(null);let Ie,Le,$e,qe=x.input.charCodeAt(x.position);if(qe===91)be=93,Ae=!1,ie=[];else if(qe===123)be=125,Ae=!0,ie={};else return!1;for(x.anchor!==null&&P(x,x.anchor,ie),qe=x.input.charCodeAt(++x.position);qe!==0;){if(V(x,!0,Y),qe=x.input.charCodeAt(x.position),qe===be)return x.position++,x.tag=re,x.anchor=he,x.kind=Ae?"mapping":"sequence",x.result=ie,!0;if(se?qe===44&&A(x,"expected the node content, but found ','"):A(x,"missed comma between flow collection entries"),Le=Ie=$e=null,Ce=xe=!1,qe===63){const gt=x.input.charCodeAt(x.position+1);S(gt)&&(Ce=xe=!0,x.position++,V(x,!0,Y))}ge=x.line,oe=x.lineStart,z=x.position,Ue(x,Y,s,!1,!0),Le=x.tag,Ie=x.result,V(x,!0,Y),qe=x.input.charCodeAt(x.position),(xe||x.line===ge)&&qe===58&&(Ce=!0,qe=x.input.charCodeAt(++x.position),V(x,!0,Y),Ue(x,Y,s,!1,!0),$e=x.result),Ae?K(x,ie,Me,Le,Ie,$e,ge,oe,z):Ce?ie.push(K(x,null,Me,Le,Ie,$e,ge,oe,z)):ie.push(Ie),V(x,!0,Y),qe=x.input.charCodeAt(x.position),qe===44?(se=!0,qe=x.input.charCodeAt(++x.position)):se=!1}A(x,"unexpected end of the stream within a flow collection")}function le(x,Y){let se,ge=u,oe=!1,z=!1,re=Y,ie=0,he=!1,be,Ce=x.input.charCodeAt(x.position);if(Ce===124)se=!1;else if(Ce===62)se=!0;else return!1;for(x.kind="scalar",x.result="";Ce!==0;)if(Ce=x.input.charCodeAt(++x.position),Ce===43||Ce===45)u===ge?ge=Ce===43?f:d:A(x,"repeat of a chomping mode identifier");else if((be=R(Ce))>=0)be===0?A(x,"bad explicit indentation width of a block scalar; it cannot be less than one"):z?A(x,"repeat of an indentation width identifier"):(re=Y+be-1,z=!0);else break;if(v(Ce)){do Ce=x.input.charCodeAt(++x.position);while(v(Ce));if(Ce===35)do Ce=x.input.charCodeAt(++x.position);while(!b(Ce)&&Ce!==0)}for(;Ce!==0;){for(q(x),x.lineIndent=0,Ce=x.input.charCodeAt(x.position);(!z||x.lineIndent<re)&&Ce===32;)x.lineIndent++,Ce=x.input.charCodeAt(++x.position);if(!z&&x.lineIndent>re&&(re=x.lineIndent),b(Ce)){ie++;continue}if(!z&&re===0&&A(x,"missing indentation for block scalar"),x.lineIndent<re){ge===f?x.result+=e.repeat(`
534
- `,oe?1+ie:ie):ge===u&&oe&&(x.result+=`
535
- `);break}se?v(Ce)?(he=!0,x.result+=e.repeat(`
536
- `,oe?1+ie:ie)):he?(he=!1,x.result+=e.repeat(`
537
- `,ie+1)):ie===0?oe&&(x.result+=" "):x.result+=e.repeat(`
538
- `,ie):x.result+=e.repeat(`
539
- `,oe?1+ie:ie),oe=!0,z=!0,ie=0;const xe=x.position;for(;!b(Ce)&&Ce!==0;)Ce=x.input.charCodeAt(++x.position);F(x,xe,x.position,!1)}return!0}function de(x,Y){const se=x.tag,ge=x.anchor,oe=[];let z=!1;if(x.firstTabInLine!==-1)return!1;x.anchor!==null&&P(x,x.anchor,oe);let re=x.input.charCodeAt(x.position);for(;re!==0&&(x.firstTabInLine!==-1&&(x.position=x.firstTabInLine,A(x,"tab characters must not be used in indentation")),re===45);){const ie=x.input.charCodeAt(x.position+1);if(!S(ie))break;if(z=!0,x.position++,V(x,!0,-1)&&x.lineIndent<=Y){oe.push(null),re=x.input.charCodeAt(x.position);continue}const he=x.line;if(Ue(x,Y,l,!1,!0),oe.push(x.result),V(x,!0,-1),re=x.input.charCodeAt(x.position),(x.line===he||x.lineIndent>Y)&&re!==0)A(x,"bad indentation of a sequence entry");else if(x.lineIndent<Y)break}return z?(x.tag=se,x.anchor=ge,x.kind="sequence",x.result=oe,!0):!1}function Ke(x,Y,se){let ge,oe,z,re;const ie=x.tag,he=x.anchor,be={},Ce=Object.create(null);let xe=null,Ae=null,Me=null,Ie=!1,Le=!1;if(x.firstTabInLine!==-1)return!1;x.anchor!==null&&P(x,x.anchor,be);let $e=x.input.charCodeAt(x.position);for(;$e!==0;){!Ie&&x.firstTabInLine!==-1&&(x.position=x.firstTabInLine,A(x,"tab characters must not be used in indentation"));const qe=x.input.charCodeAt(x.position+1),gt=x.line;if(($e===63||$e===58)&&S(qe))$e===63?(Ie&&(K(x,be,Ce,xe,Ae,null,oe,z,re),xe=Ae=Me=null),Le=!0,Ie=!0,ge=!0):Ie?(Ie=!1,ge=!0):A(x,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),x.position+=1,$e=qe;else{if(oe=x.line,z=x.lineStart,re=x.position,!Ue(x,se,a,!1,!0))break;if(x.line===gt){for($e=x.input.charCodeAt(x.position);v($e);)$e=x.input.charCodeAt(++x.position);if($e===58)$e=x.input.charCodeAt(++x.position),S($e)||A(x,"a whitespace character is expected after the key-value separator within a block mapping"),Ie&&(K(x,be,Ce,xe,Ae,null,oe,z,re),xe=Ae=Me=null),Le=!0,Ie=!1,ge=!1,xe=x.tag,Ae=x.result;else if(Le)A(x,"can not read an implicit mapping pair; a colon is missed");else return x.tag=ie,x.anchor=he,!0}else if(Le)A(x,"can not read a block mapping entry; a multiline key may not be an implicit key");else return x.tag=ie,x.anchor=he,!0}if((x.line===gt||x.lineIndent>Y)&&(Ie&&(oe=x.line,z=x.lineStart,re=x.position),Ue(x,Y,c,!0,ge)&&(Ie?Ae=x.result:Me=x.result),Ie||(K(x,be,Ce,xe,Ae,Me,oe,z,re),xe=Ae=Me=null),V(x,!0,-1),$e=x.input.charCodeAt(x.position)),(x.line===gt||x.lineIndent>Y)&&$e!==0)A(x,"bad indentation of a mapping entry");else if(x.lineIndent<Y)break}return Ie&&K(x,be,Ce,xe,Ae,null,oe,z,re),Le&&(x.tag=ie,x.anchor=he,x.kind="mapping",x.result=be),Le}function He(x){let Y=!1,se=!1,ge,oe,z=x.input.charCodeAt(x.position);if(z!==33)return!1;x.tag!==null&&A(x,"duplication of a tag property"),z=x.input.charCodeAt(++x.position),z===60?(Y=!0,z=x.input.charCodeAt(++x.position)):z===33?(se=!0,ge="!!",z=x.input.charCodeAt(++x.position)):ge="!";let re=x.position;if(Y){do z=x.input.charCodeAt(++x.position);while(z!==0&&z!==62);x.position<x.length?(oe=x.input.slice(re,x.position),z=x.input.charCodeAt(++x.position)):A(x,"unexpected end of the stream within a verbatim tag")}else{for(;z!==0&&!S(z);)z===33&&(se?A(x,"tag suffix cannot contain exclamation marks"):(ge=x.input.slice(re-1,x.position+1),k.test(ge)||A(x,"named tag handle cannot contain such characters"),se=!0,re=x.position+1)),z=x.input.charCodeAt(++x.position);oe=x.input.slice(re,x.position),g.test(oe)&&A(x,"tag suffix cannot contain flow indicator characters")}oe&&!w.test(oe)&&A(x,"tag name cannot contain such characters: "+oe);try{oe=decodeURIComponent(oe)}catch{A(x,"tag name is malformed: "+oe)}return Y?x.tag=oe:i.call(x.tagMap,ge)?x.tag=x.tagMap[ge]+oe:ge==="!"?x.tag="!"+oe:ge==="!!"?x.tag="tag:yaml.org,2002:"+oe:A(x,'undeclared tag handle "'+ge+'"'),!0}function Fe(x){let Y=x.input.charCodeAt(x.position);if(Y!==38)return!1;x.anchor!==null&&A(x,"duplication of an anchor property"),Y=x.input.charCodeAt(++x.position);const se=x.position;for(;Y!==0&&!S(Y)&&!T(Y);)Y=x.input.charCodeAt(++x.position);return x.position===se&&A(x,"name of an anchor node must contain at least one character"),x.anchor=x.input.slice(se,x.position),!0}function dt(x){let Y=x.input.charCodeAt(x.position);if(Y!==42)return!1;Y=x.input.charCodeAt(++x.position);const se=x.position;for(;Y!==0&&!S(Y)&&!T(Y);)Y=x.input.charCodeAt(++x.position);x.position===se&&A(x,"name of an alias node must contain at least one character");const ge=x.input.slice(se,x.position);return i.call(x.anchorMap,ge)||A(x,'unidentified alias "'+ge+'"'),x.result=x.anchorMap[ge],V(x,!0,-1),!0}function st(x,Y,se,ge){const oe=B(x);return H(x),O(x,Y),x.tag=null,x.anchor=null,x.kind=null,x.result=null,Ke(x,se,ge)&&x.kind==="mapping"?(E(x),!0):(j(x),O(x,oe),!1)}function Ue(x,Y,se,ge,oe){let z,re,ie=1,he=!1,be=!1,Ce=null,xe,Ae,Me;x.depth>=x.maxDepth&&A(x,"nesting exceeded maxDepth ("+x.maxDepth+")"),x.depth+=1,x.listener!==null&&x.listener("open",x),x.tag=null,x.anchor=null,x.kind=null,x.result=null;const Ie=z=re=c===se||l===se;if(ge&&V(x,!0,-1)&&(he=!0,x.lineIndent>Y?ie=1:x.lineIndent===Y?ie=0:x.lineIndent<Y&&(ie=-1)),ie===1)for(;;){const Le=x.input.charCodeAt(x.position),$e=B(x);if(he&&(Le===33&&x.tag!==null||Le===38&&x.anchor!==null)||!He(x)&&!Fe(x))break;Ce===null&&(Ce=$e),V(x,!0,-1)?(he=!0,re=Ie,x.lineIndent>Y?ie=1:x.lineIndent===Y?ie=0:x.lineIndent<Y&&(ie=-1)):re=!1}if(re&&(re=he||oe),ie===1||c===se)if(s===se||a===se?Ae=Y:Ae=Y+1,Me=x.position-x.lineStart,ie===1)if(re&&(de(x,Me)||Ke(x,Me,Ae))||pe(x,Ae))be=!0;else{const Le=x.input.charCodeAt(x.position);Ce!==null&&Ie&&!re&&Le!==124&&Le!==62&&st(x,Ce,Ce.position-Ce.lineStart,Ae)||z&&le(x,Ae)||Te(x,Ae)||ne(x,Ae)?be=!0:dt(x)?(be=!0,(x.tag!==null||x.anchor!==null)&&A(x,"alias node should not have any properties")):Ne(x,Ae,s===se)&&(be=!0,x.tag===null&&(x.tag="?")),x.anchor!==null&&P(x,x.anchor,x.result)}else ie===0&&(be=re&&de(x,Me));if(x.tag===null)x.anchor!==null&&P(x,x.anchor,x.result);else if(x.tag==="?"){x.result!==null&&x.kind!=="scalar"&&A(x,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+x.kind+'"');for(let Le=0,$e=x.implicitTypes.length;Le<$e;Le+=1)if(xe=x.implicitTypes[Le],xe.resolve(x.result)){x.result=xe.construct(x.result),x.tag=xe.tag,x.anchor!==null&&P(x,x.anchor,x.result);break}}else if(x.tag!=="!"){if(i.call(x.typeMap[x.kind||"fallback"],x.tag))xe=x.typeMap[x.kind||"fallback"][x.tag];else{xe=null;const Le=x.typeMap.multi[x.kind||"fallback"];for(let $e=0,qe=Le.length;$e<qe;$e+=1)if(x.tag.slice(0,Le[$e].tag.length)===Le[$e].tag){xe=Le[$e];break}}xe||A(x,"unknown tag !<"+x.tag+">"),x.result!==null&&xe.kind!==x.kind&&A(x,"unacceptable node kind for !<"+x.tag+'> tag; it should be "'+xe.kind+'", not "'+x.kind+'"'),xe.resolve(x.result,x.tag)?(x.result=xe.construct(x.result,x.tag),x.anchor!==null&&P(x,x.anchor,x.result)):A(x,"cannot resolve a node with !<"+x.tag+"> explicit tag")}return x.listener!==null&&x.listener("close",x),x.depth-=1,x.tag!==null||x.anchor!==null||be}function at(x){const Y=x.position;let se=!1,ge;for(x.version=null,x.checkLineBreaks=x.legacy,x.tagMap=Object.create(null),x.anchorMap=Object.create(null);(ge=x.input.charCodeAt(x.position))!==0&&(V(x,!0,-1),ge=x.input.charCodeAt(x.position),!(x.lineIndent>0||ge!==37));){se=!0,ge=x.input.charCodeAt(++x.position);let oe=x.position;for(;ge!==0&&!S(ge);)ge=x.input.charCodeAt(++x.position);const z=x.input.slice(oe,x.position),re=[];for(z.length<1&&A(x,"directive name must not be less than one character in length");ge!==0;){for(;v(ge);)ge=x.input.charCodeAt(++x.position);if(ge===35){do ge=x.input.charCodeAt(++x.position);while(ge!==0&&!b(ge));break}if(b(ge))break;for(oe=x.position;ge!==0&&!S(ge);)ge=x.input.charCodeAt(++x.position);re.push(x.input.slice(oe,x.position))}ge!==0&&q(x),i.call(Q,z)?Q[z](x,z,re):M(x,'unknown document directive "'+z+'"')}if(V(x,!0,-1),x.lineIndent===0&&x.input.charCodeAt(x.position)===45&&x.input.charCodeAt(x.position+1)===45&&x.input.charCodeAt(x.position+2)===45?(x.position+=3,V(x,!0,-1)):se&&A(x,"directives end mark is expected"),Ue(x,x.lineIndent-1,c,!1,!0),V(x,!0,-1),x.checkLineBreaks&&h.test(x.input.slice(Y,x.position))&&M(x,"non-ASCII line breaks are interpreted as content"),x.documents.push(x.result),x.position===x.lineStart&&ue(x)){x.input.charCodeAt(x.position)===46&&(x.position+=3,V(x,!0,-1));return}x.position<x.length-1&&A(x,"end of the stream or a document separator is expected")}function Z(x,Y){x=String(x),Y=Y||{},x.length!==0&&(x.charCodeAt(x.length-1)!==10&&x.charCodeAt(x.length-1)!==13&&(x+=`
540
- `),x.charCodeAt(0)===65279&&(x=x.slice(1)));const se=new I(x,Y),ge=x.indexOf("\0");for(ge!==-1&&(se.position=ge,A(se,"null byte is not allowed in input")),se.input+="\0";se.input.charCodeAt(se.position)===32;)se.lineIndent+=1,se.position+=1;for(;se.position<se.length-1;)at(se);return se.documents}function ae(x,Y,se){Y!==null&&typeof Y=="object"&&typeof se>"u"&&(se=Y,Y=null);const ge=Z(x,se);if(typeof Y!="function")return ge;for(let oe=0,z=ge.length;oe<z;oe+=1)Y(ge[oe])}function _e(x,Y){const se=Z(x,Y);if(se.length!==0){if(se.length===1)return se[0];throw new t("expected a single document in the stream, but found more")}}return wd.loadAll=ae,wd.load=_e,wd}var Vm={},FS;function tQ(){if(FS)return Vm;FS=1;const e=Eu(),t=Nu(),n=Cy(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,s=65279,a=9,l=10,c=13,u=32,d=33,f=34,p=35,h=37,g=38,k=39,w=42,m=44,b=45,v=58,S=61,T=62,N=63,_=64,R=91,L=93,C=96,U=123,$=124,G=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 D=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],A=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function M(z,re){if(re===null)return{};const ie={},he=Object.keys(re);for(let be=0,Ce=he.length;be<Ce;be+=1){let xe=he[be],Ae=String(re[xe]);xe.slice(0,2)==="!!"&&(xe="tag:yaml.org,2002:"+xe.slice(2));const Me=z.compiledTypeMap.fallback[xe];Me&&i.call(Me.styleAliases,Ae)&&(Ae=Me.styleAliases[Ae]),ie[xe]=Ae}return ie}function P(z){let re,ie;const he=z.toString(16).toUpperCase();if(z<=255)re="x",ie=2;else if(z<=65535)re="u",ie=4;else if(z<=4294967295)re="U",ie=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+re+e.repeat("0",ie-he.length)+he}const H=1,E=2;function j(z){this.schema=z.schema||n,this.indent=Math.max(1,z.indent||2),this.noArrayIndent=z.noArrayIndent||!1,this.skipInvalid=z.skipInvalid||!1,this.flowLevel=e.isNothing(z.flowLevel)?-1:z.flowLevel,this.styleMap=M(this.schema,z.styles||null),this.sortKeys=z.sortKeys||!1,this.lineWidth=z.lineWidth||80,this.noRefs=z.noRefs||!1,this.noCompatMode=z.noCompatMode||!1,this.condenseFlow=z.condenseFlow||!1,this.quotingType=z.quotingType==='"'?E:H,this.forceQuotes=z.forceQuotes||!1,this.replacer=typeof z.replacer=="function"?z.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function B(z,re){const ie=e.repeat(" ",re);let he=0,be="";const Ce=z.length;for(;he<Ce;){let xe;const Ae=z.indexOf(`
541
- `,he);Ae===-1?(xe=z.slice(he),he=Ce):(xe=z.slice(he,Ae+1),he=Ae+1),xe.length&&xe!==`
542
- `&&(be+=ie),be+=xe}return be}function O(z,re){return`
543
- `+e.repeat(" ",z.indent*re)}function Q(z,re){for(let ie=0,he=z.implicitTypes.length;ie<he;ie+=1)if(z.implicitTypes[ie].resolve(re))return!0;return!1}function F(z){return z===u||z===a}function J(z){return z>=32&&z<=126||z>=161&&z<=55295&&z!==8232&&z!==8233||z>=57344&&z<=65533&&z!==s||z>=65536&&z<=1114111}function ce(z){return J(z)&&z!==s&&z!==c&&z!==l}function K(z,re,ie){const he=ce(z),be=he&&!F(z);return(ie?he:he&&z!==m&&z!==R&&z!==L&&z!==U&&z!==G)&&z!==p&&!(re===v&&!be)||ce(re)&&!F(re)&&z===p||re===v&&be}function q(z){return J(z)&&z!==s&&!F(z)&&z!==b&&z!==N&&z!==v&&z!==m&&z!==R&&z!==L&&z!==U&&z!==G&&z!==p&&z!==g&&z!==w&&z!==d&&z!==$&&z!==S&&z!==T&&z!==k&&z!==f&&z!==h&&z!==_&&z!==C}function V(z){return!F(z)&&z!==v}function ue(z,re){const ie=z.charCodeAt(re);let he;return ie>=55296&&ie<=56319&&re+1<z.length&&(he=z.charCodeAt(re+1),he>=56320&&he<=57343)?(ie-55296)*1024+he-56320+65536:ie}function me(z){return/^\n* /.test(z)}const Ne=1,Te=2,ne=3,pe=4,le=5;function de(z,re,ie,he,be,Ce,xe,Ae){let Me,Ie=0,Le=null,$e=!1,qe=!1;const gt=he!==-1;let ft=-1,Dt=q(ue(z,0))&&V(ue(z,z.length-1));if(re||xe)for(Me=0;Me<z.length;Ie>=65536?Me+=2:Me++){if(Ie=ue(z,Me),!J(Ie))return le;Dt=Dt&&K(Ie,Le,Ae),Le=Ie}else{for(Me=0;Me<z.length;Ie>=65536?Me+=2:Me++){if(Ie=ue(z,Me),Ie===l)$e=!0,gt&&(qe=qe||Me-ft-1>he&&z[ft+1]!==" ",ft=Me);else if(!J(Ie))return le;Dt=Dt&&K(Ie,Le,Ae),Le=Ie}qe=qe||gt&&Me-ft-1>he&&z[ft+1]!==" "}return!$e&&!qe?Dt&&!xe&&!be(z)?Ne:Ce===E?le:Te:ie>9&&me(z)?le:xe?Ce===E?le:Te:qe?pe:ne}function Ke(z,re,ie,he,be){z.dump=function(){if(re.length===0)return z.quotingType===E?'""':"''";if(!z.noCompatMode&&(D.indexOf(re)!==-1||A.test(re)))return z.quotingType===E?'"'+re+'"':"'"+re+"'";const Ce=z.indent*Math.max(1,ie),xe=z.lineWidth===-1?-1:Math.max(Math.min(z.lineWidth,40),z.lineWidth-Ce),Ae=he||z.flowLevel>-1&&ie>=z.flowLevel;function Me(Ie){return Q(z,Ie)}switch(de(re,Ae,z.indent,xe,Me,z.quotingType,z.forceQuotes&&!he,be)){case Ne:return re;case Te:return"'"+re.replace(/'/g,"''")+"'";case ne:return"|"+He(re,z.indent)+Fe(B(re,Ce));case pe:return">"+He(re,z.indent)+Fe(B(dt(re,xe),Ce));case le:return'"'+Ue(re)+'"';default:throw new t("impossible error: invalid scalar style")}}()}function He(z,re){const ie=me(z)?String(re):"",he=z[z.length-1]===`
544
- `,Ce=he&&(z[z.length-2]===`
545
- `||z===`
546
- `)?"+":he?"":"-";return ie+Ce+`
547
- `}function Fe(z){return z[z.length-1]===`
548
- `?z.slice(0,-1):z}function dt(z,re){const ie=/(\n+)([^\n]*)/g;let he=function(){let Ae=z.indexOf(`
549
- `);return Ae=Ae!==-1?Ae:z.length,ie.lastIndex=Ae,st(z.slice(0,Ae),re)}(),be=z[0]===`
550
- `||z[0]===" ",Ce,xe;for(;xe=ie.exec(z);){const Ae=xe[1],Me=xe[2];Ce=Me[0]===" ",he+=Ae+(!be&&!Ce&&Me!==""?`
551
- `:"")+st(Me,re),be=Ce}return he}function st(z,re){if(z===""||z[0]===" ")return z;const ie=/ [^ ]/g;let he,be=0,Ce,xe=0,Ae=0,Me="";for(;he=ie.exec(z);)Ae=he.index,Ae-be>re&&(Ce=xe>be?xe:Ae,Me+=`
552
- `+z.slice(be,Ce),be=Ce+1),xe=Ae;return Me+=`
553
- `,z.length-be>re&&xe>be?Me+=z.slice(be,xe)+`
554
- `+z.slice(xe+1):Me+=z.slice(be),Me.slice(1)}function Ue(z){let re="",ie=0;for(let he=0;he<z.length;ie>=65536?he+=2:he++){ie=ue(z,he);const be=I[ie];!be&&J(ie)?(re+=z[he],ie>=65536&&(re+=z[he+1])):re+=be||P(ie)}return re}function at(z,re,ie){let he="";const be=z.tag;for(let Ce=0,xe=ie.length;Ce<xe;Ce+=1){let Ae=ie[Ce];z.replacer&&(Ae=z.replacer.call(ie,String(Ce),Ae)),(Y(z,re,Ae,!1,!1)||typeof Ae>"u"&&Y(z,re,null,!1,!1))&&(he!==""&&(he+=","+(z.condenseFlow?"":" ")),he+=z.dump)}z.tag=be,z.dump="["+he+"]"}function Z(z,re,ie,he){let be="";const Ce=z.tag;for(let xe=0,Ae=ie.length;xe<Ae;xe+=1){let Me=ie[xe];z.replacer&&(Me=z.replacer.call(ie,String(xe),Me)),(Y(z,re+1,Me,!0,!0,!1,!0)||typeof Me>"u"&&Y(z,re+1,null,!0,!0,!1,!0))&&((!he||be!=="")&&(be+=O(z,re)),z.dump&&l===z.dump.charCodeAt(0)?be+="-":be+="- ",be+=z.dump)}z.tag=Ce,z.dump=be||"[]"}function ae(z,re,ie){let he="";const be=z.tag,Ce=Object.keys(ie);for(let xe=0,Ae=Ce.length;xe<Ae;xe+=1){let Me="";he!==""&&(Me+=", "),z.condenseFlow&&(Me+='"');const Ie=Ce[xe];let Le=ie[Ie];z.replacer&&(Le=z.replacer.call(ie,Ie,Le)),Y(z,re,Ie,!1,!1)&&(z.dump.length>1024&&(Me+="? "),Me+=z.dump+(z.condenseFlow?'"':"")+":"+(z.condenseFlow?"":" "),Y(z,re,Le,!1,!1)&&(Me+=z.dump,he+=Me))}z.tag=be,z.dump="{"+he+"}"}function _e(z,re,ie,he){let be="";const Ce=z.tag,xe=Object.keys(ie);if(z.sortKeys===!0)xe.sort();else if(typeof z.sortKeys=="function")xe.sort(z.sortKeys);else if(z.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let Ae=0,Me=xe.length;Ae<Me;Ae+=1){let Ie="";(!he||be!=="")&&(Ie+=O(z,re));const Le=xe[Ae];let $e=ie[Le];if(z.replacer&&($e=z.replacer.call(ie,Le,$e)),!Y(z,re+1,Le,!0,!0,!0))continue;const qe=z.tag!==null&&z.tag!=="?"||z.dump&&z.dump.length>1024;qe&&(z.dump&&l===z.dump.charCodeAt(0)?Ie+="?":Ie+="? "),Ie+=z.dump,qe&&(Ie+=O(z,re)),Y(z,re+1,$e,!0,qe)&&(z.dump&&l===z.dump.charCodeAt(0)?Ie+=":":Ie+=": ",Ie+=z.dump,be+=Ie)}z.tag=Ce,z.dump=be||"{}"}function x(z,re,ie){const he=ie?z.explicitTypes:z.implicitTypes;for(let be=0,Ce=he.length;be<Ce;be+=1){const xe=he[be];if((xe.instanceOf||xe.predicate)&&(!xe.instanceOf||typeof re=="object"&&re instanceof xe.instanceOf)&&(!xe.predicate||xe.predicate(re))){if(ie?xe.multi&&xe.representName?z.tag=xe.representName(re):z.tag=xe.tag:z.tag="?",xe.represent){const Ae=z.styleMap[xe.tag]||xe.defaultStyle;let Me;if(r.call(xe.represent)==="[object Function]")Me=xe.represent(re,Ae);else if(i.call(xe.represent,Ae))Me=xe.represent[Ae](re,Ae);else throw new t("!<"+xe.tag+'> tag resolver accepts not "'+Ae+'" style');z.dump=Me}return!0}}return!1}function Y(z,re,ie,he,be,Ce,xe){z.tag=null,z.dump=ie,x(z,ie,!1)||x(z,ie,!0);const Ae=r.call(z.dump),Me=he;he&&(he=z.flowLevel<0||z.flowLevel>re);const Ie=Ae==="[object Object]"||Ae==="[object Array]";let Le,$e;if(Ie&&(Le=z.duplicates.indexOf(ie),$e=Le!==-1),(z.tag!==null&&z.tag!=="?"||$e||z.indent!==2&&re>0)&&(be=!1),$e&&z.usedDuplicates[Le])z.dump="*ref_"+Le;else{if(Ie&&$e&&!z.usedDuplicates[Le]&&(z.usedDuplicates[Le]=!0),Ae==="[object Object]")he&&Object.keys(z.dump).length!==0?(_e(z,re,z.dump,be),$e&&(z.dump="&ref_"+Le+z.dump)):(ae(z,re,z.dump),$e&&(z.dump="&ref_"+Le+" "+z.dump));else if(Ae==="[object Array]")he&&z.dump.length!==0?(z.noArrayIndent&&!xe&&re>0?Z(z,re-1,z.dump,be):Z(z,re,z.dump,be),$e&&(z.dump="&ref_"+Le+z.dump)):(at(z,re,z.dump),$e&&(z.dump="&ref_"+Le+" "+z.dump));else if(Ae==="[object String]")z.tag!=="?"&&Ke(z,z.dump,re,Ce,Me);else{if(Ae==="[object Undefined]")return!1;if(z.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+Ae)}if(z.tag!==null&&z.tag!=="?"){let qe=encodeURI(z.tag[0]==="!"?z.tag.slice(1):z.tag).replace(/!/g,"%21");z.tag[0]==="!"?qe="!"+qe:qe.slice(0,18)==="tag:yaml.org,2002:"?qe="!!"+qe.slice(18):qe="!<"+qe+">",z.dump=qe+" "+z.dump}}return!0}function se(z,re){const ie=[],he=[];ge(z,ie,he);const be=he.length;for(let Ce=0;Ce<be;Ce+=1)re.duplicates.push(ie[he[Ce]]);re.usedDuplicates=new Array(be)}function ge(z,re,ie){if(z!==null&&typeof z=="object"){const he=re.indexOf(z);if(he!==-1)ie.indexOf(he)===-1&&ie.push(he);else if(re.push(z),Array.isArray(z))for(let be=0,Ce=z.length;be<Ce;be+=1)ge(z[be],re,ie);else{const be=Object.keys(z);for(let Ce=0,xe=be.length;Ce<xe;Ce+=1)ge(z[be[Ce]],re,ie)}}}function oe(z,re){re=re||{};const ie=new j(re);ie.noRefs||se(z,ie);let he=z;return ie.replacer&&(he=ie.replacer.call({"":he},"",he)),Y(ie,0,he,!0,!0)?ie.dump+`
555
- `:""}return Vm.dump=oe,Vm}var $S;function nQ(){if($S)return _n;$S=1;const e=eQ(),t=tQ();function n(r,i){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}return _n.Type=Hn(),_n.Schema=wj(),_n.FAILSAFE_SCHEMA=_j(),_n.JSON_SCHEMA=jj(),_n.CORE_SCHEMA=Oj(),_n.DEFAULT_SCHEMA=Cy(),_n.load=e.load,_n.loadAll=e.loadAll,_n.dump=t.dump,_n.YAMLException=Nu(),_n.types={binary:Ij(),float:Mj(),map:Nj(),null:Cj(),pairs:zj(),set:Pj(),timestamp:Rj(),bool:Tj(),int:Aj(),merge:Dj(),omap:Lj(),seq:Ej(),str:Sj()},_n.safeLoad=n("safeLoad","load"),_n.safeLoadAll=n("safeLoadAll","loadAll"),_n.safeDump=n("safeDump","dump"),_n}var rQ=nQ();const Uj=QZ(rQ),{Type:zQ,Schema:PQ,FAILSAFE_SCHEMA:UQ,JSON_SCHEMA:BQ,CORE_SCHEMA:HQ,DEFAULT_SCHEMA:FQ,load:$Q,loadAll:GQ,dump:KQ,YAMLException:qQ,types:YQ,safeLoad:VQ,safeLoadAll:XQ,safeDump:WQ}=Uj;function Bj(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 r=Uj.load(t[1]);if(r&&typeof r=="object"&&!Array.isArray(r))return{frontmatter:r,body:n}}catch{}return{frontmatter:null,body:e}}function Hj({data:e}){const t=We(),n=Object.entries(e);return n.length?o.jsxs("div",{className:"mb-4 rounded-md border border-white/[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(([r,i])=>o.jsxs("div",{className:"contents",children:[o.jsx("dt",{className:"font-mono text-neutral-500",children:r}),o.jsx("dd",{className:"font-mono text-neutral-200 break-all",children:iQ(i)})]},r))})]}):null}function iQ(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e)}const sQ=/^[^/]+\/skills\/[^/]+\//;function Q0(e){const t=e.lastIndexOf("/");return t<0?e:e.slice(t+1)}function aQ(e){const t={children:[]};for(const r of e){const s=r.relPath.replace(sQ,"").split("/");let a=t,l="";for(let c=0;c<s.length;c++){const u=s[c];if(l=l?`${l}/${u}`:u,c===s.length-1)a.children.push({type:"file",file:r});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=r=>{r.children.sort((i,s)=>{const a=i.type==="dir",l=s.type==="dir";if(a!==l)return a?-1:1;if(i.type==="file"&&s.type==="file"){const d=i.file.relPath.endsWith("/SKILL.md")?0:1,f=s.file.relPath.endsWith("/SKILL.md")?0:1;if(d!==f)return d-f}const c=i.type==="file"?Q0(i.file.relPath):i.name,u=s.type==="file"?Q0(s.file.relPath):s.name;return c.localeCompare(u)}),r.children.forEach(i=>{i.type==="dir"&&n(i)})};return n(t),t.children}function Fj({node:e,depth:t,selectedRel:n,onSelect:r,collapsed:i,onToggle:s}){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:()=>r(e.file),style:{paddingLeft:a},className:ye("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(ou,{className:"h-3 w-3 shrink-0 text-blue-400"}):o.jsx(Es,{className:"h-3 w-3 shrink-0 text-neutral-500"}),o.jsx("span",{className:"truncate",children:Q0(e.file.relPath)})]})}const l=i.has(e.path);return o.jsxs("div",{children:[o.jsxs("button",{onClick:()=>s(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(Un,{className:"h-3 w-3 shrink-0"}):o.jsx(Pn,{className:"h-3 w-3 shrink-0"}),o.jsx(Ir,{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(Fj,{node:c,depth:t+1,selectedRel:n,onSelect:r,collapsed:i,onToggle:s},c.type==="dir"?c.path:c.file.relPath))]})}function lQ({projectId:e,name:t,scope:n,source:r,pluginKey:i,agent:s,files:a,readOnly:l,outdated:c,custom:u,onUninstall:d,onClose:f}){var j;const p=We(),h=n==="user"&&!!r,[g,k]=y.useState(a),[w,m]=y.useState(()=>a.find(O=>O.relPath.endsWith("/SKILL.md"))??a[0]??null),[b,v]=y.useState(null),[S,T]=y.useState(null),[N,_]=y.useState(0),R=y.useRef(w);R.current=w;const L=y.useMemo(()=>aQ(g),[g]),[C,U]=y.useState(new Set),$=B=>U(O=>{const Q=new Set(O);return Q.has(B)?Q.delete(B):Q.add(B),Q}),G=y.useMemo(()=>{const B=[],O=Q=>{for(const F of Q)F.type==="dir"&&(B.push(F.path),O(F.children))};return O(L),B},[L]),I=C.size>0,D=()=>U(I?new Set:new Set(G));y.useEffect(()=>{if(!h)return;let B=!1;return Se.listGlobalSkillFiles(e,{source:r,name:t,pluginKey:i}).then(O=>{if(B)return;k(O);const Q=O.find(F=>F.relPath.endsWith("/SKILL.md"));m(F=>F??Q??O[0]??null)}).catch(O=>{B||T(String(O))}),()=>{B=!0}},[e,h,r,t,i]),y.useEffect(()=>{if(!w){v(null),T(null);return}let B=!1;return v(null),T(null),(h?Se.readGlobalSkillFile(e,{source:r,name:t,pluginKey:i,path:w.relPath}):Se.readFile(e,w.relPath)).then(Q=>{B||v(Q.content)}).catch(Q=>{B||T(String(Q))}),()=>{B=!0}},[e,h,r,t,i,w,N]),y.useEffect(()=>{if(h)return sl(B=>{if(B.type!=="asset")return;const O=B,Q=R.current;Q&&O.absPath===Q.absPath&&_(F=>F+1)})},[h]);const A=(w==null?void 0:w.relPath.toLowerCase().endsWith(".md"))??!1,M=b!=null&&A?Bj(b):null,P=(r==null?void 0:r.endsWith("-plugin"))??!1,H=r?An(uu(r)).label:"",E=((j=a[0])==null?void 0:j.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-white/[0.08] shadow-mac",children:[o.jsxs("div",{className:"flex items-center gap-2 p-3 border-b border-white/[0.06]",children:[o.jsx(Es,{className:"h-4 w-4 shrink-0 text-blue-400"}),o.jsx("span",{className:"text-sm font-semibold truncate",children:t}),i&&o.jsx("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",title:p("skillGrid.keyTip"),children:i}),n==="project"?o.jsx(Ye,{variant:"default",children:"project"}):o.jsxs(o.Fragment,{children:[o.jsx(Ye,{variant:"skill",children:"global"}),l&&o.jsx(Ye,{variant:"settings",children:p("skillDetail.readOnly")})]}),h&&o.jsxs(o.Fragment,{children:[o.jsx(Ye,{variant:P?"mcp":"skill",children:p(P?"skillDetail.plugin":"skillDetail.local")}),o.jsx(Ye,{variant:"other",children:H})]}),o.jsx(Ye,{children:p("skillDetail.fileCount",{n:g.length})}),c&&o.jsx(Ye,{variant:"warning",children:p("skillDetail.update")}),u&&o.jsx(Ye,{variant:"other",children:p("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:p("skillDetail.uninstallTitle"),children:o.jsx(Fr,{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-white/[0.06] overflow-y-auto p-2 space-y-0.5",children:[L.length>0&&o.jsx("div",{className:"flex items-center gap-1 pb-1.5 mb-1 border-b border-white/[0.06]",children:o.jsxs("button",{onClick:D,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:p(I?"skillDetail.expandAllDirs":"skillDetail.collapseAllDirs"),children:[I?o.jsx(lu,{className:"h-2.5 w-2.5"}):o.jsx(au,{className:"h-2.5 w-2.5"}),p(I?"skillDetail.expandAll":"skillDetail.collapseAll")]})}),L.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:p(h?"common.loading":"skillDetail.noFiles")}),L.map(B=>o.jsx(Fj,{node:B,depth:0,selectedRel:w==null?void 0:w.relPath,onSelect:m,collapsed:C,onToggle:$},B.type==="dir"?B.path:B.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}),b==null&&!S&&o.jsx("p",{className:"text-xs text-neutral-500",children:p("common.loading")}),M&&o.jsxs(o.Fragment,{children:[M.frontmatter&&o.jsx(Hj,{data:M.frontmatter}),o.jsx("div",{className:"prose prose-invert prose-sm max-w-none",children:o.jsx(cy,{remarkPlugins:[gy],rehypePlugins:[kj],children:M.body})})]}),b!=null&&!A&&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-white/[0.06]",children:b}),(w==null?void 0:w.relPath.endsWith("/SKILL.md"))&&b===""&&o.jsx("p",{className:"text-xs text-neutral-600",children:p("skillDetail.emptySkillMd")})]})]}),o.jsx("div",{className:"flex items-center gap-2 p-2 border-t border-white/[0.06] text-[11px] text-neutral-500",children:n==="project"?o.jsxs(o.Fragment,{children:[o.jsx(Ir,{className:"h-3 w-3"}),p("skillDetail.projectScopeHint",{root:E||(s?An(s).label:"")})]}):l?o.jsxs(o.Fragment,{children:[o.jsx(Qs,{className:"h-3 w-3"}),p("skillDetail.globalReadOnlyHint")]}):P?o.jsxs(o.Fragment,{children:[o.jsx(Qs,{className:"h-3 w-3"}),p("skillDetail.globalPluginHint",{runtime:H})]}):o.jsxs(o.Fragment,{children:[o.jsx(Qs,{className:"h-3 w-3"}),p("skillDetail.globalLocalHint",{runtime:H})]})})]})}const GS={home:{labelKey:"picker.home",icon:AD},desktop:{labelKey:"picker.desktop",icon:LD},downloads:{labelKey:"picker.downloads",icon:dx},documents:{labelKey:"picker.documents",icon:ou},"library-parent":{labelKey:"picker.libraryParent",icon:EC},drive:{labelKey:"picker.drive",icon:i0},root:{labelKey:"picker.root",icon:i0}},oQ=["home","desktop","downloads","documents","library-parent","drive","root"];function cQ(e){const t=e.trim().replace(/^"(.*)"$/s,"$1");return/^[a-zA-Z]:[\\/]$/.test(t)?t:t.replace(/[\\/]+$/,"").trim()}function uQ({open:e,onClose:t,onConfirm:n,existingPaths:r=[]}){const[i,s]=y.useState([]),[a,l]=y.useState(new Map),[c,u]=y.useState(new Set),[d,f]=y.useState(new Set),[p,h]=y.useState([]),[g,k]=y.useState(""),[w,m]=y.useState(null),b=We();y.useEffect(()=>{!e||i.length>0||Se.listFsRoots().then(C=>{const U=new Map(oQ.map(($,G)=>[$,G]));s([...C].sort(($,G)=>(U.get($.kind)??99)-(U.get(G.kind)??99)))}).catch(C=>m(String(C)))},[e,i.length]);const v=y.useCallback(async C=>{u(U=>new Set(U).add(C)),m(null);try{const U=await Se.listFsChildren(C);l($=>new Map($).set(C,U))}catch(U){m(String(U))}finally{u(U=>{const $=new Set(U);return $.delete(C),$})}},[]),S=y.useCallback(C=>{f(U=>{const $=new Set(U);return $.has(C)?$.delete(C):($.add(C),!a.has(C)&&!c.has(C)&&v(C)),$})},[a,c,v]),T=y.useCallback(C=>{const $=!p.includes(C)?[...p,C]:p.filter(G=>G!==C);h($),k($.length>0?$[$.length-1]:"")},[p]),N=y.useMemo(()=>new Set(r),[r]),_=y.useCallback(()=>{const C=cQ(g);k(C),!(!C||p.includes(C)||N.has(C))&&h([...p,C])},[g,p,N]);function R(C,U){const $=[];for(const G of C){const I=d.has(G.path),D=p.includes(G.path),A=N.has(G.path),M=G.rootKind?GS[G.rootKind]:null,P=a.get(G.path),H=c.has(G.path);$.push(o.jsxs("div",{className:"group flex items-center gap-1 pr-2 rounded hover:bg-white/[0.04]",style:{paddingLeft:U*14+6},children:[o.jsx("button",{onClick:()=>S(G.path),className:"shrink-0 p-0.5 text-neutral-500 hover:text-neutral-200",title:b(I?"common.collapse":"common.expand"),children:I?o.jsx(Pn,{className:"h-3.5 w-3.5"}):o.jsx(Un,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{onClick:()=>S(G.path),className:ye("flex-1 min-w-0 flex items-center gap-1.5 text-left py-1 truncate",A?"text-neutral-500":"text-neutral-200"),title:G.path,children:[M?o.jsx(M.icon,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}):o.jsx(Ir,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("span",{className:"truncate text-xs",children:G.rootKind==="drive"?G.name:M?b(M.labelKey):G.name}),A&&o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:b("picker.alreadyAdded")})]}),o.jsx("button",{onClick:()=>T(G.path),disabled:A,className:ye("shrink-0 w-4 h-4 rounded border flex items-center justify-center transition-colors",D?"bg-blue-500 border-blue-500 text-white":"border-neutral-600 text-transparent group-hover:border-neutral-400",A&&"opacity-30 cursor-not-allowed"),title:b(D?"picker.unselect":"picker.selectFolder"),children:o.jsx(ii,{className:"h-3 w-3"})})]},G.path)),I&&(H||!P?$.push(o.jsxs("div",{className:"flex items-center gap-1.5 text-neutral-500 py-1",style:{paddingLeft:(U+1)*14+24},children:[o.jsx(Cn,{className:"h-3 w-3 animate-spin"}),o.jsx("span",{className:"text-[11px]",children:b("common.loading")})]},`${G.path}__loading`)):P.length>0?$.push(...R(P,U+1)):$.push(o.jsx("div",{className:"text-neutral-600 py-1",style:{paddingLeft:(U+1)*14+24},children:o.jsx("span",{className:"text-[11px]",children:b("common.empty")})},`${G.path}__empty`)))}return $}const L=i.map(C=>({path:C.path,name:C.path,rootKind:C.kind}));return e?ln.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-white/[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-white/[0.06] frosted",children:[o.jsx(Ir,{className:"h-4 w-4 text-blue-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:b("picker.title")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:b("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:b("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-white/[0.06]",children:[o.jsx(Ir,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsx("input",{value:g,onChange:C=>k(C.target.value),onKeyDown:C=>{C.key==="Enter"&&_()},placeholder:b("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:_,disabled:!g.trim(),title:b("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:b("picker.add")})]}),o.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[o.jsxs("aside",{className:"w-44 shrink-0 border-r border-white/[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:b("picker.quickAccess")}),i.map(C=>{const U=GS[C.kind];return o.jsxs("button",{onClick:()=>S(C.path),className:"w-full flex items-center gap-1.5 px-2 py-1 rounded text-left hover:bg-white/[0.06]",title:C.path,children:[C.kind==="drive"||C.kind==="root"?o.jsx(i0,{className:"h-3.5 w-3.5 shrink-0 text-neutral-400"}):o.jsx(U.icon,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsxs("span",{className:"text-xs text-neutral-300 truncate",children:[b(U.labelKey),C.kind==="home"||C.kind==="drive"?o.jsx("span",{className:"ml-1 text-neutral-500",children:C.path}):null]})]},C.path)}),i.length===0&&o.jsx(Bp,{rows:8,className:"p-0"})]}),o.jsx("main",{className:"flex-1 overflow-y-auto p-1.5",children:L.length>0?R(L,0):o.jsx("div",{className:"flex items-center justify-center h-full text-neutral-500 text-xs",children:w??b("common.loading")})})]}),o.jsxs("footer",{className:"shrink-0 border-t border-white/[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:[p.length===0&&o.jsx("span",{className:"text-[11px] text-neutral-500",children:b("picker.noneSelected")}),p.map(C=>o.jsxs("button",{onClick:()=>T(C),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:b("picker.clickRemove"),children:[o.jsx(Ir,{className:"h-3 w-3"}),o.jsx("span",{className:"max-w-[220px] truncate",children:C}),o.jsx(tn,{className:"h-3 w-3"})]},C))]}),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:b("picker.selectedCount",{count:p.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:b("common.cancel")}),o.jsx("button",{onClick:()=>{n(p),h([]),k("")},disabled:p.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:p.length>0?b("picker.addCount",{count:p.length}):b("picker.add")})]})]})]}),document.body):null}const Sd=e=>e.replace(/\\/g,"/"),KS=e=>`${e.provenance}:${e.sourceRoot}:${e.id}`;function dQ({installedSkillNames:e,onInstallSkill:t,onInstallFileAsset:n,onInstallMcp:r,updates:i,onUpdateAsset:s,category:a,scope:l,capabilities:c,projectId:u,onSyncAll:d}){const[f,p]=y.useState([]),[h,g]=y.useState(null),[k,w]=y.useState([]),[m,b]=y.useState([]),[v,S]=y.useState([]),[T,N]=y.useState([]),[_,R]=y.useState(!1),[L,C]=y.useState(!1),[U,$]=y.useState(""),[G,I]=y.useState(qt[0]??"claude"),[D,A]=y.useState(0),[M,P]=y.useState(new Map),[H,E]=y.useState(null),j=We(),{show:B}=Zt(),O=cn(),Q=te=>{te&&B("error",te)},F=O.stateOf("lib-git-import")==="loading",J=O.stateOf("lib-check-updates")==="loading",ce=O.stateOf("lib-refresh-all")==="loading",K=gl(os("skill",c),{scope:l,agent:G}),q=gl(os("mcp",c),{scope:l,agent:G}),V=te=>te.ok||!te.reasonKey?void 0:j(te.reasonKey),ue=y.useCallback(()=>Se.listMarket().then(p).catch(te=>Q(String(te))),[]);y.useEffect(()=>{ue()},[ue]),y.useEffect(()=>Ri("market",()=>void ue()),[ue]),y.useEffect(()=>{if(h===null){w([]),b([]),S([]),N([]);return}R(!0),Q(null),Se.listLibraryAssets(h).then(te=>{const je=(te.plugins??[]).map(fe=>fe.relPath),W=fe=>je.some(Oe=>Oe===""||fe===Oe||fe.startsWith(`${Oe}/`));w(te.skills.filter(fe=>!W(fe.relPath))),b(te.files??[]),S(te.mcp??[]),N(te.plugins??[])}).catch(te=>Q(String(te))).finally(()=>R(!1))},[h,D]),y.useEffect(()=>{Se.listToolkit(u).then(te=>E(te.packs)).catch(()=>E([]))},[u,D,h]);async function me(){J||await O.run("lib-check-updates",async()=>{const te=await Se.checkMarketUpdates();P(new Map(te.map(je=>[je.id,je.status]))),B("success",j("library.checkDone",{n:te.filter(je=>je.status==="update-available").length}))},{fail:te=>j("library.checkFailed",{error:Xe(te)})})}async function Ne(){const te=[...M.entries()].filter(([,je])=>je==="update-available").map(([je])=>je);!te.length||ce||await O.run("lib-refresh-all",async()=>{await Se.refreshMarketCache(te),await d(),await ue(),A(W=>W+1);const je=await Se.checkMarketUpdates(te);P(W=>{const fe=new Map(W);for(const Oe of je)fe.set(Oe.id,Oe.status);return fe}),B("success",j("library.refreshDone",{n:te.length}))},{fail:je=>j("library.refreshFailed",{error:Xe(je)})})}async function Te(te,je,W){const fe=KS(te);O.stateOf(fe)!=="loading"&&await O.run(fe,async()=>{const Oe=await Se.toggleToolkit(u,te.id,je,te.sourceRoot);Oe.warnings.length>0&&B("info",Oe.warnings.join(";"));const Je=await Se.listToolkit(u);E(Je.packs),W==null||W()},{fail:Oe=>j("toolkit.toggleFailed",{error:Xe(Oe)})})}async function ne(te){await O.run("lib-import-dirs",async()=>{let je=null,W=0;for(const fe of te)try{je=(await Se.importMarketDir(fe)).id,W++}catch(Oe){B("error",j("library.importDirFail",{path:fe,error:Xe(Oe)}))}W>0&&B("success",j("library.importDirOk",{n:W})),await ue(),A(fe=>fe+1),je!==null&&g(je)},{fail:je=>j("library.importFailed",{error:Xe(je)})})}async function pe(){const te=U.trim();!te||F||await O.run("lib-git-import",async()=>{const je=await Se.importMarketGit(te);$(""),await ue(),A(W=>W+1),g(je.id),B("success",j("library.importGitOk",{name:je.resourceId??je.path}))},{fail:je=>j("library.importFailed",{error:Xe(je)})})}async function le(te){const je=`lib-migrate:${te.id}`;O.stateOf(je)!=="loading"&&await O.run(je,async()=>{const W=await Se.migrateLibrary(te.id);await ue(),g(W.id),B("success",j("library.migratedOk",{name:te.resourceId??te.path}))},{fail:W=>j("library.migrateFailed",{error:Xe(W)})})}const[de,Ke]=y.useState(null);async function He(te){const je=`lib-remove:${te.id}`;O.stateOf(je)!=="loading"&&await O.run(je,async()=>{let W;te.managed?W=(await Se.removeMarket(te.id)).warning:await Se.removeLibrary(te.id),h===te.id&&g(null),await ue(),B("success",j("library.removedOk",{name:te.resourceId??te.path})),W&&B("info",j("library.removeDeregWarn",{error:W}))},{fail:W=>j("library.removeFailed",{error:Xe(W)})})}const[Fe,dt]=y.useState(new Set),st=te=>dt(je=>{const W=new Set(je);return W.has(te)?W.delete(te):W.add(te),W}),[Ue,at]=y.useState(new Set),Z=te=>at(je=>{const W=new Set(je);return W.has(te)?W.delete(te):W.add(te),W}),[ae,_e]=y.useState(new Set),x=te=>ae.has(te),Y=te=>_e(je=>{const W=new Set(je);return W.has(te)?W.delete(te):W.add(te),W}),se=f.filter(te=>te.source==="builtin"),ge=f.filter(te=>te.source==="dir"||te.source==="legacy"),oe=f.filter(te=>te.source==="git"),z=te=>o.jsx(mQ,{item:te,selected:h===te.id,status:M.get(te.id),onSelect:g,onMigrate:je=>void le(je),onRemove:je=>je.managed?Ke(je):void He(je)},te.id),re=((i==null?void 0:i.skills)??[]).filter(te=>te.outdated),ie=((i==null?void 0:i.mcp)??[]).filter(te=>te.outdated),he=((i==null?void 0:i.files)??[]).filter(te=>te.outdated),be=[...M.values()].filter(te=>te==="update-available").length,Ce=a==="files",xe=Ce,Ae=Ce,Me=Ce,Ie=Ce,Le=!xe&&!Me&&!Ae&&!Ie,$e=[...xe?[Xm]:[],...Ae?[Wm]:[],...Me?[Zm]:[],...Ie?[Qm]:[],...re.length>0||ie.length>0||he.length>0?[Jm]:[]],qe=qS(k).map(([te])=>te||"__root__"),gt=T.map(te=>`plugin:${te.relPath||te.name}`),ft=k.filter(te=>e.has(te.name)).length,Dt=T.filter(te=>{const je=(H==null?void 0:H.find(W=>Sd(W.dir)===Sd(te.dirPath)))??null;return(je==null?void 0:je.installed)===!0}).length,Qt=[...[...se.length>0?["builtin"]:[],...ge.length>0?["local"]:[],...oe.length>0?["git"]:[]],...$e],It=Qt.some(te=>!ae.has(te))||qe.some(te=>Fe.has(te))||gt.some(te=>!Ue.has(te));function Yt(){It?(_e(new Set(Qt)),dt(new Set),at(new Set(gt))):(_e(new Set),dt(new Set(qe)),at(new Set))}return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"p-3 border-b border-white/[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:j("library.heading")}),!Le&&o.jsxs("button",{onClick:Yt,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:j(It?"library.expandAllTip":"library.collapseAllTip"),children:[It?o.jsx(lu,{className:"h-2.5 w-2.5"}):o.jsx(au,{className:"h-2.5 w-2.5"}),j(It?"library.expandAll":"library.collapseAll")]})]}),o.jsxs("div",{className:"rounded-md border border-white/[0.06] bg-neutral-900/60 p-2 flex items-center gap-2",children:[l==="user"?o.jsx(Qs,{className:"h-3.5 w-3.5 shrink-0 text-emerald-400"}):o.jsx(Ir,{className:"h-3.5 w-3.5 shrink-0 text-blue-400"}),o.jsxs("span",{className:"text-[11px] text-neutral-400",children:[j("library.installTo")," ",o.jsx("span",{className:ye("font-semibold",l==="user"?"text-emerald-300":"text-blue-300"),children:j(l==="user"?"library.scopeGlobal":"library.scopeProject")})]}),o.jsx("span",{className:"ml-auto text-[11px] text-neutral-600",children:j("library.followsSelection")})]}),o.jsxs("button",{onClick:()=>C(!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:j("library.addFoldersTip"),children:[o.jsx(ut,{state:O.stateOf("lib-import-dirs"),className:"h-3.5 w-3.5",icon:o.jsx(kC,{className:"h-3.5 w-3.5"})}),j("library.addFolders")]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("input",{value:U,onChange:te=>$(te.target.value),onKeyDown:te=>{te.key==="Enter"&&pe()},placeholder:j("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 pe(),disabled:!U.trim()||F,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:j("library.importGitTip"),children:[o.jsx(ut,{state:O.stateOf("lib-git-import"),className:"h-3.5 w-3.5",icon:o.jsx(r0,{className:"h-3.5 w-3.5"})}),j(F?"library.scanning":"library.importGit")]})]}),o.jsx(uQ,{open:L,onClose:()=>C(!1),onConfirm:te=>{C(!1),ne(te)},existingPaths:f.map(te=>te.path)}),o.jsx(so,{open:de!==null,title:j("library.removeMarketTitle"),message:j("library.removeMarketConfirm",{name:(de==null?void 0:de.resourceId)??(de==null?void 0:de.path)??""}),confirmLabel:j("common.confirm"),onConfirm:()=>{de&&He(de)},onClose:()=>Ke(null)}),f.length>0&&o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs("button",{onClick:()=>void me(),disabled:J,title:j("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:O.stateOf("lib-check-updates"),className:"h-3.5 w-3.5",icon:o.jsx(Il,{className:"h-3.5 w-3.5"})}),j(J?"library.checking":"library.checkUpdates")]}),o.jsxs("button",{onClick:()=>void Ne(),disabled:be===0||ce,title:j("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:O.stateOf("lib-refresh-all"),className:"h-3.5 w-3.5",icon:o.jsx(dx,{className:"h-3.5 w-3.5"})}),j(ce?"library.scanning":"library.refreshUpdates"),be>0&&o.jsx(Ye,{variant:"other",className:"px-1",children:be})]})]})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-4",children:[_&&f.length===0&&o.jsx(fA,{count:3}),se.length>0&&o.jsx(Yi,{icon:o.jsx(Ec,{className:"h-3.5 w-3.5 text-emerald-400"}),title:j("library.marketSectionBuiltin"),count:se.length,open:x("builtin"),onToggle:()=>Y("builtin"),children:se.map(z)}),ge.length>0&&o.jsx(Yi,{icon:o.jsx(Ir,{className:"h-3.5 w-3.5 text-blue-400"}),title:j("library.marketSectionLocal"),count:ge.length,open:x("local"),onToggle:()=>Y("local"),children:ge.map(z)}),oe.length>0&&o.jsx(Yi,{icon:o.jsx(r0,{className:"h-3.5 w-3.5 text-violet-400"}),title:j("library.marketSectionGit"),count:oe.length,open:x("git"),onToggle:()=>Y("git"),children:oe.map(z)}),Le&&o.jsxs("div",{className:"rounded-md border border-dashed border-white/[0.08] bg-neutral-900/40 p-4 text-center",children:[o.jsx(s0,{className:"h-5 w-5 mx-auto text-neutral-600 mb-1"}),o.jsx("p",{className:"text-xs text-neutral-500",children:j("library.noTemplates",{name:fQ(a,j)})}),o.jsx("p",{className:"text-[11px] text-neutral-600 mt-0.5",children:j("library.noTemplatesHint")})]}),xe&&o.jsxs(Yi,{icon:o.jsx(Es,{className:"h-3.5 w-3.5 text-emerald-400"}),title:j("library.sectionSkills"),hint:j("library.hintDragInstall"),count:k.length,tag:o.jsx(Mc,{tone:Ac(ft,k.length),children:j("library.tagInstalled",{done:ft,total:k.length})}),open:x(Xm),onToggle:()=>Y(Xm),children:[_&&o.jsx("p",{className:"text-xs text-neutral-500",children:j("library.scanning")}),!_&&h===null&&o.jsx("p",{className:"text-xs text-neutral-600",children:j("library.addLibrarySkills")}),!_&&h!==null&&k.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:j("library.noSkillsFound")}),o.jsx(YS,{agent:G,onChange:I,kind:"skills",scope:l,capabilities:c}),qS(k).map(([te,je])=>{const W=te||"__root__",fe=Fe.has(W);return o.jsxs("div",{className:"mb-1",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>st(W),onKeyDown:Oe=>{(Oe.key==="Enter"||Oe.key===" ")&&(Oe.preventDefault(),st(W))},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-white/20 [&_svg]:pointer-events-none",title:te||j("library.rootName"),children:[fe?o.jsx(Un,{className:"h-3 w-3 shrink-0"}):o.jsx(Pn,{className:"h-3 w-3 shrink-0"}),o.jsx(Ir,{className:"h-3 w-3 shrink-0 text-emerald-500/60"}),o.jsx("span",{className:"truncate",children:te||j("library.rootName")}),o.jsx(Ye,{variant:"skill",className:"shrink-0",children:j("library.localBadge")}),o.jsx(Ye,{className:"shrink-0",children:je.length})]}),!fe&&o.jsx("div",{className:"space-y-0.5",children:je.map(Oe=>o.jsx(gQ,{skill:Oe,payload:Bh({installKind:"skill",category:"skill",name:Oe.name,sourceDir:Oe.dirPath,targetAgent:G},c),installed:e.has(Oe.name),onInstall:()=>t(Oe,l,G),installDisabled:!K.ok,installReason:V(K)},Oe.name))})]},W)})]}),Ae&&o.jsxs(Yi,{icon:o.jsx(Es,{className:"h-3.5 w-3.5 text-blue-400"}),title:j("library.sectionFiles"),hint:j("library.hintClickInstall"),count:m.length,open:x(Wm),onToggle:()=>Y(Wm),children:[_&&o.jsx("p",{className:"text-xs text-neutral-500",children:j("library.scanning")}),!_&&h===null&&o.jsx("p",{className:"text-xs text-neutral-600",children:j("library.addLibraryTemplates")}),!_&&h!==null&&m.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:j("library.noFileTemplates")}),zC.map(te=>{var fe;const je=m.filter(Oe=>Oe.category===te);if(!je.length)return null;const W=((fe=os(te,c).surfaces[0])==null?void 0:fe.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(Ir,{className:"h-3 w-3 shrink-0 text-emerald-500/60"}),o.jsx("span",{className:"truncate",children:te}),o.jsx(Ye,{className:"shrink-0",children:je.length})]}),o.jsx("div",{className:"space-y-0.5",children:je.map(Oe=>{const Je=gl(os(Oe.category,c),{scope:l,agent:W});return o.jsx(bQ,{file:Oe,payload:Bh({installKind:"file",category:Oe.category,name:Oe.name,sourceFile:Oe.filePath,targetAgent:W},c),verdict:Je,reason:V(Je),onInstall:()=>n(Oe,l)},Oe.filePath)})})]},te)})]}),Me&&o.jsxs(Yi,{icon:o.jsx(Sp,{className:"h-3.5 w-3.5 text-blue-400"}),title:j("library.sectionMcp"),hint:j("library.hintClickAdd"),count:v.length,open:x(Zm),onToggle:()=>Y(Zm),children:[v.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:j("library.noMcpTemplates")}),o.jsx(YS,{agent:G,onChange:I,kind:"mcp",scope:l,capabilities:c}),v.map(te=>o.jsx(xQ,{srv:te,payload:Bh({installKind:"mcp",category:"mcp",name:te.name,mcpConfig:{command:te.command,...te.args&&{args:te.args},...te.env&&{env:te.env}},targetAgent:G},c),verdict:q,reason:V(q),onInstall:()=>r(te.name,{command:te.command,...te.args&&{args:te.args},...te.env&&{env:te.env}},l,G)},te.name))]}),Ie&&o.jsxs(Yi,{icon:o.jsx(a0,{className:"h-3.5 w-3.5 text-violet-400"}),title:j("library.sectionPlugins"),hint:j("library.pluginsSectionHint"),count:T.length,tag:o.jsx(Mc,{tone:Ac(Dt,T.length),children:j("library.tagInstalled",{done:Dt,total:T.length})}),open:x(Qm),onToggle:()=>Y(Qm),children:[_&&o.jsx("p",{className:"text-xs text-neutral-500",children:j("library.scanning")}),!_&&h===null&&o.jsx("p",{className:"text-xs text-neutral-600",children:j("library.addLibraryPlugins")}),!_&&h!==null&&T.length===0&&o.jsx("p",{className:"text-xs text-neutral-600",children:j("library.noPlugins")}),T.map(te=>{var Je;const je=(H==null?void 0:H.find(tt=>Sd(tt.dir)===Sd(te.dirPath)))??null,W=`plugin:${te.relPath||te.name}`,fe=Ue.has(W),Oe=je!==null&&O.stateOf(KS(je))==="loading";return o.jsxs("div",{className:"rounded-md border border-white/[0.06] bg-white/[0.015] px-2 py-1.5 space-y-1",children:[o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>Z(W),onKeyDown:tt=>{(tt.key==="Enter"||tt.key===" ")&&(tt.preventDefault(),Z(W))},className:"flex flex-wrap items-center gap-1.5 cursor-pointer select-none rounded focus:outline-none focus-visible:ring-1 focus-visible:ring-white/20",children:[fe?o.jsx(Pn,{className:"h-3 w-3 shrink-0 text-neutral-600"}):o.jsx(Un,{className:"h-3 w-3 shrink-0 text-neutral-600"}),o.jsx(a0,{className:ye("h-3.5 w-3.5 shrink-0",je!=null&&je.enabled?"text-violet-400":"text-neutral-600")}),o.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-neutral-200",title:te.key?j("toolkit.keyTip",{scopes:((Je=je==null?void 0:je.scopes)==null?void 0:Je.join("+"))||j("toolkit.scopesNone")}):void 0,children:te.key??te.name}),o.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-neutral-500",children:["v",te.version]}),(te.ccPack||te.kind==="mod")&&o.jsx("span",{className:"shrink-0",title:j("library.ccPluginTip"),children:o.jsx(Ye,{className:"bg-blue-900/40 text-blue-300",children:j("library.badgeCcPlugin")})}),te.weavePack&&o.jsx("span",{className:"shrink-0",title:j("library.weavePluginTip"),children:o.jsx(Ye,{className:"bg-violet-900/40 text-violet-300",children:j("library.badgeWeavePlugin")})}),o.jsx(Ye,{className:ye("shrink-0",mA[te.kind]),children:j(hA[te.kind])}),o.jsx("span",{className:"shrink-0 text-[10px] text-neutral-600",children:j("toolkit.targets",{targets:te.targets.join("+")})}),o.jsx("span",{className:"ml-auto shrink-0",onClick:tt=>tt.stopPropagation(),onKeyDown:tt=>tt.stopPropagation(),children:je?te.weavePack&&!(te.ccPack||te.kind==="mod")?o.jsx(na,{checked:je.enabled,disabled:Oe,onChange:tt=>void Te(je,tt),title:j("library.weavePluginTip")}):je.installed?o.jsxs(Ye,{className:"bg-emerald-900/40 text-emerald-300",title:j("library.installedManageTip"),children:[j("library.installed")," ✓"]}):o.jsx("button",{type:"button",disabled:Oe,title:j("library.installPackTip"),onClick:()=>void Te(je,!0,()=>B("success",j("library.packInstalled",{name:je.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:j(Oe?"library.installing":"library.install")}):o.jsx("span",{className:"text-[10px] text-neutral-600",title:j("library.pluginNotInToolkit"),children:"—"})})]}),fe&&o.jsxs("div",{className:"pl-4 space-y-1",children:[te.description?o.jsx("p",{className:"text-[11px] text-neutral-500",title:te.description,children:te.description}):null,o.jsx("div",{className:"flex flex-wrap items-center gap-1",children:te.components.map(tt=>o.jsx(Ye,{variant:"other",className:"px-1 text-[10px]",children:tt},tt))}),te.skills.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"mb-0.5 text-[10px] text-neutral-600",title:j("library.pluginSkillsFollowTip"),children:j("library.pluginSkillsLabel")}),o.jsx("div",{className:"flex flex-wrap gap-1",children:te.skills.map(tt=>o.jsx(Ye,{variant:"skill",className:"px-1.5 text-[10px]",title:j("library.pluginSkillsFollowTip"),children:tt},tt))})]}),o.jsxs("p",{className:"text-[10px] text-neutral-600",children:[o.jsx("span",{className:"text-neutral-500",children:j("library.pluginSourceDir")})," ",o.jsx("span",{className:"font-mono",title:te.dirPath,children:te.relPath||"."})]})]})]},W)})]}),(re.length>0||ie.length>0||he.length>0)&&o.jsxs(Yi,{icon:o.jsx(Il,{className:"h-3.5 w-3.5 text-orange-400"}),title:j("library.sectionUpdates"),hint:j("library.hintOverwrite"),count:re.length+ie.length+he.length,open:x(Jm),onToggle:()=>Y(Jm),children:[re.map(te=>o.jsx(eg,{label:te.name,scope:te.scope,agent:te.agent,onUpdate:()=>s("skill",te.name,te.scope,te.agent)},`skill-${te.agent??"claude"}-${te.scope}-${te.name}`)),he.map(te=>o.jsx(eg,{label:`${te.category}/${te.name}`,scope:te.scope,onUpdate:()=>s(te.category,te.name,te.scope)},`file-${te.category}-${te.name}`)),ie.map(te=>o.jsx(eg,{label:te.name,scope:te.scope,agent:te.agent,onUpdate:()=>s("mcp",te.name,te.scope,te.agent)},`mcp-${te.agent??"claude"}-${te.scope}-${te.name}`))]})]}),Me&&o.jsx(yQ,{onInstall:(te,je)=>r(te,je,l,G),blockedTitle:V(q)})]})}function fQ(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 pQ({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(Ye,{variant:n.variant,className:"shrink-0 px-1.5 text-[10px]",children:n.label})}const Xm="skill-templates",Wm="file-templates",Zm="mcp-templates",Qm="plugin-packs",Jm="update-hints";function hQ({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(Ye,{className:ye("shrink-0 px-1.5 text-[10px]",n.cls),children:n.label})}function mQ({item:e,selected:t,status:n,onSelect:r,onMigrate:i,onRemove:s}){const a=We(),l=cn(),c=l.stateOf(`lib-migrate:${e.id}`)==="loading",u=l.stateOf(`lib-remove:${e.id}`);return o.jsxs("div",{role:"button",tabIndex:0,onClick:()=>r(e.id),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(e.id))},className:ye("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-white/20 [&_svg]:pointer-events-none",t?"border-neutral-700 bg-neutral-800/80":"border-white/[0.06] bg-white/[0.015] hover:bg-white/[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(hQ,{status:n}),e.legacy&&o.jsx("button",{onClick:d=>{d.stopPropagation(),i(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(),s(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(Fr,{className:"h-3 w-3"})})})]})]}),o.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-wrap",children:[o.jsx(pQ,{source:e.source}),e.tags&&m0.filter(d=>e.tags[d]!==void 0).map(d=>o.jsxs("span",{className:ye(b0,Sx(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 qS(e){const t=new Map;for(const n of e){const r=t.get(n.group)??[];r.push(n),t.set(n.group,r)}return[...t.entries()].sort((n,r)=>n[0]?r[0]?n[0].localeCompare(r[0]):-1:1)}function YS({agent:e,onChange:t,kind:n,scope:r,capabilities:i}){var c,u;const s=We(),a=n==="skills"?{claude:s("library.tipSkillsClaude"),codex:s("library.tipSkillsCodex")}:{claude:s("library.tipMcpClaude"),codex:s("library.tipMcpCodex")},l=(u=(c=os(n==="skills"?"skill":"mcp",i).surfaces.find(d=>d.harness===e))==null?void 0:c.dest)==null?void 0:u[r];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:s("library.installTarget")}),qt.map(d=>o.jsx("button",{onClick:()=>t(d),className:ye("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:An(d).label},d)),l&&o.jsxs("span",{className:"text-[10px] text-neutral-600",children:["→ ",l]})]})}function Yi({icon:e,title:t,hint:n,count:r,tag:i,open:s,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-white/20 [&_svg]:pointer-events-none",title:c(s?"common.collapse":"common.expand"),children:[s?o.jsx(Pn,{className:"h-3 w-3 text-neutral-500"}):o.jsx(Un,{className:"h-3 w-3 text-neutral-500"}),e,o.jsx("span",{className:"text-xs font-semibold text-neutral-300",children:t}),i??(r!==void 0&&o.jsx(Ye,{variant:"other",children:r})),n&&o.jsx("span",{className:"text-[11px] text-neutral-500 ml-auto",children:n})]}),s&&o.jsx("div",{className:"space-y-0.5",children:l})]})}function eg({label:e,scope:t,agent:n,onUpdate:r}){const i=We(),{show:s}=Zt(),a=cn(),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(Il,{className:"h-3 w-3 shrink-0 text-orange-400"}),o.jsx("span",{className:"truncate",children:e}),n&&n!==qt[0]&&o.jsx(Ye,{variant:"other",className:"shrink-0",children:An(n).label}),o.jsx(Ye,{variant:"skill",className:"shrink-0",children:t}),o.jsx("button",{onClick:()=>void a.run("update",async()=>{await r(),s("success",i("library.updatedOk",{name:e}))},{fail:c=>i("errors.updateFailed",{error:Xe(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:i("library.update")})]})}function gQ({skill:e,payload:t,installed:n,onInstall:r,installDisabled:i,installReason:s}){const{attributes:a,listeners:l,setNodeRef:c,transform:u,isDragging:d}=kp({id:`lib-skill-${e.name}`,data:t}),f=We(),{show:p}=Zt(),h=cn(),g=h.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:ye("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(SC,{className:"h-3 w-3 shrink-0 text-neutral-600"}),o.jsx("span",{className:"truncate",children:e.name}),n?o.jsx(Ye,{variant:"skill",className:"ml-auto",children:f("library.installed")}):o.jsx("button",{onPointerDown:w=>w.stopPropagation(),onClick:w=>{w.stopPropagation(),h.run("install",async()=>{await r(),p("success",f("library.installedOk",{name:e.name}))},{fail:m=>f("errors.installFailed",{error:Xe(m)})})},disabled:i||g==="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:f("library.install")})]})}function bQ({file:e,payload:t,verdict:n,reason:r,onInstall:i}){const s=We(),{attributes:a,listeners:l,setNodeRef:c,transform:u,isDragging:d}=kp({id:`lib-file-${e.filePath}`,data:t}),{show:f}=Zt(),p=cn(),h=p.stateOf("install"),g=u?{transform:`translate3d(${u.x}px, ${u.y}px, 0)`}:void 0;return o.jsxs("div",{ref:c,style:g,...a,...l,className:ye("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(Es,{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(),p.run("install",async()=>{await i(),f("success",s("library.installedOk",{name:e.name}))},{fail:w=>s("errors.installFailed",{error:Xe(w)})})},disabled:!n.ok||h==="loading",title:r,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:s("library.install")})]})}function xQ({srv:e,payload:t,verdict:n,reason:r,onInstall:i}){const s=We(),{attributes:a,listeners:l,setNodeRef:c,transform:u,isDragging:d}=kp({id:`lib-mcp-${e.name}`,data:t}),{show:f}=Zt(),p=cn(),h=p.stateOf("install"),g=u?{transform:`translate3d(${u.x}px, ${u.y}px, 0)`}:void 0;return o.jsxs("div",{ref:c,style:g,...a,...l,className:ye("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(Sp,{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(),p.run("install",async()=>{await i(),f("success",s("library.installedOk",{name:e.name}))},{fail:w=>s("errors.mcpInstallFailed",{error:Xe(w)})})},disabled:!n.ok||h==="loading",title:r,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:s("library.install")})]})}function yQ({onInstall:e,blockedTitle:t}){const[n,r]=y.useState(""),[i,s]=y.useState(""),[a,l]=y.useState(""),[c,u]=y.useState(""),d=We(),{show:f}=Zt(),p=cn(),h=p.stateOf("submit");function g(){if(t)return;const k=n.trim(),w=i.trim();if(!k||!w||h==="loading")return;const m=a.trim()?a.trim().split(/\s+/):void 0,b=vQ(c);p.run("submit",async()=>{await e(k,{command:w,...m&&{args:m},...b&&{env:b}}),f("success",d("library.installedOk",{name:k}))},{fail:v=>d("errors.mcpInstallFailed",{error:Xe(v)})}),r(""),s(""),l(""),u("")}return o.jsxs("div",{className:"border-t border-white/[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(Sp,{className:"h-3 w-3"})," ",d("library.addMcpServer")]}),o.jsx("input",{value:n,onChange:k=>r(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:i,onChange:k=>s(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:g,disabled:!n.trim()||!i.trim()||!!t||h==="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 vQ(e){const t=e.split(`
556
- `).map(r=>r.trim()).filter(Boolean);if(!t.length)return;const n={};for(const r of t){const i=r.indexOf("=");i>0&&(n[r.slice(0,i)]=r.slice(i+1))}return Object.keys(n).length?n:void 0}function kQ({projectId:e,relPath:t,global:n,agent:r,onClose:i}){const[s,a]=y.useState(null),[l,c]=y.useState(null);y.useEffect(()=>{a(null),c(null),(n?Se.readGlobalFile(t):Se.readFile(e,t)).then(p=>a(p.content)).catch(p=>c(String(p)))},[e,t,n]);const u=t.endsWith(".md")||t.endsWith(".markdown"),d=s!=null&&u?Bj(s):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-white/[0.08] shadow-mac",children:[o.jsxs("div",{className:"flex items-center gap-2 p-3 border-b border-white/[0.06]",children:[o.jsx(ou,{className:"h-4 w-4 shrink-0 text-neutral-500"}),o.jsx("span",{className:"text-xs font-mono text-neutral-300 truncate",children:t}),r&&o.jsx($r,{agent:r,className:"shrink-0"}),o.jsx("button",{onClick:i,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}),s==null&&!l&&o.jsx(iH,{lines:14,className:"p-0"}),d&&o.jsxs(o.Fragment,{children:[d.frontmatter&&o.jsx(Hj,{data:d.frontmatter}),o.jsx("div",{className:"prose prose-invert prose-sm max-w-none",children:o.jsx(cy,{remarkPlugins:[gy],rehypePlugins:[kj],children:d.body})})]}),s!=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-white/[0.06]",children:s})]})]})}function VS({onResize:e,orientation:t="horizontal",className:n,title:r}){const i=t==="vertical",s=y.useRef(null),a=y.useRef(0),l=y.useCallback(d=>{s.current=i?d.clientY:d.clientX,a.current=0,d.currentTarget.setPointerCapture(d.pointerId)},[i]),c=y.useCallback(d=>{if(s.current==null)return;const p=(i?d.clientY:d.clientX)-s.current;e(p-a.current),a.current=p},[e,i]),u=y.useCallback(()=>{s.current=null},[]);return o.jsx("div",{role:"separator","aria-orientation":i?"horizontal":"vertical",title:r,onPointerDown:l,onPointerMove:c,onPointerUp:u,onPointerCancel:u,className:ye("shrink-0 touch-none bg-transparent transition-colors","hover:bg-blue-500/40 active:bg-blue-500/60",i?"h-1.5 w-full cursor-row-resize":"w-1.5 cursor-col-resize",n)})}const wQ=90,SQ={denied:"tasks.notifyDenied",unsupported:"tasks.notifyUnsupported",insecure:"tasks.notifyInsecure"};function EQ({open:e,onClose:t}){var Q,F,J,ce,K,q,V,ue,me,Ne,Te,ne,pe;const{locale:n,t:r,setLocale:i}=sT(),[s,a]=y.useState(null),[l,c]=y.useState([]),[u,d]=y.useState([]),[f,p]=y.useState(null),[h,g]=y.useState(!1),[k,w]=y.useState(""),[m,b]=y.useState(!1),[v,S]=y.useState(!1),[T,N]=y.useState([]),[_,R]=y.useState(null),[L,C]=y.useState(null),U=cn(),{show:$}=Zt();y.useEffect(()=>{e&&md().then(C)},[e]);const G=y.useCallback(le=>{(async()=>{if(le){const de=await FC();if(de!=="granted"){$("info",r(SQ[de])),C(await md());return}if(await HM({force:!0})!=="ok"){$("info",r("settings.pushFailed")),C(await md());return}}else await qV();C(await md())})()},[r,$]),I=y.useCallback(async le=>{try{const de=await wY(le&&(le.baseUrl!==void 0||le.apiKey!==void 0)?{...le.baseUrl?{baseUrl:le.baseUrl}:{},...le.apiKey?{apiKey:le.apiKey}:{}}:void 0);N(de.models)}catch(de){if(le!=null&&le.silent)return;throw de}},[]),[D,A]=y.useState(!1),M=y.useCallback(()=>{p(null),w(""),b(!1),S(!1),Se.getDaemonSettings().then(le=>{a(le.settings),c(le.presets),d(le.urls??[])}).catch(le=>p(String(le)))},[]);y.useEffect(()=>{e&&M()},[e,M]),y.useEffect(()=>{if(e)return Ri("settings",M)},[e,M]);const P=!!((Q=s==null?void 0:s.ai)!=null&&Q.baseUrl&&((F=s==null?void 0:s.ai)!=null&&F.apiKeySet)),H=((ce=(J=s==null?void 0:s.ai)==null?void 0:J.baseUrl)==null?void 0:ce.trim())??"",E=k.trim();if(y.useEffect(()=>{if(!e||P||H===""||E==="")return;const le=setTimeout(()=>{I({baseUrl:H,apiKey:E,silent:!0})},700);return()=>clearTimeout(le)},[e,P,H,E,I]),!e)return null;const j=(s==null?void 0:s.terminal.preset)??"auto",B=(s==null?void 0:s.terminal.customCommand)??"";async function O(){if(s){g(!0),p(null);try{const le={...s,...s.ai?{ai:{baseUrl:s.ai.baseUrl,model:s.ai.model,...k!==""?{apiKey:k}:m?{apiKey:null}:{}}}:{}},de=await Se.putDaemonSettings(le);a(de),w(""),b(!1),i(de.locale),t()}catch(le){p(String(le))}finally{g(!1)}}}return ln.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-white/[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-white/[0.06] frosted",children:[o.jsx(AC,{className:"h-4 w-4 text-blue-400"}),o.jsx("span",{className:"text-sm font-semibold text-neutral-200",children:r("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:r("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(OD,{className:"h-3.5 w-3.5 text-neutral-500"}),r("settings.language")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:r("settings.languageHint")}),o.jsx("select",{value:(s==null?void 0:s.locale)??n,onChange:le=>a(de=>de&&{...de,locale:le.target.value}),className:"w-full rounded-lg bg-neutral-800 border border-white/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",children:tT.map(le=>o.jsx("option",{value:le,children:e4[le]},le))})]}),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(px,{className:"h-3.5 w-3.5 text-neutral-500"}),r("settings.defaultTerminal")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:r("settings.defaultTerminalHint")}),o.jsx("select",{value:j,onChange:le=>a(de=>de&&{...de,terminal:{...de.terminal,preset:le.target.value}}),className:"w-full rounded-lg bg-neutral-800 border border-white/[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(le=>{const de=`preset.${le.id}`;return o.jsx("option",{value:le.id,children:de in rT?r(de):le.label},le.id)})})]}),j==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:r("settings.customCommand")}),o.jsxs("p",{className:"text-[11px] text-neutral-500",children:[o.jsx("code",{className:"text-neutral-400",children:"{path}"})," ",r("settings.pathHint"),o.jsxs("code",{className:"text-neutral-400",children:[" alacritty -e cd ","{path}"]})]}),o.jsx("input",{type:"text",value:B,onChange:le=>a(de=>de&&{...de,terminal:{...de.terminal,customCommand:le.target.value}}),placeholder:"my-terminal --dir {path}",className:"w-full rounded-lg bg-neutral-800 border border-white/[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(Ep,{className:"h-3.5 w-3.5 text-neutral-500"}),o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:r("settings.hooks")}),o.jsx("span",{className:"ml-auto",children:o.jsx(na,{checked:(s==null?void 0:s.hooks.enabled)??!0,onChange:le=>a(de=>de&&{...de,hooks:{...de.hooks,enabled:le}}),title:r("settings.hooks")})})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:r("settings.hooksHint")})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(cu,{className:"h-3.5 w-3.5 text-neutral-500"}),o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:r("settings.launchOnLogin")}),o.jsx("span",{className:"ml-auto",children:o.jsx(na,{checked:((K=s==null?void 0:s.startup)==null?void 0:K.launchOnLogin)??!1,onChange:le=>a(de=>de&&{...de,startup:{launchOnLogin:le}}),title:r("settings.launchOnLogin")})})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:r("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(wD,{className:"h-3.5 w-3.5 text-neutral-500"}),r("settings.retentionDays")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:r("settings.retentionDaysHint")}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Rf,{value:((q=s==null?void 0:s.events)==null?void 0:q.retentionDays)??wQ,min:1,max:3650,onChange:le=>a(de=>de&&{...de,events:{retentionDays:le}}),title:r("settings.retentionDays")}),o.jsx("span",{className:"text-[11px] text-neutral-500",children:r("settings.daysUnit")})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(yC,{className:"h-3.5 w-3.5 text-neutral-500"}),o.jsx("label",{className:"text-xs font-medium text-neutral-300",children:r("settings.push")}),o.jsx("span",{className:"ml-auto",children:o.jsx(na,{checked:L==="on",disabled:L==null||L==="insecure"||L==="unsupported",onChange:G,title:r("settings.push")})})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:r(L==="insecure"?"settings.pushInsecure":L==="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(Qs,{className:"h-3.5 w-3.5 text-neutral-500"}),r("settings.accessUrls")]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:r("settings.accessUrlsHint")}),o.jsx("ul",{className:"space-y-1",children:u.map(le=>o.jsxs("li",{className:"flex items-center gap-1.5",children:[o.jsxs("span",{className:le.protocol==="https"?"rounded bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-400":"rounded bg-white/[0.06] px-1.5 py-0.5 text-[10px] font-medium text-neutral-400",children:[le.scope==="lan"?r("settings.urlLan"):r("settings.urlLocal")," ·"," ",le.protocol.toUpperCase()]}),o.jsx("code",{className:"min-w-0 flex-1 truncate rounded bg-neutral-950 border border-white/[0.06] px-2 py-1 text-[11px] text-neutral-300",children:le.url}),o.jsx("button",{type:"button",onClick:()=>{Hp(le.url).then(de=>{if(!de){$("error",r("common.copyFailed"));return}R(le.url),window.setTimeout(()=>R(null),1500)})},title:r("common.copy"),className:"shrink-0 rounded p-1 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800",children:_===le.url?o.jsx("span",{className:"text-[10px] text-emerald-400",children:"✓"}):o.jsx(Sc,{className:"h-3 w-3"})})]},le.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(MC,{className:"h-3.5 w-3.5 text-neutral-500"}),r("settings.ai")]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx("input",{value:((V=s==null?void 0:s.ai)==null?void 0:V.baseUrl)??"",onChange:le=>a(de=>de===null?de:{...de,ai:{...de.ai??{model:""},baseUrl:le.target.value}}),placeholder:r("settings.aiBaseUrlPlaceholder"),className:"min-w-0 rounded-lg bg-neutral-800 border border-white/[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:[T.length>0?o.jsxs("select",{value:((ue=s==null?void 0:s.ai)==null?void 0:ue.model)??"",onChange:le=>a(de=>de===null?de:{...de,ai:{...de.ai??{baseUrl:""},model:le.target.value}}),className:"min-w-0 flex-1 rounded-lg bg-neutral-800 border border-white/[0.08] px-2.5 py-1.5 text-xs text-neutral-200 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[(((me=s==null?void 0:s.ai)==null?void 0:me.model)??"")===""&&o.jsx("option",{value:"",children:r("settings.aiModelPlaceholder")}),((Ne=s==null?void 0:s.ai)==null?void 0:Ne.model)&&!T.includes(s.ai.model)&&o.jsx("option",{value:s.ai.model,children:s.ai.model}),T.map(le=>o.jsx("option",{value:le,children:le},le))]}):o.jsx("input",{value:((Te=s==null?void 0:s.ai)==null?void 0:Te.model)??"",onChange:le=>a(de=>de===null?de:{...de,ai:{...de.ai??{baseUrl:""},model:le.target.value}}),placeholder:r("settings.aiModelPlaceholder"),className:"min-w-0 flex-1 rounded-lg bg-neutral-800 border border-white/[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 U.run("ai-models",()=>{var le;return I({baseUrl:((le=s==null?void 0:s.ai)==null?void 0:le.baseUrl)??"",...k!==""?{apiKey:k}:{}})},{fail:le=>Xe(le)}),disabled:U.stateOf("ai-models")==="loading",title:r("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:U.stateOf("ai-models"),className:"h-3 w-3",icon:o.jsx(Il,{className:"h-3 w-3"})}),r("settings.aiModelFetch")]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("input",{type:v?"text":"password",value:k,readOnly:!D,onFocus:()=>A(!0),onBlur:()=>A(!1),onChange:le=>{w(le.target.value),le.target.value!==""&&b(!1)},name:"weaveAiApiKey",autoComplete:"one-time-code",spellCheck:!1,autoCorrect:"off",autoCapitalize:"off","data-1p-ignore":!0,"data-lpignore":"true","data-bwignore":!0,placeholder:(ne=s==null?void 0:s.ai)!=null&&ne.apiKeySet?r("settings.aiApiKeySet"):r("settings.aiApiKeyUnset"),className:"min-w-0 flex-1 cursor-text rounded-lg bg-neutral-800 border border-white/[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(le=>!le),title:r(v?"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:v?o.jsx(SD,{className:"h-3.5 w-3.5"}):o.jsx(ED,{className:"h-3.5 w-3.5"})}),((pe=s==null?void 0:s.ai)==null?void 0:pe.apiKeySet)===!0&&o.jsx("button",{type:"button",onClick:()=>{w(""),b(!0)},className:"shrink-0 rounded-lg bg-neutral-800 px-2 py-1.5 text-[11px] text-neutral-300 hover:bg-neutral-700",children:r("settings.aiApiKeyClear")})]}),o.jsx("p",{className:"text-[11px] text-neutral-500",children:r("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-white/[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:s===null&&!f?r("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:r("common.cancel")}),o.jsx("button",{onClick:()=>void O(),disabled:s===null||h,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:r(h?"common.saving":"common.save")})]})]})]}),document.body)}const $j="zijing66/weave",NQ=`https://github.com/${$j}`,Gj="weave.github.stars",_Q=6*60*60*1e3;function CQ(e){if(e<1e3)return String(e);const t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1).replace(/\.0$/,"")}k`}function XS(){try{const e=localStorage.getItem(Gj);if(!e)return null;const t=JSON.parse(e);return typeof t.count!="number"||typeof t.at!="number"||Date.now()-t.at>_Q?null:t.count}catch{return null}}function TQ(e){try{localStorage.setItem(Gj,JSON.stringify({count:e,at:Date.now()}))}catch{}}function AQ(){const[e,t]=y.useState(()=>XS());return y.useEffect(()=>{if(XS()!==null)return;let n=!1;return(async()=>{try{const r=await fetch(`https://api.github.com/repos/${$j}`,{headers:{accept:"application/vnd.github+json"}});if(!r.ok)return;const i=await r.json();if(n||typeof i.stargazers_count!="number")return;TQ(i.stargazers_count),t(i.stargazers_count)}catch{}})(),()=>{n=!0}},[]),e}function MQ(){const e=We(),t=cn(),[n,r]=y.useState(""),i=t.stateOf("login"),s=()=>{n&&t.run("login",async()=>{await KD(n)},{fail:a=>a instanceof OC&&a.status===401?e("auth.wrongPassword"):Xe(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(),s()},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=>r(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:i==="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-white disabled:opacity-50",children:[o.jsx(ut,{state:i}),e("auth.login")]}),o.jsx("p",{className:"mt-4 text-[11px] leading-relaxed text-neutral-600",children:e("auth.hint")})]})})}const WS=176,ZS=320,QS=260,JS=440,Ed=(e,t,n)=>Math.min(n,Math.max(t,e)),jQ=(e,t,n)=>e.some(r=>r.harness===t&&r.key===n&&r.effective);function OQ(){const e=DC();return y.useEffect(()=>{IC()},[]),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(MQ,{}):o.jsx(RQ,{})}function RQ(){var fo;const e=We(),[t,n]=y.useState([]),[r,i]=y.useState(!1),s=AQ(),[a,l]=y.useState(null),[c,u]=y.useState(!1),[d,f]=y.useState([]),[p,h]=y.useState([]),{sessions:g,projectStats:k}=fu(),[w,m]=y.useState(null),[b,v]=y.useState([]),[S,T]=y.useState([]),[N,_]=y.useState(null),[R,L]=y.useState([]),[C,U]=y.useState([]),[$,G]=y.useState({}),[I,D]=y.useState({}),[A,M]=y.useState(null),{show:P}=Zt(),H=y.useCallback(X=>{X&&P("error",X)},[P]),E=cn(),[j,B]=y.useState(!1),O=da("(min-width: 1024px)"),Q=da("(pointer: fine)"),[F,J]=y.useState(null),[ce,K]=y.useState("tasks"),[q,V]=y.useState("packs"),[ue,me]=y.useState(0),[Ne,Te]=y.useState(null),[ne,pe]=y.useState(null),[le,de]=y.useState(()=>{const X=Number(localStorage.getItem("weave:col-left"));return Number.isFinite(X)&&X>0?Ed(X,WS,ZS):224}),[Ke,He]=y.useState(()=>{const X=Number(localStorage.getItem("weave:col-right"));return Number.isFinite(X)&&X>0?Ed(X,QS,JS):288});y.useEffect(()=>localStorage.setItem("weave:col-left",String(le)),[le]),y.useEffect(()=>localStorage.setItem("weave:col-right",String(Ke)),[Ke]);const Fe=kc(su,{activationConstraint:{distance:5}}),dt=kc(ox,{activationConstraint:{delay:200,tolerance:8}}),st=ix(Q?Fe:dt);y.useEffect(()=>{Se.listProjects().then(n).catch(X=>H(String(X))).finally(()=>i(!0)),Se.listArchivedProjects().then(x).catch(()=>{})},[]);const[Ue,at]=y.useState(null);y.useEffect(()=>{Se.capabilities().then(at).catch(()=>{})},[]);const[Z,ae]=y.useState(null),[_e,x]=y.useState([]),Y=y.useCallback(()=>{Se.listProjects().then(n).catch(()=>{}),Se.listArchivedProjects().then(x).catch(()=>{})},[]),se=y.useCallback(X=>{n(ke=>{const Re=new Map(ke.map(Be=>[Be.id,Be])),ve=X.map(Be=>Re.get(Be)).filter(Be=>!!Be);for(const Be of ke)X.includes(Be.id)||ve.push(Be);return ve}),Se.reorderProjects(X).catch(ke=>{H(e("errors.projectReorderFailed",{error:String(ke)})),Y()})},[Y,e]),[ge,oe]=y.useState({});y.useEffect(()=>{const X=()=>{document.visibilityState==="visible"&&Y()};return document.addEventListener("visibilitychange",X),()=>document.removeEventListener("visibilitychange",X)},[Y]);const z=y.useCallback(X=>{Se.listAssets(X.path).then(f).catch(()=>{})},[]),re=y.useCallback(X=>{Se.listMcp(X.id).then(T).catch(()=>{})},[]),ie=y.useCallback(X=>{Se.listUpdates(X.id).then(_).catch(()=>{})},[]);y.useEffect(()=>{a&&N&&D(X=>({...X,[a.id]:N.available}))},[N,a]);const he=y.useCallback(X=>{Se.listGlobalSkills(X.id).then(L).catch(()=>{})},[]),be=y.useCallback(X=>{Se.listPluginState(X.id).then(U).catch(()=>{})},[]),Ce=y.useCallback(X=>{Se.getProjectConfig(X.id).then(ke=>G(Re=>({...Re,[X.id]:ke}))).catch(()=>{})},[]),xe=y.useRef(new Set);y.useEffect(()=>{for(const X of t)$[X.id]||xe.current.has(X.id)||(xe.current.add(X.id),Se.getProjectConfig(X.id).then(ke=>G(Re=>({...Re,[X.id]:ke}))).catch(()=>xe.current.delete(X.id)))},[t,$]);const Ae=y.useRef(new Set),Me=y.useCallback((X,ke=!1)=>{Ae.current.has(X)||!ke&&I[X]!==void 0||(Ae.current.add(X),Se.listUpdates(X).then(Re=>{Ae.current.delete(X),D(ve=>({...ve,[X]:Re.available}))}).catch(()=>Ae.current.delete(X)))},[I]),Ie=y.useCallback(()=>{Se.listHooksRules().then(v).catch(()=>{})},[]);y.useEffect(()=>{Ie()},[Ie]),y.useEffect(()=>(window.addEventListener("weave:rules-changed",Ie),()=>window.removeEventListener("weave:rules-changed",Ie)),[Ie]);const Le=y.useCallback(X=>{l(X),u(!1),f([]),T([]),_(null),L([]),U([]),M(null),pe(null),K("tasks"),m(null),Te(null),H(null),Se.listAssets(X.path).then(f).catch(ke=>H(String(ke))),re(X),ie(X),he(X),be(X),Ce(X),Se.getStatusline(X.id).then(ke=>Te(ke.config.source)).catch(()=>{})},[re,ie,he,be,Ce]),$e=y.useCallback(()=>{const X=a??t[0];X&&(u(!0),M(null),pe(null),K("tasks"),m(null),Te(null),H(null),Se.listGlobalFileAssets().then(h).catch(ke=>H(String(ke))),he(X),be(X),re(X),ie(X))},[a,t,he,be,re,ie]);y.useEffect(()=>{c||a||t.length===0||$e()},[c,a,t,$e]);const qe=y.useMemo(()=>{var ke;const X=new Set;for(const Re of R)for(const ve of Re.skills)X.add(ve.name);for(const Re of d)if(Re.category==="skill"){const ve=(ke=Re.relPath.match(/^[^/]+\/skills\/([^/]+)\//))==null?void 0:ke[1];ve&&X.add(ve)}return X},[R,d]),gt=y.useMemo(()=>{var Re;const X=new Set;for(const ve of d)if(ve.category==="skill"){const Be=(Re=ve.relPath.match(/^[^/]+\/skills\/([^/]+)\//))==null?void 0:Re[1];Be&&X.add(Be)}const ke=S.filter(ve=>ve.harness==="claude").length;return{skill:X.size,mcp:ke}},[d,S]),ft=y.useMemo(()=>Tc(R.map(X=>{const ke=uu(X.source);return{enabled:X.pluginKey&&ke?jQ(C,ke,X.pluginKey):void 0,skills:X.skills}})).effective,[R,C]),Dt=y.useMemo(()=>{const X=S.filter(ve=>!ve.installScopes.includes("project")).length,ke=ve=>S.filter(Be=>Be.installScopes.includes("project")&&Be.scope===ve).length;if(c){const ve=((N==null?void 0:N.skills)??[]).filter(wt=>wt.scope==="user"&&wt.outdated).length,Be=((N==null?void 0:N.mcp)??[]).filter(wt=>wt.scope==="user"&&wt.outdated).length;return{files:ft+ke("user")+X+p.length,outdated:ve+Be,statuslineSource:null,hooksRules:b.length,sessions:(g==null?void 0:g.length)??0}}const Re=d.filter(ve=>ve.category!=="skill"&&ve.category!=="mcp").length;return{files:gt.skill+ft+ke("project")+X+Re,outdated:((N==null?void 0:N.skills)??[]).filter(ve=>ve.outdated).length+((N==null?void 0:N.mcp)??[]).filter(ve=>ve.outdated).length,statuslineSource:Ne,hooksRules:b.filter(ve=>ve.projectId===null||ve.projectId===(a==null?void 0:a.id)).length,sessions:(g??[]).filter(ve=>ve.projectId===(a==null?void 0:a.id)).length}},[c,R,S,N,d,p,gt,C,ft,Ne,b,a,g]),St=y.useMemo(()=>A?(c?p:d).find(ke=>ke.relPath===A)??null:null,[c,p,d,A]),Qt=y.useRef(a);y.useEffect(()=>{Qt.current=a},[a]),y.useEffect(()=>Ri("projects",Y),[Y]),y.useEffect(()=>Ri("toolkit",()=>{const X=a??t[0];X&&be(X)}),[a,t,be]),y.useEffect(()=>sl(X=>{if(X.type==="project"){Y();return}if(X.type==="hook"){if(X.kind==="watch.fired"&&X.watcherSessionId==null&&typeof X.targetSessionId=="string"){const ve=g==null?void 0:g.find(hr=>hr.sessionId===X.targetSessionId),Be=Tn((ve==null?void 0:ve.title)??null,X.targetSessionId),wt=e(X.reason==="turnEnd"?"tasks.watchTurnEnd":X.reason==="messageFailed"?"tasks.watchMsgFailed":"tasks.watchOn",{label:Be});P("info",wt),wk(e("tasks.watchNotifyTitle"),wt,`weave-watch-${X.targetSessionId}`)}if(X.kind==="question.pending"&&typeof X.sessionId=="string"){const ve=g==null?void 0:g.find(hr=>hr.sessionId===X.sessionId),Be=Tn((ve==null?void 0:ve.title)??null,X.sessionId),wt=e("tasks.questionPending",{label:Be});P("info",wt),wk(e("tasks.questionPendingTitle"),wt,`weave-question-${X.sessionId}`)}window.dispatchEvent(new CustomEvent("weave:hook",{detail:X}));return}if(X.type==="push"&&X.key==="terminalTopology"){oe(X.payload.counts);return}if(X.type==="push"&&X.key==="updates"){D(X.payload.counts??{});return}if(X.type!=="asset")return;const ke=X,Re=Qt.current;!Re||ke.projectPath!==Re.path||(f(ve=>{if(ke.kind==="unlink")return ve.filter(hr=>hr.relPath!==ke.relPath);const Be={absPath:ke.absPath,relPath:ke.relPath,category:ke.category,mtimeMs:Date.now(),agent:ke.agent,...ke.isSymlink?{isSymlink:!0}:{}},wt=ve.findIndex(hr=>hr.relPath===ke.relPath);if(wt>=0){const hr=[...ve];return hr[wt]=Be,hr}return[...ve,Be]}),ke.category==="mcp"&&re(Re),ke.category==="skill"&&he(Re),ie(Re))}),[re,ie,he,Y]);const It=y.useCallback(async(X,ke="project",Re=qt[0]??"claude")=>{if(!a&&!c)return;const ve=a??t[0];if(!ve)return;const Be=await Se.install(ve.id,{category:"skill",name:X.name,sourceDir:X.dirPath,scope:ke,agent:Re});if(!Be.ok)throw new Error(`${Be.status} ${await Be.text()}`);z(ve),he(ve),ie(ve)},[a,t,c,z,he,ie]),Yt=y.useCallback(async(X,ke="project")=>{if(!a&&!c)return;const Re=a??t[0];if(!Re)return;const ve=await Se.install(Re.id,{category:X.category,name:X.name,sourceFile:X.filePath,scope:ke});if(!ve.ok)throw new Error(`${ve.status} ${await ve.text()}`);z(Re),ie(Re)},[a,t,c,z,ie]),te=y.useCallback(async(X,ke,Re="project",ve=qt[0]??"claude")=>{var Ty;if(!a&&!c)return;const Be=a??t[0];if(!Be)return;const wt=((Ty=os("mcp",Ue).surfaces.find(Kj=>Kj.harness===ve))==null?void 0:Ty.scopes)??[],hr=wt.includes(Re)?Re:wt[0]??"user",Wp=await Se.install(Be.id,{category:"mcp",name:X,mcpConfig:ke,scope:hr,agent:ve});if(!Wp.ok)throw new Error(`${Wp.status} ${await Wp.text()}`);z(Be),re(Be),ie(Be)},[a,t,c,Ue,z,re,ie]),je=y.useCallback(async(X,ke="project",Re)=>{const ve=a??t[0];if(!ve)return;const Be=await Se.uninstall(ve.id,{category:"skill",name:X,scope:ke,...Re?{agent:Re}:{}});if(!Be.ok)throw new Error(`${Be.status} ${await Be.text()}`);z(ve),he(ve),ie(ve)},[a,t,z,he,ie]),W=y.useCallback(async(X,ke="project",Re)=>{const ve=a??t[0];if(!ve)return;const Be=await Se.uninstall(ve.id,{category:"mcp",name:X,scope:(Re??qt[0])==="claude"?ke:"user",...Re?{agent:Re}:{}});if(!Be.ok)throw new Error(`${Be.status} ${await Be.text()}`);z(ve),re(ve),ie(ve)},[a,t,z,re,ie]),fe=y.useCallback(async(X,ke)=>{const Re=a??t[0];Re&&(await Se.putMcpEnable(Re.id,X,ke),re(Re))},[a,t,re]),Oe=y.useCallback(async X=>{const ke=X??a??t[0];if(!ke)return{updated:0};const Re=await Se.syncAll(ke.id);if(!Re.ok)throw new Error(`${Re.status} ${await Re.text()}`);const ve=await Re.json().catch(()=>null);return!c&&a&&ke.id===a.id?(ie(ke),z(ke)):Me(ke.id,!0),{updated:Array.isArray(ve==null?void 0:ve.updated)?ve.updated.length:0}},[a,t,c,ie,z,Me]),Je=y.useCallback(async(X,ke,Re,ve)=>{const Be=a??t[0];if(!Be)return;const wt=await Se.updateAsset(Be.id,{category:X,name:ke,scope:Re,...(X==="skill"||X==="mcp")&&ve?{agent:ve}:{}});if(!wt.ok)throw new Error(`${wt.status} ${await wt.text()}`);ie(Be),z(Be),X==="mcp"&&re(Be),X==="skill"&&he(Be)},[a,t,ie,z,re,he]),tt=y.useCallback(async X=>{const ke=X??a;if(!ke)return!1;const Re=$[ke.id]??await Se.getProjectConfig(ke.id),ve={...Re,autoSync:!Re.autoSync};G(wt=>({...wt,[ke.id]:ve}));const Be=await Se.putProjectConfig(ke.id,ve);if(!Be.ok)throw Ce(ke),new Error(`${Be.status} ${await Be.text()}`);return ve.autoSync},[a,$,Ce]),Lt=y.useCallback(X=>E.stateOf(`auto:${X}`),[E]),Mr=y.useCallback(X=>E.stateOf(`sync:${X}`),[E]),As=y.useCallback(X=>E.run(`auto:${X.id}`,async()=>{const ke=await tt(X);P("success",e(ke?"toast.autoSyncOn":"toast.autoSyncOff"))},{fail:ke=>e("errors.configUpdateFailed",{error:Xe(ke)})}),[E,tt,P,e]),Ms=y.useCallback(X=>E.run(`sync:${X.id}`,async()=>{const{updated:ke}=await Oe(X);ke>0?P("success",e("toast.synced",{n:ke})):P("info",e("toast.nothingToSync"))},{fail:ke=>e("errors.syncFailed",{error:Xe(ke)})}),[E,Oe,P,e]),Ma=y.useCallback((X,ke)=>void E.run(`open-${ke}:${X.id}`,async()=>{await Se.openProject(X.id,ke)},{fail:Re=>e("errors.openFailed",{error:Xe(Re)})}),[E,e]),oo=y.useCallback(X=>E.stateOf(`open-explorer:${X}`),[E]),ci=y.useCallback(X=>E.stateOf(`open-terminal:${X}`),[E]),js=y.useCallback(X=>void E.run(`archive:${X.id}`,async()=>{const{purged:ke}=await Se.archiveProject(X.id);if(P("success",e("toast.projectArchived",{name:X.name,sessions:ke.sessions,events:ke.events})),(a==null?void 0:a.id)===X.id){const Re=t.find(ve=>ve.id!==X.id);Re?Le(Re):l(null)}Y()},{fail:ke=>e("errors.archiveFailed",{error:Xe(ke)})}),[E,a,t,Le,P,e,Y]),co=y.useCallback(X=>void E.run(`restore:${X.id}`,async()=>{await Se.restoreProject(X.id),P("success",e("toast.projectRestored",{name:X.name})),Y()},{fail:ke=>e("errors.restoreFailed",{error:Xe(ke)})}),[E,P,e,Y]),ja=y.useCallback(X=>E.stateOf(`restore:${X}`),[E]),uo=y.useCallback(async(X,ke,Re,ve)=>{const Be=a??t[0];Be&&(await Se.putPluginState(Be.id,X,ke,Re,ve),be(Be),he(Be))},[a,t,be,he]),Pi=y.useCallback(async(X,ke)=>{const Re=a??t[0];Re&&(await Se.uninstallPluginPack(Re.id,{runtime:X,key:ke}),he(Re),be(Re))},[a,t,he,be]),mn=y.useCallback((X,ke,Re)=>{It(X,ke,Re).catch(ve=>P("error",e("errors.installFailed",{error:Xe(ve)})))},[It,P,e]),Oa=y.useCallback((X,ke)=>{Yt(X,ke).catch(Re=>P("error",e("errors.installFailed",{error:Xe(Re)})))},[Yt,P,e]),Os=y.useCallback((X,ke,Re,ve)=>{te(X,ke,Re,ve).catch(Be=>P("error",e("errors.mcpInstallFailed",{error:Xe(Be)})))},[te,P,e]),Ra=y.useCallback((X,ke,Re,ve)=>{Je(X,ke,Re,ve).catch(Be=>P("error",e("errors.updateFailed",{error:Xe(Be)})))},[Je,P,e]),ee=y.useCallback((X,ke,Re)=>{je(X,ke,Re).catch(ve=>P("error",e("errors.uninstallFailed",{error:Xe(ve)})))},[je,P,e]),we=y.useCallback(X=>{K(X),X!=="tasks"&&m(null),X==="personalization"&&me(ke=>ke+1),X==="weave"&&Ie()},[Ie]),Ve=y.useCallback((X,ke)=>{const Re=t.find(ve=>ve.id===X);Re&&(Le(Re),m(ke),K("tasks"))},[t,Le]);function pt(X){ae(X.active.data.current??null)}function Gt(X){const{active:ke,over:Re}=X,ve=ke.data.current;if(ae(null),!Re||Re.id!=="project-assets"||!ve)return;const Be=c?"user":"project",wt=gl(ve.attrs,{scope:Be,agent:ve.targetAgent});if(!wt.ok){wt.reasonKey&&H(e(wt.reasonKey));return}ve.installKind==="skill"&&ve.sourceDir&&ve.name?mn({name:ve.name,dirPath:ve.sourceDir},Be,ve.targetAgent):ve.installKind==="file"&&ve.sourceFile&&ve.name?Oa({name:ve.name,filePath:ve.sourceFile,category:ve.category},Be):ve.installKind==="mcp"&&ve.mcpConfig&&ve.name&&Os(ve.name,ve.mcpConfig,Be,ve.targetAgent)}const Fn=y.useMemo(()=>{if(!ne||ne.scope==="user")return[];const{name:X,agent:ke}=ne;return d.filter(Re=>{var Be;return((Be=Re.relPath.match(/^[^/]+\/skills\/([^/]+)\//))==null?void 0:Be[1])===X&&(!ke||Re.agent===ke)})},[ne,d]),On=y.useMemo(()=>ne?N==null?void 0:N.skills.find(X=>X.name===ne.name&&X.scope===ne.scope):void 0,[ne,N]),Da=c?"global":"project",Ot=a??t[0],Xp=c&&!Ot,Ia=a?((fo=$[a.id])==null?void 0:fo.autoSync)??!1:!1,Rs=r?o.jsx(R4,{projects:t,selectedId:a==null?void 0:a.id,globalActive:c,onSelect:X=>{Le(X),J(null)},onSelectGlobal:()=>{$e(),J(null)},onOpenExplorer:X=>Ma(X,"explorer"),onOpenTerminal:X=>Ma(X,"terminal"),openExplorerStateOf:oo,openTerminalStateOf:ci,onHoverProject:Me,autoSyncOf:X=>{var ke;return(ke=$[X])==null?void 0:ke.autoSync},updatesOf:X=>I[X],autoSyncStateOf:Lt,syncStateOf:Mr,onToggleAutoSync:X=>void As(X),onSyncNow:X=>void Ms(X),sessionStatsOf:X=>k.get(X),terminalsOf:X=>ge[X]??0,onReorder:se,archivedProjects:_e,onArchive:js,onRestore:co,restoreStateOf:ja}):o.jsx(Bp,{rows:7}),_u=Ot?o.jsx(dQ,{installedSkillNames:qe,onInstallSkill:mn,onInstallFileAsset:Oa,onInstallMcp:Os,updates:N,onUpdateAsset:Ra,category:ce,scope:c?"user":"project",capabilities:Ue,projectId:Ot.id,onSyncAll:()=>void Ms(Ot)}):o.jsx("div",{className:"p-3 text-xs text-neutral-500",children:e("app.selectProjectForAssets")});return o.jsxs(cx,{sensors:st,onDragStart:pt,onDragEnd:Gt,onDragCancel:()=>ae(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-white/[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-white/[0.06] frosted",children:[o.jsx("button",{onClick:()=>J("projects"),className:ye("rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",O&&"hidden"),title:e("app.mobileProjects"),children:o.jsx(zD,{className:"h-4 w-4"})}),o.jsx(DQ,{}),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:t.length})}),o.jsx("button",{onClick:()=>J("library"),className:ye("rounded-lg p-1.5 text-neutral-500 hover:text-neutral-200 hover:bg-neutral-800/60 transition-colors",(O||!Ot)&&"hidden"),title:e("app.mobileLibrary"),children:o.jsx(EC,{className:"h-4 w-4"})}),o.jsxs("a",{href:NQ,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(_D,{className:"h-4 w-4"}),s!==null&&o.jsx("span",{className:"text-[11px] tabular-nums",children:CQ(s)})]}),o.jsx("button",{onClick:()=>B(!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(AC,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>void qD(),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(DD,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[O&&o.jsxs(o.Fragment,{children:[o.jsx("aside",{style:{width:le},className:"shrink-0 border-r border-white/[0.06] frosted overflow-y-auto",children:Rs}),o.jsx(VS,{onResize:X=>de(ke=>Ed(ke+X,WS,ZS)),title:e("app.resizeLeft")})]}),o.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden relative",children:[Ot?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"px-4 py-2 border-b border-white/[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:c?e("app.globalTitle"):(a==null?void 0:a.name)??""}),o.jsx("p",{className:"text-[11px] text-neutral-500 truncate",children:c?e("app.globalSubtitle"):(a==null?void 0:a.path)??""})]}),!c&&N&&N.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:N.available===1?e("app.updateCountOne"):e("app.updateCount",{n:N.available})}),!c&&N&&N.available>0&&o.jsxs("button",{onClick:()=>void E.run("sync:all",async()=>{const{updated:X}=await Oe();X>0?P("success",e("toast.synced",{n:X})):P("info",e("toast.nothingToSync"))},{fail:X=>e("errors.syncFailed",{error:Xe(X)})}),title:`${e("app.syncAllTooltip",{n:N.available})}
557
-
558
- ${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:E.stateOf("sync:all"),className:"h-3 w-3"}),e("app.syncAll")]}),!c&&a&&o.jsxs(o.Fragment,{children:[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.jsxs("button",{onClick:()=>void E.run("auto:current",async()=>{const X=await tt();P("success",e(X?"toast.autoSyncOn":"toast.autoSyncOff"))},{fail:X=>e("errors.configUpdateFailed",{error:Xe(X)})}),"aria-pressed":Ia,title:`${e(Ia?"app.autoSyncOnTooltip":"app.autoSyncOffTooltip")}
559
-
560
- ${e("app.scopeCoverageTooltip")}`,className:ye("shrink-0 inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-medium",Ia?"bg-emerald-900/40 text-emerald-300":"bg-neutral-800 text-neutral-400 hover:bg-neutral-700"),children:[o.jsx(ut,{state:E.stateOf("auto:current"),className:"h-3 w-3"}),e(Ia?"app.autoSyncOn":"app.autoSyncOff")]})]})]}),o.jsx(V4,{category:ce,onSelect:we,data:Dt}),o.jsx("div",{className:ye("flex-1 relative",ce==="tasks"&&!c?"overflow-hidden !p-0":"overflow-y-auto p-3"),children:Xp?o.jsx("p",{className:"text-xs text-neutral-500",children:e("app.needProjectAnchor")}):r?o.jsx(gX,{projectId:Ot.id,mode:Da,category:ce,resourceView:q,onResourceViewChange:V,statuslineNonce:ue,assets:d,globalAssets:p,mcpRows:S,updates:N,globalSkillGroups:R,pluginRows:C,statuslineSource:Ne,onUninstallSkill:je,onUninstallMcp:W,onCycleMcpEnable:fe,onCyclePluginState:uo,onUninstallPlugin:Pi,onOpenFile:X=>{M(X),pe(null)},onOpenSkillDetail:(X,ke,Re,ve,Be)=>{M(null),pe({name:X,scope:ke,source:Re,pluginKey:ve,agent:Be})},projects:t,onOpenSession:Ve,initialSessionId:w??void 0,dragPayload:Z}):o.jsx(sH,{})})]}):o.jsx("div",{className:"flex-1 flex items-center justify-center text-neutral-500 text-sm",children:e("app.selectProject")}),A&&Ot&&o.jsx(kQ,{projectId:Ot.id,relPath:A,global:c,agent:St==null?void 0:St.agent,onClose:()=>M(null)}),ne&&o.jsx(lQ,{projectId:(Ot==null?void 0:Ot.id)??0,name:ne.name,scope:ne.scope,source:ne.source,pluginKey:ne.pluginKey,agent:ne.agent,files:Fn,readOnly:!c&&ne.scope==="user",outdated:(On==null?void 0:On.outdated)??!1,custom:(On==null?void 0:On.custom)??!1,onUninstall:()=>{ee(ne.name,ne.scope,ne.agent),pe(null)},onClose:()=>pe(null)},`${ne.scope}-${ne.name}`)]}),O&&o.jsxs(o.Fragment,{children:[o.jsx(VS,{onResize:X=>He(ke=>Ed(ke-X,QS,JS)),title:e("app.resizeRight")}),o.jsx("aside",{style:{width:Ke},className:"shrink-0 border-l border-white/[0.06] frosted overflow-hidden",children:_u})]})]})]})}),!O&&F!==null&&o.jsxs("div",{className:"fixed inset-0 z-40",children:[o.jsx("button",{"aria-label":e("app.mobileDrawerClose"),onClick:()=>J(null),className:"absolute inset-0 bg-black/60 backdrop-blur-sm drawer-fade"}),o.jsxs("aside",{className:ye("absolute top-0 bottom-0 w-[min(88vw,360px)] bg-neutral-900 border-white/[0.08] shadow-mac flex flex-col",F==="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-white/[0.06] frosted",children:[o.jsx("span",{className:"text-sm font-semibold tracking-tight text-neutral-200",children:e(F==="projects"?"app.mobileProjects":"app.mobileLibrary")}),o.jsx("button",{onClick:()=>J(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"})})]}),F==="projects"?o.jsx("div",{className:"flex-1 overflow-y-auto",children:Rs}):o.jsx("div",{className:"flex-1 overflow-hidden",children:_u})]})]}),o.jsx(EQ,{open:j,onClose:()=>B(!1)}),o.jsx(EY,{})]})}function DQ(){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"})]})}"serviceWorker"in navigator&&window.isSecureContext&&navigator.serviceWorker.register("/sw.js").catch(()=>{});FO.createRoot(document.getElementById("root")).render(o.jsx(In.StrictMode,{children:o.jsx(j4,{children:o.jsx(nL,{children:o.jsx(q4,{children:o.jsx(OQ,{})})})})}));